Skip to content

Instantly share code, notes, and snippets.

@imaustink
Last active August 7, 2018 07:13
Show Gist options
  • Save imaustink/424e56c2dfaa6ae0183505f7eb59cf24 to your computer and use it in GitHub Desktop.
Save imaustink/424e56c2dfaa6ae0183505f7eb59cf24 to your computer and use it in GitHub Desktop.
A demo of the enumerateDevices API
navigator.mediaDevices.enumerateDevices()
.then(devices => {
devices.forEach(device => {
console.log(`${device.kind}: ${device.label}`)
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment