Correct sidebar behaviour when muting local video

Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
Šimon Brandner 2021-07-20 17:08:17 +02:00
parent c7a28491ca
commit cfaf4b8078
No known key found for this signature in database
GPG key ID: 55C211A1226CB17D
2 changed files with 7 additions and 3 deletions

View file

@ -644,7 +644,6 @@ export default class CallView extends React.Component<IProps, IState> {
<CallViewSidebar
feeds={this.state.secondaryFeeds}
call={this.props.call}
hideFeedsWithMutedVideo={!this.state.primaryFeed || this.state.primaryFeed?.isVideoMuted()}
/>
);
}

View file

@ -18,17 +18,22 @@ import React from "react";
import { MatrixCall } from "matrix-js-sdk/src/webrtc/call";
import { CallFeed } from "matrix-js-sdk/src/webrtc/callFeed";
import VideoFeed from "./VideoFeed";
import { SDPStreamMetadataPurpose } from "matrix-js-sdk/src/webrtc/callEventTypes";
interface IProps {
feeds: Array<CallFeed>;
call: MatrixCall;
hideFeedsWithMutedVideo: boolean;
}
export default class CallViewSidebar extends React.Component<IProps> {
render() {
const feeds = this.props.feeds.map((feed) => {
if (feed.isVideoMuted() && this.props.hideFeedsWithMutedVideo) return;
// Hide local video feed if video is off
if (
this.props.call.isLocalVideoMuted()
&& feed.isLocal()
&& feed.purpose === SDPStreamMetadataPurpose.Usermedia
) return;
return (
<VideoFeed