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

Command icon 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

mandclu created an issue. See original summary.

mandclu’s picture

Status: Active » Needs review

japerry made their first commit to this issue’s fork.

  • japerry committed 56a119fe on 1.0.x authored by mandclu
    Issue #3427196 by mandclu: Can't view videos, PDFs, or documents if the...
japerry’s picture

Status: Needs review » Fixed

Looks good! Made a few minor formatting changes and committed.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.