ExoPlayer 2.17 — What’s new
ExoPlayer 2.17 is now out! This post highlights some of the most significant changes. As always, we recommend also taking a look at the full release notes.
Server Side Ad Insertion
ExoPlayer 2.17.0 includes support for server-side ad insertion, in which ads (and associated metadata) are inserted into a content stream on the server before it’s loaded by the player. This is in contrast to ExoPlayer’s existing support for client-side ad insertion, in which the player itself inserts ads into a content stream.
The ExoPlayer IMA extension now includes the ImaServerSideAdInsertionMediaSource
which implements support for IMA Dynamic Ad Insertion (DAI) (IMA’s version of server-side ad insertion). See our developer guide for more information on configuring this in your app.
Other implementations of server-side ad insertion can be supported by implementing a custom MediaSource
that works in a similar way to ImaServerSideAdInsertionMediaSource
, with much of the logic delegated to ServerSideAdInsertionMediaSource
. There’s more information in our developer guide.
Preparing for AndroidX Media3
We launched the first alpha version of AndroidX Media3 towards the end of 2021. In the future, Media3 will become the new home for ExoPlayer, along with additional modules for other Android Media use-cases (e.g. media session management). For now we are releasing versions of both ExoPlayer and Media3, with the releases aligned to be equivalent to one another. The ExoPlayer 2.17.0 release aligns with the Media3 1.0.0-alpha02 release. We will publish more information about migrating from ExoPlayer to AndroidX Media3 in future.
In preparation for the launch of the 1.0.0 stable version of Media3, we have been making some API changes that also affect ExoPlayer. Most notably in 2.17.0 we have deprecated the ExoPlayer PlayerView
UI component in favour of the more polished StyledPlayerView
. In Media3 the ExoPlayer PlayerView
class no longer exists, and StyledPlayerView
has been renamed to PlayerView
.
Other notable changes
Playback of HLS content now defaults to ‘chunkless preparation’, while previously this was an opt-in feature. This means playback can start faster, but if your content contains closed-caption tracks muxed into the video container that are not declared in the multivariant (master) playlist, these will not be detected. In this case you can either declare the closed-caption track in the multivariant playlist, or disable chunkless preparation with HlsMediaSource.Factory.setAllowChunklessPreparation(false)
.
ExoPlayer 2.17.0 includes several improvements to the default track selection logic, as well as some related bug fixes. The library now prefers more efficient codecs where possible, and ensures that a hardware decoder can be used for all video tracks selected during adaptive playback. There’s more information in the ‘Track selection’ part of the release notes.
As always, we recommend taking a look at the full release notes. 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!
p.s., we’re hiring!