Skip to content
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

Start HLS live stream with a time offset #9946

Closed
frontyard opened this issue Feb 7, 2022 · 5 comments
Closed

Start HLS live stream with a time offset #9946

frontyard opened this issue Feb 7, 2022 · 5 comments

Comments

@frontyard
Copy link

I have live HLS stream that I want to start with 60 minute delay (start at the point that happened 1 hour ago). Manual rewinding of this stream works using seekTo.

Using media fragments, or adding #t=3600 to the URL works on other platforms that support HLS natively (LG, Samsung), but ExoPlayer seems to be ignoring it.

What is a preferred way of starting a stream with a time offset?

@ojw28
Copy link
Contributor

ojw28 commented Feb 12, 2022

The HLS specification defines a way for the content to specify a desired start time:

The EXT-X-START tag indicates a preferred point at which to start
playing a Playlist.  By default, clients SHOULD start playback at
this point when beginning a playback session.  This tag is OPTIONAL.

If a service providing the HLS playlists wished to support it, they would be able to parse a query parameter such as t=3600 in the URL and use it to insert the correct EXT-X-START tag into the returned playlists. ExoPlayer would then start from the specified time.

I think what you're saying is that t=3600 is interpreted directly by some HLS players, without any involvement from the server. I don't think this is part of the HLS standard (if it is, please point us to the relevant part of the specification so that we can take a look), and this is not something ExoPlayer supports.

If you cannot rely on the server inserting EXT-X-START tags then I think seekTo is probably the right thing to be using, but @christosts or @tonihei may have additional suggestions.

@tonihei
Copy link
Collaborator

tonihei commented Feb 14, 2022

Instead of seekTo, you may prefer to set MediaItem.LiveConfiguration.targetOffsetMs to 3600, which instructs the player to play at a time offset of 3600ms to the live edge.

Aside, not sure if relevant: We also have the open feature request #9122 to seek to an absolute time (e.g., start of program in live stream)

I don't think this is part of the HLS standard

Worth pointing out that anchor timestamps are part of the DASH standard and other players may apply the same logic regardless of the type of the media.

@frontyard
Copy link
Author

frontyard commented Feb 23, 2022

Thank you for the response.

Using EXT-X-START is most likely a no go as it would require generating a custom playlist for each user since not every user might want to start the stream at the same offset. By default the offset needs to be zero as it's a live stream.

I will look into LiveConfiguration and watch #9122 one of which might solve my issue.

@google-oss-bot
Copy link
Collaborator

Hey @frontyard. We need more information to resolve this issue but there hasn't been an update in 14 weekdays. I'm marking the issue as stale and if there are no new updates in the next 7 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!

@google-oss-bot
Copy link
Collaborator

Since there haven't been any recent updates here, I am going to close this issue.

@frontyard if you're still experiencing this problem and want to continue the discussion just leave a comment here and we are happy to re-open this.

@google google locked and limited conversation to collaborators Apr 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants