tonyassi commited on
Commit
ca34ca0
·
verified ·
1 Parent(s): 4c86031

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +41 -18
index.html CHANGED
@@ -1,19 +1,42 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width" />
6
- <title>My static Space</title>
7
- <link rel="stylesheet" href="style.css" />
8
- </head>
9
- <body>
10
- <div class="card">
11
- <h1>Welcome to your static Space!</h1>
12
- <p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p>
13
- <p>
14
- Also don't forget to check the
15
- <a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
16
- </p>
17
- </div>
18
- </body>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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>