Update index.html
Browse files- index.html +39 -13
index.html
CHANGED
|
@@ -3,32 +3,58 @@
|
|
| 3 |
<head>
|
| 4 |
<meta charset="UTF-8" />
|
| 5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
| 6 |
-
<title>LeRobot
|
| 7 |
<link rel="stylesheet" href="style.css" />
|
| 8 |
</head>
|
| 9 |
<body>
|
| 10 |
<div class="container">
|
| 11 |
<h1>🤖 LeRobot Hackathon Demos</h1>
|
|
|
|
| 12 |
|
| 13 |
-
<select id="teamSelect">
|
| 14 |
-
<option value="https://huggingface.co/datasets/LeRobot-worldwide-hackathon/submissions/resolve/main/videos/demo1.mp4">Team Alpha - Project X</option>
|
| 15 |
-
<option value="https://huggingface.co/datasets/LeRobot-worldwide-hackathon/submissions/resolve/main/videos/demo2.mp4">Team Beta - Project Y</option>
|
| 16 |
-
<!-- Add more options as needed -->
|
| 17 |
-
</select>
|
| 18 |
|
| 19 |
<video id="videoPlayer" width="720" height="400" controls autoplay muted playsinline>
|
| 20 |
-
<source src="
|
| 21 |
Your browser does not support the video tag.
|
| 22 |
</video>
|
| 23 |
</div>
|
| 24 |
|
| 25 |
<script>
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 32 |
</script>
|
| 33 |
</body>
|
| 34 |
</html>
|
|
|
|
|
|
| 3 |
<head>
|
| 4 |
<meta charset="UTF-8" />
|
| 5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
| 6 |
+
<title>LeRobot Hackathon Gallery</title>
|
| 7 |
<link rel="stylesheet" href="style.css" />
|
| 8 |
</head>
|
| 9 |
<body>
|
| 10 |
<div class="container">
|
| 11 |
<h1>🤖 LeRobot Hackathon Demos</h1>
|
| 12 |
+
<p>Select a project to watch the demo video:</p>
|
| 13 |
|
| 14 |
+
<select id="teamSelect"></select>
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
|
| 16 |
<video id="videoPlayer" width="720" height="400" controls autoplay muted playsinline>
|
| 17 |
+
<source id="videoSource" src="" type="video/mp4" />
|
| 18 |
Your browser does not support the video tag.
|
| 19 |
</video>
|
| 20 |
</div>
|
| 21 |
|
| 22 |
<script>
|
| 23 |
+
async function loadVideos() {
|
| 24 |
+
const select = document.getElementById("teamSelect");
|
| 25 |
+
const player = document.getElementById("videoPlayer");
|
| 26 |
+
const source = document.getElementById("videoSource");
|
| 27 |
+
|
| 28 |
+
const response = await fetch("https://datasets-server.huggingface.co/rows?dataset=LeRobot-worldwide-hackathon/submissions&config=default&split=train&offset=0&limit=100");
|
| 29 |
+
const data = await response.json();
|
| 30 |
+
|
| 31 |
+
const rows = data.rows;
|
| 32 |
+
|
| 33 |
+
rows.forEach(row => {
|
| 34 |
+
const videoUrl = row.row.video;
|
| 35 |
+
const teamName = row.row.team_name;
|
| 36 |
+
const title = row.row.project_title;
|
| 37 |
+
const option = document.createElement("option");
|
| 38 |
+
option.value = videoUrl;
|
| 39 |
+
option.textContent = `${teamName} - ${title}`;
|
| 40 |
+
select.appendChild(option);
|
| 41 |
+
});
|
| 42 |
+
|
| 43 |
+
if (rows.length > 0) {
|
| 44 |
+
source.src = rows[0].row.video;
|
| 45 |
+
player.load();
|
| 46 |
+
player.play();
|
| 47 |
+
}
|
| 48 |
+
|
| 49 |
+
select.addEventListener("change", () => {
|
| 50 |
+
source.src = select.value;
|
| 51 |
+
player.load();
|
| 52 |
+
player.play();
|
| 53 |
+
});
|
| 54 |
+
}
|
| 55 |
+
|
| 56 |
+
loadVideos();
|
| 57 |
</script>
|
| 58 |
</body>
|
| 59 |
</html>
|
| 60 |
+
|