-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
38 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
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> |