Skip to content

Commit

Permalink
feat: Add configuration to disable removing raised hand on dominant s…
Browse files Browse the repository at this point in the history
…peaker (jitsi#9641)

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

* Fix lint problem

* Avoid dispatching unnecessary action

* Fix lint problem
  • Loading branch information
dimitardelchev93 authored and carotkut94 committed Jan 6, 2022
1 parent 9d6feae commit 224dcec
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 3 deletions.
3 changes: 3 additions & 0 deletions config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,

Expand Down
1 change: 1 addition & 0 deletions react/features/base/config/configWhitelist.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ export default [
'disableRtx',
'disableShortcuts',
'disableShowMoreStats',
'disableRemoveRaisedHandOnFocus',
'disableSpeakerStatsSearch',
'disableSimulcast',
'disableThirdPartyRequests',
Expand Down
10 changes: 10 additions & 0 deletions react/features/base/config/functions.any.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down
9 changes: 6 additions & 3 deletions react/features/base/participants/middleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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) {
Expand All @@ -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;
}
Expand Down

0 comments on commit 224dcec

Please sign in to comment.