Skip to main content

Variable: DEFAULT_RECONNECT_DELAY_MAX_SECONDS

const DEFAULT_RECONNECT_DELAY_MAX_SECONDS: 5 = 5;

Defined in: packages/player/src/player.ts:1474

Default NetworkReconnectOptions.maxDelaySeconds.

FFmpeg's own default is 120, i.e. it would keep retrying for over two minutes (http.c:200, { .i64 = 120 }). That is a sensible default for a download tool and a terrible one for a media session: the player would sit in a silent, uncancellable-looking limbo while the notification still said "playing".

5 is chosen against FFmpeg's actual backoff, which is delay = 1 + 2 * delay starting at 0 and stops once the next delay exceeds this bound — so it means attempts at 0 s, 1 s and 3 s, ~4 s of trying, three chances at a network blip. Long enough to ride out a cell handover, short enough that a genuinely dead source is reported while the user is still looking at the screen — and short enough that PlayerOptions.retry, which runs after this gives up, still gets to act promptly.