-
Notifications
You must be signed in to change notification settings - Fork 0
/
poster.html
55 lines (51 loc) · 1.47 KB
/
poster.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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<style>
body {
margin:0;
padding:0;
background-color: #abebc6;
}
</style>
<script>
function init() {
setTimeout(function() {
load();
}, 5000);
setTimeout(function() {
play()
}, 10000);
}
function play() {
console.log("Play video");
var video = document.getElementById("video-player");
video.play(1);
}
function load() {
console.log("Load video");
var video = document.getElementById("video-player");
video.load();
}
function asyncPlay() {
setTimeout(function() {
play()
}, 2000);
}
</script>
</head>
<body>
<video id="video-player"
preload="none"
poster="john.png"
style="position: absolute; top: 0px; left: 0px; width: 50%; height: 50%;">
<source src="mov_bbb.mp4" type="video/mp4" />
</video>
<div style="position: absolute; top: 0%; left: 50%;">
<button type="button" onclick="load()">Load</button>
<button type="button" onclick="play()">Play</button>
<button type="button" onclick="asyncPlay()">Async play after 2sec</button>
</div>
</body>
</html>