mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-10-27 16:02:26 +00:00
Reset video element before WebTorrent fallback
This commit is contained in:
1 parent
c6a838ebc2
commit
801bcd2345
1 file changed
+26
@@ -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.";
|
||||
|
||||
Reference in new issue
Block a user