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(deviceSelection):prejoin-update current device

Hristo Terezov0ef71f4368ab
diff --git a/react/features/prejoin/actions.js b/react/features/prejoin/actions.js
index 3f09c7d5d3..d529563b48 100644
--- a/react/features/prejoin/actions.js
+++ b/react/features/prejoin/actions.js
@@ -9,6 +9,7 @@ import { getDialOutStatusUrl, getDialOutUrl, updateConfig } from '../base/config
import { browser } from '../base/lib-jitsi-meet';
import { createLocalTrack } from '../base/lib-jitsi-meet/functions';
import { isVideoMutedByUser, MEDIA_TYPE } from '../base/media';
+import { updateSettings } from '../base/settings';
import {
createLocalTracksF,
getLocalAudioTrack,
@@ -359,7 +360,11 @@ export function replaceAudioTrackById(deviceId: string) {
const newTrack = await createLocalTrack('audio', deviceId);
const oldTrack = getLocalAudioTrack(tracks)?.jitsiTrack;
- dispatch(replaceLocalTrack(oldTrack, newTrack));
+ dispatch(replaceLocalTrack(oldTrack, newTrack)).then(() => {
+ dispatch(updateSettings({
+ micDeviceId: newTrack.getDeviceId()
+ }));
+ });
} catch (err) {
dispatch(setDeviceStatusWarning('prejoin.audioTrackError'));
logger.log('Error replacing audio track', err);
@@ -386,7 +391,11 @@ export function replaceVideoTrackById(deviceId: Object) {
);
const oldTrack = getLocalVideoTrack(tracks)?.jitsiTrack;
- dispatch(replaceLocalTrack(oldTrack, newTrack));
+ dispatch(replaceLocalTrack(oldTrack, newTrack)).then(() => {
+ dispatch(updateSettings({
+ cameraDeviceId: newTrack.getDeviceId()
+ }));
+ });
wasVideoMuted && newTrack.mute();
} catch (err) {
dispatch(setDeviceStatusWarning('prejoin.videoTrackError'));