File tree Expand file tree Collapse file tree 2 files changed +9
-29
lines changed
Expand file tree Collapse file tree 2 files changed +9
-29
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " @rocket.chat/ui-voip " : patch
3+ ---
4+
5+ Fixes VoIP widget mute action muting received audio instead of just microphone
Original file line number Diff line number Diff line change @@ -288,35 +288,10 @@ class VoipClient extends Emitter<VoipEvents> {
288288 throw new Error ( 'Peer connection closed.' ) ;
289289 }
290290
291- try {
292- const options : SessionInviteOptions = {
293- requestDelegate : {
294- onAccept : ( ) : void => {
295- this . muted = mute ;
296- this . toggleMediaStreamTracks ( 'sender' , ! this . muted ) ;
297- this . toggleMediaStreamTracks ( 'receiver' , ! this . muted ) ;
298- this . emit ( 'stateChanged' ) ;
299- } ,
300- onReject : ( ) : void => {
301- this . toggleMediaStreamTracks ( 'sender' , ! this . muted ) ;
302- this . toggleMediaStreamTracks ( 'receiver' , ! this . muted ) ;
303- this . emit ( 'muteerror' ) ;
304- } ,
305- } ,
306- } ;
307-
308- await this . session . invite ( options ) ;
309-
310- this . toggleMediaStreamTracks ( 'sender' , ! this . muted ) ;
311- this . toggleMediaStreamTracks ( 'receiver' , ! this . muted ) ;
312- } catch ( error ) {
313- if ( error instanceof RequestPendingError ) {
314- console . error ( `[${ this . session ?. id } ] A mute request is already in progress.` ) ;
315- }
316-
317- this . emit ( 'muteerror' ) ;
318- throw error ;
319- }
291+ const enableTracks = ! mute ;
292+ this . toggleMediaStreamTracks ( 'sender' , enableTracks ) ;
293+ this . muted = mute ;
294+ this . emit ( 'stateChanged' ) ;
320295 } ;
321296
322297 public setHold = async ( hold : boolean ) : Promise < void > => {
You can’t perform that action at this time.
0 commit comments