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
pull/9913/head jitsi-meet_6305
dimitardelchev93 3 years ago committed by GitHub
parent f1bf8e5f9a
commit 0bad0d9ecf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      config.js
  2. 1
      react/features/base/config/configWhitelist.js
  3. 10
      react/features/base/config/functions.any.js
  4. 9
      react/features/base/participants/middleware.js

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

@ -103,6 +103,7 @@ export default [
'disableRtx',
'disableShortcuts',
'disableShowMoreStats',
'disableRemoveRaisedHandOnFocus',
'disableSpeakerStatsSearch',
'disableSimulcast',
'disableThirdPartyRequests',

@ -49,6 +49,16 @@ export function getMeetingRegion(state: Object) {
return state['features/base/config']?.deploymentInfo?.region || '';
}
/**
* Selector used to get the disableRemoveRaisedHandOnFocus.
*
* @param {Object} state - The global state.
* @returns {boolean}
*/
export function getDisableRemoveRaisedHandOnFocus(state: Object) {
return state['features/base/config']?.disableRemoveRaisedHandOnFocus || false;
}
/**
* Selector used to get the endpoint used for fetching the recording.
*

@ -13,6 +13,7 @@ import {
forEachConference,
getCurrentConference
} from '../conference';
import { getDisableRemoveRaisedHandOnFocus } from '../config/functions.any';
import { JitsiConferenceEvents } from '../lib-jitsi-meet';
import { MiddlewareRegistry, StateListenerRegistry } from '../redux';
import { playSound, registerSound, unregisterSound } from '../sounds';
@ -81,7 +82,8 @@ MiddlewareRegistry.register(store => next => action => {
// and only if it was set when this is the local participant
const { conference, id } = action.participant;
const participant = getLocalParticipant(store.getState());
const state = store.getState();
const participant = getLocalParticipant(state);
const isLocal = participant && participant.id === id;
if (isLocal && participant.raisedHand === undefined) {
@ -90,13 +92,14 @@ MiddlewareRegistry.register(store => next => action => {
break;
}
participant
&& store.dispatch(participantUpdated({
if (!getDisableRemoveRaisedHandOnFocus(state)) {
participant && store.dispatch(participantUpdated({
conference,
id,
local: isLocal,
raisedHand: false
}));
}
break;
}

Loading…
Cancel
Save