Skip to content
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

feat: add a live sync panic mode #6149

Merged
merged 4 commits into from Jan 25, 2024

Conversation

gkatsev
Copy link
Contributor

@gkatsev gkatsev commented Jan 23, 2024

This PR introduces a live sync panic mode (streaming.liveSyncPanicMode) which sets the player into the streaming.liveSyncMinPlaybackRate while we're within the streaming.liveSyncPanicThreshold. This should help reduce the change of subsequent rebuffering events by moving further away from the live edge.

Part 1 of potentially 3 of #6131.

@avelad avelad added type: enhancement New feature or request priority: P3 Useful but not urgent labels Jan 24, 2024
@avelad avelad added this to the v5.0 milestone Jan 24, 2024
Copy link
Collaborator

@avelad avelad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one question, have you tested that this code works well in src=? (e.g. HLS in Safari)
Otherwise, LGTM!

externs/shaka/player.js Show resolved Hide resolved
@gkatsev
Copy link
Contributor Author

gkatsev commented Jan 24, 2024

I did not test this extensively, yet.

@gkatsev
Copy link
Contributor Author

gkatsev commented Jan 24, 2024

Seems to be working. I was thinking that it wasn't kicking in enough and then I realized I needed to convert the threshold into ms.

Also, when playing back live HLS in chrome, it basically always stopped here:

shaka-player/lib/player.js

Lines 5657 to 5661 in 35b8fb1

const currentTime = this.video_.currentTime;
if (currentTime < seekRange.start) {
// Bad stream?
return;
}

But otherwise, seems to be working as expected for DASH and for live hls on safari.

@avelad
Copy link
Collaborator

avelad commented Jan 25, 2024

Seems to be working. I was thinking that it wasn't kicking in enough and then I realized I needed to convert the threshold into ms.

Also, when playing back live HLS in chrome, it basically always stopped here:

shaka-player/lib/player.js

Lines 5657 to 5661 in 35b8fb1

const currentTime = this.video_.currentTime;
if (currentTime < seekRange.start) {
// Bad stream?
return;
}

But otherwise, seems to be working as expected for DASH and for live hls on safari.

For it to work in HLS Live in Chorme you need to useSafariBehaviorForLive = false. I have tried and with this it works correctly.

@avelad avelad merged commit 65981e2 into shaka-project:main Jan 25, 2024
11 of 15 checks passed
@gkatsev
Copy link
Contributor Author

gkatsev commented Jan 25, 2024

For it to work in HLS Live in Chorme you need to useSafariBehaviorForLive = false. I have tried and with this it works correctly.

Ah, Ok, I was missing something 🙂.

Thanks!

@gkatsev gkatsev deleted the live-sync-panic branch January 25, 2024 14:37
@shaka-bot shaka-bot added the status: archived Archived and locked; will not be updated label Mar 25, 2024
@shaka-project shaka-project locked as resolved and limited conversation to collaborators Mar 25, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
priority: P3 Useful but not urgent status: archived Archived and locked; will not be updated type: enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants