Implement review changes 1

pull/9021/head
Mihai-Andrei Uscat 4 years ago committed by Saúl Ibarra Corretgé
parent dcd073b407
commit e0da67dff5
  1. 13
      react/features/base/config/reducer.js
  2. 14
      react/features/base/lib-jitsi-meet/actions.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) => { ReducerRegistry.register('features/base/config', (state = _getInitialState(), action) => {
switch (action.type) { switch (action.type) {
case UPDATE_CONFIG: case UPDATE_CONFIG:
@ -146,6 +158,7 @@ function _setConfig(state, { config }) {
const newState = _.merge( const newState = _.merge(
{}, {},
config, config,
config.enableHdAudio ? hdAudioOptions : {},
{ error: undefined }, { error: undefined },
// The config of _getInitialState() is meant to override the config // The config of _getInitialState() is meant to override the config

@ -42,25 +42,11 @@ export function initLib() {
return (dispatch: Dispatch<any>, getState: Function): void => { return (dispatch: Dispatch<any>, getState: Function): void => {
const state = getState(); const state = getState();
const config = state['features/base/config']; const config = state['features/base/config'];
const { enableHdAudio } = config;
if (!config) { if (!config) {
throw new Error('Cannot init lib-jitsi-meet without 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 }); dispatch({ type: LIB_WILL_INIT });
try { try {

Loading…
Cancel
Save