pikvm/pikvm#1084: workaround for NULL unmute event

Note: Required a patch from Janus side:
  - https://github.com/meetecho/janus-gateway/issues/3283
This commit is contained in:
Maxim Devaev 2023-12-14 19:43:51 +02:00
parent ff2ed7db39
commit b7d5a5f78f

View File

@ -220,6 +220,15 @@ export function JanusStreamer(__setActive, __setInactive, __setInfo, __allow_aud
}, },
"onremotestream": function(stream) { "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(); let tracks = stream.getTracks();
__logInfo("Got a remote stream changes:", stream, tracks); __logInfo("Got a remote stream changes:", stream, tracks);