From 9324dec0d64d8d6c4d96b73dea1d8e6234dc016a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0imon=20Brandner?= Date: Sun, 4 Apr 2021 08:50:25 +0200 Subject: [PATCH] Rename audioOnly to videoMuted MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This makes more sense and will match a possible mute events MSC Signed-off-by: Šimon Brandner --- src/components/views/voip/CallView.tsx | 2 +- src/components/views/voip/VideoFeed.tsx | 17 +++++++++++------ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/components/views/voip/CallView.tsx b/src/components/views/voip/CallView.tsx index a2ca914373..8e99437218 100644 --- a/src/components/views/voip/CallView.tsx +++ b/src/components/views/voip/CallView.tsx @@ -614,7 +614,7 @@ export default class CallView extends React.Component { const feeds = this.state.feeds.map((feed, i) => { // Here we check to hide local audio feeds to achieve the same UI/UX // as before. But once again this might be subject to change - if (feed.isAudioOnly() && feed.isLocal()) return; + if (feed.isVideoMuted() && feed.isLocal()) return; return ( { super(props); this.state = { - audioOnly: this.props.feed.isAudioOnly(), + audioMuted: this.props.feed.isAudioMuted(), + videoMuted: this.props.feed.isVideoMuted(), }; } @@ -115,7 +117,10 @@ export default class VideoFeed extends React.Component { } onNewStream = (newStream: MediaStream) => { - this.setState({ audioOnly: this.props.feed.isAudioOnly()}); + this.setState({ + audioMuted: this.props.feed.isAudioMuted(), + videoMuted: this.props.feed.isVideoMuted(), + }); const currentMedia = this.getCurrentMedia(); currentMedia.srcObject = newStream; currentMedia.play(); @@ -132,15 +137,15 @@ export default class VideoFeed extends React.Component { mx_VideoFeed: true, mx_VideoFeed_local: this.props.feed.isLocal(), mx_VideoFeed_remote: !this.props.feed.isLocal(), - mx_VideoFeed_voice: this.state.audioOnly, - mx_VideoFeed_video: !this.state.audioOnly, + mx_VideoFeed_voice: this.state.videoMuted, + mx_VideoFeed_video: !this.state.videoMuted, mx_VideoFeed_mirror: ( this.props.feed.isLocal() && SettingsStore.getValue('VideoView.flipVideoHorizontally') ), }; - if (this.state.audioOnly) { + if (this.state.videoMuted) { const member = this.props.feed.getMember(); const avatarSize = this.props.pipMode ? 76 : 160;