Skip to content

IndexOutOfBoundsException switching between progressive and adaptive streams #5520

@Paradam

Description

@Paradam

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

  1. Load and begin playing an MP4 stream.
  2. Try and load a Dash stream, keeping playback position (player.prepare(mediaSource, false, true);).
  3. Application crash.

Link to test content

SampleExoPlayerVideoSwitchCrash.zip

To reproduce the steps in the sample app:

  1. Build and launch the app.
  2. Tap on either the "Play MP4" or "Play Dash" buttons.
  3. Once the video starts playing, tap on the other button,
  4. 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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions