|
@@ -53,15 +53,15 @@ declare var APP: Object;
|
53
|
53
|
*/
|
54
|
54
|
MiddlewareRegistry.register(store => next => action => {
|
55
|
55
|
switch (action.type) {
|
56
|
|
- case CONNECTION_ESTABLISHED:
|
57
|
|
- return _connectionEstablished(store, next, action);
|
58
|
|
-
|
59
|
56
|
case CONFERENCE_FAILED:
|
60
|
|
- return _conferenceFailed(next, action);
|
|
57
|
+ return _conferenceFailed(store, next, action);
|
61
|
58
|
|
62
|
59
|
case CONFERENCE_JOINED:
|
63
|
60
|
return _conferenceJoined(store, next, action);
|
64
|
61
|
|
|
62
|
+ case CONNECTION_ESTABLISHED:
|
|
63
|
+ return _connectionEstablished(store, next, action);
|
|
64
|
+
|
65
|
65
|
case DATA_CHANNEL_OPENED:
|
66
|
66
|
return _syncReceiveVideoQuality(store, next, action);
|
67
|
67
|
|
|
@@ -88,53 +88,31 @@ MiddlewareRegistry.register(store => next => action => {
|
88
|
88
|
return next(action);
|
89
|
89
|
});
|
90
|
90
|
|
91
|
|
-/**
|
92
|
|
- * Notifies the feature base/conference that the action CONNECTION_ESTABLISHED
|
93
|
|
- * is being dispatched within a specific redux store.
|
94
|
|
- *
|
95
|
|
- * @param {Store} store - The redux store in which the specified action is being
|
96
|
|
- * dispatched.
|
97
|
|
- * @param {Dispatch} next - The redux dispatch function to dispatch the
|
98
|
|
- * specified action to the specified store.
|
99
|
|
- * @param {Action} action - The redux action CONNECTION_ESTABLISHED which is
|
100
|
|
- * being dispatched in the specified store.
|
101
|
|
- * @private
|
102
|
|
- * @returns {Object} The value returned by {@code next(action)}.
|
103
|
|
- */
|
104
|
|
-function _connectionEstablished({ dispatch }, next, action) {
|
105
|
|
- const result = next(action);
|
106
|
|
-
|
107
|
|
- // FIXME: workaround for the web version. Currently the creation of the
|
108
|
|
- // conference is handled by /conference.js
|
109
|
|
- if (typeof APP === 'undefined') {
|
110
|
|
- dispatch(createConference());
|
111
|
|
- }
|
112
|
|
-
|
113
|
|
- return result;
|
114
|
|
-}
|
115
|
|
-
|
116
|
91
|
/**
|
117
|
92
|
* Makes sure to leave a failed conference in order to release any allocated
|
118
|
|
- * resources like peerconnections, emit participant left events etc.
|
|
93
|
+ * resources like peer connections, emit participant left events, etc.
|
119
|
94
|
*
|
120
|
|
- * @param {Dispatch} next - The redux dispatch function to dispatch the
|
121
|
|
- * specified action to the specified store.
|
122
|
|
- * @param {Action} action - The redux action CONFERENCE_FAILED which is being
|
123
|
|
- * dispatched in the specified store.
|
|
95
|
+ * @param {Store} store - The redux store in which the specified {@code action}
|
|
96
|
+ * is being dispatched.
|
|
97
|
+ * @param {Dispatch} next - The redux {@code dispatch} function to dispatch the
|
|
98
|
+ * specified {@code action} to the specified {@code store}.
|
|
99
|
+ * @param {Action} action - The redux action {@code CONFERENCE_FAILED} which is
|
|
100
|
+ * being dispatched in the specified {@code store}.
|
124
|
101
|
* @private
|
125
|
102
|
* @returns {Object} The value returned by {@code next(action)}.
|
126
|
103
|
*/
|
127
|
|
-function _conferenceFailed(next, action) {
|
|
104
|
+function _conferenceFailed(store, next, action) {
|
128
|
105
|
const result = next(action);
|
|
106
|
+
|
|
107
|
+ // XXX After next(action), it is clear whether the error is recoverable.
|
129
|
108
|
const { conference, error } = action;
|
130
|
109
|
|
131
|
110
|
!error.recoverable
|
132
|
111
|
&& conference
|
133
|
|
- && conference.leave().catch(leaveError => {
|
134
|
|
- // Even though we don't care too much about the failure it may be
|
135
|
|
- // good to now that it happen, so log it on the info level.
|
136
|
|
- logger.info(
|
137
|
|
- 'There was an error leaving a failed conference: ', leaveError);
|
|
112
|
+ && conference.leave().catch(reason => {
|
|
113
|
+ // Even though we don't care too much about the failure, it may be
|
|
114
|
+ // good to know that it happen, so log it (on the info level).
|
|
115
|
+ logger.info('JitsiConference.leave() rejected with:', reason);
|
138
|
116
|
});
|
139
|
117
|
|
140
|
118
|
return result;
|
|
@@ -144,12 +122,12 @@ function _conferenceFailed(next, action) {
|
144
|
122
|
* Does extra sync up on properties that may need to be updated after the
|
145
|
123
|
* conference was joined.
|
146
|
124
|
*
|
147
|
|
- * @param {Store} store - The redux store in which the specified action is being
|
148
|
|
- * dispatched.
|
149
|
|
- * @param {Dispatch} next - The redux dispatch function to dispatch the
|
150
|
|
- * specified action to the specified store.
|
151
|
|
- * @param {Action} action - The redux action CONFERENCE_JOINED which is being
|
152
|
|
- * dispatched in the specified store.
|
|
125
|
+ * @param {Store} store - The redux store in which the specified {@code action}
|
|
126
|
+ * is being dispatched.
|
|
127
|
+ * @param {Dispatch} next - The redux {@code dispatch} function to dispatch the
|
|
128
|
+ * specified {@code action} to the specified {@code store}.
|
|
129
|
+ * @param {Action} action - The redux action {@code CONFERENCE_JOINED} which is
|
|
130
|
+ * being dispatched in the specified {@code store}.
|
153
|
131
|
* @private
|
154
|
132
|
* @returns {Object} The value returned by {@code next(action)}.
|
155
|
133
|
*/
|
|
@@ -161,22 +139,46 @@ function _conferenceJoined({ dispatch, getState }, next, action) {
|
161
|
139
|
// FIXME On Web the audio only mode for "start audio only" is toggled before
|
162
|
140
|
// conference is added to the redux store ("on conference joined" action)
|
163
|
141
|
// and the LastN value needs to be synchronized here.
|
164
|
|
- audioOnly && (conference.getLastN() !== 0) && dispatch(setLastN(0));
|
|
142
|
+ audioOnly && conference.getLastN() !== 0 && dispatch(setLastN(0));
|
|
143
|
+
|
|
144
|
+ return result;
|
|
145
|
+}
|
|
146
|
+
|
|
147
|
+/**
|
|
148
|
+ * Notifies the feature base/conference that the action
|
|
149
|
+ * {@code CONNECTION_ESTABLISHED} is being dispatched within a specific redux
|
|
150
|
+ * store.
|
|
151
|
+ *
|
|
152
|
+ * @param {Store} store - The redux store in which the specified {@code action}
|
|
153
|
+ * is being dispatched.
|
|
154
|
+ * @param {Dispatch} next - The redux {@code dispatch} function to dispatch the
|
|
155
|
+ * specified {@code action} to the specified {@code store}.
|
|
156
|
+ * @param {Action} action - The redux action {@code CONNECTION_ESTABLISHED}
|
|
157
|
+ * which is being dispatched in the specified {@code store}.
|
|
158
|
+ * @private
|
|
159
|
+ * @returns {Object} The value returned by {@code next(action)}.
|
|
160
|
+ */
|
|
161
|
+function _connectionEstablished({ dispatch }, next, action) {
|
|
162
|
+ const result = next(action);
|
|
163
|
+
|
|
164
|
+ // FIXME: Workaround for the web version. Currently, the creation of the
|
|
165
|
+ // conference is handled by /conference.js.
|
|
166
|
+ typeof APP === 'undefined' && dispatch(createConference());
|
165
|
167
|
|
166
|
168
|
return result;
|
167
|
169
|
}
|
168
|
170
|
|
169
|
171
|
/**
|
170
|
|
- * Notifies the feature base/conference that the action PIN_PARTICIPANT is being
|
171
|
|
- * dispatched within a specific redux store. Pins the specified remote
|
|
172
|
+ * Notifies the feature base/conference that the action {@code PIN_PARTICIPANT}
|
|
173
|
+ * is being dispatched within a specific redux store. Pins the specified remote
|
172
|
174
|
* participant in the associated conference, ignores the local participant.
|
173
|
175
|
*
|
174
|
|
- * @param {Store} store - The redux store in which the specified action is being
|
175
|
|
- * dispatched.
|
176
|
|
- * @param {Dispatch} next - The redux dispatch function to dispatch the
|
177
|
|
- * specified action to the specified store.
|
178
|
|
- * @param {Action} action - The redux action PIN_PARTICIPANT which is being
|
179
|
|
- * dispatched in the specified store.
|
|
176
|
+ * @param {Store} store - The redux store in which the specified {@code action}
|
|
177
|
+ * is being dispatched.
|
|
178
|
+ * @param {Dispatch} next - The redux {@code dispatch} function to dispatch the
|
|
179
|
+ * specified {@code action} to the specified {@code store}.
|
|
180
|
+ * @param {Action} action - The redux action {@code PIN_PARTICIPANT} which is
|
|
181
|
+ * being dispatched in the specified {@code store}.
|
180
|
182
|
* @private
|
181
|
183
|
* @returns {Object} The value returned by {@code next(action)}.
|
182
|
184
|
*/
|
|
@@ -239,12 +241,12 @@ function _pinParticipant({ getState }, next, action) {
|
239
|
241
|
* Sets the audio-only flag for the current conference. When audio-only is set,
|
240
|
242
|
* local video is muted and last N is set to 0 to avoid receiving remote video.
|
241
|
243
|
*
|
242
|
|
- * @param {Store} store - The redux store in which the specified action is being
|
243
|
|
- * dispatched.
|
244
|
|
- * @param {Dispatch} next - The redux dispatch function to dispatch the
|
245
|
|
- * specified action to the specified store.
|
246
|
|
- * @param {Action} action - The redux action SET_AUDIO_ONLY which is being
|
247
|
|
- * dispatched in the specified store.
|
|
244
|
+ * @param {Store} store - The redux store in which the specified {@code action}
|
|
245
|
+ * is being dispatched.
|
|
246
|
+ * @param {Dispatch} next - The redux {@code dispatch} function to dispatch the
|
|
247
|
+ * specified {@code action} to the specified {@code store}.
|
|
248
|
+ * @param {Action} action - The redux action {@code SET_AUDIO_ONLY} which is
|
|
249
|
+ * being dispatched in the specified {@code store}.
|
248
|
250
|
* @private
|
249
|
251
|
* @returns {Object} The value returned by {@code next(action)}.
|
250
|
252
|
*/
|
|
@@ -274,8 +276,8 @@ function _setAudioOnly({ dispatch, getState }, next, action) {
|
274
|
276
|
/* ensureTrack */ true));
|
275
|
277
|
|
276
|
278
|
if (typeof APP !== 'undefined') {
|
277
|
|
- // TODO This should be a temporary solution that lasts only until
|
278
|
|
- // video tracks and all ui is moved into react/redux on the web.
|
|
279
|
+ // TODO This should be a temporary solution that lasts only until video
|
|
280
|
+ // tracks and all ui is moved into react/redux on the web.
|
279
|
281
|
APP.UI.emitEvent(UIEvents.TOGGLE_AUDIO_ONLY, newValue);
|
280
|
282
|
}
|
281
|
283
|
|
|
@@ -285,12 +287,12 @@ function _setAudioOnly({ dispatch, getState }, next, action) {
|
285
|
287
|
/**
|
286
|
288
|
* Sets the last N (value) of the video channel in the conference.
|
287
|
289
|
*
|
288
|
|
- * @param {Store} store - The redux store in which the specified action is being
|
289
|
|
- * dispatched.
|
290
|
|
- * @param {Dispatch} next - The redux dispatch function to dispatch the
|
291
|
|
- * specified action to the specified store.
|
292
|
|
- * @param {Action} action - The redux action SET_LASTN which is being dispatched
|
293
|
|
- * in the specified store.
|
|
290
|
+ * @param {Store} store - The redux store in which the specified {@code action}
|
|
291
|
+ * is being dispatched.
|
|
292
|
+ * @param {Dispatch} next - The redux {@code dispatch} function to dispatch the
|
|
293
|
+ * specified {@code action} to the specified {@code store}.
|
|
294
|
+ * @param {Action} action - The redux action {@code SET_LASTN} which is being
|
|
295
|
+ * dispatched in the specified {@code store}.
|
294
|
296
|
* @private
|
295
|
297
|
* @returns {Object} The value returned by {@code next(action)}.
|
296
|
298
|
*/
|
|
@@ -312,12 +314,12 @@ function _setLastN({ getState }, next, action) {
|
312
|
314
|
* Sets the maximum receive video quality and will turn off audio only mode if
|
313
|
315
|
* enabled.
|
314
|
316
|
*
|
315
|
|
- * @param {Store} store - The redux store in which the specified action is being
|
316
|
|
- * dispatched.
|
317
|
|
- * @param {Dispatch} next - The redux dispatch function to dispatch the
|
318
|
|
- * specified action to the specified store.
|
319
|
|
- * @param {Action} action - The redux action SET_RECEIVE_VIDEO_QUALITY which is
|
320
|
|
- * being dispatched in the specified store.
|
|
317
|
+ * @param {Store} store - The redux store in which the specified {@code action}
|
|
318
|
+ * is being dispatched.
|
|
319
|
+ * @param {Dispatch} next - The redux {@code dispatch} function to dispatch the
|
|
320
|
+ * specified {@code action} to the specified {@code store}.
|
|
321
|
+ * @param {Action} action - The redux action {@code SET_RECEIVE_VIDEO_QUALITY}
|
|
322
|
+ * which is being dispatched in the specified {@code store}.
|
321
|
323
|
* @private
|
322
|
324
|
* @returns {Object} The value returned by {@code next(action)}.
|
323
|
325
|
*/
|
|
@@ -336,12 +338,12 @@ function _setReceiveVideoQuality({ dispatch, getState }, next, action) {
|
336
|
338
|
* Notifies the feature {@code base/conference} that the redix action
|
337
|
339
|
* {@link SET_ROOM} is being dispatched within a specific redux store.
|
338
|
340
|
*
|
339
|
|
- * @param {Store} store - The redux store in which the specified action is being
|
340
|
|
- * dispatched.
|
341
|
|
- * @param {Dispatch} next - The redux dispatch function to dispatch the
|
342
|
|
- * specified action to the specified store.
|
|
341
|
+ * @param {Store} store - The redux store in which the specified {@code action}
|
|
342
|
+ * is being dispatched.
|
|
343
|
+ * @param {Dispatch} next - The redux {@code dispatch} function to dispatch the
|
|
344
|
+ * specified {@code action} to the specified {@code store}.
|
343
|
345
|
* @param {Action} action - The redux action {@code SET_ROOM} which is being
|
344
|
|
- * dispatched in the specified store.
|
|
346
|
+ * dispatched in the specified {@code store}.
|
345
|
347
|
* @private
|
346
|
348
|
* @returns {Object} The value returned by {@code next(action)}.
|
347
|
349
|
*/
|
|
@@ -420,12 +422,12 @@ function _syncConferenceLocalTracksWithState({ getState }, action) {
|
420
|
422
|
/**
|
421
|
423
|
* Sets the maximum receive video quality.
|
422
|
424
|
*
|
423
|
|
- * @param {Store} store - The redux store in which the specified action is being
|
424
|
|
- * dispatched.
|
425
|
|
- * @param {Dispatch} next - The redux dispatch function to dispatch the
|
426
|
|
- * specified action to the specified store.
|
427
|
|
- * @param {Action} action - The redux action DATA_CHANNEL_STATUS_CHANGED which
|
428
|
|
- * is being dispatched in the specified store.
|
|
425
|
+ * @param {Store} store - The redux store in which the specified {@code action}
|
|
426
|
+ * is being dispatched.
|
|
427
|
+ * @param {Dispatch} next - The redux {@code dispatch} function to dispatch the
|
|
428
|
+ * specified {@code action} to the specified {@code store}.
|
|
429
|
+ * @param {Action} action - The redux action {@code DATA_CHANNEL_STATUS_CHANGED}
|
|
430
|
+ * which is being dispatched in the specified {@code store}.
|
429
|
431
|
* @private
|
430
|
432
|
* @returns {Object} The value returned by {@code next(action)}.
|
431
|
433
|
*/
|
|
@@ -438,15 +440,16 @@ function _syncReceiveVideoQuality({ getState }, next, action) {
|
438
|
440
|
}
|
439
|
441
|
|
440
|
442
|
/**
|
441
|
|
- * Notifies the feature base/conference that the action TRACK_ADDED
|
442
|
|
- * or TRACK_REMOVED is being dispatched within a specific redux store.
|
|
443
|
+ * Notifies the feature base/conference that the action {@code TRACK_ADDED}
|
|
444
|
+ * or {@code TRACK_REMOVED} is being dispatched within a specific redux store.
|
443
|
445
|
*
|
444
|
|
- * @param {Store} store - The redux store in which the specified action is being
|
445
|
|
- * dispatched.
|
446
|
|
- * @param {Dispatch} next - The redux dispatch function to dispatch the
|
447
|
|
- * specified action to the specified store.
|
448
|
|
- * @param {Action} action - The redux action TRACK_ADDED or TRACK_REMOVED which
|
449
|
|
- * is being dispatched in the specified store.
|
|
446
|
+ * @param {Store} store - The redux store in which the specified {@code action}
|
|
447
|
+ * is being dispatched.
|
|
448
|
+ * @param {Dispatch} next - The redux {@code dispatch} function to dispatch the
|
|
449
|
+ * specified {@code action} to the specified {@code store}.
|
|
450
|
+ * @param {Action} action - The redux action {@code TRACK_ADDED} or
|
|
451
|
+ * {@code TRACK_REMOVED} which is being dispatched in the specified
|
|
452
|
+ * {@code store}.
|
450
|
453
|
* @private
|
451
|
454
|
* @returns {Object} The value returned by {@code next(action)}.
|
452
|
455
|
*/
|