Browse Source

Implement review changes 1

master
Mihai-Andrei Uscat 4 years ago
parent
commit
e0da67dff5

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

56
     }
56
     }
57
 };
57
 };
58
 
58
 
59
+/**
60
+ * Options that enable stereo and HD audio if the {@code enableHdAudio} config option is set.
61
+ */
62
+const hdAudioOptions = {
63
+    disableAP: true,
64
+    enableNoAudioDetection: false,
65
+    enableNoisyMicDetection: false,
66
+    enableTalkWhileMuted: false,
67
+    opusMaxAverageBitrate: 510000,
68
+    stereo: true
69
+};
70
+
59
 ReducerRegistry.register('features/base/config', (state = _getInitialState(), action) => {
71
 ReducerRegistry.register('features/base/config', (state = _getInitialState(), action) => {
60
     switch (action.type) {
72
     switch (action.type) {
61
     case UPDATE_CONFIG:
73
     case UPDATE_CONFIG:
146
     const newState = _.merge(
158
     const newState = _.merge(
147
         {},
159
         {},
148
         config,
160
         config,
161
+        config.enableHdAudio ? hdAudioOptions : {},
149
         { error: undefined },
162
         { error: undefined },
150
 
163
 
151
         // The config of _getInitialState() is meant to override the config
164
         // The config of _getInitialState() is meant to override the config

+ 0
- 14
react/features/base/lib-jitsi-meet/actions.js View File

42
     return (dispatch: Dispatch<any>, getState: Function): void => {
42
     return (dispatch: Dispatch<any>, getState: Function): void => {
43
         const state = getState();
43
         const state = getState();
44
         const config = state['features/base/config'];
44
         const config = state['features/base/config'];
45
-        const { enableHdAudio } = config;
46
 
45
 
47
         if (!config) {
46
         if (!config) {
48
             throw new Error('Cannot init lib-jitsi-meet without config');
47
             throw new Error('Cannot init lib-jitsi-meet without config');
49
         }
48
         }
50
 
49
 
51
-        if (enableHdAudio) {
52
-            Object.assign(config, {
53
-                ...config,
54
-                channelCount: 2,
55
-                disableAP: true,
56
-                enableNoAudioDetection: false,
57
-                enableNoisyMicDetection: false,
58
-                enableTalkWhileMuted: false,
59
-                opusMaxAverageBitrate: 510000,
60
-                stereo: true
61
-            });
62
-        }
63
-
64
         dispatch({ type: LIB_WILL_INIT });
50
         dispatch({ type: LIB_WILL_INIT });
65
 
51
 
66
         try {
52
         try {

Loading…
Cancel
Save