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

iOS browsers can't playback audio uploads #11131

Closed
trwnh opened this issue Jun 20, 2019 · 4 comments

Comments

Projects
None yet
3 participants
@trwnh
Copy link
Contributor

commented Jun 20, 2019

https://mastodon.social/@trwnh/102302023193770025

Turns out iOS actually doesn't support anything common other than WAV/AAC/MP3.

Every other browser seems to support much better formats, like Ogg Vorbis/Opus. Technically, iOS Safari does support Opus as a codec, but only in WebRTC -- not in <audio> or <video> elements.

Existing workarounds used on other sites are to do one of the following:

  • Require client apps
  • Use a JS library that transpiles these codecs, such as ogv.js
  • Use <audio>, with Ogg as first choice and MP3 for fallback.
  • Encode as MP4, blank video with AAC audio.

Not sure which is best.

(Also for some reason the extension on uploaded files is .mpga instead of .ogg, even though the mimetype is correctly identified as audio/ogg)

@Gargron

This comment has been minimized.

Copy link
Member

commented Jun 20, 2019

Turns out MP3 is supported on virtually all browsers unlike OGG, so we're just going to convert to MP3 instead. With media attachments, we never keep multiple copies of it to save space, we try to convert to one format that's supported by the most platforms.

@trwnh

This comment has been minimized.

Copy link
Contributor Author

commented Jun 20, 2019

@aka-rin

This comment has been minimized.

Copy link

commented Jun 21, 2019

For personal usage I prefer MP3 for convenience, but Mastodon is a free software ...

So I vote opus with ogv.js as browser fallback. It should work on all browsers that Mastodon supports.

@Gargron

This comment has been minimized.

Copy link
Member

commented Jun 21, 2019

MP3 patent has already expired, I honestly don't see an issue with using it when it's supported natively by all platforms.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.