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(remote-menu):option for disable mute and kick

Hristo Terezov3a871cbed8a9
diff --git a/config.js b/config.js
index 4d6dc8a453..57cf31d25f 100644
--- a/config.js
+++ b/config.js
@@ -459,6 +459,15 @@ var config = {
// downloadAppsUrl: 'https://docs.example.com/our-apps.html'
// },
+ // Options related to the remote participant menu.
+ // remoteVideoMenu: {
+ // // If set to true the 'Kick out' button will be disabled.
+ // disableKick: true
+ // },
+
+ // If set to true all muting operations of remote participants will be disabled.
+ // disableRemoteMute: true,
+
// List of undocumented settings used in jitsi-meet
/**
_immediateReloadThreshold
diff --git a/react/features/base/config/configWhitelist.js b/react/features/base/config/configWhitelist.js
index 675254b754..845883d5de 100644
--- a/react/features/base/config/configWhitelist.js
+++ b/react/features/base/config/configWhitelist.js
@@ -88,6 +88,7 @@ export default [
'disableLocalVideoFlip',
'disableNS',
'disableRemoteControl',
+ 'disableRemoteMute',
'disableRtx',
'disableSuspendVideo',
'disableThirdPartyRequests',
@@ -126,6 +127,7 @@ export default [
'pcStatsInterval',
'preferH264',
'requireDisplayName',
+ 'remoteVideoMenu',
'resolution',
'startAudioMuted',
'startAudioOnly',
diff --git a/react/features/base/config/reducer.js b/react/features/base/config/reducer.js
index 4beed615e1..43bd8f083e 100644
--- a/react/features/base/config/reducer.js
+++ b/react/features/base/config/reducer.js
@@ -43,7 +43,9 @@ const INITIAL_RN_STATE = {
p2p: {
disableH264: false,
preferH264: true
- }
+ },
+
+ remoteVideoMenu: {}
};
ReducerRegistry.register('features/base/config', (state = _getInitialState(), action) => {
diff --git a/react/features/remote-video-menu/components/native/RemoteVideoMenu.js b/react/features/remote-video-menu/components/native/RemoteVideoMenu.js
index 2b1b2afa03..1745d4bd95 100644
--- a/react/features/remote-video-menu/components/native/RemoteVideoMenu.js
+++ b/react/features/remote-video-menu/components/native/RemoteVideoMenu.js
@@ -40,6 +40,16 @@ type Props = {
*/
_bottomSheetStyles: StyleType,
+ /**
+ * Whether or not to display the kick button.
+ */
+ _disableKick: boolean,
+
+ /**
+ * Whether or not to display the remote mute buttons.
+ */
+ _disableRemoteMute: boolean,
+
/**
* True if the menu is currently open, false otherwise.
*/
@@ -75,7 +85,7 @@ class RemoteVideoMenu extends Component<Props> {
* @inheritdoc
*/
render() {
- const { participant } = this.props;
+ const { _disableKick, _disableRemoteMute, participant } = this.props;
const buttonProps = {
afterClick: this._onCancel,
showLabel: true,
@@ -83,6 +93,19 @@ class RemoteVideoMenu extends Component<Props> {
styles: this.props._bottomSheetStyles.buttons
};
+ const buttons = [];
+
+ if (!_disableRemoteMute) {
+ buttons.push(<MuteButton { ...buttonProps } />);
+ }
+
+ if (!_disableKick) {
+ buttons.push(<KickButton { ...buttonProps } />);
+ }
+
+ buttons.push(<PinButton { ...buttonProps } />);
+ buttons.push(<PrivateMessageButton { ...buttonProps } />);
+
return (
<BottomSheet onCancel = { this._onCancel }>
<View style = { styles.participantNameContainer }>
@@ -93,10 +116,7 @@ class RemoteVideoMenu extends Component<Props> {
{ this.props._participantDisplayName }
</Text>
</View>
- <MuteButton { ...buttonProps } />
- <KickButton { ...buttonProps } />
- <PinButton { ...buttonProps } />
- <PrivateMessageButton { ...buttonProps } />
+ { buttons }
</BottomSheet>
);
}
@@ -130,13 +150,15 @@ class RemoteVideoMenu extends Component<Props> {
*/
function _mapStateToProps(state, ownProps) {
const { participant } = ownProps;
+ const { remoteVideoMenu = {}, disableRemoteMute } = state['features/base/config'];
+ const { disableKick } = remoteVideoMenu;
return {
- _bottomSheetStyles:
- ColorSchemeRegistry.get(state, 'BottomSheet'),
+ _bottomSheetStyles: ColorSchemeRegistry.get(state, 'BottomSheet'),
+ _disableKick: Boolean(disableKick),
+ _disableRemoteMute: Boolean(disableRemoteMute),
_isOpen: isDialogOpen(state, RemoteVideoMenu_),
- _participantDisplayName: getParticipantDisplayName(
- state, participant.id)
+ _participantDisplayName: getParticipantDisplayName(state, participant.id)
};
}
diff --git a/react/features/remote-video-menu/components/web/RemoteVideoMenuTriggerButton.js b/react/features/remote-video-menu/components/web/RemoteVideoMenuTriggerButton.js
index e7d1faf532..b1ed1947c3 100644
--- a/react/features/remote-video-menu/components/web/RemoteVideoMenuTriggerButton.js
+++ b/react/features/remote-video-menu/components/web/RemoteVideoMenuTriggerButton.js
@@ -26,6 +26,16 @@ declare var interfaceConfig: Object;
*/
type Props = {
+ /**
+ * Whether or not to display the kick button.
+ */
+ _disableKick: boolean,
+
+ /**
+ * Whether or not to display the remote mute buttons.
+ */
+ _disableRemoteMute: Boolean,
+
/**
* Whether or not the participant is a conference moderator.
*/
@@ -157,6 +167,8 @@ class RemoteVideoMenuTriggerButton extends Component<Props> {
*/
_renderRemoteVideoMenu() {
const {
+ _disableKick,
+ _disableRemoteMute,
_isModerator,
initialVolumeValue,
isAudioMuted,
@@ -169,22 +181,27 @@ class RemoteVideoMenuTriggerButton extends Component<Props> {
const buttons = [];
if (_isModerator) {
- buttons.push(
- <MuteButton
- isAudioMuted = { isAudioMuted }
- key = 'mute'
- participantID = { participantID } />
- );
- buttons.push(
- <MuteEveryoneElseButton
- key = 'mute-others'
- participantID = { participantID } />
- );
- buttons.push(
- <KickButton
- key = 'kick'
- participantID = { participantID } />
- );
+ if (!_disableRemoteMute) {
+ buttons.push(
+ <MuteButton
+ isAudioMuted = { isAudioMuted }
+ key = 'mute'
+ participantID = { participantID } />
+ );
+ buttons.push(
+ <MuteEveryoneElseButton
+ key = 'mute-others'
+ participantID = { participantID } />
+ );
+ }
+
+ if (!_disableKick) {
+ buttons.push(
+ <KickButton
+ key = 'kick'
+ participantID = { participantID } />
+ );
+ }
}
if (remoteControlState) {
@@ -236,9 +253,13 @@ class RemoteVideoMenuTriggerButton extends Component<Props> {
*/
function _mapStateToProps(state) {
const participant = getLocalParticipant(state);
+ const { remoteVideoMenu = {}, disableRemoteMute } = state['features/base/config'];
+ const { disableKick } = remoteVideoMenu;
return {
- _isModerator: Boolean(participant?.role === PARTICIPANT_ROLE.MODERATOR)
+ _isModerator: Boolean(participant?.role === PARTICIPANT_ROLE.MODERATOR),
+ _disableKick: Boolean(disableKick),
+ _disableRemoteMute: Boolean(disableRemoteMute)
};
}
diff --git a/react/features/toolbox/components/web/MuteEveryoneButton.js b/react/features/toolbox/components/web/MuteEveryoneButton.js
index 13d26cd8d4..32b486ed87 100644
--- a/react/features/toolbox/components/web/MuteEveryoneButton.js
+++ b/react/features/toolbox/components/web/MuteEveryoneButton.js
@@ -64,11 +64,12 @@ function _mapStateToProps(state: Object, ownProps: Props) {
const localParticipant = getLocalParticipant(state);
const isModerator = localParticipant.role === PARTICIPANT_ROLE.MODERATOR;
const { visible } = ownProps;
+ const { disableRemoteMute } = state['features/base/config'];
return {
isModerator,
localParticipantId: localParticipant.id,
- visible: visible && isModerator
+ visible: visible && isModerator && !disableRemoteMute
};
}