Przeglądaj źródła

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

master
Hristo Terezov 5 lat temu
rodzic
commit
3a871cbed8

+ 9
- 0
config.js Wyświetl plik

459
     //    downloadAppsUrl: 'https://docs.example.com/our-apps.html'
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
     // List of undocumented settings used in jitsi-meet
471
     // List of undocumented settings used in jitsi-meet
463
     /**
472
     /**
464
      _immediateReloadThreshold
473
      _immediateReloadThreshold

+ 2
- 0
react/features/base/config/configWhitelist.js Wyświetl plik

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

+ 3
- 1
react/features/base/config/reducer.js Wyświetl plik

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

+ 31
- 9
react/features/remote-video-menu/components/native/RemoteVideoMenu.js Wyświetl plik

40
      */
40
      */
41
     _bottomSheetStyles: StyleType,
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
      * True if the menu is currently open, false otherwise.
54
      * True if the menu is currently open, false otherwise.
45
      */
55
      */
75
      * @inheritdoc
85
      * @inheritdoc
76
      */
86
      */
77
     render() {
87
     render() {
78
-        const { participant } = this.props;
88
+        const { _disableKick, _disableRemoteMute, participant } = this.props;
79
         const buttonProps = {
89
         const buttonProps = {
80
             afterClick: this._onCancel,
90
             afterClick: this._onCancel,
81
             showLabel: true,
91
             showLabel: true,
83
             styles: this.props._bottomSheetStyles.buttons
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
         return (
109
         return (
87
             <BottomSheet onCancel = { this._onCancel }>
110
             <BottomSheet onCancel = { this._onCancel }>
88
                 <View style = { styles.participantNameContainer }>
111
                 <View style = { styles.participantNameContainer }>
93
                         { this.props._participantDisplayName }
116
                         { this.props._participantDisplayName }
94
                     </Text>
117
                     </Text>
95
                 </View>
118
                 </View>
96
-                <MuteButton { ...buttonProps } />
97
-                <KickButton { ...buttonProps } />
98
-                <PinButton { ...buttonProps } />
99
-                <PrivateMessageButton { ...buttonProps } />
119
+                { buttons }
100
             </BottomSheet>
120
             </BottomSheet>
101
         );
121
         );
102
     }
122
     }
130
  */
150
  */
131
 function _mapStateToProps(state, ownProps) {
151
 function _mapStateToProps(state, ownProps) {
132
     const { participant } = ownProps;
152
     const { participant } = ownProps;
153
+    const { remoteVideoMenu = {}, disableRemoteMute } = state['features/base/config'];
154
+    const { disableKick } = remoteVideoMenu;
133
 
155
 
134
     return {
156
     return {
135
-        _bottomSheetStyles:
136
-            ColorSchemeRegistry.get(state, 'BottomSheet'),
157
+        _bottomSheetStyles: ColorSchemeRegistry.get(state, 'BottomSheet'),
158
+        _disableKick: Boolean(disableKick),
159
+        _disableRemoteMute: Boolean(disableRemoteMute),
137
         _isOpen: isDialogOpen(state, RemoteVideoMenu_),
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 Wyświetl plik

26
  */
26
  */
27
 type Props = {
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
      * Whether or not the participant is a conference moderator.
40
      * Whether or not the participant is a conference moderator.
31
      */
41
      */
157
      */
167
      */
158
     _renderRemoteVideoMenu() {
168
     _renderRemoteVideoMenu() {
159
         const {
169
         const {
170
+            _disableKick,
171
+            _disableRemoteMute,
160
             _isModerator,
172
             _isModerator,
161
             initialVolumeValue,
173
             initialVolumeValue,
162
             isAudioMuted,
174
             isAudioMuted,
169
         const buttons = [];
181
         const buttons = [];
170
 
182
 
171
         if (_isModerator) {
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
         if (remoteControlState) {
207
         if (remoteControlState) {
236
  */
253
  */
237
 function _mapStateToProps(state) {
254
 function _mapStateToProps(state) {
238
     const participant = getLocalParticipant(state);
255
     const participant = getLocalParticipant(state);
256
+    const { remoteVideoMenu = {}, disableRemoteMute } = state['features/base/config'];
257
+    const { disableKick } = remoteVideoMenu;
239
 
258
 
240
     return {
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 Wyświetl plik

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

Ładowanie…
Anuluj
Zapisz