From 48213e120aee723b7c3b4a7736133bf356589e21 Mon Sep 17 00:00:00 2001 From: WolverinDEV Date: Sun, 25 Apr 2021 11:42:27 +0200 Subject: [PATCH] Fixed a bug that client video disappears on mute --- shared/js/connection/rtc/video/Connection.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shared/js/connection/rtc/video/Connection.ts b/shared/js/connection/rtc/video/Connection.ts index d880a06d..f0419eae 100644 --- a/shared/js/connection/rtc/video/Connection.ts +++ b/shared/js/connection/rtc/video/Connection.ts @@ -371,7 +371,8 @@ export class RtpVideoConnection implements VideoConnection { /* The server stops broadcasting by default, we've to reenable it */ Object.values(this.broadcasts).forEach(broadcast => broadcast.restartBroadcast()); } - } else if(parseInt("scid") === localClient.currentChannel().channelId) { + } else { + /* On a channel switch, every client stops video sharing */ const broadcast = this.registeredClients[clientId]; broadcast?.setBroadcastId("screen", undefined); broadcast?.setBroadcastId("camera", undefined); @@ -543,7 +544,6 @@ export class RtpVideoConnection implements VideoConnection { private handleVideoAssignmentChanged(type: VideoBroadcastType, event: RTCConnectionEvents["notify_video_assignment_changed"]) { const oldClient = Object.values(this.registeredClients).find(client => client.getRtpTrack(type) === event.track); if(oldClient) { - oldClient.setBroadcastId(type, undefined); oldClient.setRtpTrack(type, undefined); }