diff --git a/web/src/components/player/MsePlayer.tsx b/web/src/components/player/MsePlayer.tsx index cb0340ebc..970b20f35 100644 --- a/web/src/components/player/MsePlayer.tsx +++ b/web/src/components/player/MsePlayer.tsx @@ -328,7 +328,10 @@ function MSEPlayer({ setBufferTimeout( setTimeout(() => { - onError("stalled"); + // only error and fallback if player is visible + if (document.visibilityState === "visible") { + onError("stalled"); + } }, 3000), ); } diff --git a/web/src/components/player/WebRTCPlayer.tsx b/web/src/components/player/WebRTCPlayer.tsx index 1e5e209d9..3baf26d19 100644 --- a/web/src/components/player/WebRTCPlayer.tsx +++ b/web/src/components/player/WebRTCPlayer.tsx @@ -238,7 +238,9 @@ export default function WebRtcPlayer({ setBufferTimeout( setTimeout(() => { - onError("stalled"); + if (document.visibilityState === "visible") { + onError("stalled"); + } }, 3000), ); }