Skip to content

Commit

Permalink
Update publish-alpha
Browse files Browse the repository at this point in the history
  • Loading branch information
raviteja83 authored Dec 10, 2024
2 parents 57d11f7 + 9013a6a commit 065a283
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
9 changes: 4 additions & 5 deletions packages/hms-video-store/src/device-manager/DeviceManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ export class DeviceManager implements HMSDeviceManager {
// do it only on initial load.
if (!force) {
await this.updateToActualDefaultDevice();
await this.autoSelectAudioOutput();
this.startPollingForDevices();
}
this.logDevices('Init');
Expand Down Expand Up @@ -134,12 +133,12 @@ export class DeviceManager implements HMSDeviceManager {
}

cleanup() {
this.initialized = false;
this.earpieceSelected = false;
if (this.timer) {
clearTimeout(this.timer);
this.timer = null;
}
this.initialized = false;
this.earpieceSelected = false;
this.audioInput = [];
this.audioOutput = [];
this.videoInput = [];
Expand Down Expand Up @@ -483,8 +482,8 @@ export class DeviceManager implements HMSDeviceManager {
* Mweb is not able to play via call channel by default, this is to switch from media channel to call channel
*/
// eslint-disable-next-line complexity
private autoSelectAudioOutput = async () => {
if ('ondevicechange' in navigator.mediaDevices) {
public autoSelectAudioOutput = async () => {
if ('ondevicechange' in navigator.mediaDevices || !this.audioInputChanged) {
return;
}
const { bluetoothDevice, earpiece, speakerPhone, wired } = this.categorizeAudioInputDevices();
Expand Down
1 change: 1 addition & 0 deletions packages/hms-video-store/src/sdk/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -666,6 +666,7 @@ export class HMSSdk implements HMSInterface {
await this.notifyJoin();
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 065a283

Please sign in to comment.