Name is required.
Email address is required.
Invalid email address
Answer is required.
Exceeding max length of 5KB

Pre-request next HLS segment early


We are working with an adaptive bitrate switching video that is being played back at an increased rate using HTML5. The video comes in from the server in 16 second chunks and as it gets to the end of one segment, it asks for the next. The issue is that with the increased playback speed, there isn't enough time to get that next segment if we wait till the normal time to request it and so playback stops at the end of each segment.

Are there some event callbacks we can tie into and give it a head start?

7 Community Answers

George

JW Player Support Agent  
0 rated :

Hi,

This is an inherent issue with HLS and increased playback speed. The fastest way around this would be to use MP4 sources.

Alan Halls

User  
0 rated :

Thanks George, In looking at your page:
https://www.jwplayer.com/blog/hls-in-html5/
========
The JW Player uses a conservative but accurate calculation to determine the time until a segment is ready for playback after download begins. This is a function of the estimated file size, network latency, network bandwidth and browser performance. The estimated file size is the maximum of either the average segment size thus far or the size as calculated using metadata from the manifest and segment duration. Providing more accurate manifests will help the algorithm settle on the correct level more quickly.



In pseudo-code this looks like :

TimeUntilReady = latency + (fileSize / bandwidth) + (cpuMultiplier * fileSize);

Using this method, the Player calculates the maximum rendition supported such that if we were to perform an upswitch, the timeUntilReady of the new segment is less than the time before playback reaches our minimum allowed forward buffer, including a safety margin. The safety margin is dynamically updated to become more conservative when the network seems unreliable. By using this minimum forward buffer and a safety factor we attempt to eliminate time spent under buffered, while aggressively increasing to the maximum possible quality.
==========

What I need is to adjust the safety margin, or the forward buffer, or the TimeUntilReady, but I don't see any of that in the code, or documentation. While we are using MP4 sources, since we are using adaptive bitrate, it goes through a manifest m3u8 which breaks it up into 16 second .ts files. I am using Wowza as the video server.

George

JW Player Support Agent  
0 rated :

I’ll escalate to engineering for review

Alan Halls

User  
0 rated :

Thanks George :)

George

JW Player Support Agent  
0 rated :

Hello Alan,

The engineering team is considering the feature, looking to implement in Q2 of 2017

alan

User  
0 rated :

I just noticed this was posted, but wasn't sure if this was what they were going to implement as it seems a little early :)
https://support.jwplayer.com/customer/portal/articles/2200669-video-preloading

I don't see any examples to see what the configurable options are if it is.

George

JW Player Support Agent  
0 rated :

Hi,

Preload is a bit different, here’s documentation on that:
https://developer.jwplayer.com/jw-player/docs/developer-guide/customization/configuration-reference/#rendering-and-loading

This question has received the maximum number of answers.