enumerateDevices method
The enumerateDevices()
method of the MediaDevices interface
requests a list of the currently available media input and output devices,
such as microphones, cameras, headsets, and so forth.
The returned Promise
is resolved with an array of MediaDeviceInfo
objects describing the devices.
The returned list will omit any devices that are blocked by the document
Permission Policy:
microphone
,
camera
,
speaker-selection
(for output devices), and so on.
Access to particular non-default devices is also gated by the
Permissions API,
and the list will omit devices for which the user has not granted explicit
permission.
Implementation
external JSPromise<JSArray<MediaDeviceInfo>> enumerateDevices();