Skip to content

Commit

Permalink
fix: skip preview and handle device load with no permission
Browse files Browse the repository at this point in the history
  • Loading branch information
raviteja83 committed Feb 24, 2025
1 parent dac6514 commit 6d032ce
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
12 changes: 3 additions & 9 deletions packages/hms-video-store/src/device-manager/DeviceManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,10 @@ export class DeviceManager implements HMSDeviceManager {
const isLocalTrackEnabled = ({ enabled, track }: { enabled: boolean; track: HMSLocalTrack }) =>
enabled && track.source === 'regular';
this.eventBus.localVideoEnabled.waitFor(isLocalTrackEnabled).then(async () => {
await this.enumerateDevices();
if (this.videoInputChanged) {
this.eventBus.deviceChange.publish({ devices: this.getDevices() } as HMSDeviceChangeEvent);
}
await this.init(true);
});
this.eventBus.localAudioEnabled.waitFor(isLocalTrackEnabled).then(async () => {
await this.enumerateDevices();
if (this.audioInputChanged) {
this.eventBus.deviceChange.publish({ devices: this.getDevices() } as HMSDeviceChangeEvent);
}
await this.init(true);
});

this.eventBus.deviceChange.subscribe(({ type, isUserSelection, selection }) => {
Expand Down Expand Up @@ -106,9 +100,9 @@ export class DeviceManager implements HMSDeviceManager {
// do it only on initial load.
if (!force) {
await this.updateToActualDefaultDevice();
await this.autoSelectAudioOutput();
this.startPollingForDevices();
}
await this.autoSelectAudioOutput();
this.logDevices('Init');
await this.setOutputDevice();
this.eventBus.deviceChange.publish({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ export const ConferenceScreen = () => {
initEndpoint: endpoints?.init,
rememberDeviceSelection: true,
settings: {
isAudioMuted: !isPreviewScreenEnabled,
isVideoMuted: !isPreviewScreenEnabled,
isAudioMuted: true,
isVideoMuted: true,
speakerAutoSelectionBlacklist: ['Yeti Stereo Microphone'],
},
})
Expand Down

0 comments on commit 6d032ce

Please sign in to comment.