Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

fix(conference): Do not remove muted tracks at join time when ssrc-rewriting is enabled.

Jaya Allamsettybb17337440d5
diff --git a/conference.js b/conference.js
index 96e9dda81b..18fdd38e86 100644
--- a/conference.js
+++ b/conference.js
@@ -56,7 +56,7 @@ import {
getConferenceOptions,
sendLocalParticipant
} from './react/features/base/conference/functions';
-import { getReplaceParticipant } from './react/features/base/config/functions';
+import { getReplaceParticipant, getSsrcRewritingFeatureFlag } from './react/features/base/config/functions';
import { connect } from './react/features/base/connection/actions.web';
import {
checkAndNotifyForNewDevice,
@@ -1970,15 +1970,17 @@ export default {
APP.store.dispatch(setAudioMuted(audioMuted));
APP.store.dispatch(setVideoMuted(videoMuted));
- // 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));
+ 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));
+ }
}
}
diff --git a/react/features/base/conference/actions.ts b/react/features/base/conference/actions.ts
index ad54cf60b1..fd00d148f6 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 } from '../config/functions';
+import { getReplaceParticipant, getSsrcRewritingFeatureFlag } 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,14 +177,16 @@ function _addConferenceListeners(conference: IJitsiConference, dispatch: IStore[
dispatch(setAudioMuted(audioMuted));
dispatch(setVideoMuted(videoMuted));
- // Remove the tracks from peerconnection as well.
- for (const track of localTracks) {
- const trackType = track.jitsiTrack.getType();
+ if (getSsrcRewritingFeatureFlag(state)) {
+ // 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));
+ }
}
}
});