google / google/ExoPlayer

Seek to initial position in a live stream using absolute time

Open
#9,122 3 comments 0 reactions 1 assignee Claimed by @marcbaechinger View on GitHub
enhancement
Dominant language
Java
Stars
21.9k
Forks
6k
PR merge metrics
No merged PRs in 30d

Description

Let's say ExoPlayer is playing a live stream with a relatively long playlist (e.g. one hour).
The user pauses the playback and leaves it paused for long enough for the device to fall asleep.
Later the device is woken up and the playback is restarted.
What would be desirable is to restart it from the position where it was paused.

It is possible to call prepare, wait for the moment when the timeline is known and then call the seekTo.
However, this seems to inevitably leave some chance that some media will be downloaded before the seek (i.e. for a wrong playback position).

Is there any way to start live playback with the initial position specified as an absolute time (UTC) which avoids downloading media (and initialization) segments for a wrong/default position?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.