瀏覽代碼

feat(raise-hand) group options in config.js

factor2
Mengyuan Liu 10 月之前
父節點
當前提交
8299aa498b
沒有連結到貢獻者的電子郵件帳戶。

+ 17
- 0
config.js 查看文件

232
     // Sets the preferred resolution (height) for local video. Defaults to 720.
232
     // Sets the preferred resolution (height) for local video. Defaults to 720.
233
     // resolution: 720,
233
     // resolution: 720,
234
 
234
 
235
+    // DEPRECATED. Please use raisedHands.disableRemoveRaisedHandOnFocus instead.
235
     // Specifies whether the raised hand will hide when someone becomes a dominant speaker or not
236
     // Specifies whether the raised hand will hide when someone becomes a dominant speaker or not
236
     // disableRemoveRaisedHandOnFocus: false,
237
     // disableRemoveRaisedHandOnFocus: false,
237
 
238
 
239
+    // Specifies which raised hand related config should be set.
240
+    // raisedHands: {
241
+    //     // Specifies whether the raised hand can be lowered by moderator.
242
+    //     disableLowerHandByModerator: false,
243
+
244
+    //     // Specifies whether there is a notification before hiding the raised hand
245
+    //     // when someone becomes the dominant speaker.
246
+    //     disableLowerHandNotification: true,
247
+
248
+    //     // Specifies whether there is a notification when you are the next speaker in line.
249
+    //     disableNextSpeakerNotification: false,
250
+
251
+    //     // Specifies whether the raised hand will hide when someone becomes a dominant speaker or not.
252
+    //     disableRemoveRaisedHandOnFocus: false,
253
+    // },
254
+
238
     // speakerStats: {
255
     // speakerStats: {
239
     //     // Specifies whether the speaker stats is enable or not.
256
     //     // Specifies whether the speaker stats is enable or not.
240
     //     disabled: false,
257
     //     disabled: false,

+ 6
- 0
react/features/base/config/configType.ts 查看文件

488
         hideExtraJoinButtons?: Array<string>;
488
         hideExtraJoinButtons?: Array<string>;
489
     };
489
     };
490
     prejoinPageEnabled?: boolean;
490
     prejoinPageEnabled?: boolean;
491
+    raisedHands?: {
492
+        disableLowerHandByModerator?: boolean;
493
+        disableLowerHandNotification?: boolean;
494
+        disableNextSpeakerNotification?: boolean;
495
+        disableRemoveRaisedHandOnFocus?: boolean;
496
+    };
491
     readOnlyName?: boolean;
497
     readOnlyName?: boolean;
492
     recordingLimit?: {
498
     recordingLimit?: {
493
         appName?: string;
499
         appName?: string;

+ 1
- 0
react/features/base/config/configWhitelist.ts 查看文件

201
     'preferVisitor',
201
     'preferVisitor',
202
     'prejoinConfig',
202
     'prejoinConfig',
203
     'prejoinPageEnabled',
203
     'prejoinPageEnabled',
204
+    'raisedHands',
204
     'recordingService',
205
     'recordingService',
205
     'requireDisplayName',
206
     'requireDisplayName',
206
     'remoteVideoMenu',
207
     'remoteVideoMenu',

+ 31
- 1
react/features/base/config/functions.any.ts 查看文件

89
  * @returns {boolean}
89
  * @returns {boolean}
90
  */
90
  */
91
 export function getDisableRemoveRaisedHandOnFocus(state: IReduxState) {
91
 export function getDisableRemoveRaisedHandOnFocus(state: IReduxState) {
92
-    return state['features/base/config']?.disableRemoveRaisedHandOnFocus || false;
92
+    return state['features/base/config']?.raisedHands?.disableRemoveRaisedHandOnFocus || false;
93
+}
94
+
95
+/**
96
+ * Selector used to get the disableLowerHandByModerator.
97
+ *
98
+ * @param {Object} state - The global state.
99
+ * @returns {boolean}
100
+ */
101
+export function getDisableLowerHandByModerator(state: IReduxState) {
102
+    return state['features/base/config']?.raisedHands?.disableLowerHandByModerator || false;
103
+}
104
+
105
+/**
106
+ * Selector used to get the disableLowerHandNotification.
107
+ *
108
+ * @param {Object} state - The global state.
109
+ * @returns {boolean}
110
+ */
111
+export function getDisableLowerHandNotification(state: IReduxState) {
112
+    return state['features/base/config']?.raisedHands?.disableLowerHandNotification || true;
113
+}
114
+
115
+/**
116
+ * Selector used to get the disableNextSpeakerNotification.
117
+ *
118
+ * @param {Object} state - The global state.
119
+ * @returns {boolean}
120
+ */
121
+export function getDisableNextSpeakerNotification(state: IReduxState) {
122
+    return state['features/base/config']?.raisedHands?.disableNextSpeakerNotification || false;
93
 }
123
 }
94
 
124
 
95
 /**
125
 /**

+ 6
- 0
react/features/base/config/reducer.ts 查看文件

442
         newValue.disabledSounds.unshift('INCOMING_MSG_SOUND');
442
         newValue.disabledSounds.unshift('INCOMING_MSG_SOUND');
443
     }
443
     }
444
 
444
 
445
+    newValue.raisedHands = newValue.raisedHands || {};
446
+
447
+    if (oldValue.disableRemoveRaisedHandOnFocus) {
448
+        newValue.raisedHands.disableRemoveRaisedHandOnFocus = oldValue.disableRemoveRaisedHandOnFocus;
449
+    }
450
+
445
     if (oldValue.stereo || oldValue.opusMaxAverageBitrate) {
451
     if (oldValue.stereo || oldValue.opusMaxAverageBitrate) {
446
         newValue.audioQuality = {
452
         newValue.audioQuality = {
447
             opusMaxAverageBitrate: oldValue.audioQuality?.opusMaxAverageBitrate ?? oldValue.opusMaxAverageBitrate,
453
             opusMaxAverageBitrate: oldValue.audioQuality?.opusMaxAverageBitrate ?? oldValue.opusMaxAverageBitrate,

+ 9
- 2
react/features/base/participants/subscriber.ts 查看文件

6
 import { hideNotification, showNotification } from '../../notifications/actions';
6
 import { hideNotification, showNotification } from '../../notifications/actions';
7
 import { NOTIFICATION_TIMEOUT_TYPE, RAISE_HAND_NOTIFICATION_ID } from '../../notifications/constants';
7
 import { NOTIFICATION_TIMEOUT_TYPE, RAISE_HAND_NOTIFICATION_ID } from '../../notifications/constants';
8
 import { getCurrentConference } from '../conference/functions';
8
 import { getCurrentConference } from '../conference/functions';
9
-import { getSsrcRewritingFeatureFlag, hasBeenNotified, isNextToSpeak } from '../config/functions.any';
9
+import {
10
+    getDisableNextSpeakerNotification,
11
+    getSsrcRewritingFeatureFlag,
12
+    hasBeenNotified,
13
+    isNextToSpeak } from '../config/functions.any';
10
 import { VIDEO_TYPE } from '../media/constants';
14
 import { VIDEO_TYPE } from '../media/constants';
11
 import StateListenerRegistry from '../redux/StateListenerRegistry';
15
 import StateListenerRegistry from '../redux/StateListenerRegistry';
12
 
16
 
33
 StateListenerRegistry.register(
37
 StateListenerRegistry.register(
34
     /* selector */ state => state['features/base/participants'].raisedHandsQueue,
38
     /* selector */ state => state['features/base/participants'].raisedHandsQueue,
35
     /* listener */ (raisedHandsQueue, store) => {
39
     /* listener */ (raisedHandsQueue, store) => {
36
-        if (raisedHandsQueue.length && isNextToSpeak(store.getState()) && !hasBeenNotified(store.getState())) {
40
+        if (raisedHandsQueue.length
41
+            && isNextToSpeak(store.getState())
42
+            && !hasBeenNotified(store.getState())
43
+            && !getDisableNextSpeakerNotification(store.getState())) {
37
             _notifyNextSpeakerInRaisedHandQueue(store);
44
             _notifyNextSpeakerInRaisedHandQueue(store);
38
         }
45
         }
39
         if (!raisedHandsQueue[0]) {
46
         if (!raisedHandsQueue[0]) {

+ 5
- 2
react/features/conference/middleware.any.ts 查看文件

13
     ENDPOINT_MESSAGE_RECEIVED
13
     ENDPOINT_MESSAGE_RECEIVED
14
 } from '../base/conference/actionTypes';
14
 } from '../base/conference/actionTypes';
15
 import { getCurrentConference } from '../base/conference/functions';
15
 import { getCurrentConference } from '../base/conference/functions';
16
+import { getDisableLowerHandByModerator } from '../base/config/functions.any';
16
 import { getURLWithoutParamsNormalized } from '../base/connection/utils';
17
 import { getURLWithoutParamsNormalized } from '../base/connection/utils';
17
 import { hideDialog } from '../base/dialog/actions';
18
 import { hideDialog } from '../base/dialog/actions';
18
 import { isDialogOpen } from '../base/dialog/functions';
19
 import { isDialogOpen } from '../base/dialog/functions';
75
     }
76
     }
76
     case ENDPOINT_MESSAGE_RECEIVED: {
77
     case ENDPOINT_MESSAGE_RECEIVED: {
77
         const { participant, data } = action;
78
         const { participant, data } = action;
78
-        const { dispatch } = store;
79
+        const { dispatch, getState } = store;
79
 
80
 
80
-        if (data.name === LOWER_HAND_MESSAGE && participant.isModerator()) {
81
+        if (data.name === LOWER_HAND_MESSAGE
82
+            && participant.isModerator()
83
+            && !getDisableLowerHandByModerator(getState())) {
81
             dispatch(raiseHand(false));
84
             dispatch(raiseHand(false));
82
         }
85
         }
83
         break;
86
         break;

Loading…
取消
儲存