From 1e92ed0a37ef5e66debce2ca67ade8ab3b6f7616 Mon Sep 17 00:00:00 2001 From: DorraJaouad Date: Thu, 18 Apr 2024 22:09:17 +0200 Subject: [PATCH] fix(media): improve the default selection before preferences Signed-off-by: DorraJaouad --- src/components/MediaSettings/MediaSettings.vue | 5 +++++ src/utils/webrtc/MediaDevicesManager.js | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/src/components/MediaSettings/MediaSettings.vue b/src/components/MediaSettings/MediaSettings.vue index 5e8003a449f..0523a9b44d5 100644 --- a/src/components/MediaSettings/MediaSettings.vue +++ b/src/components/MediaSettings/MediaSettings.vue @@ -489,6 +489,11 @@ export default { mounted() { subscribe('talk:media-settings:show', this.showModal) subscribe('talk:media-settings:hide', this.closeModalAndApplySettings) + + const devicesPreferred = BrowserStorage.getItem('devicesPreferred') + if (!devicesPreferred) { + this.tabContent = 'devices' + } }, beforeDestroy() { diff --git a/src/utils/webrtc/MediaDevicesManager.js b/src/utils/webrtc/MediaDevicesManager.js index 4c8ea756afc..0850cec15a2 100644 --- a/src/utils/webrtc/MediaDevicesManager.js +++ b/src/utils/webrtc/MediaDevicesManager.js @@ -273,6 +273,12 @@ MediaDevicesManager.prototype = { this._preferenceVideoInputList = newVideoInputList BrowserStorage.setItem('videoInputPreferences', JSON.stringify(newVideoInputList)) } + + const devicesPreferred = BrowserStorage.getItem('devicesPreferred') + if (!devicesPreferred) { + BrowserStorage.setItem('devicesPreferred', true) + } + }, /**