-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
49 lines (43 loc) · 1.12 KB
/
index.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
<!DOCTYPE html>
<html>
<head>
<title>Gandalf Sax Guy 🧙🎷</title>
</head>
<body>
<h1 id="timer"></h1>
<div id="video-container"></div>
<script>
let timer = 60 * 1000; // 1 minute
function addVideo() {
var videlem = document.createElement("video");
videlem.width = 320;
videlem.height = 240;
videlem.controls = true;
videlem.autoplay = true;
videlem.loop = true;
/// ... some setup like poster image, size, position etc. goes here...
/// now, add sources:
var sourceMP4 = document.createElement("source");
sourceMP4.type = "video/mp4";
sourceMP4.src = "video/gandalf-sax-guy.mp4";
videlem.appendChild(sourceMP4);
// Add to the parent element
document.getElementById("video-container").appendChild(videlem);
}
function startTimeout() {
setTimeout(function() {
addVideo();
timer = timer - (timer / 10);
writeTimer();
startTimeout();
}, timer);
}
function writeTimer() {
document.getElementById("timer").innerHTML = timer;
}
startTimeout();
addVideo();
writeTimer();
</script>
</body>
</html>