Update index.html
Browse files- index.html +41 -18
index.html
CHANGED
@@ -1,19 +1,42 @@
|
|
1 |
-
<!
|
2 |
-
<html>
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
</html>
|
|
|
1 |
+
<!DOCTYPE html>
|
2 |
+
<html lang="en">
|
3 |
+
<head>
|
4 |
+
<meta charset="UTF-8">
|
5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6 |
+
<title>Dropdown Video Selector</title>
|
7 |
+
</head>
|
8 |
+
<body>
|
9 |
+
<label for="videoSelect">Choose a video:</label>
|
10 |
+
<select id="videoSelect" onchange="changeVideo()">
|
11 |
+
<option value="">--Select a video--</option>
|
12 |
+
<option value="https://huggingface.co/spaces/tonyassi/g/resolve/main/lucy/video1.mov">Video 1</option>
|
13 |
+
<option value="https://huggingface.co/spaces/tonyassi/g/resolve/main/lucy/video2.mov">Video 2</option>
|
14 |
+
</select>
|
15 |
+
|
16 |
+
<div id="videoContainer" style="margin-top: 20px; display: none;">
|
17 |
+
<video id="videoPlayer" width="600" controls loop>
|
18 |
+
<source id="videoSource" src="" type="video/mp4">
|
19 |
+
Your browser does not support the video tag.
|
20 |
+
</video>
|
21 |
+
</div>
|
22 |
+
|
23 |
+
<script>
|
24 |
+
function changeVideo() {
|
25 |
+
const videoSelect = document.getElementById('videoSelect');
|
26 |
+
const videoContainer = document.getElementById('videoContainer');
|
27 |
+
const videoPlayer = document.getElementById('videoPlayer');
|
28 |
+
const videoSource = document.getElementById('videoSource');
|
29 |
+
|
30 |
+
const selectedValue = videoSelect.value;
|
31 |
+
if (selectedValue) {
|
32 |
+
videoSource.src = selectedValue;
|
33 |
+
videoPlayer.load();
|
34 |
+
videoPlayer.play();
|
35 |
+
videoContainer.style.display = 'block'; // Show the video container
|
36 |
+
} else {
|
37 |
+
videoContainer.style.display = 'none'; // Hide the video container if no video is selected
|
38 |
+
}
|
39 |
+
}
|
40 |
+
</script>
|
41 |
+
</body>
|
42 |
</html>
|