fix(multi-stream) only create local ss particpant with multi-stream enabled

This commit is contained in:
William Liang 2022-04-07 11:16:27 -04:00 committed by Jaya Allamsetty
parent 57672ebea8
commit ae6454c59c
1 changed files with 12 additions and 4 deletions

View File

@ -69,15 +69,23 @@ declare var APP: Object;
MiddlewareRegistry.register(store => next => action => { MiddlewareRegistry.register(store => next => action => {
switch (action.type) { switch (action.type) {
case TRACK_ADDED: { case TRACK_ADDED: {
const state = store.getState();
const { jitsiTrack, local } = action.track;
// The devices list needs to be refreshed when no initial video permissions // The devices list needs to be refreshed when no initial video permissions
// were granted and a local video track is added by umuting the video. // were granted and a local video track is added by umuting the video.
if (action.track.local) { if (local) {
store.dispatch(getAvailableDevices()); store.dispatch(getAvailableDevices());
} }
if (getSourceNameSignalingFeatureFlag(store.getState()) // The TRACK_ADDED action is dispatched when a presenter starts a screenshare. Do not create a local fake
&& action.track.jitsiTrack.videoType === VIDEO_TYPE.DESKTOP // screenshare participant when multiple stream is not enabled.
&& !action.track.jitsiTrack.isMuted() const skipCreateFakeScreenShareParticipant = local && !getMultipleVideoSupportFeatureFlag(state);
if (getSourceNameSignalingFeatureFlag(state)
&& jitsiTrack.getVideoType() === VIDEO_TYPE.DESKTOP
&& !jitsiTrack.isMuted()
&& !skipCreateFakeScreenShareParticipant
) { ) {
createFakeScreenShareParticipant(store, action); createFakeScreenShareParticipant(store, action);
} }