adbanner-test/app/assets/javascripts/ad_banner/popcorn.jplayer.min.js

2 lines
6.4 KiB
JavaScript
Raw Normal View History

/*! Popcorn Player for jPlayer 2.9.2 ~ (c) 2009-2014 Happyworm Ltd ~ MIT License */
!function(a){var b="//code.jquery.com/jquery-1.11.1.min.js",c="//code.jplayer.org/2.9.0/jplayer/jquery.jplayer.min.js",d="//code.jplayer.org/2.9.0/jplayer/jquery.jplayer.swf",e="html,flash",f=!1,g=!1,h=!1,i={mp3:{codec:"audio/mpeg",flashCanPlay:!0,media:"audio"},m4a:{codec:'audio/mp4; codecs="mp4a.40.2"',flashCanPlay:!0,media:"audio"},m3u8a:{codec:'application/vnd.apple.mpegurl; codecs="mp4a.40.2"',flashCanPlay:!1,media:"audio"},m3ua:{codec:"audio/mpegurl",flashCanPlay:!1,media:"audio"},oga:{codec:'audio/ogg; codecs="vorbis, opus"',flashCanPlay:!1,media:"audio"},flac:{codec:"audio/x-flac",flashCanPlay:!1,media:"audio"},wav:{codec:'audio/wav; codecs="1"',flashCanPlay:!1,media:"audio"},webma:{codec:'audio/webm; codecs="vorbis"',flashCanPlay:!1,media:"audio"},fla:{codec:"audio/x-flv",flashCanPlay:!0,media:"audio"},rtmpa:{codec:'audio/rtmp; codecs="rtmp"',flashCanPlay:!0,media:"audio"},m4v:{codec:'video/mp4; codecs="avc1.42E01E, mp4a.40.2"',flashCanPlay:!0,media:"video"},m3u8v:{codec:'application/vnd.apple.mpegurl; codecs="avc1.42E01E, mp4a.40.2"',flashCanPlay:!1,media:"video"},m3uv:{codec:"audio/mpegurl",flashCanPlay:!1,media:"video"},ogv:{codec:'video/ogg; codecs="theora, vorbis"',flashCanPlay:!1,media:"video"},webmv:{codec:'video/webm; codecs="vorbis, vp8"',flashCanPlay:!1,media:"video"},flv:{codec:"video/x-flv",flashCanPlay:!0,media:"video"},rtmpv:{codec:'video/rtmp; codecs="rtmp"',flashCanPlay:!0,media:"video"}},j=function(a){return a&&"object"==typeof a&&a.hasOwnProperty?!0:!1},k=function(a){var b=!1;return/\.mp3$/i.test(a)?b="mp3":/\.mp4$/i.test(a)||/\.m4v$/i.test(a)?b="m4v":/\.m4a$/i.test(a)?b="m4a":/\.ogg$/i.test(a)||/\.oga$/i.test(a)?b="oga":/\.ogv$/i.test(a)?b="ogv":/\.webm$/i.test(a)&&(b="webmv"),b},l=function(a){var b="",c="";if(j(a))for(var d in a)a.hasOwnProperty(d)&&(b+=c+d,c=",");return f&&console.log('getSupplied(): Generated: supplied = "'+b+'"'),b};a.player("jplayer",{_canPlayType:function(a,b){var c,d=a.toLowerCase(),f={media:{},options:{}},g=!1;if("video"!==d&&"audio"!==d&&("string"==typeof b?/^http.*/i.test(b)&&(c=k(b),c&&(f.media[c]=b,f.options.solution=e,f.options.supplied=c)):f=b,j(f)&&j(f.media))){j(f.options)||(f.options={}),f.options.solution||(f.options.solution=e),f.options.supplied||(f.options.supplied=l(f.media));for(var h=f.options.solution.toLowerCase().split(","),m=f.options.supplied.toLowerCase().split(","),n=0;n<h.length;n++)for(var o,p=h[n].replace(/^\s+|\s+$/g,""),q="html"===p,r="flash"===p,s=0;s<m.length;s++)if(c=m[s].replace(/^\s+|\s+$/g,""),i[c]){!o&&q&&(o=document.createElement(i[c].media));var t=!!(o&&o.canPlayType&&o.canPlayType(i[c].codec)),u=t&&q,v=i[c].flashCanPlay&&r;(u||v)&&(g={html:u,type:c},n=h.length,s=m.length)}}return g},_setup:function(){var i,m,n=this,o="unknown",p={},q={},r=!1,s=0,t=null,u=!1,v=null,w=function(){r?(f&&console.log("Dispatched event : durationchange : "+s),n.dispatchEvent("durationchange")):(f&&console.log("DELAYED EVENT (!ready) : durationchange : "+s),clearTimeout(t),t=setTimeout(w,250))},x=function(){var a=function(a){a.jPlayer.status.duration!==s&&(s=a.jPlayer.status.duration,w())},b=function(a){u||100!==a.jPlayer.status.seekPercent||(u=!0,setTimeout(function(){f&&console.log("Trigger : canplaythrough"),m._trigger($.jPlayer.event.canplaythrough)},0))};i.bind($.jPlayer.event.loadstart,function(){setTimeout(function(){f&&console.log("Trigger : loadeddata"),m._trigger($.jPlayer.event.loadeddata)},0)}).bind($.jPlayer.event.progress,function(c){a(c),b(c)}).bind($.jPlayer.event.timeupdate,function(c){a(c),b(c)}).bind($.jPlayer.event.play,function(){setTimeout(function(){f&&console.log("Trigger : playing"),m._trigger($.jPlayer.event.playing)},0)}),f&&console.log("Created CUSTOM event handlers for FLASH")},y=function(){!function(b){i=b("#"+n.id),"string"==typeof n.src?(o=k(n.src),p[o]=n.src,q.supplied=o,q.solution=e):j(n.src)&&(p=j(n.src.media)?n.src.media:{},q=j(n.src.options)?n.src.options:{},q.solution=q.solution||e,q.supplied=q.supplied||l(n.src.media)),q.swfPath=q.swfPath||d,i.bind(b.jPlayer.event.ready,function(a){a.jPlayer.flash.used&&x(),b(this).j