Skip to content

Failed to receive STATE_END after calling seekTo() to seek to end of video #596

@ptran-gpfw

Description

@ptran-gpfw

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.,

seekTo( durationMs - 1)

This workaround is allows us to get expected STATE_ENDED event 100% of the time.

(CC: @FranciscoRuiz-gpsw)

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions