-
Notifications
You must be signed in to change notification settings - Fork 582
Description
Version
Media3 pre-release (alpha, beta or RC not in this list)
More version details
1.8.0-rc01
Devices that reproduce the issue
- Pixel 2 XL
- Samsung A42,
- Others
Devices that do not reproduce the issue
No response
Reproducible in the demo app?
Yes
Reproduction steps
I create a test inside my fork of media3 because it needs some changes into the compose demo. The idea is to implement the new scrubbing feature of ExoPlayer and try using key-frame if they are available.
I added a Slider to seek when slider value changes and it activate scrubbingMode the first time. When slider finishing we disable scrubbingMode. The player is also configured with SeekParameters.CLOSEST_SYNC
when scrubbing.
Before this feature we also implemented something similar waiting seek end before seek to the next position to fast seek in the content. It was working fine until this version of the player. The player error is exactly the same.
Expected result
The HLS content seeking fast while scrubbing and when scrubbing ends, the playback continues.
Actual result
The playback stop with a player error when we stop scrubbing, some times is doesn't have error, but most of the time it has.
15:14:38.032 E playerFailed [eventTime=2647.10, mediaPos=342.00, window=1, period=1, errorCode=ERROR_CODE_UNSPECIFIED (Ask Gemini)
androidx.media3.exoplayer.ExoPlaybackException: Unexpected runtime error
at androidx.media3.exoplayer.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:910)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:223)
at android.os.HandlerThread.run(HandlerThread.java:67)
Caused by: java.lang.ArrayIndexOutOfBoundsException: length=10; index=-1
at java.util.ArrayList.get(ArrayList.java:439)
at androidx.media3.exoplayer.hls.HlsSampleStreamWrapper.getLastMediaChunk(HlsSampleStreamWrapper.java:1544)
at androidx.media3.exoplayer.hls.HlsSampleStreamWrapper.getNextLoadPositionUs(HlsSampleStreamWrapper.java:759)
at androidx.media3.exoplayer.hls.HlsSampleStreamWrapper.seekInsideBufferUs(HlsSampleStreamWrapper.java:1567)
at androidx.media3.exoplayer.hls.HlsSampleStreamWrapper.seekToUs(HlsSampleStreamWrapper.java:519)
at androidx.media3.exoplayer.hls.HlsSampleStreamWrapper.selectTracks(HlsSampleStreamWrapper.java:464)
at androidx.media3.exoplayer.hls.HlsMediaPeriod.selectTracks(HlsMediaPeriod.java:326)
at androidx.media3.exoplayer.source.MaskingMediaPeriod.selectTracks(MaskingMediaPeriod.java:189)
at androidx.media3.exoplayer.MediaPeriodHolder.applyTrackSelection(MediaPeriodHolder.java:339)
at androidx.media3.exoplayer.ExoPlayerImplInternal.reselectTracksInternal(ExoPlayerImplInternal.java:2235)
at androidx.media3.exoplayer.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:742)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:223)
at android.os.HandlerThread.run(HandlerThread.java:67)
]
The issue happens here, I suspect an race condition issue because it should not have an index=-1 when the list has items.
Media
The HLS media provide in videos.kt
- https://demo.unified-streaming.com/k8s/features/stable/no-handler-origin/tears-of-steel/tears-of-steel-trickplay.m3u8
- https://devstreaming-cdn.apple.com/videos/streaming/examples/img_bipbop_adv_example_fmp4/master.m3u8
Bug Report
- You will email the zip file produced by
adb bugreport
to android-media-github@google.com after filing this issue.