Correct sidebar behaviour when muting local video
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
parent
c7a28491ca
commit
cfaf4b8078
2 changed files with 7 additions and 3 deletions
|
@ -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()}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue