-
Notifications
You must be signed in to change notification settings - Fork 1
/
example.html
117 lines (117 loc) · 3.18 KB
/
example.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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Video.js Adaptive Source</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="node_modules/video.js/dist/video-js.css" rel="stylesheet">
<link href="lib/videojs-adaptive-source.css" rel="stylesheet">
<script src="node_modules/video.js/dist/video.js"></script>
<script src="lib/videojs-adaptive-source.js"></script>
</head>
<body>
<div style="width: 49%; display: inline-block">
<pre>
videojs(
'video',
{
controls: true,
plugins: {
videoJsAdaptiveSource: {
useIconButton: false,
disableAdaptive: false,
threshold: 4
}
}
},
function()
{
this.setSources([
{
src: 'sample_426x240_1000k.mp4',
type: 'video/mp4',
label: '240p',
bitrate: 1000
},
{
src: 'sample_640x360_1500k.mp4',
type: 'video/mp4',
label: '360p',
bitrate: 1500
},
{
src: 'sample_854x480_2000k.mp4',
type: 'video/mp4',
label: '480p',
bitrate: 2000
},
{
src: 'sample_1280x720_3000k.mp4',
type: 'video/mp4',
label: '720p',
bitrate: 3000
},
{
src: 'sample_1920x1080_5000k.mp4',
type: 'video/mp4',
label: '1080p',
bitrate: 5000
}
], "test.jpg");
});
</pre>
</div>
<div style="width: 49%; display: inline-block; vertical-align: top">
<video id='video' class="video-js vjs-default-skin" width="640px"></video>
</div>
<script tyle="text/javascript">
videojs(
'video',
{
controls: true,
plugins: {
videoJsAdaptiveSource: {
useIconButton: false,
disableAdaptive: false,
threshold: 4
}
}
},
function()
{
this.setSources([
{
src: 'sample_426x240_1000k.mp4',
type: 'video/mp4',
label: '240p',
bitrate: 1000
},
{
src: 'sample_640x360_1500k.mp4',
type: 'video/mp4',
label: '360p',
bitrate: 1500
},
{
src: 'sample_854x480_2000k.mp4',
type: 'video/mp4',
label: '480p',
bitrate: 2000
},
{
src: 'sample_1280x720_3000k.mp4',
type: 'video/mp4',
label: '720p',
bitrate: 3000
},
{
src: 'sample_1920x1080_5000k.mp4',
type: 'video/mp4',
label: '1080p',
bitrate: 5000
}
], "test.jpg");
});
</script>
</body>
</html>