diff --git a/config.js b/config.js index 4d6dc8a45..57cf31d25 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 675254b75..845883d5d 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 4beed615e..43bd8f083 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 2b1b2afa0..1745d4bd9 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 { * @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 { styles: this.props._bottomSheetStyles.buttons }; + const buttons = []; + + if (!_disableRemoteMute) { + buttons.push(); + } + + if (!_disableKick) { + buttons.push(); + } + + buttons.push(); + buttons.push(); + return ( @@ -93,10 +116,7 @@ class RemoteVideoMenu extends Component { { this.props._participantDisplayName } - - - - + { buttons } ); } @@ -130,13 +150,15 @@ class RemoteVideoMenu extends Component { */ 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 e7d1faf53..b1ed1947c 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 { */ _renderRemoteVideoMenu() { const { + _disableKick, + _disableRemoteMute, _isModerator, initialVolumeValue, isAudioMuted, @@ -169,22 +181,27 @@ class RemoteVideoMenuTriggerButton extends Component { const buttons = []; if (_isModerator) { - buttons.push( - - ); - buttons.push( - - ); - buttons.push( - - ); + if (!_disableRemoteMute) { + buttons.push( + + ); + buttons.push( + + ); + } + + if (!_disableKick) { + buttons.push( + + ); + } } if (remoteControlState) { @@ -236,9 +253,13 @@ class RemoteVideoMenuTriggerButton extends Component { */ 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 13d26cd8d..32b486ed8 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 }; }