Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 26 additions & 1 deletion src/ui-commands/camera/commands.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { CameraEnum } from './enums';
import { SetSelfViewDisableAllDevicesCommandArguments, SetSelfViewDisableCommandArguments } from './types';
import { SetCameraFocusCommandArguments, SetSelfViewDisableAllDevicesCommandArguments, SetSelfViewDisableCommandArguments } from './types';

export const camera = {
/**
Expand Down Expand Up @@ -49,4 +49,29 @@
}),
);
},
/**
* Sets the in focus camera for a specific user.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* Sets the in focus camera for a specific user.
* Sets the focused camera for a specific user.

*
* @param setSelfViewDisableCommandArguments: object with a
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* @param setSelfViewDisableCommandArguments: object with a
* @param setCameraFocusCommandArguments: object with a

Parameter name is slightly off.

* boolean that tells whether to enable or disable the camera focus for specific user.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* boolean that tells whether to enable or disable the camera focus for specific user.
* object that tells whether to enable or disable the camera focus for specific user.

*/
setCameraFocus: (
setCameraFocusCommandArguments: SetCameraFocusCommandArguments,
) => {
const {
webcamSelector,
focus,
} = setCameraFocusCommandArguments;
window.dispatchEvent(
new CustomEvent<
SetCameraFocusCommandArguments
>(CameraEnum.SET_CAMERA_FOCUS, {
detail: {
focus,
webcamSelector,
},
}),
);
}
,

Check failure on line 76 in src/ui-commands/camera/commands.ts

View workflow job for this annotation

GitHub Actions / ts-code-validation

Expected indentation of 2 spaces but found 0
Comment on lines +75 to +76
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
}
,
},

Adjusting typescipt error.

};
1 change: 1 addition & 0 deletions src/ui-commands/camera/enums.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export enum CameraEnum {
SET_SELF_VIEW_DISABLED_ALL_DEVICES = 'SET_SELF_VIEW_DISABLED_ALL_DEVICES_COMMAND',
SET_SELF_VIEW_DISABLED = 'SET_SELF_VIEW_DISABLED_COMMAND',
SET_CAMERA_FOCUS = 'SET_CAMERA_FOCUS_COMMAND',
}
18 changes: 18 additions & 0 deletions src/ui-commands/camera/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,29 @@ export interface SetSelfViewDisableCommandArguments {
streamId: string;
}

interface ByUserId {
userId: string;
}

interface ByStreamId {
streamId: string;
}

export type ObjectTo = ByUserId | ByStreamId;

export interface SetCameraFocusCommandArguments {
focus: boolean;
webcamSelector: ObjectTo[];
}

export interface UiCommandsCameraObject {
setSelfViewDisableAllDevices: (
setSelfViewDisableAllDevicesCommandArguments: SetSelfViewDisableAllDevicesCommandArguments
) => void;
setSelfViewDisable: (
setSelfViewDisableAllDevicesCommandArguments: SetSelfViewDisableCommandArguments
) => void;
setCameraFocus: (
setCameraFocusCommandArguments: SetCameraFocusCommandArguments
) => void;
}
Loading