Skip to content

Instantly share code, notes, and snippets.

@curran
Last active September 10, 2016 17: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 curran/3184b45f555dae6bebb1536110763824 to your computer and use it in GitHub Desktop.
Save curran/3184b45f555dae6bebb1536110763824 to your computer and use it in GitHub Desktop.
Mirror
license: mit
<!DOCTYPE html>
<head>
<meta charset="utf-8">
<script src="https://unpkg.com/webrtc-adapter@2.0.2/out/adapter.js"></script>
<style>
body { margin:0;position:fixed;top:0;right:0;bottom:0;left:0; }
video { min-width: 100%; height: auto; }
</style>
</head>
<body>
<video id="video" autoplay></video>
<script>
var video = document.getElementById("video");
navigator.mediaDevices.getUserMedia({ video: { width: 1280, height: 720 } })
.then(function(stream) {
video.src = window.URL.createObjectURL(stream);
video.play();
});
</script>
</body>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment