From 337664a1b411985504af72a876a64954bfd69bb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0imon=20Brandner?= Date: Wed, 21 Jul 2021 16:34:21 +0200 Subject: [PATCH] Update sidebar behaviour MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Šimon Brandner --- src/components/views/voip/CallView.tsx | 10 ++++++++-- src/components/views/voip/CallViewSidebar.tsx | 11 +++++++---- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/src/components/views/voip/CallView.tsx b/src/components/views/voip/CallView.tsx index e878808c7e..f20341f4a2 100644 --- a/src/components/views/voip/CallView.tsx +++ b/src/components/views/voip/CallView.tsx @@ -588,6 +588,8 @@ export default class CallView extends React.Component { const avatarSize = this.props.pipMode ? 76 : 160; const transfereeCall = CallHandler.sharedInstance().getTransfereeForCallId(this.props.call.callId); const isOnHold = this.state.isLocalOnHold || this.state.isRemoteOnHold; + const isScreensharing = this.props.call.isScreensharing(); + const sidebarShown = this.state.sidebarShown; let contentView: React.ReactNode; let holdTransferContent; @@ -638,11 +640,15 @@ export default class CallView extends React.Component { } let sidebar; - if (!isOnHold && !transfereeCall && !this.props.pipMode && this.state.sidebarShown) { + if ( + (!isOnHold && !transfereeCall && !this.props.pipMode) && + (sidebarShown || isScreensharing) + ) { sidebar = ( ); } @@ -744,7 +750,7 @@ export default class CallView extends React.Component { mx_CallView_presenting_hidden: !this.state.controlsVisible, }); const sharerName = this.state.primaryFeed.getMember().name; - let text = this.props.call.isScreensharing() + let text = isScreensharing ? _t("You are presenting") : _t('%(sharerName)s is presenting', { sharerName }); if (!this.state.sidebarShown) { diff --git a/src/components/views/voip/CallViewSidebar.tsx b/src/components/views/voip/CallViewSidebar.tsx index a8c6eed5a2..c2d1432402 100644 --- a/src/components/views/voip/CallViewSidebar.tsx +++ b/src/components/views/voip/CallViewSidebar.tsx @@ -23,16 +23,19 @@ import { SDPStreamMetadataPurpose } from "matrix-js-sdk/src/webrtc/callEventType interface IProps { feeds: Array; call: MatrixCall; + hideLocalFeeds: boolean; } export default class CallViewSidebar extends React.Component { render() { const feeds = this.props.feeds.map((feed) => { - // Hide local video feed if video is off + // Hide local usermedia feed if video is muted or hide any local feed if we should do so if ( - this.props.call.isLocalVideoMuted() - && feed.isLocal() - && feed.purpose === SDPStreamMetadataPurpose.Usermedia + feed.isLocal() && + ( + (this.props.call.isLocalVideoMuted() && feed.purpose === SDPStreamMetadataPurpose.Usermedia) || + this.props.hideLocalFeeds + ) ) return; return (