Implement review changes 1

This commit is contained in:
Mihai-Andrei Uscat 2021-04-09 11:20:37 +03:00 committed by Saúl Ibarra Corretgé
parent dcd073b407
commit e0da67dff5
2 changed files with 13 additions and 14 deletions

View File

@ -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

View File

@ -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 {