Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

Implement review changes 1

Mihai-Andrei Uscate0da67dff56d
diff --git a/react/features/base/config/reducer.js b/react/features/base/config/reducer.js
index 8f94d801d5..dbc1511397 100644
--- a/react/features/base/config/reducer.js
+++ b/react/features/base/config/reducer.js
@@ -56,6 +56,18 @@ const INITIAL_RN_STATE = {
}
};
+/**
+ * Options that enable stereo and HD audio if the {@code enableHdAudio} config option is set.
+ */
+const hdAudioOptions = {
+ disableAP: true,
+ enableNoAudioDetection: false,
+ enableNoisyMicDetection: false,
+ enableTalkWhileMuted: false,
+ opusMaxAverageBitrate: 510000,
+ stereo: true
+};
+
ReducerRegistry.register('features/base/config', (state = _getInitialState(), action) => {
switch (action.type) {
case UPDATE_CONFIG:
@@ -146,6 +158,7 @@ function _setConfig(state, { config }) {
const newState = _.merge(
{},
config,
+ config.enableHdAudio ? hdAudioOptions : {},
{ error: undefined },
// The config of _getInitialState() is meant to override the config
diff --git a/react/features/base/lib-jitsi-meet/actions.js b/react/features/base/lib-jitsi-meet/actions.js
index b92959491c..6114455f8f 100644
--- a/react/features/base/lib-jitsi-meet/actions.js
+++ b/react/features/base/lib-jitsi-meet/actions.js
@@ -42,25 +42,11 @@ export function initLib() {
return (dispatch: Dispatch<any>, getState: Function): void => {
const state = getState();
const config = state['features/base/config'];
- const { enableHdAudio } = config;
if (!config) {
throw new Error('Cannot init lib-jitsi-meet without config');
}
- if (enableHdAudio) {
- Object.assign(config, {
- ...config,
- channelCount: 2,
- disableAP: true,
- enableNoAudioDetection: false,
- enableNoisyMicDetection: false,
- enableTalkWhileMuted: false,
- opusMaxAverageBitrate: 510000,
- stereo: true
- });
- }
-
dispatch({ type: LIB_WILL_INIT });
try {