Skip to content

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

fix(device-selection): use persisted settings as default values if available

Leonard Kim5d4a2e87f82d
diff --git a/react/features/base/settings/reducer.js b/react/features/base/settings/reducer.js
index 57d8af8f86..d38bb77f07 100644
--- a/react/features/base/settings/reducer.js
+++ b/react/features/base/settings/reducer.js
@@ -128,7 +128,14 @@ function _initSettings(featureState) {
const audioOutputDeviceId
= window.localStorage.getItem('audioOutputDeviceId') || 'default';
- if (audioOutputDeviceId
+ settings = assignIfDefined({
+ audioOutputDeviceId,
+ cameraDeviceId,
+ localFlipX,
+ micDeviceId
+ }, settings);
+
+ if (settings.audioOutputDeviceId
!== JitsiMeetJS.mediaDevices.getAudioOutputDevice()) {
JitsiMeetJS.mediaDevices.setAudioOutputDevice(
audioOutputDeviceId
@@ -138,13 +145,6 @@ function _initSettings(featureState) {
+ 'instead.', ex);
});
}
-
- settings = assignIfDefined({
- audioOutputDeviceId,
- cameraDeviceId,
- localFlipX,
- micDeviceId
- }, settings);
}
// Things we stored in profile earlier