-
-
Save junlapong/768ac8fb3f370f6c8f12ff328dd7e433 to your computer and use it in GitHub Desktop.
HTML display from camera
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8" /> | |
| <title>Camera</title> | |
| </head> | |
| <body> | |
| <video id="camera" autoplay playsinline></video> | |
| <script> | |
| const videoElement = document.getElementById("camera"); | |
| navigator.mediaDevices | |
| .getUserMedia({ | |
| video: {}, | |
| }) | |
| .then((stream) => { | |
| videoElement.srcObject = stream; | |
| }); | |
| </script> | |
| </body> | |
| </html> |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Chrome