From b7d5a5f78f59d1dc836ba426f3909c434a6f12af Mon Sep 17 00:00:00 2001 From: Maxim Devaev Date: Thu, 14 Dec 2023 19:43:51 +0200 Subject: pikvm/pikvm#1084: workaround for NULL unmute event Note: Required a patch from Janus side: - https://github.com/meetecho/janus-gateway/issues/3283 --- web/share/js/kvm/stream_janus.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/web/share/js/kvm/stream_janus.js b/web/share/js/kvm/stream_janus.js index 60090dc5..5a8b4cce 100644 --- a/web/share/js/kvm/stream_janus.js +++ b/web/share/js/kvm/stream_janus.js @@ -220,6 +220,15 @@ export function JanusStreamer(__setActive, __setInactive, __setInfo, __allow_aud }, "onremotestream": function(stream) { + if (stream === null) { + // https://github.com/pikvm/pikvm/issues/1084 + // Этого вообще не должно происходить, но почему-то янусу в unmute + // может прилететь null-эвент. Костыляем, наблюдаем. + __logError("Got invalid onremotestream(null). Restarting Janus..."); + __destroyJanus(); + return; + } + let tracks = stream.getTracks(); __logInfo("Got a remote stream changes:", stream, tracks); -- cgit v1.2.3