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 ) where durationMs is the video duration retrieved from ExoPlayer#getDuration(). After this call to seekTo we rarely get the onPlayerStateChanged callback from ExoPlayer. We expect to receive an event for STATE_END.
We only observe the event for STATE_BUFFERING but rarely get the STATE_END event. Rarely meaning 1 out of 10 times we get the expected STATE_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)
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 )wheredurationMsis the video duration retrieved fromExoPlayer#getDuration(). After this call toseekTowe rarely get theonPlayerStateChangedcallback from ExoPlayer. We expect to receive an event forSTATE_END.We only observe the event for
STATE_BUFFERINGbut rarely get theSTATE_ENDevent. Rarely meaning 1 out of 10 times we get the expectedSTATE_ENDevent.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
seekTovalue. I.e.,This workaround is allows us to get expected
STATE_ENDEDevent 100% of the time.(CC: @FranciscoRuiz-gpsw)