/*! * videojs-playlists - Playlists done right for Videojs * v0.1.1 * * copyright Antonio Laguna 2013 * MIT License */ function playList(a,b){var c=this;c.pl=c.pl||{};var d=parseInt(a,10);return c.pl._guessVideoType=function(a){var b={webm:"video/webm",mp4:"video/mp4",ogv:"video/ogg"},c=a.split(".").pop();return b[c]||""},c.pl.init=function(a,b){b=b||{},c.pl.videos=[],c.pl.current=0,c.on("ended",c.pl._videoEnd),b.getVideoSource&&(c.pl.getVideoSource=b.getVideoSource),c.pl._addVideos(a)},c.pl._updatePoster=function(a){c.poster(a),c.removeChild(c.posterImage),c.posterImage=c.addChild("posterImage")},c.pl._addVideos=function(a){for(var b=0,d=a.length;d>b;b++){for(var e=[],f=0,g=a[b].src.length;g>f;f++)e.push({type:c.pl._guessVideoType(a[b].src[f]),src:a[b].src[f]});a[b].src=e,c.pl.videos.push(a[b])}},c.pl._nextPrev=function(a){var b,d;if("next"===a?(b=c.pl.videos.length-1,d=1):(b=0,d=-1),c.pl.current!==b){var e=c.pl.current+d;c.pl._setVideo(e),c.trigger(a,[c.pl.videos[e]])}},c.pl._setVideo=function(a){a