Why Live HLS Shows Infinity or No Total Duration

A live player may show LIVE, hide its total time or expose Infinity in developer tools. That does not mean you can rewind forever, that the broadcast will never end, or that your browser has downloaded an infinite recording. Total duration, the currently seekable timeline and locally buffered media answer different questions.

For a viewer, the practical question is whether the publisher offers a replay window and whether that window is still available. For a developer, dividing the current position by an unbounded duration is not a useful way to build a live progress bar.

Verification method — October 24, 2026: We ran the exact browser snippet below in headless Chromium 156.0.8078.4 through the project's Playwright installation. Five assertions checked the initial duration, unbounded duration, empty buffer, declared 120–180 second seekable range and empty range after clearing it. The fixture creates an empty MediaSource without adding a SourceBuffer or fetching media. No HLS manifest, decoding, successful playback, server DVR retention, native Safari path, phone or television was tested. General API meanings were checked against MDN. This article does not modify M3U8Online's player controls.

Three timelines, not one progress number

ValueQuestion it helps answerWhat it cannot establish alone
durationWhat duration does the media element currently expose?How far back the publisher retains live segments
seekableWhich timeline ranges does the browser currently report as seekable?That every resource behind those positions will load successfully
bufferedWhich media time ranges are currently buffered?A permanent recording or an offline entitlement

Before media information is available, duration can be NaN. A finite duration can be useful for bounded media. Unbounded media can expose Infinity, but a numeric value by itself is not a universal live-versus-VOD detector across all player engines. An engine may present a finite or changing timeline for a live presentation.

Do not use total duration as a replacement for the live edge or a wall-clock latency measurement. Our live-latency guide explains why even the latest seekable position and the broadcaster's current time are different concepts.

A small experiment that separates the values

Use a disposable blank page in a browser that exposes MediaSource and setLiveSeekableRange. Run this in that page's developer-tools console, not on an unrelated service's page. It temporarily adds an empty video element and cleans it up. It does not play anything or send any request for a stream.

(async () => {
  if (typeof MediaSource === 'undefined') throw new Error('MediaSource unavailable');
  const video = document.createElement('video');
  const source = new MediaSource();
  const objectUrl = URL.createObjectURL(source);
  const initialDuration = String(video.duration);
  document.body.append(video);
  let timer;
  try {
    const opened = new Promise((resolve, reject) => {
      timer = setTimeout(() => reject(new Error('sourceopen timeout')), 10000);
      source.addEventListener('sourceopen', resolve, { once: true });
    });
    video.src = objectUrl;
    await opened;
    clearTimeout(timer);
    source.duration = Infinity;
    source.setLiveSeekableRange(120, 180);
    const deadline = Date.now() + 5000;
    while (video.duration !== Infinity && Date.now() < deadline) {
      await new Promise(resolve => setTimeout(resolve, 20));
    }
    if (video.duration !== Infinity) throw new Error('duration update timeout');
    const result = {
      initialDuration,
      duration: String(video.duration),
      bufferedRanges: video.buffered.length,
      seekable: Array.from({ length: video.seekable.length },
        (_, i) => [video.seekable.start(i), video.seekable.end(i)]),
    };
    source.clearLiveSeekableRange();
    result.seekableRangesAfterClear = video.seekable.length;
    return result;
  } finally {
    clearTimeout(timer);
    video.removeAttribute('src');
    video.load();
    URL.revokeObjectURL(objectUrl);
    video.remove();
  }
})()

Our checked result was:

FieldObserved value
initialDurationString NaN
durationString Infinity
bufferedRanges0
seekable[[120, 180]]
seekableRangesAfterClear0

The strings make the exceptional numeric values readable when serializing the result. They are not the types returned by the original duration property.

The important contrast is an unbounded duration alongside a finite declared seekable interval and no buffered media. The interval exists because our code explicitly set it, not because a server supplied a working DVR window. Clearing it removes that declared interval in this empty fixture; real players with buffered media can produce different ranges. This example is an API demonstration, not a recipe for creating a replay service.

If you just want to rewind a broadcast

Look for the publisher's replay or DVR controls. If the interface offers only Go Live and no usable timeline, an infinite duration is not a hidden promise of unlimited rewind. When a replay window slides forward, an older position may no longer be available even if you watched it earlier.

Try one supported backward seek within the advertised window and note whether the player returns to live, waits or displays an error. Avoid repeatedly reloading: it can discard your current position and does not restore expired media. Use the publisher's recording or on-demand replay when you need the whole event, if one is offered.

For a position that jumps back to live, follow our DVR seeking diagnosis. Increasing playback speed is another operation entirely; the catch-up guide separates faster playback from skipping content.

If you maintain the timeline UI

First distinguish unavailable metadata from unbounded duration. Avoid passing NaN or Infinity to formatting code or a finite progress calculation. A LIVE label can describe the product state without inventing an end time.

When exposing DVR seeking, read fresh seekable ranges rather than caching an old duration. Handle an empty range list before calling start(0) or end(0); those indices are invalid when there are no ranges. Do not assume a single continuous interval if the browser exposes more than one. Preserve the relationship between any displayed relative position and the actual media timeline.

A sliding window needs moving boundaries. If a viewer pauses, the window can move while their intended position stays still. Re-read availability before applying a seek, and provide a clear recovery choice when the old target is gone. If the product offers Go Live, use the playback engine's supported synchronization target instead of assuming that duration is the right seek destination.

Changing the displayed label, assigning a MediaSource duration or declaring a seekable range cannot manufacture media. A complete implementation still needs playlist delivery, retained segments, decoding support and authorized requests. On native HLS paths, do not assume this MSE experiment describes Safari's implementation; validate the actual platform.

What to include in a useful report

Record the browser and playback engine, displayed label, currentTime, raw duration and every seekable and buffered range at the time of failure. State whether playback continued and whether a seek was attempted. If you operate the stream, compare those observations with authorized playlist snapshots and the delivery result for the requested media.

Share sanitized observations, not cookies, tokens or private manifests. “Duration was Infinity, seekable was 120–180, and a request for an older position failed” is more actionable than “the duration is broken.” It still does not identify the cause without the corresponding request and player evidence.

Primary references