Media3 1.3.0 — What’s new?

Andrew Lewis
AndroidX Media3
Published in
2 min readMar 28, 2024

--

Media3 1.3.0 is now available! Feature highlights include support for image output in ExoPlayer, including handling for DASH thumbnails, some initial low-level APIs for preloading to reduce latency when switching between media items, transmuxing optimizations in Transformer, and many smaller bug fixes and improvements.

As a reminder, the exoplayer2 package is deprecated, and media3 contains the same ExoPlayer functionality and more. Apps wanting to migrate from the exoplayer2 package name should upgrade to ExoPlayer 2.19.1 and then follow the instructions to migrate to Media3 1.1.1, before then upgrading to Media3 1.3.0. In early April we plan to stop pushing the dev-v2 branch in the legacy GitHub project.

In line with other AndroidX libraries, we’ve also increased our minimum API version to 19 in this release for media3 modules that previously required earlier API versions.

To learn more about what’s in this release, check out the full release notes.

Image support and DASH thumbnails

ExoPlayer now supports loading and rendering images to a provided ImageOutput instance, which you can set using ExoPlayer.setImageOutput. For example, when playing a DASH stream with thumbnails the player can load the thumbnail grid image, unpack the individual thumbnails and send them to the provided image output based on the playback position. By default the player will play either video or images. If you’re playing mixed-media content, you can use the track selection parameter setPrioritizeImageOverVideoEnabled to prioritize playing an image track over a video track.

Preloading media with ExoPlayer

Playback startup latency is an important metric for media apps, especially in short-form use cases where users can quickly switch between media items. We are working on new functionality that helps take care of preloading and caching in these scenarios, without competing with loading media for playback. In Media3 1.3.0 we have published the first low-level class in this area: PreloadMediaSource. This API is most suitable for apps that have already implemented a preloading strategy. Stay tuned for future releases where we will expand support with higher-level APIs!

If you want to give PreloadMediaSource a try already we’d be grateful for early feedback on this. You can use it to wrap your existing content MediaSource, then call preload(long) to start loading media into memory at the specified position before adding the source to ExoPlayer. This helps to reduce startup latency when attempting to play the source.

Transformer updates

To learn more about the latest updates on APIs for media creation and editing, see our recent blog post: Trim, Transcode, Concatenate: Your Guide to Media3 Editing Libraries.

This release improves logic for detecting when it’s possible to transmux (avoiding decoding and re-encoding) and adds experimental support for optimizing some clipping operations by transcoding part of the file and transmuxing the rest. Call experimentalSetTrimOptimizationEnabled on the Transformer builder to try this out.

Please get in touch via the Media3 issue Tracker if you run into any bugs, or if you have questions or feature requests. We look forward to hearing from you!

--

--