瀏覽代碼

feat(remote-menu):option for disable mute and kick

master
Hristo Terezov 5 年之前
父節點
當前提交
3a871cbed8

+ 9
- 0
config.js 查看文件

@@ -459,6 +459,15 @@ var config = {
459 459
     //    downloadAppsUrl: 'https://docs.example.com/our-apps.html'
460 460
     // },
461 461
 
462
+    // Options related to the remote participant menu.
463
+    // remoteVideoMenu: {
464
+    //     // If set to true the 'Kick out' button will be disabled.
465
+    //     disableKick: true
466
+    // },
467
+
468
+    // If set to true all muting operations of remote participants will be disabled.
469
+    // disableRemoteMute: true,
470
+
462 471
     // List of undocumented settings used in jitsi-meet
463 472
     /**
464 473
      _immediateReloadThreshold

+ 2
- 0
react/features/base/config/configWhitelist.js 查看文件

@@ -88,6 +88,7 @@ export default [
88 88
     'disableLocalVideoFlip',
89 89
     'disableNS',
90 90
     'disableRemoteControl',
91
+    'disableRemoteMute',
91 92
     'disableRtx',
92 93
     'disableSuspendVideo',
93 94
     'disableThirdPartyRequests',
@@ -126,6 +127,7 @@ export default [
126 127
     'pcStatsInterval',
127 128
     'preferH264',
128 129
     'requireDisplayName',
130
+    'remoteVideoMenu',
129 131
     'resolution',
130 132
     'startAudioMuted',
131 133
     'startAudioOnly',

+ 3
- 1
react/features/base/config/reducer.js 查看文件

@@ -43,7 +43,9 @@ const INITIAL_RN_STATE = {
43 43
     p2p: {
44 44
         disableH264: false,
45 45
         preferH264: true
46
-    }
46
+    },
47
+
48
+    remoteVideoMenu: {}
47 49
 };
48 50
 
49 51
 ReducerRegistry.register('features/base/config', (state = _getInitialState(), action) => {

+ 31
- 9
react/features/remote-video-menu/components/native/RemoteVideoMenu.js 查看文件

@@ -40,6 +40,16 @@ type Props = {
40 40
      */
41 41
     _bottomSheetStyles: StyleType,
42 42
 
43
+    /**
44
+     * Whether or not to display the kick button.
45
+     */
46
+    _disableKick: boolean,
47
+
48
+    /**
49
+     * Whether or not to display the remote mute buttons.
50
+     */
51
+    _disableRemoteMute: boolean,
52
+
43 53
     /**
44 54
      * True if the menu is currently open, false otherwise.
45 55
      */
@@ -75,7 +85,7 @@ class RemoteVideoMenu extends Component<Props> {
75 85
      * @inheritdoc
76 86
      */
77 87
     render() {
78
-        const { participant } = this.props;
88
+        const { _disableKick, _disableRemoteMute, participant } = this.props;
79 89
         const buttonProps = {
80 90
             afterClick: this._onCancel,
81 91
             showLabel: true,
@@ -83,6 +93,19 @@ class RemoteVideoMenu extends Component<Props> {
83 93
             styles: this.props._bottomSheetStyles.buttons
84 94
         };
85 95
 
96
+        const buttons = [];
97
+
98
+        if (!_disableRemoteMute) {
99
+            buttons.push(<MuteButton { ...buttonProps } />);
100
+        }
101
+
102
+        if (!_disableKick) {
103
+            buttons.push(<KickButton { ...buttonProps } />);
104
+        }
105
+
106
+        buttons.push(<PinButton { ...buttonProps } />);
107
+        buttons.push(<PrivateMessageButton { ...buttonProps } />);
108
+
86 109
         return (
87 110
             <BottomSheet onCancel = { this._onCancel }>
88 111
                 <View style = { styles.participantNameContainer }>
@@ -93,10 +116,7 @@ class RemoteVideoMenu extends Component<Props> {
93 116
                         { this.props._participantDisplayName }
94 117
                     </Text>
95 118
                 </View>
96
-                <MuteButton { ...buttonProps } />
97
-                <KickButton { ...buttonProps } />
98
-                <PinButton { ...buttonProps } />
99
-                <PrivateMessageButton { ...buttonProps } />
119
+                { buttons }
100 120
             </BottomSheet>
101 121
         );
102 122
     }
@@ -130,13 +150,15 @@ class RemoteVideoMenu extends Component<Props> {
130 150
  */
131 151
 function _mapStateToProps(state, ownProps) {
132 152
     const { participant } = ownProps;
153
+    const { remoteVideoMenu = {}, disableRemoteMute } = state['features/base/config'];
154
+    const { disableKick } = remoteVideoMenu;
133 155
 
134 156
     return {
135
-        _bottomSheetStyles:
136
-            ColorSchemeRegistry.get(state, 'BottomSheet'),
157
+        _bottomSheetStyles: ColorSchemeRegistry.get(state, 'BottomSheet'),
158
+        _disableKick: Boolean(disableKick),
159
+        _disableRemoteMute: Boolean(disableRemoteMute),
137 160
         _isOpen: isDialogOpen(state, RemoteVideoMenu_),
138
-        _participantDisplayName: getParticipantDisplayName(
139
-            state, participant.id)
161
+        _participantDisplayName: getParticipantDisplayName(state, participant.id)
140 162
     };
141 163
 }
142 164
 

+ 38
- 17
react/features/remote-video-menu/components/web/RemoteVideoMenuTriggerButton.js 查看文件

@@ -26,6 +26,16 @@ declare var interfaceConfig: Object;
26 26
  */
27 27
 type Props = {
28 28
 
29
+    /**
30
+     * Whether or not to display the kick button.
31
+     */
32
+    _disableKick: boolean,
33
+
34
+    /**
35
+     * Whether or not to display the remote mute buttons.
36
+     */
37
+    _disableRemoteMute: Boolean,
38
+
29 39
     /**
30 40
      * Whether or not the participant is a conference moderator.
31 41
      */
@@ -157,6 +167,8 @@ class RemoteVideoMenuTriggerButton extends Component<Props> {
157 167
      */
158 168
     _renderRemoteVideoMenu() {
159 169
         const {
170
+            _disableKick,
171
+            _disableRemoteMute,
160 172
             _isModerator,
161 173
             initialVolumeValue,
162 174
             isAudioMuted,
@@ -169,22 +181,27 @@ class RemoteVideoMenuTriggerButton extends Component<Props> {
169 181
         const buttons = [];
170 182
 
171 183
         if (_isModerator) {
172
-            buttons.push(
173
-                <MuteButton
174
-                    isAudioMuted = { isAudioMuted }
175
-                    key = 'mute'
176
-                    participantID = { participantID } />
177
-            );
178
-            buttons.push(
179
-                <MuteEveryoneElseButton
180
-                    key = 'mute-others'
181
-                    participantID = { participantID } />
182
-            );
183
-            buttons.push(
184
-                <KickButton
185
-                    key = 'kick'
186
-                    participantID = { participantID } />
187
-            );
184
+            if (!_disableRemoteMute) {
185
+                buttons.push(
186
+                    <MuteButton
187
+                        isAudioMuted = { isAudioMuted }
188
+                        key = 'mute'
189
+                        participantID = { participantID } />
190
+                );
191
+                buttons.push(
192
+                    <MuteEveryoneElseButton
193
+                        key = 'mute-others'
194
+                        participantID = { participantID } />
195
+                );
196
+            }
197
+
198
+            if (!_disableKick) {
199
+                buttons.push(
200
+                    <KickButton
201
+                        key = 'kick'
202
+                        participantID = { participantID } />
203
+                );
204
+            }
188 205
         }
189 206
 
190 207
         if (remoteControlState) {
@@ -236,9 +253,13 @@ class RemoteVideoMenuTriggerButton extends Component<Props> {
236 253
  */
237 254
 function _mapStateToProps(state) {
238 255
     const participant = getLocalParticipant(state);
256
+    const { remoteVideoMenu = {}, disableRemoteMute } = state['features/base/config'];
257
+    const { disableKick } = remoteVideoMenu;
239 258
 
240 259
     return {
241
-        _isModerator: Boolean(participant?.role === PARTICIPANT_ROLE.MODERATOR)
260
+        _isModerator: Boolean(participant?.role === PARTICIPANT_ROLE.MODERATOR),
261
+        _disableKick: Boolean(disableKick),
262
+        _disableRemoteMute: Boolean(disableRemoteMute)
242 263
     };
243 264
 }
244 265
 

+ 2
- 1
react/features/toolbox/components/web/MuteEveryoneButton.js 查看文件

@@ -64,11 +64,12 @@ function _mapStateToProps(state: Object, ownProps: Props) {
64 64
     const localParticipant = getLocalParticipant(state);
65 65
     const isModerator = localParticipant.role === PARTICIPANT_ROLE.MODERATOR;
66 66
     const { visible } = ownProps;
67
+    const { disableRemoteMute } = state['features/base/config'];
67 68
 
68 69
     return {
69 70
         isModerator,
70 71
         localParticipantId: localParticipant.id,
71
-        visible: visible && isModerator
72
+        visible: visible && isModerator && !disableRemoteMute
72 73
     };
73 74
 }
74 75
 

Loading…
取消
儲存