Skip to content

Stop using playback rate manipulation for buffer management #7602

@tykus160

Description

@tykus160

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:

  1. 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.
  2. 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:

  1. 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.
  2. 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.

Metadata

Metadata

Assignees

Labels

priority: P1Big impact or workaround impractical; resolve before feature releasestatus: archivedArchived and locked; will not be updatedtype: enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions