-
Notifications
You must be signed in to change notification settings - Fork 70
/
example-two-players.html
187 lines (176 loc) · 6.67 KB
/
example-two-players.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
<!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>
<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>
<div class="player-container" style="background-color: blue;">
<video
id="video-blue"
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 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',
type: 'image/jpeg',
media: '(min-width: 400px;)'
},
{
src: 'test/example/oceans-low.jpg'
}
]
},
{
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',
type: 'image/jpeg',
media: '(min-width: 400px;)'
},
{
src: 'test/example/oceans-low.jpg'
}
]
}, {
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'
}]
}];
var player = videojs('video');
player.playlist(playlist);
// Initialize the playlist-ui plugin with no option (i.e. the defaults).
player.playlistUi();
var playerBlue = videojs('video-blue');
var bluePlaylist = [].concat(playlist[3], playlist.slice(0,3), playlist.slice(4));
playerBlue.playlist(bluePlaylist);
// Initialize the playlist-ui plugin with no option (i.e. the defaults).
playerBlue.playlistUi();
</script>
</body>
</html>