
This change makes sure that the `AdPlaybackState` of any period can contain an empty postroll placeholder. The placeholder postroll should be represented in the `MediaPeriodId` of a content period as `nextAdGroupIndex`, but should be ignored when building the list of `MediaPeriodInfo` in the `MediaPeriodQueue`. This is required to allow to add an ad group to ad playback state of the content period that is currently being played, instantly insert an ad period into the media period queue and immediately transition playback to the new period. This change makes sure and tests that - a live server side inserted postroll placeholder can be inserted to a `AdPlaybackState` in well-defined and tested way (helper method) - a postroll placeholder is NOT ignored when `AdPlaybackState.getAdGroupIndexAfterPositionUs` is called (this is required when evaluating the `nextAdGroupIndex`). - a postroll placeholder is ignored when `AdPlaybackState.getAdGroupIndexForPositionUs` is called (this is required to not attempt to play the ad and is analogous to ignore the post roll placeholder in a single period timeline). - `MediaPeriod.getFollowingMediaPeriodInfo()` does not include a `MediaPeriodInfo` for the placeholder postroll when building the queue. PiperOrigin-RevId: 515079136
ExoPlayer module
This module provides ExoPlayer
, the Player
implementation for local media
playback on Android.
Getting the module
The easiest way to get the module is to add it as a gradle dependency:
implementation 'androidx.media3:media3-exoplayer:1.X.X'
where 1.X.X
is the version, which must match the version of the other media
modules being used.
Alternatively, you can clone this GitHub project and depend on the module locally. Instructions for doing this can be found in the top level README.