Skip to content

Commit

Permalink
fix: renamed prop
Browse files Browse the repository at this point in the history
  • Loading branch information
ygit committed Nov 19, 2024
1 parent 2b27c32 commit 70ce0aa
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export class DeviceManager implements HMSDeviceManager {
hasWebcamPermission = false;
hasMicrophonePermission = false;

prevSelection: SelectedDevices = {
currentSelection: SelectedDevices = {
audioInput: undefined,
videoInput: undefined,
audioOutput: undefined,
Expand Down
8 changes: 5 additions & 3 deletions packages/hms-video-store/src/sdk/RoleChangeManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,11 +167,11 @@ export default class RoleChangeManager {
private getAudioDeviceSettings(): { audioInputDeviceId: string; audioOutputDeviceId: string } {
const initialSettings = this.store.getConfig()?.settings;
const audioInputDeviceId =
this.deviceManager.prevSelection[DeviceType.audioInput]?.deviceId ||
this.deviceManager.currentSelection[DeviceType.audioInput]?.deviceId ||
initialSettings?.audioInputDeviceId ||
'default';
const audioOutputDeviceId =
this.deviceManager.prevSelection[DeviceType.audioOutput]?.deviceId ||
this.deviceManager.currentSelection[DeviceType.audioOutput]?.deviceId ||
initialSettings?.audioOutputDeviceId ||
'default';

Expand All @@ -184,7 +184,9 @@ export default class RoleChangeManager {
private getVideoInputDeviceId(): string {
const initialSettings = this.store.getConfig()?.settings;
return (
this.deviceManager.prevSelection[DeviceType.videoInput]?.deviceId || initialSettings?.videoDeviceId || 'default'
this.deviceManager.currentSelection[DeviceType.videoInput]?.deviceId ||
initialSettings?.videoDeviceId ||
'default'
);
}
}
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 @@ -1350,7 +1350,7 @@ export class HMSSdk implements HMSInterface {
}

private handleLocalRoleUpdate = async ({ oldRole, newRole }: { oldRole: HMSRole; newRole: HMSRole }) => {
this.deviceManager.prevSelection = this.deviceManager.getCurrentSelection();
this.deviceManager.currentSelection = this.deviceManager.getCurrentSelection();
await this.transport.handleLocalRoleUpdate({ oldRole, newRole });
await this.roleChangeManager?.handleLocalPeerRoleUpdate({ oldRole, newRole });
await this.interactivityCenter.whiteboard.handleLocalRoleUpdate();
Expand Down

0 comments on commit 70ce0aa

Please sign in to comment.