IllegalStateException when adding item to the playlist during ad playback
Open
@marcbaechinger is already working on this.
Since Feb 4, 2025.
bug
needs triage
- Dominant language
- Java
- Stars
- 3k
- Forks
- 955
- Avg merge
- 12d 14h
- Merged PRs (30d)
- 2
Description
Version
Media3 1.5.1
More version details
No response
Devices that reproduce the issue
Any device
Devices that do not reproduce the issue
No response
Reproducible in the demo app?
Not tested
Reproduction steps
- Ad
MediaItemwith a pre-roll ad - Observe ad playing
- Attempt to add another
MediaItemusingPlayer.addMediaItem - Observe crash
Expected result
No crash
Actual result
Crash with
java.lang.IllegalStateException
at androidx.media3.common.util.Assertions.checkState(Assertions.java:85)
at androidx.media3.exoplayer.ExoPlayerImpl.maskTimelineAndPosition(ExoPlayerImpl.java:2515)
at androidx.media3.exoplayer.ExoPlayerImpl.addMediaSourcesInternal(ExoPlayerImpl.java:2423)
at androidx.media3.exoplayer.ExoPlayerImpl.addMediaSources(ExoPlayerImpl.java:684)
at androidx.media3.exoplayer.ExoPlayerImpl.addMediaItems(ExoPlayerImpl.java:652)
at androidx.media3.common.BasePlayer.addMediaItems(BasePlayer.java:71)
at androidx.media3.common.BasePlayer.addMediaItem(BasePlayer.java:66)
Media
Any stream with a pre-roll ad
Bug Report
- You will email the zip file produced by
adb bugreportto android-media-github@google.com after filing this issue.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.