media-player.min.js 67 KB

123
  1. function onYouTubePlayerAPIReady(){mejs.YouTubeApi.iFrameReady()}function onYouTubePlayerReady(e){mejs.YouTubeApi.flashReady(e)}var mejs=mejs||{};mejs.version="2.13.0",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"]}],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"]}],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(e){return encodeURIComponent(e)},escapeHTML:function(e){return e.toString().split("&").join("&amp;").split("<").join("&lt;").split('"').join("&quot;")},absolutizeUrl:function(e){var t=document.createElement("div");return t.innerHTML='<a href="'+this.escapeHTML(e)+'">x</a>',t.firstChild.href},getScriptPath:function(e){for(var t,i,n,s,o,a,r=0,l="",d="",u=document.getElementsByTagName("script"),c=u.length,m=e.length;c>r;r++){for(s=u[r].src,i=s.lastIndexOf("/"),i>-1?(a=s.substring(i+1),o=s.substring(0,i+1)):(a=s,o=""),t=0;m>t;t++)if(d=e[t],n=a.indexOf(d),n>-1){l=o;break}if(""!==l)break}return l},secondsToTimeCode:function(e,t,i,n){"undefined"==typeof i?i=!1:"undefined"==typeof n&&(n=25);var s=Math.floor(e/3600)%24,o=Math.floor(e/60)%60,a=Math.floor(e%60),r=Math.floor((e%1*n).toFixed(3)),l=(t||s>0?(10>s?"0"+s:s)+":":"")+(10>o?"0"+o:o)+":"+(10>a?"0"+a:a)+(i?":"+(10>r?"0"+r:r):"");return l},timeCodeToSeconds:function(e,t,i,n){"undefined"==typeof i?i=!1:"undefined"==typeof n&&(n=25);var s=e.split(":"),o=parseInt(s[0],10),a=parseInt(s[1],10),r=parseInt(s[2],10),l=0,d=0;return i&&(l=parseInt(s[3])/n),d=3600*o+60*a+r+l},convertSMPTEtoSeconds:function(e){if("string"!=typeof e)return!1;e=e.replace(",",".");var t=0,i=-1!=e.indexOf(".")?e.split(".")[1].length:0,n=1;e=e.split(":").reverse();for(var s=0;s<e.length;s++)n=1,s>0&&(n=Math.pow(60,s)),t+=Number(e[s])*n;return Number(t.toFixed(i))},removeSwf:function(e){var t=document.getElementById(e);t&&/object|embed/i.test(t.nodeName)&&(mejs.MediaFeatures.isIE?(t.style.display="none",function(){4==t.readyState?mejs.Utility.removeObjectInIE(e):setTimeout(arguments.callee,10)}()):t.parentNode.removeChild(t))},removeObjectInIE:function(e){var t=document.getElementById(e);if(t){for(var i in t)"function"==typeof t[i]&&(t[i]=null);t.parentNode.removeChild(t)}}},mejs.PluginDetector={hasPluginVersion:function(e,t){var i=this.plugins[e];return t[1]=t[1]||0,t[2]=t[2]||0,i[0]>t[0]||i[0]==t[0]&&i[1]>t[1]||i[0]==t[0]&&i[1]==t[1]&&i[2]>=t[2]?!0:!1},nav:window.navigator,ua:window.navigator.userAgent.toLowerCase(),plugins:[],addPlugin:function(e,t,i,n,s){this.plugins[e]=this.detectPlugin(t,i,n,s)},detectPlugin:function(e,t,i,n){var s,o,a,r=[0,0,0];if("undefined"!=typeof this.nav.plugins&&"object"==typeof this.nav.plugins[e]){if(s=this.nav.plugins[e].description,s&&("undefined"==typeof this.nav.mimeTypes||!this.nav.mimeTypes[t]||this.nav.mimeTypes[t].enabledPlugin))for(r=s.replace(e,"").replace(/^\s+/,"").replace(/\sr/gi,".").split("."),o=0;o<r.length;o++)r[o]=parseInt(r[o].match(/\d+/),10)}else if("undefined"!=typeof window.ActiveXObject)try{a=new ActiveXObject(i),a&&(r=n(a))}catch(l){}return r}},mejs.PluginDetector.addPlugin("flash","Shockwave Flash","application/x-shockwave-flash","ShockwaveFlash.ShockwaveFlash",function(e){var t=[],i=e.GetVariable("$version");return i&&(i=i.split(" ")[1].split(","),t=[parseInt(i[0],10),parseInt(i[1],10),parseInt(i[2],10)]),t}),mejs.PluginDetector.addPlugin("silverlight","Silverlight Plug-In","application/x-silverlight-2","AgControl.AgControl",function(e){var t=[0,0,0,0],i=function(e,t,i,n){for(;e.isVersionSupported(t[0]+"."+t[1]+"."+t[2]+"."+t[3]);)t[i]+=n;t[i]-=n};return i(e,t,0,1),i(e,t,1,1),i(e,t,2,1e4),i(e,t,2,1e3),i(e,t,2,100),i(e,t,2,10),i(e,t,2,1),i(e,t,3,1),t}),mejs.MediaFeatures={init:function(){var e,t,i=this,n=document,s=mejs.PluginDetector.nav,o=mejs.PluginDetector.ua.toLowerCase(),a=["source","track","audio","video"];i.isiPad=null!==o.match(/ipad/i),i.isiPhone=null!==o.match(/iphone/i),i.isiOS=i.isiPhone||i.isiPad,i.isAndroid=null!==o.match(/android/i),i.isBustedAndroid=null!==o.match(/android 2\.[12]/),i.isBustedNativeHTTPS="https:"===location.protocol&&(null!==o.match(/android [12]\./)||null!==o.match(/macintosh.* version.* safari/)),i.isIE=-1!=s.appName.toLowerCase().indexOf("microsoft"),i.isChrome=null!==o.match(/chrome/gi),i.isFirefox=null!==o.match(/firefox/gi),i.isWebkit=null!==o.match(/webkit/gi),i.isGecko=null!==o.match(/gecko/gi)&&!i.isWebkit,i.isOpera=null!==o.match(/opera/gi),i.hasTouch="ontouchstart"in window&&null!=window.ontouchstart,i.svg=!!document.createElementNS&&!!document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGRect;for(e=0;e<a.length;e++)t=document.createElement(a[e]);i.supportsMediaTag="undefined"!=typeof t.canPlayType||i.isBustedAndroid;try{t.canPlayType("video/mp4")}catch(r){i.supportsMediaTag=!1}i.hasSemiNativeFullScreen="undefined"!=typeof t.webkitEnterFullscreen,i.hasWebkitNativeFullScreen="undefined"!=typeof t.webkitRequestFullScreen,i.hasMozNativeFullScreen="undefined"!=typeof t.mozRequestFullScreen,i.hasTrueNativeFullScreen=i.hasWebkitNativeFullScreen||i.hasMozNativeFullScreen,i.nativeFullScreenEnabled=i.hasTrueNativeFullScreen,i.hasMozNativeFullScreen&&(i.nativeFullScreenEnabled=t.mozFullScreenEnabled),this.isChrome&&(i.hasSemiNativeFullScreen=!1),i.hasTrueNativeFullScreen&&(i.fullScreenEventName=i.hasWebkitNativeFullScreen?"webkitfullscreenchange":"mozfullscreenchange",i.isFullScreen=function(){return t.mozRequestFullScreen?n.mozFullScreen:t.webkitRequestFullScreen?n.webkitIsFullScreen:void 0},i.requestFullScreen=function(e){i.hasWebkitNativeFullScreen?e.webkitRequestFullScreen():i.hasMozNativeFullScreen&&e.mozRequestFullScreen()},i.cancelFullScreen=function(){i.hasWebkitNativeFullScreen?document.webkitCancelFullScreen():i.hasMozNativeFullScreen&&document.mozCancelFullScreen()}),i.hasSemiNativeFullScreen&&o.match(/mac os x 10_5/i)&&(i.hasNativeFullScreen=!1,i.hasSemiNativeFullScreen=!1)}},mejs.MediaFeatures.init(),mejs.HtmlMediaElement={pluginType:"native",isFullScreen:!1,setCurrentTime:function(e){this.currentTime=e},setMuted:function(e){this.muted=e},setVolume:function(e){this.volume=e},stop:function(){this.pause()},setSrc:function(e){for(var t=this.getElementsByTagName("source");t.length>0;)this.removeChild(t[0]);if("string"==typeof e)this.src=e;else{var i,n;for(i=0;i<e.length;i++)if(n=e[i],this.canPlayType(n.type)){this.src=n.src;break}}},setVideoSize:function(e,t){this.width=e,this.height=t}},mejs.PluginMediaElement=function(e,t,i){this.id=e,this.pluginType=t,this.src=i,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?this.pluginApi.playVideo():this.pluginApi.playMedia(),this.paused=!1)},load:function(){null!=this.pluginApi&&("youtube"==this.pluginType||this.pluginApi.loadMedia(),this.paused=!1)},pause:function(){null!=this.pluginApi&&("youtube"==this.pluginType?this.pluginApi.pauseVideo():this.pluginApi.pauseMedia(),this.paused=!0)},stop:function(){null!=this.pluginApi&&("youtube"==this.pluginType?this.pluginApi.stopVideo():this.pluginApi.stopMedia(),this.paused=!0)},canPlayType:function(e){var t,i,n,s=mejs.plugins[this.pluginType];for(t=0;t<s.length;t++)if(n=s[t],mejs.PluginDetector.hasPluginVersion(this.pluginType,n.version))for(i=0;i<n.types.length;i++)if(e==n.types[i])return"probably";return""},positionFullscreenButton:function(e,t,i){null!=this.pluginApi&&this.pluginApi.positionFullscreenButton&&this.pluginApi.positionFullscreenButton(Math.floor(e),Math.floor(t),i)},hideFullscreenButton:function(){null!=this.pluginApi&&this.pluginApi.hideFullscreenButton&&this.pluginApi.hideFullscreenButton()},setSrc:function(e){if("string"==typeof e)this.pluginApi.setSrc(mejs.Utility.absolutizeUrl(e)),this.src=mejs.Utility.absolutizeUrl(e);else{var t,i;for(t=0;t<e.length;t++)if(i=e[t],this.canPlayType(i.type)){this.pluginApi.setSrc(mejs.Utility.absolutizeUrl(i.src)),this.src=mejs.Utility.absolutizeUrl(e);break}}},setCurrentTime:function(e){null!=this.pluginApi&&("youtube"==this.pluginType?this.pluginApi.seekTo(e):this.pluginApi.setCurrentTime(e),this.currentTime=e)},setVolume:function(e){null!=this.pluginApi&&(this.pluginApi.setVolume("youtube"==this.pluginType?100*e:e),this.volume=e)},setMuted:function(e){null!=this.pluginApi&&("youtube"==this.pluginType?(e?this.pluginApi.mute():this.pluginApi.unMute(),this.muted=e,this.dispatchEvent("volumechange")):this.pluginApi.setMuted(e),this.muted=e)},setVideoSize:function(e,t){this.pluginElement.style&&(this.pluginElement.style.width=e+"px",this.pluginElement.style.height=t+"px"),null!=this.pluginApi&&this.pluginApi.setVideoSize&&this.pluginApi.setVideoSize(e,t)},setFullscreen:function(e){null!=this.pluginApi&&this.pluginApi.setFullscreen&&this.pluginApi.setFullscreen(e)},enterFullScreen:function(){null!=this.pluginApi&&this.pluginApi.setFullscreen&&this.setFullscreen(!0)},exitFullScreen:function(){null!=this.pluginApi&&this.pluginApi.setFullscreen&&this.setFullscreen(!1)},addEventListener:function(e,t){this.events[e]=this.events[e]||[],this.events[e].push(t)},removeEventListener:function(e,t){if(!e)return this.events={},!0;var n=this.events[e];if(!n)return!0;if(!t)return this.events[e]=[],!0;for(i=0;i<n.length;i++)if(n[i]===t)return this.events[e].splice(i,1),!0;return!1},dispatchEvent:function(e){var t,i,n=this.events[e];if(n)for(i=Array.prototype.slice.call(arguments,1),t=0;t<n.length;t++)n[t].apply(null,i)},hasAttribute:function(e){return e in this.attributes},removeAttribute:function(e){delete this.attributes[e]},getAttribute:function(e){return this.hasAttribute(e)?this.attributes[e]:""},setAttribute:function(e,t){this.attributes[e]=t},remove:function(){mejs.Utility.removeSwf(this.pluginElement.id),mejs.MediaPluginBridge.unregisterPluginElement(this.pluginElement.id)}},mejs.MediaPluginBridge={pluginMediaElements:{},htmlMediaElements:{},registerPluginElement:function(e,t,i){this.pluginMediaElements[e]=t,this.htmlMediaElements[e]=i},unregisterPluginElement:function(e){delete this.pluginMediaElements[e],delete this.htmlMediaElements[e]},initPlugin:function(e){var t=this.pluginMediaElements[e],i=this.htmlMediaElements[e];if(t){switch(t.pluginType){case"flash":t.pluginElement=t.pluginApi=document.getElementById(e);break;case"silverlight":t.pluginElement=document.getElementById(t.id),t.pluginApi=t.pluginElement.Content.MediaElementJS}null!=t.pluginApi&&t.success&&t.success(t,i)}},fireEvent:function(e,t,i){var n,s,o,a=this.pluginMediaElements[e];if(a){n={type:t,target:a};for(s in i)a[s]=i[s],n[s]=i[s];o=i.bufferedTime||0,n.target.buffered=n.buffered={start:function(){return 0},end:function(){return o},length:1},a.dispatchEvent(n.type,n)}}},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:"media/flashmediaelement.swf",flashStreamer:"",enablePluginSmoothing:!1,enablePseudoStreaming:!1,pseudoStreamingStartQueryParam:"start",silverlightName:"media/silverlightmediaelement.xap",defaultVideoWidth:480,defaultVideoHeight:270,pluginWidth:-1,pluginHeight:-1,pluginVars:[],timerRate:250,startVolume:.8,success:function(){},error:function(){}},mejs.MediaElement=function(e,t){return mejs.HtmlMediaElementShim.create(e,t)},mejs.HtmlMediaElementShim={create:function(e,t){var i,n,s=mejs.MediaElementDefaults,o="string"==typeof e?document.getElementById(e):e,a=o.tagName.toLowerCase(),r="audio"===a||"video"===a,l=o.getAttribute(r?"src":"href"),d=o.getAttribute("poster"),u=o.getAttribute("autoplay"),c=o.getAttribute("preload"),m=o.getAttribute("controls");for(n in t)s[n]=t[n];return l="undefined"==typeof l||null===l||""==l?null:l,d="undefined"==typeof d||null===d?"":d,c="undefined"==typeof c||null===c||"false"===c?"none":c,u=!("undefined"==typeof u||null===u||"false"===u),m=!("undefined"==typeof m||null===m||"false"===m),i=this.determinePlayback(o,s,mejs.MediaFeatures.supportsMediaTag,r,l),i.url=null!==i.url?mejs.Utility.absolutizeUrl(i.url):"","native"==i.method?(mejs.MediaFeatures.isBustedAndroid&&(o.src=i.url,o.addEventListener("click",function(){o.play()},!1)),this.updateNative(i,s,u,c)):""!==i.method?this.createPlugin(i,s,d,u,c,m):(this.createErrorMessage(i,s,d),this)},determinePlayback:function(e,t,i,n,s){var o,a,r,l,d,u,c,m,p,h,f,v=[],g={method:"",url:"",htmlMediaElement:e,isVideo:"audio"!=e.tagName.toLowerCase()};if("undefined"!=typeof t.type&&""!==t.type)if("string"==typeof t.type)v.push({type:t.type,url:s});else for(o=0;o<t.type.length;o++)v.push({type:t.type[o],url:s});else if(null!==s)u=this.formatType(s,e.getAttribute("type")),v.push({type:u,url:s});else for(o=0;o<e.childNodes.length;o++)d=e.childNodes[o],1==d.nodeType&&"source"==d.tagName.toLowerCase()&&(s=d.getAttribute("src"),u=this.formatType(s,d.getAttribute("type")),f=d.getAttribute("media"),(!f||!window.matchMedia||window.matchMedia&&window.matchMedia(f).matches)&&v.push({type:u,url:s}));if(!n&&v.length>0&&null!==v[0].url&&this.getTypeFromFile(v[0].url).indexOf("audio")>-1&&(g.isVideo=!1),mejs.MediaFeatures.isBustedAndroid&&(e.canPlayType=function(e){return null!==e.match(/video\/(mp4|m4v)/gi)?"maybe":""}),!(!i||"auto"!==t.mode&&"auto_plugin"!==t.mode&&"native"!==t.mode||mejs.MediaFeatures.isBustedNativeHTTPS&&t.httpsBasicAuthSite===!0)){for(n||(h=document.createElement(g.isVideo?"video":"audio"),e.parentNode.insertBefore(h,e),e.style.display="none",g.htmlMediaElement=e=h),o=0;o<v.length;o++)if(""!==e.canPlayType(v[o].type).replace(/no/,"")||""!==e.canPlayType(v[o].type.replace(/mp3/,"mpeg")).replace(/no/,"")){g.method="native",g.url=v[o].url;break}if("native"===g.method&&(null!==g.url&&(e.src=g.url),"auto_plugin"!==t.mode))return g}if("auto"===t.mode||"auto_plugin"===t.mode||"shim"===t.mode)for(o=0;o<v.length;o++)for(u=v[o].type,a=0;a<t.plugins.length;a++)for(c=t.plugins[a],m=mejs.plugins[c],r=0;r<m.length;r++)if(p=m[r],null==p.version||mejs.PluginDetector.hasPluginVersion(c,p.version))for(l=0;l<p.types.length;l++)if(u==p.types[l])return g.method=c,g.url=v[o].url,g;return"auto_plugin"===t.mode&&"native"===g.method?g:(""===g.method&&v.length>0&&(g.url=v[0].url),g)},formatType:function(e,t){return e&&!t?this.getTypeFromFile(e):t&&~t.indexOf(";")?t.substr(0,t.indexOf(";")):t},getTypeFromFile:function(e){e=e.split("?")[0];var t=e.substring(e.lastIndexOf(".")+1).toLowerCase();return(/(mp4|m4v|ogg|ogv|webm|webmv|flv|wmv|mpeg|mov)/gi.test(t)?"video":"audio")+"/"+this.getTypeFromExtension(t)},getTypeFromExtension:function(e){switch(e){case"mp4":case"m4v":return"mp4";case"webm":case"webma":case"webmv":return"webm";case"ogg":case"oga":case"ogv":return"ogg";default:return e}},createErrorMessage:function(e,t,i){var n=e.htmlMediaElement,s=document.createElement("div");s.className="me-cannotplay";try{s.style.width=n.width+"px",s.style.height=n.height+"px"}catch(o){}s.innerHTML=t.customError?t.customError:""!==i?'<a href="'+e.url+'"><img src="'+i+'" width="100%" height="100%" /></a>':'<a href="'+e.url+'"><span>'+mejs.i18n.t("Download File")+"</span></a>",n.parentNode.insertBefore(s,n),n.style.display="none",t.error(n)},createPlugin:function(e,t,i,n,s,o){var a,r,l,d=e.htmlMediaElement,u=1,c=1,m="me_"+e.method+"_"+mejs.meIndex++,p=new mejs.PluginMediaElement(m,e.method,e.url),h=document.createElement("div");p.tagName=d.tagName;for(var f=0;f<d.attributes.length;f++){var v=d.attributes[f];1==v.specified&&p.setAttribute(v.name,v.value)}for(r=d.parentNode;null!==r&&"body"!=r.tagName.toLowerCase();){if("p"==r.parentNode.tagName.toLowerCase()){r.parentNode.parentNode.insertBefore(r,r.parentNode);break}r=r.parentNode}switch(e.isVideo?(u=t.pluginWidth>0?t.pluginWidth:t.videoWidth>0?t.videoWidth:null!==d.getAttribute("width")?d.getAttribute("width"):t.defaultVideoWidth,c=t.pluginHeight>0?t.pluginHeight:t.videoHeight>0?t.videoHeight:null!==d.getAttribute("height")?d.getAttribute("height"):t.defaultVideoHeight,u=mejs.Utility.encodeUrl(u),c=mejs.Utility.encodeUrl(c)):t.enablePluginDebug&&(u=320,c=240),p.success=t.success,mejs.MediaPluginBridge.registerPluginElement(m,p,d),h.className="me-plugin",h.id=m+"_container",e.isVideo?d.parentNode.insertBefore(h,d):document.body.insertBefore(h,document.body.childNodes[0]),l=["id="+m,"isvideo="+(e.isVideo?"true":"false"),"autoplay="+(n?"true":"false"),"preload="+s,"width="+u,"startvolume="+t.startVolume,"timerrate="+t.timerRate,"flashstreamer="+t.flashStreamer,"height="+c,"pseudostreamstart="+t.pseudoStreamingStartQueryParam],null!==e.url&&l.push("flash"==e.method?"file="+mejs.Utility.encodeUrl(e.url):"file="+e.url),t.enablePluginDebug&&l.push("debug=true"),t.enablePluginSmoothing&&l.push("smoothing=true"),t.enablePseudoStreaming&&l.push("pseudostreaming=true"),o&&l.push("controls=true"),t.pluginVars&&(l=l.concat(t.pluginVars)),e.method){case"silverlight":h.innerHTML='<object data="data:application/x-silverlight-2," type="application/x-silverlight-2" id="'+m+'" name="'+m+'" width="'+u+'" height="'+c+'" class="mejs-shim"><param name="initParams" value="'+l.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="'+t.pluginPath+t.silverlightName+'" /></object>';break;case"flash":mejs.MediaFeatures.isIE?(a=document.createElement("div"),h.appendChild(a),a.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="//download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab" id="'+m+'" width="'+u+'" height="'+c+'" class="mejs-shim"><param name="movie" value="'+t.pluginPath+t.flashName+"?x="+new Date+'" /><param name="flashvars" value="'+l.join("&amp;")+'" /><param name="quality" value="high" /><param name="bgcolor" value="#000000" /><param name="wmode" value="transparent" /><param name="allowScriptAccess" value="always" /><param name="allowFullScreen" value="true" /></object>'):h.innerHTML='<embed id="'+m+'" name="'+m+'" play="true" loop="false" quality="high" bgcolor="#000000" wmode="transparent" allowScriptAccess="always" allowFullScreen="true" type="application/x-shockwave-flash" pluginspage="//www.macromedia.com/go/getflashplayer" src="'+t.pluginPath+t.flashName+'" flashvars="'+l.join("&")+'" width="'+u+'" height="'+c+'" class="mejs-shim"></embed>';break;case"youtube":var g=e.url.substr(e.url.lastIndexOf("=")+1);youtubeSettings={container:h,containerId:h.id,pluginMediaElement:p,pluginId:m,videoId:g,height:c,width:u},mejs.PluginDetector.hasPluginVersion("flash",[10,0,0])?mejs.YouTubeApi.createFlash(youtubeSettings):mejs.YouTubeApi.enqueueIframe(youtubeSettings);break;case"vimeo":p.vimeoid=e.url.substr(e.url.lastIndexOf("/")+1),h.innerHTML='<iframe src="http://player.vimeo.com/video/'+p.vimeoid+'?portrait=0&byline=0&title=0" width="'+u+'" height="'+c+'" frameborder="0" class="mejs-shim"></iframe>'}return d.style.display="none",d.removeAttribute("autoplay"),p},updateNative:function(e,t){var i,n=e.htmlMediaElement;for(i in mejs.HtmlMediaElement)n[i]=mejs.HtmlMediaElement[i];return t.success(n,n),n}},mejs.YouTubeApi={isIframeStarted:!1,isIframeLoaded:!1,loadIframeApi:function(){if(!this.isIframeStarted){var e=document.createElement("script");e.src="//www.youtube.com/player_api";var t=document.getElementsByTagName("script")[0];t.parentNode.insertBefore(e,t),this.isIframeStarted=!0}},iframeQueue:[],enqueueIframe:function(e){this.isLoaded?this.createIframe(e):(this.loadIframeApi(),this.iframeQueue.push(e))},createIframe:function(e){var t=e.pluginMediaElement,i=new YT.Player(e.containerId,{height:e.height,width:e.width,videoId:e.videoId,playerVars:{controls:0},events:{onReady:function(){e.pluginMediaElement.pluginApi=i,mejs.MediaPluginBridge.initPlugin(e.pluginId),setInterval(function(){mejs.YouTubeApi.createEvent(i,t,"timeupdate")},250)},onStateChange:function(e){mejs.YouTubeApi.handleStateChange(e.data,i,t)}}})},createEvent:function(e,t,i){var n={type:i,target:t};if(e&&e.getDuration){t.currentTime=n.currentTime=e.getCurrentTime(),t.duration=n.duration=e.getDuration(),n.paused=t.paused,n.ended=t.ended,n.muted=e.isMuted(),n.volume=e.getVolume()/100,n.bytesTotal=e.getVideoBytesTotal(),n.bufferedBytes=e.getVideoBytesLoaded();var s=n.bufferedBytes/n.bytesTotal*n.duration;n.target.buffered=n.buffered={start:function(){return 0},end:function(){return s},length:1}}t.dispatchEvent(n.type,n)},iFrameReady:function(){for(this.isLoaded=!0,this.isIframeLoaded=!0;this.iframeQueue.length>0;){var e=this.iframeQueue.pop();this.createIframe(e)}},flashPlayers:{},createFlash:function(e){this.flashPlayers[e.pluginId]=e;var t,i="//www.youtube.com/apiplayer?enablejsapi=1&amp;playerapiid="+e.pluginId+"&amp;version=3&amp;autoplay=0&amp;controls=0&amp;modestbranding=1&loop=0";mejs.MediaFeatures.isIE?(t=document.createElement("div"),e.container.appendChild(t),t.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="//download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab" id="'+e.pluginId+'" width="'+e.width+'" height="'+e.height+'" class="mejs-shim"><param name="movie" value="'+i+'" /><param name="wmode" value="transparent" /><param name="allowScriptAccess" value="always" /><param name="allowFullScreen" value="true" /></object>'):e.container.innerHTML='<object type="application/x-shockwave-flash" id="'+e.pluginId+'" data="'+i+'" width="'+e.width+'" height="'+e.height+'" style="visibility: visible; " class="mejs-shim"><param name="allowScriptAccess" value="always"><param name="wmode" value="transparent"></object>'},flashReady:function(e){var t=this.flashPlayers[e],i=document.getElementById(e),n=t.pluginMediaElement;n.pluginApi=n.pluginElement=i,mejs.MediaPluginBridge.initPlugin(e),i.cueVideoById(t.videoId);var s=t.containerId+"_callback";window[s]=function(e){mejs.YouTubeApi.handleStateChange(e,i,n)},i.addEventListener("onStateChange",s),setInterval(function(){mejs.YouTubeApi.createEvent(i,n,"timeupdate")},250)},handleStateChange:function(e,t,i){switch(e){case-1:i.paused=!0,i.ended=!0,mejs.YouTubeApi.createEvent(t,i,"loadedmetadata");break;case 0:i.paused=!1,i.ended=!0,mejs.YouTubeApi.createEvent(t,i,"ended");break;case 1:i.paused=!1,i.ended=!1,mejs.YouTubeApi.createEvent(t,i,"play"),mejs.YouTubeApi.createEvent(t,i,"playing");break;case 2:i.paused=!0,i.ended=!1,mejs.YouTubeApi.createEvent(t,i,"pause");break;case 3:mejs.YouTubeApi.createEvent(t,i,"progress");break;case 5:}}},window.mejs=mejs,window.MediaElement=mejs.MediaElement,function(e,t){"use strict";var i={locale:{language:"",strings:{}},methods:{}};i.locale.getLanguage=function(){return i.locale.language||navigator.language},"undefined"!=typeof mejsL10n&&(i.locale.language=mejsL10n.language),i.locale.INIT_LANGUAGE=i.locale.getLanguage(),i.methods.checkPlain=function(e){var t,i,n={"&":"&amp;",'"':"&quot;","<":"&lt;",">":"&gt;"};e=String(e);for(t in n)n.hasOwnProperty(t)&&(i=new RegExp(t,"g"),e=e.replace(i,n[t]));return e},i.methods.formatString=function(e,t){for(var n in t){switch(n.charAt(0)){case"@":t[n]=i.methods.checkPlain(t[n]);break;case"!":break;case"%":default:t[n]='<em class="placeholder">'+i.methods.checkPlain(t[n])+"</em>"}e=e.replace(n,t[n])}return e},i.methods.t=function(e,t,n){return i.locale.strings&&i.locale.strings[n.context]&&i.locale.strings[n.context][e]&&(e=i.locale.strings[n.context][e]),t&&(e=i.methods.formatString(e,t)),e},i.t=function(e,t,n){if("string"==typeof e&&e.length>0){var s=i.locale.getLanguage();return n=n||{context:s},i.methods.t(e,t,n)}throw{name:"InvalidArgumentException",message:"First argument is either not a string or empty."}},t.i18n=i}(document,mejs),function(e){"use strict";"undefined"!=typeof mejsL10n&&(e[mejsL10n.language]=mejsL10n.strings)}(mejs.i18n.locale.strings),function(e){"use strict";e.de={Fullscreen:"Vollbild","Go Fullscreen":"Vollbild an","Turn off Fullscreen":"Vollbild aus",Close:"Schließen"}}(mejs.i18n.locale.strings),function(e){"use strict";e.zh={Fullscreen:"全螢幕","Go Fullscreen":"全屏模式","Turn off Fullscreen":"退出全屏模式",Close:"關閉"}}(mejs.i18n.locale.strings),"undefined"!=typeof jQuery?mejs.$=jQuery:"undefined"!=typeof ender&&(mejs.$=ender),function(e){mejs.MepDefaults={poster:"",showPosterWhenEnded:!1,defaultVideoWidth:480,defaultVideoHeight:270,videoWidth:-1,videoHeight:-1,defaultAudioWidth:400,defaultAudioHeight:30,defaultSeekBackwardInterval:function(e){return.05*e.duration},defaultSeekForwardInterval:function(e){return.05*e.duration},audioWidth:-1,audioHeight:-1,startVolume:.8,loop:!1,autoRewind:!0,enableAutosize:!0,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"],isVideo:!0,enableKeyboard:!0,pauseOtherPlayers:!0,keyActions:[{keys:[32,179],action:function(e,t){t.paused||t.ended?t.play():t.pause()}},{keys:[38],action:function(e,t){var i=Math.min(t.volume+.1,1);t.setVolume(i)}},{keys:[40],action:function(e,t){var i=Math.max(t.volume-.1,0);t.setVolume(i)}},{keys:[37,227],action:function(e,t){if(!isNaN(t.duration)&&t.duration>0){e.isVideo&&(e.showControls(),e.startControlsTimer());var i=Math.max(t.currentTime-e.options.defaultSeekBackwardInterval(t),0);t.setCurrentTime(i)}}},{keys:[39,228],action:function(e,t){if(!isNaN(t.duration)&&t.duration>0){e.isVideo&&(e.showControls(),e.startControlsTimer());var i=Math.min(t.currentTime+e.options.defaultSeekForwardInterval(t),t.duration);t.setCurrentTime(i)}}},{keys:[70],action:function(e){"undefined"!=typeof e.enterFullScreen&&(e.isFullScreen?e.exitFullScreen():e.enterFullScreen())}}]},mejs.mepIndex=0,mejs.players={},mejs.MediaElementPlayer=function(t,i){if(!(this instanceof mejs.MediaElementPlayer))return new mejs.MediaElementPlayer(t,i);var n=this;return n.$media=n.$node=e(t),n.node=n.media=n.$media[0],"undefined"!=typeof n.node.player?n.node.player:(n.node.player=n,"undefined"==typeof i&&(i=n.$node.data("mejsoptions")),n.options=e.extend({},mejs.MepDefaults,i),n.id="mep_"+mejs.mepIndex++,mejs.players[n.id]=n,n.init(),n)},mejs.MediaElementPlayer.prototype={hasFocus:!1,controlsAreVisible:!0,init:function(){var t=this,i=mejs.MediaFeatures,n=e.extend(!0,{},t.options,{success:function(e,i){t.meReady(e,i)},error:function(e){t.handleError(e)}}),s=t.media.tagName.toLowerCase();if(t.isDynamic="audio"!==s&&"video"!==s,t.isVideo=t.isDynamic?t.options.isVideo:"audio"!==s&&t.options.isVideo,i.isiPad&&t.options.iPadUseNativeControls||i.isiPhone&&t.options.iPhoneUseNativeControls)t.$media.attr("controls","controls"),i.isiPad&&null!==t.media.getAttribute("autoplay")&&(t.media.load(),t.media.play());else if(i.isAndroid&&t.options.AndroidUseNativeControls);else{if(t.$media.removeAttr("controls"),t.container=e('<div id="'+t.id+'" class="mejs-container '+(mejs.MediaFeatures.svg?"svg":"no-svg")+'"><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(t.$media[0].className).insertBefore(t.$media),t.container.addClass((i.isAndroid?"mejs-android ":"")+(i.isiOS?"mejs-ios ":"")+(i.isiPad?"mejs-ipad ":"")+(i.isiPhone?"mejs-iphone ":"")+(t.isVideo?"mejs-video ":"mejs-audio ")),i.isiOS){var o=t.$media.clone();t.container.find(".mejs-mediaelement").append(o),t.$media.remove(),t.$node=t.$media=o,t.node=t.media=o[0]}else t.container.find(".mejs-mediaelement").append(t.$media);t.controls=t.container.find(".mejs-controls"),t.layers=t.container.find(".mejs-layers");var a=t.isVideo?"video":"audio",r=a.substring(0,1).toUpperCase()+a.substring(1);t.width=t.options[a+"Width"]>0||t.options[a+"Width"].toString().indexOf("%")>-1?t.options[a+"Width"]:""!==t.media.style.width&&null!==t.media.style.width?t.media.style.width:null!==t.media.getAttribute("width")?t.$media.attr("width"):t.options["default"+r+"Width"],t.height=t.options[a+"Height"]>0||t.options[a+"Height"].toString().indexOf("%")>-1?t.options[a+"Height"]:""!==t.media.style.height&&null!==t.media.style.height?t.media.style.height:null!==t.$media[0].getAttribute("height")?t.$media.attr("height"):t.options["default"+r+"Height"],t.setPlayerSize(t.width,t.height),n.pluginWidth=t.width,n.pluginHeight=t.height}mejs.MediaElement(t.$media[0],n),"undefined"!=typeof t.container&&t.controlsAreVisible&&t.container.trigger("controlsshown")},showControls:function(e){var t=this;e="undefined"==typeof e||e,t.controlsAreVisible||(e?(t.controls.css("visibility","visible").stop(!0,!0).fadeIn(200,function(){t.controlsAreVisible=!0,t.container.trigger("controlsshown")}),t.container.find(".mejs-control").css("visibility","visible").stop(!0,!0).fadeIn(200,function(){t.controlsAreVisible=!0})):(t.controls.css("visibility","visible").css("display","block"),t.container.find(".mejs-control").css("visibility","visible").css("display","block"),t.controlsAreVisible=!0,t.container.trigger("controlsshown")),t.setControlsSize())},hideControls:function(t){var i=this;t="undefined"==typeof t||t,i.controlsAreVisible&&!i.options.alwaysShowControls&&(t?(i.controls.stop(!0,!0).fadeOut(200,function(){e(this).css("visibility","hidden").css("display","block"),i.controlsAreVisible=!1,i.container.trigger("controlshidden")}),i.container.find(".mejs-control").stop(!0,!0).fadeOut(200,function(){e(this).css("visibility","hidden").css("display","block")})):(i.controls.css("visibility","hidden").css("display","block"),i.container.find(".mejs-control").css("visibility","hidden").css("display","block"),i.controlsAreVisible=!1,i.container.trigger("controlshidden")))},controlsTimer:null,startControlsTimer:function(e){var t=this;e="undefined"!=typeof e?e:1500,t.killControlsTimer("start"),t.controlsTimer=setTimeout(function(){t.hideControls(),t.killControlsTimer("hide")},e)},killControlsTimer:function(){var e=this;null!==e.controlsTimer&&(clearTimeout(e.controlsTimer),delete e.controlsTimer,e.controlsTimer=null)},controlsEnabled:!0,disableControls:function(){var e=this;e.killControlsTimer(),e.hideControls(!1),this.controlsEnabled=!1},enableControls:function(){var e=this;e.showControls(!1),e.controlsEnabled=!0},meReady:function(e,t){var i,n,s=this,o=mejs.MediaFeatures,a=t.getAttribute("autoplay"),r=!("undefined"==typeof a||null===a||"false"===a);if(!s.created){if(s.created=!0,s.media=e,s.domNode=t,!(o.isAndroid&&s.options.AndroidUseNativeControls||o.isiPad&&s.options.iPadUseNativeControls||o.isiPhone&&s.options.iPhoneUseNativeControls)){s.buildposter(s,s.controls,s.layers,s.media),s.buildkeyboard(s,s.controls,s.layers,s.media),s.buildoverlays(s,s.controls,s.layers,s.media),s.findTracks();for(i in s.options.features)if(n=s.options.features[i],s["build"+n])try{s["build"+n](s,s.controls,s.layers,s.media)}catch(l){}s.container.trigger("controlsready"),s.setPlayerSize(s.width,s.height),s.setControlsSize(),s.isVideo&&(mejs.MediaFeatures.hasTouch?s.$media.bind("touchstart",function(){s.controlsAreVisible?s.hideControls(!1):s.controlsEnabled&&s.showControls(!1)}):(mejs.MediaElementPlayer.prototype.clickToPlayPauseCallback=function(){s.options.clickToPlayPause&&(s.media.paused?s.media.play():s.media.pause())},s.media.addEventListener("click",s.clickToPlayPauseCallback,!1),s.container.bind("mouseenter mouseover",function(){s.controlsEnabled&&(s.options.alwaysShowControls||(s.killControlsTimer("enter"),s.showControls(),s.startControlsTimer(2500)))
  2. }).bind("mousemove",function(){s.controlsEnabled&&(s.controlsAreVisible||s.showControls(),s.options.alwaysShowControls||s.startControlsTimer(2500))}).bind("mouseleave",function(){s.controlsEnabled&&(s.media.paused||s.options.alwaysShowControls||s.startControlsTimer(1e3))})),s.options.hideVideoControlsOnLoad&&s.hideControls(!1),r&&!s.options.alwaysShowControls&&s.hideControls(),s.options.enableAutosize&&s.media.addEventListener("loadedmetadata",function(e){s.options.videoHeight<=0&&null===s.domNode.getAttribute("height")&&!isNaN(e.target.videoHeight)&&(s.setPlayerSize(e.target.videoWidth,e.target.videoHeight),s.setControlsSize(),s.media.setVideoSize(e.target.videoWidth,e.target.videoHeight))},!1)),e.addEventListener("play",function(){var e;for(e in mejs.players){var t=mejs.players[e];t.id==s.id||!s.options.pauseOtherPlayers||t.paused||t.ended||t.pause(),t.hasFocus=!1}s.hasFocus=!0},!1),s.media.addEventListener("ended",function(){if(s.options.autoRewind)try{s.media.setCurrentTime(0)}catch(e){}s.media.pause(),s.setProgressRail&&s.setProgressRail(),s.setCurrentRail&&s.setCurrentRail(),s.options.loop?s.media.play():!s.options.alwaysShowControls&&s.controlsEnabled&&s.showControls()},!1),s.media.addEventListener("loadedmetadata",function(){s.updateDuration&&s.updateDuration(),s.updateCurrent&&s.updateCurrent(),s.isFullScreen||(s.setPlayerSize(s.width,s.height),s.setControlsSize())},!1),setTimeout(function(){s.setPlayerSize(s.width,s.height),s.setControlsSize()},50),s.globalBind("resize",function(){s.isFullScreen||mejs.MediaFeatures.hasTrueNativeFullScreen&&document.webkitIsFullScreen||s.setPlayerSize(s.width,s.height),s.setControlsSize()}),"youtube"==s.media.pluginType&&s.container.find(".mejs-overlay-play").hide()}r&&"native"==e.pluginType&&(e.load(),e.play()),s.options.success&&("string"==typeof s.options.success?window[s.options.success](s.media,s.domNode,s):s.options.success(s.media,s.domNode,s))}},handleError:function(e){var t=this;t.controls.hide(),t.options.error&&t.options.error(e)},setPlayerSize:function(t,i){var n=this;if("undefined"!=typeof t&&(n.width=t),"undefined"!=typeof i&&(n.height=i),n.height.toString().indexOf("%")>0||"100%"===n.$node.css("max-width")||parseInt(n.$node.css("max-width").replace(/px/,""),10)/n.$node.offsetParent().width()===1||n.$node[0].currentStyle&&"100%"===n.$node[0].currentStyle.maxWidth){var s=n.isVideo?n.media.videoWidth&&n.media.videoWidth>0?n.media.videoWidth:n.options.defaultVideoWidth:n.options.defaultAudioWidth,o=n.isVideo?n.media.videoHeight&&n.media.videoHeight>0?n.media.videoHeight:n.options.defaultVideoHeight:n.options.defaultAudioHeight,a=n.container.parent().closest(":visible").width(),r=n.isVideo||!n.options.autosizeProgress?parseInt(a*o/s,10):o;"body"===n.container.parent()[0].tagName.toLowerCase()&&(a=e(window).width(),r=e(window).height()),0!=r&&0!=a&&(n.container.width(a).height(r),n.$media.add(n.container.find(".mejs-shim")).width("100%").height("100%"),n.isVideo&&n.media.setVideoSize&&n.media.setVideoSize(a,r),n.layers.children(".mejs-layer").width("100%").height("100%"))}else n.container.width(n.width).height(n.height),n.layers.children(".mejs-layer").width(n.width).height(n.height);var l=n.layers.find(".mejs-overlay-play"),d=l.find(".mejs-overlay-button");l.height(n.container.height()-n.controls.height()),d.css("margin-top","-"+(d.height()/2-n.controls.height()/2).toString()+"px")},setControlsSize:function(){var t=this,i=0,n=0,s=t.controls.find(".mejs-time-rail"),o=t.controls.find(".mejs-time-total"),a=(t.controls.find(".mejs-time-current"),t.controls.find(".mejs-time-loaded"),s.siblings());t.options&&!t.options.autosizeProgress&&(n=parseInt(s.css("width"))),0!==n&&n||(a.each(function(){var t=e(this);"absolute"!=t.css("position")&&t.is(":visible")&&(i+=e(this).outerWidth(!0))}),n=t.controls.width()-i-(s.outerWidth(!0)-s.width())),s.width(n),o.width(n-(o.outerWidth(!0)-o.width())),t.setProgressRail&&t.setProgressRail(),t.setCurrentRail&&t.setCurrentRail()},buildposter:function(t,i,n,s){var o=this,a=e('<div class="mejs-poster mejs-layer"></div>').appendTo(n),r=t.$media.attr("poster");""!==t.options.poster&&(r=t.options.poster),""!==r&&null!=r?o.setPoster(r):a.hide(),s.addEventListener("play",function(){a.hide()},!1),t.options.showPosterWhenEnded&&t.options.autoRewind&&s.addEventListener("ended",function(){a.show()},!1)},setPoster:function(t){var i=this,n=i.container.find(".mejs-poster"),s=n.find("img");0==s.length&&(s=e('<img width="100%" height="100%" />').appendTo(n)),s.attr("src",t),n.css({"background-image":"url("+t+")"})},buildoverlays:function(t,i,n,s){var o=this;if(t.isVideo){var a=e('<div class="mejs-overlay mejs-layer"><div class="mejs-overlay-loading"><span></span></div></div>').hide().appendTo(n),r=e('<div class="mejs-overlay mejs-layer"><div class="mejs-overlay-error"></div></div>').hide().appendTo(n),l=e('<div class="mejs-overlay mejs-layer mejs-overlay-play"><div class="mejs-overlay-button"></div></div>').appendTo(n).click(function(){o.options.clickToPlayPause&&(s.paused?s.play():s.pause())});s.addEventListener("play",function(){l.hide(),a.hide(),i.find(".mejs-time-buffering").hide(),r.hide()},!1),s.addEventListener("playing",function(){l.hide(),a.hide(),i.find(".mejs-time-buffering").hide(),r.hide()},!1),s.addEventListener("seeking",function(){a.show(),i.find(".mejs-time-buffering").show()},!1),s.addEventListener("seeked",function(){a.hide(),i.find(".mejs-time-buffering").hide()},!1),s.addEventListener("pause",function(){mejs.MediaFeatures.isiPhone||l.show()},!1),s.addEventListener("waiting",function(){a.show(),i.find(".mejs-time-buffering").show()},!1),s.addEventListener("loadeddata",function(){a.show(),i.find(".mejs-time-buffering").show()},!1),s.addEventListener("canplay",function(){a.hide(),i.find(".mejs-time-buffering").hide()},!1),s.addEventListener("error",function(){a.hide(),i.find(".mejs-time-buffering").hide(),r.show(),r.find("mejs-overlay-error").html("Error loading this resource")},!1)}},buildkeyboard:function(t,i,n,s){var o=this;o.globalBind("keydown",function(e){if(t.hasFocus&&t.options.enableKeyboard)for(var i=0,n=t.options.keyActions.length;n>i;i++)for(var o=t.options.keyActions[i],a=0,r=o.keys.length;r>a;a++)if(e.keyCode==o.keys[a])return e.preventDefault(),o.action(t,s,e.keyCode),!1;return!0}),o.globalBind("click",function(i){0==e(i.target).closest(".mejs-container").length&&(t.hasFocus=!1)})},findTracks:function(){var t=this,i=t.$media.find("track");t.tracks=[],i.each(function(i,n){n=e(n),t.tracks.push({srclang:n.attr("srclang")?n.attr("srclang").toLowerCase():"",src:n.attr("src"),kind:n.attr("kind"),label:n.attr("label")||"",entries:[],isLoaded:!1})})},changeSkin:function(e){this.container[0].className="mejs-container "+e,this.setPlayerSize(this.width,this.height),this.setControlsSize()},play:function(){this.media.play()},pause:function(){try{this.media.pause()}catch(e){}},load:function(){this.media.load()},setMuted:function(e){this.media.setMuted(e)},setCurrentTime:function(e){this.media.setCurrentTime(e)},getCurrentTime:function(){return this.media.currentTime},setVolume:function(e){this.media.setVolume(e)},getVolume:function(){return this.media.volume},setSrc:function(e){this.media.setSrc(e)},remove:function(){var e,t,i=this;for(e in i.options.features)if(t=i.options.features[e],i["clean"+t])try{i["clean"+t](i)}catch(n){}i.isDynamic?i.$node.insertBefore(i.container):(i.$media.prop("controls",!0),i.$node.clone().show().insertBefore(i.container),i.$node.remove()),"native"!==i.media.pluginType&&i.media.remove(),delete mejs.players[i.id],i.container.remove(),i.globalUnbind(),delete i.node.player}},function(){function t(t,n){var s={d:[],w:[]};return e.each((t||"").split(" "),function(e,t){var o=t+"."+n;0===o.indexOf(".")?(s.d.push(o),s.w.push(o)):s[i.test(t)?"w":"d"].push(o)}),s.d=s.d.join(" "),s.w=s.w.join(" "),s}var i=/^((after|before)print|(before)?unload|hashchange|message|o(ff|n)line|page(hide|show)|popstate|resize|storage)\b/;mejs.MediaElementPlayer.prototype.globalBind=function(i,n,s){var o=this;i=t(i,o.id),i.d&&e(document).bind(i.d,n,s),i.w&&e(window).bind(i.w,n,s)},mejs.MediaElementPlayer.prototype.globalUnbind=function(i,n){var s=this;i=t(i,s.id),i.d&&e(document).unbind(i.d,n),i.w&&e(window).unbind(i.w,n)}}(),"undefined"!=typeof jQuery&&(jQuery.fn.mediaelementplayer=function(e){return this.each(e===!1?function(){var e=jQuery(this).data("mediaelementplayer");e&&e.remove(),jQuery(this).removeData("mediaelementplayer")}:function(){jQuery(this).data("mediaelementplayer",new mejs.MediaElementPlayer(this,e))}),this}),e(document).ready(function(){e(".mejs-player").mediaelementplayer()}),window.MediaElementPlayer=mejs.MediaElementPlayer}(mejs.$),function(e){e.extend(mejs.MepDefaults,{playpauseText:mejs.i18n.t("Play/Pause")}),e.extend(MediaElementPlayer.prototype,{buildplaypause:function(t,i,n,s){var o=this,a=e('<div class="mejs-button mejs-playpause-button mejs-play" ><button type="button" aria-controls="'+o.id+'" title="'+o.options.playpauseText+'" aria-label="'+o.options.playpauseText+'"></button></div>').appendTo(i).click(function(e){return e.preventDefault(),s.paused?s.play():s.pause(),!1});s.addEventListener("play",function(){a.removeClass("mejs-play").addClass("mejs-pause")},!1),s.addEventListener("playing",function(){a.removeClass("mejs-play").addClass("mejs-pause")},!1),s.addEventListener("pause",function(){a.removeClass("mejs-pause").addClass("mejs-play")},!1),s.addEventListener("paused",function(){a.removeClass("mejs-pause").addClass("mejs-play")},!1)}})}(mejs.$),function(e){e.extend(mejs.MepDefaults,{stopText:"Stop"}),e.extend(MediaElementPlayer.prototype,{buildstop:function(t,i,n,s){{var o=this;e('<div class="mejs-button mejs-stop-button mejs-stop"><button type="button" aria-controls="'+o.id+'" title="'+o.options.stopText+'" aria-label="'+o.options.stopText+'"></button></div>').appendTo(i).click(function(){s.paused||s.pause(),s.currentTime>0&&(s.setCurrentTime(0),s.pause(),i.find(".mejs-time-current").width("0px"),i.find(".mejs-time-handle").css("left","0px"),i.find(".mejs-time-float-current").html(mejs.Utility.secondsToTimeCode(0)),i.find(".mejs-currenttime").html(mejs.Utility.secondsToTimeCode(0)),n.find(".mejs-poster").show())})}}})}(mejs.$),function(e){e.extend(MediaElementPlayer.prototype,{buildprogress:function(t,i,n,s){e('<div class="mejs-time-rail"><span class="mejs-time-total"><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(i),i.find(".mejs-time-buffering").hide();var o=this,a=i.find(".mejs-time-total"),r=i.find(".mejs-time-loaded"),l=i.find(".mejs-time-current"),d=i.find(".mejs-time-handle"),u=i.find(".mejs-time-float"),c=i.find(".mejs-time-float-current"),m=function(e){var t=e.pageX,i=a.offset(),n=a.outerWidth(!0),o=0,r=0,l=0;s.duration&&(t<i.left?t=i.left:t>n+i.left&&(t=n+i.left),l=t-i.left,o=l/n,r=.02>=o?0:o*s.duration,p&&r!==s.currentTime&&s.setCurrentTime(r),mejs.MediaFeatures.hasTouch||(u.css("left",l),c.html(mejs.Utility.secondsToTimeCode(r)),u.show()))},p=!1,h=!1;a.bind("mousedown",function(e){return 1===e.which?(p=!0,m(e),o.globalBind("mousemove.dur",function(e){m(e)}),o.globalBind("mouseup.dur",function(){p=!1,u.hide(),o.globalUnbind(".dur")}),!1):void 0}).bind("mouseenter",function(){h=!0,o.globalBind("mousemove.dur",function(e){m(e)}),mejs.MediaFeatures.hasTouch||u.show()}).bind("mouseleave",function(){h=!1,p||(o.globalUnbind(".dur"),u.hide())}),s.addEventListener("progress",function(e){t.setProgressRail(e),t.setCurrentRail(e)},!1),s.addEventListener("timeupdate",function(e){t.setProgressRail(e),t.setCurrentRail(e)},!1),o.loaded=r,o.total=a,o.current=l,o.handle=d},setProgressRail:function(e){var t=this,i=void 0!=e?e.target:t.media,n=null;i&&i.buffered&&i.buffered.length>0&&i.buffered.end&&i.duration?n=i.buffered.end(0)/i.duration:i&&void 0!=i.bytesTotal&&i.bytesTotal>0&&void 0!=i.bufferedBytes?n=i.bufferedBytes/i.bytesTotal:e&&e.lengthComputable&&0!=e.total&&(n=e.loaded/e.total),null!==n&&(n=Math.min(1,Math.max(0,n)),t.loaded&&t.total&&t.loaded.width(t.total.width()*n))},setCurrentRail:function(){var e=this;if(void 0!=e.media.currentTime&&e.media.duration&&e.total&&e.handle){var t=Math.round(e.total.width()*e.media.currentTime/e.media.duration),i=t-Math.round(e.handle.outerWidth(!0)/2);e.current.width(t),e.handle.css("left",i)}}})}(mejs.$),function(e){e.extend(mejs.MepDefaults,{duration:-1,timeAndDurationSeparator:"<span> | </span>"}),e.extend(MediaElementPlayer.prototype,{buildcurrent:function(t,i,n,s){var o=this;e('<div class="mejs-time"><span class="mejs-currenttime">'+(t.options.alwaysShowHours?"00:":"")+(t.options.showTimecodeFrameCount?"00:00:00":"00:00")+"</span></div>").appendTo(i),o.currenttime=o.controls.find(".mejs-currenttime"),s.addEventListener("timeupdate",function(){t.updateCurrent()},!1)},buildduration:function(t,i,n,s){var o=this;i.children().last().find(".mejs-currenttime").length>0?e(o.options.timeAndDurationSeparator+'<span class="mejs-duration">'+(o.options.duration>0?mejs.Utility.secondsToTimeCode(o.options.duration,o.options.alwaysShowHours||o.media.duration>3600,o.options.showTimecodeFrameCount,o.options.framesPerSecond||25):(t.options.alwaysShowHours?"00:":"")+(t.options.showTimecodeFrameCount?"00:00:00":"00:00"))+"</span>").appendTo(i.find(".mejs-time")):(i.find(".mejs-currenttime").parent().addClass("mejs-currenttime-container"),e('<div class="mejs-time mejs-duration-container"><span class="mejs-duration">'+(o.options.duration>0?mejs.Utility.secondsToTimeCode(o.options.duration,o.options.alwaysShowHours||o.media.duration>3600,o.options.showTimecodeFrameCount,o.options.framesPerSecond||25):(t.options.alwaysShowHours?"00:":"")+(t.options.showTimecodeFrameCount?"00:00:00":"00:00"))+"</span></div>").appendTo(i)),o.durationD=o.controls.find(".mejs-duration"),s.addEventListener("timeupdate",function(){t.updateDuration()},!1)},updateCurrent:function(){var e=this;e.currenttime&&e.currenttime.html(mejs.Utility.secondsToTimeCode(e.media.currentTime,e.options.alwaysShowHours||e.media.duration>3600,e.options.showTimecodeFrameCount,e.options.framesPerSecond||25))},updateDuration:function(){var e=this;e.container.toggleClass("mejs-long-video",e.media.duration>3600),e.durationD&&(e.options.duration>0||e.media.duration)&&e.durationD.html(mejs.Utility.secondsToTimeCode(e.options.duration>0?e.options.duration:e.media.duration,e.options.alwaysShowHours,e.options.showTimecodeFrameCount,e.options.framesPerSecond||25))}})}(mejs.$),function(e){e.extend(mejs.MepDefaults,{muteText:mejs.i18n.t("Mute Toggle"),hideVolumeOnTouchDevices:!0,audioVolume:"horizontal",videoVolume:"vertical"}),e.extend(MediaElementPlayer.prototype,{buildvolume:function(t,i,n,s){if(!mejs.MediaFeatures.hasTouch||!this.options.hideVolumeOnTouchDevices){var o=this,a=o.isVideo?o.options.videoVolume:o.options.audioVolume,r="horizontal"==a?e('<div class="mejs-button mejs-volume-button mejs-mute"><button type="button" aria-controls="'+o.id+'" title="'+o.options.muteText+'" aria-label="'+o.options.muteText+'"></button></div><div class="mejs-horizontal-volume-slider"><div class="mejs-horizontal-volume-total"></div><div class="mejs-horizontal-volume-current"></div><div class="mejs-horizontal-volume-handle"></div></div>').appendTo(i):e('<div class="mejs-button mejs-volume-button mejs-mute"><button type="button" aria-controls="'+o.id+'" title="'+o.options.muteText+'" aria-label="'+o.options.muteText+'"></button><div class="mejs-volume-slider"><div class="mejs-volume-total"></div><div class="mejs-volume-current"></div><div class="mejs-volume-handle"></div></div></div>').appendTo(i),l=o.container.find(".mejs-volume-slider, .mejs-horizontal-volume-slider"),d=o.container.find(".mejs-volume-total, .mejs-horizontal-volume-total"),u=o.container.find(".mejs-volume-current, .mejs-horizontal-volume-current"),c=o.container.find(".mejs-volume-handle, .mejs-horizontal-volume-handle"),m=function(e,t){if(!l.is(":visible")&&"undefined"==typeof t)return l.show(),m(e,!0),void l.hide();if(e=Math.max(0,e),e=Math.min(e,1),0==e?r.removeClass("mejs-mute").addClass("mejs-unmute"):r.removeClass("mejs-unmute").addClass("mejs-mute"),"vertical"==a){var i=d.height(),n=d.position(),s=i-i*e;c.css("top",Math.round(n.top+s-c.height()/2)),u.height(i-s),u.css("top",n.top+s)}else{var o=d.width(),n=d.position(),p=o*e;c.css("left",Math.round(n.left+p-c.width()/2)),u.width(Math.round(p))}},p=function(e){var t=null,i=d.offset();if("vertical"==a){var n=d.height(),o=(parseInt(d.css("top").replace(/px/,""),10),e.pageY-i.top);if(t=(n-o)/n,0==i.top||0==i.left)return}else{var r=d.width(),l=e.pageX-i.left;t=l/r}t=Math.max(0,t),t=Math.min(t,1),m(t),s.setMuted(0==t?!0:!1),s.setVolume(t)},h=!1,f=!1;r.hover(function(){l.show(),f=!0},function(){f=!1,h||"vertical"!=a||l.hide()}),l.bind("mouseover",function(){f=!0}).bind("mousedown",function(e){return p(e),o.globalBind("mousemove.vol",function(e){p(e)}),o.globalBind("mouseup.vol",function(){h=!1,o.globalUnbind(".vol"),f||"vertical"!=a||l.hide()}),h=!0,!1}),r.find("button").click(function(){s.setMuted(!s.muted)}),s.addEventListener("volumechange",function(){h||(s.muted?(m(0),r.removeClass("mejs-mute").addClass("mejs-unmute")):(m(s.volume),r.removeClass("mejs-unmute").addClass("mejs-mute")))},!1),o.container.is(":visible")&&(m(t.options.startVolume),0===t.options.startVolume&&s.setMuted(!0),"native"===s.pluginType&&s.setVolume(t.options.startVolume))}}})}(mejs.$),function(e){e.extend(mejs.MepDefaults,{usePluginFullScreen:!0,newWindowCallback:function(){return""},fullscreenText:mejs.i18n.t("Fullscreen")}),e.extend(MediaElementPlayer.prototype,{isFullScreen:!1,isNativeFullScreen:!1,isInIframe:!1,buildfullscreen:function(t,i,n,s){if(t.isVideo){if(t.isInIframe=window.location!=window.parent.location,mejs.MediaFeatures.hasTrueNativeFullScreen){var o=function(){t.isFullScreen&&(mejs.MediaFeatures.isFullScreen()?(t.isNativeFullScreen=!0,t.setControlsSize()):(t.isNativeFullScreen=!1,t.exitFullScreen()))};mejs.MediaFeatures.hasMozNativeFullScreen?t.globalBind(mejs.MediaFeatures.fullScreenEventName,o):t.container.bind(mejs.MediaFeatures.fullScreenEventName,o)}var a=this,r=(t.container,e('<div class="mejs-button mejs-fullscreen-button"><button type="button" aria-controls="'+a.id+'" title="'+a.options.fullscreenText+'" aria-label="'+a.options.fullscreenText+'"></button></div>').appendTo(i));if("native"===a.media.pluginType||!a.options.usePluginFullScreen&&!mejs.MediaFeatures.isFirefox)r.click(function(){var e=mejs.MediaFeatures.hasTrueNativeFullScreen&&mejs.MediaFeatures.isFullScreen()||t.isFullScreen;e?t.exitFullScreen():t.enterFullScreen()});else{var l=null,d=function(){var e,t=document.createElement("x"),i=document.documentElement,n=window.getComputedStyle;return"pointerEvents"in t.style?(t.style.pointerEvents="auto",t.style.pointerEvents="x",i.appendChild(t),e=n&&"auto"===n(t,"").pointerEvents,i.removeChild(t),!!e):!1}();if(d&&!mejs.MediaFeatures.isOpera){var u,c,m=!1,p=function(){if(m){for(var e in h)h[e].hide();r.css("pointer-events",""),a.controls.css("pointer-events",""),a.media.removeEventListener("click",a.clickToPlayPauseCallback),m=!1}},h={},f=["top","left","right","bottom"],v=function(){var e=r.offset().left-a.container.offset().left,t=r.offset().top-a.container.offset().top,i=r.outerWidth(!0),n=r.outerHeight(!0),s=a.container.width(),o=a.container.height();for(u in h)h[u].css({position:"absolute",top:0,left:0});h.top.width(s).height(t),h.left.width(e).height(n).css({top:t}),h.right.width(s-e-i).height(n).css({top:t,left:e+i}),h.bottom.width(s).height(o-n-t).css({top:t+n})};for(a.globalBind("resize",function(){v()}),u=0,c=f.length;c>u;u++)h[f[u]]=e('<div class="mejs-fullscreen-hover" />').appendTo(a.container).mouseover(p).hide();r.on("mouseover",function(){if(!a.isFullScreen){var e=r.offset(),i=t.container.offset();s.positionFullscreenButton(e.left-i.left,e.top-i.top,!1),r.css("pointer-events","none"),a.controls.css("pointer-events","none"),a.media.addEventListener("click",a.clickToPlayPauseCallback);for(u in h)h[u].show();v(),m=!0}}),s.addEventListener("fullscreenchange",function(){a.isFullScreen=!a.isFullScreen,a.isFullScreen?a.media.removeEventListener("click",a.clickToPlayPauseCallback):a.media.addEventListener("click",a.clickToPlayPauseCallback),p()}),a.globalBind("mousemove",function(e){if(m){var t=r.offset();(e.pageY<t.top||e.pageY>t.top+r.outerHeight(!0)||e.pageX<t.left||e.pageX>t.left+r.outerWidth(!0))&&(r.css("pointer-events",""),a.controls.css("pointer-events",""),m=!1)}})}else r.on("mouseover",function(){null!==l&&(clearTimeout(l),delete l);var e=r.offset(),i=t.container.offset();s.positionFullscreenButton(e.left-i.left,e.top-i.top,!0)}).on("mouseout",function(){null!==l&&(clearTimeout(l),delete l),l=setTimeout(function(){s.hideFullscreenButton()},1500)})}t.fullscreenBtn=r,a.globalBind("keydown",function(e){(mejs.MediaFeatures.hasTrueNativeFullScreen&&mejs.MediaFeatures.isFullScreen()||a.isFullScreen)&&27==e.keyCode&&t.exitFullScreen()})}},cleanfullscreen:function(e){e.exitFullScreen()},containerSizeTimeout:null,enterFullScreen:function(){var t=this;if("native"===t.media.pluginType||!mejs.MediaFeatures.isFirefox&&!t.options.usePluginFullScreen){if(e(document.documentElement).addClass("mejs-fullscreen"),normalHeight=t.container.height(),normalWidth=t.container.width(),"native"===t.media.pluginType)if(mejs.MediaFeatures.hasTrueNativeFullScreen)mejs.MediaFeatures.requestFullScreen(t.container[0]),t.isInIframe&&setTimeout(function n(){t.isNativeFullScreen&&(e(window).width()!==screen.width?t.exitFullScreen():setTimeout(n,500))},500);else if(mejs.MediaFeatures.hasSemiNativeFullScreen)return void t.media.webkitEnterFullscreen();if(t.isInIframe){var i=t.options.newWindowCallback(this);if(""!==i){if(!mejs.MediaFeatures.hasTrueNativeFullScreen)return t.pause(),void window.open(i,t.id,"top=0,left=0,width="+screen.availWidth+",height="+screen.availHeight+",resizable=yes,scrollbars=no,status=no,toolbar=no");setTimeout(function(){t.isNativeFullScreen||(t.pause(),window.open(i,t.id,"top=0,left=0,width="+screen.availWidth+",height="+screen.availHeight+",resizable=yes,scrollbars=no,status=no,toolbar=no"))},250)}}t.container.addClass("mejs-container-fullscreen").width("100%").height("100%"),t.containerSizeTimeout=setTimeout(function(){t.container.css({width:"100%",height:"100%"}),t.setControlsSize()},500),"native"===t.media.pluginType?t.$media.width("100%").height("100%"):(t.container.find(".mejs-shim").width("100%").height("100%"),t.media.setVideoSize(e(window).width(),e(window).height())),t.layers.children("div").width("100%").height("100%"),t.fullscreenBtn&&t.fullscreenBtn.removeClass("mejs-fullscreen").addClass("mejs-unfullscreen"),t.setControlsSize(),t.isFullScreen=!0}},exitFullScreen:function(){var t=this;return clearTimeout(t.containerSizeTimeout),"native"!==t.media.pluginType&&mejs.MediaFeatures.isFirefox?void t.media.setFullscreen(!1):(mejs.MediaFeatures.hasTrueNativeFullScreen&&(mejs.MediaFeatures.isFullScreen()||t.isFullScreen)&&mejs.MediaFeatures.cancelFullScreen(),e(document.documentElement).removeClass("mejs-fullscreen"),t.container.removeClass("mejs-container-fullscreen").width(normalWidth).height(normalHeight),"native"===t.media.pluginType?t.$media.width(normalWidth).height(normalHeight):(t.container.find(".mejs-shim").width(normalWidth).height(normalHeight),t.media.setVideoSize(normalWidth,normalHeight)),t.layers.children("div").width(normalWidth).height(normalHeight),t.fullscreenBtn.removeClass("mejs-unfullscreen").addClass("mejs-fullscreen"),t.setControlsSize(),void(t.isFullScreen=!1))}})}(mejs.$),function(e){e.extend(mejs.MepDefaults,{startLanguage:"",tracksText:mejs.i18n.t("Captions/Subtitles"),hideCaptionsButtonWhenEmpty:!0,toggleCaptionsButtonWhenOnlyOne:!1,slidesSelector:""}),e.extend(MediaElementPlayer.prototype,{hasChapters:!1,buildtracks:function(t,i,n,s){if(0!=t.tracks.length){var o,a=this;if(a.domNode.textTracks)for(var o=a.domNode.textTracks.length-1;o>=0;o--)a.domNode.textTracks[o].mode="hidden";t.chapters=e('<div class="mejs-chapters mejs-layer"></div>').prependTo(n).hide(),t.captions=e('<div class="mejs-captions-layer mejs-layer"><div class="mejs-captions-position mejs-captions-position-hover"><span class="mejs-captions-text"></span></div></div>').prependTo(n).hide(),t.captionsText=t.captions.find(".mejs-captions-text"),t.captionsButton=e('<div class="mejs-button mejs-captions-button"><button type="button" aria-controls="'+a.id+'" title="'+a.options.tracksText+'" aria-label="'+a.options.tracksText+'"></button><div class="mejs-captions-selector"><ul><li><input type="radio" name="'+t.id+'_captions" id="'+t.id+'_captions_none" value="none" checked="checked" /><label for="'+t.id+'_captions_none">'+mejs.i18n.t("None")+"</label></li></ul></div></div>").appendTo(i);var r=0;for(o=0;o<t.tracks.length;o++)"subtitles"==t.tracks[o].kind&&r++;for(a.options.toggleCaptionsButtonWhenOnlyOne&&1==r?t.captionsButton.on("click",function(){if(null==t.selectedTrack)var e=t.tracks[0].srclang;else var e="none";t.setTrack(e)}):t.captionsButton.hover(function(){e(this).find(".mejs-captions-selector").css("visibility","visible")},function(){e(this).find(".mejs-captions-selector").css("visibility","hidden")}).on("click","input[type=radio]",function(){lang=this.value,t.setTrack(lang)}),t.options.alwaysShowControls?t.container.find(".mejs-captions-position").addClass("mejs-captions-position-hover"):t.container.bind("controlsshown",function(){t.container.find(".mejs-captions-position").addClass("mejs-captions-position-hover")}).bind("controlshidden",function(){s.paused||t.container.find(".mejs-captions-position").removeClass("mejs-captions-position-hover")}),t.trackToLoad=-1,t.selectedTrack=null,t.isLoadingTrack=!1,o=0;o<t.tracks.length;o++)"subtitles"==t.tracks[o].kind&&t.addTrackButton(t.tracks[o].srclang,t.tracks[o].label);t.loadNextTrack(),s.addEventListener("timeupdate",function(){t.displayCaptions()},!1),""!=t.options.slidesSelector&&(t.slidesContainer=e(t.options.slidesSelector),s.addEventListener("timeupdate",function(){t.displaySlides()},!1)),s.addEventListener("loadedmetadata",function(){t.displayChapters()},!1),t.container.hover(function(){t.hasChapters&&(t.chapters.css("visibility","visible"),t.chapters.fadeIn(200).height(t.chapters.find(".mejs-chapter").outerHeight()))},function(){t.hasChapters&&!s.paused&&t.chapters.fadeOut(200,function(){e(this).css("visibility","hidden"),e(this).css("display","block")})}),null!==t.node.getAttribute("autoplay")&&t.chapters.css("visibility","hidden")}},setTrack:function(e){var t,i=this;if("none"==e)i.selectedTrack=null,i.captionsButton.removeClass("mejs-captions-enabled");else for(t=0;t<i.tracks.length;t++)if(i.tracks[t].srclang==e){null==i.selectedTrack&&i.captionsButton.addClass("mejs-captions-enabled"),i.selectedTrack=i.tracks[t],i.captions.attr("lang",i.selectedTrack.srclang),i.displayCaptions();break}},loadNextTrack:function(){var e=this;e.trackToLoad++,e.trackToLoad<e.tracks.length?(e.isLoadingTrack=!0,e.loadTrack(e.trackToLoad)):(e.isLoadingTrack=!1,e.checkForTracks())},loadTrack:function(t){var i=this,n=i.tracks[t],s=function(){n.isLoaded=!0,i.enableTrackButton(n.srclang,n.label),i.loadNextTrack()};e.ajax({url:n.src,dataType:"text",success:function(e){n.entries="string"==typeof e&&/<tt\s+xml/gi.exec(e)?mejs.TrackFormatParser.dfxp.parse(e):mejs.TrackFormatParser.webvvt.parse(e),s(),"chapters"==n.kind&&i.media.addEventListener("play",function(){i.media.duration>0&&i.displayChapters(n)},!1),"slides"==n.kind&&i.setupSlides(n)},error:function(){i.loadNextTrack()}})},enableTrackButton:function(t,i){var n=this;""===i&&(i=mejs.language.codes[t]||t),n.captionsButton.find("input[value="+t+"]").prop("disabled",!1).siblings("label").html(i),n.options.startLanguage==t&&e("#"+n.id+"_captions_"+t).click(),n.adjustLanguageBox()},addTrackButton:function(t,i){var n=this;""===i&&(i=mejs.language.codes[t]||t),n.captionsButton.find("ul").append(e('<li><input type="radio" name="'+n.id+'_captions" id="'+n.id+"_captions_"+t+'" value="'+t+'" disabled="disabled" /><label for="'+n.id+"_captions_"+t+'">'+i+" (loading)</label></li>")),n.adjustLanguageBox(),n.container.find(".mejs-captions-translations option[value="+t+"]").remove()},adjustLanguageBox:function(){var e=this;e.captionsButton.find(".mejs-captions-selector").height(e.captionsButton.find(".mejs-captions-selector ul").outerHeight(!0)+e.captionsButton.find(".mejs-captions-translations").outerHeight(!0))},checkForTracks:function(){var e=this,t=!1;if(e.options.hideCaptionsButtonWhenEmpty){for(i=0;i<e.tracks.length;i++)if("subtitles"==e.tracks[i].kind){t=!0;break}t||(e.captionsButton.hide(),e.setControlsSize())}},displayCaptions:function(){if("undefined"!=typeof this.tracks){var e,t=this,i=t.selectedTrack;if(null!=i&&i.isLoaded){for(e=0;e<i.entries.times.length;e++)if(t.media.currentTime>=i.entries.times[e].start&&t.media.currentTime<=i.entries.times[e].stop)return t.captionsText.html(i.entries.text[e]),void t.captions.show().height(0);t.captions.hide()}else t.captions.hide()}},setupSlides:function(e){var t=this;t.slides=e,t.slides.entries.imgs=[t.slides.entries.text.length],t.showSlide(0)},showSlide:function(t){if("undefined"!=typeof this.tracks&&"undefined"!=typeof this.slidesContainer){var i=this,n=i.slides.entries.text[t],s=i.slides.entries.imgs[t];"undefined"==typeof s||"undefined"==typeof s.fadeIn?i.slides.entries.imgs[t]=s=e('<img src="'+n+'">').on("load",function(){s.appendTo(i.slidesContainer).hide().fadeIn().siblings(":visible").fadeOut()}):s.is(":visible")||s.is(":animated")||s.fadeIn().siblings(":visible").fadeOut()}},displaySlides:function(){if("undefined"!=typeof this.slides){var e,t=this,i=t.slides;for(e=0;e<i.entries.times.length;e++)if(t.media.currentTime>=i.entries.times[e].start&&t.media.currentTime<=i.entries.times[e].stop)return void t.showSlide(e)}},displayChapters:function(){var e,t=this;for(e=0;e<t.tracks.length;e++)if("chapters"==t.tracks[e].kind&&t.tracks[e].isLoaded){t.drawChapters(t.tracks[e]),t.hasChapters=!0;break}},drawChapters:function(t){var i,n,s=this,o=0,a=0;for(s.chapters.empty(),i=0;i<t.entries.times.length;i++)n=t.entries.times[i].stop-t.entries.times[i].start,o=Math.floor(n/s.media.duration*100),(o+a>100||i==t.entries.times.length-1&&100>o+a)&&(o=100-a),s.chapters.append(e('<div class="mejs-chapter" rel="'+t.entries.times[i].start+'" style="left: '+a.toString()+"%;width: "+o.toString()+'%;"><div class="mejs-chapter-block'+(i==t.entries.times.length-1?" mejs-chapter-block-last":"")+'"><span class="ch-title">'+t.entries.text[i]+'</span><span class="ch-time">'+mejs.Utility.secondsToTimeCode(t.entries.times[i].start)+"&ndash;"+mejs.Utility.secondsToTimeCode(t.entries.times[i].stop)+"</span></div></div>")),a+=o;s.chapters.find("div.mejs-chapter").click(function(){s.media.setCurrentTime(parseFloat(e(this).attr("rel"))),s.media.paused&&s.media.play()}),s.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",tl:"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={webvvt:{pattern_identifier:/^([a-zA-z]+-)?[0-9]+$/,pattern_timecode:/^([0-9]{2}:[0-9]{2}:[0-9]{2}([,.][0-9]{1,3})?) --\> ([0-9]{2}:[0-9]{2}:[0-9]{2}([,.][0-9]{3})?)(.*)$/,parse:function(t){for(var i,n,s=0,o=mejs.TrackFormatParser.split2(t,/\r?\n/),a={text:[],times:[]};s<o.length;s++)if(this.pattern_identifier.exec(o[s])&&(s++,i=this.pattern_timecode.exec(o[s]),i&&s<o.length)){for(s++,n=o[s],s++;""!==o[s]&&s<o.length;)n=n+"\n"+o[s],s++;
  3. n=e.trim(n).replace(/(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/gi,"<a href='$1' target='_blank'>$1</a>"),a.text.push(n),a.times.push({start:0==mejs.Utility.convertSMPTEtoSeconds(i[1])?.2:mejs.Utility.convertSMPTEtoSeconds(i[1]),stop:mejs.Utility.convertSMPTEtoSeconds(i[3]),settings:i[5]})}return a}},dfxp:{parse:function(t){t=e(t).filter("tt");var i,n,s=0,o=t.children("div").eq(0),a=o.find("p"),r=t.find("#"+o.attr("style")),l={text:[],times:[]};if(r.length){var d=r.removeAttr("id").get(0).attributes;if(d.length)for(i={},s=0;s<d.length;s++)i[d[s].name.split(":")[1]]=d[s].value}for(s=0;s<a.length;s++){var u,c={start:null,stop:null,style:null};if(a.eq(s).attr("begin")&&(c.start=mejs.Utility.convertSMPTEtoSeconds(a.eq(s).attr("begin"))),!c.start&&a.eq(s-1).attr("end")&&(c.start=mejs.Utility.convertSMPTEtoSeconds(a.eq(s-1).attr("end"))),a.eq(s).attr("end")&&(c.stop=mejs.Utility.convertSMPTEtoSeconds(a.eq(s).attr("end"))),!c.stop&&a.eq(s+1).attr("begin")&&(c.stop=mejs.Utility.convertSMPTEtoSeconds(a.eq(s+1).attr("begin"))),i){u="";for(var m in i)u+=m+":"+i[m]+";"}u&&(c.style=u),0==c.start&&(c.start=.2),l.times.push(c),n=e.trim(a.eq(s).html()).replace(/(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/gi,"<a href='$1' target='_blank'>$1</a>"),l.text.push(n),0==l.times.start&&(l.times.start=2)}return l}},split2:function(e,t){return e.split(t)}},3!="x\n\ny".split(/\n/gi).length&&(mejs.TrackFormatParser.split2=function(e,t){var i,n=[],s="";for(i=0;i<e.length;i++)s+=e.substring(i,i+1),t.test(s)&&(n.push(s.replace(t,"")),s="");return n.push(s),n})}(mejs.$),function(e){e.extend(mejs.MepDefaults,{contextMenuItems:[{render:function(e){return"undefined"==typeof e.enterFullScreen?null:mejs.i18n.t(e.isFullScreen?"Turn off Fullscreen":"Go Fullscreen")},click:function(e){e.isFullScreen?e.exitFullScreen():e.enterFullScreen()}},{render:function(e){return mejs.i18n.t(e.media.muted?"Unmute":"Mute")},click:function(e){e.setMuted(e.media.muted?!1:!0)}},{isSeparator:!0},{render:function(){return mejs.i18n.t("Download Video")},click:function(e){window.location.href=e.media.currentSrc}}]}),e.extend(MediaElementPlayer.prototype,{buildcontextmenu:function(t){t.contextMenu=e('<div class="mejs-contextmenu"></div>').appendTo(e("body")).hide(),t.container.bind("contextmenu",function(e){return t.isContextMenuEnabled?(e.preventDefault(),t.renderContextMenu(e.clientX-1,e.clientY-1),!1):void 0}),t.container.bind("click",function(){t.contextMenu.hide()}),t.contextMenu.bind("mouseleave",function(){t.startContextMenuTimer()})},cleancontextmenu:function(e){e.contextMenu.remove()},isContextMenuEnabled:!0,enableContextMenu:function(){this.isContextMenuEnabled=!0},disableContextMenu:function(){this.isContextMenuEnabled=!1},contextMenuTimeout:null,startContextMenuTimer:function(){var e=this;e.killContextMenuTimer(),e.contextMenuTimer=setTimeout(function(){e.hideContextMenu(),e.killContextMenuTimer()},750)},killContextMenuTimer:function(){var e=this.contextMenuTimer;null!=e&&(clearTimeout(e),delete e,e=null)},hideContextMenu:function(){this.contextMenu.hide()},renderContextMenu:function(t,i){for(var n=this,s="",o=n.options.contextMenuItems,a=0,r=o.length;r>a;a++)if(o[a].isSeparator)s+='<div class="mejs-contextmenu-separator"></div>';else{var l=o[a].render(n);null!=l&&(s+='<div class="mejs-contextmenu-item" data-itemindex="'+a+'" id="element-'+1e6*Math.random()+'">'+l+"</div>")}n.contextMenu.empty().append(e(s)).css({top:i,left:t}).show(),n.contextMenu.find(".mejs-contextmenu-item").each(function(){var t=e(this),i=parseInt(t.data("itemindex"),10),s=n.options.contextMenuItems[i];"undefined"!=typeof s.show&&s.show(t,n),t.click(function(){"undefined"!=typeof s.click&&s.click(n),n.contextMenu.hide()})}),setTimeout(function(){n.killControlsTimer("rev3")},100)}})}(mejs.$),function(e){e.extend(mejs.MepDefaults,{postrollCloseText:mejs.i18n.t("Close")}),e.extend(MediaElementPlayer.prototype,{buildpostroll:function(t,i,n){var s=this,o=s.container.find('link[rel="postroll"]').attr("href");"undefined"!=typeof o&&(t.postroll=e('<div class="mejs-postroll-layer mejs-layer"><a class="mejs-postroll-close" onclick="$(this).parent().hide();return false;">'+s.options.postrollCloseText+'</a><div class="mejs-postroll-layer-content"></div></div>').prependTo(n).hide(),s.media.addEventListener("ended",function(){e.ajax({dataType:"html",url:o,success:function(e){n.find(".mejs-postroll-layer-content").html(e)}}),t.postroll.show()},!1))}})}(mejs.$);