Video Freezing on Firefox

118 views
Skip to first unread message

Juliusz Mandrosz

unread,
Feb 22, 2021, 6:43:35 AM2/22/21
to meetecho-janus
Hi,
I am using a video room plugin. After disabling camera on Firefox, there is a 3 seconds latency until video track is removed completely and also onRemoteStream is called. Because of this latency, when I am shutting off my camera, other participants sees my video frozen for 3 seconds. I've noticed that firefox doesn't seem to notify onmute/onunmute events, so i am implemented different way to remove video tracks, so in my function which is responsible for toggle mute/unmute video, i am creating an offer with removing video, without that there was a infinite freeze. Unfortunately there is still latency between renegotiations, is there any solution to solve this kind of problem?

Lorenzo Miniero

unread,
Feb 22, 2021, 7:55:22 AM2/22/21
to meetecho-janus

Juliusz Mandrosz

unread,
Feb 22, 2021, 9:10:32 AM2/22/21
to meetecho-janus
Thank you for quick response, i've seen that post before and I have already updated Janus to this version, but now i found that this delay was caused by stopping track in prepareWebRTC function: 

if(media.removeVideo || media.replaceVideo) {
if(config.myStream && config.myStream.getVideoTracks() && config.myStream.getVideoTracks().length) {
var vt = config.myStream.getVideoTracks()[0];
Janus.log("Removing video track:", vt);
config.myStream.removeTrack(vt);
try {
//vt.stop();
} catch(e) {}
}, 
I've commented out line responsible for stopping a track and there isn't any delay now, but it caused another problem, because camera LED is still on, even after turning it off.
Message has been deleted

Juliusz Mandrosz

unread,
Feb 22, 2021, 1:41:37 PM2/22/21
to meetecho-janus
i found some workaround for the problem. So instead of stopping a track, I am doing something like this: vt.enabled = false; And it seems to work as expected, no delay after renegotiation and camera LED is turning off. What do you think about this solution?
Reply all
Reply to author
Forward
0 new messages