2013-02-09 01:20:59 +03:00
|
|
|
<!DOCTYPE html>
|
2016-04-29 00:29:40 +02:00
|
|
|
<html lang="en">
|
2013-02-09 01:20:59 +03:00
|
|
|
<head>
|
|
|
|
<meta charset="utf-8" />
|
2013-02-11 17:49:30 +03:00
|
|
|
<title>Video.js Plugin Example</title>
|
2013-02-09 01:20:59 +03:00
|
|
|
|
2015-06-06 03:10:39 +02:00
|
|
|
<!-- Add ES5 shim and sham for IE8 -->
|
|
|
|
<script src="../build/temp/ie8/videojs-ie8.js"></script>
|
2013-02-09 01:20:59 +03:00
|
|
|
|
2015-06-06 03:10:39 +02:00
|
|
|
<!-- Load the source files -->
|
|
|
|
<link href="../build/temp/video-js.css" rel="stylesheet" type="text/css">
|
2015-03-28 07:59:21 +02:00
|
|
|
<script src="../build/temp/video.js"></script>
|
2013-02-09 01:20:59 +03:00
|
|
|
|
2015-06-06 03:10:39 +02:00
|
|
|
<!-- Set the location of the flash SWF -->
|
|
|
|
<script>
|
2015-08-13 16:58:24 +02:00
|
|
|
videojs.options.flash.swf = '../build/temp/video-js.swf';
|
2015-06-06 03:10:39 +02:00
|
|
|
</script>
|
|
|
|
|
2013-02-09 01:20:59 +03:00
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<p style="background-color:#eee; border: 1px solid #777; padding: 10px; font-size: .8em; line-height: 1.5em; font-family: Verdana, sans-serif;">This page shows you how to create, register and initialize a Video.js plugin.</p>
|
|
|
|
|
2015-12-15 21:38:09 +02:00
|
|
|
<video id="vid1" class="video-js vjs-default-skin" controls preload="auto" width="640" height="264" poster="http://vjs.zencdn.net/v/oceans.png">
|
2016-01-26 03:11:26 +02:00
|
|
|
<source src="http://vjs.zencdn.net/v/oceans.mp4" type="video/mp4">
|
|
|
|
<source src="http://vjs.zencdn.net/v/oceans.webm" type="video/webm">
|
|
|
|
<source src="http://vjs.zencdn.net/v/oceans.ogv" type="video/ogg">
|
2013-02-09 01:20:59 +03:00
|
|
|
<p>Video Playback Not Supported</p>
|
|
|
|
</video>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
(function() {
|
2013-02-11 21:05:39 +03:00
|
|
|
var vid1, progressed;
|
2013-02-09 01:20:59 +03:00
|
|
|
|
|
|
|
// create a really simple plugin
|
|
|
|
// this one just logs the buffered percentage to the console whenever
|
|
|
|
// more data is downloaded
|
|
|
|
progressed = function(options) {
|
|
|
|
this.on('progress', function(e) {
|
|
|
|
console.log(this.bufferedPercent());
|
|
|
|
});
|
|
|
|
};
|
|
|
|
|
|
|
|
// register the plugin
|
2015-10-28 22:06:33 +02:00
|
|
|
videojs.plugin('progressed', progressed);
|
2013-02-09 01:20:59 +03:00
|
|
|
|
|
|
|
// initialize it
|
2015-10-28 22:06:33 +02:00
|
|
|
vid1 = videojs('vid1');
|
2013-02-11 18:16:08 +03:00
|
|
|
vid1.progressed();
|
2013-02-09 01:20:59 +03:00
|
|
|
})();
|
|
|
|
</script>
|
|
|
|
|
|
|
|
</body>
|
|
|
|
</html>
|