enumerateDevices()

enumerateDevices()

This is a wrapper around navigator.mediaDevices.enumerateDevices().

Returns a Promise that resolves with a list of available video input devices, and audio input and output devices.

{
"devices": [
{
"deviceId": "CAMERA_ENVIRONMENT",
"facing": "environment",
"groupId": "",
"kind": "videoinput",
"label": "Rear camera"
},
{
"deviceId": "CAMERA_USER",
"facing": "user",
"groupId": "",
"kind": "videoinput",
"label": "Front camera"
},
{
"deviceId": "WIRED_OR_EARPIECE",
"groupId": "",
"kind": "audio",
"label": "Phone earpiece"
},
{
"deviceId": "SPEAKERPHONE",
"groupId": "",
"kind": "audio",
"label": "Speakerphone"
},
{
"deviceId": "BLUETOOTH",
"groupId": "",
"kind": "audio",
"label": "Bluetooth"
}
]
}