diff --git a/packages/hms-video-store/src/audio-sink-manager/AudioSinkManager.ts b/packages/hms-video-store/src/audio-sink-manager/AudioSinkManager.ts index c91ed8a787..f319cb1e3b 100644 --- a/packages/hms-video-store/src/audio-sink-manager/AudioSinkManager.ts +++ b/packages/hms-video-store/src/audio-sink-manager/AudioSinkManager.ts @@ -308,6 +308,7 @@ export class AudioSinkManager { const localAudioTrack = this.store.getLocalPeer()?.audioTrack; if (localAudioTrack && earpiece) { const externalDeviceID = bluetoothDevice?.deviceId || wired?.deviceId || speakerPhone?.deviceId; + console.log('externalDeviceID', externalDeviceID); // already selected appropriate device if (localAudioTrack.settings.deviceId === externalDeviceID) { return; diff --git a/packages/hms-video-store/src/media/tracks/HMSLocalAudioTrack.ts b/packages/hms-video-store/src/media/tracks/HMSLocalAudioTrack.ts index caef6b0629..578141e0d5 100644 --- a/packages/hms-video-store/src/media/tracks/HMSLocalAudioTrack.ts +++ b/packages/hms-video-store/src/media/tracks/HMSLocalAudioTrack.ts @@ -273,6 +273,7 @@ export class HMSLocalAudioTrack extends HMSAudioTrack { const hasPropertyChanged = generateHasPropertyChanged(settings, this.settings); if (hasPropertyChanged('deviceId')) { this.manuallySelectedDeviceId = !internal ? settings.deviceId : this.manuallySelectedDeviceId; + console.log('device change', this.manuallySelectedDeviceId, settings.deviceId); await this.replaceTrackWith(settings); const groupId = this.nativeTrack.getSettings().groupId; if (!internal && settings.deviceId) {