forked from AliRazavi-edu/PNU_3991
-
Notifications
You must be signed in to change notification settings - Fork 0
/
html5-videos.html
411 lines (403 loc) · 23 KB
/
html5-videos.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
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<title>lightGallery: Html5 videos</title>
<meta name="description" content="lightGallery supports all types of HTML5 video formats like MP4, WebM, Ogg .. " />
<link href="/js/static/css/main.css" rel="stylesheet">
<link href="/js/static/css/justifiedGallery.min.css" rel="stylesheet">
<link href='https://fonts.googleapis.com/css?family=Open+Sans:400,300,600,700' rel='stylesheet' type='text/css'>
<link href="/js/lightgallery/css/lightgallery.css" rel="stylesheet">
<!-- <link href="//vjs.zencdn.net/4.12/video-js.css" rel="stylesheet">-->
<link href="/css/video-js.css" rel="stylesheet">
<link rel="shortcut icon" href="/assets/favicon.ico" type="image/x-icon">
<link rel="icon" href="/assets/favicon.ico" type="image/x-icon">
<!-- <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>-->
<!-- <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>-->
<!--[if lt IE 9]>
<script src="/js/html5shiv.min.js"></script>
<script src="/js/respond.min.js"></script>
<![endif]-->
</head>
<body class="demos">
<!--[if lt IE 7]>
<p class="browsehappy">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p>
<![endif]-->
<nav class="navbar navbar-default" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="http://sachinchoolur.github.io/lightgallery.js/">lg</a>
</div>
<div id="navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li><a href="../">Home<span class="border"></span></a></li>
<li><a href="../docs/">Docs<span class="border"></span></a></li><li> <a href="../docs/license.html">License<span class="border"></span></a></li>
<li class="active"><a href="../demos/">Demos<span class="border"></span></a></li>
<li><a target="_blank" href="https://github.com/sachinchoolur/lightgallery.js">Github<span class="border"></span></a></li>
<li><a target="_blank" href="http://sachinchoolur.github.io/lightGallery/" onclick="ga('send', 'event', 'lg', 'lg');">jQuery lightGallery<span class="border"></span></a></li>
</ul>
</div>
</div>
</nav>
<section class="section">
<div class="container-fluid">
<div class="section-header has-desc mrb50">
<h1 class="page-header mrb15">Html5 Video Gallery</h1>
<p>lightGallery supports all types of HTML5 video formats. Such as MP4, WebM, Ogg, etc.</p>
<p>To display html5 video create your video content using html5 video tag inside a hidden div. Then just add id or class name of the object(hidden div) which contains your html, inside the data-html attribute. data-src should not be provided when you use html5 videos . You can even provide video html directly inside data-html attribute. lightGallery will automatically check your content, and if it is id or class name of your hidden div content will be fetched from the div, and will be displayed as video. Otherwise direct content will be used for displaying the videos.</p>
</div>
<div style="display:none;" id="video1">
<video class="lg-video-object lg-html5" controls preload="none">
<source src="assets/videos/video1.mp4" type="video/mp4">
Your browser does not support HTML5 video.
</video>
</div>
<div style="display:none;" id="video2">
<video class="lg-video-object lg-html5" controls preload="none">
<source src="assets/videos/video2.mp4" type="video/mp4">
Your browser does not support HTML5 video.
</video>
</div>
<div style="display:none;" id="video3">
<video class="lg-video-object lg-html5" controls preload="none">
<!-- <source src="../static/videos/video3.mp4" type="video/mp4">-->
<source src="assets/videos/video3.mp4" type="video/mp4">
Your browser does not support HTML5 video.
</video>
</div>
<div style="display:none;" id="video4">
<video class="lg-video-object lg-html5" controls preload="none">
<source src="../static/videos/video4.mp4" type="video/mp4">
Your browser does not support HTML5 video.
</video>
</div>
<div class="demo-gallery dark mrb35">
<ul id="html5-videos" class="list-unstyled row">
<li class="col-xs-6 col-sm-4 col-md-3 video" data-poster="../static/img/videos/h-video1-poster.jpg" data-sub-html="<h4>CGI Animated Short HD: Student Academy Award Winning 'PeckPocketed' by Kevin Herron</h4>" data-html="#video1">
<a href="">
<img class="img-responsive" src="../static/img/thumb-v-y-2.jpg">
<div class="demo-gallery-poster">
<img src="../static/img/play-button.png">
</div>
</a>
</li>
<li class="col-xs-6 col-sm-4 col-md-3 video" data-html="#video2" data-poster="../static/img/videos/h-video2-poster.jpg" data-sub-html="<h4>Rollin`Wild - Short Funny Animated Clips - Film Academy BW</h4>">
<a href="">
<img class="img-responsive" src="../static/img/thumb-v-y-1.jpg">
<div class="demo-gallery-poster">
<img src="../static/img/play-button.png">
</div>
</a>
</li>
<li class="col-xs-6 col-sm-4 col-md-3 video" data-html="#video3" data-poster="../static/img/videos/h-video3-poster.jpg" data-sub-html="<h4>Big Buck Bunny</h4>">
<a href="">
<img class="img-responsive" src="../static/img/thumb-v-v-1.jpg">
<div class="demo-gallery-poster">
<img src="../static/img/play-button.png">
</div>
</a>
</li>
<li class="col-xs-6 col-sm-4 col-md-3 video" data-html="#video4" data-poster="../static/img/videos/h-video4-poster.jpg" data-sub-html="<h4>Ninja vs Pirate</h4>">
<a href="">
<img class="img-responsive" src="../static/img/thumb-v-v-2.jpg">
<div class="demo-gallery-poster">
<img src="../static/img/play-button.png">
</div>
</a>
</li>
</ul>
</div>
<div class="docs-ad">
<div class="lg-ad light">
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- lg1.2demo -->
<ins class="adsbygoogle"
style="display:inline-block;width:728px;height:90px"
data-ad-client="ca-pub-2888290830590449"
data-ad-slot="5565545012"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
</div>
</div>
<div class="bs-callout bs-callout-danger mrb50">
<h4>Plugin dependency<a class="anchorjs-link"><span class="anchorjs-icon"></span></a></h4>
<p>Lightgallery require the video plugin to be included in your document.</p>
</div>
<div class="bs-callout bs-callout-info mrb50">
<p>Class <code>lg-video-object</code> and <code>lg-html5</code> needs to be added with your video tag</p>
<p>You can prevent preloading of video by setting <code>preload="none"</code></p>
</div>
<div class="code-demo mrb50">
<div class="section-header mrb15">
<h4 class="section-title">HTML structure</h4>
</div>
<div class="sample-code html">
<pre class="prettyprint linenums lang-html">
<!-- Hidden video div -->
<div style="display:none;" id="video1">
<video class="lg-video-object lg-html5" controls preload="none">
<source src="videos/video1.mp4" type="video/mp4">
Your browser does not support HTML5 video.
</video>
</div>
<div style="display:none;" id="video2">
<video class="lg-video-object lg-html5" controls preload="none">
<source src="videos/video2.mp4" type="video/mp4">
Your browser does not support HTML5 video.
</video>
</div>
<!-- data-src should not be provided when you use html5 videos -->
<ul id="html5-videos">
<li data-poster="video-poster1.jpg" data-sub-html="video caption1" data-html="#video1" >
<img src="img/thumb1.jpg" />
</li>
<li data-poster="video-poster2.jpg" data-sub-html="video caption2" data-html="#video2" >
<img src="img/thumb2.jpg" />
</li>
...
</ul>
</pre>
</div>
</div>
<div class="code-demo mrb0">
<div class="section-header mrb15">
<h4 class="section-title">Javascript</h4>
</div>
<div class="sample-code html">
<pre class="prettyprint linenums lang-js">
lightGallery(document.getElementById('html5-videos'));
</pre>
</div>
</div>
</div>
</section>
<section class="section highlight pdb0">
<div class="container-fluid">
<h2 id="video-without-poster" class="anchor-title mrb15">
<a href="#video-without-poster">Html5 video gallery with videojs</a>
<span class="border"></span>
</h2>
<p class="lead mrb50">It is easy to integrate <a href="http://www.videojs.com/" target="_blank">videojs</a> with lightgallery. Setup your <code>video</code> tag according to the videojs documentation and pass <code>videojs</code> : <code>true</code> via lightgallery options. You are done!</p>
<div style="display:none;" id="videojs1">
<video class="lg-video-object lg-html5 video-js vjs-default-skin" poster="../static/img/videos/h-video1-poster.jpg" controls preload="none">
<source src="../static/videos/video1.mp4" type="video/mp4">
Your browser does not support HTML5 video.
</video>
</div>
<div style="display:none;" id="videojs2">
<video class="lg-video-object lg-html5 video-js vjs-default-skin" controls preload="none">
<source src="../static/videos/video2.mp4" type="video/mp4">
Your browser does not support HTML5 video.
</video>
</div>
<div style="display:none;" id="videojs3">
<video class="lg-video-object lg-html5 video-js vjs-default-skin" controls preload="none">
<source src="../static/videos/video3.mp4" type="video/mp4">
Your browser does not support HTML5 video.
</video>
</div>
<div style="display:none;" id="videojs4">
<video class="lg-video-object lg-html5 video-js vjs-default-skin" controls preload="none">
<source src="../static/videos/video4.mp4" type="video/mp4">
Your browser does not support HTML5 video.
</video>
</div>
<div class="demo-gallery dark mrb35">
<ul id="html5-videos-videojs" class="list-unstyled row">
<li class="col-xs-6 col-sm-4 col-md-3 video" data-sub-html="<h4>CGI Animated Short HD: Student Academy Award Winning 'PeckPocketed' by Kevin Herron</h4>" data-poster="../static/img/videos/h-video1-poster.jpg" data-html="#videojs1">
<a href="">
<img class="img-responsive" src="../static/img/thumb-v-y-2.jpg">
<div class="demo-gallery-poster">
<img src="../static/img/play-button.png">
</div>
</a>
</li>
<li class="col-xs-6 col-sm-4 col-md-3 video" data-html="#videojs2" data-poster="../static/img/videos/h-video2-poster.jpg" data-sub-html="<h4>Rollin`Wild - Short Funny Animated Clips - Film Academy BW</h4>">
<a href="">
<img class="img-responsive" src="../static/img/thumb-v-y-1.jpg">
<div class="demo-gallery-poster">
<img src="../static/img/play-button.png">
</div>
</a>
</li>
<li class="col-xs-6 col-sm-4 col-md-3 video" data-html="#videojs3" data-poster="../static/img/videos/h-video3-poster.jpg" data-sub-html="<h4>Big Buck Bunny</h4>">
<a href="">
<img class="img-responsive" src="../static/img/thumb-v-v-1.jpg">
<div class="demo-gallery-poster">
<img src="../static/img/play-button.png">
</div>
</a>
</li>
<li class="col-xs-6 col-sm-4 col-md-3 video" data-html="#videojs4" data-poster="../static/img/videos/h-video4-poster.jpg" data-sub-html="<h4>Ninja vs Pirate</h4>">
<a href="">
<img class="img-responsive" src="../static/img/thumb-v-v-2.jpg">
<div class="demo-gallery-poster">
<img src="../static/img/play-button.png">
</div>
</a>
</li>
</ul>
</div>
<div class="docs-ad">
<div class="lg-ad light">
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- lg1.2demo -->
<ins class="adsbygoogle"
style="display:inline-block;width:728px;height:90px"
data-ad-client="ca-pub-2888290830590449"
data-ad-slot="5565545012"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
</div>
</div>
<div class="code-demo mrb50">
<div class="section-header mrb15">
<h4 class="section-title">Include Videojs CSS and Javascript files</h4>
</div>
<div class="sample-code html">
<pre class="prettyprint linenums lang-html">
<link href="http://vjs.zencdn.net/4.12/video-js.css" rel="stylesheet">
<script src="http://vjs.zencdn.net/4.12/video.js"></script>
</pre>
</div>
</div>
<div class="code-demo mrb50">
<div class="section-header mrb15">
<h4 class="section-title">HTML structure</h4>
</div>
<div class="sample-code html">
<pre class="prettyprint linenums lang-html">
<!-- Hidden video div -->
<div style="display:none;" id="video1">
<video class="lg-video-object lg-html5 video-js vjs-default-skin" controls preload="none">
<source src="videos/video1.mp4" type="video/mp4">
Your browser does not support HTML5 video.
</video>
</div>
<div style="display:none;" id="video2">
<video class="lg-video-object lg-html5 video-js vjs-default-skin" controls preload="none">
<source src="videos/video2.mp4" type="video/mp4">
Your browser does not support HTML5 video.
</video>
</div>
<!-- data-src should not be provided when you use html5 videos -->
<ul id="video-gallery">
<li data-poster="video-poster1.jpg" data-sub-html="video caption1" data-html="#video1" >
<img src="img/thumb1.jpg" />
</li>
<li data-poster="video-poster2.jpg" data-sub-html="video caption2" data-html="#video2" >
<img src="img/thumb2.jpg" />
</li>
...
</ul>
</pre>
</div>
</div>
<div class="code-demo mrb50">
<div class="section-header mrb15">
<h4 class="section-title">Javascript</h4>
</div>
<div class="sample-code html">
<pre class="prettyprint linenums lang-js">
lightGallery(document.getElementById('video-gallery'), {
videojs: true
});
</pre>
</div>
</div>
</div>
</section>
<section class="demo-links section">
<div class="container-fluid">
<h2 id="more-demo" class="anchor-title mrb50">
<a href="#more-demo">More demos</a>
<span class="border"></span>
</h2>
<div class="row">
<div class="col-xs-6 col-sm-4 col-md-3">
<a class="btn btn-primary btn-lg" href="index.html">Thumbnails</a>
</div>
<div class="col-xs-6 col-sm-4 col-md-3">
<a class="btn btn-primary btn-lg" href="videos.html">Youtube/Vimeo Videos</a>
</div>
<div class="col-xs-6 col-sm-4 col-md-3">
<a class="btn btn-primary btn-lg" href="html5-videos.html">HTML5 Videos</a>
</div>
<div class="col-xs-6 col-sm-4 col-md-3">
<a class="btn btn-primary btn-lg" href="transitions.html">Transitions</a>
</div>
<div class="col-xs-6 col-sm-4 col-md-3">
<a class="btn btn-success btn-lg" href="dynamic.html">Dynamic</a>
</div>
<div class="col-xs-6 col-sm-4 col-md-3">
<a class="btn btn-success btn-lg" href="events.html">Events</a>
</div>
<div class="col-xs-6 col-sm-4 col-md-3">
<a class="btn btn-success btn-lg" href="methods.html">Methods</a>
</div>
<div class="col-xs-6 col-sm-4 col-md-3">
<a class="btn btn-success btn-lg" href="iframe.html">Iframe</a>
</div>
<div class="col-xs-6 col-sm-4 col-md-3">
<a class="btn btn-danger btn-lg" href="captions.html">Captions</a>
</div>
<div class="col-xs-6 col-sm-4 col-md-3">
<a class="btn btn-danger btn-lg" href="responsive.html">Responsive</a>
</div>
<div class="col-xs-6 col-sm-4 col-md-3">
<a class="btn btn-danger btn-lg" href="fixed-size.html">fixed Size</a>
</div>
<div class="col-xs-6 col-sm-4 col-md-3">
<a class="btn btn-danger btn-lg" href="html-markup.html">Html Markup</a>
</div>
<div class="col-xs-6 col-sm-4 col-md-3">
<a class="btn btn-danger btn-lg" href="comment-box.html">Comment box</a>
</div>
<div class="col-xs-6 col-sm-4 col-md-3">
<a class="btn btn-danger btn-lg" href="easing.html">Easing</a>
</div>
<div class="col-xs-6 col-sm-4 col-md-3">
<a class="btn btn-danger btn-lg" href="hash.html">Hash plugin</a>
</div>
<div class="col-xs-6 col-sm-4 col-md-3">
<a class="btn btn-danger btn-lg" href="share.html">Share</a>
</div>
</div>
</div>
</section>
<footer>
<a target="_blank" href="https://twitter.com/sachinchoolur"><img src="../static/img/social/twitter.png"></a>
<a target="_blank" href="https://in.linkedin.com/in/sachinchoolur"><img src="../static/img/social/linked-in.png"></a>
</footer>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-49767543-5', 'auto');
ga('send', 'pageview');
</script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script src="../static/js/prettify.js"></script>
<script src="https://f.vimeocdn.com/js/froogaloop2.min.js"></script>
<script src="//vjs.zencdn.net/4.12/video.js"></script>
<script src="../static/js/transition.js"></script>
<script src="../static/js/collapse.js"></script>
<script src="../lightgallery/js/lightgallery.js"></script>
<script src="../lightgallery/js/lg-fullscreen.js"></script>
<script src="../lightgallery/js/lg-thumbnail.js"></script>
<script src="../lightgallery/js/lg-video.js"></script>
<script src="../lightgallery/js/lg-autoplay.js"></script>
<script src="../static/js/demos.js"></script>
</body>
</html>