Update muting to work with the js-sdk call upgrade changes

Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
Šimon Brandner 2021-08-05 16:50:03 +02:00
parent 9c3439a1aa
commit a2977f5b17
No known key found for this signature in database
GPG key ID: 55C211A1226CB17D

View file

@ -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(),
});
};
@ -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> => {