Created
December 17, 2016 14:43
-
-
Save JMPerez/6b9e9ad08c76f7a97ee33e433707fac9 to your computer and use it in GitHub Desktop.
Asking for permission to get access to window recording and camera
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
// we ask for permission to record the window | |
// mediaSource could also be 'screen' if we wanted | |
// to record the entire screen | |
const getStreamForWindow = () => navigator.mediaDevices.getUserMedia({ | |
video: { | |
mediaSource: 'window' | |
} | |
}); | |
// we ask for permission to record the audio and video from the camera | |
const getStreamForCamera = () => navigator.mediaDevices.getUserMedia({ | |
audio: true | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment