|
|
@@ -32,7 +32,7 @@ import {
|
|
32
|
32
|
/**
|
|
33
|
33
|
* Implements the middleware of the feature base/conference.
|
|
34
|
34
|
*
|
|
35
|
|
- * @param {Store} store - Redux store.
|
|
|
35
|
+ * @param {Store} store - The redux store.
|
|
36
|
36
|
* @returns {Function}
|
|
37
|
37
|
*/
|
|
38
|
38
|
MiddlewareRegistry.register(store => next => action => {
|
|
|
@@ -40,13 +40,13 @@ MiddlewareRegistry.register(store => next => action => {
|
|
40
|
40
|
case CONNECTION_ESTABLISHED:
|
|
41
|
41
|
return _connectionEstablished(store, next, action);
|
|
42
|
42
|
|
|
43
|
|
- case CONFERENCE_JOINED:
|
|
44
|
|
- return _conferenceJoined(store, next, action);
|
|
45
|
|
-
|
|
46
|
43
|
case CONFERENCE_FAILED:
|
|
47
|
44
|
case CONFERENCE_LEFT:
|
|
48
|
45
|
return _conferenceFailedOrLeft(store, next, action);
|
|
49
|
46
|
|
|
|
47
|
+ case CONFERENCE_JOINED:
|
|
|
48
|
+ return _conferenceJoined(store, next, action);
|
|
|
49
|
+
|
|
50
|
50
|
case PIN_PARTICIPANT:
|
|
51
|
51
|
return _pinParticipant(store, next, action);
|
|
52
|
52
|
|
|
|
@@ -66,13 +66,13 @@ MiddlewareRegistry.register(store => next => action => {
|
|
66
|
66
|
|
|
67
|
67
|
/**
|
|
68
|
68
|
* Notifies the feature base/conference that the action CONNECTION_ESTABLISHED
|
|
69
|
|
- * is being dispatched within a specific Redux store.
|
|
|
69
|
+ * is being dispatched within a specific redux store.
|
|
70
|
70
|
*
|
|
71
|
|
- * @param {Store} store - The Redux store in which the specified action is being
|
|
|
71
|
+ * @param {Store} store - The redux store in which the specified action is being
|
|
72
|
72
|
* dispatched.
|
|
73
|
|
- * @param {Dispatch} next - The Redux dispatch function to dispatch the
|
|
|
73
|
+ * @param {Dispatch} next - The redux dispatch function to dispatch the
|
|
74
|
74
|
* specified action to the specified store.
|
|
75
|
|
- * @param {Action} action - The Redux action CONNECTION_ESTABLISHED which is
|
|
|
75
|
+ * @param {Action} action - The redux action CONNECTION_ESTABLISHED which is
|
|
76
|
76
|
* being dispatched in the specified store.
|
|
77
|
77
|
* @private
|
|
78
|
78
|
* @returns {Object} The new state that is the result of the reduction of the
|
|
|
@@ -91,37 +91,37 @@ function _connectionEstablished(store, next, action) {
|
|
91
|
91
|
}
|
|
92
|
92
|
|
|
93
|
93
|
/**
|
|
94
|
|
- * Does extra sync up on properties that may need to be updated, after
|
|
95
|
|
- * the conference failed or was left.
|
|
|
94
|
+ * Does extra sync up on properties that may need to be updated after the
|
|
|
95
|
+ * conference failed or was left.
|
|
96
|
96
|
*
|
|
97
|
|
- * @param {Store} store - The Redux store in which the specified action is being
|
|
|
97
|
+ * @param {Store} store - The redux store in which the specified action is being
|
|
98
|
98
|
* dispatched.
|
|
99
|
|
- * @param {Dispatch} next - The Redux dispatch function to dispatch the
|
|
|
99
|
+ * @param {Dispatch} next - The redux dispatch function to dispatch the
|
|
100
|
100
|
* specified action to the specified store.
|
|
101
|
|
- * @param {Action} action - The Redux action {@link CONFERENCE_FAILED} or
|
|
|
101
|
+ * @param {Action} action - The redux action {@link CONFERENCE_FAILED} or
|
|
102
|
102
|
* {@link CONFERENCE_LEFT} which is being dispatched in the specified store.
|
|
103
|
103
|
* @private
|
|
104
|
104
|
* @returns {Object} The new state that is the result of the reduction of the
|
|
105
|
105
|
* specified action.
|
|
106
|
106
|
*/
|
|
107
|
|
-function _conferenceFailedOrLeft(store, next, action) {
|
|
|
107
|
+function _conferenceFailedOrLeft({ dispatch, getState }, next, action) {
|
|
108
|
108
|
const result = next(action);
|
|
109
|
|
- const { audioOnly } = store.getState()['features/base/conference'];
|
|
110
|
109
|
|
|
111
|
|
- audioOnly && store.dispatch(setAudioOnly(false));
|
|
|
110
|
+ getState()['features/base/conference'].audioOnly
|
|
|
111
|
+ && dispatch(setAudioOnly(false));
|
|
112
|
112
|
|
|
113
|
113
|
return result;
|
|
114
|
114
|
}
|
|
115
|
115
|
|
|
116
|
116
|
/**
|
|
117
|
|
- * Does extra sync up on properties that may need to be updated, after
|
|
118
|
|
- * the conference was joined.
|
|
|
117
|
+ * Does extra sync up on properties that may need to be updated after the
|
|
|
118
|
+ * conference was joined.
|
|
119
|
119
|
*
|
|
120
|
|
- * @param {Store} store - The Redux store in which the specified action is being
|
|
|
120
|
+ * @param {Store} store - The redux store in which the specified action is being
|
|
121
|
121
|
* dispatched.
|
|
122
|
|
- * @param {Dispatch} next - The Redux dispatch function to dispatch the
|
|
|
122
|
+ * @param {Dispatch} next - The redux dispatch function to dispatch the
|
|
123
|
123
|
* specified action to the specified store.
|
|
124
|
|
- * @param {Action} action - The Redux action CONFERENCE_JOINED which is being
|
|
|
124
|
+ * @param {Action} action - The redux action CONFERENCE_JOINED which is being
|
|
125
|
125
|
* dispatched in the specified store.
|
|
126
|
126
|
* @private
|
|
127
|
127
|
* @returns {Object} The new state that is the result of the reduction of the
|
|
|
@@ -144,14 +144,14 @@ function _conferenceJoined(store, next, action) {
|
|
144
|
144
|
|
|
145
|
145
|
/**
|
|
146
|
146
|
* Notifies the feature base/conference that the action PIN_PARTICIPANT is being
|
|
147
|
|
- * dispatched within a specific Redux store. Pins the specified remote
|
|
|
147
|
+ * dispatched within a specific redux store. Pins the specified remote
|
|
148
|
148
|
* participant in the associated conference, ignores the local participant.
|
|
149
|
149
|
*
|
|
150
|
|
- * @param {Store} store - The Redux store in which the specified action is being
|
|
|
150
|
+ * @param {Store} store - The redux store in which the specified action is being
|
|
151
|
151
|
* dispatched.
|
|
152
|
|
- * @param {Dispatch} next - The Redux dispatch function to dispatch the
|
|
|
152
|
+ * @param {Dispatch} next - The redux dispatch function to dispatch the
|
|
153
|
153
|
* specified action to the specified store.
|
|
154
|
|
- * @param {Action} action - The Redux action PIN_PARTICIPANT which is being
|
|
|
154
|
+ * @param {Action} action - The redux action PIN_PARTICIPANT which is being
|
|
155
|
155
|
* dispatched in the specified store.
|
|
156
|
156
|
* @private
|
|
157
|
157
|
* @returns {Object} The new state that is the result of the reduction of the
|
|
|
@@ -195,26 +195,26 @@ function _pinParticipant(store, next, action) {
|
|
195
|
195
|
* Sets the audio-only flag for the current conference. When audio-only is set,
|
|
196
|
196
|
* local video is muted and last N is set to 0 to avoid receiving remote video.
|
|
197
|
197
|
*
|
|
198
|
|
- * @param {Store} store - The Redux store in which the specified action is being
|
|
|
198
|
+ * @param {Store} store - The redux store in which the specified action is being
|
|
199
|
199
|
* dispatched.
|
|
200
|
|
- * @param {Dispatch} next - The Redux dispatch function to dispatch the
|
|
|
200
|
+ * @param {Dispatch} next - The redux dispatch function to dispatch the
|
|
201
|
201
|
* specified action to the specified store.
|
|
202
|
|
- * @param {Action} action - The Redux action SET_AUDIO_ONLY which is being
|
|
|
202
|
+ * @param {Action} action - The redux action SET_AUDIO_ONLY which is being
|
|
203
|
203
|
* dispatched in the specified store.
|
|
204
|
204
|
* @private
|
|
205
|
205
|
* @returns {Object} The new state that is the result of the reduction of the
|
|
206
|
206
|
* specified action.
|
|
207
|
207
|
*/
|
|
208
|
|
-function _setAudioOnly({ dispatch }, next, action) {
|
|
|
208
|
+function _setAudioOnly({ dispatch, getState }, next, action) {
|
|
209
|
209
|
const result = next(action);
|
|
210
|
210
|
|
|
211
|
|
- const { audioOnly } = action;
|
|
|
211
|
+ const { audioOnly } = getState()['features/base/conference'];
|
|
212
|
212
|
|
|
213
|
213
|
// Set lastN to 0 in case audio-only is desired; leave it as undefined,
|
|
214
|
214
|
// otherwise, and the default lastN value will be chosen automatically.
|
|
215
|
215
|
dispatch(setLastN(audioOnly ? 0 : undefined));
|
|
216
|
216
|
|
|
217
|
|
- // Mute the local video.
|
|
|
217
|
+ // Mute/unmute the local video.
|
|
218
|
218
|
dispatch(setVideoMuted(audioOnly, VIDEO_MUTISM_AUTHORITY.AUDIO_ONLY));
|
|
219
|
219
|
|
|
220
|
220
|
if (typeof APP !== 'undefined') {
|
|
|
@@ -229,11 +229,11 @@ function _setAudioOnly({ dispatch }, next, action) {
|
|
229
|
229
|
/**
|
|
230
|
230
|
* Sets the last N (value) of the video channel in the conference.
|
|
231
|
231
|
*
|
|
232
|
|
- * @param {Store} store - The Redux store in which the specified action is being
|
|
|
232
|
+ * @param {Store} store - The redux store in which the specified action is being
|
|
233
|
233
|
* dispatched.
|
|
234
|
|
- * @param {Dispatch} next - The Redux dispatch function to dispatch the
|
|
|
234
|
+ * @param {Dispatch} next - The redux dispatch function to dispatch the
|
|
235
|
235
|
* specified action to the specified store.
|
|
236
|
|
- * @param {Action} action - The Redux action SET_LASTN which is being dispatched
|
|
|
236
|
+ * @param {Action} action - The redux action SET_LASTN which is being dispatched
|
|
237
|
237
|
* in the specified store.
|
|
238
|
238
|
* @private
|
|
239
|
239
|
* @returns {Object} The new state that is the result of the reduction of the
|
|
|
@@ -257,7 +257,7 @@ function _setLastN(store, next, action) {
|
|
257
|
257
|
* Synchronizes local tracks from state with local tracks in JitsiConference
|
|
258
|
258
|
* instance.
|
|
259
|
259
|
*
|
|
260
|
|
- * @param {Store} store - Redux store.
|
|
|
260
|
+ * @param {Store} store - The redux store.
|
|
261
|
261
|
* @param {Object} action - Action object.
|
|
262
|
262
|
* @private
|
|
263
|
263
|
* @returns {Promise}
|
|
|
@@ -284,13 +284,13 @@ function _syncConferenceLocalTracksWithState(store, action) {
|
|
284
|
284
|
|
|
285
|
285
|
/**
|
|
286
|
286
|
* Notifies the feature base/conference that the action TRACK_ADDED
|
|
287
|
|
- * or TRACK_REMOVED is being dispatched within a specific Redux store.
|
|
|
287
|
+ * or TRACK_REMOVED is being dispatched within a specific redux store.
|
|
288
|
288
|
*
|
|
289
|
|
- * @param {Store} store - The Redux store in which the specified action is being
|
|
|
289
|
+ * @param {Store} store - The redux store in which the specified action is being
|
|
290
|
290
|
* dispatched.
|
|
291
|
|
- * @param {Dispatch} next - The Redux dispatch function to dispatch the
|
|
|
291
|
+ * @param {Dispatch} next - The redux dispatch function to dispatch the
|
|
292
|
292
|
* specified action to the specified store.
|
|
293
|
|
- * @param {Action} action - The Redux action TRACK_ADDED or TRACK_REMOVED which
|
|
|
293
|
+ * @param {Action} action - The redux action TRACK_ADDED or TRACK_REMOVED which
|
|
294
|
294
|
* is being dispatched in the specified store.
|
|
295
|
295
|
* @private
|
|
296
|
296
|
* @returns {Object} The new state that is the result of the reduction of the
|