UniversalViewer / universalviewer

A community-developed open source project on a mission to help you share your 📚📜📰📽️📻🗿 with the 🌎
http://universalviewer.io
Other
497 stars 191 forks source link

Playing audio/mpeg does not work in uv4. #964

Open Daniel-KM opened 8 months ago

Daniel-KM commented 8 months ago

The format audio/mp4 is working fine: https://iiif.io/api/cookbook/recipe/0002-mvm-audio, but this is not the right media type for mp3, that is audio/mpeg, but it does not work anymore in uv4 (worked in uv3).

v3: https://uv-v3.netlify.app/#?manifest=https://bibnum.explore.psl.eu/files/tmp/mp3.manifest.json v4: https://uv-v4.netlify.app/#?manifest=https://bibnum.explore.psl.eu/files/tmp/mp3.manifest.json

demiankatz commented 8 months ago

@Daniel-KM, I think this may actually indicate a problem with the iiif/vocabulary library used by the UV. You can see here that they define the MP3 mime type as audio/mp3, not audio/mpeg, and that is the value the UV uses to route manifests to extensions. See: https://github.com/IIIF-Commons/vocabulary/blob/master/src/index.ts#L75

I suspect that even though audio/mpeg is the preferred mime type, there are a variety of others in use in the wild. I'm not sure whether the full solution to this problem is to update the iiif/vocabulary, or if we also need to add some alternate values to cover real-world edge cases.

Daniel-KM commented 8 months ago

Ok, this is a regression: Universal Viewer should support any common media-types supported by any common browsers. I fixed it in IIIF-Commons/vocabulary.

demiankatz commented 8 months ago

Thanks, @Daniel-KM! Once that gets merged and a new version is released, it shouldn't be too hard to integrate the fix on the UV side. Please keep us posted (or feel free to open a PR, as you see fit).