navigator.mediaDevices.enumerateDevices().then((devices) => {
devices.forEach((device) => {
console.log(device); // an InputDeviceInfo object if the device is an input device, otherwise a MediaDeviceInfo object.
});
});InputDeviceInfo / notebook
InputDeviceInfo
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.