-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlesson.html
More file actions
85 lines (76 loc) · 1.86 KB
/
lesson.html
File metadata and controls
85 lines (76 loc) · 1.86 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Practice Sign</title>
<style>
body {
font-family: Arial, sans-serif;
background: #111;
color: #fff;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
height: 100vh;
margin: 0;
text-align: center;
}
.content {
display: flex;
gap: 40px;
margin-top: 30px;
align-items: center;
}
video, iframe {
border-radius: 20px;
box-shadow: 0 10px 20px rgba(0,0,0,0.5);
}
#sign-video {
width: 400px;
height: 300px;
}
#camera {
width: 400px;
height: 300px;
background: #333;
}
a.back {
color: #fff;
margin-top: 20px;
display: inline-block;
text-decoration: none;
font-size: 18px;
}
</style>
</head>
<body>
<h1 id="title">Practice Alphabet</h1>
<div class="content">
<video id="sign-video" controls></video>
<video id="camera" autoplay muted></video>
</div>
<a class="back" href="alphabet.html">← Back to Cards</a>
<script>
// Get the alphabet letter from URL
const params = new URLSearchParams(window.location.search);
const letter = params.get('letter');
// Set title
document.getElementById('title').innerText = `Practice Alphabet: ${letter}`;
// Set video source
const signVideo = document.getElementById('sign-video');
signVideo.src = `videos/${letter}.mp4`; // Example: videos/A.mp4, videos/B.mp4, etc.
// Open Camera
const camera = document.getElementById('camera');
if (navigator.mediaDevices.getUserMedia) {
navigator.mediaDevices.getUserMedia({ video: true })
.then(function(stream) {
camera.srcObject = stream;
})
.catch(function(error) {
console.log("Camera access error:", error);
});
}
</script>
</body>
</html>