UNPKG

875 BPlain TextView Raw
1/**
2 * A camera for video input available to be used on the device.
3 */
4export interface Camera {
5 /**
6 * The unique identifier for the device, can change between page loads.
7 */
8 readonly deviceId: string;
9 /**
10 * The label describing the device.
11 */
12 readonly label: string;
13 /**
14 * The type of camera, back or front (not guaranteed to be correct, depending on the device).
15 */
16 readonly cameraType: Camera.Type;
17 /**
18 * The current video resolution if and when the camera is in use, given as width and height in pixels.
19 */
20 currentResolution?: { width: number; height: number };
21}
22
23export namespace Camera {
24 /**
25 * Camera type (not guaranteed to be correct, depending on the device).
26 */
27 export enum Type {
28 /**
29 * Front facing camera.
30 */
31 FRONT = "front",
32 /**
33 * Back facing camera.
34 */
35 BACK = "back"
36 }
37}