-
Notifications
You must be signed in to change notification settings - Fork 2.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
Flush backbuffer of lower quality segments for looped video's #4553
Comments
The stream-controller could perform this kind of back-buffer ejection using the fragment tracker to identify buffered content of a lesser quality further back than the currently playing fragment. See |
Clearing the buffer seems to be not enough for this case. This avoids the choppy video start on HLS fMP4 playback. Tested with Chrome 106 & Edge 106. Closes video-dev#4516
Is there a traction on this feature/issue? Any ideas on a rough workaround for the time being? |
Hi @iDVB, You could use a
To avoid interfering with playback wait until currentTime is at least one target duration past the end of the lower quality buffer. If this is specifically for looping, you might wait until playback is close to the end. Note that this does not solve for looping. There is nothing in HLS.js that will reload the first segment as the playhead approaches |
Thanks for those ideas. For us this would be an acceptable trade off. Just not exactly sure what that code looks like or if it would work. It's odd for us, because the loop video looks GREAT on first load and loop, but then we load a different video and then load back that loop and it's that reloading the loop video that seems to start it at first level. |
Sounds like this might be a different issue then. My understanding is that this issue is about loading low quality segments when bandwidth is low, and then never replacing them when bandwidth improves. I think it might be worth opening a new issue where you describe the steps you take when switching videos. |
This seems like a very sought after feature. My current solution of detecting max level and clearing lower level buffer causes a delay in the loop which is not optimized. |
Pinning to v1.6 "Interstitials" milestone. |
Moving to v1.7 milestone. |
Is your feature request related to a problem? Please describe.
This is a feature request based on issue #4315.
For example:
As mentioned by @cjpillsbury,
hls.bufferController.flushBackBuffer()
onHls.Events.LEVEL_SWITCHED
could also flush segments of higher quality.I'm also not sure if buffered segments later on in the video are considered backbuffer. So if we are for example on segment 4. Would it also flush segment 6?
Another thing is that it should wait flushing before the new segment has been buffered. Because when the connection decreases again and the higher quality segment cannot be buffered, we should fall back on the lower quality buffered segment that has already been buffered.
Describe the solution you'd like
An additional Hls option that magickly fixes the mentioned issues 😬
Additional context
No response
The text was updated successfully, but these errors were encountered: