Parcourir la source

feat: Add configuration to disable removing raised hand on dominant speaker (#9641)

* Add configuration to disable removing raised hand on dominant speaker change

* Fix lint problem

* Avoid dispatching unnecessary action

* Fix lint problem
master
dimitardelchev93 il y a 4 ans
Parent
révision
0bad0d9ecf
Aucun compte lié à l'adresse e-mail de l'auteur

+ 3
- 0
config.js Voir le fichier

@@ -144,6 +144,9 @@ var config = {
144 144
     // Sets the preferred resolution (height) for local video. Defaults to 720.
145 145
     // resolution: 720,
146 146
 
147
+    // Specifies whether the raised hand will hide when someone becomes a dominant speaker or not
148
+    // disableRemoveRaisedHandOnFocus: false,
149
+
147 150
     // Specifies whether there will be a search field in speaker stats or not
148 151
     // disableSpeakerStatsSearch: false,
149 152
 

+ 1
- 0
react/features/base/config/configWhitelist.js Voir le fichier

@@ -103,6 +103,7 @@ export default [
103 103
     'disableRtx',
104 104
     'disableShortcuts',
105 105
     'disableShowMoreStats',
106
+    'disableRemoveRaisedHandOnFocus',
106 107
     'disableSpeakerStatsSearch',
107 108
     'disableSimulcast',
108 109
     'disableThirdPartyRequests',

+ 10
- 0
react/features/base/config/functions.any.js Voir le fichier

@@ -49,6 +49,16 @@ export function getMeetingRegion(state: Object) {
49 49
     return state['features/base/config']?.deploymentInfo?.region || '';
50 50
 }
51 51
 
52
+/**
53
+ * Selector used to get the disableRemoveRaisedHandOnFocus.
54
+ *
55
+ * @param {Object} state - The global state.
56
+ * @returns {boolean}
57
+ */
58
+export function getDisableRemoveRaisedHandOnFocus(state: Object) {
59
+    return state['features/base/config']?.disableRemoveRaisedHandOnFocus || false;
60
+}
61
+
52 62
 /**
53 63
  * Selector used to get the endpoint used for fetching the recording.
54 64
  *

+ 6
- 3
react/features/base/participants/middleware.js Voir le fichier

@@ -13,6 +13,7 @@ import {
13 13
     forEachConference,
14 14
     getCurrentConference
15 15
 } from '../conference';
16
+import { getDisableRemoveRaisedHandOnFocus } from '../config/functions.any';
16 17
 import { JitsiConferenceEvents } from '../lib-jitsi-meet';
17 18
 import { MiddlewareRegistry, StateListenerRegistry } from '../redux';
18 19
 import { playSound, registerSound, unregisterSound } from '../sounds';
@@ -81,7 +82,8 @@ MiddlewareRegistry.register(store => next => action => {
81 82
         // and only if it was set when this is the local participant
82 83
 
83 84
         const { conference, id } = action.participant;
84
-        const participant = getLocalParticipant(store.getState());
85
+        const state = store.getState();
86
+        const participant = getLocalParticipant(state);
85 87
         const isLocal = participant && participant.id === id;
86 88
 
87 89
         if (isLocal && participant.raisedHand === undefined) {
@@ -90,13 +92,14 @@ MiddlewareRegistry.register(store => next => action => {
90 92
             break;
91 93
         }
92 94
 
93
-        participant
94
-            && store.dispatch(participantUpdated({
95
+        if (!getDisableRemoveRaisedHandOnFocus(state)) {
96
+            participant && store.dispatch(participantUpdated({
95 97
                 conference,
96 98
                 id,
97 99
                 local: isLocal,
98 100
                 raisedHand: false
99 101
             }));
102
+        }
100 103
 
101 104
         break;
102 105
     }

Chargement…
Annuler
Enregistrer