From a775dd178a6333d466906582d7ae2b8f3818cc5a Mon Sep 17 00:00:00 2001 From: Jaya Allamsetty Date: Wed, 13 Mar 2024 17:11:32 -0400 Subject: [PATCH] Revert "fix(conference): Do not remove muted tracks at join time when ssrc-rewriting is enabled." This reverts commit bb17337440d5c67486daa3c5600c1aeee5e856d5. --- conference.js | 22 ++++++++++------------ react/features/base/conference/actions.ts | 18 ++++++++---------- 2 files changed, 18 insertions(+), 22 deletions(-) diff --git a/conference.js b/conference.js index 18fdd38e86d1..96e9dda81b3a 100644 --- a/conference.js +++ b/conference.js @@ -56,7 +56,7 @@ import { getConferenceOptions, sendLocalParticipant } from './react/features/base/conference/functions'; -import { getReplaceParticipant, getSsrcRewritingFeatureFlag } from './react/features/base/config/functions'; +import { getReplaceParticipant } from './react/features/base/config/functions'; import { connect } from './react/features/base/connection/actions.web'; import { checkAndNotifyForNewDevice, @@ -1970,17 +1970,15 @@ export default { APP.store.dispatch(setAudioMuted(audioMuted)); APP.store.dispatch(setVideoMuted(videoMuted)); - if (!getSsrcRewritingFeatureFlag(APP.store.getState())) { - // Remove the tracks from the peerconnection if ssrc-rewriting is not enabled. - for (const track of localTracks) { - // Always add the track on Safari because of a known issue where audio playout doesn't happen - // if the user joins audio and video muted, i.e., if there is no local media capture. - if (audioMuted && track.jitsiTrack?.getType() === MEDIA_TYPE.AUDIO && !browser.isWebKitBased()) { - promises.push(this.useAudioStream(null)); - } - if (videoMuted && track.jitsiTrack?.getType() === MEDIA_TYPE.VIDEO) { - promises.push(this.useVideoStream(null)); - } + // Remove the tracks from the peerconnection. + for (const track of localTracks) { + // Always add the track on Safari because of a known issue where audio playout doesn't happen + // if the user joins audio and video muted, i.e., if there is no local media capture. + if (audioMuted && track.jitsiTrack?.getType() === MEDIA_TYPE.AUDIO && !browser.isWebKitBased()) { + promises.push(this.useAudioStream(null)); + } + if (videoMuted && track.jitsiTrack?.getType() === MEDIA_TYPE.VIDEO) { + promises.push(this.useVideoStream(null)); } } diff --git a/react/features/base/conference/actions.ts b/react/features/base/conference/actions.ts index fd00d148f602..ad54cf60b180 100644 --- a/react/features/base/conference/actions.ts +++ b/react/features/base/conference/actions.ts @@ -4,7 +4,7 @@ import { IReduxState, IStore } from '../../app/types'; import { setIAmVisitor } from '../../visitors/actions'; import { iAmVisitor } from '../../visitors/functions'; import { overwriteConfig } from '../config/actions'; -import { getReplaceParticipant, getSsrcRewritingFeatureFlag } from '../config/functions'; +import { getReplaceParticipant } from '../config/functions'; import { connect, disconnect, hangup } from '../connection/actions'; import { JITSI_CONNECTION_CONFERENCE_KEY } from '../connection/constants'; import { JitsiConferenceEvents, JitsiE2ePingEvents } from '../lib-jitsi-meet'; @@ -177,16 +177,14 @@ function _addConferenceListeners(conference: IJitsiConference, dispatch: IStore[ dispatch(setAudioMuted(audioMuted)); dispatch(setVideoMuted(videoMuted)); - if (getSsrcRewritingFeatureFlag(state)) { - // Remove the tracks from peerconnection as well. - for (const track of localTracks) { - const trackType = track.jitsiTrack.getType(); + // Remove the tracks from peerconnection as well. + for (const track of localTracks) { + const trackType = track.jitsiTrack.getType(); - // Do not remove the audio track on RN. Starting with iOS 15 it will fail to unmute otherwise. - if ((audioMuted && trackType === MEDIA_TYPE.AUDIO && navigator.product !== 'ReactNative') - || (videoMuted && trackType === MEDIA_TYPE.VIDEO)) { - dispatch(replaceLocalTrack(track.jitsiTrack, null, conference)); - } + // Do not remove the audio track on RN. Starting with iOS 15 it will fail to unmute otherwise. + if ((audioMuted && trackType === MEDIA_TYPE.AUDIO && navigator.product !== 'ReactNative') + || (videoMuted && trackType === MEDIA_TYPE.VIDEO)) { + dispatch(replaceLocalTrack(track.jitsiTrack, null, conference)); } } });