From 3cf7582e055f389b79d303cb3616a65f6a43a784 Mon Sep 17 00:00:00 2001 From: WolverinDEV Date: Mon, 19 Apr 2021 14:00:25 +0200 Subject: [PATCH] Some minor video bugfixes --- ChangeLog.md | 4 ++++ shared/js/connection/rtc/video/Connection.ts | 3 ++- shared/js/ui/frames/video/Controller.ts | 11 +++++++++-- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/ChangeLog.md b/ChangeLog.md index 3acde1ac..392719bd 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,4 +1,8 @@ # Changelog: +* **19.04.21** + - Fixed a bug that the client video box is shown as active even though the client does not stream any video + - Fixed a bug that the video fullscreen windows pops open when a client leaves/joins the channel + * **05.04.21** - Fixed the mute but for the webclient - Fixed that "always active" microphone filter now works reliably diff --git a/shared/js/connection/rtc/video/Connection.ts b/shared/js/connection/rtc/video/Connection.ts index 1305551a..d880a06d 100644 --- a/shared/js/connection/rtc/video/Connection.ts +++ b/shared/js/connection/rtc/video/Connection.ts @@ -19,7 +19,7 @@ import {RtpVideoClient} from "./VideoClient"; import {tr} from "tc-shared/i18n/localize"; import {ConnectionState} from "tc-shared/ConnectionHandler"; import {ConnectionStatistics} from "tc-shared/connection/ConnectionBase"; -import * as _ from "lodash"; +import _ from "lodash"; class LocalRtpVideoBroadcast implements LocalVideoBroadcast { private readonly handle: RtpVideoConnection; @@ -543,6 +543,7 @@ 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); } diff --git a/shared/js/ui/frames/video/Controller.ts b/shared/js/ui/frames/video/Controller.ts index c1193248..04f1d9e6 100644 --- a/shared/js/ui/frames/video/Controller.ts +++ b/shared/js/ui/frames/video/Controller.ts @@ -134,6 +134,11 @@ class RemoteClientVideoController implements ClientVideoController { return; } + if(videoClient.getVideoState(type) === VideoBroadcastState.Stopped) { + /* There is no video we could join */ + return; + } + videoClient.joinBroadcast(type).catch(error => { logError(LogCategory.VIDEO, tr("Failed to join video broadcast: %o"), error); /* TODO: Propagate error? */ @@ -399,7 +404,7 @@ class ChannelVideoController { this.events.on("action_toggle_spotlight", event => { this.toggleSpotlight(event.videoIds, event.enabled); - if(!this.isExpended()) { + if(event.expend && !this.isExpended()) { this.events.fire("action_toggle_expended", { expended: true }); } }); @@ -742,7 +747,9 @@ export class ChannelVideoFrame { ReactDOM.render(React.createElement(ChannelVideoRenderer, { handlerId: handle.handlerId, events: this.events }), this.container); - this.events.on("notify_expended", event => this.container.classList.toggle(cssStyle.expended, event.expended)); + this.events.on("notify_expended", event => { + this.container.classList.toggle(cssStyle.expended, event.expended); + }); this.controller.callbackVisibilityChanged = flag => { this.container.classList.toggle(cssStyle.hidden, !flag); if(!flag) {