mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-11-06 12:52:26 +00:00
fix(playback): disable timeout for webtorrent-only sources
When a video has no fallback URL (CDN), the playback service now waits indefinitely for peers instead of timing out after 3 seconds. This prevents premature failures for WebTorrent-only content. Ref: `js/services/playbackService.js` Co-authored-by: PR0M3TH3AN <[email protected]>
This commit is contained in:
1 parent
4142478400
commit
32395e16a0
1 file changed
+5
-1
@@ -1187,10 +1187,14 @@ class PlaybackSession extends SimpleEventEmitter {
|
||||
// Try Torrent First
|
||||
if (this.magnetForPlayback) {
|
||||
try {
|
||||
// If we have a fallback URL, use the effective timeout.
|
||||
// Otherwise, we must wait indefinitely for peers because there is no plan B.
|
||||
const torrentTimeout = httpsUrl ? effectiveTimeout : 0;
|
||||
|
||||
// Wrap Torrent attempt in timeout
|
||||
const torrentResult = await withTimeout(
|
||||
attemptTorrentPlayback("preference"),
|
||||
effectiveTimeout,
|
||||
torrentTimeout,
|
||||
"Torrent Playback"
|
||||
);
|
||||
|
||||
|
||||
Reference in new issue
Block a user