mirror of
https://gitcode.com/GitHub_Trending/ji/jitsi-meet.git
synced 2025-12-30 03:12:29 +00:00
fix: Make multi-stream mode the default mode.
Since plan-b mode will no longer be supported, check for unified plan support is not needed anymore.
This commit is contained in:
committed by
Jaya Allamsetty
parent
06f434e924
commit
9ae5677c00
@@ -6,8 +6,6 @@ import { safeJsonParse } from '@jitsi/js-utils/json';
|
||||
import _ from 'lodash';
|
||||
|
||||
import { IReduxState } from '../../app/types';
|
||||
import { browser } from '../lib-jitsi-meet';
|
||||
import { IMediaState } from '../media/reducer';
|
||||
import { parseURLParams } from '../util/parseURLParams';
|
||||
|
||||
import { IConfig } from './configType';
|
||||
@@ -60,16 +58,6 @@ export function getMeetingRegion(state: IReduxState) {
|
||||
return state['features/base/config']?.deploymentInfo?.region || '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Selector for determining if sending multiple stream support is enabled.
|
||||
*
|
||||
* @param {Object} _state - The global state.
|
||||
* @returns {boolean}
|
||||
*/
|
||||
export function getMultipleVideoSendingSupportFeatureFlag(_state: IReduxState | IMediaState) {
|
||||
return browser.supportsUnifiedPlan();
|
||||
}
|
||||
|
||||
/**
|
||||
* Selector used to get the SSRC-rewriting feature flag.
|
||||
*
|
||||
|
||||
@@ -17,7 +17,6 @@ import { SET_AUDIO_ONLY } from '../audio-only/actionTypes';
|
||||
import { setAudioOnly } from '../audio-only/actions';
|
||||
import { SET_ROOM } from '../conference/actionTypes';
|
||||
import { isRoomValid } from '../conference/functions';
|
||||
import { getMultipleVideoSendingSupportFeatureFlag } from '../config/functions.any';
|
||||
import { getLocalParticipant } from '../participants/functions';
|
||||
import MiddlewareRegistry from '../redux/MiddlewareRegistry';
|
||||
import { getPropertyValue } from '../settings/functions.any';
|
||||
@@ -186,17 +185,14 @@ function _appStateChanged({ dispatch, getState }: IStore, next: Function, action
|
||||
* @private
|
||||
* @returns {Object} The value returned by {@code next(action)}.
|
||||
*/
|
||||
function _setAudioOnly({ dispatch, getState }: IStore, next: Function, action: AnyAction) {
|
||||
function _setAudioOnly({ dispatch }: IStore, next: Function, action: AnyAction) {
|
||||
const { audioOnly } = action;
|
||||
const state = getState();
|
||||
|
||||
sendAnalytics(createTrackMutedEvent('video', 'audio-only mode', audioOnly));
|
||||
|
||||
// Make sure we mute both the desktop and video tracks.
|
||||
dispatch(setVideoMuted(audioOnly, VIDEO_MUTISM_AUTHORITY.AUDIO_ONLY));
|
||||
if (getMultipleVideoSendingSupportFeatureFlag(state)) {
|
||||
dispatch(setScreenshareMuted(audioOnly, SCREENSHARE_MUTISM_AUTHORITY.AUDIO_ONLY));
|
||||
}
|
||||
dispatch(setScreenshareMuted(audioOnly, SCREENSHARE_MUTISM_AUTHORITY.AUDIO_ONLY));
|
||||
|
||||
return next(action);
|
||||
}
|
||||
|
||||
@@ -2,10 +2,7 @@ import _ from 'lodash';
|
||||
|
||||
import { IStore } from '../../app/types';
|
||||
import { getCurrentConference } from '../conference/functions';
|
||||
import {
|
||||
getMultipleVideoSendingSupportFeatureFlag,
|
||||
getSsrcRewritingFeatureFlag
|
||||
} from '../config/functions.any';
|
||||
import { getSsrcRewritingFeatureFlag } from '../config/functions.any';
|
||||
import { VIDEO_TYPE } from '../media/constants';
|
||||
import StateListenerRegistry from '../redux/StateListenerRegistry';
|
||||
|
||||
@@ -92,16 +89,14 @@ function _updateScreenshareParticipants(store: IStore): void {
|
||||
return acc;
|
||||
}, []);
|
||||
|
||||
if (getMultipleVideoSendingSupportFeatureFlag(state)) {
|
||||
if (!localScreenShare && newLocalSceenshareSourceName) {
|
||||
dispatch(createVirtualScreenshareParticipant(newLocalSceenshareSourceName, true, conference));
|
||||
}
|
||||
if (!localScreenShare && newLocalSceenshareSourceName) {
|
||||
dispatch(createVirtualScreenshareParticipant(newLocalSceenshareSourceName, true, conference));
|
||||
}
|
||||
|
||||
if (localScreenShare && !newLocalSceenshareSourceName) {
|
||||
dispatch(participantLeft(localScreenShare.id, conference, {
|
||||
fakeParticipant: FakeParticipant.LocalScreenShare
|
||||
}));
|
||||
}
|
||||
if (localScreenShare && !newLocalSceenshareSourceName) {
|
||||
dispatch(participantLeft(localScreenShare.id, conference, {
|
||||
fakeParticipant: FakeParticipant.LocalScreenShare
|
||||
}));
|
||||
}
|
||||
|
||||
if (getSsrcRewritingFeatureFlag(state)) {
|
||||
|
||||
@@ -5,7 +5,6 @@ import { showErrorNotification, showNotification } from '../../notifications/act
|
||||
import { NOTIFICATION_TIMEOUT, NOTIFICATION_TIMEOUT_TYPE } from '../../notifications/constants';
|
||||
import { getCurrentConference } from '../conference/functions';
|
||||
import { IJitsiConference } from '../conference/reducer';
|
||||
import { getMultipleVideoSendingSupportFeatureFlag } from '../config/functions.any';
|
||||
import { JitsiTrackErrors, JitsiTrackEvents } from '../lib-jitsi-meet';
|
||||
import { createLocalTrack } from '../lib-jitsi-meet/functions.any';
|
||||
import { setAudioMuted, setScreenshareMuted, setVideoMuted } from '../media/actions';
|
||||
@@ -59,8 +58,7 @@ export function addLocalTrack(newTrack: any) {
|
||||
}
|
||||
|
||||
const setMuted = newTrack.isVideoTrack()
|
||||
? getMultipleVideoSendingSupportFeatureFlag(getState())
|
||||
&& newTrack.getVideoType() === VIDEO_TYPE.DESKTOP
|
||||
? newTrack.getVideoType() === VIDEO_TYPE.DESKTOP
|
||||
? setScreenshareMuted
|
||||
: setVideoMuted
|
||||
: setAudioMuted;
|
||||
@@ -337,7 +335,7 @@ export function replaceLocalTrack(oldTrack: any, newTrack: any, conference?: IJi
|
||||
* @returns {Function}
|
||||
*/
|
||||
function replaceStoredTracks(oldTrack: any, newTrack: any) {
|
||||
return async (dispatch: IStore['dispatch'], getState: IStore['getState']) => {
|
||||
return async (dispatch: IStore['dispatch']) => {
|
||||
// We call dispose after doing the replace because dispose will
|
||||
// try and do a new o/a after the track removes itself. Doing it
|
||||
// after means the JitsiLocalTrack.conference is already
|
||||
@@ -353,8 +351,7 @@ function replaceStoredTracks(oldTrack: any, newTrack: any) {
|
||||
// state. If this is not done, the current mute state of the app will be reflected on the track,
|
||||
// not vice-versa.
|
||||
const setMuted = newTrack.isVideoTrack()
|
||||
? getMultipleVideoSendingSupportFeatureFlag(getState())
|
||||
&& newTrack.getVideoType() === VIDEO_TYPE.DESKTOP
|
||||
? newTrack.getVideoType() === VIDEO_TYPE.DESKTOP
|
||||
? setScreenshareMuted
|
||||
: setVideoMuted
|
||||
: setAudioMuted;
|
||||
@@ -388,8 +385,7 @@ export function trackAdded(track: any) {
|
||||
JitsiTrackEvents.TRACK_OWNER_CHANGED,
|
||||
(owner: string) => dispatch(trackOwnerChanged(track, owner)));
|
||||
const local = track.isLocal();
|
||||
const isVirtualScreenshareParticipantCreated = !local || getMultipleVideoSendingSupportFeatureFlag(getState());
|
||||
const mediaType = track.getVideoType() === VIDEO_TYPE.DESKTOP && isVirtualScreenshareParticipantCreated
|
||||
const mediaType = track.getVideoType() === VIDEO_TYPE.DESKTOP
|
||||
? MEDIA_TYPE.SCREENSHARE
|
||||
: track.getType();
|
||||
let isReceivingData, noDataFromSourceNotificationInfo, participantId;
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
import { IReduxState, IStore } from '../../app/types';
|
||||
import {
|
||||
getMultipleVideoSendingSupportFeatureFlag
|
||||
} from '../config/functions.any';
|
||||
import { JitsiTrackErrors, browser } from '../lib-jitsi-meet';
|
||||
import { gumPending } from '../media/actions';
|
||||
import { CAMERA_FACING_MODE, MEDIA_TYPE, MediaType, VIDEO_TYPE } from '../media/constants';
|
||||
@@ -400,8 +397,7 @@ export function setTrackMuted(track: any, muted: boolean, state: IReduxState | I
|
||||
// Ignore the check for desktop track muted operation. When the screenshare is terminated by clicking on the
|
||||
// browser's 'Stop sharing' button, the local stream is stopped before the inactive stream handler is fired.
|
||||
// We still need to proceed here and remove the track from the peerconnection.
|
||||
if (track.isMuted() === muted
|
||||
&& !(track.getVideoType() === VIDEO_TYPE.DESKTOP && getMultipleVideoSendingSupportFeatureFlag(state))) {
|
||||
if (track.isMuted() === muted && track.getVideoType() !== VIDEO_TYPE.DESKTOP) {
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,6 @@ import { IStore } from '../../app/types';
|
||||
import { _RESET_BREAKOUT_ROOMS } from '../../breakout-rooms/actionTypes';
|
||||
import { isPrejoinPageVisible } from '../../prejoin/functions';
|
||||
import { getCurrentConference } from '../conference/functions';
|
||||
import { getMultipleVideoSendingSupportFeatureFlag } from '../config/functions.any';
|
||||
import {
|
||||
SET_AUDIO_MUTED,
|
||||
SET_CAMERA_FACING_MODE,
|
||||
@@ -16,9 +15,7 @@ import { gumPending, toggleCameraFacingMode } from '../media/actions';
|
||||
import {
|
||||
CAMERA_FACING_MODE,
|
||||
MEDIA_TYPE,
|
||||
MediaType,
|
||||
SCREENSHARE_MUTISM_AUTHORITY,
|
||||
VIDEO_MUTISM_AUTHORITY
|
||||
MediaType
|
||||
} from '../media/constants';
|
||||
import { IGUMPendingState } from '../media/types';
|
||||
import MiddlewareRegistry from '../redux/MiddlewareRegistry';
|
||||
@@ -186,15 +183,13 @@ function _getLocalTrack(
|
||||
* @private
|
||||
* @returns {void}
|
||||
*/
|
||||
async function _setMuted(store: IStore, { ensureTrack, authority, muted }: {
|
||||
authority: number; ensureTrack: boolean; muted: boolean; }, mediaType: MediaType) {
|
||||
async function _setMuted(store: IStore, { ensureTrack, muted }: {
|
||||
ensureTrack: boolean; muted: boolean; }, mediaType: MediaType) {
|
||||
const { dispatch, getState } = store;
|
||||
const localTrack = _getLocalTrack(store, mediaType, /* includePending */ true);
|
||||
const state = getState();
|
||||
|
||||
if (mediaType === MEDIA_TYPE.SCREENSHARE
|
||||
&& getMultipleVideoSendingSupportFeatureFlag(state)
|
||||
&& !muted) {
|
||||
if (mediaType === MEDIA_TYPE.SCREENSHARE && !muted) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -203,14 +198,8 @@ async function _setMuted(store: IStore, { ensureTrack, authority, muted }: {
|
||||
// completed. If there's no `jitsiTrack`, then the `muted` state will be applied once the `jitsiTrack` is
|
||||
// created.
|
||||
const { jitsiTrack } = localTrack;
|
||||
const isAudioOnly = (mediaType === MEDIA_TYPE.VIDEO && authority === VIDEO_MUTISM_AUTHORITY.AUDIO_ONLY)
|
||||
|| (mediaType === MEDIA_TYPE.SCREENSHARE && authority === SCREENSHARE_MUTISM_AUTHORITY.AUDIO_ONLY);
|
||||
|
||||
// Screenshare cannot be unmuted using the video mute button unless it is muted by audioOnly in the legacy
|
||||
// screensharing mode.
|
||||
if (jitsiTrack && (
|
||||
jitsiTrack.videoType !== 'desktop' || isAudioOnly || getMultipleVideoSendingSupportFeatureFlag(state))
|
||||
) {
|
||||
if (jitsiTrack) {
|
||||
setTrackMuted(jitsiTrack, muted, state, dispatch)
|
||||
.catch(() => dispatch(trackMuteUnmuteFailed(localTrack, muted)));
|
||||
}
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
import { IReduxState } from '../app/types';
|
||||
import { getMultipleVideoSendingSupportFeatureFlag } from '../base/config/functions.any';
|
||||
import { isWindows } from '../base/environment/environment';
|
||||
import { isMobileBrowser } from '../base/environment/utils';
|
||||
import { browser } from '../base/lib-jitsi-meet';
|
||||
import { VIDEO_TYPE } from '../base/media/constants';
|
||||
import { getLocalDesktopTrack, getLocalVideoTrack } from '../base/tracks/functions';
|
||||
import { getLocalDesktopTrack } from '../base/tracks/functions';
|
||||
|
||||
/**
|
||||
* Is the current screen sharing session audio only.
|
||||
@@ -56,10 +54,5 @@ export function isScreenVideoShared(state: IReduxState) {
|
||||
const tracks = state['features/base/tracks'];
|
||||
const localScreenshare = getLocalDesktopTrack(tracks);
|
||||
|
||||
if (getMultipleVideoSendingSupportFeatureFlag(state)) {
|
||||
return localScreenshare?.jitsiTrack && !localScreenshare.jitsiTrack.isMuted();
|
||||
}
|
||||
const localVideo = getLocalVideoTrack(tracks);
|
||||
|
||||
return localVideo?.jitsiTrack?.getVideoType() === VIDEO_TYPE.DESKTOP;
|
||||
return localScreenshare?.jitsiTrack && !localScreenshare.jitsiTrack.isMuted();
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { IStore } from '../app/types';
|
||||
import { getMultipleVideoSendingSupportFeatureFlag } from '../base/config/functions';
|
||||
import { getLocalJitsiDesktopTrack, getLocalJitsiVideoTrack } from '../base/tracks/functions';
|
||||
import { getLocalJitsiDesktopTrack } from '../base/tracks/functions';
|
||||
|
||||
import { SET_SCREENSHOT_CAPTURE } from './actionTypes';
|
||||
import { createScreenshotCaptureSummary } from './functions';
|
||||
@@ -45,9 +44,7 @@ export function toggleScreenshotCaptureSummary(enabled: boolean) {
|
||||
|
||||
if (enabled) {
|
||||
try {
|
||||
const jitsiTrack = getMultipleVideoSendingSupportFeatureFlag(state)
|
||||
? getLocalJitsiDesktopTrack(state)
|
||||
: getLocalJitsiVideoTrack(state);
|
||||
const jitsiTrack = getLocalJitsiDesktopTrack(state);
|
||||
|
||||
await screenshotSummary.start(jitsiTrack);
|
||||
dispatch(setScreenshotCapture(enabled));
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { connect } from 'react-redux';
|
||||
|
||||
import { IReduxState } from '../../app/types';
|
||||
import { getMultipleVideoSendingSupportFeatureFlag } from '../../base/config/functions.any';
|
||||
import { translate } from '../../base/i18n/functions';
|
||||
import { IconImage } from '../../base/icons/svg';
|
||||
import AbstractButton, { IProps as AbstractButtonProps } from '../../base/toolbox/components/AbstractButton';
|
||||
@@ -70,7 +69,6 @@ function _mapStateToProps(state: IReduxState) {
|
||||
return {
|
||||
_isBackgroundEnabled: Boolean(state['features/virtual-background'].backgroundEffectEnabled),
|
||||
visible: checkBlurSupport()
|
||||
&& getMultipleVideoSendingSupportFeatureFlag(state)
|
||||
&& !isScreenVideoShared(state)
|
||||
&& checkVirtualBackgroundEnabled(state)
|
||||
};
|
||||
|
||||
@@ -9,7 +9,6 @@ import { connect } from 'react-redux';
|
||||
import { makeStyles } from 'tss-react/mui';
|
||||
|
||||
import { IReduxState, IStore } from '../../app/types';
|
||||
import { getMultipleVideoSendingSupportFeatureFlag } from '../../base/config/functions.any';
|
||||
import { translate } from '../../base/i18n/functions';
|
||||
import Icon from '../../base/icons/components/Icon';
|
||||
import { IconCloseLarge } from '../../base/icons/svg';
|
||||
@@ -32,11 +31,6 @@ interface IProps extends WithTranslation {
|
||||
*/
|
||||
_images: Array<Image>;
|
||||
|
||||
/**
|
||||
* Whether or not multi-stream send support is enabled.
|
||||
*/
|
||||
_multiStreamModeEnabled: boolean;
|
||||
|
||||
/**
|
||||
* If the upload button should be displayed or not.
|
||||
*/
|
||||
@@ -503,8 +497,7 @@ function _mapStateToProps(state: IReduxState) {
|
||||
|
||||
return {
|
||||
_images: (hasBrandingImages && dynamicBrandingImages) || IMAGES,
|
||||
_showUploadButton: !state['features/base/config'].disableAddingBackgroundImages,
|
||||
_multiStreamModeEnabled: getMultipleVideoSendingSupportFeatureFlag(state)
|
||||
_showUploadButton: !state['features/base/config'].disableAddingBackgroundImages
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user