Created
June 25, 2020 07:11
-
-
Save dkgrieshammer/b10c588cc7e671a1c7b95ee41f57d02b to your computer and use it in GitHub Desktop.
Lists available inputs like Webcams and Audio Inputs in JS - using it in P5.js to select different cameras for capture
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// logs all Devices to console; if served via HTTPS or permission for Media is granted, devices will have clear names | |
// otherwise the list will only show cryptic IDs | |
navigator.mediaDevices.enumerateDevices().then(function (devices) { | |
devices.forEach(function(device) { | |
console.log(device) | |
}) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment