Have you read the FAQ and checked for duplicate open issues?
Yes
Is your feature request related to a problem? Please describe.
Currently shaka manipulates playbackRate to control the buffer, i.e. if we think player is starving, we're setting playbackRate to 0 to prevent playback until buffer is fulfilled. Unfortunately, this behavior causes some issues:
- We've noticed that on live streams when we're too close to the live edge, Chrome sometimes entirely freezes the video (while audio continues to play). We have confirmation from our internal tests that disabling manipulating
playbackRate prevents this issue.
- We've seen the issue on PlayStation 5 that at the start video plays, but buffering spinner is visible for a couple of seconds. Turned out PS5 does not support
playbackRate=0 at all.
I know there was already an attempt to stop manipulate playback rate and rely completely on media element events, but it has been reverted due to issues it caused around rebufferingGoal handling.
Describe the solution you'd like
We're thinking about potential solutions and 2 comes to my mind for now:
- Nuclear solution - remove buffer poller, rely entirely on video element events, and deprecate
rebufferingGoal and minBufferTime. It's harsh but relatively easy to implement. I think other JS players are working like that.
- Use
SegmentPrefetch for buffer management - push data only there until rebufferingGoal is reached, when it's ready move this data to SourceBuffers. We could keep our configs then, but implementation can be tricky.
Describe alternatives you've considered
Additional context
In dash.js minBufferTime is used only to calculate presentation delay if there is no suggestedPresentationDelay set.
For a rebufferingGoal equivalent, looking at config there's only initialBufferLevel (defaults to NaN), that is used to wait for enough data in buffer to start playback. I think playback is prevented by not having autoplay attribute in video element and explicitly called play() when buffer is fulfilled.
Previous work in this area:
Are you planning send a PR to add it?
Yes, either me or one of my team mates are happy to work on it, once we agree on what solution is most suitable.
Have you read the FAQ and checked for duplicate open issues?
Yes
Is your feature request related to a problem? Please describe.
Currently shaka manipulates
playbackRateto control the buffer, i.e. if we think player is starving, we're settingplaybackRateto 0 to prevent playback until buffer is fulfilled. Unfortunately, this behavior causes some issues:playbackRateprevents this issue.playbackRate=0at all.I know there was already an attempt to stop manipulate playback rate and rely completely on media element events, but it has been reverted due to issues it caused around
rebufferingGoalhandling.Describe the solution you'd like
We're thinking about potential solutions and 2 comes to my mind for now:
rebufferingGoalandminBufferTime. It's harsh but relatively easy to implement. I think other JS players are working like that.SegmentPrefetchfor buffer management - push data only there untilrebufferingGoalis reached, when it's ready move this data to SourceBuffers. We could keep our configs then, but implementation can be tricky.Describe alternatives you've considered
Additional context
In dash.js
minBufferTimeis used only to calculate presentation delay if there is nosuggestedPresentationDelayset.For a
rebufferingGoalequivalent, looking at config there's onlyinitialBufferLevel(defaults toNaN), that is used to wait for enough data in buffer to start playback. I think playback is prevented by not havingautoplayattribute in video element and explicitly calledplay()when buffer is fulfilled.Previous work in this area:
Are you planning send a PR to add it?
Yes, either me or one of my team mates are happy to work on it, once we agree on what solution is most suitable.