Skip to content

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

feat(visitors): Adds option to disable self-demote button.

damenchob969fba433de
diff --git a/config.js b/config.js
index 71be03e769..439831b8a9 100644
--- a/config.js
+++ b/config.js
@@ -121,6 +121,9 @@ var config = {
// Disables polls feature.
// disablePolls: false,
+ // Disables demote button from self-view
+ // disableSelfDemote: false,
+
// Disables self-view tile. (hides it from tile view and from filmstrip)
// disableSelfView: false,
diff --git a/react/features/base/config/configType.ts b/react/features/base/config/configType.ts
index 79761ef137..94523f9f8f 100644
--- a/react/features/base/config/configType.ts
+++ b/react/features/base/config/configType.ts
@@ -287,6 +287,7 @@ export interface IConfig {
disableRemoveRaisedHandOnFocus?: boolean;
disableResponsiveTiles?: boolean;
disableRtx?: boolean;
+ disableSelfDemote?: boolean;
disableSelfView?: boolean;
disableSelfViewSettings?: boolean;
disableShortcuts?: boolean;
diff --git a/react/features/base/config/configWhitelist.ts b/react/features/base/config/configWhitelist.ts
index 631e7ebfe4..1caa2d3303 100644
--- a/react/features/base/config/configWhitelist.ts
+++ b/react/features/base/config/configWhitelist.ts
@@ -116,6 +116,7 @@ export default [
'disableRemoteMute',
'disableResponsiveTiles',
'disableRtx',
+ 'disableSelfDemote',
'disableSelfView',
'disableSelfViewSettings',
'disableShortcuts',
diff --git a/react/features/video-menu/components/native/LocalVideoMenu.tsx b/react/features/video-menu/components/native/LocalVideoMenu.tsx
index 63467e82fe..15309bbefc 100644
--- a/react/features/video-menu/components/native/LocalVideoMenu.tsx
+++ b/react/features/video-menu/components/native/LocalVideoMenu.tsx
@@ -141,12 +141,13 @@ class LocalVideoMenu extends PureComponent<IProps> {
* @returns {IProps}
*/
function _mapStateToProps(state: IReduxState) {
+ const { disableSelfDemote } = state['features/base/config'];
const participant = getLocalParticipant(state);
return {
_participant: participant,
_participantDisplayName: getParticipantDisplayName(state, participant?.id ?? ''),
- _showDemote: getParticipantCount(state) > 1
+ _showDemote: !disableSelfDemote && getParticipantCount(state) > 1
};
}
diff --git a/react/features/video-menu/components/web/LocalVideoMenuTriggerButton.tsx b/react/features/video-menu/components/web/LocalVideoMenuTriggerButton.tsx
index e0e366e7e3..84eb6b0049 100644
--- a/react/features/video-menu/components/web/LocalVideoMenuTriggerButton.tsx
+++ b/react/features/video-menu/components/web/LocalVideoMenuTriggerButton.tsx
@@ -268,7 +268,7 @@ const LocalVideoMenuTriggerButton = ({
function _mapStateToProps(state: IReduxState, ownProps: Partial<IProps>) {
const { thumbnailType } = ownProps;
const localParticipant = getLocalParticipant(state);
- const { disableLocalVideoFlip, disableSelfViewSettings } = state['features/base/config'];
+ const { disableLocalVideoFlip, disableSelfDemote, disableSelfViewSettings } = state['features/base/config'];
const videoTrack = getLocalVideoTrack(state['features/base/tracks']);
const { overflowDrawer } = state['features/toolbox'];
const { showConnectionInfo } = state['features/base/connection'];
@@ -292,7 +292,7 @@ function _mapStateToProps(state: IReduxState, ownProps: Partial<IProps>) {
return {
_menuPosition,
- _showDemote: getParticipantCount(state) > 1,
+ _showDemote: !disableSelfDemote && getParticipantCount(state) > 1,
_showLocalVideoFlipButton: !disableLocalVideoFlip && videoTrack?.videoType !== 'desktop',
_showHideSelfViewButton: showHideSelfViewButton,
_overflowDrawer: overflowDrawer,