diff options
Diffstat (limited to 'librevideojs/js/cliplibrejs-playlists.min.js')
-rw-r--r-- | librevideojs/js/cliplibrejs-playlists.min.js | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/librevideojs/js/cliplibrejs-playlists.min.js b/librevideojs/js/cliplibrejs-playlists.min.js new file mode 100644 index 0000000..ac39ef7 --- /dev/null +++ b/librevideojs/js/cliplibrejs-playlists.min.js @@ -0,0 +1,29 @@ +/*! + * + * @source: cliplibrejs-playlist.js + * + * @licstart The following is the entire license notice for the + * JavaScript code in this page. + * + * Copyleft (Ɔ) 2012 Heckyel - Cybersy + * + * + * The JavaScript code in this page is free software: you can + * redistribute it and/or modify it under the terms of the GNU + * General Public License (GNU GPL) as published by the Free Software + * Foundation, either version 3 of the License, or (at your option) + * any later version. The code is distributed WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU GPL for more details. + * + * As additional permission under GNU GPL version 3 section 7, you + * may distribute non-source (e.g., minimized or compacted) forms of + * that code without the copy of the GNU GPL normally required by + * section 4, provided you include this license notice and a URL + * through which recipients can access the Corresponding Source. + * + * @licend The above is the entire license notice + * for the JavaScript code in this page. + * + */ +function playList(c,a){var d=this;d.pl=d.pl||{};var b=parseInt(c,10);d.pl._guessVideoType=function(e){var f={webm:"video/webm",mp4:"video/mp4",ogv:"video/ogg"};var g=e.split(".").pop();return f[g]||""};d.pl.init=function(f,e){e=e||{};d.pl.videos=[];d.pl.current=0;d.on("ended",d.pl._videoEnd);if(e.getVideoSource){d.pl.getVideoSource=e.getVideoSource}d.pl._addVideos(f)};d.pl._updatePoster=function(e){d.poster(e);d.removeChild(d.posterImage);d.posterImage=d.addChild("posterImage")};d.pl._addVideos=function(k){for(var h=0,l=k.length;h<l;h++){var f=[];for(var g=0,e=k[h].src.length;g<e;g++){f.push({type:d.pl._guessVideoType(k[h].src[g]),src:k[h].src[g]})}k[h].src=f;d.pl.videos.push(k[h])}};d.pl._nextPrev=function(g){var h,f;if(g==="next"){h=d.pl.videos.length-1;f=1}else{h=0;f=-1}if(d.pl.current!==h){var e=d.pl.current+f;d.pl._setVideo(e);d.trigger(g,[d.pl.videos[e]])}};d.pl._setVideo=function(e){if(e<d.pl.videos.length){d.pl.current=e;d.pl.currentVideo=d.pl.videos[e];if(!d.paused()){d.pl._resumeVideo()}if(d.pl.getVideoSource){d.pl.getVideoSource(d.pl.videos[e],function(f,g){d.pl._setVideoSource(f,g)})}else{d.pl._setVideoSource(d.pl.videos[e].src,d.pl.videos[e].poster)}}};d.pl._setVideoSource=function(e,f){d.src(e);d.pl._updatePoster(f)};d.pl._resumeVideo=function(){d.one("loadstart",function(){d.play()})};d.pl._videoEnd=function(){if(d.pl.current===d.pl.videos.length-1){d.trigger("lastVideoEnded")}else{d.pl._resumeVideo();d.next()}};if(c instanceof Array){d.pl.init(c,a);d.pl._setVideo(0);return d}else{if(b===b){d.pl._setVideo(b);return d}else{if(typeof c==="string"&&typeof d.pl[c]!=="undefined"){d.pl[c].apply(d);return d}}}}cliplibrejs.Player.prototype.next=function(){this.pl._nextPrev("next");return this};cliplibrejs.Player.prototype.prev=function(){this.pl._nextPrev("prev");return this};cliplibrejs.plugin("playList",playList);
\ No newline at end of file |