-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
62 lines (61 loc) · 1.32 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
50
51
52
53
54
55
56
57
58
59
60
61
62
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
<title>视频播放器</title>
<style type="text/css">
*{
margin:0px;
padding:0px;
}
html, body {
width: 100%;
height: 100%;
overflow: hidden;
}
.btn {
width: 80px;
height: 80px;
position: absolute;
bottom: 30px;
left: 50%;
margin-left: -50px;
background: black;
opacity: 0.9;
border-radius: 100%;
color: white;
text-align: center;
line-height: 80px;
font-size: 16px;
}
#box{
width: 100%;
height:100%;
}
</style>
</head>
<body>
<div id="btn" class="btn">播放</div>
<div id="box"></div>
</body>
<script src="./video.js"></script>
<script type="text/javascript">
const qwe = new mobVideo({
el: 'box',
videoUrl: './images/video.mp4',
imageUrl: './images/loading.png',
audioUrl: 'https://www.runoob.com/try/demo_source/horse.ogg'
}).init(function (config) {
document.getElementById('btn').onclick = function () {
config.play()
}
}, function (config) {
console.log('播放了')
}, function (config, time) {
console.log(time)
}, function () {
console.log('结束了')
})
</script>
</html>