|
|
|
@ -1,11 +1,16 @@ |
|
|
|
|
|
|
|
|
|
import _ from 'lodash'; |
|
|
|
|
import { batch } from 'react-redux'; |
|
|
|
|
|
|
|
|
|
import { IStore } from '../../app/types'; |
|
|
|
|
import { showNotification } from '../../notifications/actions'; |
|
|
|
|
import { NOTIFICATION_TIMEOUT_TYPE } from '../../notifications/constants'; |
|
|
|
|
import { getCurrentConference } from '../conference/functions'; |
|
|
|
|
import { getSsrcRewritingFeatureFlag } from '../config/functions.any'; |
|
|
|
|
import { getSsrcRewritingFeatureFlag, hasBeenNotified, isNextToSpeak } from '../config/functions.any'; |
|
|
|
|
import { VIDEO_TYPE } from '../media/constants'; |
|
|
|
|
import StateListenerRegistry from '../redux/StateListenerRegistry'; |
|
|
|
|
|
|
|
|
|
import { NOTIFIED_TO_SPEAK } from './actionTypes'; |
|
|
|
|
import { createVirtualScreenshareParticipant, participantLeft } from './actions'; |
|
|
|
|
import { |
|
|
|
|
getParticipantById, |
|
|
|
@ -25,6 +30,15 @@ StateListenerRegistry.register( |
|
|
|
|
&& _updateScreenshareParticipantsBasedOnPresence(store) |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
StateListenerRegistry.register( |
|
|
|
|
/* selector */ state => state['features/base/participants'].raisedHandsQueue, |
|
|
|
|
/* listener */ (raisedHandsQueue, store) => { |
|
|
|
|
if (isNextToSpeak(store.getState()) && !hasBeenNotified(store.getState())) { |
|
|
|
|
_notifyNextSpeakerInRaisedHandQueue(store); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Compares the old and new screenshare lists provided and creates/removes the virtual screenshare participant |
|
|
|
|
* tiles accodingly. |
|
|
|
@ -121,3 +135,23 @@ function _updateScreenshareParticipantsBasedOnPresence(store: IStore): void { |
|
|
|
|
|
|
|
|
|
_createOrRemoveVirtualParticipants(previousScreenshareSourceNames, currentScreenshareSourceNames, store); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Handles notifying the next speaker in the raised hand queue. |
|
|
|
|
* |
|
|
|
|
* @param {*} store - The redux store. |
|
|
|
|
* @returns {void} |
|
|
|
|
*/ |
|
|
|
|
function _notifyNextSpeakerInRaisedHandQueue(store: IStore): void { |
|
|
|
|
const { dispatch } = store; |
|
|
|
|
|
|
|
|
|
batch(() => { |
|
|
|
|
dispatch(showNotification({ |
|
|
|
|
titleKey: 'notify.nextToSpeak', |
|
|
|
|
maxLines: 2 |
|
|
|
|
}, NOTIFICATION_TIMEOUT_TYPE.MEDIUM)); |
|
|
|
|
dispatch({ |
|
|
|
|
type: NOTIFIED_TO_SPEAK |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|