Skip to content

Defer playlist reload while network is offline #7898

Description

@dloftus

What version of HLS.js are you using?

1.6.15

What browser (including version) are you using?

Chrome version 149.0.7827.53 (Official Build) (arm64)

What OS (including version) are you using?

Mac OS 15.7.2

Test stream

https://test-streams.mux.dev/x36xhzz/x36xhzz.m3u8

Configuration

{
 autoStartLoad: false,
 liveSyncDurationCount: 3,
 maxBufferLength: defaults.maxBufferLength,
 maxMaxBufferLength:  defaults.maxMaxBufferLength,
 manifestLoadingMaxRetry: HlsjsRobustness.MANIFEST_RETRY_ATTEMPTS,
 manifestLoadingRetryDelay: HlsjsRobustness.MANIFEST_RETRY_DELAY,
 levelLoadingRetryDelay: HlsjsRobustness.LEVEL_RETRY_DELAY,
 fragLoadingRetryDelay: HlsjsRobustness.FRAGMENT_RETRY_DELAY,
 capLevelToPlayerSize: true,
 pLoader: this.createLoader(this, RequestObjectType.MANIFEST),
 fLoader: this.createLoader(this, RequestObjectType.SEGMENT),
 loader: this.createLoader(this, RequestObjectType.OTHER),
}

Additional player setup steps

When testing behavior following loss of network connection during playback, we observe:

  • For live streams, a fatal network error always occurs.
  • For VOD streams, depending on presentation size and rendition details, one sees either:
    • A fatal network error, OR
    • Non-fatal errors only

The discrepancy between the 2 VOD streams arises when the player size (presenation size) is less than or equal to the lowest rendition on the ladder. This and the live/VOD discrepancy both appear to stem from the following underlying behavior in hlsjs:

  1. When a frag load error occurs and network.onLine is false (i.e., device is offline), retry is deferred indefinitely until online status flips back to true.

  2. When a playlist load error occurs, and device is offline, retries are not deferred, and once retries are exhausted, a fatal error is emitted.

So for live streams, where manifest requests are continual, a fatal error is always seen, but for VOD, it is conditional.

For example, 2 VOD streams are both played at 640x360; stream A has a ladder that extends down to 320x180, stream B's lowest rendition is 640x360. When the device goes offline, stream A will attempt to switch down to 320x180, and a fatal error ensues. Stream B will not make any switch, and only non-fatal errors will emerge as the buffer eventually plays out.
(Logs attached show this scenario)

Question

Should behavior be adjusted that no fatal errors emerge while "offline = true", or should fatal errors always emerge when network goes offline (perhaps keyed off buffer occupancy rather than load error)?

Checklist

Steps to reproduce

  1. Play the test stream at a size of either 640x360, or at 320 x180
  2. Turn off Wif-Fi or otherwise kill net connection
  3. For both streams, examine the errors that emerge

Expected behaviour

Quesitonable. Should it be that that no fatal errors emerge while "offline = true", or should fatal errors always emerge when network goes offline (but perhaps keyed off buffer occupancy rather than load error)?

What actually happened?

The 320 stream has nowhere to switch to, and will hang with no fatal error; the 640 stream will attempt to downshift and draw an error.

Console output

logs exceed char limit

Chrome media internals output

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    Status
    Top priorities

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions