Don't call error when connection has been closed on purpose

This commit is contained in:
Nicolas Mowen 2024-06-13 07:31:40 -06:00
parent dfde663b49
commit 6e180d41bf
2 changed files with 8 additions and 2 deletions

View File

@ -328,7 +328,10 @@ function MSEPlayer({
setBufferTimeout(
setTimeout(() => {
if (document.visibilityState === "visible") {
if (
document.visibilityState === "visible" &&
wsRef.current != undefined
) {
onError("stalled");
}
}, 3000),

View File

@ -238,7 +238,10 @@ export default function WebRtcPlayer({
setBufferTimeout(
setTimeout(() => {
if (document.visibilityState === "visible") {
if (
document.visibilityState === "visible" &&
pcRef.current != undefined
) {
onError("stalled");
}
}, 3000),