Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
Update muting to work with the js-sdk call upgrade changes
Browse files Browse the repository at this point in the history
Signed-off-by: Šimon Brandner <[email protected]>
  • Loading branch information
SimonBrandner committed Sep 18, 2021
1 parent 9c3439a commit 4ad830e
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/components/views/voip/CallView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,8 @@ export default class CallView extends React.Component<IProps, IState> {
this.setState({
primaryFeed: primary,
secondaryFeeds: secondary,
micMuted: this.props.call.isMicrophoneMuted(),
vidMuted: this.props.call.isLocalVideoMuted(),
});
};

Expand Down Expand Up @@ -258,18 +260,14 @@ export default class CallView extends React.Component<IProps, IState> {
return { primary, secondary };
}

private onMicMuteClick = (): void => {
private onMicMuteClick = async (): Promise<void> => {
const newVal = !this.state.micMuted;

this.props.call.setMicrophoneMuted(newVal);
this.setState({ micMuted: newVal });
this.setState({ micMuted: await this.props.call.setMicrophoneMuted(newVal) });
};

private onVidMuteClick = (): void => {
private onVidMuteClick = async (): Promise<void> => {
const newVal = !this.state.vidMuted;

this.props.call.setLocalVideoMuted(newVal);
this.setState({ vidMuted: newVal });
this.setState({ vidMuted: await this.props.call.setLocalVideoMuted(newVal) });
};

private onScreenshareClick = async (): Promise<void> => {
Expand Down Expand Up @@ -349,6 +347,7 @@ export default class CallView extends React.Component<IProps, IState> {
private renderCallControls(): JSX.Element {
// We don't support call upgrades (yet) so hide the video mute button in voice calls
const vidMuteButtonShown = this.props.call.type === CallType.Video;

// Screensharing is possible, if we can send a second stream and
// identify it using SDPStreamMetadata or if we can replace the already
// existing usermedia track by a screensharing track. We also need to be
Expand Down

0 comments on commit 4ad830e

Please sign in to comment.