Skip to content

Instantly share code, notes, and snippets.

@kypflug
Created May 2, 2018
Embed
What would you like to do?
var constraints = {
video: true
};
function handleSuccess(stream) {
video.srcObject = stream;
}
function handleError(error) {
console.log('navigator.getDisplayMedia error: ', error);
}
navigator.getDisplayMedia(constraints).
then(handleSuccess).catch(handleError);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment