|
|
|
@ -0,0 +1,231 @@
|
|
|
|
|
/*
|
|
|
|
|
jQuery
|
|
|
|
|
Copyright 2014 jQuery Foundation and other contributors
|
|
|
|
|
http://jquery.com/
|
|
|
|
|
MediaElement.js
|
|
|
|
|
Copyright 2010-2013, John Dyer (http://j.hn)
|
|
|
|
|
MediaElement Playlist Feature (plugin) -
|
|
|
|
|
Andrew Berezovsky <andrew.berezovsky@gmail.com>
|
|
|
|
|
and Junaid Qadir Baloch <shekhanzai.baloch@gmail.com>
|
|
|
|
|
JavaScript-ID3-Reader
|
|
|
|
|
Copyright (c) 2008 Jacob Seidelin, http://blog.nihilogic.dk/ BSD License
|
|
|
|
|
Copyright (c) 2009 Opera Software ASA BSD License
|
|
|
|
|
Copyright (c) 2010 António Afonso BSD License
|
|
|
|
|
Copyright (c) 2010 Joshua Kifer BSD License
|
|
|
|
|
MyPlayer
|
|
|
|
|
Copyright (c) 2014 tilt@linuxfoo.de MIT License
|
|
|
|
|
*/
|
|
|
|
|
var mejs=mejs||{};mejs.version="2.18.2";mejs.meIndex=0;
|
|
|
|
|
mejs.plugins={silverlight:[{version:[3,0],types:"video/mp4 video/m4v video/mov video/wmv audio/wma audio/m4a audio/mp3 audio/wav audio/mpeg".split(" ")}],flash:[{version:[9,0,124],types:"video/mp4 video/m4v video/mov video/flv video/rtmp video/x-flv audio/flv audio/x-flv audio/mp3 audio/m4a audio/mpeg video/youtube video/x-youtube video/dailymotion video/x-dailymotion application/x-mpegURL".split(" ")}],youtube:[{version:null,types:["video/youtube","video/x-youtube","audio/youtube","audio/x-youtube"]}],
|
|
|
|
|
vimeo:[{version:null,types:["video/vimeo","video/x-vimeo"]}]};
|
|
|
|
|
mejs.Utility={encodeUrl:function(c){return encodeURIComponent(c)},escapeHTML:function(c){return c.toString().split("&").join("&").split("<").join("<").split('"').join(""")},absolutizeUrl:function(c){var a=document.createElement("div");return a.innerHTML='<a href="'+this.escapeHTML(c)+'">x</a>',a.firstChild.href},getScriptPath:function(c){for(var a,b,f,e,d,g=0,h="",k="",l=document.getElementsByTagName("script"),n=l.length,m=c.length;n>g;g++){f=l[g].src;a=f.lastIndexOf("/");-1<a?(d=f.substring(a+
|
|
|
|
|
1),e=f.substring(0,a+1)):(d=f,e="");for(a=0;m>a;a++)if(k=c[a],b=d.indexOf(k),-1<b){h=e;break}if(""!==h)break}return h},calculateTimeFormat:function(c,a,b){0>c&&(c=0);"undefined"==typeof b&&(b=25);var f=a.timeFormat,e=f[0],d=f[1]==f[0],g=d?2:1,h=":",k=Math.floor(c/3600)%24,l=Math.floor(c/60)%60,n=Math.floor(c%60);c=[[Math.floor((c%1*b).toFixed(3)),"f"],[n,"s"],[l,"m"],[k,"h"]];f.length<g&&(h=f[g]);g=!1;b=0;for(k=c.length;k>b;b++)if(-1!==f.indexOf(c[b][1]))g=!0;else if(g){l=!1;for(n=b;k>n;n++)if(0<
|
|
|
|
|
c[n][0]){l=!0;break}if(!l)break;d||(f=e+f);f=c[b][1]+h+f;d&&(f=c[b][1]+f);e=c[b][1]}a.currentTimeFormat=f},twoDigitsString:function(c){return 10>c?"0"+c:String(c)},secondsToTimeCode:function(c,a,b,f){if(0>c&&(c=0),"object"!=typeof a)a=a?"hh:mm:ss":"m:ss",a={currentTimeFormat:b?a+":ff":a,framesPerSecond:f||25};b=a.framesPerSecond;"undefined"==typeof b&&(b=25);a=a.currentTimeFormat;f=Math.floor(c/3600)%24;var e=Math.floor(c/60)%60,d=Math.floor(c%60);lis=[[Math.floor((c%1*b).toFixed(3)),"f"],[d,"s"],
|
|
|
|
|
[e,"m"],[f,"h"]];c=a;i=0;for(len=lis.length;i<len;i++)c=c.replace(lis[i][1]+lis[i][1],this.twoDigitsString(lis[i][0])),c=c.replace(lis[i][1],lis[i][0]);return c},timeCodeToSeconds:function(c,a,b,f){"undefined"==typeof b?b=!1:"undefined"==typeof f&&(f=25);c=c.split(":");a=parseInt(c[0],10);var e=parseInt(c[1],10),d=parseInt(c[2],10),g=0;return b&&(g=parseInt(c[3])/f),3600*a+60*e+d+g},convertSMPTEtoSeconds:function(c){if("string"!=typeof c)return!1;c=c.replace(",",".");var a=0,b=-1!=c.indexOf(".")?
|
|
|
|
|
c.split(".")[1].length:0,f=1;c=c.split(":").reverse();for(var e=0;e<c.length;e++)f=1,0<e&&(f=Math.pow(60,e)),a+=Number(c[e])*f;return Number(a.toFixed(b))},removeSwf:function(c){var a=document.getElementById(c);a&&/object|embed/i.test(a.nodeName)&&(mejs.MediaFeatures.isIE?(a.style.display="none",function(){4==a.readyState?mejs.Utility.removeObjectInIE(c):setTimeout(arguments.callee,10)}()):a.parentNode.removeChild(a))},removeObjectInIE:function(c){if(c=document.getElementById(c)){for(var a in c)"function"==
|
|
|
|
|
typeof c[a]&&(c[a]=null);c.parentNode.removeChild(c)}}};
|
|
|
|
|
mejs.PluginDetector={hasPluginVersion:function(c,a){var b=this.plugins[c];return a[1]=a[1]||0,a[2]=a[2]||0,b[0]>a[0]||b[0]==a[0]&&b[1]>a[1]||b[0]==a[0]&&b[1]==a[1]&&b[2]>=a[2]?!0:!1},nav:window.navigator,ua:window.navigator.userAgent.toLowerCase(),plugins:[],addPlugin:function(c,a,b,f,e){this.plugins[c]=this.detectPlugin(a,b,f,e)},detectPlugin:function(c,a,b,f){var e,d,g=[0,0,0];if("undefined"!=typeof this.nav.plugins&&"object"==typeof this.nav.plugins[c]){if(e=this.nav.plugins[c].description,e&&
|
|
|
|
|
("undefined"==typeof this.nav.mimeTypes||!this.nav.mimeTypes[a]||this.nav.mimeTypes[a].enabledPlugin))for(g=e.replace(c,"").replace(/^\s+/,"").replace(/\sr/gi,".").split("."),c=0;c<g.length;c++)g[c]=parseInt(g[c].match(/\d+/),10)}else if("undefined"!=typeof window.ActiveXObject)try{(d=new ActiveXObject(b))&&(g=f(d))}catch(h){}return g}};
|
|
|
|
|
mejs.PluginDetector.addPlugin("flash","Shockwave Flash","application/x-shockwave-flash","ShockwaveFlash.ShockwaveFlash",function(c){var a=[];c=c.GetVariable("$version");return c&&(c=c.split(" ")[1].split(","),a=[parseInt(c[0],10),parseInt(c[1],10),parseInt(c[2],10)]),a});
|
|
|
|
|
mejs.PluginDetector.addPlugin("silverlight","Silverlight Plug-In","application/x-silverlight-2","AgControl.AgControl",function(c){var a=[0,0,0,0],b=function(a,b,d,c){for(;a.isVersionSupported(b[0]+"."+b[1]+"."+b[2]+"."+b[3]);)b[d]+=c;b[d]-=c};return b(c,a,0,1),b(c,a,1,1),b(c,a,2,1E4),b(c,a,2,1E3),b(c,a,2,100),b(c,a,2,10),b(c,a,2,1),b(c,a,3,1),a});
|
|
|
|
|
mejs.MediaFeatures={init:function(){var c,a,b=this,f=document;c=mejs.PluginDetector.nav;var e=mejs.PluginDetector.ua.toLowerCase(),d=["source","track","audio","video"];b.isiPad=null!==e.match(/ipad/i);b.isiPhone=null!==e.match(/iphone/i);b.isiOS=b.isiPhone||b.isiPad;b.isAndroid=null!==e.match(/android/i);b.isBustedAndroid=null!==e.match(/android 2\.[12]/);b.isBustedNativeHTTPS="https:"===location.protocol&&(null!==e.match(/android [12]\./)||null!==e.match(/macintosh.* version.* safari/));b.isIE=-1!=
|
|
|
|
|
c.appName.toLowerCase().indexOf("microsoft")||null!==c.appName.toLowerCase().match(/trident/gi);b.isChrome=null!==e.match(/chrome/gi);b.isChromium=null!==e.match(/chromium/gi);b.isFirefox=null!==e.match(/firefox/gi);b.isWebkit=null!==e.match(/webkit/gi);b.isGecko=null!==e.match(/gecko/gi)&&!b.isWebkit&&!b.isIE;b.isOpera=null!==e.match(/opera/gi);b.hasTouch="ontouchstart"in window;b.svg=!!document.createElementNS&&!!document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGRect;for(c=0;c<
|
|
|
|
|
d.length;c++)a=document.createElement(d[c]);b.supportsMediaTag="undefined"!=typeof a.canPlayType||b.isBustedAndroid;try{a.canPlayType("video/mp4")}catch(g){b.supportsMediaTag=!1}b.hasSemiNativeFullScreen="undefined"!=typeof a.webkitEnterFullscreen;b.hasNativeFullscreen="undefined"!=typeof a.requestFullscreen;b.hasWebkitNativeFullScreen="undefined"!=typeof a.webkitRequestFullScreen;b.hasMozNativeFullScreen="undefined"!=typeof a.mozRequestFullScreen;b.hasMsNativeFullScreen="undefined"!=typeof a.msRequestFullscreen;
|
|
|
|
|
b.hasTrueNativeFullScreen=b.hasWebkitNativeFullScreen||b.hasMozNativeFullScreen||b.hasMsNativeFullScreen;b.nativeFullScreenEnabled=b.hasTrueNativeFullScreen;b.hasMozNativeFullScreen?b.nativeFullScreenEnabled=document.mozFullScreenEnabled:b.hasMsNativeFullScreen&&(b.nativeFullScreenEnabled=document.msFullscreenEnabled);b.isChrome&&(b.hasSemiNativeFullScreen=!1);b.hasTrueNativeFullScreen&&(b.fullScreenEventName="",b.hasWebkitNativeFullScreen?b.fullScreenEventName="webkitfullscreenchange":b.hasMozNativeFullScreen?
|
|
|
|
|
b.fullScreenEventName="mozfullscreenchange":b.hasMsNativeFullScreen&&(b.fullScreenEventName="MSFullscreenChange"),b.isFullScreen=function(){return b.hasMozNativeFullScreen?f.mozFullScreen:b.hasWebkitNativeFullScreen?f.webkitIsFullScreen:b.hasMsNativeFullScreen?null!==f.msFullscreenElement:void 0},b.requestFullScreen=function(a){b.hasWebkitNativeFullScreen?a.webkitRequestFullScreen():b.hasMozNativeFullScreen?a.mozRequestFullScreen():b.hasMsNativeFullScreen&&a.msRequestFullscreen()},b.cancelFullScreen=
|
|
|
|
|
function(){b.hasWebkitNativeFullScreen?document.webkitCancelFullScreen():b.hasMozNativeFullScreen?document.mozCancelFullScreen():b.hasMsNativeFullScreen&&document.msExitFullscreen()});b.hasSemiNativeFullScreen&&e.match(/mac os x 10_5/i)&&(b.hasNativeFullScreen=!1,b.hasSemiNativeFullScreen=!1)}};mejs.MediaFeatures.init();
|
|
|
|
|
mejs.HtmlMediaElement={pluginType:"native",isFullScreen:!1,setCurrentTime:function(c){this.currentTime=c},setMuted:function(c){this.muted=c},setVolume:function(c){this.volume=c},stop:function(){this.pause()},setSrc:function(c){for(var a=this.getElementsByTagName("source");0<a.length;)this.removeChild(a[0]);if("string"==typeof c)this.src=c;else for(var b,a=0;a<c.length;a++)if(b=c[a],this.canPlayType(b.type)){this.src=b.src;break}},setVideoSize:function(c,a){this.width=c;this.height=a}};
|
|
|
|
|
mejs.PluginMediaElement=function(c,a,b){this.id=c;this.pluginType=a;this.src=b;this.events={};this.attributes={}};
|
|
|
|
|
mejs.PluginMediaElement.prototype={pluginElement:null,pluginType:"",isFullScreen:!1,playbackRate:-1,defaultPlaybackRate:-1,seekable:[],played:[],paused:!0,ended:!1,seeking:!1,duration:0,error:null,tagName:"",muted:!1,volume:1,currentTime:0,play:function(){null!=this.pluginApi&&("youtube"==this.pluginType||"vimeo"==this.pluginType?this.pluginApi.playVideo():this.pluginApi.playMedia(),this.paused=!1)},load:function(){null!=this.pluginApi&&("youtube"==this.pluginType||"vimeo"==this.pluginType||this.pluginApi.loadMedia(),
|
|
|
|
|
this.paused=!1)},pause:function(){null!=this.pluginApi&&("youtube"==this.pluginType||"vimeo"==this.pluginType?this.pluginApi.pauseVideo():this.pluginApi.pauseMedia(),this.paused=!0)},stop:function(){null!=this.pluginApi&&("youtube"==this.pluginType||"vimeo"==this.pluginType?this.pluginApi.stopVideo():this.pluginApi.stopMedia(),this.paused=!0)},canPlayType:function(c){var a,b,f,e=mejs.plugins[this.pluginType];for(a=0;a<e.length;a++)if(f=e[a],mejs.PluginDetector.hasPluginVersion(this.pluginType,f.version))for(b=
|
|
|
|
|
0;b<f.types.length;b++)if(c==f.types[b])return"probably";return""},positionFullscreenButton:function(c,a,b){null!=this.pluginApi&&this.pluginApi.positionFullscreenButton&&this.pluginApi.positionFullscreenButton(Math.floor(c),Math.floor(a),b)},hideFullscreenButton:function(){null!=this.pluginApi&&this.pluginApi.hideFullscreenButton&&this.pluginApi.hideFullscreenButton()},setSrc:function(c){if("string"==typeof c)this.pluginApi.setSrc(mejs.Utility.absolutizeUrl(c)),this.src=mejs.Utility.absolutizeUrl(c);
|
|
|
|
|
else{var a,b;for(a=0;a<c.length;a++)if(b=c[a],this.canPlayType(b.type)){this.pluginApi.setSrc(mejs.Utility.absolutizeUrl(b.src));this.src=mejs.Utility.absolutizeUrl(b.src);break}}},setCurrentTime:function(c){null!=this.pluginApi&&("youtube"==this.pluginType||"vimeo"==this.pluginType?this.pluginApi.seekTo(c):this.pluginApi.setCurrentTime(c),this.currentTime=c)},setVolume:function(c){null!=this.pluginApi&&("youtube"==this.pluginType?this.pluginApi.setVolume(100*c):this.pluginApi.setVolume(c),this.volume=
|
|
|
|
|
c)},setMuted:function(c){null!=this.pluginApi&&("youtube"==this.pluginType?(c?this.pluginApi.mute():this.pluginApi.unMute(),this.muted=c,this.dispatchEvent({type:"volumechange"})):this.pluginApi.setMuted(c),this.muted=c)},setVideoSize:function(c,a){this.pluginElement&&this.pluginElement.style&&(this.pluginElement.style.width=c+"px",this.pluginElement.style.height=a+"px");null!=this.pluginApi&&this.pluginApi.setVideoSize&&this.pluginApi.setVideoSize(c,a)},setFullscreen:function(c){null!=this.pluginApi&&
|
|
|
|
|
this.pluginApi.setFullscreen&&this.pluginApi.setFullscreen(c)},enterFullScreen:function(){null!=this.pluginApi&&this.pluginApi.setFullscreen&&this.setFullscreen(!0)},exitFullScreen:function(){null!=this.pluginApi&&this.pluginApi.setFullscreen&&this.setFullscreen(!1)},addEventListener:function(c,a,b){this.events[c]=this.events[c]||[];this.events[c].push(a)},removeEventListener:function(c,a){if(!c)return this.events={},!0;var b=this.events[c];if(!b)return!0;if(!a)return this.events[c]=[],!0;for(var f=
|
|
|
|
|
0;f<b.length;f++)if(b[f]===a)return this.events[c].splice(f,1),!0;return!1},dispatchEvent:function(c){var a,b=this.events[c.type];if(b)for(a=0;a<b.length;a++)b[a].apply(this,[c])},hasAttribute:function(c){return c in this.attributes},removeAttribute:function(c){delete this.attributes[c]},getAttribute:function(c){return this.hasAttribute(c)?this.attributes[c]:""},setAttribute:function(c,a){this.attributes[c]=a},remove:function(){mejs.Utility.removeSwf(this.pluginElement.id);mejs.MediaPluginBridge.unregisterPluginElement(this.pluginElement.id)}};
|
|
|
|
|
mejs.MediaPluginBridge={pluginMediaElements:{},htmlMediaElements:{},registerPluginElement:function(c,a,b){this.pluginMediaElements[c]=a;this.htmlMediaElements[c]=b},unregisterPluginElement:function(c){delete this.pluginMediaElements[c];delete this.htmlMediaElements[c]},initPlugin:function(c){var a=this.pluginMediaElements[c],b=this.htmlMediaElements[c];if(a){switch(a.pluginType){case "flash":a.pluginElement=a.pluginApi=document.getElementById(c);break;case "silverlight":a.pluginElement=document.getElementById(a.id),
|
|
|
|
|
a.pluginApi=a.pluginElement.Content.MediaElementJS}null!=a.pluginApi&&a.success&&a.success(a,b)}},fireEvent:function(c,a,b){var f,e;if(c=this.pluginMediaElements[c]){a={type:a,target:c};for(f in b)c[f]=b[f],a[f]=b[f];e=b.bufferedTime||0;a.target.buffered=a.buffered={start:function(a){return 0},end:function(a){return e},length:1};c.dispatchEvent(a)}}};
|
|
|
|
|
mejs.MediaElementDefaults={mode:"auto",plugins:["flash","silverlight","youtube","vimeo"],enablePluginDebug:!1,httpsBasicAuthSite:!1,type:"",pluginPath:mejs.Utility.getScriptPath(["mediaelement.js","mediaelement.min.js","mediaelement-and-player.js","mediaelement-and-player.min.js"]),flashName:"flashmediaelement.swf",flashStreamer:"",flashScriptAccess:"sameDomain",enablePluginSmoothing:!1,enablePseudoStreaming:!1,pseudoStreamingStartQueryParam:"start",silverlightName:"silverlightmediaelement.xap",defaultVideoWidth:480,
|
|
|
|
|
defaultVideoHeight:270,pluginWidth:-1,pluginHeight:-1,pluginVars:[],timerRate:250,startVolume:.8,success:function(){},error:function(){}};mejs.MediaElement=function(c,a){return mejs.HtmlMediaElementShim.create(c,a)};
|
|
|
|
|
mejs.HtmlMediaElementShim={create:function(c,a){var b,f,e={},d="string"==typeof c?document.getElementById(c):c,g=d.tagName.toLowerCase(),h=(g="audio"===g||"video"===g)?d.getAttribute("src"):d.getAttribute("href"),k=d.getAttribute("poster"),l=d.getAttribute("autoplay"),n=d.getAttribute("preload"),m=d.getAttribute("controls");for(f in mejs.MediaElementDefaults)e[f]=mejs.MediaElementDefaults[f];for(f in a)e[f]=a[f];return h="undefined"==typeof h||null===h||""==h?null:h,k="undefined"==typeof k||null===
|
|
|
|
|
k?"":k,n="undefined"==typeof n||null===n||"false"===n?"none":n,l=!("undefined"==typeof l||null===l||"false"===l),m=!("undefined"==typeof m||null===m||"false"===m),b=this.determinePlayback(d,e,mejs.MediaFeatures.supportsMediaTag,g,h),b.url=null!==b.url?mejs.Utility.absolutizeUrl(b.url):"","native"==b.method?(mejs.MediaFeatures.isBustedAndroid&&(d.src=b.url,d.addEventListener("click",function(){d.play()},!1)),this.updateNative(b,e,l,n)):""!==b.method?this.createPlugin(b,e,k,l,n,m):(this.createErrorMessage(b,
|
|
|
|
|
e,k),this)},determinePlayback:function(c,a,b,f,e){var d,g,h,k,l,n,m=[],p={method:"",url:"",htmlMediaElement:c,isVideo:"audio"!=c.tagName.toLowerCase()};if("undefined"!=typeof a.type&&""!==a.type)if("string"==typeof a.type)m.push({type:a.type,url:e});else for(d=0;d<a.type.length;d++)m.push({type:a.type[d],url:e});else if(null!==e)h=this.formatType(e,c.getAttribute("type")),m.push({type:h,url:e});else for(d=0;d<c.childNodes.length;d++)g=c.childNodes[d],1==g.nodeType&&"source"==g.tagName.toLowerCase()&&
|
|
|
|
|
(e=g.getAttribute("src"),h=this.formatType(e,g.getAttribute("type")),n=g.getAttribute("media"),(!n||!window.matchMedia||window.matchMedia&&window.matchMedia(n).matches)&&m.push({type:h,url:e}));if(!f&&0<m.length&&null!==m[0].url&&-1<this.getTypeFromFile(m[0].url).indexOf("audio")&&(p.isVideo=!1),mejs.MediaFeatures.isBustedAndroid&&(c.canPlayType=function(a){return null!==a.match(/video\/(mp4|m4v)/gi)?"maybe":""}),mejs.MediaFeatures.isChromium&&(c.canPlayType=function(a){return null!==a.match(/video\/(webm|ogv|ogg)/gi)?
|
|
|
|
|
"maybe":""}),!(!b||"auto"!==a.mode&&"auto_plugin"!==a.mode&&"native"!==a.mode||mejs.MediaFeatures.isBustedNativeHTTPS&&!0===a.httpsBasicAuthSite)){f||(l=document.createElement(p.isVideo?"video":"audio"),c.parentNode.insertBefore(l,c),c.style.display="none",p.htmlMediaElement=c=l);for(d=0;d<m.length;d++)if("video/m3u8"==m[d].type||""!==c.canPlayType(m[d].type).replace(/no/,"")||""!==c.canPlayType(m[d].type.replace(/mp3/,"mpeg")).replace(/no/,"")||""!==c.canPlayType(m[d].type.replace(/m4a/,"mp4")).replace(/no/,
|
|
|
|
|
"")){p.method="native";p.url=m[d].url;break}if("native"===p.method&&(null!==p.url&&(c.src=p.url),"auto_plugin"!==a.mode))return p}if("auto"===a.mode||"auto_plugin"===a.mode||"shim"===a.mode)for(d=0;d<m.length;d++)for(h=m[d].type,c=0;c<a.plugins.length;c++)for(e=a.plugins[c],g=mejs.plugins[e],b=0;b<g.length;b++)if(k=g[b],null==k.version||mejs.PluginDetector.hasPluginVersion(e,k.version))for(f=0;f<k.types.length;f++)if(h.toLowerCase()==k.types[f].toLowerCase())return p.method=e,p.url=m[d].url,p;return"auto_plugin"===
|
|
|
|
|
a.mode&&"native"===p.method?p:(""===p.method&&0<m.length&&(p.url=m[0].url),p)},formatType:function(c,a){return c&&!a?this.getTypeFromFile(c):a&&~a.indexOf(";")?a.substr(0,a.indexOf(";")):a},getTypeFromFile:function(c){c=c.split("?")[0];c=c.substring(c.lastIndexOf(".")+1).toLowerCase();var a=/(mp4|m4v|ogg|ogv|m3u8|webm|webmv|flv|wmv|mpeg|mov)/gi.test(c)?"video/":"audio/";return this.getTypeFromExtension(c,a)},getTypeFromExtension:function(c,a){switch(a=a||"",c){case "mp4":case "m4v":case "m4a":case "f4v":case "f4a":return a+
|
|
|
|
|
"mp4";case "flv":return a+"x-flv";case "webm":case "webma":case "webmv":return a+"webm";case "ogg":case "oga":case "ogv":return a+"ogg";case "m3u8":return"application/x-mpegurl";case "ts":return a+"mp2t";default:return a+c}},createErrorMessage:function(c,a,b){var f=c.htmlMediaElement,e=document.createElement("div"),d=a.customError;e.className="me-cannotplay";try{e.style.width=f.width+"px",e.style.height=f.height+"px"}catch(g){}d||(d='<a href="'+c.url+'">',""!==b&&(d+='<img src="'+b+'" width="100%" height="100%" alt="" />'),
|
|
|
|
|
d+="<span>"+mejs.i18n.t("Download File")+"</span></a>");e.innerHTML=d;f.parentNode.insertBefore(e,f);f.style.display="none";a.error(f)},createPlugin:function(c,a,b,f,e,d){var g,h,k;b=c.htmlMediaElement;var l=1,n=1,m="me_"+c.method+"_"+mejs.meIndex++,p=new mejs.PluginMediaElement(m,c.method,c.url),q=document.createElement("div");p.tagName=b.tagName;for(h=0;h<b.attributes.length;h++){var u=b.attributes[h];u.specified&&p.setAttribute(u.name,u.value)}for(h=b.parentNode;null!==h&&null!=h.tagName&&"body"!==
|
|
|
|
|
h.tagName.toLowerCase()&&null!=h.parentNode&&null!=h.parentNode.tagName&&null!=h.parentNode.constructor&&"ShadowRoot"===h.parentNode.constructor.name;){if("p"===h.parentNode.tagName.toLowerCase()){h.parentNode.parentNode.insertBefore(h,h.parentNode);break}h=h.parentNode}switch(c.isVideo?(l=0<a.pluginWidth?a.pluginWidth:0<a.videoWidth?a.videoWidth:null!==b.getAttribute("width")?b.getAttribute("width"):a.defaultVideoWidth,n=0<a.pluginHeight?a.pluginHeight:0<a.videoHeight?a.videoHeight:null!==b.getAttribute("height")?
|
|
|
|
|
b.getAttribute("height"):a.defaultVideoHeight,l=mejs.Utility.encodeUrl(l),n=mejs.Utility.encodeUrl(n)):a.enablePluginDebug&&(l=320,n=240),p.success=a.success,mejs.MediaPluginBridge.registerPluginElement(m,p,b),q.className="me-plugin",q.id=m+"_container",c.isVideo?b.parentNode.insertBefore(q,b):document.body.insertBefore(q,document.body.childNodes[0]),k=["id="+m,"jsinitfunction=mejs.MediaPluginBridge.initPlugin","jscallbackfunction=mejs.MediaPluginBridge.fireEvent","isvideo="+(c.isVideo?"true":"false"),
|
|
|
|
|
"autoplay="+(f?"true":"false"),"preload="+e,"width="+l,"startvolume="+a.startVolume,"timerrate="+a.timerRate,"flashstreamer="+a.flashStreamer,"height="+n,"pseudostreamstart="+a.pseudoStreamingStartQueryParam],null!==c.url&&("flash"==c.method?k.push("file="+mejs.Utility.encodeUrl(c.url)):k.push("file="+c.url)),a.enablePluginDebug&&k.push("debug=true"),a.enablePluginSmoothing&&k.push("smoothing=true"),a.enablePseudoStreaming&&k.push("pseudostreaming=true"),d&&k.push("controls=true"),a.pluginVars&&(k=
|
|
|
|
|
k.concat(a.pluginVars)),c.method){case "silverlight":q.innerHTML='<object data="data:application/x-silverlight-2," type="application/x-silverlight-2" id="'+m+'" name="'+m+'" width="'+l+'" height="'+n+'" class="mejs-shim"><param name="initParams" value="'+k.join(",")+'" /><param name="windowless" value="true" /><param name="background" value="black" /><param name="minRuntimeVersion" value="3.0.0.0" /><param name="autoUpgrade" value="true" /><param name="source" value="'+a.pluginPath+a.silverlightName+
|
|
|
|
|
'" /></object>';break;case "flash":mejs.MediaFeatures.isIE?(g=document.createElement("div"),q.appendChild(g),g.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="//download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab" id="'+m+'" width="'+l+'" height="'+n+'" class="mejs-shim"><param name="movie" value="'+a.pluginPath+a.flashName+"?x="+new Date+'" /><param name="flashvars" value="'+k.join("&")+'" /><param name="quality" value="high" /><param name="bgcolor" value="#000000" /><param name="wmode" value="transparent" /><param name="allowScriptAccess" value="'+
|
|
|
|
|
a.flashScriptAccess+'" /><param name="allowFullScreen" value="true" /><param name="scale" value="default" /></object>'):q.innerHTML='<embed id="'+m+'" name="'+m+'" play="true" loop="false" quality="high" bgcolor="#000000" wmode="transparent" allowScriptAccess="'+a.flashScriptAccess+'" allowFullScreen="true" type="application/x-shockwave-flash" pluginspage="//www.macromedia.com/go/getflashplayer" src="'+a.pluginPath+a.flashName+'" flashvars="'+k.join("&")+'" width="'+l+'" height="'+n+'" scale="default"class="mejs-shim"></embed>';
|
|
|
|
|
break;case "youtube":var t;-1!=c.url.lastIndexOf("youtu.be")?(t=c.url.substr(c.url.lastIndexOf("/")+1),-1!=t.indexOf("?")&&(t=t.substr(0,t.indexOf("?")))):t=c.url.substr(c.url.lastIndexOf("=")+1);youtubeSettings={container:q,containerId:q.id,pluginMediaElement:p,pluginId:m,videoId:t,height:n,width:l};mejs.PluginDetector.hasPluginVersion("flash",[10,0,0])?mejs.YouTubeApi.createFlash(youtubeSettings,a):mejs.YouTubeApi.enqueueIframe(youtubeSettings);break;case "vimeo":if(a=m+"_player",p.vimeoid=c.url.substr(c.url.lastIndexOf("/")+
|
|
|
|
|
1),q.innerHTML='<iframe src="//player.vimeo.com/video/'+p.vimeoid+"?api=1&portrait=0&byline=0&title=0&player_id="+a+'" width="'+l+'" height="'+n+'" frameborder="0" class="mejs-shim" id="'+a+'" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>',"function"==typeof $f){var r=$f(q.childNodes[0]);r.addEvent("ready",function(){function a(b,d,c,e){b={type:c,target:d};"timeupdate"==c&&(d.currentTime=b.currentTime=e.seconds,d.duration=b.duration=e.duration);d.dispatchEvent(b)}r.playVideo=
|
|
|
|
|
function(){r.api("play")};r.stopVideo=function(){r.api("unload")};r.pauseVideo=function(){r.api("pause")};r.seekTo=function(a){r.api("seekTo",a)};r.setVolume=function(a){r.api("setVolume",a)};r.setMuted=function(a){a?(r.lastVolume=r.api("getVolume"),r.api("setVolume",0)):(r.api("setVolume",r.lastVolume),delete r.lastVolume)};r.addEvent("play",function(){a(r,p,"play");a(r,p,"playing")});r.addEvent("pause",function(){a(r,p,"pause")});r.addEvent("finish",function(){a(r,p,"ended")});r.addEvent("playProgress",
|
|
|
|
|
function(b){a(r,p,"timeupdate",b)});p.pluginElement=q;p.pluginApi=r;mejs.MediaPluginBridge.initPlugin(m)})}else console.warn("You need to include froogaloop for vimeo to work")}return b.style.display="none",b.removeAttribute("autoplay"),p},updateNative:function(c,a,b,f){var e;c=c.htmlMediaElement;for(e in mejs.HtmlMediaElement)c[e]=mejs.HtmlMediaElement[e];return a.success(c,c),c}};
|
|
|
|
|
mejs.YouTubeApi={isIframeStarted:!1,isIframeLoaded:!1,loadIframeApi:function(){if(!this.isIframeStarted){var c=document.createElement("script");c.src="//www.youtube.com/player_api";var a=document.getElementsByTagName("script")[0];a.parentNode.insertBefore(c,a);this.isIframeStarted=!0}},iframeQueue:[],enqueueIframe:function(c){this.isLoaded?this.createIframe(c):(this.loadIframeApi(),this.iframeQueue.push(c))},createIframe:function(c){var a=c.pluginMediaElement,b=new YT.Player(c.containerId,{height:c.height,
|
|
|
|
|
width:c.width,videoId:c.videoId,playerVars:{controls:0},events:{onReady:function(){c.pluginMediaElement.pluginApi=b;mejs.MediaPluginBridge.initPlugin(c.pluginId);setInterval(function(){mejs.YouTubeApi.createEvent(b,a,"timeupdate")},250)},onStateChange:function(c){mejs.YouTubeApi.handleStateChange(c.data,b,a)}}})},createEvent:function(c,a,b){b={type:b,target:a};if(c&&c.getDuration){a.currentTime=b.currentTime=c.getCurrentTime();a.duration=b.duration=c.getDuration();b.paused=a.paused;b.ended=a.ended;
|
|
|
|
|
b.muted=c.isMuted();b.volume=c.getVolume()/100;b.bytesTotal=c.getVideoBytesTotal();b.bufferedBytes=c.getVideoBytesLoaded();var f=b.bufferedBytes/b.bytesTotal*b.duration;b.target.buffered=b.buffered={start:function(a){return 0},end:function(a){return f},length:1}}a.dispatchEvent(b)},iFrameReady:function(){for(this.isIframeLoaded=this.isLoaded=!0;0<this.iframeQueue.length;){var c=this.iframeQueue.pop();this.createIframe(c)}},flashPlayers:{},createFlash:function(c){this.flashPlayers[c.pluginId]=c;var a,
|
|
|
|
|
b="//www.youtube.com/apiplayer?enablejsapi=1&playerapiid="+c.pluginId+"&version=3&autoplay=0&controls=0&modestbranding=1&loop=0";mejs.MediaFeatures.isIE?(a=document.createElement("div"),c.container.appendChild(a),a.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="//download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab" id="'+c.pluginId+'" width="'+c.width+'" height="'+c.height+'" class="mejs-shim"><param name="movie" value="'+b+'" /><param name="wmode" value="transparent" /><param name="allowScriptAccess" value="'+
|
|
|
|
|
options.flashScriptAccess+'" /><param name="allowFullScreen" value="true" /></object>'):c.container.innerHTML='<object type="application/x-shockwave-flash" id="'+c.pluginId+'" data="'+b+'" width="'+c.width+'" height="'+c.height+'" style="visibility: visible; " class="mejs-shim"><param name="allowScriptAccess" value="'+options.flashScriptAccess+'"><param name="wmode" value="transparent"></object>'},flashReady:function(c){var a=this.flashPlayers[c],b=document.getElementById(c),f=a.pluginMediaElement;
|
|
|
|
|
f.pluginApi=f.pluginElement=b;mejs.MediaPluginBridge.initPlugin(c);b.cueVideoById(a.videoId);c=a.containerId+"_callback";window[c]=function(a){mejs.YouTubeApi.handleStateChange(a,b,f)};b.addEventListener("onStateChange",c);setInterval(function(){mejs.YouTubeApi.createEvent(b,f,"timeupdate")},250);mejs.YouTubeApi.createEvent(b,f,"canplay")},handleStateChange:function(c,a,b){switch(c){case -1:b.paused=!0;b.ended=!0;mejs.YouTubeApi.createEvent(a,b,"loadedmetadata");break;case 0:b.paused=!1;b.ended=!0;
|
|
|
|
|
mejs.YouTubeApi.createEvent(a,b,"ended");break;case 1:b.paused=!1;b.ended=!1;mejs.YouTubeApi.createEvent(a,b,"play");mejs.YouTubeApi.createEvent(a,b,"playing");break;case 2:b.paused=!0;b.ended=!1;mejs.YouTubeApi.createEvent(a,b,"pause");break;case 3:mejs.YouTubeApi.createEvent(a,b,"progress")}}};window.onYouTubePlayerAPIReady=function(){mejs.YouTubeApi.iFrameReady()};window.onYouTubePlayerReady=function(c){mejs.YouTubeApi.flashReady(c)};window.mejs=mejs;window.MediaElement=mejs.MediaElement;
|
|
|
|
|
(function(c,a,b){var f={locale:{language:a.i18n&&a.i18n.locale.language||"",strings:a.i18n&&a.i18n.locale.strings||{}},ietf_lang_regex:/^(x\-)?[a-z]{2,}(\-\w{2,})?(\-\w{2,})?$/,methods:{},getLanguage:function(){var a=f.locale.language||window.navigator.userLanguage||window.navigator.language;return f.ietf_lang_regex.exec(a)?a:null}};"undefined"!=typeof mejsL10n&&(f.locale.language=mejsL10n.language);f.methods.checkPlain=function(a){var b,c,f={"&":"&",'"':""","<":"<",">":">"};a=String(a);
|
|
|
|
|
for(b in f)f.hasOwnProperty(b)&&(c=new RegExp(b,"g"),a=a.replace(c,f[b]));return a};f.methods.t=function(a,b){return f.locale.strings&&f.locale.strings[b.context]&&f.locale.strings[b.context][a]&&(a=f.locale.strings[b.context][a]),f.methods.checkPlain(a)};f.t=function(a,b){if("string"==typeof a&&0<a.length){var c=f.getLanguage();return b=b||{context:c},f.methods.t(a,b)}throw{name:"InvalidArgumentException",message:"First argument is either not a string or empty."};};a.i18n=f})(document,mejs);
|
|
|
|
|
(function(c,a){"undefined"!=typeof mejsL10n&&(c[mejsL10n.language]=mejsL10n.strings)})(mejs.i18n.locale.strings);"undefined"!=typeof jQuery?mejs.$=jQuery:"undefined"!=typeof Zepto?(mejs.$=Zepto,Zepto.fn.outerWidth=function(c){var a=$(this).width();return c&&(a+=parseInt($(this).css("margin-right"),10),a+=parseInt($(this).css("margin-left"),10)),a}):"undefined"!=typeof ender&&(mejs.$=ender);
|
|
|
|
|
(function(c){mejs.MepDefaults={poster:"",showPosterWhenEnded:!1,defaultVideoWidth:480,defaultVideoHeight:270,videoWidth:-1,videoHeight:-1,defaultAudioWidth:400,defaultAudioHeight:30,defaultSeekBackwardInterval:function(a){return.05*a.duration},defaultSeekForwardInterval:function(a){return.05*a.duration},setDimensions:!0,audioWidth:-1,audioHeight:-1,startVolume:.8,loop:!1,autoRewind:!0,enableAutosize:!0,timeFormat:"",alwaysShowHours:!1,showTimecodeFrameCount:!1,framesPerSecond:25,autosizeProgress:!0,
|
|
|
|
|
alwaysShowControls:!1,hideVideoControlsOnLoad:!1,clickToPlayPause:!0,iPadUseNativeControls:!1,iPhoneUseNativeControls:!1,AndroidUseNativeControls:!1,features:"playpause current progress duration tracks volume fullscreen".split(" "),isVideo:!0,enableKeyboard:!0,pauseOtherPlayers:!0,keyActions:[{keys:[32,179],action:function(a,b){b.paused||b.ended?b.play():b.pause()}},{keys:[38],action:function(a,b){a.container.find(".mejs-volume-slider").css("display","block");a.isVideo&&(a.showControls(),a.startControlsTimer());
|
|
|
|
|
b.setVolume(Math.min(b.volume+.1,1))}},{keys:[40],action:function(a,b){a.container.find(".mejs-volume-slider").css("display","block");a.isVideo&&(a.showControls(),a.startControlsTimer());b.setVolume(Math.max(b.volume-.1,0))}},{keys:[37,227],action:function(a,b){if(!isNaN(b.duration)&&0<b.duration){a.isVideo&&(a.showControls(),a.startControlsTimer());var c=Math.max(b.currentTime-a.options.defaultSeekBackwardInterval(b),0);b.setCurrentTime(c)}}},{keys:[39,228],action:function(a,b){if(!isNaN(b.duration)&&
|
|
|
|
|
0<b.duration){a.isVideo&&(a.showControls(),a.startControlsTimer());var c=Math.min(b.currentTime+a.options.defaultSeekForwardInterval(b),b.duration);b.setCurrentTime(c)}}},{keys:[70],action:function(a,b){"undefined"!=typeof a.enterFullScreen&&(a.isFullScreen?a.exitFullScreen():a.enterFullScreen())}},{keys:[77],action:function(a,b){a.container.find(".mejs-volume-slider").css("display","block");a.isVideo&&(a.showControls(),a.startControlsTimer());a.media.muted?a.setMuted(!1):a.setMuted(!0)}}]};mejs.mepIndex=
|
|
|
|
|
0;mejs.players={};mejs.MediaElementPlayer=function(a,b){return this instanceof mejs.MediaElementPlayer?(this.$media=this.$node=c(a),this.node=this.media=this.$media[0],this.node?"undefined"!=typeof this.node.player?this.node.player:("undefined"==typeof b&&(b=this.$node.data("mejsoptions")),this.options=c.extend({},mejs.MepDefaults,b),this.options.timeFormat||(this.options.timeFormat="mm:ss",this.options.alwaysShowHours&&(this.options.timeFormat="hh:mm:ss"),this.options.showTimecodeFrameCount&&(this.options.timeFormat+=
|
|
|
|
|
":ff")),mejs.Utility.calculateTimeFormat(0,this.options,this.options.framesPerSecond||25),this.id="mep_"+mejs.mepIndex++,mejs.players[this.id]=this,this.init(),this):void 0):new mejs.MediaElementPlayer(a,b)};mejs.MediaElementPlayer.prototype={hasFocus:!1,controlsAreVisible:!0,init:function(){var a=this,b=mejs.MediaFeatures,f=c.extend(!0,{},a.options,{success:function(b,c){a.meReady(b,c)},error:function(b){a.handleError(b)}}),e=a.media.tagName.toLowerCase();(a.isDynamic="audio"!==e&&"video"!==e,a.isDynamic?
|
|
|
|
|
a.isVideo=a.options.isVideo:a.isVideo="audio"!==e&&a.options.isVideo,b.isiPad&&a.options.iPadUseNativeControls||b.isiPhone&&a.options.iPhoneUseNativeControls)?(a.$media.attr("controls","controls"),b.isiPad&&null!==a.media.getAttribute("autoplay")&&a.play()):b.isAndroid&&a.options.AndroidUseNativeControls||(a.$media.removeAttr("controls"),e=a.isVideo?mejs.i18n.t("Video Player"):mejs.i18n.t("Audio Player"),(c('<span class="mejs-offscreen">'+e+"</span>").insertBefore(a.$media),a.container=c('<div id="'+
|
|
|
|
|
a.id+'" class="mejs-container '+(mejs.MediaFeatures.svg?"svg":"no-svg")+'" tabindex="0" role="application" aria-label="'+e+'"><div class="mejs-inner"><div class="mejs-mediaelement"></div><div class="mejs-layers"></div><div class="mejs-controls"></div><div class="mejs-clear"></div></div></div>').addClass(a.$media[0].className).insertBefore(a.$media).focus(function(b){a.controlsAreVisible||(a.showControls(!0),a.container.find(".mejs-playpause-button > button").focus())}),a.container.addClass((b.isAndroid?
|
|
|
|
|
"mejs-android ":"")+(b.isiOS?"mejs-ios ":"")+(b.isiPad?"mejs-ipad ":"")+(b.isiPhone?"mejs-iphone ":"")+(a.isVideo?"mejs-video ":"mejs-audio ")),b.isiOS)?(b=a.$media.clone(),a.container.find(".mejs-mediaelement").append(b),a.$media.remove(),a.$node=a.$media=b,a.node=a.media=b[0]):a.container.find(".mejs-mediaelement").append(a.$media),a.node.player=a,a.controls=a.container.find(".mejs-controls"),a.layers=a.container.find(".mejs-layers"),b=a.isVideo?"video":"audio",e=b.substring(0,1).toUpperCase()+
|
|
|
|
|
b.substring(1),0<a.options[b+"Width"]||-1<a.options[b+"Width"].toString().indexOf("%")?a.width=a.options[b+"Width"]:""!==a.media.style.width&&null!==a.media.style.width?a.width=a.media.style.width:null!==a.media.getAttribute("width")?a.width=a.$media.attr("width"):a.width=a.options["default"+e+"Width"],0<a.options[b+"Height"]||-1<a.options[b+"Height"].toString().indexOf("%")?a.height=a.options[b+"Height"]:""!==a.media.style.height&&null!==a.media.style.height?a.height=a.media.style.height:null!==
|
|
|
|
|
a.$media[0].getAttribute("height")?a.height=a.$media.attr("height"):a.height=a.options["default"+e+"Height"],a.setPlayerSize(a.width,a.height),f.pluginWidth=a.width,f.pluginHeight=a.height);mejs.MediaElement(a.$media[0],f);"undefined"!=typeof a.container&&a.controlsAreVisible&&a.container.trigger("controlsshown")},showControls:function(a){var b=this;b.controlsAreVisible||("undefined"==typeof a||a?(b.controls.css("visibility","visible").stop(!0,!0).fadeIn(200,function(){b.controlsAreVisible=!0;b.container.trigger("controlsshown")}),
|
|
|
|
|
b.container.find(".mejs-control").css("visibility","visible").stop(!0,!0).fadeIn(200,function(){b.controlsAreVisible=!0})):(b.controls.css("visibility","visible").css("display","block"),b.container.find(".mejs-control").css("visibility","visible").css("display","block"),b.controlsAreVisible=!0,b.container.trigger("controlsshown")),b.setControlsSize())},hideControls:function(a){var b=this;!b.controlsAreVisible||b.options.alwaysShowControls||b.keyboardAction||("undefined"==typeof a||a?(b.controls.stop(!0,
|
|
|
|
|
!0).fadeOut(200,function(){c(this).css("visibility","hidden").css("display","block");b.controlsAreVisible=!1;b.container.trigger("controlshidden")}),b.container.find(".mejs-control").stop(!0,!0).fadeOut(200,function(){c(this).css("visibility","hidden").css("display","block")})):(b.controls.css("visibility","hidden").css("display","block"),b.container.find(".mejs-control").css("visibility","hidden").css("display","block"),b.controlsAreVisible=!1,b.container.trigger("controlshidden")))},controlsTimer:null,
|
|
|
|
|
startControlsTimer:function(a){var b=this;a="undefined"!=typeof a?a:1500;b.killControlsTimer("start");b.controlsTimer=setTimeout(function(){b.hideControls();b.killControlsTimer("hide")},a)},killControlsTimer:function(a){null!==this.controlsTimer&&(clearTimeout(this.controlsTimer),delete this.controlsTimer,this.controlsTimer=null)},controlsEnabled:!0,disableControls:function(){this.killControlsTimer();this.hideControls(!1);this.controlsEnabled=!1},enableControls:function(){this.showControls(!1);this.controlsEnabled=
|
|
|
|
|
!0},meReady:function(a,b){var f,e,d=this,g=mejs.MediaFeatures,h=b.getAttribute("autoplay"),h=!("undefined"==typeof h||null===h||"false"===h);if(!d.created){if(d.created=!0,d.media=a,d.domNode=b,!(g.isAndroid&&d.options.AndroidUseNativeControls||g.isiPad&&d.options.iPadUseNativeControls||g.isiPhone&&d.options.iPhoneUseNativeControls)){d.buildposter(d,d.controls,d.layers,d.media);d.buildkeyboard(d,d.controls,d.layers,d.media);d.buildoverlays(d,d.controls,d.layers,d.media);d.findTracks();for(f in d.options.features)if(e=
|
|
|
|
|
d.options.features[f],d["build"+e])try{d["build"+e](d,d.controls,d.layers,d.media)}catch(l){}d.container.trigger("controlsready");d.setPlayerSize(d.width,d.height);d.setControlsSize();d.isVideo&&(mejs.MediaFeatures.hasTouch?d.$media.bind("touchstart",function(){d.controlsAreVisible?d.hideControls(!1):d.controlsEnabled&&d.showControls(!1)}):(d.clickToPlayPauseCallback=function(){d.options.clickToPlayPause&&(d.media.paused?d.play():d.pause())},d.media.addEventListener("click",d.clickToPlayPauseCallback,
|
|
|
|
|
!1),d.container.bind("mouseenter",function(){d.controlsEnabled&&(d.options.alwaysShowControls||(d.killControlsTimer("enter"),d.showControls(),d.startControlsTimer(2500)))}).bind("mousemove",function(){d.controlsEnabled&&(d.controlsAreVisible||d.showControls(),d.options.alwaysShowControls||d.startControlsTimer(2500))}).bind("mouseleave",function(){d.controlsEnabled&&(d.media.paused||d.options.alwaysShowControls||d.startControlsTimer(1E3))})),d.options.hideVideoControlsOnLoad&&d.hideControls(!1),h&&
|
|
|
|
|
!d.options.alwaysShowControls&&d.hideControls(),d.options.enableAutosize&&d.media.addEventListener("loadedmetadata",function(a){0>=d.options.videoHeight&&null===d.domNode.getAttribute("height")&&!isNaN(a.target.videoHeight)&&(d.setPlayerSize(a.target.videoWidth,a.target.videoHeight),d.setControlsSize(),d.media.setVideoSize(a.target.videoWidth,a.target.videoHeight))},!1));a.addEventListener("play",function(){for(var a in mejs.players){var b=mejs.players[a];b.id==d.id||!d.options.pauseOtherPlayers||
|
|
|
|
|
b.paused||b.ended||b.pause();b.hasFocus=!1}d.hasFocus=!0},!1);d.media.addEventListener("ended",function(a){if(d.options.autoRewind)try{d.media.setCurrentTime(0),window.setTimeout(function(){c(d.container).find(".mejs-overlay-loading").parent().hide()},20)}catch(b){}d.media.pause();d.setProgressRail&&d.setProgressRail();d.setCurrentRail&&d.setCurrentRail();d.options.loop?d.play():!d.options.alwaysShowControls&&d.controlsEnabled&&d.showControls()},!1);d.media.addEventListener("loadedmetadata",function(a){d.updateDuration&&
|
|
|
|
|
d.updateDuration();d.updateCurrent&&d.updateCurrent();d.isFullScreen||(d.setPlayerSize(d.width,d.height),d.setControlsSize())},!1);var k=null;d.media.addEventListener("timeupdate",function(){k!==this.duration&&(k=this.duration,mejs.Utility.calculateTimeFormat(k,d.options,d.options.framesPerSecond||25))},!1);d.container.focusout(function(a){a.relatedTarget&&(a=c(a.relatedTarget),d.keyboardAction&&0===a.parents(".mejs-container").length&&(d.keyboardAction=!1,d.hideControls(!0)))});setTimeout(function(){d.setPlayerSize(d.width,
|
|
|
|
|
d.height);d.setControlsSize()},50);d.globalBind("resize",function(){d.isFullScreen||mejs.MediaFeatures.hasTrueNativeFullScreen&&document.webkitIsFullScreen||d.setPlayerSize(d.width,d.height);d.setControlsSize()});"youtube"==d.media.pluginType&&(g.isiOS||g.isAndroid)&&d.container.find(".mejs-overlay-play").hide()}h&&"native"==a.pluginType&&d.play();d.options.success&&("string"==typeof d.options.success?window[d.options.success](d.media,d.domNode,d):d.options.success(d.media,d.domNode,d))}},handleError:function(a){this.controls.hide();
|
|
|
|
|
this.options.error&&this.options.error(a)},setPlayerSize:function(a,b){if(!this.options.setDimensions)return!1;if("undefined"!=typeof a&&(this.width=a),"undefined"!=typeof b&&(this.height=b),0<this.height.toString().indexOf("%")||"none"!==this.$node.css("max-width")&&"t.width"!==this.$node.css("max-width")||this.$node[0].currentStyle&&"100%"===this.$node[0].currentStyle.maxWidth){var f=this.isVideo?this.media.videoWidth&&0<this.media.videoWidth?this.media.videoWidth:null!==this.media.getAttribute("width")?
|
|
|
|
|
this.media.getAttribute("width"):this.options.defaultVideoWidth:this.options.defaultAudioWidth,e=this.isVideo?this.media.videoHeight&&0<this.media.videoHeight?this.media.videoHeight:null!==this.media.getAttribute("height")?this.media.getAttribute("height"):this.options.defaultVideoHeight:this.options.defaultAudioHeight,d=this.container.parent().closest(":visible").width(),g=this.container.parent().closest(":visible").height(),f=this.isVideo||!this.options.autosizeProgress?parseInt(d*e/f,10):e;isNaN(f)&&
|
|
|
|
|
(f=g);0<this.container.parent().length&&"body"===this.container.parent()[0].tagName.toLowerCase()&&(d=c(window).width(),f=c(window).height());f&&d&&(this.container.width(d).height(f),this.$media.add(this.container.find(".mejs-shim")).width("100%").height("100%"),this.isVideo&&this.media.setVideoSize&&this.media.setVideoSize(d,f),this.layers.children(".mejs-layer").width("100%").height("100%"))}else this.container.width(this.width).height(this.height),this.layers.children(".mejs-layer").width(this.width).height(this.height)},
|
|
|
|
|
setControlsSize:function(){var a=0,b=0,f=this.controls.find(".mejs-time-rail"),e=this.controls.find(".mejs-time-total"),d=f.siblings(),g=d.last(),h=null;if(this.container.is(":visible")&&f.length&&f.is(":visible")){this.options&&!this.options.autosizeProgress&&(b=parseInt(f.css("width"),10));0!==b&&b||(d.each(function(){var b=c(this);"absolute"!=b.css("position")&&b.is(":visible")&&(a+=c(this).outerWidth(!0))}),b=this.controls.width()-a-(f.outerWidth(!0)-f.width()));do f.width(b),e.width(b-(e.outerWidth(!0)-
|
|
|
|
|
e.width())),"absolute"!=g.css("position")&&(h=g.length?g.position():null,b--);while(null!==h&&0<h.top&&0<b);this.container.trigger("controlsresize")}},buildposter:function(a,b,f,e){var d=c('<div class="mejs-poster mejs-layer"></div>').appendTo(f);b=a.$media.attr("poster");""!==a.options.poster&&(b=a.options.poster);b?this.setPoster(b):d.hide();e.addEventListener("play",function(){d.hide()},!1);a.options.showPosterWhenEnded&&a.options.autoRewind&&e.addEventListener("ended",function(){d.show()},!1)},
|
|
|
|
|
setPoster:function(a){var b=this.container.find(".mejs-poster"),f=b.find("img");0===f.length&&(f=c('<img width="100%" height="100%" alt="" />').appendTo(b));f.attr("src",a);b.css({"background-image":"url("+a+")"})},buildoverlays:function(a,b,f,e){var d=this;if(a.isVideo){var g=c('<div class="mejs-overlay mejs-layer"><div class="mejs-overlay-loading"><span></span></div></div>').hide().appendTo(f),h=c('<div class="mejs-overlay mejs-layer"><div class="mejs-overlay-error"></div></div>').hide().appendTo(f),
|
|
|
|
|
k=c('<div class="mejs-overlay mejs-layer mejs-overlay-play"><div class="mejs-overlay-button"></div></div>').appendTo(f).bind("click",function(){d.options.clickToPlayPause&&e.paused&&e.play()});e.addEventListener("play",function(){k.hide();g.hide();b.find(".mejs-time-buffering").hide();h.hide()},!1);e.addEventListener("playing",function(){k.hide();g.hide();b.find(".mejs-time-buffering").hide();h.hide()},!1);e.addEventListener("seeking",function(){g.show();b.find(".mejs-time-buffering").show()},!1);
|
|
|
|
|
e.addEventListener("seeked",function(){g.hide();b.find(".mejs-time-buffering").hide()},!1);e.addEventListener("pause",function(){mejs.MediaFeatures.isiPhone||k.show()},!1);e.addEventListener("waiting",function(){g.show();b.find(".mejs-time-buffering").show()},!1);e.addEventListener("loadeddata",function(){g.show();b.find(".mejs-time-buffering").show();mejs.MediaFeatures.isAndroid&&(e.canplayTimeout=window.setTimeout(function(){if(document.createEvent){var a=document.createEvent("HTMLEvents");return a.initEvent("canplay",
|
|
|
|
|
!0,!0),e.dispatchEvent(a)}},300))},!1);e.addEventListener("canplay",function(){g.hide();b.find(".mejs-time-buffering").hide();clearTimeout(e.canplayTimeout)},!1);e.addEventListener("error",function(a){d.handleError(a);g.hide();k.hide();h.show();h.find(".mejs-overlay-error").html("Error loading this resource")},!1);e.addEventListener("keydown",function(b){d.onkeydown(a,e,b)},!1)}},buildkeyboard:function(a,b,f,e){var d=this;d.container.keydown(function(){d.keyboardAction=!0});d.globalBind("keydown",
|
|
|
|
|
function(b){return a.hasFocus=0!==c(b.target).closest(".mejs-container").length,d.onkeydown(a,e,b)});d.globalBind("click",function(b){a.hasFocus=0!==c(b.target).closest(".mejs-container").length})},onkeydown:function(a,b,c){if(a.hasFocus&&a.options.enableKeyboard)for(var e=0,d=a.options.keyActions.length;d>e;e++)for(var g=a.options.keyActions[e],h=0,k=g.keys.length;k>h;h++)if(c.keyCode==g.keys[h])return"function"==typeof c.preventDefault&&c.preventDefault(),g.action(a,b,c.keyCode),!1;return!0},findTracks:function(){var a=
|
|
|
|
|
this,b=a.$media.find("track");a.tracks=[];b.each(function(b,e){e=c(e);a.tracks.push({srclang:e.attr("srclang")?e.attr("srclang").toLowerCase():"",src:e.attr("src"),kind:e.attr("kind"),label:e.attr("label")||"",entries:[],isLoaded:!1})})},changeSkin:function(a){this.container[0].className="mejs-container "+a;this.setPlayerSize(this.width,this.height);this.setControlsSize()},play:function(){this.load();this.media.play()},pause:function(){try{this.media.pause()}catch(a){}},load:function(){this.isLoaded||
|
|
|
|
|
this.media.load();this.isLoaded=!0},setMuted:function(a){this.media.setMuted(a)},setCurrentTime:function(a){this.media.setCurrentTime(a)},getCurrentTime:function(){return this.media.currentTime},setVolume:function(a){this.media.setVolume(a)},getVolume:function(){return this.media.volume},setSrc:function(a){this.media.setSrc(a)},remove:function(){var a,b;this.container.prev(".mejs-offscreen").remove();for(a in this.options.features)if(b=this.options.features[a],this["clean"+b])try{this["clean"+b](this)}catch(c){}this.isDynamic?
|
|
|
|
|
this.$node.insertBefore(this.container):(this.$media.prop("controls",!0),this.$node.clone().insertBefore(this.container).show(),this.$node.remove());"native"!==this.media.pluginType&&this.media.remove();delete mejs.players[this.id];"object"==typeof this.container&&this.container.remove();this.globalUnbind();delete this.node.player},rebuildtracks:function(){this.findTracks();this.buildtracks(this,this.controls,this.layers,this.media)},resetSize:function(){var a=this;setTimeout(function(){a.setPlayerSize(a.width,
|
|
|
|
|
a.height);a.setControlsSize()},50)}};(function(){function a(a,e){var d={d:[],w:[]};return c.each((a||"").split(" "),function(a,c){var f=c+"."+e;0===f.indexOf(".")?(d.d.push(f),d.w.push(f)):d[b.test(c)?"w":"d"].push(f)}),d.d=d.d.join(" "),d.w=d.w.join(" "),d}var b=/^((after|before)print|(before)?unload|hashchange|message|o(ff|n)line|page(hide|show)|popstate|resize|storage)\b/;mejs.MediaElementPlayer.prototype.globalBind=function(b,e,d){var g=this.node?this.node.ownerDocument:document;b=a(b,this.id);
|
|
|
|
|
b.d&&c(g).bind(b.d,e,d);b.w&&c(window).bind(b.w,e,d)};mejs.MediaElementPlayer.prototype.globalUnbind=function(b,e){var d=this.node?this.node.ownerDocument:document;b=a(b,this.id);b.d&&c(d).unbind(b.d,e);b.w&&c(window).unbind(b.w,e)}})();"undefined"!=typeof c&&(c.fn.mediaelementplayer=function(a){return!1===a?this.each(function(){var a=c(this).data("mediaelementplayer");a&&a.remove();c(this).removeData("mediaelementplayer")}):this.each(function(){c(this).data("mediaelementplayer",new mejs.MediaElementPlayer(this,
|
|
|
|
|
a))}),this},c(document).ready(function(){c(".mejs-player").mediaelementplayer()}));window.MediaElementPlayer=mejs.MediaElementPlayer})(mejs.$);
|
|
|
|
|
(function(c){c.extend(mejs.MepDefaults,{playText:mejs.i18n.t("Play"),pauseText:mejs.i18n.t("Pause")});c.extend(MediaElementPlayer.prototype,{buildplaypause:function(a,b,f,e){function d(a){"play"===a?(h.removeClass("mejs-play").addClass("mejs-pause"),k.attr({title:g.pauseText,"aria-label":g.pauseText})):(h.removeClass("mejs-pause").addClass("mejs-play"),k.attr({title:g.playText,"aria-label":g.playText}))}var g=this.options,h=c('<div class="mejs-button mejs-playpause-button mejs-play" ><button type="button" aria-controls="'+
|
|
|
|
|
this.id+'" title="'+g.playText+'" aria-label="'+g.playText+'"></button></div>').appendTo(b).click(function(a){return a.preventDefault(),e.paused?e.play():e.pause(),!1}),k=h.find("button");d("pse");e.addEventListener("play",function(){d("play")},!1);e.addEventListener("playing",function(){d("play")},!1);e.addEventListener("pause",function(){d("pse")},!1);e.addEventListener("paused",function(){d("pse")},!1)}})})(mejs.$);
|
|
|
|
|
(function(c){c.extend(mejs.MepDefaults,{stopText:"Stop"});c.extend(MediaElementPlayer.prototype,{buildstop:function(a,b,f,e){c('<div class="mejs-button mejs-stop-button mejs-stop"><button type="button" aria-controls="'+this.id+'" title="'+this.options.stopText+'" aria-label="'+this.options.stopText+'"></button></div>').appendTo(b).click(function(){e.paused||e.pause();0<e.currentTime&&(e.setCurrentTime(0),e.pause(),b.find(".mejs-time-current").width("0px"),b.find(".mejs-time-handle").css("left","0px"),
|
|
|
|
|
b.find(".mejs-time-float-current").html(mejs.Utility.secondsToTimeCode(0,a.options)),b.find(".mejs-currenttime").html(mejs.Utility.secondsToTimeCode(0,a.options)),f.find(".mejs-poster").show())})}})})(mejs.$);
|
|
|
|
|
(function(c){c.extend(mejs.MepDefaults,{progessHelpText:mejs.i18n.t("Use Left/Right Arrow keys to advance one second, Up/Down arrows to advance ten seconds.")});c.extend(MediaElementPlayer.prototype,{buildprogress:function(a,b,f,e){c('<div class="mejs-time-rail"><span class="mejs-time-total mejs-time-slider"><span class="mejs-time-buffering"></span><span class="mejs-time-loaded"></span><span class="mejs-time-current"></span><span class="mejs-time-handle"></span><span class="mejs-time-float"><span class="mejs-time-float-current">00:00</span><span class="mejs-time-float-corner"></span></span></span></div>').appendTo(b);b.find(".mejs-time-buffering").hide();
|
|
|
|
|
var d=this,g=b.find(".mejs-time-total");f=b.find(".mejs-time-loaded");var h=b.find(".mejs-time-current"),k=b.find(".mejs-time-handle"),l=b.find(".mejs-time-float"),n=b.find(".mejs-time-float-current"),m=b.find(".mejs-time-slider"),p=function(b){var d=g.offset(),c=g.width(),f=0,h=0,k=0;b=b.originalEvent&&b.originalEvent.changedTouches?b.originalEvent.changedTouches[0].pageX:b.changedTouches?b.changedTouches[0].pageX:b.pageX;e.duration&&(b<d.left?b=d.left:b>c+d.left&&(b=c+d.left),k=b-d.left,f=k/c,h=
|
|
|
|
|
.02>=f?0:f*e.duration,q&&h!==e.currentTime&&e.setCurrentTime(h),mejs.MediaFeatures.hasTouch||(l.css("left",k),n.html(mejs.Utility.secondsToTimeCode(h,a.options)),l.show()))},q=!1,u=0,t=!1,r=a.options.autoRewind,v=function(){1E3<=new Date-u&&e.play()};m.bind("focus",function(b){a.options.autoRewind=!1});m.bind("blur",function(b){a.options.autoRewind=r});m.bind("keydown",function(a){1E3<=new Date-u&&(t=e.paused);var b=e.duration,d=e.currentTime;switch(a.keyCode){case 37:--d;break;case 39:d+=1;break;
|
|
|
|
|
case 38:d+=Math.floor(.1*b);break;case 40:d-=Math.floor(.1*b);break;case 36:d=0;break;case 35:d=b;break;case 10:return void(e.paused?e.play():e.pause());case 13:return void(e.paused?e.play():e.pause());default:return}return d=0>d?0:d>=b?b:Math.floor(d),u=new Date,t||e.pause(),d<e.duration&&!t&&setTimeout(v,1100),e.setCurrentTime(d),a.preventDefault(),a.stopPropagation(),!1});g.bind("mousedown touchstart",function(a){1!==a.which&&0!==a.which||(q=!0,p(a),d.globalBind("mousemove.dur touchmove.dur",function(a){p(a)}),
|
|
|
|
|
d.globalBind("mouseup.dur touchend.dur",function(a){q=!1;l.hide();d.globalUnbind(".dur")}))}).bind("mouseenter",function(a){d.globalBind("mousemove.dur",function(a){p(a)});mejs.MediaFeatures.hasTouch||l.show()}).bind("mouseleave",function(a){q||(d.globalUnbind(".dur"),l.hide())});e.addEventListener("progress",function(b){a.setProgressRail(b);a.setCurrentRail(b)},!1);e.addEventListener("timeupdate",function(b){a.setProgressRail(b);a.setCurrentRail(b);b=e.currentTime;var d=mejs.i18n.t("Time Slider"),
|
|
|
|
|
c=mejs.Utility.secondsToTimeCode(b,a.options);m.attr({"aria-label":d,"aria-valuemin":0,"aria-valuemax":e.duration,"aria-valuenow":b,"aria-valuetext":c,role:"slider",tabindex:0})},!1);d.container.on("controlsresize",function(){a.setProgressRail();a.setCurrentRail()});d.loaded=f;d.total=g;d.current=h;d.handle=k},setProgressRail:function(a){var b=void 0!==a?a.target:this.media,c=null;b&&b.buffered&&0<b.buffered.length&&b.buffered.end&&b.duration?c=b.buffered.end(b.buffered.length-1)/b.duration:b&&void 0!==
|
|
|
|
|
b.bytesTotal&&0<b.bytesTotal&&void 0!==b.bufferedBytes?c=b.bufferedBytes/b.bytesTotal:a&&a.lengthComputable&&0!==a.total&&(c=a.loaded/a.total);null!==c&&(c=Math.min(1,Math.max(0,c)),this.loaded&&this.total&&this.loaded.width(this.total.width()*c))},setCurrentRail:function(){if(void 0!==this.media.currentTime&&this.media.duration&&this.total&&this.handle){var a=Math.round(this.total.width()*this.media.currentTime/this.media.duration),b=a-Math.round(this.handle.outerWidth(!0)/2);this.current.width(a);
|
|
|
|
|
this.handle.css("left",b)}}})})(mejs.$);
|
|
|
|
|
(function(c){c.extend(mejs.MepDefaults,{duration:-1,timeAndDurationSeparator:"<span> | </span>"});c.extend(MediaElementPlayer.prototype,{buildcurrent:function(a,b,f,e){c('<div class="mejs-time" role="timer" aria-live="off"><span class="mejs-currenttime">'+mejs.Utility.secondsToTimeCode(0,a.options)+"</span></div>").appendTo(b);this.currenttime=this.controls.find(".mejs-currenttime");e.addEventListener("timeupdate",function(){a.updateCurrent()},!1)},buildduration:function(a,b,f,e){0<b.children().last().find(".mejs-currenttime").length?
|
|
|
|
|
c(this.options.timeAndDurationSeparator+'<span class="mejs-duration">'+mejs.Utility.secondsToTimeCode(this.options.duration,this.options)+"</span>").appendTo(b.find(".mejs-time")):(b.find(".mejs-currenttime").parent().addClass("mejs-currenttime-container"),c('<div class="mejs-time mejs-duration-container"><span class="mejs-duration">'+mejs.Utility.secondsToTimeCode(this.options.duration,this.options)+"</span></div>").appendTo(b));this.durationD=this.controls.find(".mejs-duration");e.addEventListener("timeupdate",
|
|
|
|
|
function(){a.updateDuration()},!1)},updateCurrent:function(){this.currenttime&&this.currenttime.html(mejs.Utility.secondsToTimeCode(this.media.currentTime,this.options))},updateDuration:function(){this.container.toggleClass("mejs-long-video",3600<this.media.duration);this.durationD&&(0<this.options.duration||this.media.duration)&&this.durationD.html(mejs.Utility.secondsToTimeCode(0<this.options.duration?this.options.duration:this.media.duration,this.options))}})})(mejs.$);
|
|
|
|
|
(function(c){c.extend(mejs.MepDefaults,{muteText:mejs.i18n.t("Mute Toggle"),allyVolumeControlText:mejs.i18n.t("Use Up/Down Arrow keys to increase or decrease volume."),hideVolumeOnTouchDevices:!0,audioVolume:"horizontal",videoVolume:"vertical"});c.extend(MediaElementPlayer.prototype,{buildvolume:function(a,b,f,e){if(!mejs.MediaFeatures.isAndroid&&!mejs.MediaFeatures.isiOS||!this.options.hideVolumeOnTouchDevices){var d=this,g=d.isVideo?d.options.videoVolume:d.options.audioVolume,h="horizontal"==g?
|
|
|
|
|
c('<div class="mejs-button mejs-volume-button mejs-mute"><button type="button" aria-controls="'+d.id+'" title="'+d.options.muteText+'" aria-label="'+d.options.muteText+'"></button></div><a href="javascript:void(0);" class="mejs-horizontal-volume-slider"><span class="mejs-offscreen">'+d.options.allyVolumeControlText+'</span><div class="mejs-horizontal-volume-total"></div><div class="mejs-horizontal-volume-current"></div><div class="mejs-horizontal-volume-handle"></div></a>').appendTo(b):c('<div class="mejs-button mejs-volume-button mejs-mute"><button type="button" aria-controls="'+
|
|
|
|
|
d.id+'" title="'+d.options.muteText+'" aria-label="'+d.options.muteText+'"></button><a href="javascript:void(0);" class="mejs-volume-slider"><span class="mejs-offscreen">'+d.options.allyVolumeControlText+'</span><div class="mejs-volume-total"></div><div class="mejs-volume-current"></div><div class="mejs-volume-handle"></div></a></div>').appendTo(b),k=d.container.find(".mejs-volume-slider, .mejs-horizontal-volume-slider"),l=d.container.find(".mejs-volume-total, .mejs-horizontal-volume-total"),n=d.container.find(".mejs-volume-current, .mejs-horizontal-volume-current"),
|
|
|
|
|
m=d.container.find(".mejs-volume-handle, .mejs-horizontal-volume-handle"),p=function(a,b){if(!k.is(":visible")&&"undefined"==typeof b)return k.show(),p(a,!0),void k.hide();a=Math.max(0,a);a=Math.min(a,1);0===a?(h.removeClass("mejs-mute").addClass("mejs-unmute"),h.children("button").attr("title",mejs.i18n.t("Unmute")).attr("aria-label",mejs.i18n.t("Unmute"))):(h.removeClass("mejs-unmute").addClass("mejs-mute"),h.children("button").attr("title",mejs.i18n.t("Mute")).attr("aria-label",mejs.i18n.t("Mute")));
|
|
|
|
|
var d=l.position();if("vertical"==g){var c=l.height(),e=c-c*a;m.css("top",Math.round(d.top+e-m.height()/2));n.height(c-e);n.css("top",d.top+e)}else c=l.width()*a,m.css("left",Math.round(d.left+c-m.width()/2)),n.width(Math.round(c))},q=function(a){var b=null,d=l.offset();if("vertical"===g){if(b=l.height(),b=(b-(a.pageY-d.top))/b,0===d.top||0===d.left)return}else b=l.width(),b=(a.pageX-d.left)/b;b=Math.max(0,b);b=Math.min(b,1);p(b);0===b?e.setMuted(!0):e.setMuted(!1);e.setVolume(b)},u=!1,t=!1;h.hover(function(){k.show();
|
|
|
|
|
t=!0},function(){t=!1;u||"vertical"!=g||k.hide()});k.bind("mouseover",function(){t=!0}).bind("mousedown",function(a){return q(a),d.globalBind("mousemove.vol",function(a){q(a)}),d.globalBind("mouseup.vol",function(){u=!1;d.globalUnbind(".vol");t||"vertical"!=g||k.hide()}),u=!0,!1}).bind("keydown",function(a){var b=e.volume;switch(a.keyCode){case 38:b+=.1;break;case 40:b-=.1;break;default:return!0}return u=!1,p(b),e.setVolume(b),!1});h.find("button").click(function(){e.setMuted(!e.muted)});h.find("button").bind("focus",
|
|
|
|
|
function(){k.show()});e.addEventListener("volumechange",function(a){u||(e.muted?(p(0),h.removeClass("mejs-mute").addClass("mejs-unmute")):(p(e.volume),h.removeClass("mejs-unmute").addClass("mejs-mute")));a=Math.floor(100*e.volume);k.attr({"aria-label":mejs.i18n.t("volumeSlider"),"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":a,"aria-valuetext":a+"%",role:"slider",tabindex:0})},!1);0===a.options.startVolume&&e.setMuted(!0);"native"===e.pluginType&&e.setVolume(a.options.startVolume);d.container.on("controlsresize",
|
|
|
|
|
function(){p(e.volume)})}}})})(mejs.$);
|
|
|
|
|
(function(c){c.extend(mejs.MepDefaults,{usePluginFullScreen:!0,newWindowCallback:function(){return""},fullscreenText:mejs.i18n.t("Fullscreen")});c.extend(MediaElementPlayer.prototype,{isFullScreen:!1,isNativeFullScreen:!1,isInIframe:!1,buildfullscreen:function(a,b,f,e){if(a.isVideo){(a.isInIframe=window.location!=window.parent.location,mejs.MediaFeatures.hasTrueNativeFullScreen)&&a.globalBind(mejs.MediaFeatures.fullScreenEventName,function(b){a.isFullScreen&&(mejs.MediaFeatures.isFullScreen()?(a.isNativeFullScreen=
|
|
|
|
|
!0,a.setControlsSize()):(a.isNativeFullScreen=!1,a.exitFullScreen()))});var d=this,g=c('<div class="mejs-button mejs-fullscreen-button"><button type="button" aria-controls="'+d.id+'" title="'+d.options.fullscreenText+'" aria-label="'+d.options.fullscreenText+'"></button></div>').appendTo(b);if("native"===d.media.pluginType||!d.options.usePluginFullScreen&&!mejs.MediaFeatures.isFirefox)g.click(function(){mejs.MediaFeatures.hasTrueNativeFullScreen&&mejs.MediaFeatures.isFullScreen()||a.isFullScreen?
|
|
|
|
|
a.exitFullScreen():a.enterFullScreen()});else{var h=null;if(function(){var a,b=document.createElement("x"),d=document.documentElement,c=window.getComputedStyle;return"pointerEvents"in b.style?(b.style.pointerEvents="auto",b.style.pointerEvents="x",d.appendChild(b),a=c&&"auto"===c(b,"").pointerEvents,d.removeChild(b),!!a):!1}()&&!mejs.MediaFeatures.isOpera){var k,l=!1,n=function(){if(l){for(var a in m)m[a].hide();g.css("pointer-events","");d.controls.css("pointer-events","");d.media.removeEventListener("click",
|
|
|
|
|
d.clickToPlayPauseCallback);l=!1}},m={};f=["top","left","right","bottom"];var p=function(){var a=g.offset().left-d.container.offset().left,b=g.offset().top-d.container.offset().top,c=g.outerWidth(!0),e=g.outerHeight(!0),f=d.container.width(),h=d.container.height();for(k in m)m[k].css({position:"absolute",top:0,left:0});m.top.width(f).height(b);m.left.width(a).height(e).css({top:b});m.right.width(f-a-c).height(e).css({top:b,left:a+c});m.bottom.width(f).height(h-e-b).css({top:b+e})};d.globalBind("resize",
|
|
|
|
|
function(){p()});k=0;for(b=f.length;b>k;k++)m[f[k]]=c('<div class="mejs-fullscreen-hover" />').appendTo(d.container).mouseover(n).hide();g.on("mouseover",function(){if(!d.isFullScreen){var b=g.offset(),c=a.container.offset();e.positionFullscreenButton(b.left-c.left,b.top-c.top,!1);g.css("pointer-events","none");d.controls.css("pointer-events","none");d.media.addEventListener("click",d.clickToPlayPauseCallback);for(k in m)m[k].show();p();l=!0}});e.addEventListener("fullscreenchange",function(a){d.isFullScreen=
|
|
|
|
|
!d.isFullScreen;d.isFullScreen?d.media.removeEventListener("click",d.clickToPlayPauseCallback):d.media.addEventListener("click",d.clickToPlayPauseCallback);n()});d.globalBind("mousemove",function(a){if(l){var b=g.offset();(a.pageY<b.top||a.pageY>b.top+g.outerHeight(!0)||a.pageX<b.left||a.pageX>b.left+g.outerWidth(!0))&&(g.css("pointer-events",""),d.controls.css("pointer-events",""),l=!1)}})}else g.on("mouseover",function(){null!==h&&(clearTimeout(h),delete h);var b=g.offset(),d=a.container.offset();
|
|
|
|
|
e.positionFullscreenButton(b.left-d.left,b.top-d.top,!0)}).on("mouseout",function(){null!==h&&(clearTimeout(h),delete h);h=setTimeout(function(){e.hideFullscreenButton()},1500)})}a.fullscreenBtn=g;d.globalBind("keydown",function(b){(mejs.MediaFeatures.hasTrueNativeFullScreen&&mejs.MediaFeatures.isFullScreen()||d.isFullScreen)&&27==b.keyCode&&a.exitFullScreen()});d.normalHeight=0;d.normalWidth=0}},cleanfullscreen:function(a){a.exitFullScreen()},containerSizeTimeout:null,enterFullScreen:function(){var a=
|
|
|
|
|
this;if("native"===a.media.pluginType||!mejs.MediaFeatures.isFirefox&&!a.options.usePluginFullScreen){if(c(document.documentElement).addClass("mejs-fullscreen"),a.normalHeight=a.container.height(),a.normalWidth=a.container.width(),"native"===a.media.pluginType)if(mejs.MediaFeatures.hasTrueNativeFullScreen)mejs.MediaFeatures.requestFullScreen(a.container[0]),a.isInIframe&&setTimeout(function e(){if(a.isNativeFullScreen){var b=window.devicePixelRatio||1,g=b*c(window).width(),h=screen.width,b=b*g;Math.abs(h-
|
|
|
|
|
g)>Math.abs(h-b)&&(g=b);Math.abs(h-g)>.002*h?a.exitFullScreen():setTimeout(e,500)}},1E3);else if(mejs.MediaFeatures.hasSemiNativeFullScreen)return void a.media.webkitEnterFullscreen();if(a.isInIframe){var b=a.options.newWindowCallback(this);if(""!==b){if(!mejs.MediaFeatures.hasTrueNativeFullScreen)return a.pause(),void window.open(b,a.id,"top=0,left=0,width="+screen.availWidth+",height="+screen.availHeight+",resizable=yes,scrollbars=no,status=no,toolbar=no");setTimeout(function(){a.isNativeFullScreen||
|
|
|
|
|
(a.pause(),window.open(b,a.id,"top=0,left=0,width="+screen.availWidth+",height="+screen.availHeight+",resizable=yes,scrollbars=no,status=no,toolbar=no"))},250)}}a.container.addClass("mejs-container-fullscreen").width("100%").height("100%");a.containerSizeTimeout=setTimeout(function(){a.container.css({width:"100%",height:"100%"});a.setControlsSize()},500);"native"===a.media.pluginType?a.$media.width("100%").height("100%"):(a.container.find(".mejs-shim").width("100%").height("100%"),a.media.setVideoSize(c(window).width(),
|
|
|
|
|
c(window).height()));a.layers.children("div").width("100%").height("100%");a.fullscreenBtn&&a.fullscreenBtn.removeClass("mejs-fullscreen").addClass("mejs-unfullscreen");a.setControlsSize();a.isFullScreen=!0;a.container.find(".mejs-captions-text").css("font-size",screen.width/a.width*100+"%");a.container.find(".mejs-captions-position").css("bottom","45px");a.container.trigger("enteredfullscreen")}},exitFullScreen:function(){return clearTimeout(this.containerSizeTimeout),"native"!==this.media.pluginType&&
|
|
|
|
|
mejs.MediaFeatures.isFirefox?void this.media.setFullscreen(!1):(mejs.MediaFeatures.hasTrueNativeFullScreen&&(mejs.MediaFeatures.isFullScreen()||this.isFullScreen)&&mejs.MediaFeatures.cancelFullScreen(),c(document.documentElement).removeClass("mejs-fullscreen"),this.container.removeClass("mejs-container-fullscreen").width(this.normalWidth).height(this.normalHeight),"native"===this.media.pluginType?this.$media.width(this.normalWidth).height(this.normalHeight):(this.container.find(".mejs-shim").width(this.normalWidth).height(this.normalHeight),
|
|
|
|
|
this.media.setVideoSize(this.normalWidth,this.normalHeight)),this.layers.children("div").width(this.normalWidth).height(this.normalHeight),this.fullscreenBtn.removeClass("mejs-unfullscreen").addClass("mejs-fullscreen"),this.setControlsSize(),this.isFullScreen=!1,this.container.find(".mejs-captions-text").css("font-size",""),this.container.find(".mejs-captions-position").css("bottom",""),void this.container.trigger("exitedfullscreen"))}})})(mejs.$);
|
|
|
|
|
(function(c){c.extend(mejs.MepDefaults,{speeds:["2.00","1.50","1.25","1.00","0.75"],defaultSpeed:"1.00",speedChar:"x"});c.extend(MediaElementPlayer.prototype,{buildspeed:function(a,b,f,e){if("native"==this.media.pluginType){var d=null,g=null,h=null;a=null;var k=[];a=!1;for(var l=0,n=this.options.speeds.length;n>l;l++)f=this.options.speeds[l],"string"==typeof f?(k.push({name:f+this.options.speedChar,value:f}),f===this.options.defaultSpeed&&(a=!0)):(k.push(f),f.value===this.options.defaultSpeed&&(a=
|
|
|
|
|
!0));a||k.push({name:this.options.defaultSpeed+this.options.speedChar,value:this.options.defaultSpeed});k.sort(function(a,b){return parseFloat(b.value)-parseFloat(a.value)});var m=function(a){l=0;for(n=k.length;n>l;l++)if(k[l].value===a)return k[l].name};f='<div class="mejs-button mejs-speed-button"><button type="button">'+m(this.options.defaultSpeed)+'</button><div class="mejs-speed-selector"><ul>';l=0;for(il=k.length;l<il;l++)a=this.id+"-speed-"+k[l].value,f+='<li><input type="radio" name="speed" value="'+
|
|
|
|
|
k[l].value+'" id="'+a+'" '+(k[l].value===this.options.defaultSpeed?" checked":"")+' /><label for="'+a+'" '+(k[l].value===this.options.defaultSpeed?' class="mejs-speed-selected"':"")+">"+k[l].name+"</label></li>";d=c(f+"</ul></div></div>").appendTo(b);g=d.find(".mejs-speed-selector");h=this.options.defaultSpeed;e.addEventListener("loadedmetadata",function(a){h&&(e.playbackRate=parseFloat(h))},!0);g.on("click",'input[type="radio"]',function(){var a=c(this).attr("value");h=a;e.playbackRate=parseFloat(a);
|
|
|
|
|
d.find("button").html(m(a));d.find(".mejs-speed-selected").removeClass("mejs-speed-selected");d.find('input[type="radio"]:checked').next().addClass("mejs-speed-selected")});d.one("mouseenter focusin",function(){g.height(d.find(".mejs-speed-selector ul").outerHeight(!0)+d.find(".mejs-speed-translations").outerHeight(!0)).css("top",-1*g.height()+"px")})}}})})(mejs.$);
|
|
|
|
|
(function(c){c.extend(mejs.MepDefaults,{startLanguage:"",tracksText:mejs.i18n.t("Captions/Subtitles"),tracksAriaLive:!1,hideCaptionsButtonWhenEmpty:!0,toggleCaptionsButtonWhenOnlyOne:!1,slidesSelector:""});c.extend(MediaElementPlayer.prototype,{hasChapters:!1,cleartracks:function(a,b,c,e){a&&(a.captions&&a.captions.remove(),a.chapters&&a.chapters.remove(),a.captionsText&&a.captionsText.remove(),a.captionsButton&&a.captionsButton.remove())},buildtracks:function(a,b,f,e){if(0!==a.tracks.length){var d,
|
|
|
|
|
g=this,h=g.options.tracksAriaLive?'role="log" aria-live="assertive" aria-atomic="false"':"";if(g.domNode.textTracks)for(d=g.domNode.textTracks.length-1;0<=d;d--)g.domNode.textTracks[d].mode="hidden";g.cleartracks(a,b,f,e);a.chapters=c('<div class="mejs-chapters mejs-layer"></div>').prependTo(f).hide();a.captions=c('<div class="mejs-captions-layer mejs-layer"><div class="mejs-captions-position mejs-captions-position-hover" '+h+'><span class="mejs-captions-text"></span></div></div>').prependTo(f).hide();
|
|
|
|
|
a.captionsText=a.captions.find(".mejs-captions-text");a.captionsButton=c('<div class="mejs-button mejs-captions-button"><button type="button" aria-controls="'+g.id+'" title="'+g.options.tracksText+'" aria-label="'+g.options.tracksText+'"></button><div class="mejs-captions-selector"><ul><li><input type="radio" name="'+a.id+'_captions" id="'+a.id+'_captions_none" value="none" checked="checked" /><label for="'+a.id+'_captions_none">'+mejs.i18n.t("None")+"</label></li></ul></div></div>").appendTo(b);
|
|
|
|
|
for(d=b=0;d<a.tracks.length;d++)"subtitles"==a.tracks[d].kind&&b++;g.options.toggleCaptionsButtonWhenOnlyOne&&1==b?a.captionsButton.on("click",function(){null===a.selectedTrack?lang=a.tracks[0].srclang:lang="none";a.setTrack(lang)}):(a.captionsButton.on("mouseenter focusin",function(){c(this).find(".mejs-captions-selector").css("visibility","visible")}).on("click","input[type=radio]",function(){lang=this.value;a.setTrack(lang)}),a.captionsButton.on("mouseleave focusout",function(){c(this).find(".mejs-captions-selector").css("visibility",
|
|
|
|
|
"hidden")}));a.options.alwaysShowControls?a.container.find(".mejs-captions-position").addClass("mejs-captions-position-hover"):a.container.bind("controlsshown",function(){a.container.find(".mejs-captions-position").addClass("mejs-captions-position-hover")}).bind("controlshidden",function(){e.paused||a.container.find(".mejs-captions-position").removeClass("mejs-captions-position-hover")});a.trackToLoad=-1;a.selectedTrack=null;a.isLoadingTrack=!1;for(d=0;d<a.tracks.length;d++)"subtitles"==a.tracks[d].kind&&
|
|
|
|
|
a.addTrackButton(a.tracks[d].srclang,a.tracks[d].label);a.loadNextTrack();e.addEventListener("timeupdate",function(b){a.displayCaptions()},!1);""!==a.options.slidesSelector&&(a.slidesContainer=c(a.options.slidesSelector),e.addEventListener("timeupdate",function(b){a.displaySlides()},!1));e.addEventListener("loadedmetadata",function(b){a.displayChapters()},!1);a.container.hover(function(){a.hasChapters&&(a.chapters.css("visibility","visible"),a.chapters.fadeIn(200).height(a.chapters.find(".mejs-chapter").outerHeight()))},
|
|
|
|
|
function(){a.hasChapters&&!e.paused&&a.chapters.fadeOut(200,function(){c(this).css("visibility","hidden");c(this).css("display","block")})});g.container.on("controlsresize",function(){g.adjustLanguageBox()});null!==a.node.getAttribute("autoplay")&&a.chapters.css("visibility","hidden")}},setTrack:function(a){var b;if("none"==a)this.selectedTrack=null,this.captionsButton.removeClass("mejs-captions-enabled");else for(b=0;b<this.tracks.length;b++)if(this.tracks[b].srclang==a){null===this.selectedTrack&&
|
|
|
|
|
this.captionsButton.addClass("mejs-captions-enabled");this.selectedTrack=this.tracks[b];this.captions.attr("lang",this.selectedTrack.srclang);this.displayCaptions();break}},loadNextTrack:function(){this.trackToLoad++;this.trackToLoad<this.tracks.length?(this.isLoadingTrack=!0,this.loadTrack(this.trackToLoad)):(this.isLoadingTrack=!1,this.checkForTracks())},loadTrack:function(a){var b=this,f=b.tracks[a];c.ajax({url:f.src,dataType:"text",success:function(a){"string"==typeof a&&/<tt\s+xml/gi.exec(a)?
|
|
|
|
|
f.entries=mejs.TrackFormatParser.dfxp.parse(a):f.entries=mejs.TrackFormatParser.webvtt.parse(a);f.isLoaded=!0;b.enableTrackButton(f.srclang,f.label);b.loadNextTrack();"chapters"==f.kind&&b.media.addEventListener("play",function(a){0<b.media.duration&&b.displayChapters(f)},!1);"slides"==f.kind&&b.setupSlides(f)},error:function(){b.removeTrackButton(f.srclang);b.loadNextTrack()}})},enableTrackButton:function(a,b){""===b&&(b=mejs.language.codes[a]||a);this.captionsButton.find("input[value="+a+"]").prop("disabled",
|
|
|
|
|
!1).siblings("label").html(b);this.options.startLanguage==a&&c("#"+this.id+"_captions_"+a).prop("checked",!0).trigger("click");this.adjustLanguageBox()},removeTrackButton:function(a){this.captionsButton.find("input[value="+a+"]").closest("li").remove();this.adjustLanguageBox()},addTrackButton:function(a,b){""===b&&(b=mejs.language.codes[a]||a);this.captionsButton.find("ul").append(c('<li><input type="radio" name="'+this.id+'_captions" id="'+this.id+"_captions_"+a+'" value="'+a+'" disabled="disabled" /><label for="'+
|
|
|
|
|
this.id+"_captions_"+a+'">'+b+" (loading)</label></li>"));this.adjustLanguageBox();this.container.find(".mejs-captions-translations option[value="+a+"]").remove()},adjustLanguageBox:function(){this.captionsButton.find(".mejs-captions-selector").height(this.captionsButton.find(".mejs-captions-selector ul").outerHeight(!0)+this.captionsButton.find(".mejs-captions-translations").outerHeight(!0))},checkForTracks:function(){var a=!1;if(this.options.hideCaptionsButtonWhenEmpty){for(i=0;i<this.tracks.length;i++)if("subtitles"==
|
|
|
|
|
this.tracks[i].kind&&this.tracks[i].isLoaded){a=!0;break}a||(this.captionsButton.hide(),this.setControlsSize())}},displayCaptions:function(){if("undefined"!=typeof this.tracks){var a,b=this.selectedTrack;if(null!==b&&b.isLoaded)for(a=0;a<b.entries.times.length;a++)if(this.media.currentTime>=b.entries.times[a].start&&this.media.currentTime<=b.entries.times[a].stop)return this.captionsText.html(b.entries.text[a]).attr("class","mejs-captions-text "+(b.entries.times[a].identifier||"")),void this.captions.show().height(0);
|
|
|
|
|
this.captions.hide()}},setupSlides:function(a){this.slides=a;this.slides.entries.imgs=[this.slides.entries.text.length];this.showSlide(0)},showSlide:function(a){if("undefined"!=typeof this.tracks&&"undefined"!=typeof this.slidesContainer){var b=this,f=b.slides.entries.text[a],e=b.slides.entries.imgs[a];"undefined"==typeof e||"undefined"==typeof e.fadeIn?b.slides.entries.imgs[a]=e=c('<img src="'+f+'">').on("load",function(){e.appendTo(b.slidesContainer).hide().fadeIn().siblings(":visible").fadeOut()}):
|
|
|
|
|
e.is(":visible")||e.is(":animated")||e.fadeIn().siblings(":visible").fadeOut()}},displaySlides:function(){if("undefined"!=typeof this.slides){var a,b=this.slides;for(a=0;a<b.entries.times.length;a++)if(this.media.currentTime>=b.entries.times[a].start&&this.media.currentTime<=b.entries.times[a].stop)return void this.showSlide(a)}},displayChapters:function(){var a;for(a=0;a<this.tracks.length;a++)if("chapters"==this.tracks[a].kind&&this.tracks[a].isLoaded){this.drawChapters(this.tracks[a]);this.hasChapters=
|
|
|
|
|
!0;break}},drawChapters:function(a){var b,f,e=this,d=f=0;e.chapters.empty();for(b=0;b<a.entries.times.length;b++)f=a.entries.times[b].stop-a.entries.times[b].start,f=Math.floor(f/e.media.duration*100),(100<f+d||b==a.entries.times.length-1&&100>f+d)&&(f=100-d),e.chapters.append(c('<div class="mejs-chapter" rel="'+a.entries.times[b].start+'" style="left: '+d.toString()+"%;width: "+f.toString()+'%;"><div class="mejs-chapter-block'+(b==a.entries.times.length-1?" mejs-chapter-block-last":"")+'"><span class="ch-title">'+
|
|
|
|
|
a.entries.text[b]+'</span><span class="ch-time">'+mejs.Utility.secondsToTimeCode(a.entries.times[b].start,e.options)+"–"+mejs.Utility.secondsToTimeCode(a.entries.times[b].stop,e.options)+"</span></div></div>")),d+=f;e.chapters.find("div.mejs-chapter").click(function(){e.media.setCurrentTime(parseFloat(c(this).attr("rel")));e.media.paused&&e.media.play()});e.chapters.show()}});mejs.language={codes:{af:"Afrikaans",sq:"Albanian",ar:"Arabic",be:"Belarusian",bg:"Bulgarian",ca:"Catalan",zh:"Chinese",
|
|
|
|
|
"zh-cn":"Chinese Simplified","zh-tw":"Chinese Traditional",hr:"Croatian",cs:"Czech",da:"Danish",nl:"Dutch",en:"English",et:"Estonian",fl:"Filipino",fi:"Finnish",fr:"French",gl:"Galician",de:"German",el:"Greek",ht:"Haitian Creole",iw:"Hebrew",hi:"Hindi",hu:"Hungarian",is:"Icelandic",id:"Indonesian",ga:"Irish",it:"Italian",ja:"Japanese",ko:"Korean",lv:"Latvian",lt:"Lithuanian",mk:"Macedonian",ms:"Malay",mt:"Maltese",no:"Norwegian",fa:"Persian",pl:"Polish",pt:"Portuguese",ro:"Romanian",ru:"Russian",
|
|
|
|
|
sr:"Serbian",sk:"Slovak",sl:"Slovenian",es:"Spanish",sw:"Swahili",sv:"Swedish",tl:"Tagalog",th:"Thai",tr:"Turkish",uk:"Ukrainian",vi:"Vietnamese",cy:"Welsh",yi:"Yiddish"}};mejs.TrackFormatParser={webvtt:{pattern_timecode:/^((?:[0-9]{1,2}:)?[0-9]{2}:[0-9]{2}([,.][0-9]{1,3})?) --\> ((?:[0-9]{1,2}:)?[0-9]{2}:[0-9]{2}([,.][0-9]{3})?)(.*)$/,parse:function(a){for(var b,f,e=0,d=mejs.TrackFormatParser.split2(a,/\r?\n/),g={text:[],times:[]};e<d.length;e++){if(b=this.pattern_timecode.exec(d[e]),b&&e<d.length){0<=
|
|
|
|
|
e-1&&""!==d[e-1]&&(f=d[e-1]);e++;a=d[e];for(e++;""!==d[e]&&e<d.length;)a=a+"\n"+d[e],e++;a=c.trim(a).replace(/(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/gi,"<a href='$1' target='_blank'>$1</a>");g.text.push(a);g.times.push({identifier:f,start:0===mejs.Utility.convertSMPTEtoSeconds(b[1])?.2:mejs.Utility.convertSMPTEtoSeconds(b[1]),stop:mejs.Utility.convertSMPTEtoSeconds(b[3]),settings:b[5]})}f=""}return g}},dfxp:{parse:function(a){a=c(a).filter("tt");var b,f,e=0,e=a.children("div").eq(0),
|
|
|
|
|
d=e.find("p"),e=a.find("#"+e.attr("style"));a={text:[],times:[]};if(e.length&&(f=e.removeAttr("id").get(0).attributes,f.length))for(b={},e=0;e<f.length;e++)b[f[e].name.split(":")[1]]=f[e].value;for(e=0;e<d.length;e++){var g;f={start:null,stop:null,style:null};if(d.eq(e).attr("begin")&&(f.start=mejs.Utility.convertSMPTEtoSeconds(d.eq(e).attr("begin"))),!f.start&&d.eq(e-1).attr("end")&&(f.start=mejs.Utility.convertSMPTEtoSeconds(d.eq(e-1).attr("end"))),d.eq(e).attr("end")&&(f.stop=mejs.Utility.convertSMPTEtoSeconds(d.eq(e).attr("end"))),
|
|
|
|
|
!f.stop&&d.eq(e+1).attr("begin")&&(f.stop=mejs.Utility.convertSMPTEtoSeconds(d.eq(e+1).attr("begin"))),b){g="";for(var h in b)g+=h+":"+b[h]+";"}g&&(f.style=g);0===f.start&&(f.start=.2);a.times.push(f);f=c.trim(d.eq(e).html()).replace(/(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/gi,"<a href='$1' target='_blank'>$1</a>");a.text.push(f);0===a.times.start&&(a.times.start=2)}return a}},split2:function(a,b){return a.split(b)}};3!="x\n\ny".split(/\n/gi).length&&(mejs.TrackFormatParser.split2=
|
|
|
|
|
function(a,b){var c,e=[],d="";for(c=0;c<a.length;c++)d+=a.substring(c,c+1),b.test(d)&&(e.push(d.replace(b,"")),d="");return e.push(d),e})})(mejs.$);
|
|
|
|
|
(function(c){c.extend(mejs.MepDefaults,{contextMenuItems:[{render:function(a){return"undefined"==typeof a.enterFullScreen?null:a.isFullScreen?mejs.i18n.t("Turn off Fullscreen"):mejs.i18n.t("Go Fullscreen")},click:function(a){a.isFullScreen?a.exitFullScreen():a.enterFullScreen()}},{render:function(a){return a.media.muted?mejs.i18n.t("Unmute"):mejs.i18n.t("Mute")},click:function(a){a.media.muted?a.setMuted(!1):a.setMuted(!0)}},{isSeparator:!0},{render:function(a){return mejs.i18n.t("Download Video")},
|
|
|
|
|
click:function(a){window.location.href=a.media.currentSrc}}]});c.extend(MediaElementPlayer.prototype,{buildcontextmenu:function(a,b,f,e){a.contextMenu=c('<div class="mejs-contextmenu"></div>').appendTo(c("body")).hide();a.container.bind("contextmenu",function(b){return a.isContextMenuEnabled?(b.preventDefault(),a.renderContextMenu(b.clientX-1,b.clientY-1),!1):void 0});a.container.bind("click",function(){a.contextMenu.hide()});a.contextMenu.bind("mouseleave",function(){a.startContextMenuTimer()})},
|
|
|
|
|
cleancontextmenu:function(a){a.contextMenu.remove()},isContextMenuEnabled:!0,enableContextMenu:function(){this.isContextMenuEnabled=!0},disableContextMenu:function(){this.isContextMenuEnabled=!1},contextMenuTimeout:null,startContextMenuTimer:function(){var a=this;a.killContextMenuTimer();a.contextMenuTimer=setTimeout(function(){a.hideContextMenu();a.killContextMenuTimer()},750)},killContextMenuTimer:function(){var a=this.contextMenuTimer;null!=a&&(clearTimeout(a),delete a)},hideContextMenu:function(){this.contextMenu.hide()},
|
|
|
|
|
renderContextMenu:function(a,b){for(var f=this,e="",d=f.options.contextMenuItems,g=0,h=d.length;h>g;g++)if(d[g].isSeparator)e+='<div class="mejs-contextmenu-separator"></div>';else{var k=d[g].render(f);null!=k&&(e+='<div class="mejs-contextmenu-item" data-itemindex="'+g+'" id="element-'+1E6*Math.random()+'">'+k+"</div>")}f.contextMenu.empty().append(c(e)).css({top:b,left:a}).show();f.contextMenu.find(".mejs-contextmenu-item").each(function(){var a=c(this),b=parseInt(a.data("itemindex"),10),d=f.options.contextMenuItems[b];
|
|
|
|
|
"undefined"!=typeof d.show&&d.show(a,f);a.click(function(){"undefined"!=typeof d.click&&d.click(f);f.contextMenu.hide()})});setTimeout(function(){f.killControlsTimer("rev3")},100)}})})(mejs.$);
|
|
|
|
|
(function(c){c.extend(mejs.MepDefaults,{skipBackInterval:30,skipBackText:mejs.i18n.t("Skip back %1 seconds")});c.extend(MediaElementPlayer.prototype,{buildskipback:function(a,b,f,e){var d=this;a=d.options.skipBackText.replace("%1",d.options.skipBackInterval);c('<div class="mejs-button mejs-skip-back-button"><button type="button" aria-controls="'+d.id+'" title="'+a+'" aria-label="'+a+'">'+d.options.skipBackInterval+"</button></div>").appendTo(b).click(function(){e.setCurrentTime(Math.max(e.currentTime-
|
|
|
|
|
d.options.skipBackInterval,0));c(this).find("button").blur()})}})})(mejs.$);
|
|
|
|
|
(function(c){c.extend(mejs.MepDefaults,{postrollCloseText:mejs.i18n.t("Close")});c.extend(MediaElementPlayer.prototype,{buildpostroll:function(a,b,f,e){var d=this.container.find('link[rel="postroll"]').attr("href");"undefined"!=typeof d&&(a.postroll=c('<div class="mejs-postroll-layer mejs-layer"><a class="mejs-postroll-close" onclick="$(this).parent().hide();return false;">'+this.options.postrollCloseText+'</a><div class="mejs-postroll-layer-content"></div></div>').prependTo(f).hide(),this.media.addEventListener("ended",
|
|
|
|
|
function(b){c.ajax({dataType:"html",url:d,success:function(a,b){f.find(".mejs-postroll-layer-content").html(a)}});a.postroll.show()},!1))}})})(mejs.$);(function(c){c.extend(mejs.MepDefaults,{loopText:"Repeat On/Off",shuffleText:"Shuffle On/Off",nextText:"Next Track",prevText:"Previous Track",playlistText:"Show/Hide Playlist"});c.extend(MediaElementPlayer.prototype,{buildloop:function(a,b,f,e){var d=c('<div class="mejs-button mejs-loop-button '+(a.options.loop?"mejs-loop-on":"mejs-loop-off")+'"><button type="button" aria-controls="'+a.id+'" title="'+a.options.loopText+'"></button></div>').appendTo(b).click(function(b){a.options.loop=!a.options.loop;
|
|
|
|
|
c(e).trigger("mep-looptoggle",[a.options.loop]);a.options.loop?d.removeClass("mejs-loop-off").addClass("mejs-loop-on"):d.removeClass("mejs-loop-on").addClass("mejs-loop-off")});this.loopToggle=this.controls.find(".mejs-loop-button")},loopToggleClick:function(){this.loopToggle.trigger("click")},buildshuffle:function(a,b,f,e){var d=c('<div class="mejs-button mejs-shuffle-button '+(a.options.shuffle?"mejs-shuffle-on":"mejs-shuffle-off")+'"><button type="button" aria-controls="'+a.id+'" title="'+a.options.shuffleText+
|
|
|
|
|
'"></button></div>').appendTo(b).click(function(b){a.options.shuffle=!a.options.shuffle;c(e).trigger("mep-shuffletoggle",[a.options.shuffle]);a.options.shuffle?d.removeClass("mejs-shuffle-off").addClass("mejs-shuffle-on"):d.removeClass("mejs-shuffle-on").addClass("mejs-shuffle-off")});this.shuffleToggle=this.controls.find(".mejs-shuffle-button")},shuffleToggleClick:function(){this.shuffleToggle.trigger("click")},buildprevtrack:function(a,b,f,e){c('<div class="mejs-button mejs-prevtrack-button mejs-prevtrack"><button type="button" aria-controls="'+
|
|
|
|
|
a.id+'" title="'+a.options.prevText+'"></button></div>').appendTo(b).click(function(b){c(e).trigger("mep-playprevtrack");a.playPrevTrack()});this.prevTrack=this.controls.find(".mejs-prevtrack-button")},prevTrackClick:function(){this.prevTrack.trigger("click")},buildnexttrack:function(a,b,f,e){c('<div class="mejs-button mejs-nexttrack-button mejs-nexttrack"><button type="button" aria-controls="'+a.id+'" title="'+a.options.nextText+'"></button></div>').appendTo(b).click(function(b){c(e).trigger("mep-playnexttrack");
|
|
|
|
|
a.playNextTrack()});this.nextTrack=this.controls.find(".mejs-nexttrack-button")},nextTrackClick:function(){this.nextTrack.trigger("click")},buildplaylist:function(a,b,f,e){var d=c('<div class="mejs-button mejs-playlist-button '+(a.options.playlist?"mejs-hide-playlist":"mejs-show-playlist")+'"><button type="button" aria-controls="'+a.id+'" title="'+a.options.playlistText+'"></button></div>').appendTo(b).click(function(b){a.options.playlist=!a.options.playlist;c(e).trigger("mep-playlisttoggle",[a.options.playlist]);
|
|
|
|
|
a.options.playlist?(f.children(".mejs-playlist").show(),d.removeClass("mejs-show-playlist").addClass("mejs-hide-playlist")):(f.children(".mejs-playlist").hide(),d.removeClass("mejs-hide-playlist").addClass("mejs-show-playlist"))});this.playlistToggle=this.controls.find(".mejs-playlist-button")},playlistToggleClick:function(){this.playlistToggle.trigger("click")},buildplaylistfeature:function(a,b,f,e){b=c('<div class="mejs-playlist mejs-layer"><ul class="mejs"></ul></div>').appendTo(f);a.options.playlist||
|
|
|
|
|
b.hide();"bottom"==a.options.playlistposition?b.css("top",a.options.audioHeight+"px"):b.css("bottom",a.options.audioHeight+"px");var d=[];c("#"+a.id).find(".mejs-mediaelement source").each(function(a,b){if(""!=c.trim(this.src)){var e={};e.source=c.trim(this.src);if(""!=c.trim(this.title))e.name=c.trim(this.title);else{var f;f=e.source.split("/");f=0<f.length?decodeURIComponent(f[f.length-1]):"";e.name=f}d.push(e)}});for(var g in d)f.find(".mejs-playlist > ul").append('<li data-url="'+d[g].source+
|
|
|
|
|
'" title="'+d[g].name+'">'+d[g].name+"</li>");f.find("li:first").addClass("current played");f.find(".mejs-playlist > ul li").click(function(b){c(this).hasClass("current")?a.play():(c(this).addClass("played"),a.playTrack(c(this)))});e.addEventListener("ended",function(b){a.playNextTrack()},!1)},playNextTrack:function(){var a=this.layers.find(".mejs-playlist > ul > li"),b=a.filter(".current"),c=a.not(".played");1>c.length&&(b.removeClass("played").siblings().removeClass("played"),c=a.not(".current"));
|
|
|
|
|
this.options.shuffle?a=c.eq(Math.floor(Math.random()*c.length)):(a=b.next(),1>a.length&&this.options.loop&&(a=b.siblings().first()));1==a.length&&(a.addClass("played"),this.playTrack(a))},playPrevTrack:function(){var a=this.layers.find(".mejs-playlist > ul > li"),b=a.filter(".current"),c=a.filter(".played").not(".current");1>c.length&&(b.removeClass("played"),c=a.not(".current"));this.options.shuffle?a=c.eq(Math.floor(Math.random()*c.length)):(a=b.prev(),1>a.length&&this.options.loop&&(a=b.siblings().last()));
|
|
|
|
|
1==a.length&&(b.removeClass("played"),this.playTrack(a))},playTrack:function(a){this.pause();this.setSrc(a.attr("data-url"));this.load();this.play();a.addClass("current").siblings().removeClass("current")},playTrackURL:function(a){a=this.layers.find(".mejs-playlist > ul > li").filter('[data-url="'+a+'"]');this.playTrack(a)}})})(mejs.$);function A(c,a,b){var f=a||0,e=0;"string"==typeof c?(e=b||c.length,this.a=function(a){return c.charCodeAt(a+f)&255}):"unknown"==typeof c&&(e=b||IEBinary_getLength(c),this.a=function(a){return IEBinary_getByteAt(c,a+f)});this.l=function(a,b){for(var c=Array(b),e=0;e<b;e++)c[e]=this.a(a+e);return c};this.h=function(){return e};this.d=function(a,b){return 0!=(this.a(a)&1<<b)};this.w=function(a){a=(this.a(a+1)<<8)+this.a(a);0>a&&(a+=65536);return a};this.i=function(a){var b=this.a(a),c=this.a(a+1),e=
|
|
|
|
|
this.a(a+2);a=this.a(a+3);b=(((b<<8)+c<<8)+e<<8)+a;0>b&&(b+=4294967296);return b};this.o=function(a){var b=this.a(a),c=this.a(a+1);a=this.a(a+2);b=((b<<8)+c<<8)+a;0>b&&(b+=16777216);return b};this.c=function(a,b){for(var c=[],e=a,f=0;e<a+b;e++,f++)c[f]=String.fromCharCode(this.a(e));return c.join("")};this.e=function(a,b,c){a=this.l(a,b);switch(c.toLowerCase()){case "utf-16":case "utf-16le":case "utf-16be":b=c;var e,f=0,n=1;c=0;e=Math.min(e||a.length,a.length);254==a[0]&&255==a[1]?(b=!0,f=2):255==
|
|
|
|
|
a[0]&&254==a[1]&&(b=!1,f=2);b&&(n=0,c=1);b=[];for(var m=0;f<e;m++){var p=a[f+n],q=(p<<8)+a[f+c],f=f+2;if(0==q)break;else 216>p||224<=p?b[m]=String.fromCharCode(q):(p=(a[f+n]<<8)+a[f+c],f+=2,b[m]=String.fromCharCode(q,p))}a=new String(b.join(""));a.g=f;break;case "utf-8":e=0;f=Math.min(f||a.length,a.length);239==a[0]&&187==a[1]&&191==a[2]&&(e=3);n=[];for(c=0;e<f&&(b=a[e++],0!=b);c++)128>b?n[c]=String.fromCharCode(b):194<=b&&224>b?(m=a[e++],n[c]=String.fromCharCode(((b&31)<<6)+(m&63))):224<=b&&240>
|
|
|
|
|
b?(m=a[e++],q=a[e++],n[c]=String.fromCharCode(((b&255)<<12)+((m&63)<<6)+(q&63))):240<=b&&245>b&&(m=a[e++],q=a[e++],p=a[e++],b=((b&7)<<18)+((m&63)<<12)+((q&63)<<6)+(p&63)-65536,n[c]=String.fromCharCode((b>>10)+55296,(b&1023)+56320));a=new String(n.join(""));a.g=e;break;default:f=[];n=n||a.length;for(e=0;e<n;){c=a[e++];if(0==c)break;f[e-1]=String.fromCharCode(c)}a=new String(f.join(""));a.g=e}return a};this.f=function(a,b){b()}}document.write("<script type='text/vbscript'>\r\nFunction IEBinary_getByteAt(strBinary, iOffset)\r\n\tIEBinary_getByteAt = AscB(MidB(strBinary,iOffset+1,1))\r\nEnd Function\r\nFunction IEBinary_getLength(strBinary)\r\n\tIEBinary_getLength = LenB(strBinary)\r\nEnd Function\r\n\x3c/script>\r\n");
|
|
|
|
|
function B(c,a,b){function f(a,b,c,d,f,g){var q=e();q?("undefined"===typeof g&&(g=!0),b&&("undefined"!=typeof q.onload?q.onload=function(){"200"==q.status||"206"==q.status?(q.fileSize=f||q.getResponseHeader("Content-Length"),b(q)):c&&c();q=null}:q.onreadystatechange=function(){4==q.readyState&&("200"==q.status||"206"==q.status?(q.fileSize=f||q.getResponseHeader("Content-Length"),b(q)):c&&c(),q=null)}),q.open("GET",a,g),q.overrideMimeType&&q.overrideMimeType("text/plain; charset=x-user-defined"),d&&
|
|
|
|
|
q.setRequestHeader("Range","bytes="+d[0]+"-"+d[1]),q.setRequestHeader("If-Modified-Since","Sat, 1 Jan 1970 00:00:00 GMT"),q.send(null)):c&&c()}function e(){var a=null;window.XMLHttpRequest?a=new XMLHttpRequest:window.ActiveXObject&&(a=new ActiveXObject("Microsoft.XMLHTTP"));return a}function d(a,b){var c=e();c&&(b&&("undefined"!=typeof c.onload?c.onload=function(){"200"==c.status&&b(this);c=null}:c.onreadystatechange=function(){4==c.readyState&&("200"==c.status&&b(this),c=null)}),c.open("HEAD",a,
|
|
|
|
|
!0),c.send(null))}function g(a,c){function d(a){var b=~~(a[0]/g)-p;a=~~(a[1]/g)+1+p;0>b&&(b=0);a>=blockTotal&&(a=blockTotal-1);return[b,a]}function e(d,l){for(;t[d[0]];)if(d[0]++,d[0]>d[1]){l&&l();return}for(;t[d[1]];)if(d[1]--,d[0]>d[1]){l&&l();return}var n=[d[0]*g,(d[1]+1)*g-1];f(a,function(a){parseInt(a.getResponseHeader("Content-Length"),10)==c&&(d[0]=0,d[1]=blockTotal-1,n[0]=0,n[1]=c-1);a={data:a.N||a.responseText,offset:n[0]};for(var b=d[0];b<=d[1];b++)t[b]=a;l&&l()},b,n,q,!!l)}var g,p,q,u=
|
|
|
|
|
new A("",0,c),t=[];g=g||2048;p="undefined"===typeof p?0:p;blockTotal=~~((c-1)/g)+1;for(var r in u)u.hasOwnProperty(r)&&"function"===typeof u[r]&&(this[r]=u[r]);this.a=function(a){var b;e(d([a,a]));b=t[~~(a/g)];if("string"==typeof b.data)return b.data.charCodeAt(a-b.offset)&255;if("unknown"==typeof b.data)return IEBinary_getByteAt(b.data,a-b.offset)};this.f=function(a,b){e(d(a),b)}}(function(){d(c,function(b){b=parseInt(b.getResponseHeader("Content-Length"),10)||-1;a(new g(c,b))})})()}
|
|
|
|
|
(function(c){c.FileAPIReader=function(a,b){return function(c,e){var d=b||new FileReader;d.onload=function(a){e(new A(a.target.result))};d.readAsBinaryString(a)}}})(this);
|
|
|
|
|
(function(c){var a=c.p={},b={},f=[0,7];a.t=function(a){delete b[a]};a.s=function(){b={}};a.B=function(a,c,g){g=g||{};(g.dataReader||B)(a,function(h){h.f(f,function(){var f="ftypM4A"==h.c(4,7)?ID4:"ID3"==h.c(0,3)?ID3v2:ID3v1;f.m(h,function(){var l=g.tags,n=f.n(h,l),l=b[a]||{},m;for(m in n)n.hasOwnProperty(m)&&(l[m]=n[m]);b[a]=l;c&&c()})})})};a.v=function(a){if(!b[a])return null;var c={},f;for(f in b[a])b[a].hasOwnProperty(f)&&(c[f]=b[a][f]);return c};a.A=function(a,c){return b[a]?b[a][c]:null};c.ID3=
|
|
|
|
|
c.p;a.loadTags=a.B;a.getAllTags=a.v;a.getTag=a.A;a.clearTags=a.t;a.clearAll=a.s})(this);
|
|
|
|
|
(function(c){var a=c.q={},b="Blues;Classic Rock;Country;Dance;Disco;Funk;Grunge;Hip-Hop;Jazz;Metal;New Age;Oldies;Other;Pop;R&B;Rap;Reggae;Rock;Techno;Industrial;Alternative;Ska;Death Metal;Pranks;Soundtrack;Euro-Techno;Ambient;Trip-Hop;Vocal;Jazz+Funk;Fusion;Trance;Classical;Instrumental;Acid;House;Game;Sound Clip;Gospel;Noise;AlternRock;Bass;Soul;Punk;Space;Meditative;Instrumental Pop;Instrumental Rock;Ethnic;Gothic;Darkwave;Techno-Industrial;Electronic;Pop-Folk;Eurodance;Dream;Southern Rock;Comedy;Cult;Gangsta;Top 40;Christian Rap;Pop/Funk;Jungle;Native American;Cabaret;New Wave;Psychadelic;Rave;Showtunes;Trailer;Lo-Fi;Tribal;Acid Punk;Acid Jazz;Polka;Retro;Musical;Rock & Roll;Hard Rock;Folk;Folk-Rock;National Folk;Swing;Fast Fusion;Bebob;Latin;Revival;Celtic;Bluegrass;Avantgarde;Gothic Rock;Progressive Rock;Psychedelic Rock;Symphonic Rock;Slow Rock;Big Band;Chorus;Easy Listening;Acoustic;Humour;Speech;Chanson;Opera;Chamber Music;Sonata;Symphony;Booty Bass;Primus;Porn Groove;Satire;Slow Jam;Club;Tango;Samba;Folklore;Ballad;Power Ballad;Rhythmic Soul;Freestyle;Duet;Punk Rock;Drum Solo;Acapella;Euro-House;Dance Hall".split(";");a.m=
|
|
|
|
|
function(a,b){var c=a.h();a.f([c-128-1,c],b)};a.n=function(a){var c=a.h()-128;if("TAG"==a.c(c,3)){var d=a.c(c+3,30).replace(/\0/g,""),g=a.c(c+33,30).replace(/\0/g,""),h=a.c(c+63,30).replace(/\0/g,""),k=a.c(c+93,4).replace(/\0/g,"");if(0==a.a(c+97+28))var l=a.c(c+97,28).replace(/\0/g,""),n=a.a(c+97+29);else l="",n=0;a=a.a(c+97+30);return{version:"1.1",title:d,artist:g,album:h,year:k,comment:l,track:n,genre:255>a?b[a]:""}}return{}};c.ID3v1=c.q})(this);
|
|
|
|
|
(function(c){function a(a,b){var c=b.a(a),e=b.a(a+1),f=b.a(a+2);return b.a(a+3)&127|(f&127)<<7|(e&127)<<14|(c&127)<<21}var b=c.D={};b.b={};b.frames={BUF:"Recommended buffer size",CNT:"Play counter",COM:"Comments",CRA:"Audio encryption",CRM:"Encrypted meta frame",ETC:"Event timing codes",EQU:"Equalization",GEO:"General encapsulated object",IPL:"Involved people list",LNK:"Linked information",MCI:"Music CD Identifier",MLL:"MPEG location lookup table",PIC:"Attached picture",POP:"Popularimeter",REV:"Reverb",
|
|
|
|
|
RVA:"Relative volume adjustment",SLT:"Synchronized lyric/text",STC:"Synced tempo codes",TAL:"Album/Movie/Show title",TBP:"BPM (Beats Per Minute)",TCM:"Composer",TCO:"Content type",TCR:"Copyright message",TDA:"Date",TDY:"Playlist delay",TEN:"Encoded by",TFT:"File type",TIM:"Time",TKE:"Initial key",TLA:"Language(s)",TLE:"Length",TMT:"Media type",TOA:"Original artist(s)/performer(s)",TOF:"Original filename",TOL:"Original Lyricist(s)/text writer(s)",TOR:"Original release year",TOT:"Original album/Movie/Show title",
|
|
|
|
|
TP1:"Lead artist(s)/Lead performer(s)/Soloist(s)/Performing group",TP2:"Band/Orchestra/Accompaniment",TP3:"Conductor/Performer refinement",TP4:"Interpreted, remixed, or otherwise modified by",TPA:"Part of a set",TPB:"Publisher",TRC:"ISRC (International Standard Recording Code)",TRD:"Recording dates",TRK:"Track number/Position in set",TSI:"Size",TSS:"Software/hardware and settings used for encoding",TT1:"Content group description",TT2:"Title/Songname/Content description",TT3:"Subtitle/Description refinement",
|
|
|
|
|
TXT:"Lyricist/text writer",TXX:"User defined text information frame",TYE:"Year",UFI:"Unique file identifier",ULT:"Unsychronized lyric/text transcription",WAF:"Official audio file webpage",WAR:"Official artist/performer webpage",WAS:"Official audio source webpage",WCM:"Commercial information",WCP:"Copyright/Legal information",WPB:"Publishers official webpage",WXX:"User defined URL link frame",AENC:"Audio encryption",APIC:"Attached picture",COMM:"Comments",COMR:"Commercial frame",ENCR:"Encryption method registration",
|
|
|
|
|
EQUA:"Equalization",ETCO:"Event timing codes",GEOB:"General encapsulated object",GRID:"Group identification registration",IPLS:"Involved people list",LINK:"Linked information",MCDI:"Music CD identifier",MLLT:"MPEG location lookup table",OWNE:"Ownership frame",PRIV:"Private frame",PCNT:"Play counter",POPM:"Popularimeter",POSS:"Position synchronisation frame",RBUF:"Recommended buffer size",RVAD:"Relative volume adjustment",RVRB:"Reverb",SYLT:"Synchronized lyric/text",SYTC:"Synchronized tempo codes",
|
|
|
|
|
TALB:"Album/Movie/Show title",TBPM:"BPM (beats per minute)",TCOM:"Composer",TCON:"Content type",TCOP:"Copyright message",TDAT:"Date",TDLY:"Playlist delay",TENC:"Encoded by",TEXT:"Lyricist/Text writer",TFLT:"File type",TIME:"Time",TIT1:"Content group description",TIT2:"Title/songname/content description",TIT3:"Subtitle/Description refinement",TKEY:"Initial key",TLAN:"Language(s)",TLEN:"Length",TMED:"Media type",TOAL:"Original album/movie/show title",TOFN:"Original filename",TOLY:"Original lyricist(s)/text writer(s)",
|
|
|
|
|
TOPE:"Original artist(s)/performer(s)",TORY:"Original release year",TOWN:"File owner/licensee",TPE1:"Lead performer(s)/Soloist(s)",TPE2:"Band/orchestra/accompaniment",TPE3:"Conductor/performer refinement",TPE4:"Interpreted, remixed, or otherwise modified by",TPOS:"Part of a set",TPUB:"Publisher",TRCK:"Track number/Position in set",TRDA:"Recording dates",TRSN:"Internet radio station name",TRSO:"Internet radio station owner",TSIZ:"Size",TSRC:"ISRC (international standard recording code)",TSSE:"Software/Hardware and settings used for encoding",
|
|
|
|
|
TYER:"Year",TXXX:"User defined text information frame",UFID:"Unique file identifier",USER:"Terms of use",USLT:"Unsychronized lyric/text transcription",WCOM:"Commercial information",WCOP:"Copyright/Legal information",WOAF:"Official audio file webpage",WOAR:"Official artist/performer webpage",WOAS:"Official audio source webpage",WORS:"Official internet radio station homepage",WPAY:"Payment",WPUB:"Publishers official webpage",WXXX:"User defined URL link frame"};var f={title:["TIT2","TT2"],artist:["TPE1",
|
|
|
|
|
"TP1"],album:["TALB","TAL"],year:["TYER","TYE"],comment:["COMM","COM"],track:["TRCK","TRK"],genre:["TCON","TCO"],picture:["APIC","PIC"],lyrics:["USLT","ULT"]},e=["title","artist","album","track"];b.m=function(b,c){b.f([0,a(6,b)],c)};b.n=function(c,g){var h=0,k=c.a(h+3);if(4<k)return{version:">2.4"};var l=c.a(h+4),n=c.d(h+5,7),m=c.d(h+5,6),p=c.d(h+5,5),q=a(h+6,c),h=h+10;if(m)var u=c.i(h),h=h+(u+4);var k={version:"2."+k+"."+l,major:k,revision:l,flags:{unsynchronisation:n,extended_header:m,experimental_indicator:p},
|
|
|
|
|
size:q},t;if(n)t={};else{for(var q=q-10,n=c,l=g,m={},p=k.major,u=[],r=0,v;v=(l||e)[r];r++)u=u.concat(f[v]||[v]);for(l=u;h<q;){u=null;r=n;v=h;var y=null;switch(p){case 2:t=r.c(v,3);var w=r.o(v+3),x=6;break;case 3:t=r.c(v,4);w=r.i(v+4);x=10;break;case 4:t=r.c(v,4),w=a(v+4,r),x=10}if(""==t)break;h+=x+w;0>l.indexOf(t)||(2<p&&(y={message:{P:r.d(v+8,6),I:r.d(v+8,5),M:r.d(v+8,4)},k:{K:r.d(v+8+1,7),F:r.d(v+8+1,3),H:r.d(v+8+1,2),C:r.d(v+8+1,1),u:r.d(v+8+1,0)}}),v+=x,y&&y.k.u&&(a(v,r),v+=4,w-=4),y&&y.k.C||
|
|
|
|
|
(t in b.b?u=b.b[t]:"T"==t[0]&&(u=b.b["T*"]),u=u?u(v,w,r,y):void 0,u={id:t,size:w,description:t in b.frames?b.frames[t]:"Unknown",data:u},t in m?(m[t].id&&(m[t]=[m[t]]),m[t].push(u)):m[t]=u))}t=m}for(var z in f)if(f.hasOwnProperty(z)){a:{w=f[z];"string"==typeof w&&(w=[w]);for(x=0;h=w[x];x++)if(h in t){c=t[h].data;break a}c=void 0}c&&(k[z]=c)}for(var C in t)t.hasOwnProperty(C)&&(k[C]=t[C]);return k};c.ID3v2=b})(this);
|
|
|
|
|
(function(){function c(a){var c;switch(a){case 0:c="iso-8859-1";break;case 1:c="utf-16";break;case 2:c="utf-16be";break;case 3:c="utf-8"}return c}var a="32x32 pixels 'file icon' (PNG only);Other file icon;Cover (front);Cover (back);Leaflet page;Media (e.g. lable side of CD);Lead artist/lead performer/soloist;Artist/performer;Conductor;Band/Orchestra;Composer;Lyricist/text writer;Recording Location;During recording;During performance;Movie/video screen capture;A bright coloured fish;Illustration;Band/artist logotype;Publisher/Studio logotype".split(";");
|
|
|
|
|
ID3v2.b.APIC=function(b,f,e,d,g){g=g||"3";d=b;var h=c(e.a(b));switch(g){case "2":var k=e.c(b+1,3);b+=4;break;case "3":case "4":k=e.e(b+1,f-(b-d),h),b+=1+k.g}g=e.a(b,1);g=a[g];h=e.e(b+1,f-(b-d),h);b+=1+h.g;return{format:k.toString(),type:g,description:h.toString(),data:e.l(b,d+f-b)}};ID3v2.b.COMM=function(a,f,e){var d=a,g=c(e.a(a)),h=e.c(a+1,3),k=e.e(a+4,f-4,g);a+=4+k.g;a=e.e(a,d+f-a,g);return{language:h,O:k.toString(),text:a.toString()}};ID3v2.b.COM=ID3v2.b.COMM;ID3v2.b.PIC=function(a,c,e,d){return ID3v2.b.APIC(a,
|
|
|
|
|
c,e,d,"2")};ID3v2.b.PCNT=function(a,c,e){return e.J(a)};ID3v2.b.CNT=ID3v2.b.PCNT;ID3v2.b["T*"]=function(a,f,e){var d=c(e.a(a));return e.e(a+1,f-1,d).toString()};ID3v2.b.TCON=function(a,c,e){return ID3v2.b["T*"].apply(this,arguments).replace(/^\(\d+\)/,"")};ID3v2.b.TCO=ID3v2.b.TCON;ID3v2.b.USLT=function(a,f,e){var d=a,g=c(e.a(a)),h=e.c(a+1,3),k=e.e(a+4,f-4,g);a+=4+k.g;a=e.e(a,d+f-a,g);return{language:h,G:k.toString(),L:a.toString()}};ID3v2.b.ULT=ID3v2.b.USLT})();
|
|
|
|
|
(function(c){function a(b,c,g,h){var k=b.i(c);if(0==k)h();else{var l=b.c(c+4,4);-1<["moov","udta","meta","ilst"].indexOf(l)?("meta"==l&&(c+=4),b.f([c+8,c+8+8],function(){a(b,c+8,k-8,h)})):b.f([c+(l in f.j?0:k),c+k+8],function(){a(b,c+k,g,h)})}}function b(a,c,g,h,k){k=void 0===k?"":k+" ";for(var l=g;l<g+h;){var n=c.i(l);if(0==n)break;var m=c.c(l+4,4);if(-1<["moov","udta","meta","ilst"].indexOf(m)){"meta"==m&&(l+=4);b(a,c,l+8,n-8,k);break}if(f.j[m]){var p=c.o(l+16+1),q=f.j[m],p=f.types[p];if("trkn"==
|
|
|
|
|
m)a[q[0]]=c.a(l+16+11),a.count=c.a(l+16+13);else{var m=l+16+4+4,u=n-16-4-4,t;switch(p){case "text":t=c.e(m,u,"UTF-8");break;case "uint8":t=c.w(m);break;case "jpeg":case "png":t={k:"image/"+p,data:c.l(m,u)}}a[q[0]]="comment"===q[0]?{text:t}:t}}l+=n}}var f=c.r={};f.types={0:"uint8",1:"text",13:"jpeg",14:"png",21:"uint8"};f.j={"\u00a9alb":["album"],"\u00a9art":["artist"],"\u00a9ART":["artist"],aART:["artist"],"\u00a9day":["year"],"\u00a9nam":["title"],"\u00a9gen":["genre"],trkn:["track"],"\u00a9wrt":["composer"],
|
|
|
|
|
"\u00a9too":["encoder"],cprt:["copyright"],covr:["picture"],"\u00a9grp":["grouping"],keyw:["keyword"],"\u00a9lyr":["lyrics"],"\u00a9cmt":["comment"],tmpo:["tempo"],cpil:["compilation"],disk:["disc"]};f.m=function(b,c){b.f([0,7],function(){a(b,0,b.h(),c)})};f.n=function(a){var c={};b(c,a,0,a.h());return c};c.ID4=c.r})(this);var MyPlayer=function(c){var a=!1,b=null,f={detachable:!0,element:"body",id3:!1,mode:"mp3url",waveform:!1,autoplay:!1,loop:!0,shuffle:!1,list:[]},e="undefined"===typeof c?f:$.extend({},f,c),d=function(){var a=e.autoplay?'autoplay="true"':"";$(e.element).append('<audio controls="controls" '+a+"><p>Your browser does not understand the <audio> tag. </p></audio>");e.audio=e.element+" audio"},g=function(){$(e.element).find("ul.mejs li").each(function(a,b){var c=$(b).attr("data-url");$(b).prepend('<span class="ajaxLoader"> </span> ');
|
|
|
|
|
ID3.loadTags(c,function(){var b=ID3.getAllTags(c);if("undefined"!=typeof b.title){var d=b.title;"undefined"!=typeof b.artist&&(d=b.artist+" - "+d);$(e.element).find("ul.mejs li").each(function(b,c){a==b&&$(c).html(d)})}})})},h=function(){m();e.id3&&g()},k=function(){b=new MediaElementPlayer($(e.audio),{success:h,loop:e.loop,shuffle:e.shuffle,playlist:!0,audioHeight:32,playlistposition:"bottom",features:"playlistfeature prevtrack playpause nexttrack loop shuffle current progress duration volume".split(" "),
|
|
|
|
|
pluginPath:mejs.Utility.getScriptPath(["myplayer.min.js"])+"../plugins/"});$(e.element).append('<p class="playerDetached" style="display: none;">The player is currently detached.</p>')},l=function(a){for(var b=window.location.search.substring(1).split("&"),c=0;c<b.length;c++){var d=b[c].split("=");if(d[0]==a)return d[1]}return!1},n=function(){if(e.detachable){var a=function(a){b.pause();$(".mejs-audio").hide();$(".playerDetached").show();a=window.open(a,"myplayer","height="+Math.max($(e.element).height(),
|
|
|
|
|
298)+",width=408,resizable=false");window.focus&&a.focus();$("iframe",top.document).height(20);return!1};if(0==l("popup"))$(".mejs-controls").append('<div id="popupButton" class="popupButton"><button title="Open in separate window" type="button"></button></div>'),$(".popupButton button").click(function(){var c=b.getCurrentTime(),d=b.getVolume(),f=b.media.paused,g=0;$(e.element).find("ul.mejs li").each(function(a){$(this).hasClass("current")&&(g=a)});a($(location).attr("href")+"?popup&paused="+f+"¤tTime="+
|
|
|
|
|
c+"&volume="+d+"&trackNo="+g)});else{var c=$(window).height();window.onbeforeunload=function(){$("iframe",opener.top.document).height(c);$(".mejs-audio",opener.document).show();$(".playerDetached",opener.document).hide()}}}},m=function(){if(a){var c=l("paused")&&"true"==l("paused"),d=l("currentTime")?parseFloat(l("currentTime")):0,f=l("volume")?parseFloat(l("volume")):1,g=l("trackNo")?parseInt(l("trackNo")):0;b.setVolume(f);$(e.element).find("ul.mejs li").each(function(a){a==g&&(b.playTrack($(this)),
|
|
|
|
|
b.setCurrentTime(d))});c&&b.pause()}};!1!==l("popup")&&(a=!0,$("body").html('<div id="myplayer" style="width: '+$(e.element).width()+"px; height: "+$(e.element).height()+' px;"></div>'),e.element="#myplayer");if("mp3url"==e.mode){var p="undefined"===typeof e.mp3url?$(location).attr("href").replace(/\?.*/,"").replace(/\/[^\/]+\/?$/,""):e.mp3url;$.ajax({url:p,type:"GET",success:function(a){d();var b=document.createElement("html");b.innerHTML=a;$(b).find("a").each(function(a,b){var c=$(b).attr("href");
|
|
|
|
|
if(c.match(/\.mp3$/)){var c=p+"/"+c,d=b.innerHTML;$(e.audio).append('<source src="'+c+'" title="'+d+'"/>')}});k();n()}})}else if("m3u"==e.mode)c="undefined"===typeof e.m3u?$(location).attr("href").replace(/\?.*/,"").replace(/\/[^\/]+\/?$/,"/play.m3u"):e.m3u,d(),$.get(c,function(a){a=a.split("\n");for(var b=0,c=a.length;b<c;b++)if(!a[b].match(/^[ \t]*#/)&&a[b].match(/\.mp3$/)){var d=a[b],f=unescape(d.split("/").pop());$(e.audio).append('<source src="'+d+'" title="'+f+'"/>')}k();n()});else if("list"==
|
|
|
|
|
e.mode){d();c=0;for(f=e.list.length;c<f;c++){var q=e.list[c],u=typeof q,t="",r="";if(null!==q&&"object"===u){if(q.url)t=q.url;else{alert("MyPlayer: item["+c+']: property "url" is missing.');continue}r=q.title?q.title:q.url}else if("string"===u)r=t=q;else{alert("MyPlayer: item ["+c+']: unsupported type "'+u+'"');continue}$(e.audio).append('<source src="'+t+'" title="'+r+'"/>')}k();n()}else $(e.element).append('<p>Unsupported mode "'+e.mode+'"</p>')};
|