Created
July 4, 2021 04:09
-
-
Save franciscojsc/12378b30801e6659951ebf631a2027b4 to your computer and use it in GitHub Desktop.
WebCam Web 📷
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> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>WebCam Web</title> | |
</head> | |
<body> | |
<video id="video" autoplay muted></video> | |
<script> | |
const addVideoStream = (stream) => { | |
document.querySelector('#video').srcObject = stream; | |
} | |
navigator.mediaDevices.getUserMedia({ | |
video: true | |
}).then(addVideoStream); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment