Published on May 20, 2024 (about 1 month ago)

Native players for native apps: Mux Player for Android and iOS is GA

Emily Dixon
By Emily Dixon4 min readProduct

Back in December, we announced that we were expanding Mux Player with native libraries for Android and iOS. In our beta announcement, Dylan wrote a little about our philosophy and plans for Mux Player. I’m happy to announce that our beta is over, and Mux Player for Android and iOS is now GA! And some more good news, if you’re a mobile developer, you'll find using the player very familiar 😉

Want to see what I mean? Here’s how you play a Mux Asset using Mux Player on iOS:

swift
let playerViewController = AVPlayerViewController(playbackID: myPlaybackId) addChild(playerViewController) playerViewController.didMove(toParent: self) playerViewController.player?.play()

Here’s how to do it in Android:

kotlin
val player = MuxPlayer.Builder(context).build() playerView.setPlayer(player) val mediaItem = MediaItems.fromMuxPlaybackId(myPlaybackId) player.setMediaItem(mediaItem) player.prepare()

That’s it.

It’s the native players you already know how to use but with added convenience. You get transparent integration with Mux Video and Mux Data, hassle-free caching to speed up your playback experience, and simple APIs for stuff like secure playback and custom domains. Plus it’s almost a drop-in replacement for the players you already know and use.

But you heard about most of that stuff in the beta announcement. We don’t want to repeat a perfectly good blog post any more than we wanted to replace two perfectly good player APIs. Instead, let’s talk a little bit about why to use native players, and why we made them a bit more... Muxy.

LinkSo why make a native player in the first place?

Given Mux Player’s success on the web, we think it’s time to bring our batteries-included Mux-integrated player to native mobile. While it’s true that a web player can be embedded in a native app with a web view, this approach comes with some drawbacks.

Native players have been shown to use less power and system resources than web players overall. In some cases, the difference can be quite dramatic. A 2023 study found a selection of native apps with native players to consume, on average, 35% as much energy as their in-browser counterparts, 33% as much CPU, and 13% as much memory (almost an order of magnitude). This difference is largely due to a lack of overhead for the browser engine, though other factors influenced the final measurements.

Native players are also often much simpler to integrate into a native app than a web player. A web player may work well in cases where a single video is being shown on a static page, like a TV app. Unfortunately, webview-based players may struggle to remain performant in more complex UIs. This can result in rendering issues or the UI dropping frames during animations.

User experiences that involve a lot of scrolling (like TikTok) or compositing animated content over a video (like Instagram Live) are much more straightforward to implement when using a native player. In these situations, a native player can work much more closely with the native renderers. That affords a higher-quality experience for your users, with less headache for you.

Lastly, native players have access to anything inside of the app sandbox. This can enable player features that may be difficult to implement from inside the abstraction of a browser. For example, caching some amount of content to disk will benefit the playback experience of basically any app. Working closely with the hardware also makes it much more straightforward to implement player features that may need some under-the-hood customization, like content security features such as Digital Rights Management (DRM). Native players can even make use of system status APIs to adjust their functionality. For example, Media3 (and Mux Player for Android) is able to pre-tune its adaptive streaming based on information about the connected network.

Link(re-)Introducing Mux Player for mobile

We’re excited to bring Mux Player for mobile to GA. Our 1.0.0 version has simple APIs for playing your Mux assets, a simple on-off API for smart caching to speed up your users’ playback experience, and stats from Mux Data straight out of the box. And 1.0.0 is just the beginning. We have tons more features planned to help you get the most out of Mux Video, and the most out of your video apps.

We’re excited for you to try out our new native Mux Players for iOS and Android. To find out how check out the dev guides for iOS and Android. As always, we’d love your feedback - please reach out with any thoughts or questions. We can’t wait to see your apps using Mux Player!

Written By

Emily Dixon

A career-long mobile developer, Emily has worked in the healthcare, video, and entertainment industries. She loves being outside, and camps whenever she can get away.

Leave your wallet where it is

No credit card required to get started.