Преглед на файлове

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

factor2
Mengyuan Liu преди 10 месеца
родител
ревизия
8299aa498b
No account linked to committer's email address

+ 17
- 0
config.js Целия файл

@@ -232,9 +232,26 @@ var config = {
232 232
     // Sets the preferred resolution (height) for local video. Defaults to 720.
233 233
     // resolution: 720,
234 234
 
235
+    // DEPRECATED. Please use raisedHands.disableRemoveRaisedHandOnFocus instead.
235 236
     // Specifies whether the raised hand will hide when someone becomes a dominant speaker or not
236 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 255
     // speakerStats: {
239 256
     //     // Specifies whether the speaker stats is enable or not.
240 257
     //     disabled: false,

+ 6
- 0
react/features/base/config/configType.ts Целия файл

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

+ 1
- 0
react/features/base/config/configWhitelist.ts Целия файл

@@ -201,6 +201,7 @@ export default [
201 201
     'preferVisitor',
202 202
     'prejoinConfig',
203 203
     'prejoinPageEnabled',
204
+    'raisedHands',
204 205
     'recordingService',
205 206
     'requireDisplayName',
206 207
     'remoteVideoMenu',

+ 31
- 1
react/features/base/config/functions.any.ts Целия файл

@@ -89,7 +89,37 @@ export function getFeatureFlag(state: IReduxState, featureFlag: string) {
89 89
  * @returns {boolean}
90 90
  */
91 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,6 +442,12 @@ function _translateLegacyConfig(oldValue: IConfig) {
442 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 451
     if (oldValue.stereo || oldValue.opusMaxAverageBitrate) {
446 452
         newValue.audioQuality = {
447 453
             opusMaxAverageBitrate: oldValue.audioQuality?.opusMaxAverageBitrate ?? oldValue.opusMaxAverageBitrate,

+ 9
- 2
react/features/base/participants/subscriber.ts Целия файл

@@ -6,7 +6,11 @@ import { IStore } from '../../app/types';
6 6
 import { hideNotification, showNotification } from '../../notifications/actions';
7 7
 import { NOTIFICATION_TIMEOUT_TYPE, RAISE_HAND_NOTIFICATION_ID } from '../../notifications/constants';
8 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 14
 import { VIDEO_TYPE } from '../media/constants';
11 15
 import StateListenerRegistry from '../redux/StateListenerRegistry';
12 16
 
@@ -33,7 +37,10 @@ StateListenerRegistry.register(
33 37
 StateListenerRegistry.register(
34 38
     /* selector */ state => state['features/base/participants'].raisedHandsQueue,
35 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 44
             _notifyNextSpeakerInRaisedHandQueue(store);
38 45
         }
39 46
         if (!raisedHandsQueue[0]) {

+ 5
- 2
react/features/conference/middleware.any.ts Целия файл

@@ -13,6 +13,7 @@ import {
13 13
     ENDPOINT_MESSAGE_RECEIVED
14 14
 } from '../base/conference/actionTypes';
15 15
 import { getCurrentConference } from '../base/conference/functions';
16
+import { getDisableLowerHandByModerator } from '../base/config/functions.any';
16 17
 import { getURLWithoutParamsNormalized } from '../base/connection/utils';
17 18
 import { hideDialog } from '../base/dialog/actions';
18 19
 import { isDialogOpen } from '../base/dialog/functions';
@@ -75,9 +76,11 @@ MiddlewareRegistry.register(store => next => action => {
75 76
     }
76 77
     case ENDPOINT_MESSAGE_RECEIVED: {
77 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 84
             dispatch(raiseHand(false));
82 85
         }
83 86
         break;

Loading…
Отказ
Запис