Skip to content

Instantly share code, notes, and snippets.

@kypflug
Created May 2, 2018 16:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kypflug/5d1e15bb33beb008a91a8bc789250255 to your computer and use it in GitHub Desktop.
Save kypflug/5d1e15bb33beb008a91a8bc789250255 to your computer and use it in GitHub Desktop.
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