From a1ce6f1ce5d2feeef04c31f6cf5c3b98360c29a9 Mon Sep 17 00:00:00 2001 From: Hristo Terezov Date: Mon, 9 Oct 2023 15:37:50 -0500 Subject: [PATCH] fed(UI): remove UI.setAudioMuted --- conference.js | 15 +++------------ modules/UI/UI.js | 10 ---------- react/features/base/tracks/middleware.web.ts | 7 ++----- 3 files changed, 5 insertions(+), 27 deletions(-) diff --git a/conference.js b/conference.js index 587aaefe8151..08c0f720412e 100644 --- a/conference.js +++ b/conference.js @@ -636,7 +636,7 @@ export default { // so that the user can try unmute later on and add audio/video // to the conference if (!tracks.find(t => t.isAudioTrack())) { - this.setAudioMuteStatus(true); + this.updateAudioIconEnabled(); } if (!tracks.find(t => t.isVideoTrack())) { @@ -845,7 +845,7 @@ export default { // This will only modify base/media.audio.muted which is then synced // up with the track at the end of local tracks initialization. muteLocalAudio(mute); - this.setAudioMuteStatus(mute); + this.updateAudioIconEnabled(); return; } else if (this.isLocalAudioMuted() === mute) { @@ -1394,7 +1394,7 @@ export default { APP.store.dispatch( replaceLocalTrack(oldTrack, newTrack, room)) .then(() => { - this.setAudioMuteStatus(this.isLocalAudioMuted()); + this.updateAudioIconEnabled(); }) .then(resolve) .catch(reject) @@ -2675,15 +2675,6 @@ export default { APP.UI.setVideoMuted(this.getMyUserId()); }, - /** - * Sets the audio muted status. - * - * @param {boolean} muted - New muted status. - */ - setAudioMuteStatus(muted) { - APP.UI.setAudioMuted(this.getMyUserId(), muted); - }, - /** * Dispatches the passed in feedback for submission. The submitted score * should be a number inclusively between 1 through 5, or -1 for no score. diff --git a/modules/UI/UI.js b/modules/UI/UI.js index 92c4c1cf23e4..7b7d2660b144 100644 --- a/modules/UI/UI.js +++ b/modules/UI/UI.js @@ -203,16 +203,6 @@ UI.toggleFilmstrip = function() { APP.store.dispatch(setFilmstripVisible(!visible)); }; -/** - * Sets muted audio state for participant - */ -UI.setAudioMuted = function(id) { - // FIXME: Maybe this can be removed! - if (APP.conference.isLocalId(id)) { - APP.conference.updateAudioIconEnabled(); - } -}; - /** * Sets muted video state for participant */ diff --git a/react/features/base/tracks/middleware.web.ts b/react/features/base/tracks/middleware.web.ts index cd6b2884eec0..aa7383ba39d0 100644 --- a/react/features/base/tracks/middleware.web.ts +++ b/react/features/base/tracks/middleware.web.ts @@ -75,7 +75,7 @@ MiddlewareRegistry.register(store => next => action => { } else if (isVideoTrack) { APP.conference.setVideoMuteStatus(); } else { - APP.conference.setAudioMuteStatus(!muted); + APP.conference.updateAudioIconEnabled(); } break; @@ -102,7 +102,6 @@ MiddlewareRegistry.register(store => next => action => { } const { jitsiTrack } = action.track; - const muted = jitsiTrack.isMuted(); const participantID = jitsiTrack.getParticipantId(); const isVideoTrack = jitsiTrack.type !== MEDIA_TYPE.AUDIO; @@ -113,9 +112,7 @@ MiddlewareRegistry.register(store => next => action => { APP.UI.setVideoMuted(participantID); } } else if (jitsiTrack.isLocal()) { - APP.conference.setAudioMuteStatus(muted); - } else { - APP.UI.setAudioMuted(participantID, muted); + APP.conference.updateAudioIconEnabled(); } return result;