auto select the first audio input on connection success webrtc

This commit is contained in:
Audric Ackermann 2021-11-22 14:39:38 +11:00
parent d5f6180ae6
commit 53289298a9
No known key found for this signature in database
GPG key ID: 999F434D76324AD4

View file

@ -558,6 +558,10 @@ function handleConnectionStateChanged(pubkey: string) {
closeVideoCall();
} else if (peerConnection?.connectionState === 'connected') {
setIsRinging(false);
const firstAudioInput = audioInputsList?.[0].deviceId || undefined;
if (firstAudioInput) {
void selectAudioInputByDeviceId(firstAudioInput);
}
window.inboxStore?.dispatch(callConnected({ pubkey }));
}
}