getDevicesWithPermissions

View as Markdown

getDevicesWithPermissions

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

Deprecated. Use getDevices for better cross-browser compatibility.

After prompting the user for permission, returns an array of media input and output devices available on this machine. If kind is provided, only the devices of the specified kind are returned. Possible values for kind are "camera", "microphone", and "speaker", which respectively correspond to getCameraDevicesWithPermissions, getMicrophoneDevicesWithPermissions, and getSpeakerDevicesWithPermissions.

Parameters

kind
DevicePermissionNameDefaults to undefined

Filter for this device category.

fullList
booleanDefaults to false

By default, only devices for which we have been granted permissions are returned. Pass true to obtain a list of devices regardless of permissions. Note that some values such as name and deviceId could be omitted.

Returns

Promise<MediaDeviceInfo[]>

Example

1await SignalWire.WebRTC.getDevicesWithPermissions("camera");
2// [
3// {
4// "deviceId": "Rug5Bk...4TMhY=",
5// "kind": "videoinput",
6// "label": "HD FaceTime Camera",
7// "groupId": "Su/dzw...ccfnY="
8// }
9// ]