diff --git a/src/webrtc/groupCall.ts b/src/webrtc/groupCall.ts index 519b2909524..a9794259f1b 100644 --- a/src/webrtc/groupCall.ts +++ b/src/webrtc/groupCall.ts @@ -458,8 +458,16 @@ export class GroupCall extends TypedEventEmitter} Whether muting/unmuting was successful + */ + public async setMicrophoneMuted(muted: boolean): Promise { + // hasAudioDevice can block indefinitely if the window has lost focus, + // and it doesn't make much sense to keep a device from being muted, so + // we always allow muted = true changes to go through + if (!muted && !await this.client.getMediaHandler().hasAudioDevice()) { return false; } @@ -514,10 +522,19 @@ export class GroupCall extends TypedEventEmitter} Whether muting/unmuting was successful + */ + public async setLocalVideoMuted(muted: boolean): Promise { + // hasAudioDevice can block indefinitely if the window has lost focus, + // and it doesn't make much sense to keep a device from being muted, so + // we always allow muted = true changes to go through + if (!muted && !await this.client.getMediaHandler().hasVideoDevice()) { return false; } @@ -533,6 +550,7 @@ export class GroupCall extends TypedEventEmitter