Add pause-resume live stream catch-up#1571
Open
gabrielMalonso wants to merge 6 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds live-edge aware behavior for live streams. It contains two related, but distinct, opt-in behaviors:
Live stream catch-up after pause/resume
1x.Optional reset to
1xat the live edge1xafter reaching the live edge, because there is no buffered future content to consume.1xback to1xwhen the stream reaches the live edge, even outside the pause/resume catch-up flow.Both behaviors are disabled by default and can be configured from the options page.
Motivation
Live streams behave differently from normal on-demand videos. When watching VOD content, a speed above
1xis stable because the entire timeline is available. On live content, however, speed above1xis usually useful only while there is latency to recover.There are two common cases this PR addresses:
1x, reaches the live edge, and wants playback to return to normal speed instead of staying in an unnecessary accelerated state.The implementation keeps these behaviors explicit and opt-in so existing users keep the current behavior unless they enable the new settings.
User-facing options
This PR adds settings to:
1.5x10sbehind live3sbehind live1xwhen a live stream reaches the live edgeBehavior
Live stream catch-up
1xwhen the temporary catch-up speed was active.Reset speed at live edge
1xback to1xafter reaching the configured live-edge threshold.Implementation notes
movie_player.getProgressState()andgetVideoData().isLivewhen available, because the native mediaseekablerange can overstate YouTube live latency.Validation
npm testnpm run lintnpm run builddist/extension locally and manually tested the live catch-up flow in the browser.