vdo.ninja/devices.html
Steve Seguin 9d1e1d7f53
version 13.2
-bug fixes
-camera settings added
2020-11-09 16:24:26 -05:00

28 lines
578 B
HTML

<html>
<head><meta charset="UTF-8"></head>
<body>
<pre><code id="json-container"></code></pre>
<script>
var list = [];
navigator.mediaDevices.enumerateDevices()
.then(function(devices) {
devices.forEach(function(device) {
console.log(device.kind + ": " + device.label +
" id = " + device.deviceId);
list.push(device);
});
document.getElementById('json-container').innerHTML = JSON.stringify(list, null, 2);
})
.catch(function(err) {
console.log(err.name + ": " + err.message);
});
</script>
</body>
</html>