A digital mirror - shows the video feed from your camera.
It doesn’t work in bl.ocks.org using http
due to security restrictions. It does, however, work using https (thanks to Robert Monfera for pointing this out).
Draws from:
Built with blockbuilder.org
<!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>