Simplify watch-page live timing: rely on hls.js initialization only. #18
Labels
No labels
bug
codex
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
wandabastyle/twitch_relay#18
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Goal:
Remove the custom live-edge / auto-seek timing layer and make hls.js initialization the single source of truth for live latency and buffer behavior.
The desired player behavior:
Important:
Tasks:
In src/app.rs, inside render_stream_page(...), find the embedded JS in the returned raw HTML string.
Look for:
Remove the app-level logic that repeatedly checks live drift and seeks closer to live.
Remove this kind of logic if present:
The player should not have an app-level live timing controller competing with hls.js.
If there is a user-facing Go Live button:
Suggested helper shape if useful:
function seekToLive() {
if (!video) return;
}
Keep this small and adapt it to the existing code style.
Find the existing hls.js initialization. It may currently look similar to:
hlsInstance = new Hls({
startPosition: -4,
lowLatencyMode: true,
liveSyncDurationCount: 1,
liveMaxLatencyDurationCount: 3,
maxLiveSyncPlaybackRate: 1.3,
maxBufferLength: 30,
maxMaxBufferLength: 60
});
Replace it with:
hlsInstance = new Hls({
startPosition: -6,
lowLatencyMode: true,
});
Important:
Near the HLS config, add a concise comment:
// Twitch-like low-latency HLS profile:
// hls.js is the single source of truth for live timing.
// Target roughly 5-7s behind live with enough buffer/retry tolerance
// to avoid stalls on imperfect networks.
Do not change:
Do not break:
Acceptance criteria:
github.com/wandabastyle/twitch_relay@ac7b49b2cd