thelounge / thelounge

💬 ‎ Modern, responsive, cross-platform, self-hosted web IRC client
https://thelounge.chat
MIT License
5.64k stars 685 forks source link

File Uploader: MIME type issue #4429

Open ghost opened 2 years ago

ghost commented 2 years ago

When uploading an ogg file that container opus audio, the MIME type doesn't appear to get set correctly. If the .ogg contains vorbis audio, the mime type appears to be set correctly and the audio embeds.

This ZIP file contains an example of each to test uploading to your own The Lounge: Toss A Coin To Your Witcher (2020).zip (credit to Dan Vasc for this sick cover, btw)

If you upload the [OPUS] file, you will not get an embed in The Lounge. If you load the file directly, you'll notice that the mime type being set is audio/opus, which doesn't appear to be supported by any of the major browsers.

If you upload the [VORBIS] file, you will get an embed in The Lounge. If you load the file directly, you'll notice that the mime type being set is audio/ogg, which is supported by at least Chromium and Firefox (Safari is special).

ghost commented 2 years ago

Tangentially related...but had some more fun testing with FLAC (not uploads, just links; see also: #4210):

While audio/x-flac would seem to be technically correct, in that it's not defined by IANA, MDN says that audio/flac is the standard and that audio/x-flac is non-standard... 😅

Edit: I believe this particular comment (not the Issue itself) will be resolved with #4470.