maringetxway commited on
Commit
fe5c8c5
·
verified ·
1 Parent(s): 5e54783

Update main.js

Browse files
Files changed (1) hide show
  1. main.js +25 -24
main.js CHANGED
@@ -1,26 +1,27 @@
1
  async function loadVideos() {
2
- try {
3
- const response = await fetch("https://datasets-server.huggingface.co/rows?dataset=LeRobot-worldwide-hackathon/submissions&config=default&split=train&offset=0&limit=100");
4
- const data = await response.json();
5
-
6
- const container = document.getElementById("videoContainer");
7
-
8
- data.rows.forEach(row => {
9
- const videoUrl = row.row.video;
10
- if (videoUrl) {
11
- const video = document.createElement("video");
12
- video.src = videoUrl;
13
- video.autoplay = false;
14
- video.muted = true;
15
- video.loop = false;
16
- video.playsInline = true;
17
- container.appendChild(video);
18
- }
19
- });
20
- } catch (error) {
21
- console.error("Error loading videos:", error);
22
- }
 
23
  }
24
-
25
- loadVideos();
26
-
 
1
  async function loadVideos() {
2
+ try {
3
+ const response = await fetch("https://datasets-server.huggingface.co/rows?dataset=maringetxway/winners&config=default&split=train&offset=0&limit=100");
4
+ const data = await response.json();
5
+
6
+ const container = document.getElementById("videoContainer");
7
+
8
+ data.rows.forEach(row => {
9
+ const videoUrl = row.row.video; // Assumes each row has a `video` field
10
+ if (videoUrl) {
11
+ const video = document.createElement("video");
12
+ video.src = videoUrl;
13
+ video.controls = true;
14
+ video.autoplay = false;
15
+ video.muted = true;
16
+ video.loop = false;
17
+ video.playsInline = true;
18
+ video.className = "w-full mb-4 rounded-lg shadow-md"; // Optional styling
19
+ container.appendChild(video);
20
+ }
21
+ });
22
+ } catch (error) {
23
+ console.error("Error loading videos:", error);
24
  }
25
+ }
26
+
27
+ loadVideos();