Reset video element before WebTorrent fallback

This commit is contained in:
thePR0M3TH3AN committed 2025-09-27 13:05:27 -04:00
1 parent c6a838ebc2
commit 801bcd2345
1 file changed
+26
+26
View File
@@ -4834,6 +4834,32 @@ class bitvidApp {
fallbackStarted = true;
this.cleanupUrlPlaybackWatchdog();
cleanupHostedUrlStatusListeners();
if (videoEl) {
try {
videoEl.pause();
} catch (err) {
this.log(
"[playVideoWithFallback] Ignoring pause error before torrent fallback:",
err
);
}
try {
videoEl.removeAttribute("src");
} catch (err) {
// removeAttribute throws in old browsers when the attribute does not exist
}
videoEl.src = "";
videoEl.srcObject = null;
try {
videoEl.load();
} catch (err) {
this.log(
"[playVideoWithFallback] Ignoring load error before torrent fallback:",
err
);
}
}
if (!magnetForPlayback) {
const message =
"Hosted playback failed and no magnet fallback is available.";