Skip to content

Commit

Permalink
fed(UI): remove UI.setAudioMuted
Browse files Browse the repository at this point in the history
  • Loading branch information
hristoterezov committed Oct 11, 2023
1 parent 43a7d00 commit a1ce6f1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 27 deletions.
15 changes: 3 additions & 12 deletions conference.js
Original file line number Diff line number Diff line change
Expand Up @@ -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())) {
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -1394,7 +1394,7 @@ export default {
APP.store.dispatch(
replaceLocalTrack(oldTrack, newTrack, room))
.then(() => {
this.setAudioMuteStatus(this.isLocalAudioMuted());
this.updateAudioIconEnabled();
})
.then(resolve)
.catch(reject)
Expand Down Expand Up @@ -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.
Expand Down
10 changes: 0 additions & 10 deletions modules/UI/UI.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
7 changes: 2 additions & 5 deletions react/features/base/tracks/middleware.web.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ MiddlewareRegistry.register(store => next => action => {
} else if (isVideoTrack) {
APP.conference.setVideoMuteStatus();
} else {
APP.conference.setAudioMuteStatus(!muted);
APP.conference.updateAudioIconEnabled();
}

break;
Expand All @@ -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;

Expand All @@ -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;
Expand Down

0 comments on commit a1ce6f1

Please sign in to comment.