Last active
August 12, 2020 23:15
-
-
Save kimberleehowley/5efc98cf95ce88a3afec0b845fa12663 to your computer and use it in GitHub Desktop.
This file contains 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
// Save the requirements Object in your console | |
const requirements = {'video': true, 'audio': true} | |
// Call navigator.mediaDevices.getUserMedia() passing in that object, and your camera should turn on. | |
navigator.mediaDevices.getUserMedia(requirements) | |
.then(stream => { | |
console.log('Yay, we’re streaming:', stream); | |
}) | |
.catch(error => { | |
console.error('Whoops, could not access devices:', error); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment