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
This commit is contained in:
dimitardelchev93 2021-09-10 00:53:25 +03:00 committed by GitHub
parent f1bf8e5f9a
commit 0bad0d9ecf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 20 additions and 3 deletions

View File

@ -144,6 +144,9 @@ var config = {
// Sets the preferred resolution (height) for local video. Defaults to 720. // Sets the preferred resolution (height) for local video. Defaults to 720.
// resolution: 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 // Specifies whether there will be a search field in speaker stats or not
// disableSpeakerStatsSearch: false, // disableSpeakerStatsSearch: false,

View File

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

View File

@ -49,6 +49,16 @@ export function getMeetingRegion(state: Object) {
return state['features/base/config']?.deploymentInfo?.region || ''; 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. * Selector used to get the endpoint used for fetching the recording.
* *

View File

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