From 797326fd1ef1374a96c19617528794e8a15ce06e Mon Sep 17 00:00:00 2001 From: Ravi theja Date: Tue, 5 Mar 2024 12:30:39 +0530 Subject: [PATCH] revert: polling device change for mweb --- .../src/audio-sink-manager/AudioSinkManager.ts | 18 ------------------ 1 file changed, 18 deletions(-) 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 83bc2085f5..647ffb7fd3 100644 --- a/packages/hms-video-store/src/audio-sink-manager/AudioSinkManager.ts +++ b/packages/hms-video-store/src/audio-sink-manager/AudioSinkManager.ts @@ -47,7 +47,6 @@ export class AudioSinkManager { this.eventBus.audioTrackRemoved.subscribe(this.handleTrackRemove); this.eventBus.audioTrackUpdate.subscribe(this.handleTrackUpdate); this.eventBus.deviceChange.subscribe(this.handleAudioDeviceChange); - this.startPollingForDevices(); } setListener(listener?: HMSUpdateListener) { @@ -267,19 +266,6 @@ export class AudioSinkManager { } }; - private startPollingForDevices = () => { - // device change supported, no polling needed - if ('ondevicechange' in navigator.mediaDevices) { - return; - } - this.timer = setInterval(() => { - (async () => { - await this.deviceManager.init(true, false); - await this.autoSelectAudioOutput(); - })(); - }, 5000); - }; - /** * Mweb is not able to play via call channel by default, this is to switch from media channel to call channel */ @@ -308,10 +294,6 @@ export class AudioSinkManager { const localAudioTrack = this.store.getLocalPeer()?.audioTrack; if (localAudioTrack && earpiece) { const externalDeviceID = bluetoothDevice?.deviceId || wired?.deviceId || speakerPhone?.deviceId; - // already selected appropriate device - if (localAudioTrack.settings.deviceId === externalDeviceID) { - return; - } await localAudioTrack.setSettings({ deviceId: earpiece?.deviceId }); await localAudioTrack.setSettings({ deviceId: externalDeviceID,