Skip to content

Instantly share code, notes, and snippets.

@junlapong
Forked from iporsut/index.html
Created June 6, 2021 11:46
Show Gist options
  • Select an option

  • Save junlapong/768ac8fb3f370f6c8f12ff328dd7e433 to your computer and use it in GitHub Desktop.

Select an option

Save junlapong/768ac8fb3f370f6c8f12ff328dd7e433 to your computer and use it in GitHub Desktop.
HTML display from camera
<!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>
@junlapong

Copy link
Copy Markdown
Author

Chrome

  • Right click, then select Picture in Picture

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment