Skip to content

Instantly share code, notes, and snippets.

@EricDavies
Created November 27, 2017 22:50
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 EricDavies/32f085fab3e42ba9c6b3a799e4961c76 to your computer and use it in GitHub Desktop.
Save EricDavies/32f085fab3e42ba9c6b3a799e4961c76 to your computer and use it in GitHub Desktop.
getusermediaTest
<!DOCTYPE html>
<html>
<head>
<title>Test getusermedia</title>
</head>
<body>
<div id="result"></div>
<script>
navigator.mediaDevices.getUserMedia({audio:true,video:true}).then(
function(stream) {
document.getElementById("result").appendChild(
document.createTextNode("success"));
}
).catch(
function(error) {
document.getElementById("result").appendChild(
document.createTextNode("failure: " + error.toString()));
console.log(arguments);
}
);
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment