|
@@ -21,6 +21,7 @@ import {
|
21
|
21
|
MEDIA_TYPE,
|
22
|
22
|
VIDEO_MUTISM_AUTHORITY
|
23
|
23
|
} from './constants';
|
|
24
|
+import { getStartWithAudioMuted, getStartWithVideoMuted } from './functions';
|
24
|
25
|
import logger from './logger';
|
25
|
26
|
import {
|
26
|
27
|
_AUDIO_INITIAL_MEDIA_STATE,
|
|
@@ -133,37 +134,8 @@ function _setRoom({ dispatch, getState }, next, action) {
|
133
|
134
|
const state = getState();
|
134
|
135
|
const { room } = action;
|
135
|
136
|
const roomIsValid = isRoomValid(room);
|
136
|
|
-
|
137
|
|
- // XXX The configurations/preferences/settings startWithAudioMuted,
|
138
|
|
- // startWithVideoMuted, and startAudioOnly were introduced for
|
139
|
|
- // conferences/meetings. So it makes sense for these to not be considered
|
140
|
|
- // outside of conferences/meetings (e.g. WelcomePage). Later on, though, we
|
141
|
|
- // introduced a "Video <-> Voice" toggle on the WelcomePage which utilizes
|
142
|
|
- // startAudioOnly outside of conferences/meetings so that particular
|
143
|
|
- // configuration/preference/setting employs slightly exclusive logic.
|
144
|
|
- const mutedSources = {
|
145
|
|
- // We have startWithAudioMuted and startWithVideoMuted here:
|
146
|
|
- config: true,
|
147
|
|
- settings: true,
|
148
|
|
-
|
149
|
|
- // XXX We've already overwritten base/config with urlParams. However,
|
150
|
|
- // settings are more important than the server-side config.
|
151
|
|
- // Consequently, we need to read from urlParams anyway:
|
152
|
|
- urlParams: true,
|
153
|
|
-
|
154
|
|
- // We don't have startWithAudioMuted and startWithVideoMuted here:
|
155
|
|
- jwt: false
|
156
|
|
- };
|
157
|
|
- const audioMuted
|
158
|
|
- = roomIsValid
|
159
|
|
- ? Boolean(
|
160
|
|
- getPropertyValue(state, 'startWithAudioMuted', mutedSources))
|
161
|
|
- : _AUDIO_INITIAL_MEDIA_STATE.muted;
|
162
|
|
- const videoMuted
|
163
|
|
- = roomIsValid
|
164
|
|
- ? Boolean(
|
165
|
|
- getPropertyValue(state, 'startWithVideoMuted', mutedSources))
|
166
|
|
- : _VIDEO_INITIAL_MEDIA_STATE.muted;
|
|
137
|
+ const audioMuted = roomIsValid ? getStartWithAudioMuted(state) : _AUDIO_INITIAL_MEDIA_STATE.muted;
|
|
138
|
+ const videoMuted = roomIsValid ? getStartWithVideoMuted(state) : _VIDEO_INITIAL_MEDIA_STATE.muted;
|
167
|
139
|
|
168
|
140
|
sendAnalytics(
|
169
|
141
|
createStartMutedConfigurationEvent('local', audioMuted, videoMuted));
|