Skip to content

Commit

Permalink
fix: use a better check
Browse files Browse the repository at this point in the history
  • Loading branch information
raviteja83 committed Dec 10, 2024
1 parent 2891b6d commit 2f6f85d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ export class DeviceManager implements HMSDeviceManager {
*/
// eslint-disable-next-line complexity
public autoSelectAudioOutput = async () => {
if ('ondevicechange' in navigator.mediaDevices || !this.store.getLocalPeer()?.joinedAt) {
if ('ondevicechange' in navigator.mediaDevices || !this.audioInputChanged) {
return;
}
const { bluetoothDevice, earpiece, speakerPhone, wired } = this.categorizeAudioInputDevices();
Expand Down
2 changes: 1 addition & 1 deletion packages/hms-video-store/src/sdk/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -664,9 +664,9 @@ export class HMSSdk implements HMSInterface {
HMSLogger.d(this.TAG, `✅ Joined room ${roomId}`);
this.analyticsTimer.start(TimedEvent.PEER_LIST);
await this.notifyJoin();
await this.deviceManager.autoSelectAudioOutput();
this.sdkState.isJoinInProgress = false;
await this.publish(config.settings, previewRole);
await this.deviceManager.autoSelectAudioOutput();
} catch (error) {
this.analyticsTimer.end(TimedEvent.JOIN);
this.sdkState.isJoinInProgress = false;
Expand Down

0 comments on commit 2f6f85d

Please sign in to comment.