mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-03-01 18:22:41 -08:00
refactor state and overlay runtime helpers
This commit is contained in:
28
src/core/services/mpv-transport.ts
Normal file
28
src/core/services/mpv-transport.ts
Normal 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;
|
||||
}
|
||||
Reference in New Issue
Block a user