|
@@ -1,11 +1,16 @@
|
|
1
|
+
|
1
|
2
|
import _ from 'lodash';
|
|
3
|
+import { batch } from 'react-redux';
|
2
|
4
|
|
3
|
5
|
import { IStore } from '../../app/types';
|
|
6
|
+import { showNotification } from '../../notifications/actions';
|
|
7
|
+import { NOTIFICATION_TIMEOUT_TYPE } from '../../notifications/constants';
|
4
|
8
|
import { getCurrentConference } from '../conference/functions';
|
5
|
|
-import { getSsrcRewritingFeatureFlag } from '../config/functions.any';
|
|
9
|
+import { getSsrcRewritingFeatureFlag, hasBeenNotified, isNextToSpeak } from '../config/functions.any';
|
6
|
10
|
import { VIDEO_TYPE } from '../media/constants';
|
7
|
11
|
import StateListenerRegistry from '../redux/StateListenerRegistry';
|
8
|
12
|
|
|
13
|
+import { NOTIFIED_TO_SPEAK } from './actionTypes';
|
9
|
14
|
import { createVirtualScreenshareParticipant, participantLeft } from './actions';
|
10
|
15
|
import {
|
11
|
16
|
getParticipantById,
|
|
@@ -25,6 +30,15 @@ StateListenerRegistry.register(
|
25
|
30
|
&& _updateScreenshareParticipantsBasedOnPresence(store)
|
26
|
31
|
);
|
27
|
32
|
|
|
33
|
+StateListenerRegistry.register(
|
|
34
|
+ /* selector */ state => state['features/base/participants'].raisedHandsQueue,
|
|
35
|
+ /* listener */ (raisedHandsQueue, store) => {
|
|
36
|
+ if (isNextToSpeak(store.getState()) && !hasBeenNotified(store.getState())) {
|
|
37
|
+ _notifyNextSpeakerInRaisedHandQueue(store);
|
|
38
|
+ }
|
|
39
|
+ }
|
|
40
|
+);
|
|
41
|
+
|
28
|
42
|
/**
|
29
|
43
|
* Compares the old and new screenshare lists provided and creates/removes the virtual screenshare participant
|
30
|
44
|
* tiles accodingly.
|
|
@@ -121,3 +135,23 @@ function _updateScreenshareParticipantsBasedOnPresence(store: IStore): void {
|
121
|
135
|
|
122
|
136
|
_createOrRemoveVirtualParticipants(previousScreenshareSourceNames, currentScreenshareSourceNames, store);
|
123
|
137
|
}
|
|
138
|
+
|
|
139
|
+/**
|
|
140
|
+ * Handles notifying the next speaker in the raised hand queue.
|
|
141
|
+ *
|
|
142
|
+ * @param {*} store - The redux store.
|
|
143
|
+ * @returns {void}
|
|
144
|
+ */
|
|
145
|
+function _notifyNextSpeakerInRaisedHandQueue(store: IStore): void {
|
|
146
|
+ const { dispatch } = store;
|
|
147
|
+
|
|
148
|
+ batch(() => {
|
|
149
|
+ dispatch(showNotification({
|
|
150
|
+ titleKey: 'notify.nextToSpeak',
|
|
151
|
+ maxLines: 2
|
|
152
|
+ }, NOTIFICATION_TIMEOUT_TYPE.MEDIUM));
|
|
153
|
+ dispatch({
|
|
154
|
+ type: NOTIFIED_TO_SPEAK
|
|
155
|
+ });
|
|
156
|
+ });
|
|
157
|
+}
|