Bladeren bron

Add: remoteVideoMenu.disableGrantModerator option (#7534)

* Add: remoteVideoMenu.disableGrantModerator option

* Add disableGrantModerator to native side

* Update RemoteVideoMenu.js

* Update RemoteVideoMenuTriggerButton.js

Co-authored-by: ouya99 <alexander@andlabs.eu>
master
Christoph Wiechert 4 jaren geleden
bovenliggende
commit
79497cecba
No account linked to committer's email address

+ 3
- 1
config.js Bestand weergeven

@@ -671,7 +671,9 @@ var config = {
671 671
     // Options related to the remote participant menu.
672 672
     // remoteVideoMenu: {
673 673
     //     // If set to true the 'Kick out' button will be disabled.
674
-    //     disableKick: true
674
+    //     disableKick: true,
675
+    //     // If set to true the 'Grant moderator' button will be disabled.
676
+    //     disableGrantModerator: true
675 677
     // },
676 678
 
677 679
     // If set to true all muting operations of remote participants will be disabled.

+ 7
- 2
react/features/video-menu/components/native/RemoteVideoMenu.js Bestand weergeven

@@ -53,6 +53,11 @@ type Props = {
53 53
      */
54 54
     _disableRemoteMute: boolean,
55 55
 
56
+    /**
57
+     * Whether or not to display the grant moderator button.
58
+     */
59
+    _disableGrantModerator: Boolean,
60
+
56 61
     /**
57 62
      * True if the menu is currently open, false otherwise.
58 63
      */
@@ -89,7 +94,7 @@ class RemoteVideoMenu extends PureComponent<Props> {
89 94
      * @inheritdoc
90 95
      */
91 96
     render() {
92
-        const { _disableKick, _disableRemoteMute, participant } = this.props;
97
+        const { _disableKick, _disableRemoteMute, _disableGrantModerator, participant } = this.props;
93 98
         const buttonProps = {
94 99
             afterClick: this._onCancel,
95 100
             showLabel: true,
@@ -103,7 +108,7 @@ class RemoteVideoMenu extends PureComponent<Props> {
103 108
                 renderHeader = { this._renderMenuHeader }>
104 109
                 { !_disableRemoteMute && <MuteButton { ...buttonProps } /> }
105 110
                 { !_disableKick && <KickButton { ...buttonProps } /> }
106
-                <GrantModeratorButton { ...buttonProps } />
111
+                { !_disableGrantModerator && <GrantModeratorButton { ...buttonProps } /> }
107 112
                 <PinButton { ...buttonProps } />
108 113
                 <PrivateMessageButton { ...buttonProps } />
109 114
                 <MuteEveryoneElseButton { ...buttonProps } />

+ 16
- 7
react/features/video-menu/components/web/RemoteVideoMenuTriggerButton.js Bestand weergeven

@@ -43,6 +43,11 @@ type Props = {
43 43
      */
44 44
     _disableRemoteMute: Boolean,
45 45
 
46
+    /**
47
+     * Whether or not to display the grant moderator button.
48
+     */
49
+    _disableGrantModerator: Boolean,
50
+
46 51
     /**
47 52
      * Whether or not the participant is a conference moderator.
48 53
      */
@@ -136,6 +141,7 @@ class RemoteVideoMenuTriggerButton extends Component<Props> {
136 141
         const {
137 142
             _disableKick,
138 143
             _disableRemoteMute,
144
+            _disableGrantModerator,
139 145
             _isModerator,
140 146
             dispatch,
141 147
             initialVolumeValue,
@@ -170,11 +176,13 @@ class RemoteVideoMenuTriggerButton extends Component<Props> {
170 176
                 );
171 177
             }
172 178
 
173
-            buttons.push(
174
-                <GrantModeratorButton
175
-                    key = 'grant-moderator'
176
-                    participantID = { participantID } />
177
-            );
179
+            if (!_disableGrantModerator) {
180
+                buttons.push(
181
+                    <GrantModeratorButton
182
+                        key = 'grant-moderator'
183
+                        participantID = { participantID } />
184
+                );
185
+            }
178 186
 
179 187
             if (!_disableKick) {
180 188
                 buttons.push(
@@ -242,7 +250,7 @@ function _mapStateToProps(state, ownProps) {
242 250
     const { participantID } = ownProps;
243 251
     const localParticipant = getLocalParticipant(state);
244 252
     const { remoteVideoMenu = {}, disableRemoteMute } = state['features/base/config'];
245
-    const { disableKick } = remoteVideoMenu;
253
+    const { disableKick, disableGrantModerator } = remoteVideoMenu;
246 254
     let _remoteControlState = null;
247 255
     const participant = getParticipantById(state, participantID);
248 256
     const _isRemoteControlSessionActive = participant?.remoteControlSessionStatus ?? false;
@@ -283,7 +291,8 @@ function _mapStateToProps(state, ownProps) {
283 291
         _disableRemoteMute: Boolean(disableRemoteMute),
284 292
         _remoteControlState,
285 293
         _menuPosition,
286
-        _overflowDrawer: overflowDrawer
294
+        _overflowDrawer: overflowDrawer,
295
+        _disableGrantModerator: Boolean(disableGrantModerator)
287 296
     };
288 297
 }
289 298
 

Laden…
Annuleren
Opslaan