defaultAudio in config

auto_join_3.3
Stefan Otto 2020-05-06 12:00:54 +02:00
parent aca3499afb
commit 4f07b973c8
4 changed files with 15 additions and 19 deletions

View File

@ -47,7 +47,7 @@ var config =
sampleRate : 48000, sampleRate : 48000,
channelCount : 1, channelCount : 1,
volume : 1.0, volume : 1.0,
autoGainControl : false, autoGainControl : true,
echoCancellation : true, echoCancellation : true,
noiseSuppression : true, noiseSuppression : true,
sampleSize : 16 sampleSize : 16

View File

@ -32,7 +32,6 @@ let requestTimeout,
transportOptions, transportOptions,
lastN, lastN,
mobileLastN, mobileLastN,
defaultAudio,
defaultResolution; defaultResolution;
if (process.env.NODE_ENV !== 'test') if (process.env.NODE_ENV !== 'test')
@ -42,7 +41,6 @@ if (process.env.NODE_ENV !== 'test')
transportOptions, transportOptions,
lastN, lastN,
mobileLastN, mobileLastN,
defaultAudio,
defaultResolution defaultResolution
} = window.config); } = window.config);
} }
@ -210,9 +208,6 @@ export default class RoomClient
if (defaultResolution) if (defaultResolution)
store.dispatch(settingsActions.setVideoResolution(defaultResolution)); store.dispatch(settingsActions.setVideoResolution(defaultResolution));
if (defaultAudio)
store.dispatch(settingsActions.setDefaultAudio(defaultAudio));
// Max spotlights // Max spotlights
if (device.platform === 'desktop') if (device.platform === 'desktop')
this._maxSpotlights = lastN; this._maxSpotlights = lastN;
@ -1046,7 +1041,7 @@ export default class RoomClient
{ {
audio : audio :
{ {
deviceId : { exact: device.deviceId }, deviceId : { ideal: device.deviceId },
sampleRate : store.getState().settings.sampleRate, sampleRate : store.getState().settings.sampleRate,
channelCount : store.getState().settings.channelCount, channelCount : store.getState().settings.channelCount,
volume : store.getState().settings.volume, volume : store.getState().settings.volume,
@ -3245,14 +3240,14 @@ export default class RoomClient
const stream = await navigator.mediaDevices.getUserMedia( const stream = await navigator.mediaDevices.getUserMedia(
{ {
audio : { audio : {
deviceId : { ideal: deviceId }, deviceId : { ideal: device.deviceId },
sampleRate : 48000, sampleRate : store.getState().settings.sampleRate,
channelCount : 1, channelCount : store.getState().settings.channelCount,
volume : 1.0, volume : store.getState().settings.volume,
autoGainControl : true, autoGainControl : store.getState().settings.autoGainControl,
echoCancellation : false, echoCancellation : store.getState().settings.echoCancellation,
noiseSuppression : false, noiseSuppression : store.getState().settings.noiseSuppression,
sampleSize : 16 sampleSize : store.getState().settings.sampleSize
} }
} }
); );

View File

@ -56,10 +56,10 @@ export const setNoiseSuppression = (noiseSuppression) =>
payload : { noiseSuppression } payload : { noiseSuppression }
}); });
export const setDefaultAudio = (defaultAudio) => export const setDefaultAudio = (audio) =>
({ ({
type : 'SET_DEFAULT_AUDIO', type : 'SET_DEFAULT_AUDIO',
payload : { defaultAudio } payload : { audio }
}); });
export const toggleEchoCancellation = () => export const toggleEchoCancellation = () =>

View File

@ -16,7 +16,8 @@ const initialState =
lastN : 4, lastN : 4,
permanentTopBar : true, permanentTopBar : true,
hiddenControls : false, hiddenControls : false,
notificationSounds : true notificationSounds : true,
...window.config.defaultAudio
}; };
const settings = (state = initialState, action) => const settings = (state = initialState, action) =>
@ -89,7 +90,7 @@ const settings = (state = initialState, action) =>
case 'SET_NOISE_SUPPRESSION': case 'SET_NOISE_SUPPRESSION':
{ {
const { noiseSuppression } = action.payload; const { noiseSuppression } = action.payload;
return { ...state, noiseSuppression }; return { ...state, noiseSuppression };
} }