Stabilize configurable live playback latency#43
Closed
xmarre wants to merge 1 commit into
Closed
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
Background and extension prototype
This change is based on behavior first implemented and tested in the standalone Chrome extension AngelThump Latency Lock.
The extension was created to work around the current player behavior without modifying AngelThump itself. It has been tested against the live site and was used to validate the main ideas in this PR:
This PR moves that behavior directly into the AngelThump player, where the HLS instance is available natively and the implementation can be simpler and more reliable. The extension is not required once the native fix is deployed.
Problem
The current player forces
liveSyncDurationCount: 2withlowLatencyMode: true. With roughly three-second segments this leaves only around six seconds of safety margin, allowing delayed playlist or segment delivery to drain the buffer.Fatal
manifestLoadErrorevents are explicitly excluded from network recovery, which can leave playback permanently frozen after a transient manifest failure.Implementation
The player now uses:
liveSyncDurationliveSyncOnStallIncrease: 0maxLiveSyncPlaybackRate: 1liveSyncMode: "buffered"lowLatencyMode: falseThe setting persists in local storage. Delay changes reposition playback through
liveSyncPositionwhile remaining inside the active seekable window.Starved sessions first restart HLS loading. Continued failure renews the AngelThump token and reloads the source through bounded exponential retries. Manual pauses do not initiate recovery.
Testing
Parsed both modified JSX files successfully with: