-
Notifications
You must be signed in to change notification settings - Fork 6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Failed to receive STATE_END after calling seekTo() to seek to end of video #596
Comments
Related (kind of) to #490. |
What components are you using to build your player? Specifically, which SampleSource implementation are you using? |
ExtractorSampleSource with Mp4Extractor:
|
I'm investigating an issue where seeking to the end of a stream with ExtractorSampleSource can cause the player to get stuck without transitioning to STATE_ENDED. The extractor immediately signals that the end of the stream has been reached, but the last buffer from the audio decoder contains media that is never played, so the player never sees the end of the stream. This may be specific to MP3. |
It also happens to HLS when the video is actually shorter (or longer) or the m3u file doesn't have TARGETDURATION |
This should be fixed on dev. |
We are implementing a kind of loop feature where if the position is at end of video then user can tap play button and position is restored to 0 and playback re-starts from beginning.
However, there is an issue when we call
seekTo( durationMs )
wheredurationMs
is the video duration retrieved fromExoPlayer#getDuration()
. After this call toseekTo
we rarely get theonPlayerStateChanged
callback from ExoPlayer. We expect to receive an event forSTATE_END
.We only observe the event for
STATE_BUFFERING
but rarely get theSTATE_END
event. Rarely meaning 1 out of 10 times we get the expectedSTATE_END
event.This is an issue for use because we need the STATE_END event to let us know we are at the end at should loop and restart playback from beginning.
Another datapoint: we have a workaround where 1 millisecond is subtracted from the
seekTo
value. I.e.,This workaround is allows us to get expected
STATE_ENDED
event 100% of the time.(CC: @FranciscoRuiz-gpsw)
The text was updated successfully, but these errors were encountered: