BrU32

JS/CSS Webcam Canvas Blur FX SRC

Dec 13th, 2016
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. <style>
  2. body{
  3. filter:blur(31px)
  4. }
  5. </style>
  6. <video id="video" width="500" height="500" autoplay></video>
  7. <canvas id="canvas" width="500" height="500"></canvas>
  8. <script>
  9. var canvas = document.getElementById('canvas');
  10. var context = canvas.getContext('2d');
  11. var video = document.getElementById('video');
  12. var mediaConfig = { video: true,audio:true};
  13. navigator.mediaDevices.getUserMedia(mediaConfig).then(function(stream) {
  14. video.src = window.URL.createObjectURL(stream);
  15. video.play();
  16. });
  17. </script>
Advertisement
Add Comment
Please, Sign In to add comment