Thanks for being a part of WWDC25!

How did we do? We’d love to know your thoughts on this year’s conference. Take the survey here

WebM audio playback

Is it possible to play WebM audio on iOS? Either with AVPlayer, AVAudioEngine, or some other API?

Safari has supported this for a few releases now, and I'm wondering if I missed something about how to do this. By default these APIs don't seem to work (nor does ExtAudioFileOpen).

Our usecase is making it possible for iOS users to play back audio recorded in our webapp (desktop versions of Chrome & Firefox only support webm as a destination format for MediaRecorder)

AVPlayer does not support WebM. However, WebKit has implemented its own demuxer for WebM playback and also supports a private entitlement for VP9 decoding.

To play WebM files in a native iOS app, you have a few options: 1. Remux the WebM container to MP4. If you’re using the Opus codec, AVPlayer can handle it in an MP4 container. However, I’m not sure exactly which iOS version introduced support. For example, it doesn’t work on iOS 15, but it does on iOS 17. On older iOS versions, AVPlayer is unable to construct the Opus codec info from the container, even though decoding itself is supported. 2. Write a WebM demuxer (or use FFmpeg), extract the samples, decode them, and play them back using AVAudioEngine or AudioQueue. For decoding, you can use FFmpeg, AVAudioConverter, or AudioConverter.

WebM audio playback
 
 
Q