
When deselecting the single sample track and later re-selecting this track, the current shortcuts in ProgressiveMediaPeriod don't handle this case correctly and cause assertion failures. In particular, this change fixes 3 issues: 1. When re-selecting the single sample track, we have cleared the SampleQueue and need to reload the sample. The existing shortcut should only be applied to avoid the reload when starting from a non-zero position. 2. When de-selecting the track, ProgressiveMediaPeriod is left in an inconsistent state where the sample queues are empty but loadingFinished is still true. Fix this by resetting loadingFinished to false. 3. When seeking, we avoid reloading the stream if we can keep inside the existing samples. This logic assumes that all remaining samples will continue to be loaded in the queue. This condition isn't true though for single sample tracks that have been de-selected. They appear to support the seek inside the queue (=no seek necessary, always supported), but still require a new load if there is no ongoing one to load the sample. Fix this by checking this implicit assumption (still loading, or loading finished). PiperOrigin-RevId: 642650248
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.