refactor state and overlay runtime helpers

This commit is contained in:
2026-02-14 15:06:20 -08:00
parent 3bb02d7d6f
commit d7c7052ac1
14 changed files with 931 additions and 514 deletions

View File

@@ -0,0 +1,28 @@
export function getMpvReconnectDelay(
attempt: number,
hasConnectedOnce: boolean,
): number {
if (hasConnectedOnce) {
if (attempt < 2) {
return 1000;
}
if (attempt < 4) {
return 2000;
}
if (attempt < 7) {
return 5000;
}
return 10000;
}
if (attempt < 2) {
return 200;
}
if (attempt < 4) {
return 500;
}
if (attempt < 6) {
return 1000;
}
return 2000;
}