Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Asset details page resolution for video files (.mp4) #1090

Open
dominiklaci opened this issue Feb 27, 2024 · 2 comments
Open

Asset details page resolution for video files (.mp4) #1090

dominiklaci opened this issue Feb 27, 2024 · 2 comments

Comments

@dominiklaci
Copy link

dominiklaci commented Feb 27, 2024

Describe the bug
The issue is about asset details page resolution. The asset of type .mp4 was resolved to default details.html page which is not correct and it should be video.html. That happens because of the way how String getAssetTypeFromMimetypeConfiguration(String mimeType) in com.adobe.aem.commons.assetshare.content.properties.impl.AssetTypeImpl is implemented.
Service user "mimetype-service" fetches "/mnt/overlay/dam/gui/content/assets/jcr:content/mimeTypeLookup" and then looks for a subnode matching the file extension. For current data in /libs/dam/gui/content/assets/jcr:content/mimeTypeLookup, "Multimedia" is the match for "video/mp4", i.e. mp4.

I solved this issue by overlaying /libs/dam/gui/content/assets/jcr:content/mimeTypeLookup and adding a new "Video" subnode containing a configuration for MP4. In "Multimedia" node, I removed the entry for "MP4".

Important note: for Resource Merger to work properly, "mimetype-service" must be granted access to the overlaid "/apps/dam" node.

Environment

  • AEM Version: 2023.12.14697.20231215T125030Z-231200
  • Asset Share Commons Version: 3.8.0
  • Author, Publish or both? Both

To Reproduce
Steps to reproduce the behavior:

  1. In Search page properties, configure "Asset Details Page Selector" to "Asset Type"
  2. From search results, open any .mp4 video asset in details page
  3. The system resolves the default "details.html" page as redirect URL

Expected behavior
"video.html" is expected

Screenshots
/libs/dam/gui/content/assets/jcr:content/mimeTypeLookup/Multimedia
Screenshot 2024-02-27 at 16 08 44

Possible fix
Screenshot 2024-02-27 at 16 09 49

"mimetype-service" needs additional read permission on /apps/dam, otherwise the Merger will not work properly
Screenshot 2024-02-27 at 16 10 38

Additional context
Ideally, this resolution should be configurable in OSGi configuration.

@davidjgonzalez
Copy link
Contributor

Have you checked out the newer Content Type asset details selector?

https://opensource.adobe.com/asset-share-commons/pages/search/search-page/#asset-details-page-selector

these are maps that drive it (left is mime/type or prefix type, and right is the content type name (which is turned lowercase with - for spaces in asset details)

https://github.com/adobe/asset-share-commons/blob/main/core/src/main/java/com/adobe/aem/commons/assetshare/content/properties/impl/ContentTypeImpl.java#L67-L99

Unfortunately the original decision to rely on AEM logic for determining this turned out to be a bad decision ... You can use the new Content Type one, or you could make your own selector that you can have full control over; theyre pretty easy to make:

https://github.com/adobe/asset-share-commons/blob/develop/core/src/main/java/com/adobe/aem/commons/assetshare/configuration/impl/selectors/ContentTypeSelectorImpl.java

@davidjgonzalez
Copy link
Contributor

davidjgonzalez commented Mar 13, 2024

There are a few issues logged about this already - if you want to use "asset type" selector, i believe the page name is now
multimedia.html ... it was video at one time, however the AEM API asset type uses changed at some point and is now returning multimedia ...

here's an example: #917

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

No branches or pull requests

2 participants