feat: Add abrSwitchInterval config option - #7669
Merged
robwalch merged 3 commits intoDec 9, 2025
Merged
Conversation
christriants
force-pushed
the
feature/abr-switch-interval
branch
from
December 7, 2025 04:34
be9e1cb to
8867c0f
Compare
robwalch
approved these changes
Dec 9, 2025
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.
This PR will...
Add support for a new config option,
abrSwitchInterval, which allows users to specify a minimum amount of time (in seconds) between automatic ABR-initiated level switches.Why is this Pull Request needed?
Existing ABR configuration options tune bandwidth-estimation sensitivity but do not provide any control over how frequently level switches occur.
abrSwitchIntervalintroduces explicit switch-level throttling. This enables:switchInterval)This gives applications finer control over playback stability while preserving fast and accurate network adaptation.
Are there any points in the code the reviewer needs to double check?
Throttling logic in
level-controller.ts:The cooldown is enforced in set nextLoadLevel() using performance.now() timestamps. Review the time comparison and edge-case handling. Debug logs are included to trace allowed vs. suppressed switches.
Emergency downswitch behavior:
Confirm that emergency downswitches triggered via
AbrController._abandonRulesCheck()still flow throughnextLoadLeveland are throttled (or intentionally exempt, depending on desired behavior).Manual to ABR mode transition:
After switching from manual mode back to ABR mode, confirm the first ABR switch correctly resets or respects
lastABRSwitchTime. Tests cover this partially, but code should be reviewed for any subtle timing interactions.Placement of throttling logic in
level-controller:Throttling is implemented in
nextLoadLevel()rather thanabr-controller. This ensures all ABR-initiated level changes are subject to the cooldown, including emergency downswitches, playlist-driven changes, and any future controllers that updatenextAutoLevel.Resolves issues:
Resolves this feature request: #7385
Checklist