Skip to content

liveTracker.liveCurrentTime() jitters backwards during live playback #9157

Description

@rakeshLogituit

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?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions