Skip to content

Stall threshold for low latency and handle stuck video #100

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

Open
wants to merge 12 commits into
base: smp-v4.7
Choose a base branch
from

Conversation

ryanmccartney
Copy link

@ryanmccartney ryanmccartney commented Jul 25, 2025

Adds a separate low latency stall threshold, as already in use in Dash.js v5.0.1 #4689.

Without this PR, the stall threshold in low latency mode is fixed at 0. This PR adds a configurable setting that defaults to 0.3s matching the regular stallThreshold value.

This reduces the number of occurrences of buffer underruns on the MSE video source buffer, which can trigger a video freezing bug in chrome versions pre 137.0.7146.0.

The addition of a low latency stall threshold only goes so far in preventing occurrences of video freezing bug above. To combat this, a new setting streaming.buffer.handleVideoFramesNotAdvancing has been added. Enabling it (changing it to a positive integer) uses the Video Quality API on the underlying video element to determine if the number of total frames has stopped advancing. If the criteria for detecting a video freeze are met, then video element time is set to current time, which corrects this issue.

Currently, a warning message is raised every time this issue is believed to have occurred. The number in set enabling handleVideoFramesNotAdvancing indicates the number of consecutive occurrences that should occur before attempting to set current time in an attempt to handle the issue. This is intended to allow the sensitivity of the mechanism to be controlled.

@ryanmccartney ryanmccartney marked this pull request as ready for review July 25, 2025 12:22
@ryanmccartney ryanmccartney changed the title Low latency Stall Threshold Low latency stall threshold Jul 25, 2025
@ryanmccartney ryanmccartney changed the title Low latency stall threshold Stall threshold for low latency and handle stuck video Jul 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant