ExoPlayer 2.13 - What’s new

Ian Baker
AndroidX Media3
Published in
3 min readFeb 5, 2021

ExoPlayer 2.13 contains many new features, improvements and bug fixes. This post highlights some of the most significant changes. As always, we recommend also taking a look at the full release notes.

Transformer API

ExoPlayer 2.13 includes a new Transformer library module for converting media. This API takes an input stream, applies changes to it as configured by the app, and produces the corresponding output file. In this initial version, we focused on the specific use case of converting Samsung slow motion videos to make them suitable for sharing with other apps and for uploading to a server. It is also possible to transmux the input or to remove a track.

Take a look at our in-depth blog post on this topic for more details!

Low-latency live streaming

ExoPlayer now supports the new DASH and HLS low-latency streaming protocols. The player will automatically make use of the low-latency features, if available in the manifest or playlist, without any further configuration needed in the player. To allow catching up to the live edge and to adjust to network conditions, we also built a new playback speed controller into the player that will very slightly change the speed to adjust the live offset if needed.

We’ve written a separate blog post describing the new low-latency live streaming support in more detail, which you can read here.

Ads in playlists

The ExoPlayer IMA extension was previously limited to playing ads with a single piece of media content. The new release removes this limitation, so you can specify an ad tag URI for each media item in a playlist. The implementation will take care of preloading ad tags where possible, giving seamless transitions between media items with ads, just like normal transitions between playlist items.

The easiest way to take advantage of the new functionality is via the MediaItem API. Apps can pass an ad tag URI for each media item in the playlist via MediaItem.Builder.setAdTagUri. An app must also configure DefaultMediaSourceFactory with an AdsLoaderProvider that returns an ImaAdsLoader instance, which will coordinate loading of all the provided ad tags. See the demo app’s PlayerActivity for a sample implementation, and the documentation on ad insertion for full details.

Track selection improvements

Different apps have different requirements for track selection behaviour. ExoPlayer provides a DefaultTrackSelector, customizable via a Parameters object, which we aim to make flexible enough to suit most use cases. In 2.13, DefaultTrackSelector.Parameters adds support for developers to express more complex preferences:

  • For tracks with particular MIME types.
  • For multiple audio and text languages.
  • For tracks with particular audio role flags.

And much more

There’s much more included in 2.13 than just the features detailed above. Other improvements include:

  • Support for playing videos stored in JPEG motion photos.
  • We’ve simplified audio session ID handling. The ID now only changes in response to an explicit call to SimpleExoPlayer.setAudioSessionId. Previously ExoPlayer would automatically change the ID in certain circumstances, making it harder for developers to keep track of the current ID. Removing these automatic changes allows application code to be simpler.
  • We’ve deleted a large number of deprecated symbols, some of which have been deprecated since 2.3.0. This simplifies the API surface of the library and also reduces implementation complexity.

As always, please feel free to get in touch via our issue tracker if you have any questions or encounter problems with the new release. Thanks for reading!

--

--