Browse Source

fix(prejoin): Fix join without audio

master
Vlad Piersec 4 years ago
parent
commit
d82bb0a89b

+ 2
- 2
react/features/base/config/actionTypes.js View File

43
  * and the passed object.
43
  * and the passed object.
44
  *
44
  *
45
  * {
45
  * {
46
- *     type: _UPDATE_CONFIG,
46
+ *     type: UPDATE_CONFIG,
47
  *     config: Object
47
  *     config: Object
48
  * }
48
  * }
49
  */
49
  */
50
-export const _UPDATE_CONFIG = '_UPDATE_CONFIG';
50
+export const UPDATE_CONFIG = 'UPDATE_CONFIG';

+ 15
- 1
react/features/base/config/actions.js View File

6
 import { addKnownDomains } from '../known-domains';
6
 import { addKnownDomains } from '../known-domains';
7
 import { parseURIString } from '../util';
7
 import { parseURIString } from '../util';
8
 
8
 
9
-import { CONFIG_WILL_LOAD, LOAD_CONFIG_ERROR, SET_CONFIG } from './actionTypes';
9
+import { CONFIG_WILL_LOAD, LOAD_CONFIG_ERROR, SET_CONFIG, UPDATE_CONFIG } from './actionTypes';
10
 import { _CONFIG_STORE_PREFIX } from './constants';
10
 import { _CONFIG_STORE_PREFIX } from './constants';
11
 import { setConfigFromURLParams } from './functions';
11
 import { setConfigFromURLParams } from './functions';
12
 
12
 
13
+
14
+/**
15
+ * Updates the config with new options.
16
+ *
17
+ * @param {Object} config - The new options (to add).
18
+ * @returns {Function}
19
+ */
20
+export function updateConfig(config: Object) {
21
+    return {
22
+        type: UPDATE_CONFIG,
23
+        config
24
+    };
25
+}
26
+
13
 /**
27
 /**
14
  * Signals that the configuration (commonly known in Jitsi Meet as config.js)
28
  * Signals that the configuration (commonly known in Jitsi Meet as config.js)
15
  * for a specific locationURL will be loaded now.
29
  * for a specific locationURL will be loaded now.

+ 3
- 5
react/features/base/config/middleware.js View File

8
 import { MiddlewareRegistry } from '../redux';
8
 import { MiddlewareRegistry } from '../redux';
9
 import { parseURIString } from '../util';
9
 import { parseURIString } from '../util';
10
 
10
 
11
-import { _UPDATE_CONFIG, SET_CONFIG } from './actionTypes';
11
+import { SET_CONFIG } from './actionTypes';
12
+import { updateConfig } from './actions';
12
 import { _CONFIG_STORE_PREFIX } from './constants';
13
 import { _CONFIG_STORE_PREFIX } from './constants';
13
 
14
 
14
 /**
15
 /**
114
         config.resolution = resolutionFlag;
115
         config.resolution = resolutionFlag;
115
     }
116
     }
116
 
117
 
117
-    dispatch({
118
-        type: _UPDATE_CONFIG,
119
-        config
120
-    });
118
+    dispatch(updateConfig(config));
121
 
119
 
122
     // FIXME On Web we rely on the global 'config' variable which gets altered
120
     // FIXME On Web we rely on the global 'config' variable which gets altered
123
     // multiple times, before it makes it to the reducer. At some point it may
121
     // multiple times, before it makes it to the reducer. At some point it may

+ 2
- 2
react/features/base/config/reducer.js View File

4
 
4
 
5
 import { equals, ReducerRegistry, set } from '../redux';
5
 import { equals, ReducerRegistry, set } from '../redux';
6
 
6
 
7
-import { _UPDATE_CONFIG, CONFIG_WILL_LOAD, LOAD_CONFIG_ERROR, SET_CONFIG } from './actionTypes';
7
+import { UPDATE_CONFIG, CONFIG_WILL_LOAD, LOAD_CONFIG_ERROR, SET_CONFIG } from './actionTypes';
8
 import { _cleanupConfig } from './functions';
8
 import { _cleanupConfig } from './functions';
9
 
9
 
10
 /**
10
 /**
50
 
50
 
51
 ReducerRegistry.register('features/base/config', (state = _getInitialState(), action) => {
51
 ReducerRegistry.register('features/base/config', (state = _getInitialState(), action) => {
52
     switch (action.type) {
52
     switch (action.type) {
53
-    case _UPDATE_CONFIG:
53
+    case UPDATE_CONFIG:
54
         return _updateConfig(state, action);
54
         return _updateConfig(state, action);
55
 
55
 
56
     case CONFIG_WILL_LOAD:
56
     case CONFIG_WILL_LOAD:

+ 8
- 3
react/features/prejoin/actions.js View File

201
 /**
201
 /**
202
  * Action used to start the conference.
202
  * Action used to start the conference.
203
  *
203
  *
204
+ * @param {Object} options - The config options that override the default ones (if any).
204
  * @returns {Function}
205
  * @returns {Function}
205
  */
206
  */
206
-export function joinConference() {
207
+export function joinConference(options?: Object) {
207
     return {
208
     return {
208
-        type: PREJOIN_START_CONFERENCE
209
+        type: PREJOIN_START_CONFERENCE,
210
+        options
209
     };
211
     };
210
 }
212
 }
211
 
213
 
222
         if (audioTrack) {
224
         if (audioTrack) {
223
             await dispatch(replaceLocalTrack(audioTrack, null));
225
             await dispatch(replaceLocalTrack(audioTrack, null));
224
         }
226
         }
225
-        dispatch(joinConference());
227
+
228
+        dispatch(joinConference({
229
+            startSilent: true
230
+        }));
226
     };
231
     };
227
 }
232
 }
228
 
233
 

+ 4
- 0
react/features/prejoin/middleware.js View File

1
 // @flow
1
 // @flow
2
 
2
 
3
+import { updateConfig } from '../base/config';
3
 import { SET_AUDIO_MUTED, SET_VIDEO_MUTED } from '../base/media';
4
 import { SET_AUDIO_MUTED, SET_VIDEO_MUTED } from '../base/media';
4
 import { MiddlewareRegistry } from '../base/redux';
5
 import { MiddlewareRegistry } from '../base/redux';
5
 import { updateSettings } from '../base/settings';
6
 import { updateSettings } from '../base/settings';
24
         const state = getState();
25
         const state = getState();
25
         const { userSelectedSkipPrejoin } = state['features/prejoin'];
26
         const { userSelectedSkipPrejoin } = state['features/prejoin'];
26
         const localVideoTrack = getLocalVideoTrack(state['features/base/tracks']);
27
         const localVideoTrack = getLocalVideoTrack(state['features/base/tracks']);
28
+        const { options } = action;
29
+
30
+        options && store.dispatch(updateConfig(options));
27
 
31
 
28
         userSelectedSkipPrejoin && dispatch(updateSettings({
32
         userSelectedSkipPrejoin && dispatch(updateSettings({
29
             userSelectedSkipPrejoin
33
             userSelectedSkipPrejoin

Loading…
Cancel
Save