Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.
TypeScript debiandeep-videojitsijitsi-meetscalable-video-conferencessfuvideovideo-communicationvideo-conferencingwebrtc
feat(filmstrip) Add always visible resize bar and initial width (#16181)
Horatiu Muresan3a54c3418bc3
diff --git a/config.js b/config.jsindex 72ccb240d4..1c414296ae 100644--- a/config.js+++ b/config.js@@ -1779,6 +1779,13 @@ var config = {// // The minimum number of participants that must be in the call for// // the top panel layout to be used.// minParticipantCountForTopPanel: 50,++ // // The width of the filmstrip on joining meeting. Can be resized afterwards.+ // initialWidth: 400,++ // // Whether the draggable resize bar of the filmstrip is always visible. Setting this to true will make+ // // the filmstrip always visible in case `disableResizable` is false.+ // alwaysShowResizeBar: true,// },// Tile view related config options.diff --git a/react/features/base/config/configType.ts b/react/features/base/config/configType.tsindex c3f2d28c7e..83ead18f81 100644--- a/react/features/base/config/configType.ts+++ b/react/features/base/config/configType.ts@@ -384,10 +384,12 @@ export interface IConfig {maxFileSize?: number;};filmstrip?: {+ alwaysShowResizeBar?: boolean;disableResizable?: boolean;disableStageFilmstrip?: boolean;disableTopPanel?: boolean;disabled?: boolean;+ initialWidth?: number;minParticipantCountForTopPanel?: number;};flags?: {diff --git a/react/features/base/config/middleware.ts b/react/features/base/config/middleware.tsindex 56b0637bdf..3605486993 100644--- a/react/features/base/config/middleware.ts+++ b/react/features/base/config/middleware.ts@@ -2,6 +2,7 @@ import { AnyAction } from 'redux';import { IStore } from '../../app/types';import { SET_DYNAMIC_BRANDING_DATA } from '../../dynamic-branding/actionTypes';+import { setUserFilmstripWidth } from '../../filmstrip/actions.web';import { getFeatureFlag } from '../flags/functions';import MiddlewareRegistry from '../redux/MiddlewareRegistry';import { updateSettings } from '../settings/actions';@@ -79,12 +80,18 @@ function _setConfig({ dispatch, getState }: IStore, next: Function, action: AnyA}));}- if (action.config.filmstrip?.stageFilmstripParticipants !== undefined) {+ const { initialWidth, stageFilmstripParticipants } = action.config.filmstrip || {};++ if (stageFilmstripParticipants !== undefined) {dispatch(updateSettings({- maxStageParticipants: action.config.filmstrip.stageFilmstripParticipants+ maxStageParticipants: stageFilmstripParticipants}));}+ if (initialWidth) {+ dispatch(setUserFilmstripWidth(initialWidth));+ }+dispatch(updateConfig(config));// FIXME On Web we rely on the global 'config' variable which gets altereddiff --git a/react/features/base/config/reducer.ts b/react/features/base/config/reducer.tsindex 7835e1d39a..00c9c4bded 100644--- a/react/features/base/config/reducer.ts+++ b/react/features/base/config/reducer.ts@@ -185,6 +185,15 @@ function _setConfig(state: IConfig, { config }: { config: IConfig; }) {});}+ const { alwaysShowResizeBar, disableResizable } = config.filmstrip || {};++ if (alwaysShowResizeBar && disableResizable) {+ config.filmstrip = {+ ...config.filmstrip,+ alwaysShowResizeBar: false+ };+ }+const newState = merge({},config,diff --git a/react/features/filmstrip/components/web/Filmstrip.tsx b/react/features/filmstrip/components/web/Filmstrip.tsxindex ae57b034c7..e70b164a00 100644--- a/react/features/filmstrip/components/web/Filmstrip.tsx+++ b/react/features/filmstrip/components/web/Filmstrip.tsx@@ -179,6 +179,9 @@ function styles(theme: Theme, props: IProps) {'&.top-panel-filmstrip': {flexDirection: 'column' as const+ },+ '&.always-show-resize-bar': {+ backgroundColor: BACKGROUND_COLOR}},@@ -245,6 +248,10 @@ function styles(theme: Theme, props: IProps) {* The type of the React {@code Component} props of {@link Filmstrip}.*/export interface IProps extends WithTranslation {+ /**+ * Whether to always show the resize bar on filmstrip. This will make the filmstrip always visible.+ */+ _alwaysShowResizeBar?: boolean;/*** Additional CSS class names top add to the root.@@ -533,6 +540,7 @@ class Filmstrip extends PureComponent <IProps, IState> {override render() {const filmstripStyle: any = { };const {+ _alwaysShowResizeBar,_currentLayout,_disableSelfView,_filmstripDisabled,@@ -649,11 +657,12 @@ class Filmstrip extends PureComponent <IProps, IState> {{_resizableFilmstrip? <divclassName = { clsx('resizable-filmstrip', classes.resizableFilmstripContainer,- _topPanelFilmstrip && 'top-panel-filmstrip') }>+ _topPanelFilmstrip && 'top-panel-filmstrip',+ _alwaysShowResizeBar && 'always-show-resize-bar') }><divclassName = { clsx('dragHandleContainer',classes.dragHandleContainer,- isMouseDown && 'visible',+ (isMouseDown || _alwaysShowResizeBar) && 'visible',_topPanelFilmstrip && 'top-panel')}onMouseDown = { this._onDragHandleMouseDown }>@@ -1081,7 +1090,7 @@ class Filmstrip extends PureComponent <IProps, IState> {function _mapStateToProps(state: IReduxState, ownProps: any) {const { _hasScroll = false, filmstripType, _topPanelFilmstrip, _remoteParticipants } = ownProps;const { toolbarButtons } = state['features/toolbox'];- const { iAmRecorder } = state['features/base/config'];+ const { iAmRecorder, filmstrip: { alwaysShowResizeBar } = {} } = state['features/base/config'];const { topPanelHeight, topPanelVisible, visible, width: verticalFilmstripWidth } = state['features/filmstrip'];const { localScreenShare } = state['features/base/participants'];const reduceHeight = state['features/toolbox'].visible && toolbarButtons?.length;@@ -1134,7 +1143,8 @@ function _mapStateToProps(state: IReduxState, ownProps: any) {_topPanelVisible,_verticalFilmstripWidth: verticalFilmstripWidth.current,_verticalViewMaxWidth: getVerticalViewMaxWidth(state),- _videosClassName: videosClassName+ _videosClassName: videosClassName,+ _alwaysShowResizeBar: alwaysShowResizeBar};}diff --git a/react/features/filmstrip/functions.web.ts b/react/features/filmstrip/functions.web.tsindex 2de306cf23..665c4f88b9 100644--- a/react/features/filmstrip/functions.web.ts+++ b/react/features/filmstrip/functions.web.ts@@ -81,13 +81,13 @@ export function shouldRemoteVideosBeVisible(state: IReduxState) {// in the filmstrip.const participantCount = getParticipantCountWithFake(state);let pinnedParticipant;- const { disable1On1Mode } = state['features/base/config'];+ const { disable1On1Mode, filmstrip: { alwaysShowResizeBar } = {} } = state['features/base/config'];const { contextMenuOpened } = state['features/base/responsive-ui'];return Boolean(contextMenuOpened|| participantCount > 2-+ || alwaysShowResizeBar// Always show the filmstrip when there is another participant to// show and the local video is pinned, or the toolbar is displayed.|| (participantCount > 1