Add additional audio MIME types - #3387
Closed
ixgate-lpeters wants to merge 1 commit into
Closed
ixgate-lpeters wants to merge 1 commit into
ixgate-lpeters wants to merge 1 commit into
Conversation
Added new audio MIME types 'audio/vnd.wave' and 'audio/x-wav' to the list. Signed-off-by: Lucas Peters <149142920+ixgate-lpeters@users.noreply.github.com>
Member
|
Closing in favour of nextcloud-libraries/nextcloud-viewer#45 Thank you for the pr @ixgate-lpeters :) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
audio/vnd.waveandaudio/x-wavto the list of MIME types handled by the audio viewer.Problem
WAV files are not playable in the Viewer when they are served with a MIME type other than
audio/wav. In practice this affects real-world files quite often, because there are three MIME types in circulation for the same container format:.wavfile in Files → inline player appearsaudio/vnd.wave) in Mail → inline player appearsaudio/x-wav→ inline player appearsOCA.Viewer.mimetypes.filter(m => m.startsWith('audio/'))returns 11 entriesAdds audio/vnd.wave and audio/x-wav to the list of MIME types handled by the audio viewer.
Problem
WAV files are not playable in the Viewer when they are served with a MIME type other than audio/wav. In practice this affects real-world files quite often, because there are three MIME types in circulation for the same container format:
MIME type Status Seen from
audio/vnd.wave IANA-registered (RFC 2361) Thunderbird and other MUAs
audio/wav de-facto standard most modern tooling — already supported
audio/x-wav historic x- prefix older Windows tooling, legacy exports
Only the middle one was registered, so the other two silently fall through.
How I ran into this
A WAV attachment in Nextcloud Mail showed no inline player, while an MP3 in the same position worked fine. Tracing it through:
So the file was perfectly playable, it just never reached the handler.
Changes
Notes
No mimesAliases needed here — all three types refer to the same RIFF/WAVE container, and determines decodability from the actual file contents rather than the declared MIME type. Adding them as regular mimes entries is sufficient.
Test plan