This repository has been archived by the owner on Dec 17, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 95
/
example.html
81 lines (78 loc) · 1.7 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
<!doctype html>
<html>
<head>
<title>Video.js Thumbnails Example</title>
<link href="node_modules/video.js/dist/video-js/video-js.css" rel="stylesheet">
<link href="videojs.thumbnails.css" rel="stylesheet">
<style>
p {
background-color: #eee;
border: thin solid #777;
padding: 10px;
}
</style>
<script src="node_modules/video.js/dist/video-js/video.js"></script>
<script src='videojs.thumbnails.js'></script>
</head>
<body>
<p>The thumbnails plugin displays a series of images over the player
progress bar when the viewer hovers over it or drags the playhead
around to seek. Give it a shot:</p>
<video id='video'
class='video-js vjs-default-skin'
width='640'
height='264'
poster='http://vjs.zencdn.net/v/oceans.png'
controls>
<source src='http://vjs.zencdn.net/v/oceans.mp4' type='video/mp4' />
</video>
<script>
// initialize video.js
var video = videojs('video');
// here's an example of generating thumbnails from a sprited image:
video.thumbnails({
0: {
src: 'thumbnails.png',
style: {
left: '-60px',
width: '600px',
height: '68px',
clip: 'rect(0, 120px, 68px, 0)'
}
},
10: {
style: {
left: '-180px',
clip: 'rect(0, 240px, 68px, 120px)'
}
},
20: {
style: {
left: '-300px',
clip: 'rect(0, 360px, 68px, 240px)'
}
},
30: {
style: {
left: '-420px',
clip: 'rect(0, 480px, 68px, 360px)'
}
},
40: {
style: {
left: '-540px',
clip: 'rect(0, 600px, 68px, 480px)'
}
}
});
// and here's an example of the bare-minimum plugin configuration:
/*
video.thumbnails({
0: {
src: 'example-thumbnail.png'
}
});
*/
</script>
</body>
</html>