Interface: IndexedDevices
Methods
anyAuthorizedDevice
▸ anyAuthorizedDevice(kind?): boolean
true when there is any authorized device of the kind. When kind is not
provided, it checks for any audio or video input device.
Parameters
| Name | Type |
|---|---|
kind? | MediaDeviceKind |
Returns
boolean
first
▸ first(kind): undefined | MediaDeviceInfoLike
First device of the kind
Parameters
| Name | Type |
|---|---|
kind | MediaDeviceKind |
Returns
undefined | MediaDeviceInfoLike
get
▸ get(device?): MediaDeviceInfoLike[]
Get devices by kind and device id or label
When both deviceId and label are provided, it will use deviceId to
find the device, and when it's not found, it will use label to find
When device is not provided, it returns all devices.
Parameters
| Name | Type | Description |
|---|---|---|
device? | Pick<Partial<MediaDeviceInfoLike>, "deviceId" | "groupId" | "kind" | "label"> | the device to find |
Returns
found devices otherwise empty array
size
▸ size(kind?): number
Size of particular kind of devices. When kind is not specified, it returns the total size.
Parameters
| Name | Type |
|---|---|
kind? | MediaDeviceKind |
Returns
number
toJSON
▸ toJSON(): Record<MediaDeviceKind, MediaDeviceInfoLike[]>
Returns
Record<MediaDeviceKind, MediaDeviceInfoLike[]>