Skip to content

new enhancement (twitch): auto-reload stream on high latency - #1252

Open
BennyyyBB wants to merge 3 commits into
SevenTV:masterfrom
BennyyyBB:auto-stream-refresh
Open

new enhancement (twitch): auto-reload stream on high latency#1252
BennyyyBB wants to merge 3 commits into
SevenTV:masterfrom
BennyyyBB:auto-stream-refresh

Conversation

@BennyyyBB

@BennyyyBB BennyyyBB commented Jul 24, 2026

Copy link
Copy Markdown

Description

Adds an optional setting that automatically reloads the page when the stream's latency to the broadcaster stays above a configurable threshold, or when the player stalls completely without any latency updates at all. (closes issue #1250)

Implementation

  • two new settings under Player: Auto-Reload on high latency (toggle, default off) and a latency threshold slider (default 10s)
  • existing liveLatency property hook (previously owned by PlayerStreamInfo.vue, only active when Video Stats was enabled) was moved to PlayerModule.vue so it always runs, independent of the Video Stats toggle
  • two independent trigger paths:
    • Threshold path: reloads once latency stays above the configured threshold for a 4s grace period (avoids reacting to single spikes)
    • Stall watchdog: a 2s-interval timer that reloads if no liveLatency update has arrived for 8s at all so it covers the case where the player freezes completely and stops reporting latency, which the threshold path alone can't catch
  • both paths share a 30s cooldown, persisted in sessionStorage so it survives the reload itself (prevents reload loops on a genuinely unstable connection)
  • reload is skipped while mediaPlayer.isPaused() is true, to avoid false positives
Screenshot 2026-07-25 012721

Testing

I manually tested using Chrome DevTools Network throttling (Slow 3G) to simulate sustained high latency and full stalls:

  • threshold trigger fires only after sustained latency, not on brief spikes
  • stall watchdog fires when latency updates stop entirely
  • cooldown prevents repeated reloads within 30s, including across an actual page reload
  • no trigger while the toggle is disabled, or while the player is manually paused

(no exponential backoff yet, so on a persistently bad connection, this could reload every 30s indefinitely + slider bounds (3–60s) are open to adjustment)

Types of changes

  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist

  • I have read the CONTRIBUTING doc
  • I have added necessary documentation (if appropriate)
  • Any dependent changes have been merged

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