Issue description
When trying to switch an ExoPlayer instance between a Dash and an MP4 stream (or MP4 to Dash) while trying to resume at the same playback position an IndexOutOfBoundsException occurs.
Specifically, calling prepare with resetPosition set to false while changing MediaSource types will cause the exception.
player.prepare(mediaSource, false, true);
Reproduction steps
- Load and begin playing an MP4 stream.
- Try and load a Dash stream, keeping playback position (
player.prepare(mediaSource, false, true);).
- Application crash.
Link to test content
SampleExoPlayerVideoSwitchCrash.zip
To reproduce the steps in the sample app:
- Build and launch the app.
- Tap on either the "Play MP4" or "Play Dash" buttons.
- Once the video starts playing, tap on the other button,
- The application will crash.
Replacing the currently playing MP4 with a new MP4 stream (pressing the "Play MP4" button a second time) switches playback as expected, likewise loading a new Dash stream while a current Dash stream is playing also switches correctly.
Version of ExoPlayer being used
2.9.5
Device(s) and version(s) of Android being used
Google Pixel 3 XL
Issue description
When trying to switch an ExoPlayer instance between a Dash and an MP4 stream (or MP4 to Dash) while trying to resume at the same playback position an IndexOutOfBoundsException occurs.
Specifically, calling prepare with resetPosition set to false while changing MediaSource types will cause the exception.
player.prepare(mediaSource, false, true);Reproduction steps
player.prepare(mediaSource, false, true);).Link to test content
SampleExoPlayerVideoSwitchCrash.zip
To reproduce the steps in the sample app:
Replacing the currently playing MP4 with a new MP4 stream (pressing the "Play MP4" button a second time) switches playback as expected, likewise loading a new Dash stream while a current Dash stream is playing also switches correctly.
Version of ExoPlayer being used
2.9.5
Device(s) and version(s) of Android being used
Google Pixel 3 XL