getDevices

View as Markdown

getDevices

  • Const getDevices(name?, fullList?): Promise<MediaDeviceInfo[]> — See MediaDeviceInfo for more details.

Enumerates the media input and output devices available on this machine. If name is provided, only the devices of the specified kind are returned. Possible values for name are "camera", "microphone", and "speaker", which respectively correspond to getCameraDevices, getMicrophoneDevices, and getSpeakerDevices.

Parameters

name
DevicePermissionNameDefaults to undefined

Filter for this device category.

fullList
booleanDefaults to false

Set to true to retrieve the raw list as returned by the browser, which might include multiple, duplicate deviceIds for the same group.

Returns

Promise<MediaDeviceInfo[]>

Example

1await SignalWire.WebRTC.getDevices("camera", true);
2// [
3// {
4// "deviceId": "3c4f97...",
5// "kind": "videoinput",
6// "label": "HD Camera",
7// "groupId": "828fec..."
8// }
9// ]