Skip to content

fix: use correct DM delivery URLs per asset MIME type#832

Open
actinium15 wants to merge 3 commits intoadobe:mainfrom
actinium15:fix/da-assets-dm-delivery-url-routing
Open

fix: use correct DM delivery URLs per asset MIME type#832
actinium15 wants to merge 3 commits intoadobe:mainfrom
actinium15:fix/da-assets-dm-delivery-url-routing

Conversation

@actinium15
Copy link

Summary

  • Documents (PDF, DOCX, CSV, ZIP) now route to /original instead of the web-optimized image delivery URL (/as/{name})
  • Videos route to /play by default
  • Both behaviours are configurable per-project: set aem.asset.document.mimetypes in the project config to a comma-separated list of MIME types that should use /original (overrides the defaults entirely, including for video MIME types if listed)

Routing logic (DM delivery mode)

Asset type URL suffix
MIME type in useOriginalMimetypes /original
video/* (not in above list) /play
Everything else (images, etc.) /as/{name}

Default aem.asset.document.mimetypes

application/pdf
application/vnd.openxmlformats-officedocument.wordprocessingml.document
text/csv
application/zip

Test plan

  • Select a PDF asset — verify URL ends with /original
  • Select a DOCX asset — verify URL ends with /original
  • Select a ZIP asset — verify URL ends with /original
  • Select a video asset — verify URL ends with /play
  • Select an image asset — verify URL ends with /as/{name}
  • Set aem.asset.document.mimetypes to video/mp4 in project config — verify MP4 asset URL ends with /original

Documents (PDF, DOCX, CSV, ZIP) now use /original instead of the
web-optimized image delivery URL. Videos use /play by default.
Both are configurable per-project via 'aem.asset.document.mimetypes'.
@actinium15
Copy link
Author

@sagarsane, @andreas-haller, could you please take a look?

I'm esp interested in knowing if the changes you intended to add via #806 are accounted for or not (they should be imo).

const ASSET_SELECTOR_URL = 'https://experience.adobe.com/solutions/CQ-assets-selectors/static-assets/resources/assets-selectors.js';

// MIME types that use /original rendition instead of web-optimized or /play delivery.
// Configurable per-project via 'aem.asset.document.mimetypes' (comma-separated).

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@auniverseaway @chrischrischris I'm thinking we probably don't need to configure this per project .. and by default only support whatever Dynamic Media OpenAPI supports (which is the list below). WDYT?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should have that config. two reasons:

  • the list isn't comprehensive since assets beyond these four may also require original download (pptx, doc, txt, ...) and DM with OpenAPI does support them
  • videos are interesting, because while /play is ideal, some customers may want to use mediabus to deliver mp4s and may require original there (and this can serve as an override)

- Original rendition: /original/as/{name} (was missing /as/{name})
- Web-optimized: /as/{baseName}.avif, always avif with extension stripped
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants