shaka-project / shaka-player

JavaScript player library / DASH & HLS client / MSE-EME player

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Missing HLS replay functionality

roberto-sartori-gl opened this issue · comments

Have you read the FAQ and checked for duplicate open issues?

Yes

Is your feature request related to a problem? Please describe.

Watching live tracks using HLS (m3u8) sources, it is not possible to go back in time.
Sorry if I'm not technical on this.

Let's take a DASH stream: based on the manifest, it is possible to go back from the 'live' up to a defined moment in the past. For example, I have live streams which allow me to go back up to 2 hours compared to the 'live'. This is working as expected with Shaka.

The same, however, is not working using HLS stream: there is no way to go back even if the manifest allows it.

Describe the solution you'd like

It should be possible to go back (and forward if we already did go back) in the track timeline.

Describe alternatives you've considered

I know that it works with other players.

Additional context

Example of m3u8 available in Spain:
https://directes-tv-es.ccma.cat/live-origin/tvc-hls/bitrate_3.m3u8

Using the shaka-player demo, only the live track is visible.

Using for example the JWPlayer demo, it is possible to go back up to 2 hours from the live.

Sorry it I used the wrong words here, I don't know how this is defined in the HLS standard but hopefully with the m3u8 link above and the JWPlayer demo you can understand what I mean.

This is already possible through configuration.

Shaka has a parameter called the "availability window", which is how long segments are available to be fetched from the server. DASH has explicit signaling for this, but HLS does not.

By default, Shaka mimics Apple's native HLS, which does not permit seeking, by setting the availability window to something very small.

You can configure Shaka's availability window explicitly with something like:

player.configure('manifest.availabilityWindowOverride', 300 /* seconds */);

See also https://shaka-player-demo.appspot.com/docs/api/shaka.extern.html#.ManifestConfiguration

Does this answer your question?

@joeyparrish thank you, this seems to work really well!

Sorry that I was not able to find the option by myself :)

One last question: as I cannot determine in advance the proper 'availabilityWindow', is there any downside to (let's say) set a very large window?

I'm asking because I have streams with no window (no 'replay' at all), and streams with 4 hours window. If HLS does not provide thgis information, I was thinking to just set a very large (12 hours or something) window.

In the tests I just did, it seems to work: I get only the live option when no replay is available, and the correct amount of minutes when there is the option (I set 12 hours, but the player only reports 4 hours available, as it should - the provider for this stream allows to go back up to 4 hours).

edit: actually, I could set useSafariBehaviorForLive to false to solve all of this.
I don't plan to use/support Safari, so this should be a safe option.

One last question: as I cannot determine in advance the proper 'availabilityWindow', is there any downside to (let's say) set a very large window?

The UI may show times that can't be accessed, but otherwise it shouldn't be an issue.

I could set useSafariBehaviorForLive to false to solve all of this.

Yes, I forgot about that option.

I don't plan to use/support Safari, so this should be a safe option.

It doesn't have anything to do with supporting Safari, but with recreating the behavior of Safari in Shaka. Sorry for the confusion!

Perfect then, thank you for the answers!
I will just keep useSafariBehaviorForLive to false.

We can close this!