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(filmstrip) Save stage filmstrip in settings (#12170)

Robert Pintiliif5e60a7ca480
diff --git a/config.js b/config.js
index 2f1f2c55b5..a5d749e7c0 100644
--- a/config.js
+++ b/config.js
@@ -1441,6 +1441,10 @@ var config = {
// // (displaying multiple participants on stage besides the vertical filmstrip)
// disableStageFilmstrip: false,
+ // // Default number of participants that can be displayed on stage.
+ // // The user can change this in settings. Number must be between 1 and 6.
+ // stageFilmstripParticipants: 1,
+
// // Disables the top panel (only shown when a user is sharing their screen).
// disableTopPanel: false,
diff --git a/react/features/base/config/middleware.ts b/react/features/base/config/middleware.ts
index 82adeb27d4..87e75eb845 100644
--- a/react/features/base/config/middleware.ts
+++ b/react/features/base/config/middleware.ts
@@ -74,6 +74,12 @@ function _setConfig({ dispatch, getState }: IStore, next: Function, action: AnyA
}));
}
+ if (action.config.filmstrip.stageFilmstripParticipants !== undefined) {
+ dispatch(updateSettings({
+ maxStageParticipants: action.config.filmstrip.stageFilmstripParticipants
+ }));
+ }
+
dispatch(updateConfig(config));
// FIXME On Web we rely on the global 'config' variable which gets altered
diff --git a/react/features/base/settings/reducer.ts b/react/features/base/settings/reducer.ts
index 6c00c2d4af..af12f04068 100644
--- a/react/features/base/settings/reducer.ts
+++ b/react/features/base/settings/reducer.ts
@@ -26,6 +26,7 @@ const DEFAULT_STATE: ISettingsState = {
displayName: undefined,
email: undefined,
localFlipX: true,
+ maxStageParticipants: 1,
micDeviceId: undefined,
serverURL: undefined,
hideShareAudioHelper: false,
@@ -62,6 +63,7 @@ export interface ISettingsState {
email?: string;
hideShareAudioHelper?: boolean;
localFlipX?: boolean;
+ maxStageParticipants?: number;
micDeviceId?: string | boolean;
serverURL?: string;
soundsIncomingMessage?: boolean;
diff --git a/react/features/filmstrip/actionTypes.ts b/react/features/filmstrip/actionTypes.ts
index 6cc7971f0a..1c3f67f938 100644
--- a/react/features/filmstrip/actionTypes.ts
+++ b/react/features/filmstrip/actionTypes.ts
@@ -187,17 +187,6 @@ export const REMOVE_STAGE_PARTICIPANT = 'REMOVE_STAGE_PARTICIPANT';
*/
export const SET_STAGE_PARTICIPANTS = 'SET_STAGE_PARTICIPANTS';
-
-/**
- * The type of Redux action which sets the max number of active participants.
- * (the participants displayed on the stage filmstrip).
- * {
- * type: SET_MAX_STAGE_PARTICIPANTS,
- * maxParticipants: Number
- * }
- */
-export const SET_MAX_STAGE_PARTICIPANTS = 'SET_MAX_STAGE_PARTICIPANTS';
-
/**
* The type of Redux action which toggles the pin state of stage participants.
* {
diff --git a/react/features/filmstrip/actions.web.js b/react/features/filmstrip/actions.web.js
index 7e1651082e..0d31d9a17a 100644
--- a/react/features/filmstrip/actions.web.js
+++ b/react/features/filmstrip/actions.web.js
@@ -24,7 +24,6 @@ import {
SET_USER_IS_RESIZING,
SET_VERTICAL_VIEW_DIMENSIONS,
SET_VOLUME,
- SET_MAX_STAGE_PARTICIPANTS,
TOGGLE_PIN_STAGE_PARTICIPANT,
CLEAR_STAGE_PARTICIPANTS,
SET_SCREENSHARING_TILE_DIMENSIONS,
@@ -514,19 +513,6 @@ export function setStageParticipants(queue) {
};
}
-/**
- * Sets the max number of participants to be displayed on stage.
- *
- * @param {number} maxParticipants - Max number of participants.
- * @returns {Object}
- */
-export function setMaxStageParticipants(maxParticipants) {
- return {
- type: SET_MAX_STAGE_PARTICIPANTS,
- maxParticipants
- };
-}
-
/**
* Toggles the pin state of the given participant.
*
diff --git a/react/features/filmstrip/functions.web.js b/react/features/filmstrip/functions.web.js
index f0507a64b6..2d6cf44f14 100644
--- a/react/features/filmstrip/functions.web.js
+++ b/react/features/filmstrip/functions.web.js
@@ -751,7 +751,7 @@ export function isStageFilmstripTopPanel(state, minParticipantCount = 0) {
export function isStageFilmstripEnabled(state) {
const { filmstrip } = state['features/base/config'];
- return !(filmstrip?.disableStageFilmstrip ?? true) && interfaceConfig.VERTICAL_FILMSTRIP;
+ return !filmstrip?.disableStageFilmstrip && interfaceConfig.VERTICAL_FILMSTRIP;
}
/**
diff --git a/react/features/filmstrip/middleware.web.js b/react/features/filmstrip/middleware.web.js
index d532367794..9e8b96c472 100644
--- a/react/features/filmstrip/middleware.web.js
+++ b/react/features/filmstrip/middleware.web.js
@@ -154,7 +154,8 @@ MiddlewareRegistry.register(store => next => action => {
const { dispatch, getState } = store;
const { participantId, pinned } = action;
const state = getState();
- const { activeParticipants, maxStageParticipants } = state['features/filmstrip'];
+ const { activeParticipants } = state['features/filmstrip'];
+ const { maxStageParticipants } = state['features/base/settings'];
let queue;
if (activeParticipants.find(p => p.participantId === participantId)) {
diff --git a/react/features/filmstrip/reducer.ts b/react/features/filmstrip/reducer.ts
index 59ea04eddf..e18c580ea6 100644
--- a/react/features/filmstrip/reducer.ts
+++ b/react/features/filmstrip/reducer.ts
@@ -16,7 +16,6 @@ import {
SET_VERTICAL_VIEW_DIMENSIONS,
SET_VISIBLE_REMOTE_PARTICIPANTS,
SET_VOLUME,
- SET_MAX_STAGE_PARTICIPANTS,
CLEAR_STAGE_PARTICIPANTS,
SET_SCREENSHARING_TILE_DIMENSIONS,
SET_USER_FILMSTRIP_HEIGHT,
@@ -56,14 +55,6 @@ const DEFAULT_STATE = {
*/
isResizing: false,
- /**
- * The current max number of participants to be displayed on the stage filmstrip.
- *
- * @public
- * @type {Number}
- */
- maxStageParticipants: 1,
-
/**
* The custom audio volume levels per participant.
*
@@ -216,7 +207,6 @@ export interface IFilmstripState {
remoteVideosContainer?: Dimensions;
};
isResizing: boolean;
- maxStageParticipants: number;
participantsVolume: {
[participantId: string]: number;
};
@@ -397,12 +387,6 @@ ReducerRegistry.register<IFilmstripState>(
activeParticipants: state.activeParticipants.filter(p => p.participantId !== action.participantId)
};
}
- case SET_MAX_STAGE_PARTICIPANTS: {
- return {
- ...state,
- maxStageParticipants: action.maxParticipants
- };
- }
case CLEAR_STAGE_PARTICIPANTS: {
return {
...state,
diff --git a/react/features/follow-me/middleware.js b/react/features/follow-me/middleware.js
index dd959786c6..357dd338f9 100644
--- a/react/features/follow-me/middleware.js
+++ b/react/features/follow-me/middleware.js
@@ -10,8 +10,9 @@ import {
pinParticipant
} from '../base/participants';
import { MiddlewareRegistry } from '../base/redux';
+import { updateSettings } from '../base/settings';
import { setFilmstripVisible } from '../filmstrip';
-import { addStageParticipant, setMaxStageParticipants } from '../filmstrip/actions.web';
+import { addStageParticipant } from '../filmstrip/actions.web';
import { setTileView } from '../video-layout';
import {
@@ -192,7 +193,9 @@ function _onFollowMeCommand(attributes = {}, id, store) {
if (attributes.maxStageParticipants !== undefined
&& oldState.maxStageParticipants !== attributes.maxStageParticipants) {
- store.dispatch(setMaxStageParticipants(Number(attributes.maxStageParticipants)));
+ store.dispatch(updateSettings({
+ maxStageParticipants: Number(attributes.maxStageParticipants)
+ }));
}
}
diff --git a/react/features/follow-me/subscriber.js b/react/features/follow-me/subscriber.js
index c3c027d306..82a4db8efc 100644
--- a/react/features/follow-me/subscriber.js
+++ b/react/features/follow-me/subscriber.js
@@ -74,7 +74,7 @@ StateListenerRegistry.register(
* Subscribes to changes to the max number of stage participants setting.
*/
StateListenerRegistry.register(
- /* selector */ state => state['features/filmstrip'].maxStageParticipants,
+ /* selector */ state => state['features/base/settings'].maxStageParticipants,
/* listener */ _sendFollowMeCommand);
/**
@@ -90,7 +90,7 @@ function _getFollowMeState(state) {
return {
filmstripVisible: state['features/filmstrip'].visible,
- maxStageParticipants: stageFilmstrip ? state['features/filmstrip'].maxStageParticipants : undefined,
+ maxStageParticipants: stageFilmstrip ? state['features/base/settings'].maxStageParticipants : undefined,
nextOnStage: stageFilmstrip ? undefined : pinnedParticipant && pinnedParticipant.id,
pinnedStageParticipants: stageFilmstrip ? JSON.stringify(getPinnedActiveParticipants(state)) : undefined,
sharedDocumentVisible: state['features/etherpad'].editing,
diff --git a/react/features/settings/actions.js b/react/features/settings/actions.js
index 5def2ac5dc..8678317bcd 100644
--- a/react/features/settings/actions.js
+++ b/react/features/settings/actions.js
@@ -10,7 +10,6 @@ import {
import { openDialog } from '../base/dialog';
import { i18next } from '../base/i18n';
import { updateSettings } from '../base/settings';
-import { setMaxStageParticipants } from '../filmstrip/actions.web';
import { setScreenshareFramerate } from '../screen-share/actions';
import {
@@ -123,8 +122,8 @@ export function submitMoreTab(newState: Object): Function {
dispatch(updateSettings({ disableSelfView: newState.hideSelfView }));
}
- if (Number(newState.maxStageParticipants) !== currentState.maxStageParticipants) {
- dispatch(setMaxStageParticipants(Number(newState.maxStageParticipants)));
+ if (newState.maxStageParticipants !== currentState.maxStageParticipants) {
+ dispatch(updateSettings({ maxStageParticipants: Number(newState.maxStageParticipants) }));
}
};
}
diff --git a/react/features/settings/functions.js b/react/features/settings/functions.js
index 1cdcd943b7..b6eaac3243 100644
--- a/react/features/settings/functions.js
+++ b/react/features/settings/functions.js
@@ -134,7 +134,7 @@ export function getMoreTabProps(stateful: Object | Function) {
showNotificationsSettings: Object.keys(enabledNotifications).length > 0,
showPrejoinPage: !state['features/base/settings'].userSelectedSkipPrejoin,
showPrejoinSettings: state['features/base/config'].prejoinConfig?.enabled,
- maxStageParticipants: state['features/filmstrip'].maxStageParticipants,
+ maxStageParticipants: state['features/base/settings'].maxStageParticipants,
stageFilmstripEnabled
};
}