pikvm/pikvm#1057: web: fixed onremotestream handler for active=false

This commit is contained in:
Maxim Devaev 2023-07-23 22:15:15 +03:00
parent 4f21aae0ce
commit dfa3354978

View File

@ -220,7 +220,8 @@ export function JanusStreamer(__setActive, __setInactive, __setInfo, __allow_aud
}, },
"onremotestream": function(stream) { "onremotestream": function(stream) {
__logInfo("Got a remote stream:", stream); __logInfo("Got a remote stream changes:", stream);
if (stream.active) {
_Janus.attachMediaStream($("stream-video"), stream); _Janus.attachMediaStream($("stream-video"), stream);
__sendKeyRequired(); __sendKeyRequired();
__startInfoInterval(); __startInfoInterval();
@ -233,6 +234,12 @@ export function JanusStreamer(__setActive, __setInactive, __setInfo, __allow_aud
} }
} }
}*/ }*/
} else {
// В каких-то случаях стрим может иметь флаг active=false,
// но при этом янус работает. Хз почему.
// - https://github.com/pikvm/pikvm/issues/1057
__destroyJanus();
}
}, },
"oncleanup": function() { "oncleanup": function() {