Files
iptvnator/libs/shared/interfaces/src/lib/external-player-arguments.utils.ts
T
ZoultandClaude Fable 5.1 5a11b82eaf feat(embedded-mpv): configurable extra libmpv options and network auto-reconnect (#1515)
Extra libmpv options (Settings > Playback) reach every embedded engine off the command line (createSession array on Windows/macOS, a 0600 --include file on Linux native-view, a stdin preamble for the frame-copy helper); the keys the embed depends on are refused, and keys libmpv rejects are reported once per session. Dropped streams reload automatically (error, or ended on live) with 2 s -> 30 s backoff, six attempts per outage and a 30 s stability reset, only for a load that already played; engine failures stay terminal, a running recording is filed as interrupted and restarted after the reload, and an external subtitle file is re-added. Settings.embeddedMpvAutoReconnect (default on) opts out; the player shows 'Reconnecting... attempt N of M'.

Started by Bpl5966 in #1515 and finished by the maintainers in the same PR.

Co-authored-by: Bpl5966 <amine.b1959@gmail.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-04 16:36:14 +02:00

26 lines
656 B
TypeScript

export type ExternalPlayerArgumentsInput =
string | readonly unknown[] | null | undefined;
export function parseExternalPlayerArguments(
value: ExternalPlayerArgumentsInput
): string[] {
if (Array.isArray(value)) {
return value.map((argument) => String(argument).trim()).filter(Boolean);
}
if (typeof value !== 'string') {
return [];
}
return value
.split(/\r?\n/)
.map((argument) => argument.trim())
.filter(Boolean);
}
export function normalizeExternalPlayerArguments(
value: ExternalPlayerArgumentsInput
): string {
return parseExternalPlayerArguments(value).join('\n');
}