mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-10-27 07:52:24 +00:00
feat(playback): add configurable timeout for initial playback start
Introduces a race condition between the primary playback source (URL or Torrent) and a configurable timeout. If the primary source fails to reach the 'playing' state within the timeout window, the system automatically falls back to the alternative source. - Adds `DEFAULT_PLAYBACK_START_TIMEOUT` to instance config (3000ms). - Updates `PlaybackService` to implement timeout logic using `withTimeout` wrapper. - Ensures proper cleanup of stalled attempts (resetting video element, destroying torrent client).
This commit is contained in:
1 parent
e795c74a8e
commit
7921ab6a2e
4 files changed
+87
-7
No files matched your search
@@ -42,6 +42,7 @@ import {
|
||||
VIEW_COUNT_CACHE_TTL_MS,
|
||||
ENSURE_PRESENCE_REBROADCAST_COOLDOWN_SECONDS,
|
||||
DEFAULT_PLAYBACK_SOURCE,
|
||||
DEFAULT_PLAYBACK_START_TIMEOUT,
|
||||
} from "../config/instance-config.js";
|
||||
|
||||
export const WATCH_HISTORY_VERSION_TAG_VALUE = "2";
|
||||
@@ -135,3 +136,4 @@ export { VIEW_COUNT_BACKFILL_MAX_DAYS };
|
||||
export { VIEW_COUNT_CACHE_TTL_MS };
|
||||
export { ENSURE_PRESENCE_REBROADCAST_COOLDOWN_SECONDS };
|
||||
export { DEFAULT_PLAYBACK_SOURCE };
|
||||
export { DEFAULT_PLAYBACK_START_TIMEOUT };
|
||||
Reference in new issue
Block a user