From b7c2ccd8146e259eebd90ab0850e96e2bff682bc Mon Sep 17 00:00:00 2001 From: Jaya Allamsetty <54324652+jallamsetty1@users.noreply.github.com> Date: Mon, 4 Apr 2022 11:19:33 -0400 Subject: [PATCH] fix(conference) Do not add audio track from screenshare to redux. In audio-only screenshare mode when there is no local audio track from mic present, do not add the audio track from screenshare to redux. Adding the track to redux will sync the track mute state to that of /base/media and show that the mic is unmuted even when that is not the case. Fixes https://github.com/jitsi/jitsi-meet/issues/10706. --- conference.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/conference.js b/conference.js index aff1fa42a3..15c3b796e2 100644 --- a/conference.js +++ b/conference.js @@ -1633,7 +1633,8 @@ export default { // In case there was no local audio when screen sharing was started the fact that we set the audio stream to // null will take care of the desktop audio stream cleanup. } else if (this._desktopAudioStream) { - await this.useAudioStream(null); + await room.replaceTrack(this._desktopAudioStream, null); + this._desktopAudioStream.dispose(); this._desktopAudioStream = undefined; } @@ -1976,9 +1977,9 @@ export default { } else { // If no local stream is present ( i.e. no input audio devices) we use the screen share audio // stream as we would use a regular stream. - logger.debug(`_switchToScreenSharing is using ${this._desktopAudioStream} for useAudioStream`); - await this.useAudioStream(this._desktopAudioStream); - + logger.debug(`_switchToScreenSharing is using ${this._desktopAudioStream} for replacing it as` + + ' the only audio track on the conference'); + await room.replaceTrack(null, this._desktopAudioStream); } APP.store.dispatch(setScreenAudioShareState(true)); }