Skip to content

Commit

Permalink
Update hello.html
Browse files Browse the repository at this point in the history
  • Loading branch information
abraae authored Jun 28, 2024
1 parent cfed498 commit 3dc450c
Showing 1 changed file with 38 additions and 1 deletion.
39 changes: 38 additions & 1 deletion hello.html
Original file line number Diff line number Diff line change
@@ -1 +1,38 @@
hello world
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Webcam Video Capture</title>
<style>
body {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
background-color: #f0f0f0;
margin: 0;
}
video {
border: 2px solid #333;
border-radius: 8px;
}
</style>
</head>
<body>
<video id="video" width="640" height="480" autoplay></video>

<script>
(async function() {
const video = document.getElementById('video');

try {
const stream = await navigator.mediaDevices.getUserMedia({ video: true });
video.srcObject = stream;
} catch (error) {
console.error('Error accessing the webcam:', error);
}
})();
</script>
</body>
</html>

0 comments on commit 3dc450c

Please sign in to comment.