Skip to content

Stabilize configurable live playback latency#43

Closed
xmarre wants to merge 1 commit into
AngelThump:masterfrom
xmarre:fix/stable-live-playback
Closed

Stabilize configurable live playback latency#43
xmarre wants to merge 1 commit into
AngelThump:masterfrom
xmarre:fix/stable-live-playback

Conversation

@xmarre

@xmarre xmarre commented Jul 11, 2026

Copy link
Copy Markdown

Summary

  • replace the fixed two-segment low-latency target with a persisted stable live delay
  • add Advanced → Stable live delay with a 9–60 second range in 0.5-second steps
  • disable playback-rate catch-up and use buffered live synchronization
  • recover starved playback by restarting HLS loading
  • recover fatal manifest failures with bounded token-refresh and source-reload retries
  • scope the HLS instance to the Player lifecycle and clean up media/fullscreen handlers

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:

  • maintaining a configurable playback delay
  • preventing unwanted jumps toward the live edge
  • adapting reserve requirements to the available stream buffer
  • clamping playback to the active seekable window
  • recovering stalled HLS sessions

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: 2 with lowLatencyMode: 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 manifestLoadError events are explicitly excluded from network recovery, which can leave playback permanently frozen after a transient manifest failure.

Implementation

The player now uses:

  • configurable 9–60 second live delay
  • 12-second default
  • 0.5-second increments
  • liveSyncDuration
  • liveSyncOnStallIncrease: 0
  • maxLiveSyncPlaybackRate: 1
  • liveSyncMode: "buffered"
  • lowLatencyMode: false

The setting persists in local storage. Delay changes reposition playback through liveSyncPosition while 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:

tsc --allowJs --checkJs false --jsx react-jsx --noEmit --noResolve --target ES2022 src/Player.js src/Controls.js

The standalone extension has also been tested against the live AngelThump site and provides a reference implementation for the expected behavior.

A complete production build and live deployment test of the native player patch remains for CI or maintainer verification.
"@

@xmarre xmarre closed this Jul 17, 2026
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