Problem/Motivation
I've been working on setting up Drupal integration for drupaldam.org, which has a CDN subdomain of drupal.widen.net. When using this module, images worked as expected, but placing any videos, PDFs, or documents would only show the "preview not available" placeholder.
After some investigation, I was able to determine that the code in EmbedCodeFactory::renderAsset grabs the domain from the configured DAM host, which was causing the embed codes to use drupaldam.widen.net, leading to the failure.
Steps to reproduce
Connect a Drupal site to the drupaldam.org instance (or any other with different host and CDN subdomain) and place a video, PDF, or document.
Proposed resolution
Update EmbedCodeFactory::getCdnDomain to accept $source and $media arguments, and retrieve the CDN host name from the 'original' value.
Issue fork acquia_dam-3427196
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
mandclu commentedComment #6
japerryLooks good! Made a few minor formatting changes and committed.