BrU32

JS/CSS Canvas Webcam FLIR/Grayscale Combo SRC V1

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