-
Notifications
You must be signed in to change notification settings - Fork 7.5k
Open
Description
Environment
- Video.js version: 8.23.7
- videojs-http-streaming (VHS) version: 3.17.4
- Browser: Chrome / safari / edge / samsung / lg
- Stream type: HLS / DASH
What's happening
When calling liveTracker.liveCurrentTime() repeatedly during a live stream, the returned value fluctuates and occasionally goes backwards by 2–3 seconds.
Example of values observed over time:
1583
1584
1585
1582 ← goes backwards
1583
1584
This causes issues when calculating the live edge offset (seekableEnd - seekRanges.start(0)), making UI elements like a live indicator or progress bar jump around.
Code
const liveTracker = (player as any)?.liveTracker;
const seekableEnd =
liveTracker?.isLive?.() && liveTracker?.liveCurrentTime?.()
? liveTracker.liveCurrentTime()
: seekRanges.end(0);
// This value jitters 2-3s backwards randomly
const offset = seekableEnd - seekRanges.start(0);Current workaround
I'm using a rolling average + backward-drift guard on the client side to smooth the values, but this feels like it should be handled inside liveTracker itself.
Question
Is this expected behaviour from liveCurrentTime()? Is there a more stable public API to get the live edge without jitter? Or is there a known fix/config option I'm missing?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels