-
Notifications
You must be signed in to change notification settings - Fork 70
/
example.html
231 lines (218 loc) · 7.65 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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Video.js Playlist UI - Default Implementation</title>
<link href="node_modules/video.js/dist/video-js.css" rel="stylesheet">
<link href="dist/videojs-playlist-ui.css" rel="stylesheet">
<link href="examples.css" rel="stylesheet">
</head>
<body>
<div class="info">
<h1>Video.js Playlist UI - Default Implementation</h1>
<p>
You can see the Video.js Playlist UI plugin in action below. Look at the
source of this page to see how to use it with your videos.
</p>
<p>
In the default configuration, the plugin looks for the first element that
has the class "vjs-playlist" and uses that as a container for the list.
</p>
</div>
<style>
.player-container, .vjs-playlist {
height: 300px;
}
</style>
<div class="player-container">
<video
id="video"
class="video-js"
height="300"
width="600"
controls>
<source src="http://vjs.zencdn.net/v/oceans.mp4" type="video/mp4">
<source src="http://vjs.zencdn.net/v/oceans.webm" type="video/webm">
</video>
<div class="vjs-playlist">
<!--
The contents of this element will be filled based on the
currently loaded playlist
-->
</div>
</div>
<script src="node_modules/video.js/dist/video.js"></script>
<script src="node_modules/videojs-playlist/dist/videojs-playlist.js"></script>
<script src="dist/videojs-playlist-ui.js"></script>
<script>
var player = videojs('video');
player.playlist([{
name: 'Disney\'s Oceans 1',
description: 'Explore the depths of our planet\'s oceans. ' +
'Experience the stories that connect their world to ours. ' +
'Lorem ipsum dolor sit amet, consectetur adipiscing elit, ' +
'sed do eiusmod tempor incididunt ut labore et dolore magna ' +
'aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco ' +
'laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure ' +
'dolor in reprehenderit in voluptate velit esse cillum dolore eu ' +
'fugiat nulla pariatur. Excepteur sint occaecat cupidatat non ' +
'proident, sunt in culpa qui officia deserunt mollit anim id est ' +
'laborum.',
duration: 45,
sources: [
{ src: 'http://vjs.zencdn.net/v/oceans.mp4', type: 'video/mp4' },
{ src: 'http://vjs.zencdn.net/v/oceans.webm', type: 'video/webm' },
],
// you can use <picture> syntax to display responsive images
thumbnail: [
{
srcset: 'test/example/oceans.jpg',
type: 'image/jpeg',
media: '(min-width: 400px;)'
},
{
src: 'test/example/oceans-low.jpg'
}
]
},
{
name: 'Disney\'s Oceans 2',
description: 'Explore the depths of our planet\'s oceans. ' +
'Experience the stories that connect their world to ours. ' +
'Lorem ipsum dolor sit amet, consectetur adipiscing elit, ' +
'sed do eiusmod tempor incididunt ut labore et dolore magna ' +
'aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco ' +
'laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure ' +
'dolor in reprehenderit in voluptate velit esse cillum dolore eu ' +
'fugiat nulla pariatur. Excepteur sint occaecat cupidatat non ' +
'proident, sunt in culpa qui officia deserunt mollit anim id est ' +
'laborum.',
duration: 45,
sources: [
{ src: 'http://vjs.zencdn.net/v/oceans.mp4?2', type: 'video/mp4' },
{ src: 'http://vjs.zencdn.net/v/oceans.webm?2', type: 'video/webm' },
],
// you can use <picture> syntax to display responsive images
thumbnail: [
{
srcset: 'test/example/oceans.jpg?2',
type: 'image/jpeg',
media: '(min-width: 400px;)'
},
{
src: 'test/example/oceans-low.jpg?2'
}
]
},
{
name: 'Disney\'s Oceans 3',
description: 'Explore the depths of our planet\'s oceans. ' +
'Experience the stories that connect their world to ours. ' +
'Lorem ipsum dolor sit amet, consectetur adipiscing elit, ' +
'sed do eiusmod tempor incididunt ut labore et dolore magna ' +
'aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco ' +
'laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure ' +
'dolor in reprehenderit in voluptate velit esse cillum dolore eu ' +
'fugiat nulla pariatur. Excepteur sint occaecat cupidatat non ' +
'proident, sunt in culpa qui officia deserunt mollit anim id est ' +
'laborum.',
duration: 45,
sources: [
{ src: 'http://vjs.zencdn.net/v/oceans.mp4?3', type: 'video/mp4' },
{ src: 'http://vjs.zencdn.net/v/oceans.webm?3', type: 'video/webm' },
],
// you can use <picture> syntax to display responsive images
thumbnail: [
{
srcset: 'test/example/oceans.jpg?3',
type: 'image/jpeg',
media: '(min-width: 400px;)'
},
{
src: 'test/example/oceans-low.jpg?3'
}
]
},
{
name: 'Disney\'s Oceans 4',
description: 'Abc.',
duration: 45,
sources: [
{ src: 'http://vjs.zencdn.net/v/oceans.mp4?4', type: 'video/mp4' },
{ src: 'http://vjs.zencdn.net/v/oceans.webm?4', type: 'video/webm' },
],
// you can use <picture> syntax to display responsive images
thumbnail: [
{
srcset: 'test/example/oceans.jpg?4',
type: 'image/jpeg',
media: '(min-width: 400px;)'
},
{
src: 'test/example/oceans-low.jpg?4'
}
]
},
{
name: 'Disney\'s Oceans 5',
description: 'Abc.',
duration: 45,
sources: [
{ src: 'http://vjs.zencdn.net/v/oceans.mp4?5', type: 'video/mp4' },
{ src: 'http://vjs.zencdn.net/v/oceans.webm?5', type: 'video/webm' },
],
// you can use <picture> syntax to display responsive images
thumbnail: [
{
srcset: 'test/example/oceans.jpg?5',
type: 'image/jpeg',
media: '(min-width: 400px;)'
},
{
src: 'test/example/oceans-low.jpg?5'
}
]
},
{
name: 'Disney\'s Oceans 6',
description: 'Abc.',
duration: 45,
sources: [
{ src: 'http://vjs.zencdn.net/v/oceans.mp4?6', type: 'video/mp4' },
{ src: 'http://vjs.zencdn.net/v/oceans.webm?6', type: 'video/webm' },
],
// you can use <picture> syntax to display responsive images
thumbnail: [
{
srcset: 'test/example/oceans.jpg?6',
type: 'image/jpeg',
media: '(min-width: 400px;)'
},
{
src: 'test/example/oceans-low.jpg?6'
}
]
}, {
name: 'Sintel (No Thumbnail)',
description: 'The film follows a girl named Sintel who is searching for a baby dragon she calls Scales.',
sources: [
{ src: 'http://media.w3.org/2010/05/sintel/trailer.mp4', type: 'video/mp4' },
{ src: 'http://media.w3.org/2010/05/sintel/trailer.webm', type: 'video/webm' },
{ src: 'http://media.w3.org/2010/05/sintel/trailer.ogv', type: 'video/ogg' }
],
thumbnail: false
},
// This is a really underspecified video to demonstrate the
// behavior when optional parameters are missing. You'll get better
// results with more video metadata!
{
name: 'Invalid Source',
sources: [{
src: 'Invalid'
}]
}]);
// Initialize the playlist-ui plugin with no option (i.e. the defaults).
player.playlistUi();
</script>
</body>
</html>