Bladeren bron

Implement review changes 3

master
Mihai-Andrei Uscat 4 jaren geleden
bovenliggende
commit
996c9fb064
2 gewijzigde bestanden met toevoegingen van 13 en 14 verwijderingen
  1. 2
    7
      config.js
  2. 11
    7
      react/features/base/config/reducer.js

+ 2
- 7
config.js Bestand weergeven

@@ -117,20 +117,15 @@ var config = {
117 117
     // participants and to enable it back a reload is needed.
118 118
     // startSilent: false
119 119
 
120
-    // Sets the preferred target bitrate for the Opus audio codec by setting its
121
-    // 'maxaveragebitrate' parameter. Currently not available in p2p mode.
122
-    // Valid values are in the range 6000 to 510000
123
-    // opusMaxAverageBitrate: 20000,
124
-
125 120
     // Enables support for opus-red (redundancy for Opus).
126 121
     // enableOpusRed: false,
127 122
 
128
-    // Specify audio quality stereo and opusMaxAverageBitrate values, both necessary in order to enable HD audio.
123
+    // Specify audio quality stereo and opusMaxAverageBitrate values in order to enable HD audio.
129 124
     // Beware, by doing so, you are disabling echo cancellation, noise suppression and AGC.
130 125
     // audioQuality: {
131 126
     //     stereo: false,
132 127
     //     opusMaxAverageBitrate: null // Value to fit the 6000 to 510000 range.
133
-    // }
128
+    // },
134 129
 
135 130
     // Video
136 131
 

+ 11
- 7
react/features/base/config/reducer.js Bestand weergeven

@@ -142,19 +142,16 @@ function _setConfig(state, { config }) {
142 142
 
143 143
     // eslint-disable-next-line no-param-reassign
144 144
     config = _translateLegacyConfig(config);
145
-    const hdAudioOptions = {};
146
-    const { audioQuality } = config;
147 145
 
148
-    if (audioQuality?.stereo && audioQuality?.opusMaxAverageBitrate) {
149
-        const { opusMaxAverageBitrate, stereo } = audioQuality;
146
+    const { audioQuality } = config;
147
+    const hdAudioOptions = {};
150 148
 
149
+    if (audioQuality?.stereo) {
151 150
         Object.assign(hdAudioOptions, {
152 151
             disableAP: true,
153 152
             enableNoAudioDetection: false,
154 153
             enableNoisyMicDetection: false,
155
-            enableTalkWhileMuted: false,
156
-            opusMaxAverageBitrate,
157
-            stereo
154
+            enableTalkWhileMuted: false
158 155
         });
159 156
     }
160 157
 
@@ -231,6 +228,13 @@ function _translateLegacyConfig(oldValue: Object) {
231 228
         newValue.toolbarButtons = interfaceConfig.TOOLBAR_BUTTONS;
232 229
     }
233 230
 
231
+    if (oldValue.stereo || oldValue.opusMaxAverageBitrate) {
232
+        newValue.audioQuality = {
233
+            opusMaxAverageBitrate: oldValue.audioQuality?.opusMaxAverageBitrate ?? oldValue.opusMaxAverageBitrate,
234
+            stereo: oldValue.audioQuality?.stereo ?? oldValue.stereo
235
+        };
236
+    }
237
+
234 238
     return newValue;
235 239
 }
236 240
 

Laden…
Annuleren
Opslaan