-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvideo.html
73 lines (64 loc) · 1.94 KB
/
video.html
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
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="apple-touch-icon" sizes="180x180" href="apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="favicon-16x16.png">
<center>
<title>♥ Lovebox ♥</title>
<style>
body {
background-color: #000000;
color: #fff;
font-family: 'Product Sans', sans-serif;
}
img.backup {
display: none;
}
</style>
</head>
<body>
<h1>♥ Lovebox ♥</h1>
<h3> D.I.Y </h3>
<br></br>
<div id="videoContainer"></div>
<video id="backupVideo" src="nothing.png"></video>
<script>
var videoSources = [
"images/image.mp4",
"images/image.webm",
"images/image.ogv"
];
var videoContainer = document.getElementById("videoContainer");
for (var i = 0; i < videoSources.length; i++) {
var video = document.createElement("video");
video.setAttribute("controls", false);
video.style.maxWidth = "50%";
video.style.maxHeight = "50%";
video.onloadedmetadata = function() {
videoContainer.appendChild(this);
};
video.onerror = function() {
this.style.display = "none";
checkAllVideosLoaded();
};
video.src = videoSources[i];
}
function checkAllVideosLoaded() {
var backupVideo = document.getElementById("backupVideo");
var allVideos = document.querySelectorAll("#videoContainer video");
setTimeout(function() {
var video = document.getElementById("myVideo");
video.play();
}, 5000); // Démarrer la vidéo après 5 secondes
if (allVideos.length == 0) {
backupVideo.style.display = "block";
} else {
backupVideo.style.display = "none";
}
}
</script>
</center>
</body>
</html>