-
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
HLS Live start play from end on window #8218
Comments
I'm assuming "end of it" you means the live-edge (most recent segments). ExoPlayer defaults to the 3 target-durations back from the live edge, this is from the Client Responsibilities section Section 6.3.3 of the spec. So, with your example of 2 min window, assuming 6 second segments, and The origin server may specify the EXT-X-START tag in the playlist if behavior other than the default is desired. If this is not what is happening, then please provide an example URL for triage. |
What @stevemayhew said is one option. If the live stream you are serving is only going to add segments to the media playlist then you can also indicate that the playlist is an "event" type of playlist, using the EXT-X-PLAYLIST-TYPE tag and ExoPlayer will start playback from the start of the playlist. If the playlist is a sliding window (segments are removed from the start of the playlist), then playing from the start increases the likelihood of a BehindLiveWindowException, so please keep that in mind so as to handle it gracefully. There's plenty of material in this issue tracker about BehindLiveWindowException. Passing over to @marcbaechinger to indicate whether there's an API to configure the default start time in the new MediaItem API (without clipping the content, so that we are allowed to seek before the start position of the clip). |
This all nice if I can change server side. But if no? I want to control this on player side. |
Please wait for a response from @marcbaechinger. Until you get an answer, if you are in a hurry, you can inject a playlist parser which wraps the default one and "injects" the custom start time in the playlist, so as to emulate one of the tags described above in your client-side. |
Sorry for my late response. I think with the released version there is currently no option to do that programmatically. We are working on improving HLS live support for low latency. With this there will be the option to set the offset to the live edge also for standard, non-low latency stream. I can not give you a timeline when this will be available in the release branch I'm afraid. |
@AquilesCanta yes. Now I use fixed HlsPlaylistParser to do this. |
We currently also have the desire for this feature. Our use case is for Replaying Live-TV. If a user swaps to a channel, we obviously want to start at the live-edge as is currently the case. But when the user selects the EPG (which is not finished) we want to start at the beginning. Currently we patched In the future, we would also like to be able to start at an arbitrary position, in case the user was watching within that EPG, swaps away and then wants to resume playback where he was, all while that EPG still is in a "Live" state. EPG is interchangable with a HLS Playlist |
Since 2.13 you can build a media item with a
The above media item would make the player use a target offset of 10 minutes behind the live edge. This would allow the to set an arbitrary position. If you know the duration of the live window of your stream you can set it appropriately at the beginning of the live window (possibly with some margin to avoid running into a Would that help in your case? Or are you asking for a constant or something which makes the player figure out the beginning of the live window if the duration of is unknown to you? |
If you want to start at the beginning of the live stream window, you can also specifically call |
The `setLiveTargetOffsetMs()` does exactly what we would want. Careful with
seeking to position 0 in a live playlist, you’ll need to gracefully deal
with `BenindLiveWindowException` in that case
…On Thu, Mar 25, 2021 at 10:27 AM tonihei ***@***.***> wrote:
If you want to start at the beginning of the live stream window, you can
also specifically call player.seekTo(0) (or any other position) before
player.prepare().
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#8218 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AADBF6DAL3626SCJJUS6ZVDTFNXANANCNFSM4TUPZQ4Q>
.
|
@marcbaechinger & @stevemayhew thanks for the insight. It does seem that it's a possible solution to the problem (while It does feel a bit like a workaround though since the live edge can only be approximated by the client application. My current solution with the modified If I understand correctly, in order to inject "configuration" I utilize the May I suggest making some metadata available (e.g. the |
I understand you want to override the start time in the playlist with your wrapper. What information is in your tag and where do you get that information from? The start position which you then replace in the playlist? |
@marcbaechinger it is kind of an edge case but the use case is as follows:
The stored playback position is what I'm adding to the In contrast, if I intercept the playlist, I can override |
I also found some related issues:
|
Something like a method to override the start time in the playlist for a given media item would work for you?
The liveTargetOffset would then be calculated from that start time you are declaring in the media item. |
@marcbaechinger yep, that would be the ideal solution. Pretty similar to what were doing via the tag at the moment. |
This would be nice to have also dor Dash streams. |
@marcbaechinger our use case is more to adapt to networks that cannot maintain adequate buffering with 3 segments back from live. The dynamic live edge support added to 2.13 should cover this use case. |
Closing as duplicate of #9122 |
I have live hls stream with 2 min window. Exoplayer start play from end of it. How to tell exo to play from start? (from first chunk in playlist)
The text was updated successfully, but these errors were encountered: