diff --git a/web/src/components/player/MsePlayer.tsx b/web/src/components/player/MsePlayer.tsx index 54b924456..2b9a8d4fb 100644 --- a/web/src/components/player/MsePlayer.tsx +++ b/web/src/components/player/MsePlayer.tsx @@ -328,7 +328,10 @@ function MSEPlayer({ setBufferTimeout( setTimeout(() => { - if (document.visibilityState === "visible") { + if ( + document.visibilityState === "visible" && + wsRef.current != undefined + ) { onError("stalled"); } }, 3000), diff --git a/web/src/components/player/WebRTCPlayer.tsx b/web/src/components/player/WebRTCPlayer.tsx index 3baf26d19..3498c31ff 100644 --- a/web/src/components/player/WebRTCPlayer.tsx +++ b/web/src/components/player/WebRTCPlayer.tsx @@ -238,7 +238,10 @@ export default function WebRtcPlayer({ setBufferTimeout( setTimeout(() => { - if (document.visibilityState === "visible") { + if ( + document.visibilityState === "visible" && + pcRef.current != undefined + ) { onError("stalled"); } }, 3000),