Browse Source

Implement review changes 1

master
Mihai-Andrei Uscat 4 years ago
parent
commit
e0da67dff5
2 changed files with 13 additions and 14 deletions
  1. 13
    0
      react/features/base/config/reducer.js
  2. 0
    14
      react/features/base/lib-jitsi-meet/actions.js

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

@@ -56,6 +56,18 @@ const INITIAL_RN_STATE = {
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 71
 ReducerRegistry.register('features/base/config', (state = _getInitialState(), action) => {
60 72
     switch (action.type) {
61 73
     case UPDATE_CONFIG:
@@ -146,6 +158,7 @@ function _setConfig(state, { config }) {
146 158
     const newState = _.merge(
147 159
         {},
148 160
         config,
161
+        config.enableHdAudio ? hdAudioOptions : {},
149 162
         { error: undefined },
150 163
 
151 164
         // The config of _getInitialState() is meant to override the config

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

@@ -42,25 +42,11 @@ export function initLib() {
42 42
     return (dispatch: Dispatch<any>, getState: Function): void => {
43 43
         const state = getState();
44 44
         const config = state['features/base/config'];
45
-        const { enableHdAudio } = config;
46 45
 
47 46
         if (!config) {
48 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 50
         dispatch({ type: LIB_WILL_INIT });
65 51
 
66 52
         try {

Loading…
Cancel
Save