|
|
@@ -27,77 +27,88 @@ import {
|
|
27
|
27
|
import { VIDEO_QUALITY_LEVELS } from './constants';
|
|
28
|
28
|
import { isRoomValid } from './functions';
|
|
29
|
29
|
|
|
|
30
|
+const DEFAULT_STATE = {
|
|
|
31
|
+ joining: undefined,
|
|
|
32
|
+ maxReceiverVideoQuality: VIDEO_QUALITY_LEVELS.HIGH,
|
|
|
33
|
+ preferredReceiverVideoQuality: VIDEO_QUALITY_LEVELS.HIGH
|
|
|
34
|
+};
|
|
|
35
|
+
|
|
30
|
36
|
/**
|
|
31
|
37
|
* Listen for actions that contain the conference object, so that it can be
|
|
32
|
38
|
* stored for use by other action creators.
|
|
33
|
39
|
*/
|
|
34
|
|
-ReducerRegistry.register('features/base/conference', (state = {}, action) => {
|
|
35
|
|
- switch (action.type) {
|
|
36
|
|
- case AUTH_STATUS_CHANGED:
|
|
37
|
|
- return _authStatusChanged(state, action);
|
|
|
40
|
+ReducerRegistry.register(
|
|
|
41
|
+ 'features/base/conference',
|
|
|
42
|
+ (state = DEFAULT_STATE, action) => {
|
|
|
43
|
+ switch (action.type) {
|
|
|
44
|
+ case AUTH_STATUS_CHANGED:
|
|
|
45
|
+ return _authStatusChanged(state, action);
|
|
38
|
46
|
|
|
39
|
|
- case CONFERENCE_FAILED:
|
|
40
|
|
- return _conferenceFailed(state, action);
|
|
|
47
|
+ case CONFERENCE_FAILED:
|
|
|
48
|
+ return _conferenceFailed(state, action);
|
|
41
|
49
|
|
|
42
|
|
- case CONFERENCE_JOINED:
|
|
43
|
|
- return _conferenceJoined(state, action);
|
|
|
50
|
+ case CONFERENCE_JOINED:
|
|
|
51
|
+ return _conferenceJoined(state, action);
|
|
44
|
52
|
|
|
45
|
|
- case CONFERENCE_LEFT:
|
|
46
|
|
- case CONFERENCE_WILL_LEAVE:
|
|
47
|
|
- return _conferenceLeftOrWillLeave(state, action);
|
|
|
53
|
+ case CONFERENCE_LEFT:
|
|
|
54
|
+ case CONFERENCE_WILL_LEAVE:
|
|
|
55
|
+ return _conferenceLeftOrWillLeave(state, action);
|
|
48
|
56
|
|
|
49
|
|
- case CONFERENCE_WILL_JOIN:
|
|
50
|
|
- return _conferenceWillJoin(state, action);
|
|
|
57
|
+ case CONFERENCE_WILL_JOIN:
|
|
|
58
|
+ return _conferenceWillJoin(state, action);
|
|
51
|
59
|
|
|
52
|
|
- case CONNECTION_WILL_CONNECT:
|
|
53
|
|
- return set(state, 'authRequired', undefined);
|
|
|
60
|
+ case CONNECTION_WILL_CONNECT:
|
|
|
61
|
+ return set(state, 'authRequired', undefined);
|
|
54
|
62
|
|
|
55
|
|
- case LOCK_STATE_CHANGED:
|
|
56
|
|
- return _lockStateChanged(state, action);
|
|
|
63
|
+ case LOCK_STATE_CHANGED:
|
|
|
64
|
+ return _lockStateChanged(state, action);
|
|
57
|
65
|
|
|
58
|
|
- case P2P_STATUS_CHANGED:
|
|
59
|
|
- return _p2pStatusChanged(state, action);
|
|
|
66
|
+ case P2P_STATUS_CHANGED:
|
|
|
67
|
+ return _p2pStatusChanged(state, action);
|
|
60
|
68
|
|
|
61
|
|
- case SET_AUDIO_ONLY:
|
|
62
|
|
- return _setAudioOnly(state, action);
|
|
|
69
|
+ case SET_AUDIO_ONLY:
|
|
|
70
|
+ return _setAudioOnly(state, action);
|
|
63
|
71
|
|
|
64
|
|
- case SET_DESKTOP_SHARING_ENABLED:
|
|
65
|
|
- return _setDesktopSharingEnabled(state, action);
|
|
|
72
|
+ case SET_DESKTOP_SHARING_ENABLED:
|
|
|
73
|
+ return _setDesktopSharingEnabled(state, action);
|
|
66
|
74
|
|
|
67
|
|
- case SET_FOLLOW_ME:
|
|
68
|
|
- return set(state, 'followMeEnabled', action.enabled);
|
|
|
75
|
+ case SET_FOLLOW_ME:
|
|
|
76
|
+ return set(state, 'followMeEnabled', action.enabled);
|
|
69
|
77
|
|
|
70
|
|
- case SET_LOCATION_URL:
|
|
71
|
|
- return set(state, 'room', undefined);
|
|
|
78
|
+ case SET_LOCATION_URL:
|
|
|
79
|
+ return set(state, 'room', undefined);
|
|
72
|
80
|
|
|
73
|
|
- case SET_MAX_RECEIVER_VIDEO_QUALITY:
|
|
74
|
|
- return set(
|
|
75
|
|
- state,
|
|
76
|
|
- 'maxReceiverVideoQuality',
|
|
77
|
|
- action.maxReceiverVideoQuality);
|
|
|
81
|
+ case SET_MAX_RECEIVER_VIDEO_QUALITY:
|
|
|
82
|
+ return set(
|
|
|
83
|
+ state,
|
|
|
84
|
+ 'maxReceiverVideoQuality',
|
|
|
85
|
+ action.maxReceiverVideoQuality);
|
|
78
|
86
|
|
|
79
|
|
- case SET_PASSWORD:
|
|
80
|
|
- return _setPassword(state, action);
|
|
|
87
|
+ case SET_PASSWORD:
|
|
|
88
|
+ return _setPassword(state, action);
|
|
81
|
89
|
|
|
82
|
|
- case SET_PREFERRED_RECEIVER_VIDEO_QUALITY:
|
|
83
|
|
- return _setPreferredReceiverVideoQuality(state, action);
|
|
|
90
|
+ case SET_PREFERRED_RECEIVER_VIDEO_QUALITY:
|
|
|
91
|
+ return set(
|
|
|
92
|
+ state,
|
|
|
93
|
+ 'preferredReceiverVideoQuality',
|
|
|
94
|
+ action.preferredReceiverVideoQuality);
|
|
84
|
95
|
|
|
85
|
|
- case SET_ROOM:
|
|
86
|
|
- return _setRoom(state, action);
|
|
|
96
|
+ case SET_ROOM:
|
|
|
97
|
+ return _setRoom(state, action);
|
|
87
|
98
|
|
|
88
|
|
- case SET_SIP_GATEWAY_ENABLED:
|
|
89
|
|
- return _setSIPGatewayEnabled(state, action);
|
|
|
99
|
+ case SET_SIP_GATEWAY_ENABLED:
|
|
|
100
|
+ return _setSIPGatewayEnabled(state, action);
|
|
90
|
101
|
|
|
91
|
|
- case SET_START_MUTED_POLICY:
|
|
92
|
|
- return {
|
|
93
|
|
- ...state,
|
|
94
|
|
- startAudioMutedPolicy: action.startAudioMutedPolicy,
|
|
95
|
|
- startVideoMutedPolicy: action.startVideoMutedPolicy
|
|
96
|
|
- };
|
|
97
|
|
- }
|
|
|
102
|
+ case SET_START_MUTED_POLICY:
|
|
|
103
|
+ return {
|
|
|
104
|
+ ...state,
|
|
|
105
|
+ startAudioMutedPolicy: action.startAudioMutedPolicy,
|
|
|
106
|
+ startVideoMutedPolicy: action.startVideoMutedPolicy
|
|
|
107
|
+ };
|
|
|
108
|
+ }
|
|
98
|
109
|
|
|
99
|
|
- return state;
|
|
100
|
|
-});
|
|
|
110
|
+ return state;
|
|
|
111
|
+ });
|
|
101
|
112
|
|
|
102
|
113
|
/**
|
|
103
|
114
|
* Reduces a specific Redux action AUTH_STATUS_CHANGED of the feature
|
|
|
@@ -210,15 +221,7 @@ function _conferenceJoined(state, { conference }) {
|
|
210
|
221
|
* @type {boolean}
|
|
211
|
222
|
*/
|
|
212
|
223
|
locked,
|
|
213
|
|
- passwordRequired: undefined,
|
|
214
|
|
-
|
|
215
|
|
- /**
|
|
216
|
|
- * The current resolution restraint on receiving remote video. By
|
|
217
|
|
- * default the conference will send the highest level possible.
|
|
218
|
|
- *
|
|
219
|
|
- * @type number
|
|
220
|
|
- */
|
|
221
|
|
- preferredReceiverVideoQuality: VIDEO_QUALITY_LEVELS.HIGH
|
|
|
224
|
+ passwordRequired: undefined
|
|
222
|
225
|
});
|
|
223
|
226
|
}
|
|
224
|
227
|
|
|
|
@@ -409,24 +412,6 @@ function _setPassword(state, { conference, method, password }) {
|
|
409
|
412
|
return state;
|
|
410
|
413
|
}
|
|
411
|
414
|
|
|
412
|
|
-/**
|
|
413
|
|
- * Reduces a specific Redux action {@code SET_PREFERRED_RECEIVER_VIDEO_QUALITY}
|
|
414
|
|
- * of the feature base/conference.
|
|
415
|
|
- *
|
|
416
|
|
- * @param {Object} state - The Redux state of the feature base/conference.
|
|
417
|
|
- * @param {Action} action - The Redux action of type
|
|
418
|
|
- * {@code SET_PREFERRED_RECEIVER_VIDEO_QUALITY} to reduce.
|
|
419
|
|
- * @private
|
|
420
|
|
- * @returns {Object} The new state of the feature base/conference after the
|
|
421
|
|
- * reduction of the specified action.
|
|
422
|
|
- */
|
|
423
|
|
-function _setPreferredReceiverVideoQuality(state, action) {
|
|
424
|
|
- return set(
|
|
425
|
|
- state,
|
|
426
|
|
- 'preferredReceiverVideoQuality',
|
|
427
|
|
- action.preferredReceiverVideoQuality);
|
|
428
|
|
-}
|
|
429
|
|
-
|
|
430
|
415
|
/**
|
|
431
|
416
|
* Reduces a specific Redux action SET_ROOM of the feature base/conference.
|
|
432
|
417
|
*
|