diff --git a/server.py b/server.py index 8b6f522f92c0516c0982846a10b5edc08cf013e3..bc639dd88ee3732767457b38c75391aee5f79e54 100755 --- a/server.py +++ b/server.py @@ -173,7 +173,7 @@ def faq(): @handle_errors('course', 'Diese Vorlesung existiert nicht!', 404, IndexError) def play(id): lectures = query('SELECT * FROM lectures WHERE id = ? AND (? OR visible)', id, ismod()) - videos = query('SELECT * FROM videos WHERE lecture_id = ? AND (? OR visible)', id, ismod()) + videos = query('SELECT videos.*, formats.description AS format_description FROM videos JOIN formats ON (videos.video_format = formats.id) WHERE lecture_id = ? AND (? OR visible)', id, ismod()) if not videos: flash('Zu dieser Vorlesung wurden noch keine Videos veröffentlicht!') courses = query('SELECT * FROM courses WHERE id = ? AND (? OR (visible AND listed))', lectures[0]['course_id'], ismod()) diff --git a/static/mediaelementjs/mediaelement-and-player.min.js b/static/mediaelementjs/mediaelement-and-player.min.js deleted file mode 100644 index 6ea6b5931c5ec0c882b4bb010badfc0c40cd500f..0000000000000000000000000000000000000000 --- a/static/mediaelementjs/mediaelement-and-player.min.js +++ /dev/null @@ -1,28 +0,0 @@ -/*! - * - * MediaElement.js - * HTML5 <video> and <audio> shim and player - * http://mediaelementjs.com/ - * - * Creates a JavaScript object that mimics HTML5 MediaElement API - * for browsers that don't understand HTML5 or can't play the provided codec - * Can play MP4 (H.264), Ogg, WebM, FLV, WMV, WMA, ACC, and MP3 - * - * Copyright 2010-2014, John Dyer (http://j.hn) - * License: MIT - * - */ -var mejs=mejs||{};mejs.version="2.22.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/dailymotion","video/x-dailymotion","application/x-mpegURL"]}],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(a){return encodeURIComponent(a)},escapeHTML:function(a){return a.toString().split("&").join("&").split("<").join("<").split('"').join(""")},absolutizeUrl:function(a){var b=document.createElement("div");return b.innerHTML='<a href="'+this.escapeHTML(a)+'">x</a>',b.firstChild.href},getScriptPath:function(a){for(var b,c,d,e,f,g,h=0,i="",j="",k=document.getElementsByTagName("script"),l=k.length,m=a.length;l>h;h++){for(e=k[h].src,c=e.lastIndexOf("/"),c>-1?(g=e.substring(c+1),f=e.substring(0,c+1)):(g=e,f=""),b=0;m>b;b++)if(j=a[b],d=g.indexOf(j),d>-1){i=f;break}if(""!==i)break}return i},calculateTimeFormat:function(a,b,c){0>a&&(a=0),"undefined"==typeof c&&(c=25);var d=b.timeFormat,e=d[0],f=d[1]==d[0],g=f?2:1,h=":",i=Math.floor(a/3600)%24,j=Math.floor(a/60)%60,k=Math.floor(a%60),l=Math.floor((a%1*c).toFixed(3)),m=[[l,"f"],[k,"s"],[j,"m"],[i,"h"]];d.length<g&&(h=d[g]);for(var n=!1,o=0,p=m.length;p>o;o++)if(-1!==d.indexOf(m[o][1]))n=!0;else if(n){for(var q=!1,r=o;p>r;r++)if(m[r][0]>0){q=!0;break}if(!q)break;f||(d=e+d),d=m[o][1]+h+d,f&&(d=m[o][1]+d),e=m[o][1]}b.currentTimeFormat=d},twoDigitsString:function(a){return 10>a?"0"+a:String(a)},secondsToTimeCode:function(a,b){if(0>a&&(a=0),"object"!=typeof b){var c="m:ss";c=arguments[1]?"hh:mm:ss":c,c=arguments[2]?c+":ff":c,b={currentTimeFormat:c,framesPerSecond:arguments[3]||25}}var d=b.framesPerSecond;"undefined"==typeof d&&(d=25);var c=b.currentTimeFormat,e=Math.floor(a/3600)%24,f=Math.floor(a/60)%60,g=Math.floor(a%60),h=Math.floor((a%1*d).toFixed(3));lis=[[h,"f"],[g,"s"],[f,"m"],[e,"h"]];var j=c;for(i=0,len=lis.length;i<len;i++)j=j.replace(lis[i][1]+lis[i][1],this.twoDigitsString(lis[i][0])),j=j.replace(lis[i][1],lis[i][0]);return j},timeCodeToSeconds:function(a,b,c,d){"undefined"==typeof c?c=!1:"undefined"==typeof d&&(d=25);var e=a.split(":"),f=parseInt(e[0],10),g=parseInt(e[1],10),h=parseInt(e[2],10),i=0,j=0;return c&&(i=parseInt(e[3])/d),j=3600*f+60*g+h+i},convertSMPTEtoSeconds:function(a){if("string"!=typeof a)return!1;a=a.replace(",",".");var b=0,c=-1!=a.indexOf(".")?a.split(".")[1].length:0,d=1;a=a.split(":").reverse();for(var e=0;e<a.length;e++)d=1,e>0&&(d=Math.pow(60,e)),b+=Number(a[e])*d;return Number(b.toFixed(c))},removeSwf:function(a){var b=document.getElementById(a);b&&/object|embed/i.test(b.nodeName)&&(mejs.MediaFeatures.isIE?(b.style.display="none",function(){4==b.readyState?mejs.Utility.removeObjectInIE(a):setTimeout(arguments.callee,10)}()):b.parentNode.removeChild(b))},removeObjectInIE:function(a){var b=document.getElementById(a);if(b){for(var c in b)"function"==typeof b[c]&&(b[c]=null);b.parentNode.removeChild(b)}},determineScheme:function(a){return a&&-1!=a.indexOf("://")?a.substr(0,a.indexOf("://")+3):"//"}},mejs.PluginDetector={hasPluginVersion:function(a,b){var c=this.plugins[a];return b[1]=b[1]||0,b[2]=b[2]||0,c[0]>b[0]||c[0]==b[0]&&c[1]>b[1]||c[0]==b[0]&&c[1]==b[1]&&c[2]>=b[2]?!0:!1},nav:window.navigator,ua:window.navigator.userAgent.toLowerCase(),plugins:[],addPlugin:function(a,b,c,d,e){this.plugins[a]=this.detectPlugin(b,c,d,e)},detectPlugin:function(a,b,c,d){var e,f,g,h=[0,0,0];if("undefined"!=typeof this.nav.plugins&&"object"==typeof this.nav.plugins[a]){if(e=this.nav.plugins[a].description,e&&("undefined"==typeof this.nav.mimeTypes||!this.nav.mimeTypes[b]||this.nav.mimeTypes[b].enabledPlugin))for(h=e.replace(a,"").replace(/^\s+/,"").replace(/\sr/gi,".").split("."),f=0;f<h.length;f++)h[f]=parseInt(h[f].match(/\d+/),10)}else if("undefined"!=typeof window.ActiveXObject)try{g=new ActiveXObject(c),g&&(h=d(g))}catch(i){}return h}},mejs.PluginDetector.addPlugin("flash","Shockwave Flash","application/x-shockwave-flash","ShockwaveFlash.ShockwaveFlash",function(a){var b=[],c=a.GetVariable("$version");return c&&(c=c.split(" ")[1].split(","),b=[parseInt(c[0],10),parseInt(c[1],10),parseInt(c[2],10)]),b}),mejs.PluginDetector.addPlugin("silverlight","Silverlight Plug-In","application/x-silverlight-2","AgControl.AgControl",function(a){var b=[0,0,0,0],c=function(a,b,c,d){for(;a.isVersionSupported(b[0]+"."+b[1]+"."+b[2]+"."+b[3]);)b[c]+=d;b[c]-=d};return c(a,b,0,1),c(a,b,1,1),c(a,b,2,1e4),c(a,b,2,1e3),c(a,b,2,100),c(a,b,2,10),c(a,b,2,1),c(a,b,3,1),b}),mejs.MediaFeatures={init:function(){var a,b,c=this,d=document,e=mejs.PluginDetector.nav,f=mejs.PluginDetector.ua.toLowerCase(),g=["source","track","audio","video"];c.isiPad=null!==f.match(/ipad/i),c.isiPhone=null!==f.match(/iphone/i),c.isiOS=c.isiPhone||c.isiPad,c.isAndroid=null!==f.match(/android/i),c.isBustedAndroid=null!==f.match(/android 2\.[12]/),c.isBustedNativeHTTPS="https:"===location.protocol&&(null!==f.match(/android [12]\./)||null!==f.match(/macintosh.* version.* safari/)),c.isIE=-1!=e.appName.toLowerCase().indexOf("microsoft")||null!==e.appName.toLowerCase().match(/trident/gi),c.isChrome=null!==f.match(/chrome/gi),c.isChromium=null!==f.match(/chromium/gi),c.isFirefox=null!==f.match(/firefox/gi),c.isWebkit=null!==f.match(/webkit/gi),c.isGecko=null!==f.match(/gecko/gi)&&!c.isWebkit&&!c.isIE,c.isOpera=null!==f.match(/opera/gi),c.hasTouch="ontouchstart"in window,c.svgAsImg=!!document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#Image","1.1");for(a=0;a<g.length;a++)b=document.createElement(g[a]);c.supportsMediaTag="undefined"!=typeof b.canPlayType||c.isBustedAndroid;try{b.canPlayType("video/mp4")}catch(h){c.supportsMediaTag=!1}c.supportsPointerEvents=function(){var a,b=document.createElement("x"),c=document.documentElement,d=window.getComputedStyle;return"pointerEvents"in b.style?(b.style.pointerEvents="auto",b.style.pointerEvents="x",c.appendChild(b),a=d&&"auto"===d(b,"").pointerEvents,c.removeChild(b),!!a):!1}(),c.hasFirefoxPluginMovingProblem=!1,c.hasiOSFullScreen="undefined"!=typeof b.webkitEnterFullscreen,c.hasNativeFullscreen="undefined"!=typeof b.requestFullscreen,c.hasWebkitNativeFullScreen="undefined"!=typeof b.webkitRequestFullScreen,c.hasMozNativeFullScreen="undefined"!=typeof b.mozRequestFullScreen,c.hasMsNativeFullScreen="undefined"!=typeof b.msRequestFullscreen,c.hasTrueNativeFullScreen=c.hasWebkitNativeFullScreen||c.hasMozNativeFullScreen||c.hasMsNativeFullScreen,c.nativeFullScreenEnabled=c.hasTrueNativeFullScreen,c.hasMozNativeFullScreen?c.nativeFullScreenEnabled=document.mozFullScreenEnabled:c.hasMsNativeFullScreen&&(c.nativeFullScreenEnabled=document.msFullscreenEnabled),c.isChrome&&(c.hasiOSFullScreen=!1),c.hasTrueNativeFullScreen&&(c.fullScreenEventName="",c.hasWebkitNativeFullScreen?c.fullScreenEventName="webkitfullscreenchange":c.hasMozNativeFullScreen?c.fullScreenEventName="mozfullscreenchange":c.hasMsNativeFullScreen&&(c.fullScreenEventName="MSFullscreenChange"),c.isFullScreen=function(){return c.hasMozNativeFullScreen?d.mozFullScreen:c.hasWebkitNativeFullScreen?d.webkitIsFullScreen:c.hasMsNativeFullScreen?null!==d.msFullscreenElement:void 0},c.requestFullScreen=function(a){c.hasWebkitNativeFullScreen?a.webkitRequestFullScreen():c.hasMozNativeFullScreen?a.mozRequestFullScreen():c.hasMsNativeFullScreen&&a.msRequestFullscreen()},c.cancelFullScreen=function(){c.hasWebkitNativeFullScreen?document.webkitCancelFullScreen():c.hasMozNativeFullScreen?document.mozCancelFullScreen():c.hasMsNativeFullScreen&&document.msExitFullscreen()}),c.hasiOSFullScreen&&f.match(/mac os x 10_5/i)&&(c.hasNativeFullScreen=!1,c.hasiOSFullScreen=!1)}},mejs.MediaFeatures.init(),mejs.HtmlMediaElement={pluginType:"native",isFullScreen:!1,setCurrentTime:function(a){this.currentTime=a},setMuted:function(a){this.muted=a},setVolume:function(a){this.volume=a},stop:function(){this.pause()},setSrc:function(a){for(var b=this.getElementsByTagName("source");b.length>0;)this.removeChild(b[0]);if("string"==typeof a)this.src=a;else{var c,d;for(c=0;c<a.length;c++)if(d=a[c],this.canPlayType(d.type)){this.src=d.src;break}}},setVideoSize:function(a,b){this.width=a,this.height=b}},mejs.PluginMediaElement=function(a,b,c){this.id=a,this.pluginType=b,this.src=c,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?1==this.pluginApi.getPlayerState()&&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(a){var b,c,d,e=mejs.plugins[this.pluginType];for(b=0;b<e.length;b++)if(d=e[b],mejs.PluginDetector.hasPluginVersion(this.pluginType,d.version))for(c=0;c<d.types.length;c++)if(a==d.types[c])return"probably";return""},positionFullscreenButton:function(a,b,c){null!=this.pluginApi&&this.pluginApi.positionFullscreenButton&&this.pluginApi.positionFullscreenButton(Math.floor(a),Math.floor(b),c)},hideFullscreenButton:function(){null!=this.pluginApi&&this.pluginApi.hideFullscreenButton&&this.pluginApi.hideFullscreenButton()},setSrc:function(a){if("string"==typeof a)this.pluginApi.setSrc(mejs.Utility.absolutizeUrl(a)),this.src=mejs.Utility.absolutizeUrl(a);else{var b,c;for(b=0;b<a.length;b++)if(c=a[b],this.canPlayType(c.type)){this.pluginApi.setSrc(mejs.Utility.absolutizeUrl(c.src)),this.src=mejs.Utility.absolutizeUrl(c.src);break}}},setCurrentTime:function(a){null!=this.pluginApi&&("youtube"==this.pluginType||"vimeo"==this.pluginType?this.pluginApi.seekTo(a):this.pluginApi.setCurrentTime(a),this.currentTime=a)},setVolume:function(a){null!=this.pluginApi&&("youtube"==this.pluginType?this.pluginApi.setVolume(100*a):this.pluginApi.setVolume(a),this.volume=a)},setMuted:function(a){null!=this.pluginApi&&("youtube"==this.pluginType?(a?this.pluginApi.mute():this.pluginApi.unMute(),this.muted=a,this.dispatchEvent({type:"volumechange"})):this.pluginApi.setMuted(a),this.muted=a)},setVideoSize:function(a,b){this.pluginElement&&this.pluginElement.style&&(this.pluginElement.style.width=a+"px",this.pluginElement.style.height=b+"px"),null!=this.pluginApi&&this.pluginApi.setVideoSize&&this.pluginApi.setVideoSize(a,b)},setFullscreen:function(a){null!=this.pluginApi&&this.pluginApi.setFullscreen&&this.pluginApi.setFullscreen(a)},enterFullScreen:function(){null!=this.pluginApi&&this.pluginApi.setFullscreen&&this.setFullscreen(!0)},exitFullScreen:function(){null!=this.pluginApi&&this.pluginApi.setFullscreen&&this.setFullscreen(!1)},addEventListener:function(a,b,c){this.events[a]=this.events[a]||[],this.events[a].push(b)},removeEventListener:function(a,b){if(!a)return this.events={},!0;var c=this.events[a];if(!c)return!0;if(!b)return this.events[a]=[],!0;for(var d=0;d<c.length;d++)if(c[d]===b)return this.events[a].splice(d,1),!0;return!1},dispatchEvent:function(a){var b,c=this.events[a.type];if(c)for(b=0;b<c.length;b++)c[b].apply(this,[a])},hasAttribute:function(a){return a in this.attributes},removeAttribute:function(a){delete this.attributes[a]},getAttribute:function(a){return this.hasAttribute(a)?this.attributes[a]:""},setAttribute:function(a,b){this.attributes[a]=b},remove:function(){mejs.Utility.removeSwf(this.pluginElement.id)}},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(a,b){return mejs.HtmlMediaElementShim.create(a,b)},mejs.HtmlMediaElementShim={create:function(a,b){var c,d,e={},f="string"==typeof a?document.getElementById(a):a,g=f.tagName.toLowerCase(),h="audio"===g||"video"===g,i=h?f.getAttribute("src"):f.getAttribute("href"),j=f.getAttribute("poster"),k=f.getAttribute("autoplay"),l=f.getAttribute("preload"),m=f.getAttribute("controls");for(d in mejs.MediaElementDefaults)e[d]=mejs.MediaElementDefaults[d];for(d in b)e[d]=b[d];return i="undefined"==typeof i||null===i||""==i?null:i,j="undefined"==typeof j||null===j?"":j,l="undefined"==typeof l||null===l||"false"===l?"none":l,k=!("undefined"==typeof k||null===k||"false"===k),m=!("undefined"==typeof m||null===m||"false"===m),c=this.determinePlayback(f,e,mejs.MediaFeatures.supportsMediaTag,h,i),c.url=null!==c.url?mejs.Utility.absolutizeUrl(c.url):"",c.scheme=mejs.Utility.determineScheme(c.url),"native"==c.method?(mejs.MediaFeatures.isBustedAndroid&&(f.src=c.url,f.addEventListener("click",function(){f.play()},!1)),this.updateNative(c,e,k,l)):""!==c.method?this.createPlugin(c,e,j,k,l,m):(this.createErrorMessage(c,e,j),this)},determinePlayback:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,o,p,q=[],r={method:"",url:"",htmlMediaElement:a,isVideo:"audio"!=a.tagName.toLowerCase(),scheme:""};if("undefined"!=typeof b.type&&""!==b.type)if("string"==typeof b.type)q.push({type:b.type,url:e});else for(f=0;f<b.type.length;f++)q.push({type:b.type[f],url:e});else if(null!==e)k=this.formatType(e,a.getAttribute("type")),q.push({type:k,url:e});else for(f=0;f<a.childNodes.length;f++)j=a.childNodes[f],1==j.nodeType&&"source"==j.tagName.toLowerCase()&&(e=j.getAttribute("src"),k=this.formatType(e,j.getAttribute("type")),p=j.getAttribute("media"),(!p||!window.matchMedia||window.matchMedia&&window.matchMedia(p).matches)&&q.push({type:k,url:e}));if(!d&&q.length>0&&null!==q[0].url&&this.getTypeFromFile(q[0].url).indexOf("audio")>-1&&(r.isVideo=!1),mejs.MediaFeatures.isBustedAndroid&&(a.canPlayType=function(a){return null!==a.match(/video\/(mp4|m4v)/gi)?"maybe":""}),mejs.MediaFeatures.isChromium&&(a.canPlayType=function(a){return null!==a.match(/video\/(webm|ogv|ogg)/gi)?"maybe":""}),c&&("auto"===b.mode||"auto_plugin"===b.mode||"native"===b.mode)&&(!mejs.MediaFeatures.isBustedNativeHTTPS||b.httpsBasicAuthSite!==!0)){for(d||(o=document.createElement(r.isVideo?"video":"audio"),a.parentNode.insertBefore(o,a),a.style.display="none",r.htmlMediaElement=a=o),f=0;f<q.length;f++)if("video/m3u8"==q[f].type||""!==a.canPlayType(q[f].type).replace(/no/,"")||""!==a.canPlayType(q[f].type.replace(/mp3/,"mpeg")).replace(/no/,"")||""!==a.canPlayType(q[f].type.replace(/m4a/,"mp4")).replace(/no/,"")){r.method="native",r.url=q[f].url;break}if("native"===r.method&&(null!==r.url&&(a.src=r.url),"auto_plugin"!==b.mode))return r}if("auto"===b.mode||"auto_plugin"===b.mode||"shim"===b.mode)for(f=0;f<q.length;f++)for(k=q[f].type,g=0;g<b.plugins.length;g++)for(l=b.plugins[g],m=mejs.plugins[l],h=0;h<m.length;h++)if(n=m[h],null==n.version||mejs.PluginDetector.hasPluginVersion(l,n.version))for(i=0;i<n.types.length;i++)if(k.toLowerCase()==n.types[i].toLowerCase())return r.method=l,r.url=q[f].url,r;return"auto_plugin"===b.mode&&"native"===r.method?r:(""===r.method&&q.length>0&&(r.url=q[0].url),r)},formatType:function(a,b){return a&&!b?this.getTypeFromFile(a):b&&~b.indexOf(";")?b.substr(0,b.indexOf(";")):b},getTypeFromFile:function(a){a=a.split("?")[0];var b=a.substring(a.lastIndexOf(".")+1).toLowerCase(),c=/(mp4|m4v|ogg|ogv|m3u8|webm|webmv|flv|wmv|mpeg|mov)/gi.test(b)?"video/":"audio/";return this.getTypeFromExtension(b,c)},getTypeFromExtension:function(a,b){switch(b=b||"",a){case"mp4":case"m4v":case"m4a":case"f4v":case"f4a":return b+"mp4";case"flv":return b+"x-flv";case"webm":case"webma":case"webmv":return b+"webm";case"ogg":case"oga":case"ogv":return b+"ogg";case"m3u8":return"application/x-mpegurl";case"ts":return b+"mp2t";default:return b+a}},createErrorMessage:function(a,b,c){var d=a.htmlMediaElement,e=document.createElement("div"),f=b.customError;e.className="me-cannotplay";try{e.style.width=d.width+"px",e.style.height=d.height+"px"}catch(g){}f||(f='<a href="'+a.url+'">',""!==c&&(f+='<img src="'+c+'" width="100%" height="100%" alt="" />'),f+="<span>"+mejs.i18n.t("Download File")+"</span></a>"),e.innerHTML=f,d.parentNode.insertBefore(e,d),d.style.display="none",b.error(d)},createPlugin:function(a,b,c,d,e,f){var g,h,i,j=a.htmlMediaElement,k=1,l=1,m="me_"+a.method+"_"+mejs.meIndex++,n=new mejs.PluginMediaElement(m,a.method,a.url),o=document.createElement("div");n.tagName=j.tagName;for(var p=0;p<j.attributes.length;p++){var q=j.attributes[p];q.specified&&n.setAttribute(q.name,q.value)}for(h=j.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(a.isVideo?(k=b.pluginWidth>0?b.pluginWidth:b.videoWidth>0?b.videoWidth:null!==j.getAttribute("width")?j.getAttribute("width"):b.defaultVideoWidth,l=b.pluginHeight>0?b.pluginHeight:b.videoHeight>0?b.videoHeight:null!==j.getAttribute("height")?j.getAttribute("height"):b.defaultVideoHeight,k=mejs.Utility.encodeUrl(k),l=mejs.Utility.encodeUrl(l)):b.enablePluginDebug&&(k=320,l=240),n.success=b.success,o.className="me-plugin",o.id=m+"_container",a.isVideo?j.parentNode.insertBefore(o,j):document.body.insertBefore(o,document.body.childNodes[0]),("flash"===a.method||"silverlight"===a.method)&&(i=["id="+m,"isvideo="+(a.isVideo?"true":"false"),"autoplay="+(d?"true":"false"),"preload="+e,"width="+k,"startvolume="+b.startVolume,"timerrate="+b.timerRate,"flashstreamer="+b.flashStreamer,"height="+l,"pseudostreamstart="+b.pseudoStreamingStartQueryParam],null!==a.url&&("flash"==a.method?i.push("file="+mejs.Utility.encodeUrl(a.url)):i.push("file="+a.url)),b.enablePluginDebug&&i.push("debug=true"),b.enablePluginSmoothing&&i.push("smoothing=true"),b.enablePseudoStreaming&&i.push("pseudostreaming=true"),f&&i.push("controls=true"),b.pluginVars&&(i=i.concat(b.pluginVars)),window[m+"_init"]=function(){switch(n.pluginType){case"flash":n.pluginElement=n.pluginApi=document.getElementById(m);break;case"silverlight":n.pluginElement=document.getElementById(n.id),n.pluginApi=n.pluginElement.Content.MediaElementJS}null!=n.pluginApi&&n.success&&n.success(n,j)},window[m+"_event"]=function(a,b){var c,d,e;c={type:a,target:n};for(d in b)n[d]=b[d],c[d]=b[d];e=b.bufferedTime||0,c.target.buffered=c.buffered={start:function(a){return 0},end:function(a){return e},length:1},n.dispatchEvent(c)}),a.method){case"silverlight":o.innerHTML='<object data="data:application/x-silverlight-2," type="application/x-silverlight-2" id="'+m+'" name="'+m+'" width="'+k+'" height="'+l+'" class="mejs-shim"><param name="initParams" value="'+i.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="'+b.pluginPath+b.silverlightName+'" /></object>';break;case"flash":mejs.MediaFeatures.isIE?(g=document.createElement("div"),o.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="'+k+'" height="'+l+'" class="mejs-shim"><param name="movie" value="'+b.pluginPath+b.flashName+"?"+(new Date).getTime()+'" /><param name="flashvars" value="'+i.join("&")+'" /><param name="quality" value="high" /><param name="bgcolor" value="#000000" /><param name="wmode" value="transparent" /><param name="allowScriptAccess" value="'+b.flashScriptAccess+'" /><param name="allowFullScreen" value="true" /><param name="scale" value="default" /></object>'):o.innerHTML='<embed id="'+m+'" name="'+m+'" play="true" loop="false" quality="high" bgcolor="#000000" wmode="transparent" allowScriptAccess="'+b.flashScriptAccess+'" allowFullScreen="true" type="application/x-shockwave-flash" pluginspage="//www.macromedia.com/go/getflashplayer" src="'+b.pluginPath+b.flashName+'" flashvars="'+i.join("&")+'" width="'+k+'" height="'+l+'" scale="default"class="mejs-shim"></embed>';break;case"youtube":var r;if(-1!=a.url.lastIndexOf("youtu.be"))r=a.url.substr(a.url.lastIndexOf("/")+1),-1!=r.indexOf("?")&&(r=r.substr(0,r.indexOf("?")));else{var s=a.url.match(/[?&]v=([^&#]+)|&|#|$/);s&&(r=s[1])}youtubeSettings={container:o,containerId:o.id,pluginMediaElement:n,pluginId:m,videoId:r,height:l,width:k,scheme:a.scheme},window.postMessage?mejs.YouTubeApi.enqueueIframe(youtubeSettings):mejs.PluginDetector.hasPluginVersion("flash",[10,0,0])&&mejs.YouTubeApi.createFlash(youtubeSettings,b);break;case"vimeo":var t=m+"_player";if(n.vimeoid=a.url.substr(a.url.lastIndexOf("/")+1),o.innerHTML='<iframe src="'+a.scheme+"player.vimeo.com/video/"+n.vimeoid+"?api=1&portrait=0&byline=0&title=0&player_id="+t+'" width="'+k+'" height="'+l+'" frameborder="0" class="mejs-shim" id="'+t+'" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>',"function"==typeof $f){var u=$f(o.childNodes[0]),v=-1;u.addEvent("ready",function(){function a(a,b,c,d){var e={type:c,target:b};"timeupdate"==c&&(b.currentTime=e.currentTime=d.seconds,b.duration=e.duration=d.duration),b.dispatchEvent(e)}u.playVideo=function(){u.api("play")},u.stopVideo=function(){u.api("unload")},u.pauseVideo=function(){u.api("pause")},u.seekTo=function(a){u.api("seekTo",a)},u.setVolume=function(a){u.api("setVolume",a)},u.setMuted=function(a){a?(u.lastVolume=u.api("getVolume"),u.api("setVolume",0)):(u.api("setVolume",u.lastVolume),delete u.lastVolume)},u.getPlayerState=function(){return v},u.addEvent("play",function(){v=1,a(u,n,"play"),a(u,n,"playing")}),u.addEvent("pause",function(){v=2,a(u,n,"pause")}),u.addEvent("finish",function(){v=0,a(u,n,"ended")}),u.addEvent("playProgress",function(b){a(u,n,"timeupdate",b)}),u.addEvent("seek",function(b){v=3,a(u,n,"seeked",b)}),u.addEvent("loadProgress",function(b){v=3,a(u,n,"progress",b)}),n.pluginElement=o,n.pluginApi=u,n.success(n,n.pluginElement)})}else console.warn("You need to include froogaloop for vimeo to work")}return j.style.display="none",j.removeAttribute("autoplay"),n},updateNative:function(a,b,c,d){var e,f=a.htmlMediaElement;for(e in mejs.HtmlMediaElement)f[e]=mejs.HtmlMediaElement[e];return b.success(f,f),f}},mejs.YouTubeApi={isIframeStarted:!1,isIframeLoaded:!1,loadIframeApi:function(a){if(!this.isIframeStarted){var b=document.createElement("script");b.src=a.scheme+"www.youtube.com/player_api";var c=document.getElementsByTagName("script")[0];c.parentNode.insertBefore(b,c),this.isIframeStarted=!0}},iframeQueue:[],enqueueIframe:function(a){this.isLoaded?this.createIframe(a):(this.loadIframeApi(a),this.iframeQueue.push(a))},createIframe:function(a){var b=a.pluginMediaElement,c=new YT.Player(a.containerId,{height:a.height,width:a.width,videoId:a.videoId,playerVars:{controls:0,wmode:"transparent"},events:{onReady:function(){c.setVideoSize=function(a,b){c.setSize(a,b)},a.pluginMediaElement.pluginApi=c,a.pluginMediaElement.pluginElement=document.getElementById(a.containerId),b.success(b,b.pluginElement),setInterval(function(){mejs.YouTubeApi.createEvent(c,b,"timeupdate")},250)},onStateChange:function(a){mejs.YouTubeApi.handleStateChange(a.data,c,b)}}})},createEvent:function(a,b,c){var d={type:c,target:b};if(a&&a.getDuration){b.currentTime=d.currentTime=a.getCurrentTime(),b.duration=d.duration=a.getDuration(),d.paused=b.paused,d.ended=b.ended,d.muted=a.isMuted(),d.volume=a.getVolume()/100,d.bytesTotal=a.getVideoBytesTotal(),d.bufferedBytes=a.getVideoBytesLoaded();var e=d.bufferedBytes/d.bytesTotal*d.duration;d.target.buffered=d.buffered={start:function(a){return 0},end:function(a){return e},length:1}}b.dispatchEvent(d)},iFrameReady:function(){for(this.isLoaded=!0,this.isIframeLoaded=!0;this.iframeQueue.length>0;){var a=this.iframeQueue.pop();this.createIframe(a)}},flashPlayers:{},createFlash:function(a){this.flashPlayers[a.pluginId]=a;var b,c=a.scheme+"www.youtube.com/apiplayer?enablejsapi=1&playerapiid="+a.pluginId+"&version=3&autoplay=0&controls=0&modestbranding=1&loop=0";mejs.MediaFeatures.isIE?(b=document.createElement("div"),a.container.appendChild(b),b.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="'+a.scheme+'download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab" id="'+a.pluginId+'" width="'+a.width+'" height="'+a.height+'" class="mejs-shim"><param name="movie" value="'+c+'" /><param name="wmode" value="transparent" /><param name="allowScriptAccess" value="'+options.flashScriptAccess+'" /><param name="allowFullScreen" value="true" /></object>'):a.container.innerHTML='<object type="application/x-shockwave-flash" id="'+a.pluginId+'" data="'+c+'" width="'+a.width+'" height="'+a.height+'" style="visibility: visible; " class="mejs-shim"><param name="allowScriptAccess" value="'+options.flashScriptAccess+'"><param name="wmode" value="transparent"></object>'},flashReady:function(a){var b=this.flashPlayers[a],c=document.getElementById(a),d=b.pluginMediaElement;d.pluginApi=d.pluginElement=c,b.success(d,d.pluginElement),c.cueVideoById(b.videoId);var e=b.containerId+"_callback";window[e]=function(a){mejs.YouTubeApi.handleStateChange(a,c,d)},c.addEventListener("onStateChange",e),setInterval(function(){mejs.YouTubeApi.createEvent(c,d,"timeupdate")},250),mejs.YouTubeApi.createEvent(c,d,"canplay")},handleStateChange:function(a,b,c){switch(a){case-1:c.paused=!0,c.ended=!0,mejs.YouTubeApi.createEvent(b,c,"loadedmetadata");break;case 0:c.paused=!1,c.ended=!0,mejs.YouTubeApi.createEvent(b,c,"ended");break;case 1:c.paused=!1,c.ended=!1,mejs.YouTubeApi.createEvent(b,c,"play"),mejs.YouTubeApi.createEvent(b,c,"playing");break;case 2:c.paused=!0,c.ended=!1,mejs.YouTubeApi.createEvent(b,c,"pause");break;case 3:mejs.YouTubeApi.createEvent(b,c,"progress");break;case 5:}}},window.onYouTubePlayerAPIReady=function(){mejs.YouTubeApi.iFrameReady()},window.onYouTubePlayerReady=function(a){mejs.YouTubeApi.flashReady(a)},window.mejs=mejs,window.MediaElement=mejs.MediaElement,function(a,b,c){"use strict";var d={locale:{language:b.i18n&&b.i18n.locale.language||"",strings:b.i18n&&b.i18n.locale.strings||{}},ietf_lang_regex:/^(x\-)?[a-z]{2,}(\-\w{2,})?(\-\w{2,})?$/,methods:{}};d.getLanguage=function(){var a=d.locale.language||window.navigator.userLanguage||window.navigator.language;return d.ietf_lang_regex.exec(a)?a:null},"undefined"!=typeof mejsL10n&&(d.locale.language=mejsL10n.language),d.methods.checkPlain=function(a){var b,c,d={"&":"&",'"':""","<":"<",">":">"};a=String(a);for(b in d)d.hasOwnProperty(b)&&(c=new RegExp(b,"g"),a=a.replace(c,d[b]));return a},d.methods.t=function(a,b){return d.locale.strings&&d.locale.strings[b.context]&&d.locale.strings[b.context][a]&&(a=d.locale.strings[b.context][a]),d.methods.checkPlain(a)},d.t=function(a,b){if("string"==typeof a&&a.length>0){var c=d.getLanguage();return b=b||{context:c},d.methods.t(a,b)}throw{name:"InvalidArgumentException",message:"First argument is either not a string or empty."}},b.i18n=d}(document,mejs),function(a,b){"use strict";"undefined"!=typeof mejsL10n&&(a[mejsL10n.language]=mejsL10n.strings)}(mejs.i18n.locale.strings),/*! - * - * MediaElementPlayer - * http://mediaelementjs.com/ - * - * Creates a controller bar for HTML5 <video> add <audio> tags - * using jQuery and MediaElement.js (HTML5 Flash/Silverlight wrapper) - * - * Copyright 2010-2013, John Dyer (http://j.hn/) - * License: MIT - * - */ -"undefined"!=typeof jQuery?mejs.$=jQuery:"undefined"!=typeof Zepto?(mejs.$=Zepto,Zepto.fn.outerWidth=function(a){var b=$(this).width();return a&&(b+=parseInt($(this).css("margin-right"),10),b+=parseInt($(this).css("margin-left"),10)),b}):"undefined"!=typeof ender&&(mejs.$=ender),function(a){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"],isVideo:!0,stretching:"auto",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());var c=Math.min(b.volume+.1,1);b.setVolume(c)}},{keys:[40],action:function(a,b){a.container.find(".mejs-volume-slider").css("display","block"),a.isVideo&&(a.showControls(),a.startControlsTimer());var c=Math.max(b.volume-.1,0);b.setVolume(c)}},{keys:[37,227],action:function(a,b){if(!isNaN(b.duration)&&b.duration>0){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)&&b.duration>0){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(b,c){if(!(this instanceof mejs.MediaElementPlayer))return new mejs.MediaElementPlayer(b,c);var d=this;return d.$media=d.$node=a(b),d.node=d.media=d.$media[0],d.node?"undefined"!=typeof d.node.player?d.node.player:("undefined"==typeof c&&(c=d.$node.data("mejsoptions")),d.options=a.extend({},mejs.MepDefaults,c),d.options.timeFormat||(d.options.timeFormat="mm:ss",d.options.alwaysShowHours&&(d.options.timeFormat="hh:mm:ss"),d.options.showTimecodeFrameCount&&(d.options.timeFormat+=":ff")),mejs.Utility.calculateTimeFormat(0,d.options,d.options.framesPerSecond||25),d.id="mep_"+mejs.mepIndex++,mejs.players[d.id]=d,d.init(),d):void 0},mejs.MediaElementPlayer.prototype={hasFocus:!1,controlsAreVisible:!0,init:function(){var b=this,c=mejs.MediaFeatures,d=a.extend(!0,{},b.options,{success:function(a,c){b.meReady(a,c)},error:function(a){b.handleError(a)}}),e=b.media.tagName.toLowerCase();if(b.isDynamic="audio"!==e&&"video"!==e,b.isDynamic?b.isVideo=b.options.isVideo:b.isVideo="audio"!==e&&b.options.isVideo,c.isiPad&&b.options.iPadUseNativeControls||c.isiPhone&&b.options.iPhoneUseNativeControls)b.$media.attr("controls","controls"),c.isiPad&&null!==b.media.getAttribute("autoplay")&&b.play();else if(c.isAndroid&&b.options.AndroidUseNativeControls);else{b.$media.removeAttr("controls");var f=b.isVideo?mejs.i18n.t("Video Player"):mejs.i18n.t("Audio Player");a('<span class="mejs-offscreen">'+f+"</span>").insertBefore(b.$media),b.container=a('<div id="'+b.id+'" class="mejs-container '+(mejs.MediaFeatures.svgAsImg?"svg":"no-svg")+'" tabindex="0" role="application" aria-label="'+f+'"><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(b.$media[0].className).insertBefore(b.$media).focus(function(a){if(!b.controlsAreVisible&&!b.hasFocus&&(b.showControls(!0),!b.hasMsNativeFullScreen)){var c=b.container.find(".mejs-playpause-button > button");c.focus()}}),"fill"!==b.options.stretching||b.container.parent("mejs-fill-container").length||(b.outerContainer=b.$media.parent(),b.container.wrap('<div class="mejs-fill-container"/>')),b.container.addClass((c.isAndroid?"mejs-android ":"")+(c.isiOS?"mejs-ios ":"")+(c.isiPad?"mejs-ipad ":"")+(c.isiPhone?"mejs-iphone ":"")+(b.isVideo?"mejs-video ":"mejs-audio ")),b.container.find(".mejs-mediaelement").append(b.$media),b.node.player=b,b.controls=b.container.find(".mejs-controls"),b.layers=b.container.find(".mejs-layers");var g=b.isVideo?"video":"audio",h=g.substring(0,1).toUpperCase()+g.substring(1);b.options[g+"Width"]>0||b.options[g+"Width"].toString().indexOf("%")>-1?b.width=b.options[g+"Width"]:""!==b.media.style.width&&null!==b.media.style.width?b.width=b.media.style.width:null!==b.media.getAttribute("width")?b.width=b.$media.attr("width"):b.width=b.options["default"+h+"Width"],b.options[g+"Height"]>0||b.options[g+"Height"].toString().indexOf("%")>-1?b.height=b.options[g+"Height"]:""!==b.media.style.height&&null!==b.media.style.height?b.height=b.media.style.height:null!==b.$media[0].getAttribute("height")?b.height=b.$media.attr("height"):b.height=b.options["default"+h+"Height"],b.setPlayerSize(b.width,b.height),d.pluginWidth=b.width,d.pluginHeight=b.height}mejs.MediaElement(b.$media[0],d),"undefined"!=typeof b.container&&b.controlsAreVisible&&b.container.trigger("controlsshown")},showControls:function(a){var b=this;a="undefined"==typeof a||a,b.controlsAreVisible||(a?(b.controls.removeClass("mejs-offscreen").stop(!0,!0).fadeIn(200,function(){b.controlsAreVisible=!0,b.container.trigger("controlsshown")}),b.container.find(".mejs-control").removeClass("mejs-offscreen").stop(!0,!0).fadeIn(200,function(){b.controlsAreVisible=!0})):(b.controls.removeClass("mejs-offscreen").css("display","block"),b.container.find(".mejs-control").removeClass("mejs-offscreen").css("display","block"),b.controlsAreVisible=!0,b.container.trigger("controlsshown")),b.setControlsSize())},hideControls:function(b){var c=this;b="undefined"==typeof b||b,!c.controlsAreVisible||c.options.alwaysShowControls||c.keyboardAction||(b?(c.controls.stop(!0,!0).fadeOut(200,function(){a(this).addClass("mejs-offscreen").css("display","block"),c.controlsAreVisible=!1,c.container.trigger("controlshidden")}),c.container.find(".mejs-control").stop(!0,!0).fadeOut(200,function(){a(this).addClass("mejs-offscreen").css("display","block")})):(c.controls.addClass("mejs-offscreen").css("display","block"),c.container.find(".mejs-control").addClass("mejs-offscreen").css("display","block"),c.controlsAreVisible=!1,c.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){var b=this;null!==b.controlsTimer&&(clearTimeout(b.controlsTimer),delete b.controlsTimer,b.controlsTimer=null)},controlsEnabled:!0,disableControls:function(){var a=this;a.killControlsTimer(),a.hideControls(!1),this.controlsEnabled=!1},enableControls:function(){var a=this;a.showControls(!1),a.controlsEnabled=!0},meReady:function(b,c){var d,e,f=this,g=mejs.MediaFeatures,h=c.getAttribute("autoplay"),i=!("undefined"==typeof h||null===h||"false"===h);if(!f.created){if(f.created=!0,f.media=b,f.domNode=c,!(g.isAndroid&&f.options.AndroidUseNativeControls||g.isiPad&&f.options.iPadUseNativeControls||g.isiPhone&&f.options.iPhoneUseNativeControls)){f.buildposter(f,f.controls,f.layers,f.media),f.buildkeyboard(f,f.controls,f.layers,f.media),f.buildoverlays(f,f.controls,f.layers,f.media),f.findTracks();for(d in f.options.features)if(e=f.options.features[d],f["build"+e])try{f["build"+e](f,f.controls,f.layers,f.media)}catch(j){}f.container.trigger("controlsready"),f.setPlayerSize(f.width,f.height),f.setControlsSize(),f.isVideo&&(mejs.MediaFeatures.hasTouch?f.$media.bind("touchstart",function(){f.controlsAreVisible?f.hideControls(!1):f.controlsEnabled&&f.showControls(!1)}):(f.clickToPlayPauseCallback=function(){f.options.clickToPlayPause&&(f.media.paused?f.play():f.pause())},f.media.addEventListener("click",f.clickToPlayPauseCallback,!1),f.container.bind("mouseenter",function(){f.controlsEnabled&&(f.options.alwaysShowControls||(f.killControlsTimer("enter"),f.showControls(),f.startControlsTimer(2500)))}).bind("mousemove",function(){f.controlsEnabled&&(f.controlsAreVisible||f.showControls(),f.options.alwaysShowControls||f.startControlsTimer(2500))}).bind("mouseleave",function(){f.controlsEnabled&&(f.media.paused||f.options.alwaysShowControls||f.startControlsTimer(1e3))})),f.options.hideVideoControlsOnLoad&&f.hideControls(!1),i&&!f.options.alwaysShowControls&&f.hideControls(),f.options.enableAutosize&&f.media.addEventListener("loadedmetadata",function(a){f.options.videoHeight<=0&&null===f.domNode.getAttribute("height")&&!isNaN(a.target.videoHeight)&&(f.setPlayerSize(a.target.videoWidth,a.target.videoHeight),f.setControlsSize(),f.media.setVideoSize(a.target.videoWidth,a.target.videoHeight))},!1)),f.media.addEventListener("play",function(){var a;for(a in mejs.players){var b=mejs.players[a];b.id==f.id||!f.options.pauseOtherPlayers||b.paused||b.ended||b.pause(),b.hasFocus=!1}f.hasFocus=!0},!1),f.media.addEventListener("ended",function(b){if(f.options.autoRewind)try{f.media.setCurrentTime(0),window.setTimeout(function(){a(f.container).find(".mejs-overlay-loading").parent().hide()},20)}catch(c){}f.media.pause(),f.setProgressRail&&f.setProgressRail(),f.setCurrentRail&&f.setCurrentRail(),f.options.loop?f.play():!f.options.alwaysShowControls&&f.controlsEnabled&&f.showControls()},!1),f.media.addEventListener("loadedmetadata",function(a){f.updateDuration&&f.updateDuration(),f.updateCurrent&&f.updateCurrent(),f.isFullScreen||(f.setPlayerSize(f.width,f.height),f.setControlsSize())},!1);var k=null;f.media.addEventListener("timeupdate",function(){k!==this.duration&&(k=this.duration,mejs.Utility.calculateTimeFormat(k,f.options,f.options.framesPerSecond||25),f.updateDuration&&f.updateDuration(),f.updateCurrent&&f.updateCurrent(),f.setControlsSize())},!1),f.container.focusout(function(b){if(b.relatedTarget){var c=a(b.relatedTarget);f.keyboardAction&&0===c.parents(".mejs-container").length&&(f.keyboardAction=!1,f.hideControls(!0))}}),setTimeout(function(){f.setPlayerSize(f.width,f.height),f.setControlsSize()},50),f.globalBind("resize",function(){f.isFullScreen||mejs.MediaFeatures.hasTrueNativeFullScreen&&document.webkitIsFullScreen||f.setPlayerSize(f.width,f.height),f.setControlsSize()}),"youtube"==f.media.pluginType&&(g.isiOS||g.isAndroid)&&(f.container.find(".mejs-overlay-play").hide(),f.container.find(".mejs-poster").hide())}i&&"native"==b.pluginType&&f.play(),f.options.success&&("string"==typeof f.options.success?window[f.options.success](f.media,f.domNode,f):f.options.success(f.media,f.domNode,f))}},handleError:function(a){var b=this;b.controls&&b.controls.hide(),b.options.error&&b.options.error(a)},setPlayerSize:function(a,b){var c=this;if(!c.options.setDimensions)return!1;switch("undefined"!=typeof a&&(c.width=a),"undefined"!=typeof b&&(c.height=b),c.options.stretching){case"fill":c.isVideo?this.setFillMode():this.setDimensions(c.width,c.height);break;case"responsive":this.setResponsiveMode();break;case"none":this.setDimensions(c.width,c.height);break;default:this.hasFluidMode()===!0?this.setResponsiveMode():this.setDimensions(c.width,c.height)}},hasFluidMode:function(){var a=this;return a.height.toString().indexOf("%")>0||"none"!==a.$node.css("max-width")&&"t.width"!==a.$node.css("max-width")||a.$node[0].currentStyle&&"100%"===a.$node[0].currentStyle.maxWidth},setResponsiveMode:function(){var b=this,c=function(){return b.isVideo?b.media.videoWidth&&b.media.videoWidth>0?b.media.videoWidth:null!==b.media.getAttribute("width")?b.media.getAttribute("width"):b.options.defaultVideoWidth:b.options.defaultAudioWidth}(),d=function(){return b.isVideo?b.media.videoHeight&&b.media.videoHeight>0?b.media.videoHeight:null!==b.media.getAttribute("height")?b.media.getAttribute("height"):b.options.defaultVideoHeight:b.options.defaultAudioHeight}(),e=b.container.parent().closest(":visible").width(),f=b.container.parent().closest(":visible").height(),g=b.isVideo||!b.options.autosizeProgress?parseInt(e*d/c,10):d;(isNaN(g)||0!==f&&g>f&&f>d)&&(g=f),b.container.parent().length>0&&"body"===b.container.parent()[0].tagName.toLowerCase()&&(e=a(window).width(),g=a(window).height()),g&&e&&(b.container.width(e).height(g),b.$media.add(b.container.find(".mejs-shim")).width("100%").height("100%"),b.isVideo&&b.media.setVideoSize&&b.media.setVideoSize(e,g),b.layers.children(".mejs-layer").width("100%").height("100%"))},setFillMode:function(){var a=this,b=a.outerContainer;b.width()||b.height(a.$media.width()),b.height()||b.height(a.$media.height());var c=b.width(),d=b.height();a.setDimensions("100%","100%"),a.container.find(".mejs-poster img").css("display","block"),targetElement=a.container.find("object, embed, iframe, video");var e=a.height,f=a.width,g=c,h=e*c/f,i=f*d/e,j=d,k=!(i>c),l=k?Math.floor(g):Math.floor(i),m=k?Math.floor(h):Math.floor(j);k?(targetElement.height(m).width(c),a.media.setVideoSize&&a.media.setVideoSize(c,m)):(targetElement.height(d).width(l),a.media.setVideoSize&&a.media.setVideoSize(l,d)),targetElement.css({"margin-left":Math.floor((c-l)/2),"margin-top":0})},setDimensions:function(a,b){var c=this;c.container.width(a).height(b),c.layers.children(".mejs-layer").width(a).height(b)},setControlsSize:function(){var b=this,c=0,d=0,e=b.controls.find(".mejs-time-rail"),f=b.controls.find(".mejs-time-total"),g=e.siblings(),h=g.last(),i=null;if(b.container.is(":visible")&&e.length&&e.is(":visible")){b.options&&!b.options.autosizeProgress&&(d=parseInt(e.css("width"),10)),0!==d&&d||(g.each(function(){var b=a(this);"absolute"!=b.css("position")&&b.is(":visible")&&(c+=a(this).outerWidth(!0))}),d=b.controls.width()-c-(e.outerWidth(!0)-e.width()));do e.width(d),f.width(d-(f.outerWidth(!0)-f.width())),"absolute"!=h.css("position")&&(i=h.length?h.position():null,d--);while(null!==i&&i.top.toFixed(2)>0&&d>0);b.container.trigger("controlsresize")}},buildposter:function(b,c,d,e){var f=this,g=a('<div class="mejs-poster mejs-layer"></div>').appendTo(d),h=b.$media.attr("poster");""!==b.options.poster&&(h=b.options.poster),h?f.setPoster(h):g.hide(),e.addEventListener("play",function(){g.hide()},!1),b.options.showPosterWhenEnded&&b.options.autoRewind&&e.addEventListener("ended",function(){g.show()},!1)},setPoster:function(b){var c=this,d=c.container.find(".mejs-poster"),e=d.find("img");0===e.length&&(e=a('<img width="100%" height="100%" alt="" />').appendTo(d)),e.attr("src",b),d.css({"background-image":"url("+b+")"})},buildoverlays:function(b,c,d,e){var f=this;if(b.isVideo){var g=a('<div class="mejs-overlay mejs-layer"><div class="mejs-overlay-loading"><span></span></div></div>').hide().appendTo(d),h=a('<div class="mejs-overlay mejs-layer"><div class="mejs-overlay-error"></div></div>').hide().appendTo(d),i=a('<div class="mejs-overlay mejs-layer mejs-overlay-play"><div class="mejs-overlay-button"></div></div>').appendTo(d).bind("click",function(){f.options.clickToPlayPause&&e.paused&&e.play()});e.addEventListener("play",function(){i.hide(),g.hide(),c.find(".mejs-time-buffering").hide(),h.hide()},!1),e.addEventListener("playing",function(){i.hide(),g.hide(),c.find(".mejs-time-buffering").hide(),h.hide()},!1),e.addEventListener("seeking",function(){g.show(),c.find(".mejs-time-buffering").show()},!1),e.addEventListener("seeked",function(){g.hide(),c.find(".mejs-time-buffering").hide()},!1),e.addEventListener("pause",function(){mejs.MediaFeatures.isiPhone||i.show()},!1),e.addEventListener("waiting",function(){g.show(),c.find(".mejs-time-buffering").show()},!1),e.addEventListener("loadeddata",function(){g.show(),c.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(),c.find(".mejs-time-buffering").hide(),clearTimeout(e.canplayTimeout)},!1),e.addEventListener("error",function(a){f.handleError(a),g.hide(),i.hide(),h.show(),h.find(".mejs-overlay-error").html("Error loading this resource")},!1),e.addEventListener("keydown",function(a){f.onkeydown(b,e,a)},!1)}},buildkeyboard:function(b,c,d,e){var f=this;f.container.keydown(function(){f.keyboardAction=!0}),f.globalBind("keydown",function(c){return b.hasFocus=0!==a(c.target).closest(".mejs-container").length&&a(c.target).closest(".mejs-container").attr("id")===b.$media.closest(".mejs-container").attr("id"),f.onkeydown(b,e,c)}),f.globalBind("click",function(c){b.hasFocus=0!==a(c.target).closest(".mejs-container").length})},onkeydown:function(a,b,c){if(a.hasFocus&&a.options.enableKeyboard)for(var d=0,e=a.options.keyActions.length;e>d;d++)for(var f=a.options.keyActions[d],g=0,h=f.keys.length;h>g;g++)if(c.keyCode==f.keys[g])return"function"==typeof c.preventDefault&&c.preventDefault(),f.action(a,b,c.keyCode,c),!1;return!0},findTracks:function(){var b=this,c=b.$media.find("track");b.tracks=[],c.each(function(c,d){d=a(d),b.tracks.push({srclang:d.attr("srclang")?d.attr("srclang").toLowerCase():"",src:d.attr("src"),kind:d.attr("kind"),label:d.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,c=this;c.container.prev(".mejs-offscreen").remove();for(a in c.options.features)if(b=c.options.features[a],c["clean"+b])try{c["clean"+b](c)}catch(d){}c.isDynamic?c.$node.insertBefore(c.container):(c.$media.prop("controls",!0),c.$node.clone().insertBefore(c.container).show(),c.$node.remove()),"native"!==c.media.pluginType&&c.media.remove(),delete mejs.players[c.id],"object"==typeof c.container&&c.container.remove(),c.globalUnbind(),delete c.node.player},rebuildtracks:function(){var a=this;a.findTracks(),a.buildtracks(a,a.controls,a.layers,a.media)},resetSize:function(){var a=this;setTimeout(function(){a.setPlayerSize(a.width,a.height),a.setControlsSize()},50)}},function(){function b(b,d){var e={d:[],w:[]};return a.each((b||"").split(" "),function(a,b){var f=b+"."+d;0===f.indexOf(".")?(e.d.push(f),e.w.push(f)):e[c.test(b)?"w":"d"].push(f)}),e.d=e.d.join(" "),e.w=e.w.join(" "),e}var c=/^((after|before)print|(before)?unload|hashchange|message|o(ff|n)line|page(hide|show)|popstate|resize|storage)\b/;mejs.MediaElementPlayer.prototype.globalBind=function(c,d,e){var f=this,g=f.node?f.node.ownerDocument:document;c=b(c,f.id),c.d&&a(g).bind(c.d,d,e),c.w&&a(window).bind(c.w,d,e)},mejs.MediaElementPlayer.prototype.globalUnbind=function(c,d){var e=this,f=e.node?e.node.ownerDocument:document;c=b(c,e.id),c.d&&a(f).unbind(c.d,d),c.w&&a(window).unbind(c.w,d)}}(),"undefined"!=typeof a&&(a.fn.mediaelementplayer=function(b){return b===!1?this.each(function(){var b=a(this).data("mediaelementplayer");b&&b.remove(),a(this).removeData("mediaelementplayer")}):this.each(function(){a(this).data("mediaelementplayer",new mejs.MediaElementPlayer(this,b))}),this},a(document).ready(function(){a(".mejs-player").mediaelementplayer()})),window.MediaElementPlayer=mejs.MediaElementPlayer}(mejs.$),function(a){a.extend(mejs.MepDefaults,{playText:mejs.i18n.t("Play"),pauseText:mejs.i18n.t("Pause")}),a.extend(MediaElementPlayer.prototype,{buildplaypause:function(b,c,d,e){function f(a){"play"===a?(i.removeClass("mejs-play").addClass("mejs-pause"),j.attr({title:h.pauseText,"aria-label":h.pauseText})):(i.removeClass("mejs-pause").addClass("mejs-play"),j.attr({title:h.playText,"aria-label":h.playText}))}var g=this,h=g.options,i=a('<div class="mejs-button mejs-playpause-button mejs-play" ><button type="button" aria-controls="'+g.id+'" title="'+h.playText+'" aria-label="'+h.playText+'"></button></div>').appendTo(c).click(function(a){return a.preventDefault(),e.paused?e.play():e.pause(),!1}),j=i.find("button");f("pse"),e.addEventListener("play",function(){f("play")},!1),e.addEventListener("playing",function(){f("play")},!1),e.addEventListener("pause",function(){f("pse")},!1),e.addEventListener("paused",function(){f("pse")},!1)}})}(mejs.$),function(a){a.extend(mejs.MepDefaults,{stopText:"Stop"}),a.extend(MediaElementPlayer.prototype,{buildstop:function(b,c,d,e){var f=this;a('<div class="mejs-button mejs-stop-button mejs-stop"><button type="button" aria-controls="'+f.id+'" title="'+f.options.stopText+'" aria-label="'+f.options.stopText+'"></button></div>').appendTo(c).click(function(){e.paused||e.pause(),e.currentTime>0&&(e.setCurrentTime(0),e.pause(),c.find(".mejs-time-current").width("0px"),c.find(".mejs-time-handle").css("left","0px"),c.find(".mejs-time-float-current").html(mejs.Utility.secondsToTimeCode(0,b.options)),c.find(".mejs-currenttime").html(mejs.Utility.secondsToTimeCode(0,b.options)),d.find(".mejs-poster").show())})}})}(mejs.$),function(a){a.extend(mejs.MepDefaults,{progessHelpText:mejs.i18n.t("Use Left/Right Arrow keys to advance one second, Up/Down arrows to advance ten seconds.")}),a.extend(MediaElementPlayer.prototype,{buildprogress:function(b,c,d,e){a('<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(c),c.find(".mejs-time-buffering").hide();var f=this,g=c.find(".mejs-time-total"),h=c.find(".mejs-time-loaded"),i=c.find(".mejs-time-current"),j=c.find(".mejs-time-handle"),k=c.find(".mejs-time-float"),l=c.find(".mejs-time-float-current"),m=c.find(".mejs-time-slider"),n=function(a){var c,d=g.offset(),f=g.width(),h=0,i=0,j=0;c=a.originalEvent&&a.originalEvent.changedTouches?a.originalEvent.changedTouches[0].pageX:a.changedTouches?a.changedTouches[0].pageX:a.pageX,e.duration&&(c<d.left?c=d.left:c>f+d.left&&(c=f+d.left),j=c-d.left,h=j/f,i=.02>=h?0:h*e.duration,o&&i!==e.currentTime&&e.setCurrentTime(i),mejs.MediaFeatures.hasTouch||(k.css("left",j),l.html(mejs.Utility.secondsToTimeCode(i,b.options)),k.show()))},o=!1,p=!1,q=0,r=!1,s=b.options.autoRewind,t=function(a){var c=e.currentTime,d=mejs.i18n.t("Time Slider"),f=mejs.Utility.secondsToTimeCode(c,b.options),g=e.duration;m.attr({"aria-label":d,"aria-valuemin":0,"aria-valuemax":g,"aria-valuenow":c,"aria-valuetext":f,role:"slider",tabindex:0})},u=function(){var a=new Date;a-q>=1e3&&e.play()};m.bind("focus",function(a){b.options.autoRewind=!1}),m.bind("blur",function(a){b.options.autoRewind=s}),m.bind("keydown",function(a){new Date-q>=1e3&&(r=e.paused);var c=a.keyCode,d=e.duration,f=e.currentTime,g=b.options.defaultSeekForwardInterval(d),h=b.options.defaultSeekBackwardInterval(d);switch(c){case 37:case 40:f-=h;break;case 39:case 38:f+=g;break;case 36:f=0;break;case 35:f=d;break;case 32:case 13:return void(e.paused?e.play():e.pause());default:return}return f=0>f?0:f>=d?d:Math.floor(f),q=new Date,r||e.pause(),f<e.duration&&!r&&setTimeout(u,1100),e.setCurrentTime(f),a.preventDefault(),a.stopPropagation(),!1}),g.bind("mousedown touchstart",function(a){(1===a.which||0===a.which)&&(o=!0,n(a),f.globalBind("mousemove.dur touchmove.dur",function(a){n(a)}),f.globalBind("mouseup.dur touchend.dur",function(a){o=!1,k.hide(),f.globalUnbind(".dur")}))}).bind("mouseenter",function(a){p=!0,f.globalBind("mousemove.dur",function(a){n(a)}),mejs.MediaFeatures.hasTouch||k.show()}).bind("mouseleave",function(a){p=!1,o||(f.globalUnbind(".dur"),k.hide())}),e.addEventListener("progress",function(a){b.setProgressRail(a),b.setCurrentRail(a)},!1),e.addEventListener("timeupdate",function(a){b.setProgressRail(a),b.setCurrentRail(a),t(a)},!1),f.container.on("controlsresize",function(){b.setProgressRail(),b.setCurrentRail()}),f.loaded=h,f.total=g,f.current=i,f.handle=j},setProgressRail:function(a){var b=this,c=void 0!==a?a.target:b.media,d=null;c&&c.buffered&&c.buffered.length>0&&c.buffered.end&&c.duration?d=c.buffered.end(c.buffered.length-1)/c.duration:c&&void 0!==c.bytesTotal&&c.bytesTotal>0&&void 0!==c.bufferedBytes?d=c.bufferedBytes/c.bytesTotal:a&&a.lengthComputable&&0!==a.total&&(d=a.loaded/a.total),null!==d&&(d=Math.min(1,Math.max(0,d)),b.loaded&&b.total&&b.loaded.width(b.total.width()*d))},setCurrentRail:function(){var a=this;if(void 0!==a.media.currentTime&&a.media.duration&&a.total&&a.handle){var b=Math.round(a.total.width()*a.media.currentTime/a.media.duration),c=b-Math.round(a.handle.outerWidth(!0)/2);a.current.width(b),a.handle.css("left",c)}}})}(mejs.$),function(a){a.extend(mejs.MepDefaults,{duration:-1,timeAndDurationSeparator:"<span> | </span>"}),a.extend(MediaElementPlayer.prototype,{buildcurrent:function(b,c,d,e){var f=this;a('<div class="mejs-time" role="timer" aria-live="off"><span class="mejs-currenttime">'+mejs.Utility.secondsToTimeCode(0,b.options)+"</span></div>").appendTo(c),f.currenttime=f.controls.find(".mejs-currenttime"),e.addEventListener("timeupdate",function(){b.updateCurrent()},!1)},buildduration:function(b,c,d,e){var f=this;c.children().last().find(".mejs-currenttime").length>0?a(f.options.timeAndDurationSeparator+'<span class="mejs-duration">'+mejs.Utility.secondsToTimeCode(f.options.duration,f.options)+"</span>").appendTo(c.find(".mejs-time")):(c.find(".mejs-currenttime").parent().addClass("mejs-currenttime-container"),a('<div class="mejs-time mejs-duration-container"><span class="mejs-duration">'+mejs.Utility.secondsToTimeCode(f.options.duration,f.options)+"</span></div>").appendTo(c)),f.durationD=f.controls.find(".mejs-duration"),e.addEventListener("timeupdate",function(){b.updateDuration()},!1)},updateCurrent:function(){var a=this,b=a.media.currentTime;isNaN(b)&&(b=0),a.currenttime&&a.currenttime.html(mejs.Utility.secondsToTimeCode(b,a.options))},updateDuration:function(){var a=this,b=a.media.duration;a.options.duration>0&&(b=a.options.duration),isNaN(b)&&(b=0),a.container.toggleClass("mejs-long-video",b>3600),a.durationD&&b>0&&a.durationD.html(mejs.Utility.secondsToTimeCode(b,a.options))}})}(mejs.$),function(a){a.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"}),a.extend(MediaElementPlayer.prototype,{buildvolume:function(b,c,d,e){if(!mejs.MediaFeatures.isAndroid&&!mejs.MediaFeatures.isiOS||!this.options.hideVolumeOnTouchDevices){var f=this,g=f.isVideo?f.options.videoVolume:f.options.audioVolume,h="horizontal"==g?a('<div class="mejs-button mejs-volume-button mejs-mute"><button type="button" aria-controls="'+f.id+'" title="'+f.options.muteText+'" aria-label="'+f.options.muteText+'"></button></div><a href="javascript:void(0);" class="mejs-horizontal-volume-slider"><span class="mejs-offscreen">'+f.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(c):a('<div class="mejs-button mejs-volume-button mejs-mute"><button type="button" aria-controls="'+f.id+'" title="'+f.options.muteText+'" aria-label="'+f.options.muteText+'"></button><a href="javascript:void(0);" class="mejs-volume-slider"><span class="mejs-offscreen">'+f.options.allyVolumeControlText+'</span><div class="mejs-volume-total"></div><div class="mejs-volume-current"></div><div class="mejs-volume-handle"></div></a></div>').appendTo(c),i=f.container.find(".mejs-volume-slider, .mejs-horizontal-volume-slider"),j=f.container.find(".mejs-volume-total, .mejs-horizontal-volume-total"),k=f.container.find(".mejs-volume-current, .mejs-horizontal-volume-current"),l=f.container.find(".mejs-volume-handle, .mejs-horizontal-volume-handle"),m=function(a,b){if(!i.is(":visible")&&"undefined"==typeof b)return i.show(),m(a,!0),void i.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 c=j.position();if("vertical"==g){var d=j.height(),e=d-d*a;l.css("top",Math.round(c.top+e-l.height()/2)),k.height(d-e),k.css("top",c.top+e)}else{var f=j.width(),n=f*a;l.css("left",Math.round(c.left+n-l.width()/2)),k.width(Math.round(n))}},n=function(a){var b=null,c=j.offset();if("vertical"===g){var d=j.height(),f=a.pageY-c.top;if(b=(d-f)/d,0===c.top||0===c.left)return}else{var h=j.width(),i=a.pageX-c.left;b=i/h}b=Math.max(0,b),b=Math.min(b,1),m(b),0===b?e.setMuted(!0):e.setMuted(!1),e.setVolume(b)},o=!1,p=!1;h.hover(function(){i.show(),p=!0},function(){p=!1,o||"vertical"!=g||i.hide()});var q=function(a){var b=Math.floor(100*e.volume);i.attr({"aria-label":mejs.i18n.t("Volume Slider"),"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":b,"aria-valuetext":b+"%",role:"slider",tabindex:0})};i.bind("mouseover",function(){p=!0}).bind("mousedown",function(a){return n(a),f.globalBind("mousemove.vol",function(a){n(a)}),f.globalBind("mouseup.vol",function(){o=!1,f.globalUnbind(".vol"),p||"vertical"!=g||i.hide()}),o=!0,!1}).bind("keydown",function(a){var b=a.keyCode,c=e.volume;switch(b){case 38:c=Math.min(c+.1,1);break;case 40:c=Math.max(0,c-.1);break;default:return!0}return o=!1,m(c),e.setVolume(c),!1}),h.find("button").click(function(){e.setMuted(!e.muted)}),h.find("button").bind("focus",function(){i.show()}),e.addEventListener("volumechange",function(a){o||(e.muted?(m(0),h.removeClass("mejs-mute").addClass("mejs-unmute")):(m(e.volume),h.removeClass("mejs-unmute").addClass("mejs-mute"))),q(a)},!1),0===b.options.startVolume&&e.setMuted(!0),"native"===e.pluginType&&e.setVolume(b.options.startVolume),f.container.on("controlsresize",function(){m(e.volume)})}}})}(mejs.$),function(a){a.extend(mejs.MepDefaults,{usePluginFullScreen:!0,newWindowCallback:function(){return""},fullscreenText:mejs.i18n.t("Fullscreen")}),a.extend(MediaElementPlayer.prototype,{isFullScreen:!1,isNativeFullScreen:!1,isInIframe:!1,fullscreenMode:"",buildfullscreen:function(b,c,d,e){if(b.isVideo){b.isInIframe=window.location!=window.parent.location,e.addEventListener("play",function(){b.detectFullscreenMode()});var f=this,g=null,h=a('<div class="mejs-button mejs-fullscreen-button"><button type="button" aria-controls="'+f.id+'" title="'+f.options.fullscreenText+'" aria-label="'+f.options.fullscreenText+'"></button></div>').appendTo(c).on("click",function(){var a=mejs.MediaFeatures.hasTrueNativeFullScreen&&mejs.MediaFeatures.isFullScreen()||b.isFullScreen;a?b.exitFullScreen():b.enterFullScreen()}).on("mouseover",function(){if("plugin-hover"==f.fullscreenMode){null!==g&&(clearTimeout(g),delete g);var a=h.offset(),c=b.container.offset();e.positionFullscreenButton(a.left-c.left,a.top-c.top,!0); -}}).on("mouseout",function(){"plugin-hover"==f.fullscreenMode&&(null!==g&&(clearTimeout(g),delete g),g=setTimeout(function(){e.hideFullscreenButton()},1500))});if(b.fullscreenBtn=h,f.globalBind("keydown",function(a){27==a.keyCode&&(mejs.MediaFeatures.hasTrueNativeFullScreen&&mejs.MediaFeatures.isFullScreen()||f.isFullScreen)&&b.exitFullScreen()}),f.normalHeight=0,f.normalWidth=0,mejs.MediaFeatures.hasTrueNativeFullScreen){var i=function(a){b.isFullScreen&&(mejs.MediaFeatures.isFullScreen()?(b.isNativeFullScreen=!0,b.setControlsSize()):(b.isNativeFullScreen=!1,b.exitFullScreen()))};b.globalBind(mejs.MediaFeatures.fullScreenEventName,i)}}},detectFullscreenMode:function(){var a=this,b="",c=mejs.MediaFeatures;return c.hasTrueNativeFullScreen&&"native"===a.media.pluginType?b="native-native":c.hasTrueNativeFullScreen&&"native"!==a.media.pluginType&&!c.hasFirefoxPluginMovingProblem?b="plugin-native":a.usePluginFullScreen?mejs.MediaFeatures.supportsPointerEvents?(b="plugin-click",a.createPluginClickThrough()):b="plugin-hover":b="fullwindow",a.fullscreenMode=b,b},isPluginClickThroughCreated:!1,createPluginClickThrough:function(){var b=this;if(!b.isPluginClickThroughCreated){var c,d,e=!1,f=function(){if(e){for(var a in g)g[a].hide();b.fullscreenBtn.css("pointer-events",""),b.controls.css("pointer-events",""),b.media.removeEventListener("click",b.clickToPlayPauseCallback),e=!1}},g={},h=["top","left","right","bottom"],i=function(){var a=fullscreenBtn.offset().left-b.container.offset().left,d=fullscreenBtn.offset().top-b.container.offset().top,e=fullscreenBtn.outerWidth(!0),f=fullscreenBtn.outerHeight(!0),h=b.container.width(),i=b.container.height();for(c in g)g[c].css({position:"absolute",top:0,left:0});g.top.width(h).height(d),g.left.width(a).height(f).css({top:d}),g.right.width(h-a-e).height(f).css({top:d,left:a+e}),g.bottom.width(h).height(i-f-d).css({top:d+f})};for(b.globalBind("resize",function(){i()}),c=0,d=h.length;d>c;c++)g[h[c]]=a('<div class="mejs-fullscreen-hover" />').appendTo(b.container).mouseover(f).hide();fullscreenBtn.on("mouseover",function(){if(!b.isFullScreen){var a=fullscreenBtn.offset(),d=player.container.offset();media.positionFullscreenButton(a.left-d.left,a.top-d.top,!1),b.fullscreenBtn.css("pointer-events","none"),b.controls.css("pointer-events","none"),b.media.addEventListener("click",b.clickToPlayPauseCallback);for(c in g)g[c].show();i(),e=!0}}),media.addEventListener("fullscreenchange",function(a){b.isFullScreen=!b.isFullScreen,b.isFullScreen?b.media.removeEventListener("click",b.clickToPlayPauseCallback):b.media.addEventListener("click",b.clickToPlayPauseCallback),f()}),b.globalBind("mousemove",function(a){if(e){var c=fullscreenBtn.offset();(a.pageY<c.top||a.pageY>c.top+fullscreenBtn.outerHeight(!0)||a.pageX<c.left||a.pageX>c.left+fullscreenBtn.outerWidth(!0))&&(fullscreenBtn.css("pointer-events",""),b.controls.css("pointer-events",""),e=!1)}}),b.isPluginClickThroughCreated=!0}},cleanfullscreen:function(a){a.exitFullScreen()},containerSizeTimeout:null,enterFullScreen:function(){var b=this;return mejs.MediaFeatures.hasiOSFullScreen?void b.media.webkitEnterFullscreen():(a(document.documentElement).addClass("mejs-fullscreen"),b.normalHeight=b.container.height(),b.normalWidth=b.container.width(),"native-native"===b.fullscreenMode||"plugin-native"===b.fullscreenMode?(mejs.MediaFeatures.requestFullScreen(b.container[0]),b.isInIframe&&setTimeout(function c(){if(b.isNativeFullScreen){var d=.002,e=a(window).width(),f=screen.width,g=Math.abs(f-e),h=f*d;g>h?b.exitFullScreen():setTimeout(c,500)}},1e3)):"fullwindow"==b.fullscreeMode,b.container.addClass("mejs-container-fullscreen").width("100%").height("100%"),b.containerSizeTimeout=setTimeout(function(){b.container.css({width:"100%",height:"100%"}),b.setControlsSize()},500),"native"===b.media.pluginType?b.$media.width("100%").height("100%"):(b.container.find(".mejs-shim").width("100%").height("100%"),setTimeout(function(){var c=a(window),d=c.width(),e=c.height();b.media.setVideoSize(d,e)},500)),b.layers.children("div").width("100%").height("100%"),b.fullscreenBtn&&b.fullscreenBtn.removeClass("mejs-fullscreen").addClass("mejs-unfullscreen"),b.setControlsSize(),b.isFullScreen=!0,b.container.find(".mejs-captions-text").css("font-size",screen.width/b.width*1*100+"%"),b.container.find(".mejs-captions-position").css("bottom","45px"),void b.container.trigger("enteredfullscreen"))},exitFullScreen:function(){var b=this;clearTimeout(b.containerSizeTimeout),mejs.MediaFeatures.hasTrueNativeFullScreen&&(mejs.MediaFeatures.isFullScreen()||b.isFullScreen)&&mejs.MediaFeatures.cancelFullScreen(),a(document.documentElement).removeClass("mejs-fullscreen"),b.container.removeClass("mejs-container-fullscreen").width(b.normalWidth).height(b.normalHeight),"native"===b.media.pluginType?b.$media.width(b.normalWidth).height(b.normalHeight):(b.container.find(".mejs-shim").width(b.normalWidth).height(b.normalHeight),b.media.setVideoSize(b.normalWidth,b.normalHeight)),b.layers.children("div").width(b.normalWidth).height(b.normalHeight),b.fullscreenBtn.removeClass("mejs-unfullscreen").addClass("mejs-fullscreen"),b.setControlsSize(),b.isFullScreen=!1,b.container.find(".mejs-captions-text").css("font-size",""),b.container.find(".mejs-captions-position").css("bottom",""),b.container.trigger("exitedfullscreen")}})}(mejs.$),function(a){a.extend(mejs.MepDefaults,{speeds:["2.00","1.50","1.25","1.00","0.75"],defaultSpeed:"1.00",speedChar:"x"}),a.extend(MediaElementPlayer.prototype,{buildspeed:function(b,c,d,e){var f=this;if("native"==f.media.pluginType){for(var g=null,h=null,i=null,j=null,k=[],l=!1,m=0,n=f.options.speeds.length;n>m;m++){var o=f.options.speeds[m];"string"==typeof o?(k.push({name:o+f.options.speedChar,value:o}),o===f.options.defaultSpeed&&(l=!0)):(k.push(o),o.value===f.options.defaultSpeed&&(l=!0))}l||k.push({name:f.options.defaultSpeed+f.options.speedChar,value:f.options.defaultSpeed}),k.sort(function(a,b){return parseFloat(b.value)-parseFloat(a.value)});var p=function(a){for(m=0,n=k.length;n>m;m++)if(k[m].value===a)return k[m].name},q='<div class="mejs-button mejs-speed-button"><button type="button">'+p(f.options.defaultSpeed)+'</button><div class="mejs-speed-selector"><ul>';for(m=0,il=k.length;m<il;m++)j=f.id+"-speed-"+k[m].value,q+='<li><input type="radio" name="speed" value="'+k[m].value+'" id="'+j+'" '+(k[m].value===f.options.defaultSpeed?" checked":"")+' /><label for="'+j+'" '+(k[m].value===f.options.defaultSpeed?' class="mejs-speed-selected"':"")+">"+k[m].name+"</label></li>";q+="</ul></div></div>",g=a(q).appendTo(c),h=g.find(".mejs-speed-selector"),i=f.options.defaultSpeed,e.addEventListener("loadedmetadata",function(a){i&&(e.playbackRate=parseFloat(i))},!0),h.on("click",'input[type="radio"]',function(){var b=a(this).attr("value");i=b,e.playbackRate=parseFloat(b),g.find("button").html(p(b)),g.find(".mejs-speed-selected").removeClass("mejs-speed-selected"),g.find('input[type="radio"]:checked').next().addClass("mejs-speed-selected")}),g.one("mouseenter focusin",function(){h.height(g.find(".mejs-speed-selector ul").outerHeight(!0)+g.find(".mejs-speed-translations").outerHeight(!0)).css("top",-1*h.height()+"px")})}}})}(mejs.$),function(a){a.extend(mejs.MepDefaults,{startLanguage:"",tracksText:mejs.i18n.t("Captions/Subtitles"),tracksAriaLive:!1,hideCaptionsButtonWhenEmpty:!0,toggleCaptionsButtonWhenOnlyOne:!1,slidesSelector:""}),a.extend(MediaElementPlayer.prototype,{hasChapters:!1,cleartracks:function(a,b,c,d){a&&(a.captions&&a.captions.remove(),a.chapters&&a.chapters.remove(),a.captionsText&&a.captionsText.remove(),a.captionsButton&&a.captionsButton.remove())},buildtracks:function(b,c,d,e){if(0!==b.tracks.length){var f,g=this,h=g.options.tracksAriaLive?'role="log" aria-live="assertive" aria-atomic="false"':"";if(g.domNode.textTracks)for(f=g.domNode.textTracks.length-1;f>=0;f--)g.domNode.textTracks[f].mode="hidden";g.cleartracks(b,c,d,e),b.chapters=a('<div class="mejs-chapters mejs-layer"></div>').prependTo(d).hide(),b.captions=a('<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(d).hide(),b.captionsText=b.captions.find(".mejs-captions-text"),b.captionsButton=a('<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="'+b.id+'_captions" id="'+b.id+'_captions_none" value="none" checked="checked" /><label for="'+b.id+'_captions_none">'+mejs.i18n.t("None")+"</label></li></ul></div></div>").appendTo(c);var i=0;for(f=0;f<b.tracks.length;f++)"subtitles"==b.tracks[f].kind&&i++;for(g.options.toggleCaptionsButtonWhenOnlyOne&&1==i?b.captionsButton.on("click",function(){null===b.selectedTrack?lang=b.tracks[0].srclang:lang="none",b.setTrack(lang)}):(b.captionsButton.on("mouseenter focusin",function(){a(this).find(".mejs-captions-selector").removeClass("mejs-offscreen")}).on("click","input[type=radio]",function(){lang=this.value,b.setTrack(lang)}),b.captionsButton.on("mouseleave focusout",function(){a(this).find(".mejs-captions-selector").addClass("mejs-offscreen")})),b.options.alwaysShowControls?b.container.find(".mejs-captions-position").addClass("mejs-captions-position-hover"):b.container.bind("controlsshown",function(){b.container.find(".mejs-captions-position").addClass("mejs-captions-position-hover")}).bind("controlshidden",function(){e.paused||b.container.find(".mejs-captions-position").removeClass("mejs-captions-position-hover")}),b.trackToLoad=-1,b.selectedTrack=null,b.isLoadingTrack=!1,f=0;f<b.tracks.length;f++)"subtitles"==b.tracks[f].kind&&b.addTrackButton(b.tracks[f].srclang,b.tracks[f].label);b.loadNextTrack(),e.addEventListener("timeupdate",function(a){b.displayCaptions()},!1),""!==b.options.slidesSelector&&(b.slidesContainer=a(b.options.slidesSelector),e.addEventListener("timeupdate",function(a){b.displaySlides()},!1)),e.addEventListener("loadedmetadata",function(a){b.displayChapters()},!1),b.container.hover(function(){b.hasChapters&&(b.chapters.removeClass("mejs-offscreen"),b.chapters.fadeIn(200).height(b.chapters.find(".mejs-chapter").outerHeight()))},function(){b.hasChapters&&!e.paused&&b.chapters.fadeOut(200,function(){a(this).addClass("mejs-offscreen"),a(this).css("display","block")})}),g.container.on("controlsresize",function(){g.adjustLanguageBox()}),null!==b.node.getAttribute("autoplay")&&b.chapters.addClass("mejs-offscreen")}},setTrack:function(a){var b,c=this;if("none"==a)c.selectedTrack=null,c.captionsButton.removeClass("mejs-captions-enabled");else for(b=0;b<c.tracks.length;b++)if(c.tracks[b].srclang==a){null===c.selectedTrack&&c.captionsButton.addClass("mejs-captions-enabled"),c.selectedTrack=c.tracks[b],c.captions.attr("lang",c.selectedTrack.srclang),c.displayCaptions();break}},loadNextTrack:function(){var a=this;a.trackToLoad++,a.trackToLoad<a.tracks.length?(a.isLoadingTrack=!0,a.loadTrack(a.trackToLoad)):(a.isLoadingTrack=!1,a.checkForTracks())},loadTrack:function(b){var c=this,d=c.tracks[b],e=function(){d.isLoaded=!0,c.enableTrackButton(d.srclang,d.label),c.loadNextTrack()};a.ajax({url:d.src,dataType:"text",success:function(a){"string"==typeof a&&/<tt\s+xml/gi.exec(a)?d.entries=mejs.TrackFormatParser.dfxp.parse(a):d.entries=mejs.TrackFormatParser.webvtt.parse(a),e(),"chapters"==d.kind&&c.media.addEventListener("play",function(a){c.media.duration>0&&c.displayChapters(d)},!1),"slides"==d.kind&&c.setupSlides(d)},error:function(){c.removeTrackButton(d.srclang),c.loadNextTrack()}})},enableTrackButton:function(b,c){var d=this;""===c&&(c=mejs.language.codes[b]||b),d.captionsButton.find("input[value="+b+"]").prop("disabled",!1).siblings("label").html(c),d.options.startLanguage==b&&a("#"+d.id+"_captions_"+b).prop("checked",!0).trigger("click"),d.adjustLanguageBox()},removeTrackButton:function(a){var b=this;b.captionsButton.find("input[value="+a+"]").closest("li").remove(),b.adjustLanguageBox()},addTrackButton:function(b,c){var d=this;""===c&&(c=mejs.language.codes[b]||b),d.captionsButton.find("ul").append(a('<li><input type="radio" name="'+d.id+'_captions" id="'+d.id+"_captions_"+b+'" value="'+b+'" disabled="disabled" /><label for="'+d.id+"_captions_"+b+'">'+c+" (loading)</label></li>")),d.adjustLanguageBox(),d.container.find(".mejs-captions-translations option[value="+b+"]").remove()},adjustLanguageBox:function(){var a=this;a.captionsButton.find(".mejs-captions-selector").height(a.captionsButton.find(".mejs-captions-selector ul").outerHeight(!0)+a.captionsButton.find(".mejs-captions-translations").outerHeight(!0))},checkForTracks:function(){var a=this,b=!1;if(a.options.hideCaptionsButtonWhenEmpty){for(i=0;i<a.tracks.length;i++)if("subtitles"==a.tracks[i].kind&&a.tracks[i].isLoaded){b=!0;break}b||(a.captionsButton.hide(),a.setControlsSize())}},displayCaptions:function(){if("undefined"!=typeof this.tracks){var a,b=this,c=b.selectedTrack;if(null!==c&&c.isLoaded){for(a=0;a<c.entries.times.length;a++)if(b.media.currentTime>=c.entries.times[a].start&&b.media.currentTime<=c.entries.times[a].stop)return b.captionsText.html(c.entries.text[a]).attr("class","mejs-captions-text "+(c.entries.times[a].identifier||"")),void b.captions.show().height(0);b.captions.hide()}else b.captions.hide()}},setupSlides:function(a){var b=this;b.slides=a,b.slides.entries.imgs=[b.slides.entries.text.length],b.showSlide(0)},showSlide:function(b){if("undefined"!=typeof this.tracks&&"undefined"!=typeof this.slidesContainer){var c=this,d=c.slides.entries.text[b],e=c.slides.entries.imgs[b];"undefined"==typeof e||"undefined"==typeof e.fadeIn?c.slides.entries.imgs[b]=e=a('<img src="'+d+'">').on("load",function(){e.appendTo(c.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,c=b.slides;for(a=0;a<c.entries.times.length;a++)if(b.media.currentTime>=c.entries.times[a].start&&b.media.currentTime<=c.entries.times[a].stop)return void b.showSlide(a)}},displayChapters:function(){var a,b=this;for(a=0;a<b.tracks.length;a++)if("chapters"==b.tracks[a].kind&&b.tracks[a].isLoaded){b.drawChapters(b.tracks[a]),b.hasChapters=!0;break}},drawChapters:function(b){var c,d,e=this,f=0,g=0;for(e.chapters.empty(),c=0;c<b.entries.times.length;c++)d=b.entries.times[c].stop-b.entries.times[c].start,f=Math.floor(d/e.media.duration*100),(f+g>100||c==b.entries.times.length-1&&100>f+g)&&(f=100-g),e.chapters.append(a('<div class="mejs-chapter" rel="'+b.entries.times[c].start+'" style="left: '+g.toString()+"%;width: "+f.toString()+'%;"><div class="mejs-chapter-block'+(c==b.entries.times.length-1?" mejs-chapter-block-last":"")+'"><span class="ch-title">'+b.entries.text[c]+'</span><span class="ch-time">'+mejs.Utility.secondsToTimeCode(b.entries.times[c].start,e.options)+"–"+mejs.Utility.secondsToTimeCode(b.entries.times[c].stop,e.options)+"</span></div></div>")),g+=f;e.chapters.find("div.mejs-chapter").click(function(){e.media.setCurrentTime(parseFloat(a(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(b){for(var c,d,e,f=0,g=mejs.TrackFormatParser.split2(b,/\r?\n/),h={text:[],times:[]};f<g.length;f++){if(c=this.pattern_timecode.exec(g[f]),c&&f<g.length){for(f-1>=0&&""!==g[f-1]&&(e=g[f-1]),f++,d=g[f],f++;""!==g[f]&&f<g.length;)d=d+"\n"+g[f],f++;d=a.trim(d).replace(/(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/gi,"<a href='$1' target='_blank'>$1</a>"),h.text.push(d),h.times.push({identifier:e,start:0===mejs.Utility.convertSMPTEtoSeconds(c[1])?.2:mejs.Utility.convertSMPTEtoSeconds(c[1]),stop:mejs.Utility.convertSMPTEtoSeconds(c[3]),settings:c[5]})}e=""}return h}},dfxp:{parse:function(b){b=a(b).filter("tt");var c,d,e=0,f=b.children("div").eq(0),g=f.find("p"),h=b.find("#"+f.attr("style")),i={text:[],times:[]};if(h.length){var j=h.removeAttr("id").get(0).attributes;if(j.length)for(c={},e=0;e<j.length;e++)c[j[e].name.split(":")[1]]=j[e].value}for(e=0;e<g.length;e++){var k,l={start:null,stop:null,style:null};if(g.eq(e).attr("begin")&&(l.start=mejs.Utility.convertSMPTEtoSeconds(g.eq(e).attr("begin"))),!l.start&&g.eq(e-1).attr("end")&&(l.start=mejs.Utility.convertSMPTEtoSeconds(g.eq(e-1).attr("end"))),g.eq(e).attr("end")&&(l.stop=mejs.Utility.convertSMPTEtoSeconds(g.eq(e).attr("end"))),!l.stop&&g.eq(e+1).attr("begin")&&(l.stop=mejs.Utility.convertSMPTEtoSeconds(g.eq(e+1).attr("begin"))),c){k="";for(var m in c)k+=m+":"+c[m]+";"}k&&(l.style=k),0===l.start&&(l.start=.2),i.times.push(l),d=a.trim(g.eq(e).html()).replace(/(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/gi,"<a href='$1' target='_blank'>$1</a>"),i.text.push(d),0===i.times.start&&(i.times.start=2)}return i}},split2:function(a,b){return a.split(b)}},3!="x\n\ny".split(/\n/gi).length&&(mejs.TrackFormatParser.split2=function(a,b){var c,d=[],e="";for(c=0;c<a.length;c++)e+=a.substring(c,c+1),b.test(e)&&(d.push(e.replace(b,"")),e="");return d.push(e),d})}(mejs.$),function(a){a.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}}]}),a.extend(MediaElementPlayer.prototype,{buildcontextmenu:function(b,c,d,e){b.contextMenu=a('<div class="mejs-contextmenu"></div>').appendTo(a("body")).hide(),b.container.bind("contextmenu",function(a){return b.isContextMenuEnabled?(a.preventDefault(),b.renderContextMenu(a.clientX-1,a.clientY-1),!1):void 0}),b.container.bind("click",function(){b.contextMenu.hide()}),b.contextMenu.bind("mouseleave",function(){b.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,a=null)},hideContextMenu:function(){this.contextMenu.hide()},renderContextMenu:function(b,c){for(var d=this,e="",f=d.options.contextMenuItems,g=0,h=f.length;h>g;g++)if(f[g].isSeparator)e+='<div class="mejs-contextmenu-separator"></div>';else{var i=f[g].render(d);null!=i&&(e+='<div class="mejs-contextmenu-item" data-itemindex="'+g+'" id="element-'+1e6*Math.random()+'">'+i+"</div>")}d.contextMenu.empty().append(a(e)).css({top:c,left:b}).show(),d.contextMenu.find(".mejs-contextmenu-item").each(function(){var b=a(this),c=parseInt(b.data("itemindex"),10),e=d.options.contextMenuItems[c];"undefined"!=typeof e.show&&e.show(b,d),b.click(function(){"undefined"!=typeof e.click&&e.click(d),d.contextMenu.hide()})}),setTimeout(function(){d.killControlsTimer("rev3")},100)}})}(mejs.$),function(a){a.extend(mejs.MepDefaults,{skipBackInterval:30,skipBackText:mejs.i18n.t("Skip back %1 seconds")}),a.extend(MediaElementPlayer.prototype,{buildskipback:function(b,c,d,e){var f=this,g=f.options.skipBackText.replace("%1",f.options.skipBackInterval);a('<div class="mejs-button mejs-skip-back-button"><button type="button" aria-controls="'+f.id+'" title="'+g+'" aria-label="'+g+'">'+f.options.skipBackInterval+"</button></div>").appendTo(c).click(function(){e.setCurrentTime(Math.max(e.currentTime-f.options.skipBackInterval,0)),a(this).find("button").blur()})}})}(mejs.$),function(a){a.extend(mejs.MepDefaults,{postrollCloseText:mejs.i18n.t("Close")}),a.extend(MediaElementPlayer.prototype,{buildpostroll:function(b,c,d,e){var f=this,g=f.container.find('link[rel="postroll"]').attr("href");"undefined"!=typeof g&&(b.postroll=a('<div class="mejs-postroll-layer mejs-layer"><a class="mejs-postroll-close" onclick="$(this).parent().hide();return false;">'+f.options.postrollCloseText+'</a><div class="mejs-postroll-layer-content"></div></div>').prependTo(d).hide(),f.media.addEventListener("ended",function(c){a.ajax({dataType:"html",url:g,success:function(a,b){d.find(".mejs-postroll-layer-content").html(a)}}),b.postroll.show()},!1))}})}(mejs.$); \ No newline at end of file diff --git a/static/mediaelementjs/mediaelement.js b/static/mediaelementjs/mediaelement.js deleted file mode 100644 index 7245c152233cabfbcb631323c5209adc16949f9a..0000000000000000000000000000000000000000 --- a/static/mediaelementjs/mediaelement.js +++ /dev/null @@ -1,2066 +0,0 @@ -/*! - * - * MediaElement.js - * HTML5 <video> and <audio> shim and player - * http://mediaelementjs.com/ - * - * Creates a JavaScript object that mimics HTML5 MediaElement API - * for browsers that don't understand HTML5 or can't play the provided codec - * Can play MP4 (H.264), Ogg, WebM, FLV, WMV, WMA, ACC, and MP3 - * - * Copyright 2010-2014, John Dyer (http://j.hn) - * License: MIT - * - */ -// Namespace -var mejs = mejs || {}; - -// version number -mejs.version = '2.22.0'; - - -// player number (for missing, same id attr) -mejs.meIndex = 0; - -// media types accepted by plugins -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/dailymotion', 'video/x-dailymotion', 'application/x-mpegURL']} - // 'video/youtube', 'video/x-youtube', - // ,{version: [12,0], types: ['video/webm']} // for future reference (hopefully!) - ], - youtube: [ - {version: null, types: ['video/youtube', 'video/x-youtube', 'audio/youtube', 'audio/x-youtube']} - ], - vimeo: [ - {version: null, types: ['video/vimeo', 'video/x-vimeo']} - ] -}; - -/* -Utility methods -*/ -mejs.Utility = { - encodeUrl: function(url) { - return encodeURIComponent(url); //.replace(/\?/gi,'%3F').replace(/=/gi,'%3D').replace(/&/gi,'%26'); - }, - escapeHTML: function(s) { - return s.toString().split('&').join('&').split('<').join('<').split('"').join('"'); - }, - absolutizeUrl: function(url) { - var el = document.createElement('div'); - el.innerHTML = '<a href="' + this.escapeHTML(url) + '">x</a>'; - return el.firstChild.href; - }, - getScriptPath: function(scriptNames) { - var - i = 0, - j, - codePath = '', - testname = '', - slashPos, - filenamePos, - scriptUrl, - scriptPath, - scriptFilename, - scripts = document.getElementsByTagName('script'), - il = scripts.length, - jl = scriptNames.length; - - // go through all <script> tags - for (; i < il; i++) { - scriptUrl = scripts[i].src; - slashPos = scriptUrl.lastIndexOf('/'); - if (slashPos > -1) { - scriptFilename = scriptUrl.substring(slashPos + 1); - scriptPath = scriptUrl.substring(0, slashPos + 1); - } else { - scriptFilename = scriptUrl; - scriptPath = ''; - } - - // see if any <script> tags have a file name that matches the - for (j = 0; j < jl; j++) { - testname = scriptNames[j]; - filenamePos = scriptFilename.indexOf(testname); - if (filenamePos > -1) { - codePath = scriptPath; - break; - } - } - - // if we found a path, then break and return it - if (codePath !== '') { - break; - } - } - - // send the best path back - return codePath; - }, - /* - * Calculate the time format to use. We have a default format set in the - * options but it can be imcomplete. We ajust it according to the media - * duration. - * - * We support format like 'hh:mm:ss:ff'. - */ - calculateTimeFormat: function(time, options, fps) { - if (time < 0) { - time = 0; - } - - if(typeof fps == 'undefined') { - fps = 25; - } - - var format = options.timeFormat, - firstChar = format[0], - firstTwoPlaces = (format[1] == format[0]), - separatorIndex = firstTwoPlaces? 2: 1, - separator = ':', - hours = Math.floor(time / 3600) % 24, - minutes = Math.floor(time / 60) % 60, - seconds = Math.floor(time % 60), - frames = Math.floor(((time % 1)*fps).toFixed(3)), - lis = [ - [frames, 'f'], - [seconds, 's'], - [minutes, 'm'], - [hours, 'h'] - ]; - - // Try to get the separator from the format - if (format.length < separatorIndex) { - separator = format[separatorIndex]; - } - - var required = false; - - for (var i=0, len=lis.length; i < len; i++) { - if (format.indexOf(lis[i][1]) !== -1) { - required=true; - } - else if (required) { - var hasNextValue = false; - for (var j=i; j < len; j++) { - if (lis[j][0] > 0) { - hasNextValue = true; - break; - } - } - - if (! hasNextValue) { - break; - } - - if (!firstTwoPlaces) { - format = firstChar + format; - } - format = lis[i][1] + separator + format; - if (firstTwoPlaces) { - format = lis[i][1] + format; - } - firstChar = lis[i][1]; - } - } - options.currentTimeFormat = format; - }, - /* - * Prefix the given number by zero if it is lower than 10. - */ - twoDigitsString: function(n) { - if (n < 10) { - return '0' + n; - } - return String(n); - }, - secondsToTimeCode: function(time, options) { - if (time < 0) { - time = 0; - } - - // Maintain backward compatibility with method signature before v2.18. - if (typeof options !== 'object') { - var format = 'm:ss'; - format = arguments[1] ? 'hh:mm:ss' : format; // forceHours - format = arguments[2] ? format + ':ff' : format; // showFrameCount - - options = { - currentTimeFormat: format, - framesPerSecond: arguments[3] || 25 - }; - } - - var fps = options.framesPerSecond; - if(typeof fps === 'undefined') { - fps = 25; - } - - var format = options.currentTimeFormat, - hours = Math.floor(time / 3600) % 24, - minutes = Math.floor(time / 60) % 60, - seconds = Math.floor(time % 60), - frames = Math.floor(((time % 1)*fps).toFixed(3)); - lis = [ - [frames, 'f'], - [seconds, 's'], - [minutes, 'm'], - [hours, 'h'] - ]; - - var res = format; - for (i=0,len=lis.length; i < len; i++) { - res = res.replace(lis[i][1]+lis[i][1], this.twoDigitsString(lis[i][0])); - res = res.replace(lis[i][1], lis[i][0]); - } - return res; - }, - - timeCodeToSeconds: function(hh_mm_ss_ff, forceHours, showFrameCount, fps){ - if (typeof showFrameCount == 'undefined') { - showFrameCount=false; - } else if(typeof fps == 'undefined') { - fps = 25; - } - - var tc_array = hh_mm_ss_ff.split(":"), - tc_hh = parseInt(tc_array[0], 10), - tc_mm = parseInt(tc_array[1], 10), - tc_ss = parseInt(tc_array[2], 10), - tc_ff = 0, - tc_in_seconds = 0; - - if (showFrameCount) { - tc_ff = parseInt(tc_array[3])/fps; - } - - tc_in_seconds = ( tc_hh * 3600 ) + ( tc_mm * 60 ) + tc_ss + tc_ff; - - return tc_in_seconds; - }, - - - convertSMPTEtoSeconds: function (SMPTE) { - if (typeof SMPTE != 'string') - return false; - - SMPTE = SMPTE.replace(',', '.'); - - var secs = 0, - decimalLen = (SMPTE.indexOf('.') != -1) ? SMPTE.split('.')[1].length : 0, - multiplier = 1; - - SMPTE = SMPTE.split(':').reverse(); - - for (var i = 0; i < SMPTE.length; i++) { - multiplier = 1; - if (i > 0) { - multiplier = Math.pow(60, i); - } - secs += Number(SMPTE[i]) * multiplier; - } - return Number(secs.toFixed(decimalLen)); - }, - - /* borrowed from SWFObject: http://code.google.com/p/swfobject/source/browse/trunk/swfobject/src/swfobject.js#474 */ - removeSwf: function(id) { - var obj = document.getElementById(id); - if (obj && /object|embed/i.test(obj.nodeName)) { - if (mejs.MediaFeatures.isIE) { - obj.style.display = "none"; - (function(){ - if (obj.readyState == 4) { - mejs.Utility.removeObjectInIE(id); - } else { - setTimeout(arguments.callee, 10); - } - })(); - } else { - obj.parentNode.removeChild(obj); - } - } - }, - removeObjectInIE: function(id) { - var obj = document.getElementById(id); - if (obj) { - for (var i in obj) { - if (typeof obj[i] == "function") { - obj[i] = null; - } - } - obj.parentNode.removeChild(obj); - } - }, - determineScheme: function(url) { - if (url && url.indexOf("://") != -1) { - return url.substr(0, url.indexOf("://")+3); - } - return "//"; // let user agent figure this out - } -}; - - -// Core detector, plugins are added below -mejs.PluginDetector = { - - // main public function to test a plug version number PluginDetector.hasPluginVersion('flash',[9,0,125]); - hasPluginVersion: function(plugin, v) { - var pv = this.plugins[plugin]; - v[1] = v[1] || 0; - v[2] = v[2] || 0; - return (pv[0] > v[0] || (pv[0] == v[0] && pv[1] > v[1]) || (pv[0] == v[0] && pv[1] == v[1] && pv[2] >= v[2])) ? true : false; - }, - - // cached values - nav: window.navigator, - ua: window.navigator.userAgent.toLowerCase(), - - // stored version numbers - plugins: [], - - // runs detectPlugin() and stores the version number - addPlugin: function(p, pluginName, mimeType, activeX, axDetect) { - this.plugins[p] = this.detectPlugin(pluginName, mimeType, activeX, axDetect); - }, - - // get the version number from the mimetype (all but IE) or ActiveX (IE) - detectPlugin: function(pluginName, mimeType, activeX, axDetect) { - - var version = [0,0,0], - description, - i, - ax; - - // Firefox, Webkit, Opera - if (typeof(this.nav.plugins) != 'undefined' && typeof this.nav.plugins[pluginName] == 'object') { - description = this.nav.plugins[pluginName].description; - if (description && !(typeof this.nav.mimeTypes != 'undefined' && this.nav.mimeTypes[mimeType] && !this.nav.mimeTypes[mimeType].enabledPlugin)) { - version = description.replace(pluginName, '').replace(/^\s+/,'').replace(/\sr/gi,'.').split('.'); - for (i=0; i<version.length; i++) { - version[i] = parseInt(version[i].match(/\d+/), 10); - } - } - // Internet Explorer / ActiveX - } else if (typeof(window.ActiveXObject) != 'undefined') { - try { - ax = new ActiveXObject(activeX); - if (ax) { - version = axDetect(ax); - } - } - catch (e) { } - } - return version; - } -}; - -// Add Flash detection -mejs.PluginDetector.addPlugin('flash','Shockwave Flash','application/x-shockwave-flash','ShockwaveFlash.ShockwaveFlash', function(ax) { - // adapted from SWFObject - var version = [], - d = ax.GetVariable("$version"); - if (d) { - d = d.split(" ")[1].split(","); - version = [parseInt(d[0], 10), parseInt(d[1], 10), parseInt(d[2], 10)]; - } - return version; -}); - -// Add Silverlight detection -mejs.PluginDetector.addPlugin('silverlight','Silverlight Plug-In','application/x-silverlight-2','AgControl.AgControl', function (ax) { - // Silverlight cannot report its version number to IE - // but it does have a isVersionSupported function, so we have to loop through it to get a version number. - // adapted from http://www.silverlightversion.com/ - var v = [0,0,0,0], - loopMatch = function(ax, v, i, n) { - while(ax.isVersionSupported(v[0]+ "."+ v[1] + "." + v[2] + "." + v[3])){ - v[i]+=n; - } - v[i] -= n; - }; - loopMatch(ax, v, 0, 1); - loopMatch(ax, v, 1, 1); - loopMatch(ax, v, 2, 10000); // the third place in the version number is usually 5 digits (4.0.xxxxx) - loopMatch(ax, v, 2, 1000); - loopMatch(ax, v, 2, 100); - loopMatch(ax, v, 2, 10); - loopMatch(ax, v, 2, 1); - loopMatch(ax, v, 3, 1); - - return v; -}); -// add adobe acrobat -/* -PluginDetector.addPlugin('acrobat','Adobe Acrobat','application/pdf','AcroPDF.PDF', function (ax) { - var version = [], - d = ax.GetVersions().split(',')[0].split('=')[1].split('.'); - - if (d) { - version = [parseInt(d[0], 10), parseInt(d[1], 10), parseInt(d[2], 10)]; - } - return version; -}); -*/ -// necessary detection (fixes for <IE9) -mejs.MediaFeatures = { - init: function() { - var - t = this, - d = document, - nav = mejs.PluginDetector.nav, - ua = mejs.PluginDetector.ua.toLowerCase(), - i, - v, - html5Elements = ['source','track','audio','video']; - - // detect browsers (only the ones that have some kind of quirk we need to work around) - t.isiPad = (ua.match(/ipad/i) !== null); - t.isiPhone = (ua.match(/iphone/i) !== null); - t.isiOS = t.isiPhone || t.isiPad; - t.isAndroid = (ua.match(/android/i) !== null); - t.isBustedAndroid = (ua.match(/android 2\.[12]/) !== null); - t.isBustedNativeHTTPS = (location.protocol === 'https:' && (ua.match(/android [12]\./) !== null || ua.match(/macintosh.* version.* safari/) !== null)); - t.isIE = (nav.appName.toLowerCase().indexOf("microsoft") != -1 || nav.appName.toLowerCase().match(/trident/gi) !== null); - t.isChrome = (ua.match(/chrome/gi) !== null); - t.isChromium = (ua.match(/chromium/gi) !== null); - t.isFirefox = (ua.match(/firefox/gi) !== null); - t.isWebkit = (ua.match(/webkit/gi) !== null); - t.isGecko = (ua.match(/gecko/gi) !== null) && !t.isWebkit && !t.isIE; - t.isOpera = (ua.match(/opera/gi) !== null); - t.hasTouch = ('ontouchstart' in window); // && window.ontouchstart != null); // this breaks iOS 7 - - // Borrowed from `Modernizr.svgasimg`, sources: - // - https://github.com/Modernizr/Modernizr/issues/687 - // - https://github.com/Modernizr/Modernizr/pull/1209/files - t.svgAsImg = !!document.implementation.hasFeature('http://www.w3.org/TR/SVG11/feature#Image', '1.1'); - - // create HTML5 media elements for IE before 9, get a <video> element for fullscreen detection - for (i=0; i<html5Elements.length; i++) { - v = document.createElement(html5Elements[i]); - } - - t.supportsMediaTag = (typeof v.canPlayType !== 'undefined' || t.isBustedAndroid); - - // Fix for IE9 on Windows 7N / Windows 7KN (Media Player not installer) - try{ - v.canPlayType("video/mp4"); - }catch(e){ - t.supportsMediaTag = false; - } - - t.supportsPointerEvents = (function() { - // TAKEN FROM MODERNIZR - var element = document.createElement('x'), - documentElement = document.documentElement, - getComputedStyle = window.getComputedStyle, - supports; - if(!('pointerEvents' in element.style)){ - return false; - } - element.style.pointerEvents = 'auto'; - element.style.pointerEvents = 'x'; - documentElement.appendChild(element); - supports = getComputedStyle && - getComputedStyle(element, '').pointerEvents === 'auto'; - documentElement.removeChild(element); - return !!supports; - })(); - - - // Older versions of Firefox can't move plugins around without it resetting, - t.hasFirefoxPluginMovingProblem = false; - - // detect native JavaScript fullscreen (Safari/Firefox only, Chrome still fails) - - // iOS - t.hasiOSFullScreen = (typeof v.webkitEnterFullscreen !== 'undefined'); - - // W3C - t.hasNativeFullscreen = (typeof v.requestFullscreen !== 'undefined'); - - // webkit/firefox/IE11+ - t.hasWebkitNativeFullScreen = (typeof v.webkitRequestFullScreen !== 'undefined'); - t.hasMozNativeFullScreen = (typeof v.mozRequestFullScreen !== 'undefined'); - t.hasMsNativeFullScreen = (typeof v.msRequestFullscreen !== 'undefined'); - - t.hasTrueNativeFullScreen = (t.hasWebkitNativeFullScreen || t.hasMozNativeFullScreen || t.hasMsNativeFullScreen); - t.nativeFullScreenEnabled = t.hasTrueNativeFullScreen; - - // Enabled? - if (t.hasMozNativeFullScreen) { - t.nativeFullScreenEnabled = document.mozFullScreenEnabled; - } else if (t.hasMsNativeFullScreen) { - t.nativeFullScreenEnabled = document.msFullscreenEnabled; - } - - if (t.isChrome) { - t.hasiOSFullScreen = false; - } - - if (t.hasTrueNativeFullScreen) { - - t.fullScreenEventName = ''; - if (t.hasWebkitNativeFullScreen) { - t.fullScreenEventName = 'webkitfullscreenchange'; - - } else if (t.hasMozNativeFullScreen) { - t.fullScreenEventName = 'mozfullscreenchange'; - - } else if (t.hasMsNativeFullScreen) { - t.fullScreenEventName = 'MSFullscreenChange'; - } - - t.isFullScreen = function() { - if (t.hasMozNativeFullScreen) { - return d.mozFullScreen; - - } else if (t.hasWebkitNativeFullScreen) { - return d.webkitIsFullScreen; - - } else if (t.hasMsNativeFullScreen) { - return d.msFullscreenElement !== null; - } - } - - t.requestFullScreen = function(el) { - - if (t.hasWebkitNativeFullScreen) { - el.webkitRequestFullScreen(); - - } else if (t.hasMozNativeFullScreen) { - el.mozRequestFullScreen(); - - } else if (t.hasMsNativeFullScreen) { - el.msRequestFullscreen(); - - } - } - - t.cancelFullScreen = function() { - if (t.hasWebkitNativeFullScreen) { - document.webkitCancelFullScreen(); - - } else if (t.hasMozNativeFullScreen) { - document.mozCancelFullScreen(); - - } else if (t.hasMsNativeFullScreen) { - document.msExitFullscreen(); - - } - } - - } - - - // OS X 10.5 can't do this even if it says it can :( - if (t.hasiOSFullScreen && ua.match(/mac os x 10_5/i)) { - t.hasNativeFullScreen = false; - t.hasiOSFullScreen = false; - } - - } -}; -mejs.MediaFeatures.init(); - -/* -extension methods to <video> or <audio> object to bring it into parity with PluginMediaElement (see below) -*/ -mejs.HtmlMediaElement = { - pluginType: 'native', - isFullScreen: false, - - setCurrentTime: function (time) { - this.currentTime = time; - }, - - setMuted: function (muted) { - this.muted = muted; - }, - - setVolume: function (volume) { - this.volume = volume; - }, - - // for parity with the plugin versions - stop: function () { - this.pause(); - }, - - // This can be a url string - // or an array [{src:'file.mp4',type:'video/mp4'},{src:'file.webm',type:'video/webm'}] - setSrc: function (url) { - - // Fix for IE9 which can't set .src when there are <source> elements. Awesome, right? - var - existingSources = this.getElementsByTagName('source'); - while (existingSources.length > 0){ - this.removeChild(existingSources[0]); - } - - if (typeof url == 'string') { - this.src = url; - } else { - var i, media; - - for (i=0; i<url.length; i++) { - media = url[i]; - if (this.canPlayType(media.type)) { - this.src = media.src; - break; - } - } - } - }, - - setVideoSize: function (width, height) { - this.width = width; - this.height = height; - } -}; - -/* -Mimics the <video/audio> element by calling Flash's External Interface or Silverlights [ScriptableMember] -*/ -mejs.PluginMediaElement = function (pluginid, pluginType, mediaUrl) { - this.id = pluginid; - this.pluginType = pluginType; - this.src = mediaUrl; - this.events = {}; - this.attributes = {}; -}; - -// JavaScript values and ExternalInterface methods that match HTML5 video properties methods -// http://www.adobe.com/livedocs/flash/9.0/ActionScriptLangRefV3/fl/video/FLVPlayback.html -// http://www.whatwg.org/specs/web-apps/current-work/multipage/video.html -mejs.PluginMediaElement.prototype = { - - // special - pluginElement: null, - pluginType: '', - isFullScreen: false, - - // not implemented :( - playbackRate: -1, - defaultPlaybackRate: -1, - seekable: [], - played: [], - - // HTML5 read-only properties - paused: true, - ended: false, - seeking: false, - duration: 0, - error: null, - tagName: '', - - // HTML5 get/set properties, but only set (updated by event handlers) - muted: false, - volume: 1, - currentTime: 0, - - // HTML5 methods - play: function () { - if (this.pluginApi != null) { - if (this.pluginType == 'youtube' || this.pluginType == 'vimeo') { - this.pluginApi.playVideo(); - } else { - this.pluginApi.playMedia(); - } - this.paused = false; - } - }, - load: function () { - if (this.pluginApi != null) { - if (this.pluginType == 'youtube' || this.pluginType == 'vimeo') { - } else { - this.pluginApi.loadMedia(); - } - - this.paused = false; - } - }, - pause: function () { - if (this.pluginApi != null) { - if (this.pluginType == 'youtube' || this.pluginType == 'vimeo') { - if( this.pluginApi.getPlayerState() == 1 ) { - this.pluginApi.pauseVideo(); - } - } else { - this.pluginApi.pauseMedia(); - } - - - this.paused = true; - } - }, - stop: function () { - if (this.pluginApi != null) { - if (this.pluginType == 'youtube' || this.pluginType == 'vimeo') { - this.pluginApi.stopVideo(); - } else { - this.pluginApi.stopMedia(); - } - this.paused = true; - } - }, - canPlayType: function(type) { - var i, - j, - pluginInfo, - pluginVersions = mejs.plugins[this.pluginType]; - - for (i=0; i<pluginVersions.length; i++) { - pluginInfo = pluginVersions[i]; - - // test if user has the correct plugin version - if (mejs.PluginDetector.hasPluginVersion(this.pluginType, pluginInfo.version)) { - - // test for plugin playback types - for (j=0; j<pluginInfo.types.length; j++) { - // find plugin that can play the type - if (type == pluginInfo.types[j]) { - return 'probably'; - } - } - } - } - - return ''; - }, - - positionFullscreenButton: function(x,y,visibleAndAbove) { - if (this.pluginApi != null && this.pluginApi.positionFullscreenButton) { - this.pluginApi.positionFullscreenButton(Math.floor(x),Math.floor(y),visibleAndAbove); - } - }, - - hideFullscreenButton: function() { - if (this.pluginApi != null && this.pluginApi.hideFullscreenButton) { - this.pluginApi.hideFullscreenButton(); - } - }, - - - // custom methods since not all JavaScript implementations support get/set - - // This can be a url string - // or an array [{src:'file.mp4',type:'video/mp4'},{src:'file.webm',type:'video/webm'}] - setSrc: function (url) { - if (typeof url == 'string') { - this.pluginApi.setSrc(mejs.Utility.absolutizeUrl(url)); - this.src = mejs.Utility.absolutizeUrl(url); - } else { - var i, media; - - for (i=0; i<url.length; i++) { - media = url[i]; - if (this.canPlayType(media.type)) { - this.pluginApi.setSrc(mejs.Utility.absolutizeUrl(media.src)); - this.src = mejs.Utility.absolutizeUrl(media.src); - break; - } - } - } - - }, - setCurrentTime: function (time) { - if (this.pluginApi != null) { - if (this.pluginType == 'youtube' || this.pluginType == 'vimeo') { - this.pluginApi.seekTo(time); - } else { - this.pluginApi.setCurrentTime(time); - } - - - - this.currentTime = time; - } - }, - setVolume: function (volume) { - if (this.pluginApi != null) { - // same on YouTube and MEjs - if (this.pluginType == 'youtube') { - this.pluginApi.setVolume(volume * 100); - } else { - this.pluginApi.setVolume(volume); - } - this.volume = volume; - } - }, - setMuted: function (muted) { - if (this.pluginApi != null) { - if (this.pluginType == 'youtube') { - if (muted) { - this.pluginApi.mute(); - } else { - this.pluginApi.unMute(); - } - this.muted = muted; - this.dispatchEvent({type:'volumechange'}); - } else { - this.pluginApi.setMuted(muted); - } - this.muted = muted; - } - }, - - // additional non-HTML5 methods - setVideoSize: function (width, height) { - - //if (this.pluginType == 'flash' || this.pluginType == 'silverlight') { - if (this.pluginElement && this.pluginElement.style) { - this.pluginElement.style.width = width + 'px'; - this.pluginElement.style.height = height + 'px'; - } - if (this.pluginApi != null && this.pluginApi.setVideoSize) { - this.pluginApi.setVideoSize(width, height); - } - //} - }, - - setFullscreen: function (fullscreen) { - if (this.pluginApi != null && this.pluginApi.setFullscreen) { - this.pluginApi.setFullscreen(fullscreen); - } - }, - - enterFullScreen: function() { - if (this.pluginApi != null && this.pluginApi.setFullscreen) { - this.setFullscreen(true); - } - - }, - - exitFullScreen: function() { - if (this.pluginApi != null && this.pluginApi.setFullscreen) { - this.setFullscreen(false); - } - }, - - // start: fake events - addEventListener: function (eventName, callback, bubble) { - this.events[eventName] = this.events[eventName] || []; - this.events[eventName].push(callback); - }, - removeEventListener: function (eventName, callback) { - if (!eventName) { this.events = {}; return true; } - var callbacks = this.events[eventName]; - if (!callbacks) return true; - if (!callback) { this.events[eventName] = []; return true; } - for (var i = 0; i < callbacks.length; i++) { - if (callbacks[i] === callback) { - this.events[eventName].splice(i, 1); - return true; - } - } - return false; - }, - dispatchEvent: function (event) { - var i, - args, - callbacks = this.events[event.type]; - - if (callbacks) { - for (i = 0; i < callbacks.length; i++) { - callbacks[i].apply(this, [event]); - } - } - }, - // end: fake events - - // fake DOM attribute methods - hasAttribute: function(name){ - return (name in this.attributes); - }, - removeAttribute: function(name){ - delete this.attributes[name]; - }, - getAttribute: function(name){ - if (this.hasAttribute(name)) { - return this.attributes[name]; - } - return ''; - }, - setAttribute: function(name, value){ - this.attributes[name] = value; - }, - - remove: function() { - mejs.Utility.removeSwf(this.pluginElement.id); - } -}; - -/* -Default options -*/ -mejs.MediaElementDefaults = { - // allows testing on HTML5, flash, silverlight - // auto: attempts to detect what the browser can do - // auto_plugin: prefer plugins and then attempt native HTML5 - // native: forces HTML5 playback - // shim: disallows HTML5, will attempt either Flash or Silverlight - // none: forces fallback view - mode: 'auto', - // remove or reorder to change plugin priority and availability - plugins: ['flash','silverlight','youtube','vimeo'], - // shows debug errors on screen - enablePluginDebug: false, - // use plugin for browsers that have trouble with Basic Authentication on HTTPS sites - httpsBasicAuthSite: false, - // overrides the type specified, useful for dynamic instantiation - type: '', - // path to Flash and Silverlight plugins - pluginPath: mejs.Utility.getScriptPath(['mediaelement.js','mediaelement.min.js','mediaelement-and-player.js','mediaelement-and-player.min.js']), - // name of flash file - flashName: 'flashmediaelement.swf', - // streamer for RTMP streaming - flashStreamer: '', - // set to 'always' for CDN version - flashScriptAccess: 'sameDomain', - // turns on the smoothing filter in Flash - enablePluginSmoothing: false, - // enabled pseudo-streaming (seek) on .mp4 files - enablePseudoStreaming: false, - // start query parameter sent to server for pseudo-streaming - pseudoStreamingStartQueryParam: 'start', - // name of silverlight file - silverlightName: 'silverlightmediaelement.xap', - // default if the <video width> is not specified - defaultVideoWidth: 480, - // default if the <video height> is not specified - defaultVideoHeight: 270, - // overrides <video width> - pluginWidth: -1, - // overrides <video height> - pluginHeight: -1, - // additional plugin variables in 'key=value' form - pluginVars: [], - // rate in milliseconds for Flash and Silverlight to fire the timeupdate event - // larger number is less accurate, but less strain on plugin->JavaScript bridge - timerRate: 250, - // initial volume for player - startVolume: 0.8, - success: function () { }, - error: function () { } -}; - -/* -Determines if a browser supports the <video> or <audio> element -and returns either the native element or a Flash/Silverlight version that -mimics HTML5 MediaElement -*/ -mejs.MediaElement = function (el, o) { - return mejs.HtmlMediaElementShim.create(el,o); -}; - -mejs.HtmlMediaElementShim = { - - create: function(el, o) { - var - options = {}, - htmlMediaElement = (typeof(el) == 'string') ? document.getElementById(el) : el, - tagName = htmlMediaElement.tagName.toLowerCase(), - isMediaTag = (tagName === 'audio' || tagName === 'video'), - src = (isMediaTag) ? htmlMediaElement.getAttribute('src') : htmlMediaElement.getAttribute('href'), - poster = htmlMediaElement.getAttribute('poster'), - autoplay = htmlMediaElement.getAttribute('autoplay'), - preload = htmlMediaElement.getAttribute('preload'), - controls = htmlMediaElement.getAttribute('controls'), - playback, - prop; - - // extend options - for (prop in mejs.MediaElementDefaults) { - options[prop] = mejs.MediaElementDefaults[prop]; - } - for (prop in o) { - options[prop] = o[prop]; - } - - - // clean up attributes - src = (typeof src == 'undefined' || src === null || src == '') ? null : src; - poster = (typeof poster == 'undefined' || poster === null) ? '' : poster; - preload = (typeof preload == 'undefined' || preload === null || preload === 'false') ? 'none' : preload; - autoplay = !(typeof autoplay == 'undefined' || autoplay === null || autoplay === 'false'); - controls = !(typeof controls == 'undefined' || controls === null || controls === 'false'); - - // test for HTML5 and plugin capabilities - playback = this.determinePlayback(htmlMediaElement, options, mejs.MediaFeatures.supportsMediaTag, isMediaTag, src); - playback.url = (playback.url !== null) ? mejs.Utility.absolutizeUrl(playback.url) : ''; - playback.scheme = mejs.Utility.determineScheme(playback.url); - - if (playback.method == 'native') { - // second fix for android - if (mejs.MediaFeatures.isBustedAndroid) { - htmlMediaElement.src = playback.url; - htmlMediaElement.addEventListener('click', function() { - htmlMediaElement.play(); - }, false); - } - - // add methods to native HTMLMediaElement - return this.updateNative(playback, options, autoplay, preload); - } else if (playback.method !== '') { - // create plugin to mimic HTMLMediaElement - - return this.createPlugin( playback, options, poster, autoplay, preload, controls); - } else { - // boo, no HTML5, no Flash, no Silverlight. - this.createErrorMessage( playback, options, poster ); - - return this; - } - }, - - determinePlayback: function(htmlMediaElement, options, supportsMediaTag, isMediaTag, src) { - var - mediaFiles = [], - i, - j, - k, - l, - n, - type, - result = { method: '', url: '', htmlMediaElement: htmlMediaElement, isVideo: (htmlMediaElement.tagName.toLowerCase() != 'audio'), scheme: ''}, - pluginName, - pluginVersions, - pluginInfo, - dummy, - media; - - // STEP 1: Get URL and type from <video src> or <source src> - - // supplied type overrides <video type> and <source type> - if (typeof options.type != 'undefined' && options.type !== '') { - - // accept either string or array of types - if (typeof options.type == 'string') { - mediaFiles.push({type:options.type, url:src}); - } else { - - for (i=0; i<options.type.length; i++) { - mediaFiles.push({type:options.type[i], url:src}); - } - } - - // test for src attribute first - } else if (src !== null) { - type = this.formatType(src, htmlMediaElement.getAttribute('type')); - mediaFiles.push({type:type, url:src}); - - // then test for <source> elements - } else { - // test <source> types to see if they are usable - for (i = 0; i < htmlMediaElement.childNodes.length; i++) { - n = htmlMediaElement.childNodes[i]; - if (n.nodeType == 1 && n.tagName.toLowerCase() == 'source') { - src = n.getAttribute('src'); - type = this.formatType(src, n.getAttribute('type')); - media = n.getAttribute('media'); - - if (!media || !window.matchMedia || (window.matchMedia && window.matchMedia(media).matches)) { - mediaFiles.push({type:type, url:src}); - } - } - } - } - - // in the case of dynamicly created players - // check for audio types - if (!isMediaTag && mediaFiles.length > 0 && mediaFiles[0].url !== null && this.getTypeFromFile(mediaFiles[0].url).indexOf('audio') > -1) { - result.isVideo = false; - } - - - // STEP 2: Test for playback method - - // special case for Android which sadly doesn't implement the canPlayType function (always returns '') - if (mejs.MediaFeatures.isBustedAndroid) { - htmlMediaElement.canPlayType = function(type) { - return (type.match(/video\/(mp4|m4v)/gi) !== null) ? 'maybe' : ''; - }; - } - - // special case for Chromium to specify natively supported video codecs (i.e. WebM and Theora) - if (mejs.MediaFeatures.isChromium) { - htmlMediaElement.canPlayType = function(type) { - return (type.match(/video\/(webm|ogv|ogg)/gi) !== null) ? 'maybe' : ''; - }; - } - - // test for native playback first - if (supportsMediaTag && (options.mode === 'auto' || options.mode === 'auto_plugin' || options.mode === 'native') && !(mejs.MediaFeatures.isBustedNativeHTTPS && options.httpsBasicAuthSite === true)) { - - if (!isMediaTag) { - - // create a real HTML5 Media Element - dummy = document.createElement( result.isVideo ? 'video' : 'audio'); - htmlMediaElement.parentNode.insertBefore(dummy, htmlMediaElement); - htmlMediaElement.style.display = 'none'; - - // use this one from now on - result.htmlMediaElement = htmlMediaElement = dummy; - } - - for (i=0; i<mediaFiles.length; i++) { - // normal check - if (mediaFiles[i].type == "video/m3u8" || htmlMediaElement.canPlayType(mediaFiles[i].type).replace(/no/, '') !== '' - // special case for Mac/Safari 5.0.3 which answers '' to canPlayType('audio/mp3') but 'maybe' to canPlayType('audio/mpeg') - || htmlMediaElement.canPlayType(mediaFiles[i].type.replace(/mp3/,'mpeg')).replace(/no/, '') !== '' - // special case for m4a supported by detecting mp4 support - || htmlMediaElement.canPlayType(mediaFiles[i].type.replace(/m4a/,'mp4')).replace(/no/, '') !== '') { - result.method = 'native'; - result.url = mediaFiles[i].url; - break; - } - } - - if (result.method === 'native') { - if (result.url !== null) { - htmlMediaElement.src = result.url; - } - - // if `auto_plugin` mode, then cache the native result but try plugins. - if (options.mode !== 'auto_plugin') { - return result; - } - } - } - - // if native playback didn't work, then test plugins - if (options.mode === 'auto' || options.mode === 'auto_plugin' || options.mode === 'shim') { - for (i=0; i<mediaFiles.length; i++) { - type = mediaFiles[i].type; - - // test all plugins in order of preference [silverlight, flash] - for (j=0; j<options.plugins.length; j++) { - - pluginName = options.plugins[j]; - - // test version of plugin (for future features) - pluginVersions = mejs.plugins[pluginName]; - - for (k=0; k<pluginVersions.length; k++) { - pluginInfo = pluginVersions[k]; - - // test if user has the correct plugin version - - // for youtube/vimeo - if (pluginInfo.version == null || - - mejs.PluginDetector.hasPluginVersion(pluginName, pluginInfo.version)) { - - // test for plugin playback types - for (l=0; l<pluginInfo.types.length; l++) { - // find plugin that can play the type - if (type.toLowerCase() == pluginInfo.types[l].toLowerCase()) { - result.method = pluginName; - result.url = mediaFiles[i].url; - return result; - } - } - } - } - } - } - } - - // at this point, being in 'auto_plugin' mode implies that we tried plugins but failed. - // if we have native support then return that. - if (options.mode === 'auto_plugin' && result.method === 'native') { - return result; - } - - // what if there's nothing to play? just grab the first available - if (result.method === '' && mediaFiles.length > 0) { - result.url = mediaFiles[0].url; - } - - return result; - }, - - formatType: function(url, type) { - // if no type is supplied, fake it with the extension - if (url && !type) { - return this.getTypeFromFile(url); - } else { - // only return the mime part of the type in case the attribute contains the codec - // see http://www.whatwg.org/specs/web-apps/current-work/multipage/video.html#the-source-element - // `video/mp4; codecs="avc1.42E01E, mp4a.40.2"` becomes `video/mp4` - - if (type && ~type.indexOf(';')) { - return type.substr(0, type.indexOf(';')); - } else { - return type; - } - } - }, - - getTypeFromFile: function(url) { - url = url.split('?')[0]; - var - ext = url.substring(url.lastIndexOf('.') + 1).toLowerCase(), - av = /(mp4|m4v|ogg|ogv|m3u8|webm|webmv|flv|wmv|mpeg|mov)/gi.test(ext) ? 'video/' : 'audio/'; - return this.getTypeFromExtension(ext, av); - }, - - getTypeFromExtension: function(ext, av) { - av = av || ''; - - switch (ext) { - case 'mp4': - case 'm4v': - case 'm4a': - case 'f4v': - case 'f4a': - return av + 'mp4'; - case 'flv': - return av + 'x-flv'; - case 'webm': - case 'webma': - case 'webmv': - return av + 'webm'; - case 'ogg': - case 'oga': - case 'ogv': - return av + 'ogg'; - case 'm3u8': - return 'application/x-mpegurl'; - case 'ts': - return av + 'mp2t'; - default: - return av + ext; - } - }, - - createErrorMessage: function(playback, options, poster) { - var - htmlMediaElement = playback.htmlMediaElement, - errorContainer = document.createElement('div'), - errorContent = options.customError; - - errorContainer.className = 'me-cannotplay'; - - try { - errorContainer.style.width = htmlMediaElement.width + 'px'; - errorContainer.style.height = htmlMediaElement.height + 'px'; - } catch (e) {} - - if (!errorContent) { - errorContent = '<a href="' + playback.url + '">'; - - if (poster !== '') { - errorContent += '<img src="' + poster + '" width="100%" height="100%" alt="" />'; - } - - errorContent += '<span>' + mejs.i18n.t('Download File') + '</span></a>'; - } - - errorContainer.innerHTML = errorContent; - - htmlMediaElement.parentNode.insertBefore(errorContainer, htmlMediaElement); - htmlMediaElement.style.display = 'none'; - - options.error(htmlMediaElement); - }, - - createPlugin:function(playback, options, poster, autoplay, preload, controls) { - var - htmlMediaElement = playback.htmlMediaElement, - width = 1, - height = 1, - pluginid = 'me_' + playback.method + '_' + (mejs.meIndex++), - pluginMediaElement = new mejs.PluginMediaElement(pluginid, playback.method, playback.url), - container = document.createElement('div'), - specialIEContainer, - node, - initVars; - - // copy tagName from html media element - pluginMediaElement.tagName = htmlMediaElement.tagName - - // copy attributes from html media element to plugin media element - for (var i = 0; i < htmlMediaElement.attributes.length; i++) { - var attribute = htmlMediaElement.attributes[i]; - if (attribute.specified) { - pluginMediaElement.setAttribute(attribute.name, attribute.value); - } - } - - // check for placement inside a <p> tag (sometimes WYSIWYG editors do this) - node = htmlMediaElement.parentNode; - - while (node !== null && node.tagName != null && node.tagName.toLowerCase() !== 'body' && - node.parentNode != null && node.parentNode.tagName != null && node.parentNode.constructor != null && node.parentNode.constructor.name === "ShadowRoot") { - if (node.parentNode.tagName.toLowerCase() === 'p') { - node.parentNode.parentNode.insertBefore(node, node.parentNode); - break; - } - node = node.parentNode; - } - - if (playback.isVideo) { - width = (options.pluginWidth > 0) ? options.pluginWidth : (options.videoWidth > 0) ? options.videoWidth : (htmlMediaElement.getAttribute('width') !== null) ? htmlMediaElement.getAttribute('width') : options.defaultVideoWidth; - height = (options.pluginHeight > 0) ? options.pluginHeight : (options.videoHeight > 0) ? options.videoHeight : (htmlMediaElement.getAttribute('height') !== null) ? htmlMediaElement.getAttribute('height') : options.defaultVideoHeight; - - // in case of '%' make sure it's encoded - width = mejs.Utility.encodeUrl(width); - height = mejs.Utility.encodeUrl(height); - - } else { - if (options.enablePluginDebug) { - width = 320; - height = 240; - } - } - - // register plugin - pluginMediaElement.success = options.success; - - // add container (must be added to DOM before inserting HTML for IE) - container.className = 'me-plugin'; - container.id = pluginid + '_container'; - - if (playback.isVideo) { - htmlMediaElement.parentNode.insertBefore(container, htmlMediaElement); - } else { - document.body.insertBefore(container, document.body.childNodes[0]); - } - - if (playback.method === 'flash' || playback.method === 'silverlight') { - - // flash/silverlight vars - initVars = [ - 'id=' + pluginid, - 'isvideo=' + ((playback.isVideo) ? "true" : "false"), - 'autoplay=' + ((autoplay) ? "true" : "false"), - 'preload=' + preload, - 'width=' + width, - 'startvolume=' + options.startVolume, - 'timerrate=' + options.timerRate, - 'flashstreamer=' + options.flashStreamer, - 'height=' + height, - 'pseudostreamstart=' + options.pseudoStreamingStartQueryParam]; - - if (playback.url !== null) { - if (playback.method == 'flash') { - initVars.push('file=' + mejs.Utility.encodeUrl(playback.url)); - } else { - initVars.push('file=' + playback.url); - } - } - if (options.enablePluginDebug) { - initVars.push('debug=true'); - } - if (options.enablePluginSmoothing) { - initVars.push('smoothing=true'); - } - if (options.enablePseudoStreaming) { - initVars.push('pseudostreaming=true'); - } - if (controls) { - initVars.push('controls=true'); // shows controls in the plugin if desired - } - if (options.pluginVars) { - initVars = initVars.concat(options.pluginVars); - } - - // call from plugin - window[pluginid + '_init'] = function() { - switch (pluginMediaElement.pluginType) { - case 'flash': - pluginMediaElement.pluginElement = pluginMediaElement.pluginApi = document.getElementById(pluginid); - break; - case 'silverlight': - pluginMediaElement.pluginElement = document.getElementById(pluginMediaElement.id); - pluginMediaElement.pluginApi = pluginMediaElement.pluginElement.Content.MediaElementJS; - break; - } - - if (pluginMediaElement.pluginApi != null && pluginMediaElement.success) { - pluginMediaElement.success(pluginMediaElement, htmlMediaElement); - } - } - - // event call from plugin - window[pluginid + '_event'] = function(eventName, values) { - - var - e, - i, - bufferedTime; - - // fake event object to mimic real HTML media event. - e = { - type: eventName, - target: pluginMediaElement - }; - - // attach all values to element and event object - for (i in values) { - pluginMediaElement[i] = values[i]; - e[i] = values[i]; - } - - // fake the newer W3C buffered TimeRange (loaded and total have been removed) - bufferedTime = values.bufferedTime || 0; - - e.target.buffered = e.buffered = { - start: function(index) { - return 0; - }, - end: function (index) { - return bufferedTime; - }, - length: 1 - }; - - pluginMediaElement.dispatchEvent(e); - } - - - } - - switch (playback.method) { - case 'silverlight': - container.innerHTML = -'<object data="data:application/x-silverlight-2," type="application/x-silverlight-2" id="' + pluginid + '" name="' + pluginid + '" width="' + width + '" height="' + height + '" class="mejs-shim">' + -'<param name="initParams" value="' + initVars.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="' + options.pluginPath + options.silverlightName + '" />' + -'</object>'; - break; - - case 'flash': - - if (mejs.MediaFeatures.isIE) { - specialIEContainer = document.createElement('div'); - container.appendChild(specialIEContainer); - specialIEContainer.outerHTML = -'<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="//download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab" ' + -'id="' + pluginid + '" width="' + width + '" height="' + height + '" class="mejs-shim">' + -'<param name="movie" value="' + options.pluginPath + options.flashName + '?' + (new Date().getTime()) + '" />' + -'<param name="flashvars" value="' + initVars.join('&') + '" />' + -'<param name="quality" value="high" />' + -'<param name="bgcolor" value="#000000" />' + -'<param name="wmode" value="transparent" />' + -'<param name="allowScriptAccess" value="' + options.flashScriptAccess + '" />' + -'<param name="allowFullScreen" value="true" />' + -'<param name="scale" value="default" />' + -'</object>'; - - } else { - - container.innerHTML = -'<embed id="' + pluginid + '" name="' + pluginid + '" ' + -'play="true" ' + -'loop="false" ' + -'quality="high" ' + -'bgcolor="#000000" ' + -'wmode="transparent" ' + -'allowScriptAccess="' + options.flashScriptAccess + '" ' + -'allowFullScreen="true" ' + -'type="application/x-shockwave-flash" pluginspage="//www.macromedia.com/go/getflashplayer" ' + -'src="' + options.pluginPath + options.flashName + '" ' + -'flashvars="' + initVars.join('&') + '" ' + -'width="' + width + '" ' + -'height="' + height + '" ' + -'scale="default"' + -'class="mejs-shim"></embed>'; - } - break; - - case 'youtube': - - - var videoId; - // youtu.be url from share button - if (playback.url.lastIndexOf("youtu.be") != -1) { - videoId = playback.url.substr(playback.url.lastIndexOf('/')+1); - if (videoId.indexOf('?') != -1) { - videoId = videoId.substr(0, videoId.indexOf('?')); - } - } - else { - // https://www.youtube.com/watch?v= - var videoIdMatch = playback.url.match( /[?&]v=([^&#]+)|&|#|$/ ); - if ( videoIdMatch ) { - videoId = videoIdMatch[1]; - } - } - youtubeSettings = { - container: container, - containerId: container.id, - pluginMediaElement: pluginMediaElement, - pluginId: pluginid, - videoId: videoId, - height: height, - width: width, - scheme: playback.scheme - }; - - // favor iframe version of YouTube - if (window.postMessage) { - mejs.YouTubeApi.enqueueIframe(youtubeSettings); - } else if (mejs.PluginDetector.hasPluginVersion('flash', [10,0,0]) ) { - mejs.YouTubeApi.createFlash(youtubeSettings, options); - } - - break; - - // DEMO Code. Does NOT work. - case 'vimeo': - var player_id = pluginid + "_player"; - pluginMediaElement.vimeoid = playback.url.substr(playback.url.lastIndexOf('/')+1); - - container.innerHTML ='<iframe src="' + playback.scheme + 'player.vimeo.com/video/' + pluginMediaElement.vimeoid + '?api=1&portrait=0&byline=0&title=0&player_id=' + player_id + '" width="' + width +'" height="' + height +'" frameborder="0" class="mejs-shim" id="' + player_id + '" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>'; - if (typeof($f) == 'function') { // froogaloop available - var player = $f(container.childNodes[0]), - playerState = -1; - - player.addEvent('ready', function() { - - player.playVideo = function() { - player.api( 'play' ); - } - player.stopVideo = function() { - player.api( 'unload' ); - } - player.pauseVideo = function() { - player.api( 'pause' ); - } - player.seekTo = function( seconds ) { - player.api( 'seekTo', seconds ); - } - player.setVolume = function( volume ) { - player.api( 'setVolume', volume ); - } - player.setMuted = function( muted ) { - if( muted ) { - player.lastVolume = player.api( 'getVolume' ); - player.api( 'setVolume', 0 ); - } else { - player.api( 'setVolume', player.lastVolume ); - delete player.lastVolume; - } - } - // parity with YT player - player.getPlayerState = function() { - return playerState; - } - - function createEvent(player, pluginMediaElement, eventName, e) { - var event = { - type: eventName, - target: pluginMediaElement - }; - if (eventName == 'timeupdate') { - pluginMediaElement.currentTime = event.currentTime = e.seconds; - pluginMediaElement.duration = event.duration = e.duration; - } - pluginMediaElement.dispatchEvent(event); - } - - player.addEvent('play', function() { - playerState = 1; - createEvent(player, pluginMediaElement, 'play'); - createEvent(player, pluginMediaElement, 'playing'); - }); - - player.addEvent('pause', function() { - playerState = 2; - createEvent(player, pluginMediaElement, 'pause'); - }); - - player.addEvent('finish', function() { - playerState = 0; - createEvent(player, pluginMediaElement, 'ended'); - }); - - player.addEvent('playProgress', function(e) { - createEvent(player, pluginMediaElement, 'timeupdate', e); - }); - - player.addEvent('seek', function(e) { - playerState = 3; - createEvent(player, pluginMediaElement, 'seeked', e); - }); - - player.addEvent('loadProgress', function(e) { - playerState = 3; - createEvent(player, pluginMediaElement, 'progress', e); - }); - - pluginMediaElement.pluginElement = container; - pluginMediaElement.pluginApi = player; - - pluginMediaElement.success(pluginMediaElement, pluginMediaElement.pluginElement); - }); - } - else { - console.warn("You need to include froogaloop for vimeo to work"); - } - break; - } - // hide original element - htmlMediaElement.style.display = 'none'; - // prevent browser from autoplaying when using a plugin - htmlMediaElement.removeAttribute('autoplay'); - - return pluginMediaElement; - }, - - updateNative: function(playback, options, autoplay, preload) { - - var htmlMediaElement = playback.htmlMediaElement, - m; - - - // add methods to video object to bring it into parity with Flash Object - for (m in mejs.HtmlMediaElement) { - htmlMediaElement[m] = mejs.HtmlMediaElement[m]; - } - - /* - Chrome now supports preload="none" - if (mejs.MediaFeatures.isChrome) { - - // special case to enforce preload attribute (Chrome doesn't respect this) - if (preload === 'none' && !autoplay) { - - // forces the browser to stop loading (note: fails in IE9) - htmlMediaElement.src = ''; - htmlMediaElement.load(); - htmlMediaElement.canceledPreload = true; - - htmlMediaElement.addEventListener('play',function() { - if (htmlMediaElement.canceledPreload) { - htmlMediaElement.src = playback.url; - htmlMediaElement.load(); - htmlMediaElement.play(); - htmlMediaElement.canceledPreload = false; - } - }, false); - // for some reason Chrome forgets how to autoplay sometimes. - } else if (autoplay) { - htmlMediaElement.load(); - htmlMediaElement.play(); - } - } - */ - - // fire success code - options.success(htmlMediaElement, htmlMediaElement); - - return htmlMediaElement; - } -}; - -/* - - test on IE (object vs. embed) - - determine when to use iframe (Firefox, Safari, Mobile) vs. Flash (Chrome, IE) - - fullscreen? -*/ - -// YouTube Flash and Iframe API -mejs.YouTubeApi = { - isIframeStarted: false, - isIframeLoaded: false, - loadIframeApi: function(yt) { - if (!this.isIframeStarted) { - var tag = document.createElement('script'); - tag.src = yt.scheme + "www.youtube.com/player_api"; - var firstScriptTag = document.getElementsByTagName('script')[0]; - firstScriptTag.parentNode.insertBefore(tag, firstScriptTag); - this.isIframeStarted = true; - } - }, - iframeQueue: [], - enqueueIframe: function(yt) { - - if (this.isLoaded) { - this.createIframe(yt); - } else { - this.loadIframeApi(yt); - this.iframeQueue.push(yt); - } - }, - createIframe: function(settings) { - - var - pluginMediaElement = settings.pluginMediaElement, - player = new YT.Player(settings.containerId, { - height: settings.height, - width: settings.width, - videoId: settings.videoId, - playerVars: {controls:0,wmode:'transparent'}, - events: { - 'onReady': function() { - - // wrapper to match - player.setVideoSize = function(width, height) { - player.setSize(width, height); - } - - // hook up iframe object to MEjs - settings.pluginMediaElement.pluginApi = player; - settings.pluginMediaElement.pluginElement = document.getElementById(settings.containerId); - - // init mejs - pluginMediaElement.success(pluginMediaElement, pluginMediaElement.pluginElement); - - // create timer - setInterval(function() { - mejs.YouTubeApi.createEvent(player, pluginMediaElement, 'timeupdate'); - }, 250); - }, - 'onStateChange': function(e) { - - mejs.YouTubeApi.handleStateChange(e.data, player, pluginMediaElement); - - } - } - }); - }, - - createEvent: function (player, pluginMediaElement, eventName) { - var event = { - type: eventName, - target: pluginMediaElement - }; - - if (player && player.getDuration) { - - // time - pluginMediaElement.currentTime = event.currentTime = player.getCurrentTime(); - pluginMediaElement.duration = event.duration = player.getDuration(); - - // state - event.paused = pluginMediaElement.paused; - event.ended = pluginMediaElement.ended; - - // sound - event.muted = player.isMuted(); - event.volume = player.getVolume() / 100; - - // progress - event.bytesTotal = player.getVideoBytesTotal(); - event.bufferedBytes = player.getVideoBytesLoaded(); - - // fake the W3C buffered TimeRange - var bufferedTime = event.bufferedBytes / event.bytesTotal * event.duration; - - event.target.buffered = event.buffered = { - start: function(index) { - return 0; - }, - end: function (index) { - return bufferedTime; - }, - length: 1 - }; - - } - - // send event up the chain - pluginMediaElement.dispatchEvent(event); - }, - - iFrameReady: function() { - - this.isLoaded = true; - this.isIframeLoaded = true; - - while (this.iframeQueue.length > 0) { - var settings = this.iframeQueue.pop(); - this.createIframe(settings); - } - }, - - // FLASH! - flashPlayers: {}, - createFlash: function(settings) { - - this.flashPlayers[settings.pluginId] = settings; - - /* - settings.container.innerHTML = - '<object type="application/x-shockwave-flash" id="' + settings.pluginId + '" data="' + settings.scheme + 'www.youtube.com/apiplayer?enablejsapi=1&playerapiid=' + settings.pluginId + '&version=3&autoplay=0&controls=0&modestbranding=1&loop=0" ' + - 'width="' + settings.width + '" height="' + settings.height + '" style="visibility: visible; " class="mejs-shim">' + - '<param name="allowScriptAccess" value="sameDomain">' + - '<param name="wmode" value="transparent">' + - '</object>'; - */ - - var specialIEContainer, - youtubeUrl = settings.scheme + 'www.youtube.com/apiplayer?enablejsapi=1&playerapiid=' + settings.pluginId + '&version=3&autoplay=0&controls=0&modestbranding=1&loop=0'; - - if (mejs.MediaFeatures.isIE) { - - specialIEContainer = document.createElement('div'); - settings.container.appendChild(specialIEContainer); - specialIEContainer.outerHTML = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="' + settings.scheme + 'download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab" ' + -'id="' + settings.pluginId + '" width="' + settings.width + '" height="' + settings.height + '" class="mejs-shim">' + - '<param name="movie" value="' + youtubeUrl + '" />' + - '<param name="wmode" value="transparent" />' + - '<param name="allowScriptAccess" value="' + options.flashScriptAccess + '" />' + - '<param name="allowFullScreen" value="true" />' + -'</object>'; - } else { - settings.container.innerHTML = - '<object type="application/x-shockwave-flash" id="' + settings.pluginId + '" data="' + youtubeUrl + '" ' + - 'width="' + settings.width + '" height="' + settings.height + '" style="visibility: visible; " class="mejs-shim">' + - '<param name="allowScriptAccess" value="' + options.flashScriptAccess + '">' + - '<param name="wmode" value="transparent">' + - '</object>'; - } - - }, - - flashReady: function(id) { - var - settings = this.flashPlayers[id], - player = document.getElementById(id), - pluginMediaElement = settings.pluginMediaElement; - - // hook up and return to MediaELementPlayer.success - pluginMediaElement.pluginApi = - pluginMediaElement.pluginElement = player; - - settings.success(pluginMediaElement, pluginMediaElement.pluginElement); - - // load the youtube video - player.cueVideoById(settings.videoId); - - var callbackName = settings.containerId + '_callback'; - - window[callbackName] = function(e) { - mejs.YouTubeApi.handleStateChange(e, player, pluginMediaElement); - } - - player.addEventListener('onStateChange', callbackName); - - setInterval(function() { - mejs.YouTubeApi.createEvent(player, pluginMediaElement, 'timeupdate'); - }, 250); - - mejs.YouTubeApi.createEvent(player, pluginMediaElement, 'canplay'); - }, - - handleStateChange: function(youTubeState, player, pluginMediaElement) { - switch (youTubeState) { - case -1: // not started - pluginMediaElement.paused = true; - pluginMediaElement.ended = true; - mejs.YouTubeApi.createEvent(player, pluginMediaElement, 'loadedmetadata'); - //createYouTubeEvent(player, pluginMediaElement, 'loadeddata'); - break; - case 0: - pluginMediaElement.paused = false; - pluginMediaElement.ended = true; - mejs.YouTubeApi.createEvent(player, pluginMediaElement, 'ended'); - break; - case 1: - pluginMediaElement.paused = false; - pluginMediaElement.ended = false; - mejs.YouTubeApi.createEvent(player, pluginMediaElement, 'play'); - mejs.YouTubeApi.createEvent(player, pluginMediaElement, 'playing'); - break; - case 2: - pluginMediaElement.paused = true; - pluginMediaElement.ended = false; - mejs.YouTubeApi.createEvent(player, pluginMediaElement, 'pause'); - break; - case 3: // buffering - mejs.YouTubeApi.createEvent(player, pluginMediaElement, 'progress'); - break; - case 5: - // cued? - break; - - } - - } -} -// IFRAME -window.onYouTubePlayerAPIReady = function() { - mejs.YouTubeApi.iFrameReady(); -}; -// FLASH -window.onYouTubePlayerReady = function(id) { - mejs.YouTubeApi.flashReady(id); -}; - -window.mejs = mejs; -window.MediaElement = mejs.MediaElement; - -/* - * Adds Internationalization and localization to mediaelement. - * - * This file does not contain translations, you have to add them manually. - * The schema is always the same: me-i18n-locale-[IETF-language-tag].js - * - * Examples are provided both for german and chinese translation. - * - * - * What is the concept beyond i18n? - * http://en.wikipedia.org/wiki/Internationalization_and_localization - * - * What langcode should i use? - * http://en.wikipedia.org/wiki/IETF_language_tag - * https://tools.ietf.org/html/rfc5646 - * - * - * License? - * - * The i18n file uses methods from the Drupal project (drupal.js): - * - i18n.methods.t() (modified) - * - i18n.methods.checkPlain() (full copy) - * - * The Drupal project is (like mediaelementjs) licensed under GPLv2. - * - http://drupal.org/licensing/faq/#q1 - * - https://github.com/johndyer/mediaelement - * - http://www.gnu.org/licenses/old-licenses/gpl-2.0.html - * - * - * @author - * Tim Latz (latz.tim@gmail.com) - * - * - * @params - * - context - document, iframe .. - * - exports - CommonJS, window .. - * - */ -;(function(context, exports, undefined) { - "use strict"; - - var i18n = { - "locale": { - // Ensure previous values aren't overwritten. - "language" : (exports.i18n && exports.i18n.locale.language) || '', - "strings" : (exports.i18n && exports.i18n.locale.strings) || {} - }, - "ietf_lang_regex" : /^(x\-)?[a-z]{2,}(\-\w{2,})?(\-\w{2,})?$/, - "methods" : {} - }; -// start i18n - - - /** - * Get language, fallback to browser's language if empty - * - * IETF: RFC 5646, https://tools.ietf.org/html/rfc5646 - * Examples: en, zh-CN, cmn-Hans-CN, sr-Latn-RS, es-419, x-private - */ - i18n.getLanguage = function () { - var language = i18n.locale.language || window.navigator.userLanguage || window.navigator.language; - return i18n.ietf_lang_regex.exec(language) ? language : null; - - //(WAS: convert to iso 639-1 (2-letters, lower case)) - //return language.substr(0, 2).toLowerCase(); - }; - - // i18n fixes for compatibility with WordPress - if ( typeof mejsL10n != 'undefined' ) { - i18n.locale.language = mejsL10n.language; - } - - - - /** - * Encode special characters in a plain-text string for display as HTML. - */ - i18n.methods.checkPlain = function (str) { - var character, regex, - replace = { - '&': '&', - '"': '"', - '<': '<', - '>': '>' - }; - str = String(str); - for (character in replace) { - if (replace.hasOwnProperty(character)) { - regex = new RegExp(character, 'g'); - str = str.replace(regex, replace[character]); - } - } - return str; - }; - - /** - * Translate strings to the page language or a given language. - * - * - * @param str - * A string containing the English string to translate. - * - * @param options - * - 'context' (defaults to the default context): The context the source string - * belongs to. - * - * @return - * The translated string, escaped via i18n.methods.checkPlain() - */ - i18n.methods.t = function (str, options) { - - // Fetch the localized version of the string. - if (i18n.locale.strings && i18n.locale.strings[options.context] && i18n.locale.strings[options.context][str]) { - str = i18n.locale.strings[options.context][str]; - } - - return i18n.methods.checkPlain(str); - }; - - - /** - * Wrapper for i18n.methods.t() - * - * @see i18n.methods.t() - * @throws InvalidArgumentException - */ - i18n.t = function(str, options) { - - if (typeof str === 'string' && str.length > 0) { - - // check every time due language can change for - // different reasons (translation, lang switcher ..) - var language = i18n.getLanguage(); - - options = options || { - "context" : language - }; - - return i18n.methods.t(str, options); - } - else { - throw { - "name" : 'InvalidArgumentException', - "message" : 'First argument is either not a string or empty.' - }; - } - }; - -// end i18n - exports.i18n = i18n; -}(document, mejs)); - -// i18n fixes for compatibility with WordPress -;(function(exports, undefined) { - - "use strict"; - - if ( typeof mejsL10n != 'undefined' ) { - exports[mejsL10n.language] = mejsL10n.strings; - } - -}(mejs.i18n.locale.strings)); diff --git a/static/mediaelementjs/mediaelement.min.js b/static/mediaelementjs/mediaelement.min.js deleted file mode 100644 index 7fac2a81485bb3e06c0b7dfc45ba4694ba010c1c..0000000000000000000000000000000000000000 --- a/static/mediaelementjs/mediaelement.min.js +++ /dev/null @@ -1,15 +0,0 @@ -/*! - * - * MediaElement.js - * HTML5 <video> and <audio> shim and player - * http://mediaelementjs.com/ - * - * Creates a JavaScript object that mimics HTML5 MediaElement API - * for browsers that don't understand HTML5 or can't play the provided codec - * Can play MP4 (H.264), Ogg, WebM, FLV, WMV, WMA, ACC, and MP3 - * - * Copyright 2010-2014, John Dyer (http://j.hn) - * License: MIT - * - */ -var mejs=mejs||{};mejs.version="2.22.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/dailymotion","video/x-dailymotion","application/x-mpegURL"]}],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(a){return encodeURIComponent(a)},escapeHTML:function(a){return a.toString().split("&").join("&").split("<").join("<").split('"').join(""")},absolutizeUrl:function(a){var b=document.createElement("div");return b.innerHTML='<a href="'+this.escapeHTML(a)+'">x</a>',b.firstChild.href},getScriptPath:function(a){for(var b,c,d,e,f,g,h=0,i="",j="",k=document.getElementsByTagName("script"),l=k.length,m=a.length;l>h;h++){for(e=k[h].src,c=e.lastIndexOf("/"),c>-1?(g=e.substring(c+1),f=e.substring(0,c+1)):(g=e,f=""),b=0;m>b;b++)if(j=a[b],d=g.indexOf(j),d>-1){i=f;break}if(""!==i)break}return i},calculateTimeFormat:function(a,b,c){0>a&&(a=0),"undefined"==typeof c&&(c=25);var d=b.timeFormat,e=d[0],f=d[1]==d[0],g=f?2:1,h=":",i=Math.floor(a/3600)%24,j=Math.floor(a/60)%60,k=Math.floor(a%60),l=Math.floor((a%1*c).toFixed(3)),m=[[l,"f"],[k,"s"],[j,"m"],[i,"h"]];d.length<g&&(h=d[g]);for(var n=!1,o=0,p=m.length;p>o;o++)if(-1!==d.indexOf(m[o][1]))n=!0;else if(n){for(var q=!1,r=o;p>r;r++)if(m[r][0]>0){q=!0;break}if(!q)break;f||(d=e+d),d=m[o][1]+h+d,f&&(d=m[o][1]+d),e=m[o][1]}b.currentTimeFormat=d},twoDigitsString:function(a){return 10>a?"0"+a:String(a)},secondsToTimeCode:function(a,b){if(0>a&&(a=0),"object"!=typeof b){var c="m:ss";c=arguments[1]?"hh:mm:ss":c,c=arguments[2]?c+":ff":c,b={currentTimeFormat:c,framesPerSecond:arguments[3]||25}}var d=b.framesPerSecond;"undefined"==typeof d&&(d=25);var c=b.currentTimeFormat,e=Math.floor(a/3600)%24,f=Math.floor(a/60)%60,g=Math.floor(a%60),h=Math.floor((a%1*d).toFixed(3));lis=[[h,"f"],[g,"s"],[f,"m"],[e,"h"]];var j=c;for(i=0,len=lis.length;i<len;i++)j=j.replace(lis[i][1]+lis[i][1],this.twoDigitsString(lis[i][0])),j=j.replace(lis[i][1],lis[i][0]);return j},timeCodeToSeconds:function(a,b,c,d){"undefined"==typeof c?c=!1:"undefined"==typeof d&&(d=25);var e=a.split(":"),f=parseInt(e[0],10),g=parseInt(e[1],10),h=parseInt(e[2],10),i=0,j=0;return c&&(i=parseInt(e[3])/d),j=3600*f+60*g+h+i},convertSMPTEtoSeconds:function(a){if("string"!=typeof a)return!1;a=a.replace(",",".");var b=0,c=-1!=a.indexOf(".")?a.split(".")[1].length:0,d=1;a=a.split(":").reverse();for(var e=0;e<a.length;e++)d=1,e>0&&(d=Math.pow(60,e)),b+=Number(a[e])*d;return Number(b.toFixed(c))},removeSwf:function(a){var b=document.getElementById(a);b&&/object|embed/i.test(b.nodeName)&&(mejs.MediaFeatures.isIE?(b.style.display="none",function(){4==b.readyState?mejs.Utility.removeObjectInIE(a):setTimeout(arguments.callee,10)}()):b.parentNode.removeChild(b))},removeObjectInIE:function(a){var b=document.getElementById(a);if(b){for(var c in b)"function"==typeof b[c]&&(b[c]=null);b.parentNode.removeChild(b)}},determineScheme:function(a){return a&&-1!=a.indexOf("://")?a.substr(0,a.indexOf("://")+3):"//"}},mejs.PluginDetector={hasPluginVersion:function(a,b){var c=this.plugins[a];return b[1]=b[1]||0,b[2]=b[2]||0,c[0]>b[0]||c[0]==b[0]&&c[1]>b[1]||c[0]==b[0]&&c[1]==b[1]&&c[2]>=b[2]?!0:!1},nav:window.navigator,ua:window.navigator.userAgent.toLowerCase(),plugins:[],addPlugin:function(a,b,c,d,e){this.plugins[a]=this.detectPlugin(b,c,d,e)},detectPlugin:function(a,b,c,d){var e,f,g,h=[0,0,0];if("undefined"!=typeof this.nav.plugins&&"object"==typeof this.nav.plugins[a]){if(e=this.nav.plugins[a].description,e&&("undefined"==typeof this.nav.mimeTypes||!this.nav.mimeTypes[b]||this.nav.mimeTypes[b].enabledPlugin))for(h=e.replace(a,"").replace(/^\s+/,"").replace(/\sr/gi,".").split("."),f=0;f<h.length;f++)h[f]=parseInt(h[f].match(/\d+/),10)}else if("undefined"!=typeof window.ActiveXObject)try{g=new ActiveXObject(c),g&&(h=d(g))}catch(i){}return h}},mejs.PluginDetector.addPlugin("flash","Shockwave Flash","application/x-shockwave-flash","ShockwaveFlash.ShockwaveFlash",function(a){var b=[],c=a.GetVariable("$version");return c&&(c=c.split(" ")[1].split(","),b=[parseInt(c[0],10),parseInt(c[1],10),parseInt(c[2],10)]),b}),mejs.PluginDetector.addPlugin("silverlight","Silverlight Plug-In","application/x-silverlight-2","AgControl.AgControl",function(a){var b=[0,0,0,0],c=function(a,b,c,d){for(;a.isVersionSupported(b[0]+"."+b[1]+"."+b[2]+"."+b[3]);)b[c]+=d;b[c]-=d};return c(a,b,0,1),c(a,b,1,1),c(a,b,2,1e4),c(a,b,2,1e3),c(a,b,2,100),c(a,b,2,10),c(a,b,2,1),c(a,b,3,1),b}),mejs.MediaFeatures={init:function(){var a,b,c=this,d=document,e=mejs.PluginDetector.nav,f=mejs.PluginDetector.ua.toLowerCase(),g=["source","track","audio","video"];c.isiPad=null!==f.match(/ipad/i),c.isiPhone=null!==f.match(/iphone/i),c.isiOS=c.isiPhone||c.isiPad,c.isAndroid=null!==f.match(/android/i),c.isBustedAndroid=null!==f.match(/android 2\.[12]/),c.isBustedNativeHTTPS="https:"===location.protocol&&(null!==f.match(/android [12]\./)||null!==f.match(/macintosh.* version.* safari/)),c.isIE=-1!=e.appName.toLowerCase().indexOf("microsoft")||null!==e.appName.toLowerCase().match(/trident/gi),c.isChrome=null!==f.match(/chrome/gi),c.isChromium=null!==f.match(/chromium/gi),c.isFirefox=null!==f.match(/firefox/gi),c.isWebkit=null!==f.match(/webkit/gi),c.isGecko=null!==f.match(/gecko/gi)&&!c.isWebkit&&!c.isIE,c.isOpera=null!==f.match(/opera/gi),c.hasTouch="ontouchstart"in window,c.svgAsImg=!!document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#Image","1.1");for(a=0;a<g.length;a++)b=document.createElement(g[a]);c.supportsMediaTag="undefined"!=typeof b.canPlayType||c.isBustedAndroid;try{b.canPlayType("video/mp4")}catch(h){c.supportsMediaTag=!1}c.supportsPointerEvents=function(){var a,b=document.createElement("x"),c=document.documentElement,d=window.getComputedStyle;return"pointerEvents"in b.style?(b.style.pointerEvents="auto",b.style.pointerEvents="x",c.appendChild(b),a=d&&"auto"===d(b,"").pointerEvents,c.removeChild(b),!!a):!1}(),c.hasFirefoxPluginMovingProblem=!1,c.hasiOSFullScreen="undefined"!=typeof b.webkitEnterFullscreen,c.hasNativeFullscreen="undefined"!=typeof b.requestFullscreen,c.hasWebkitNativeFullScreen="undefined"!=typeof b.webkitRequestFullScreen,c.hasMozNativeFullScreen="undefined"!=typeof b.mozRequestFullScreen,c.hasMsNativeFullScreen="undefined"!=typeof b.msRequestFullscreen,c.hasTrueNativeFullScreen=c.hasWebkitNativeFullScreen||c.hasMozNativeFullScreen||c.hasMsNativeFullScreen,c.nativeFullScreenEnabled=c.hasTrueNativeFullScreen,c.hasMozNativeFullScreen?c.nativeFullScreenEnabled=document.mozFullScreenEnabled:c.hasMsNativeFullScreen&&(c.nativeFullScreenEnabled=document.msFullscreenEnabled),c.isChrome&&(c.hasiOSFullScreen=!1),c.hasTrueNativeFullScreen&&(c.fullScreenEventName="",c.hasWebkitNativeFullScreen?c.fullScreenEventName="webkitfullscreenchange":c.hasMozNativeFullScreen?c.fullScreenEventName="mozfullscreenchange":c.hasMsNativeFullScreen&&(c.fullScreenEventName="MSFullscreenChange"),c.isFullScreen=function(){return c.hasMozNativeFullScreen?d.mozFullScreen:c.hasWebkitNativeFullScreen?d.webkitIsFullScreen:c.hasMsNativeFullScreen?null!==d.msFullscreenElement:void 0},c.requestFullScreen=function(a){c.hasWebkitNativeFullScreen?a.webkitRequestFullScreen():c.hasMozNativeFullScreen?a.mozRequestFullScreen():c.hasMsNativeFullScreen&&a.msRequestFullscreen()},c.cancelFullScreen=function(){c.hasWebkitNativeFullScreen?document.webkitCancelFullScreen():c.hasMozNativeFullScreen?document.mozCancelFullScreen():c.hasMsNativeFullScreen&&document.msExitFullscreen()}),c.hasiOSFullScreen&&f.match(/mac os x 10_5/i)&&(c.hasNativeFullScreen=!1,c.hasiOSFullScreen=!1)}},mejs.MediaFeatures.init(),mejs.HtmlMediaElement={pluginType:"native",isFullScreen:!1,setCurrentTime:function(a){this.currentTime=a},setMuted:function(a){this.muted=a},setVolume:function(a){this.volume=a},stop:function(){this.pause()},setSrc:function(a){for(var b=this.getElementsByTagName("source");b.length>0;)this.removeChild(b[0]);if("string"==typeof a)this.src=a;else{var c,d;for(c=0;c<a.length;c++)if(d=a[c],this.canPlayType(d.type)){this.src=d.src;break}}},setVideoSize:function(a,b){this.width=a,this.height=b}},mejs.PluginMediaElement=function(a,b,c){this.id=a,this.pluginType=b,this.src=c,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?1==this.pluginApi.getPlayerState()&&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(a){var b,c,d,e=mejs.plugins[this.pluginType];for(b=0;b<e.length;b++)if(d=e[b],mejs.PluginDetector.hasPluginVersion(this.pluginType,d.version))for(c=0;c<d.types.length;c++)if(a==d.types[c])return"probably";return""},positionFullscreenButton:function(a,b,c){null!=this.pluginApi&&this.pluginApi.positionFullscreenButton&&this.pluginApi.positionFullscreenButton(Math.floor(a),Math.floor(b),c)},hideFullscreenButton:function(){null!=this.pluginApi&&this.pluginApi.hideFullscreenButton&&this.pluginApi.hideFullscreenButton()},setSrc:function(a){if("string"==typeof a)this.pluginApi.setSrc(mejs.Utility.absolutizeUrl(a)),this.src=mejs.Utility.absolutizeUrl(a);else{var b,c;for(b=0;b<a.length;b++)if(c=a[b],this.canPlayType(c.type)){this.pluginApi.setSrc(mejs.Utility.absolutizeUrl(c.src)),this.src=mejs.Utility.absolutizeUrl(c.src);break}}},setCurrentTime:function(a){null!=this.pluginApi&&("youtube"==this.pluginType||"vimeo"==this.pluginType?this.pluginApi.seekTo(a):this.pluginApi.setCurrentTime(a),this.currentTime=a)},setVolume:function(a){null!=this.pluginApi&&("youtube"==this.pluginType?this.pluginApi.setVolume(100*a):this.pluginApi.setVolume(a),this.volume=a)},setMuted:function(a){null!=this.pluginApi&&("youtube"==this.pluginType?(a?this.pluginApi.mute():this.pluginApi.unMute(),this.muted=a,this.dispatchEvent({type:"volumechange"})):this.pluginApi.setMuted(a),this.muted=a)},setVideoSize:function(a,b){this.pluginElement&&this.pluginElement.style&&(this.pluginElement.style.width=a+"px",this.pluginElement.style.height=b+"px"),null!=this.pluginApi&&this.pluginApi.setVideoSize&&this.pluginApi.setVideoSize(a,b)},setFullscreen:function(a){null!=this.pluginApi&&this.pluginApi.setFullscreen&&this.pluginApi.setFullscreen(a)},enterFullScreen:function(){null!=this.pluginApi&&this.pluginApi.setFullscreen&&this.setFullscreen(!0)},exitFullScreen:function(){null!=this.pluginApi&&this.pluginApi.setFullscreen&&this.setFullscreen(!1)},addEventListener:function(a,b,c){this.events[a]=this.events[a]||[],this.events[a].push(b)},removeEventListener:function(a,b){if(!a)return this.events={},!0;var c=this.events[a];if(!c)return!0;if(!b)return this.events[a]=[],!0;for(var d=0;d<c.length;d++)if(c[d]===b)return this.events[a].splice(d,1),!0;return!1},dispatchEvent:function(a){var b,c=this.events[a.type];if(c)for(b=0;b<c.length;b++)c[b].apply(this,[a])},hasAttribute:function(a){return a in this.attributes},removeAttribute:function(a){delete this.attributes[a]},getAttribute:function(a){return this.hasAttribute(a)?this.attributes[a]:""},setAttribute:function(a,b){this.attributes[a]=b},remove:function(){mejs.Utility.removeSwf(this.pluginElement.id)}},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(a,b){return mejs.HtmlMediaElementShim.create(a,b)},mejs.HtmlMediaElementShim={create:function(a,b){var c,d,e={},f="string"==typeof a?document.getElementById(a):a,g=f.tagName.toLowerCase(),h="audio"===g||"video"===g,i=h?f.getAttribute("src"):f.getAttribute("href"),j=f.getAttribute("poster"),k=f.getAttribute("autoplay"),l=f.getAttribute("preload"),m=f.getAttribute("controls");for(d in mejs.MediaElementDefaults)e[d]=mejs.MediaElementDefaults[d];for(d in b)e[d]=b[d];return i="undefined"==typeof i||null===i||""==i?null:i,j="undefined"==typeof j||null===j?"":j,l="undefined"==typeof l||null===l||"false"===l?"none":l,k=!("undefined"==typeof k||null===k||"false"===k),m=!("undefined"==typeof m||null===m||"false"===m),c=this.determinePlayback(f,e,mejs.MediaFeatures.supportsMediaTag,h,i),c.url=null!==c.url?mejs.Utility.absolutizeUrl(c.url):"",c.scheme=mejs.Utility.determineScheme(c.url),"native"==c.method?(mejs.MediaFeatures.isBustedAndroid&&(f.src=c.url,f.addEventListener("click",function(){f.play()},!1)),this.updateNative(c,e,k,l)):""!==c.method?this.createPlugin(c,e,j,k,l,m):(this.createErrorMessage(c,e,j),this)},determinePlayback:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,o,p,q=[],r={method:"",url:"",htmlMediaElement:a,isVideo:"audio"!=a.tagName.toLowerCase(),scheme:""};if("undefined"!=typeof b.type&&""!==b.type)if("string"==typeof b.type)q.push({type:b.type,url:e});else for(f=0;f<b.type.length;f++)q.push({type:b.type[f],url:e});else if(null!==e)k=this.formatType(e,a.getAttribute("type")),q.push({type:k,url:e});else for(f=0;f<a.childNodes.length;f++)j=a.childNodes[f],1==j.nodeType&&"source"==j.tagName.toLowerCase()&&(e=j.getAttribute("src"),k=this.formatType(e,j.getAttribute("type")),p=j.getAttribute("media"),(!p||!window.matchMedia||window.matchMedia&&window.matchMedia(p).matches)&&q.push({type:k,url:e}));if(!d&&q.length>0&&null!==q[0].url&&this.getTypeFromFile(q[0].url).indexOf("audio")>-1&&(r.isVideo=!1),mejs.MediaFeatures.isBustedAndroid&&(a.canPlayType=function(a){return null!==a.match(/video\/(mp4|m4v)/gi)?"maybe":""}),mejs.MediaFeatures.isChromium&&(a.canPlayType=function(a){return null!==a.match(/video\/(webm|ogv|ogg)/gi)?"maybe":""}),c&&("auto"===b.mode||"auto_plugin"===b.mode||"native"===b.mode)&&(!mejs.MediaFeatures.isBustedNativeHTTPS||b.httpsBasicAuthSite!==!0)){for(d||(o=document.createElement(r.isVideo?"video":"audio"),a.parentNode.insertBefore(o,a),a.style.display="none",r.htmlMediaElement=a=o),f=0;f<q.length;f++)if("video/m3u8"==q[f].type||""!==a.canPlayType(q[f].type).replace(/no/,"")||""!==a.canPlayType(q[f].type.replace(/mp3/,"mpeg")).replace(/no/,"")||""!==a.canPlayType(q[f].type.replace(/m4a/,"mp4")).replace(/no/,"")){r.method="native",r.url=q[f].url;break}if("native"===r.method&&(null!==r.url&&(a.src=r.url),"auto_plugin"!==b.mode))return r}if("auto"===b.mode||"auto_plugin"===b.mode||"shim"===b.mode)for(f=0;f<q.length;f++)for(k=q[f].type,g=0;g<b.plugins.length;g++)for(l=b.plugins[g],m=mejs.plugins[l],h=0;h<m.length;h++)if(n=m[h],null==n.version||mejs.PluginDetector.hasPluginVersion(l,n.version))for(i=0;i<n.types.length;i++)if(k.toLowerCase()==n.types[i].toLowerCase())return r.method=l,r.url=q[f].url,r;return"auto_plugin"===b.mode&&"native"===r.method?r:(""===r.method&&q.length>0&&(r.url=q[0].url),r)},formatType:function(a,b){return a&&!b?this.getTypeFromFile(a):b&&~b.indexOf(";")?b.substr(0,b.indexOf(";")):b},getTypeFromFile:function(a){a=a.split("?")[0];var b=a.substring(a.lastIndexOf(".")+1).toLowerCase(),c=/(mp4|m4v|ogg|ogv|m3u8|webm|webmv|flv|wmv|mpeg|mov)/gi.test(b)?"video/":"audio/";return this.getTypeFromExtension(b,c)},getTypeFromExtension:function(a,b){switch(b=b||"",a){case"mp4":case"m4v":case"m4a":case"f4v":case"f4a":return b+"mp4";case"flv":return b+"x-flv";case"webm":case"webma":case"webmv":return b+"webm";case"ogg":case"oga":case"ogv":return b+"ogg";case"m3u8":return"application/x-mpegurl";case"ts":return b+"mp2t";default:return b+a}},createErrorMessage:function(a,b,c){var d=a.htmlMediaElement,e=document.createElement("div"),f=b.customError;e.className="me-cannotplay";try{e.style.width=d.width+"px",e.style.height=d.height+"px"}catch(g){}f||(f='<a href="'+a.url+'">',""!==c&&(f+='<img src="'+c+'" width="100%" height="100%" alt="" />'),f+="<span>"+mejs.i18n.t("Download File")+"</span></a>"),e.innerHTML=f,d.parentNode.insertBefore(e,d),d.style.display="none",b.error(d)},createPlugin:function(a,b,c,d,e,f){var g,h,i,j=a.htmlMediaElement,k=1,l=1,m="me_"+a.method+"_"+mejs.meIndex++,n=new mejs.PluginMediaElement(m,a.method,a.url),o=document.createElement("div");n.tagName=j.tagName;for(var p=0;p<j.attributes.length;p++){var q=j.attributes[p];q.specified&&n.setAttribute(q.name,q.value)}for(h=j.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(a.isVideo?(k=b.pluginWidth>0?b.pluginWidth:b.videoWidth>0?b.videoWidth:null!==j.getAttribute("width")?j.getAttribute("width"):b.defaultVideoWidth,l=b.pluginHeight>0?b.pluginHeight:b.videoHeight>0?b.videoHeight:null!==j.getAttribute("height")?j.getAttribute("height"):b.defaultVideoHeight,k=mejs.Utility.encodeUrl(k),l=mejs.Utility.encodeUrl(l)):b.enablePluginDebug&&(k=320,l=240),n.success=b.success,o.className="me-plugin",o.id=m+"_container",a.isVideo?j.parentNode.insertBefore(o,j):document.body.insertBefore(o,document.body.childNodes[0]),("flash"===a.method||"silverlight"===a.method)&&(i=["id="+m,"isvideo="+(a.isVideo?"true":"false"),"autoplay="+(d?"true":"false"),"preload="+e,"width="+k,"startvolume="+b.startVolume,"timerrate="+b.timerRate,"flashstreamer="+b.flashStreamer,"height="+l,"pseudostreamstart="+b.pseudoStreamingStartQueryParam],null!==a.url&&("flash"==a.method?i.push("file="+mejs.Utility.encodeUrl(a.url)):i.push("file="+a.url)),b.enablePluginDebug&&i.push("debug=true"),b.enablePluginSmoothing&&i.push("smoothing=true"),b.enablePseudoStreaming&&i.push("pseudostreaming=true"),f&&i.push("controls=true"),b.pluginVars&&(i=i.concat(b.pluginVars)),window[m+"_init"]=function(){switch(n.pluginType){case"flash":n.pluginElement=n.pluginApi=document.getElementById(m);break;case"silverlight":n.pluginElement=document.getElementById(n.id),n.pluginApi=n.pluginElement.Content.MediaElementJS}null!=n.pluginApi&&n.success&&n.success(n,j)},window[m+"_event"]=function(a,b){var c,d,e;c={type:a,target:n};for(d in b)n[d]=b[d],c[d]=b[d];e=b.bufferedTime||0,c.target.buffered=c.buffered={start:function(a){return 0},end:function(a){return e},length:1},n.dispatchEvent(c)}),a.method){case"silverlight":o.innerHTML='<object data="data:application/x-silverlight-2," type="application/x-silverlight-2" id="'+m+'" name="'+m+'" width="'+k+'" height="'+l+'" class="mejs-shim"><param name="initParams" value="'+i.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="'+b.pluginPath+b.silverlightName+'" /></object>';break;case"flash":mejs.MediaFeatures.isIE?(g=document.createElement("div"),o.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="'+k+'" height="'+l+'" class="mejs-shim"><param name="movie" value="'+b.pluginPath+b.flashName+"?"+(new Date).getTime()+'" /><param name="flashvars" value="'+i.join("&")+'" /><param name="quality" value="high" /><param name="bgcolor" value="#000000" /><param name="wmode" value="transparent" /><param name="allowScriptAccess" value="'+b.flashScriptAccess+'" /><param name="allowFullScreen" value="true" /><param name="scale" value="default" /></object>'):o.innerHTML='<embed id="'+m+'" name="'+m+'" play="true" loop="false" quality="high" bgcolor="#000000" wmode="transparent" allowScriptAccess="'+b.flashScriptAccess+'" allowFullScreen="true" type="application/x-shockwave-flash" pluginspage="//www.macromedia.com/go/getflashplayer" src="'+b.pluginPath+b.flashName+'" flashvars="'+i.join("&")+'" width="'+k+'" height="'+l+'" scale="default"class="mejs-shim"></embed>';break;case"youtube":var r;if(-1!=a.url.lastIndexOf("youtu.be"))r=a.url.substr(a.url.lastIndexOf("/")+1),-1!=r.indexOf("?")&&(r=r.substr(0,r.indexOf("?")));else{var s=a.url.match(/[?&]v=([^&#]+)|&|#|$/);s&&(r=s[1])}youtubeSettings={container:o,containerId:o.id,pluginMediaElement:n,pluginId:m,videoId:r,height:l,width:k,scheme:a.scheme},window.postMessage?mejs.YouTubeApi.enqueueIframe(youtubeSettings):mejs.PluginDetector.hasPluginVersion("flash",[10,0,0])&&mejs.YouTubeApi.createFlash(youtubeSettings,b);break;case"vimeo":var t=m+"_player";if(n.vimeoid=a.url.substr(a.url.lastIndexOf("/")+1),o.innerHTML='<iframe src="'+a.scheme+"player.vimeo.com/video/"+n.vimeoid+"?api=1&portrait=0&byline=0&title=0&player_id="+t+'" width="'+k+'" height="'+l+'" frameborder="0" class="mejs-shim" id="'+t+'" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>',"function"==typeof $f){var u=$f(o.childNodes[0]),v=-1;u.addEvent("ready",function(){function a(a,b,c,d){var e={type:c,target:b};"timeupdate"==c&&(b.currentTime=e.currentTime=d.seconds,b.duration=e.duration=d.duration),b.dispatchEvent(e)}u.playVideo=function(){u.api("play")},u.stopVideo=function(){u.api("unload")},u.pauseVideo=function(){u.api("pause")},u.seekTo=function(a){u.api("seekTo",a)},u.setVolume=function(a){u.api("setVolume",a)},u.setMuted=function(a){a?(u.lastVolume=u.api("getVolume"),u.api("setVolume",0)):(u.api("setVolume",u.lastVolume),delete u.lastVolume)},u.getPlayerState=function(){return v},u.addEvent("play",function(){v=1,a(u,n,"play"),a(u,n,"playing")}),u.addEvent("pause",function(){v=2,a(u,n,"pause")}),u.addEvent("finish",function(){v=0,a(u,n,"ended")}),u.addEvent("playProgress",function(b){a(u,n,"timeupdate",b)}),u.addEvent("seek",function(b){v=3,a(u,n,"seeked",b)}),u.addEvent("loadProgress",function(b){v=3,a(u,n,"progress",b)}),n.pluginElement=o,n.pluginApi=u,n.success(n,n.pluginElement)})}else console.warn("You need to include froogaloop for vimeo to work")}return j.style.display="none",j.removeAttribute("autoplay"),n},updateNative:function(a,b,c,d){var e,f=a.htmlMediaElement;for(e in mejs.HtmlMediaElement)f[e]=mejs.HtmlMediaElement[e];return b.success(f,f),f}},mejs.YouTubeApi={isIframeStarted:!1,isIframeLoaded:!1,loadIframeApi:function(a){if(!this.isIframeStarted){var b=document.createElement("script");b.src=a.scheme+"www.youtube.com/player_api";var c=document.getElementsByTagName("script")[0];c.parentNode.insertBefore(b,c),this.isIframeStarted=!0}},iframeQueue:[],enqueueIframe:function(a){this.isLoaded?this.createIframe(a):(this.loadIframeApi(a),this.iframeQueue.push(a))},createIframe:function(a){var b=a.pluginMediaElement,c=new YT.Player(a.containerId,{height:a.height,width:a.width,videoId:a.videoId,playerVars:{controls:0,wmode:"transparent"},events:{onReady:function(){c.setVideoSize=function(a,b){c.setSize(a,b)},a.pluginMediaElement.pluginApi=c,a.pluginMediaElement.pluginElement=document.getElementById(a.containerId),b.success(b,b.pluginElement),setInterval(function(){mejs.YouTubeApi.createEvent(c,b,"timeupdate")},250)},onStateChange:function(a){mejs.YouTubeApi.handleStateChange(a.data,c,b)}}})},createEvent:function(a,b,c){var d={type:c,target:b};if(a&&a.getDuration){b.currentTime=d.currentTime=a.getCurrentTime(),b.duration=d.duration=a.getDuration(),d.paused=b.paused,d.ended=b.ended,d.muted=a.isMuted(),d.volume=a.getVolume()/100,d.bytesTotal=a.getVideoBytesTotal(),d.bufferedBytes=a.getVideoBytesLoaded();var e=d.bufferedBytes/d.bytesTotal*d.duration;d.target.buffered=d.buffered={start:function(a){return 0},end:function(a){return e},length:1}}b.dispatchEvent(d)},iFrameReady:function(){for(this.isLoaded=!0,this.isIframeLoaded=!0;this.iframeQueue.length>0;){var a=this.iframeQueue.pop();this.createIframe(a)}},flashPlayers:{},createFlash:function(a){this.flashPlayers[a.pluginId]=a;var b,c=a.scheme+"www.youtube.com/apiplayer?enablejsapi=1&playerapiid="+a.pluginId+"&version=3&autoplay=0&controls=0&modestbranding=1&loop=0";mejs.MediaFeatures.isIE?(b=document.createElement("div"),a.container.appendChild(b),b.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="'+a.scheme+'download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab" id="'+a.pluginId+'" width="'+a.width+'" height="'+a.height+'" class="mejs-shim"><param name="movie" value="'+c+'" /><param name="wmode" value="transparent" /><param name="allowScriptAccess" value="'+options.flashScriptAccess+'" /><param name="allowFullScreen" value="true" /></object>'):a.container.innerHTML='<object type="application/x-shockwave-flash" id="'+a.pluginId+'" data="'+c+'" width="'+a.width+'" height="'+a.height+'" style="visibility: visible; " class="mejs-shim"><param name="allowScriptAccess" value="'+options.flashScriptAccess+'"><param name="wmode" value="transparent"></object>'},flashReady:function(a){var b=this.flashPlayers[a],c=document.getElementById(a),d=b.pluginMediaElement;d.pluginApi=d.pluginElement=c,b.success(d,d.pluginElement),c.cueVideoById(b.videoId);var e=b.containerId+"_callback";window[e]=function(a){mejs.YouTubeApi.handleStateChange(a,c,d)},c.addEventListener("onStateChange",e),setInterval(function(){mejs.YouTubeApi.createEvent(c,d,"timeupdate")},250),mejs.YouTubeApi.createEvent(c,d,"canplay")},handleStateChange:function(a,b,c){switch(a){case-1:c.paused=!0,c.ended=!0,mejs.YouTubeApi.createEvent(b,c,"loadedmetadata");break;case 0:c.paused=!1,c.ended=!0,mejs.YouTubeApi.createEvent(b,c,"ended");break;case 1:c.paused=!1,c.ended=!1,mejs.YouTubeApi.createEvent(b,c,"play"),mejs.YouTubeApi.createEvent(b,c,"playing");break;case 2:c.paused=!0,c.ended=!1,mejs.YouTubeApi.createEvent(b,c,"pause");break;case 3:mejs.YouTubeApi.createEvent(b,c,"progress");break;case 5:}}},window.onYouTubePlayerAPIReady=function(){mejs.YouTubeApi.iFrameReady()},window.onYouTubePlayerReady=function(a){mejs.YouTubeApi.flashReady(a)},window.mejs=mejs,window.MediaElement=mejs.MediaElement,function(a,b,c){"use strict";var d={locale:{language:b.i18n&&b.i18n.locale.language||"",strings:b.i18n&&b.i18n.locale.strings||{}},ietf_lang_regex:/^(x\-)?[a-z]{2,}(\-\w{2,})?(\-\w{2,})?$/,methods:{}};d.getLanguage=function(){var a=d.locale.language||window.navigator.userLanguage||window.navigator.language;return d.ietf_lang_regex.exec(a)?a:null},"undefined"!=typeof mejsL10n&&(d.locale.language=mejsL10n.language),d.methods.checkPlain=function(a){var b,c,d={"&":"&",'"':""","<":"<",">":">"};a=String(a);for(b in d)d.hasOwnProperty(b)&&(c=new RegExp(b,"g"),a=a.replace(c,d[b]));return a},d.methods.t=function(a,b){return d.locale.strings&&d.locale.strings[b.context]&&d.locale.strings[b.context][a]&&(a=d.locale.strings[b.context][a]),d.methods.checkPlain(a)},d.t=function(a,b){if("string"==typeof a&&a.length>0){var c=d.getLanguage();return b=b||{context:c},d.methods.t(a,b)}throw{name:"InvalidArgumentException",message:"First argument is either not a string or empty."}},b.i18n=d}(document,mejs),function(a,b){"use strict";"undefined"!=typeof mejsL10n&&(a[mejsL10n.language]=mejsL10n.strings)}(mejs.i18n.locale.strings); \ No newline at end of file diff --git a/static/mediaelementjs/mediaelementplayer.js b/static/mediaelementjs/mediaelementplayer.js deleted file mode 100644 index be7b8e02ccbe16fe45bfc3313b709068b944fed4..0000000000000000000000000000000000000000 --- a/static/mediaelementjs/mediaelementplayer.js +++ /dev/null @@ -1,3832 +0,0 @@ -/*! - * - * MediaElementPlayer - * http://mediaelementjs.com/ - * - * Creates a controller bar for HTML5 <video> add <audio> tags - * using jQuery and MediaElement.js (HTML5 Flash/Silverlight wrapper) - * - * Copyright 2010-2013, John Dyer (http://j.hn/) - * License: MIT - * - */ -if (typeof jQuery != 'undefined') { - mejs.$ = jQuery; -} else if (typeof Zepto != 'undefined') { - mejs.$ = Zepto; - - // define `outerWidth` method which has not been realized in Zepto - Zepto.fn.outerWidth = function(includeMargin) { - var width = $(this).width(); - if (includeMargin) { - width += parseInt($(this).css('margin-right'), 10); - width += parseInt($(this).css('margin-left'), 10); - } - return width - } - -} else if (typeof ender != 'undefined') { - mejs.$ = ender; -} -(function ($) { - - // default player values - mejs.MepDefaults = { - // url to poster (to fix iOS 3.x) - poster: '', - // When the video is ended, we can show the poster. - showPosterWhenEnded: false, - // default if the <video width> is not specified - defaultVideoWidth: 480, - // default if the <video height> is not specified - defaultVideoHeight: 270, - // if set, overrides <video width> - videoWidth: -1, - // if set, overrides <video height> - videoHeight: -1, - // default if the user doesn't specify - defaultAudioWidth: 400, - // default if the user doesn't specify - defaultAudioHeight: 30, - - // default amount to move back when back key is pressed - defaultSeekBackwardInterval: function(media) { - return (media.duration * 0.05); - }, - // default amount to move forward when forward key is pressed - defaultSeekForwardInterval: function(media) { - return (media.duration * 0.05); - }, - - // set dimensions via JS instead of CSS - setDimensions: true, - - // width of audio player - audioWidth: -1, - // height of audio player - audioHeight: -1, - // initial volume when the player starts (overrided by user cookie) - startVolume: 0.8, - // useful for <audio> player loops - loop: false, - // rewind to beginning when media ends - autoRewind: true, - // resize to media dimensions - enableAutosize: true, - - /* - * Time format to use. Default: 'mm:ss' - * Supported units: - * h: hour - * m: minute - * s: second - * f: frame count - * When using 'hh', 'mm', 'ss' or 'ff' we always display 2 digits. - * If you use 'h', 'm', 's' or 'f' we display 1 digit if possible. - * - * Example to display 75 seconds: - * Format 'mm:ss': 01:15 - * Format 'm:ss': 1:15 - * Format 'm:s': 1:15 - */ - timeFormat: '', - // forces the hour marker (##:00:00) - alwaysShowHours: false, - // show framecount in timecode (##:00:00:00) - showTimecodeFrameCount: false, - // used when showTimecodeFrameCount is set to true - framesPerSecond: 25, - - // automatically calculate the width of the progress bar based on the sizes of other elements - autosizeProgress : true, - // Hide controls when playing and mouse is not over the video - alwaysShowControls: false, - // Display the video control - hideVideoControlsOnLoad: false, - // Enable click video element to toggle play/pause - clickToPlayPause: true, - // force iPad's native controls - iPadUseNativeControls: false, - // force iPhone's native controls - iPhoneUseNativeControls: false, - // force Android's native controls - AndroidUseNativeControls: false, - // features to show - features: ['playpause','current','progress','duration','tracks','volume','fullscreen'], - // only for dynamic - isVideo: true, - - // stretching modes (auto, fill, responsive, none) - stretching: 'auto', - - // turns keyboard support on and off for this instance - enableKeyboard: true, - - // whenthis player starts, it will pause other players - pauseOtherPlayers: true, - - // array of keyboard actions such as play pause - keyActions: [ - { - keys: [ - 32, // SPACE - 179 // GOOGLE play/pause button - ], - action: function(player, media) { - if (media.paused || media.ended) { - media.play(); - } else { - media.pause(); - } - } - }, - { - keys: [38], // UP - action: function(player, media) { - player.container.find('.mejs-volume-slider').css('display','block'); - if (player.isVideo) { - player.showControls(); - player.startControlsTimer(); - } - - var newVolume = Math.min(media.volume + 0.1, 1); - media.setVolume(newVolume); - } - }, - { - keys: [40], // DOWN - action: function(player, media) { - player.container.find('.mejs-volume-slider').css('display','block'); - if (player.isVideo) { - player.showControls(); - player.startControlsTimer(); - } - - var newVolume = Math.max(media.volume - 0.1, 0); - media.setVolume(newVolume); - } - }, - { - keys: [ - 37, // LEFT - 227 // Google TV rewind - ], - action: function(player, media) { - if (!isNaN(media.duration) && media.duration > 0) { - if (player.isVideo) { - player.showControls(); - player.startControlsTimer(); - } - - // 5% - var newTime = Math.max(media.currentTime - player.options.defaultSeekBackwardInterval(media), 0); - media.setCurrentTime(newTime); - } - } - }, - { - keys: [ - 39, // RIGHT - 228 // Google TV forward - ], - action: function(player, media) { - if (!isNaN(media.duration) && media.duration > 0) { - if (player.isVideo) { - player.showControls(); - player.startControlsTimer(); - } - - // 5% - var newTime = Math.min(media.currentTime + player.options.defaultSeekForwardInterval(media), media.duration); - media.setCurrentTime(newTime); - } - } - }, - { - keys: [70], // F - action: function(player, media) { - if (typeof player.enterFullScreen != 'undefined') { - if (player.isFullScreen) { - player.exitFullScreen(); - } else { - player.enterFullScreen(); - } - } - } - }, - { - keys: [77], // M - action: function(player, media) { - player.container.find('.mejs-volume-slider').css('display','block'); - if (player.isVideo) { - player.showControls(); - player.startControlsTimer(); - } - if (player.media.muted) { - player.setMuted(false); - } else { - player.setMuted(true); - } - } - } - ] - }; - - mejs.mepIndex = 0; - - mejs.players = {}; - - // wraps a MediaElement object in player controls - mejs.MediaElementPlayer = function(node, o) { - // enforce object, even without "new" (via John Resig) - if ( !(this instanceof mejs.MediaElementPlayer) ) { - return new mejs.MediaElementPlayer(node, o); - } - - var t = this; - - // these will be reset after the MediaElement.success fires - t.$media = t.$node = $(node); - t.node = t.media = t.$media[0]; - - if(!t.node) { - return - } - - // check for existing player - if (typeof t.node.player != 'undefined') { - return t.node.player; - } - - - // try to get options from data-mejsoptions - if (typeof o == 'undefined') { - o = t.$node.data('mejsoptions'); - } - - // extend default options - t.options = $.extend({},mejs.MepDefaults,o); - - if (!t.options.timeFormat) { - // Generate the time format according to options - t.options.timeFormat = 'mm:ss'; - if (t.options.alwaysShowHours) { - t.options.timeFormat = 'hh:mm:ss'; - } - if (t.options.showTimecodeFrameCount) { - t.options.timeFormat += ':ff'; - } - } - - mejs.Utility.calculateTimeFormat(0, t.options, t.options.framesPerSecond || 25); - - // unique ID - t.id = 'mep_' + mejs.mepIndex++; - - // add to player array (for focus events) - mejs.players[t.id] = t; - - // start up - t.init(); - - return t; - }; - - // actual player - mejs.MediaElementPlayer.prototype = { - - hasFocus: false, - - controlsAreVisible: true, - - init: function() { - - var - t = this, - mf = mejs.MediaFeatures, - // options for MediaElement (shim) - meOptions = $.extend(true, {}, t.options, { - success: function(media, domNode) { t.meReady(media, domNode); }, - error: function(e) { t.handleError(e);} - }), - tagName = t.media.tagName.toLowerCase(); - - t.isDynamic = (tagName !== 'audio' && tagName !== 'video'); - - if (t.isDynamic) { - // get video from src or href? - t.isVideo = t.options.isVideo; - } else { - t.isVideo = (tagName !== 'audio' && t.options.isVideo); - } - - // use native controls in iPad, iPhone, and Android - if ((mf.isiPad && t.options.iPadUseNativeControls) || (mf.isiPhone && t.options.iPhoneUseNativeControls)) { - - // add controls and stop - t.$media.attr('controls', 'controls'); - - // attempt to fix iOS 3 bug - //t.$media.removeAttr('poster'); - // no Issue found on iOS3 -ttroxell - - // override Apple's autoplay override for iPads - if (mf.isiPad && t.media.getAttribute('autoplay') !== null) { - t.play(); - } - - } else if (mf.isAndroid && t.options.AndroidUseNativeControls) { - - // leave default player - - } else { - - // DESKTOP: use MediaElementPlayer controls - - // remove native controls - t.$media.removeAttr('controls'); - var videoPlayerTitle = t.isVideo ? - mejs.i18n.t('Video Player') : mejs.i18n.t('Audio Player'); - // insert description for screen readers - $('<span class="mejs-offscreen">' + videoPlayerTitle + '</span>').insertBefore(t.$media); - // build container - t.container = - $('<div id="' + t.id + '" class="mejs-container ' + (mejs.MediaFeatures.svgAsImg ? 'svg' : 'no-svg') + - '" tabindex="0" role="application" aria-label="' + videoPlayerTitle + '">'+ - '<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) - .focus(function ( e ) { - if( !t.controlsAreVisible && !t.hasFocus ) { - t.showControls(true); - // In versions older than IE11, the focus causes the playbar to be displayed - // if user clicks on the Play/Pause button in the control bar once it attempts - // to hide it - if (!t.hasMsNativeFullScreen) { - var playButton = t.container.find('.mejs-playpause-button > button'); - playButton.focus(); - } - } - }); - - if (t.options.stretching === 'fill' && !t.container.parent('mejs-fill-container').length) { - // outer container - t.outerContainer = t.$media.parent(); - t.container.wrap('<div class="mejs-fill-container"/>'); - } - - // add classes for user and content - t.container.addClass( - (mf.isAndroid ? 'mejs-android ' : '') + - (mf.isiOS ? 'mejs-ios ' : '') + - (mf.isiPad ? 'mejs-ipad ' : '') + - (mf.isiPhone ? 'mejs-iphone ' : '') + - (t.isVideo ? 'mejs-video ' : 'mejs-audio ') - ); - - - // move the <video/video> tag into the right spot - t.container.find('.mejs-mediaelement').append(t.$media); - - // needs to be assigned here, after iOS remap - t.node.player = t; - - // find parts - t.controls = t.container.find('.mejs-controls'); - t.layers = t.container.find('.mejs-layers'); - - // determine the size - - /* size priority: - (1) videoWidth (forced), - (2) style="width;height;" - (3) width attribute, - (4) defaultVideoWidth (for unspecified cases) - */ - - var tagType = (t.isVideo ? 'video' : 'audio'), - capsTagName = tagType.substring(0,1).toUpperCase() + tagType.substring(1); - - - - if (t.options[tagType + 'Width'] > 0 || t.options[tagType + 'Width'].toString().indexOf('%') > -1) { - t.width = t.options[tagType + 'Width']; - } else if (t.media.style.width !== '' && t.media.style.width !== null) { - t.width = t.media.style.width; - } else if (t.media.getAttribute('width') !== null) { - t.width = t.$media.attr('width'); - } else { - t.width = t.options['default' + capsTagName + 'Width']; - } - - if (t.options[tagType + 'Height'] > 0 || t.options[tagType + 'Height'].toString().indexOf('%') > -1) { - t.height = t.options[tagType + 'Height']; - } else if (t.media.style.height !== '' && t.media.style.height !== null) { - t.height = t.media.style.height; - } else if (t.$media[0].getAttribute('height') !== null) { - t.height = t.$media.attr('height'); - } else { - t.height = t.options['default' + capsTagName + 'Height']; - } - - // set the size, while we wait for the plugins to load below - t.setPlayerSize(t.width, t.height); - - // create MediaElementShim - meOptions.pluginWidth = t.width; - meOptions.pluginHeight = t.height; - } - - // create MediaElement shim - mejs.MediaElement(t.$media[0], meOptions); - - if (typeof(t.container) != 'undefined' && t.controlsAreVisible){ - // controls are shown when loaded - t.container.trigger('controlsshown'); - } - }, - - showControls: function(doAnimation) { - var t = this; - - doAnimation = typeof doAnimation == 'undefined' || doAnimation; - - if (t.controlsAreVisible) - return; - - if (doAnimation) { - t.controls - .removeClass('mejs-offscreen') - .stop(true, true).fadeIn(200, function() { - t.controlsAreVisible = true; - t.container.trigger('controlsshown'); - }); - - // any additional controls people might add and want to hide - t.container.find('.mejs-control') - .removeClass('mejs-offscreen') - .stop(true, true).fadeIn(200, function() {t.controlsAreVisible = true;}); - - } else { - t.controls - .removeClass('mejs-offscreen') - .css('display','block'); - - // any additional controls people might add and want to hide - t.container.find('.mejs-control') - .removeClass('mejs-offscreen') - .css('display','block'); - - t.controlsAreVisible = true; - t.container.trigger('controlsshown'); - } - - t.setControlsSize(); - - }, - - hideControls: function(doAnimation) { - var t = this; - - doAnimation = typeof doAnimation == 'undefined' || doAnimation; - - if (!t.controlsAreVisible || t.options.alwaysShowControls || t.keyboardAction) - return; - - if (doAnimation) { - // fade out main controls - t.controls.stop(true, true).fadeOut(200, function() { - $(this) - .addClass('mejs-offscreen') - .css('display','block'); - - t.controlsAreVisible = false; - t.container.trigger('controlshidden'); - }); - - // any additional controls people might add and want to hide - t.container.find('.mejs-control').stop(true, true).fadeOut(200, function() { - $(this) - .addClass('mejs-offscreen') - .css('display','block'); - }); - } else { - - // hide main controls - t.controls - .addClass('mejs-offscreen') - .css('display','block'); - - // hide others - t.container.find('.mejs-control') - .addClass('mejs-offscreen') - .css('display','block'); - - t.controlsAreVisible = false; - t.container.trigger('controlshidden'); - } - }, - - controlsTimer: null, - - startControlsTimer: function(timeout) { - - var t = this; - - timeout = typeof timeout != 'undefined' ? timeout : 1500; - - t.killControlsTimer('start'); - - t.controlsTimer = setTimeout(function() { - // - t.hideControls(); - t.killControlsTimer('hide'); - }, timeout); - }, - - killControlsTimer: function(src) { - - var t = this; - - if (t.controlsTimer !== null) { - clearTimeout(t.controlsTimer); - delete t.controlsTimer; - t.controlsTimer = null; - } - }, - - controlsEnabled: true, - - disableControls: function() { - var t= this; - - t.killControlsTimer(); - t.hideControls(false); - this.controlsEnabled = false; - }, - - enableControls: function() { - var t= this; - - t.showControls(false); - - t.controlsEnabled = true; - }, - - // Sets up all controls and events - meReady: function(media, domNode) { - - - var t = this, - mf = mejs.MediaFeatures, - autoplayAttr = domNode.getAttribute('autoplay'), - autoplay = !(typeof autoplayAttr == 'undefined' || autoplayAttr === null || autoplayAttr === 'false'), - featureIndex, - feature; - - // make sure it can't create itself again if a plugin reloads - if (t.created) { - return; - } else { - t.created = true; - } - - t.media = media; - t.domNode = domNode; - - if (!(mf.isAndroid && t.options.AndroidUseNativeControls) && !(mf.isiPad && t.options.iPadUseNativeControls) && !(mf.isiPhone && t.options.iPhoneUseNativeControls)) { - - // two built in features - t.buildposter(t, t.controls, t.layers, t.media); - t.buildkeyboard(t, t.controls, t.layers, t.media); - t.buildoverlays(t, t.controls, t.layers, t.media); - - // grab for use by features - t.findTracks(); - - // add user-defined features/controls - for (featureIndex in t.options.features) { - feature = t.options.features[featureIndex]; - if (t['build' + feature]) { - try { - t['build' + feature](t, t.controls, t.layers, t.media); - } catch (e) { - // TODO: report control error - //throw e; - - - } - } - } - - t.container.trigger('controlsready'); - - // reset all layers and controls - t.setPlayerSize(t.width, t.height); - t.setControlsSize(); - - - // controls fade - if (t.isVideo) { - - if (mejs.MediaFeatures.hasTouch) { - - // for touch devices (iOS, Android) - // show/hide without animation on touch - - t.$media.bind('touchstart', function() { - - // toggle controls - if (t.controlsAreVisible) { - t.hideControls(false); - } else { - if (t.controlsEnabled) { - t.showControls(false); - } - } - }); - - } else { - - // create callback here since it needs access to current - // MediaElement object - t.clickToPlayPauseCallback = function() { - // - - if (t.options.clickToPlayPause) { - if (t.media.paused) { - t.play(); - } else { - t.pause(); - } - } - }; - - // click to play/pause - t.media.addEventListener('click', t.clickToPlayPauseCallback, false); - - // show/hide controls - t.container - .bind('mouseenter', function () { - if (t.controlsEnabled) { - if (!t.options.alwaysShowControls ) { - t.killControlsTimer('enter'); - t.showControls(); - t.startControlsTimer(2500); - } - } - }) - .bind('mousemove', function() { - if (t.controlsEnabled) { - if (!t.controlsAreVisible) { - t.showControls(); - } - if (!t.options.alwaysShowControls) { - t.startControlsTimer(2500); - } - } - }) - .bind('mouseleave', function () { - if (t.controlsEnabled) { - if (!t.media.paused && !t.options.alwaysShowControls) { - t.startControlsTimer(1000); - } - } - }); - } - - if(t.options.hideVideoControlsOnLoad) { - t.hideControls(false); - } - - // check for autoplay - if (autoplay && !t.options.alwaysShowControls) { - t.hideControls(); - } - - // resizer - if (t.options.enableAutosize) { - t.media.addEventListener('loadedmetadata', function(e) { - // if the <video height> was not set and the options.videoHeight was not set - // then resize to the real dimensions - if (t.options.videoHeight <= 0 && t.domNode.getAttribute('height') === null && !isNaN(e.target.videoHeight)) { - t.setPlayerSize(e.target.videoWidth, e.target.videoHeight); - t.setControlsSize(); - t.media.setVideoSize(e.target.videoWidth, e.target.videoHeight); - } - }, false); - } - } - - // EVENTS - - // FOCUS: when a video starts playing, it takes focus from other players (possibily pausing them) - t.media.addEventListener('play', function() { - var playerIndex; - - // go through all other players - for (playerIndex in mejs.players) { - var p = mejs.players[playerIndex]; - if (p.id != t.id && t.options.pauseOtherPlayers && !p.paused && !p.ended) { - p.pause(); - } - p.hasFocus = false; - } - - t.hasFocus = true; - },false); - - - // ended for all - t.media.addEventListener('ended', function (e) { - if(t.options.autoRewind) { - try{ - t.media.setCurrentTime(0); - // Fixing an Android stock browser bug, where "seeked" isn't fired correctly after ending the video and jumping to the beginning - window.setTimeout(function(){ - $(t.container).find('.mejs-overlay-loading').parent().hide(); - }, 20); - } catch (exp) { - - } - } - t.media.pause(); - - if (t.setProgressRail) { - t.setProgressRail(); - } - if (t.setCurrentRail) { - t.setCurrentRail(); - } - - if (t.options.loop) { - t.play(); - } else if (!t.options.alwaysShowControls && t.controlsEnabled) { - t.showControls(); - } - }, false); - - // resize on the first play - t.media.addEventListener('loadedmetadata', function(e) { - if (t.updateDuration) { - t.updateDuration(); - } - if (t.updateCurrent) { - t.updateCurrent(); - } - - if (!t.isFullScreen) { - t.setPlayerSize(t.width, t.height); - t.setControlsSize(); - } - }, false); - - // Only change the time format when necessary - var duration = null; - t.media.addEventListener('timeupdate',function() { - if (duration !== this.duration) { - duration = this.duration; - mejs.Utility.calculateTimeFormat(duration, t.options, t.options.framesPerSecond || 25); - - // make sure to fill in and resize the controls (e.g., 00:00 => 01:13:15 - if (t.updateDuration) { - t.updateDuration(); - } - if (t.updateCurrent) { - t.updateCurrent(); - } - t.setControlsSize(); - - } - }, false); - - t.container.focusout(function (e) { - if( e.relatedTarget ) { //FF is working on supporting focusout https://bugzilla.mozilla.org/show_bug.cgi?id=687787 - var $target = $(e.relatedTarget); - if (t.keyboardAction && $target.parents('.mejs-container').length === 0) { - t.keyboardAction = false; - t.hideControls(true); - } - } - }); - - // webkit has trouble doing this without a delay - setTimeout(function () { - t.setPlayerSize(t.width, t.height); - t.setControlsSize(); - }, 50); - - // adjust controls whenever window sizes (used to be in fullscreen only) - t.globalBind('resize', function() { - - // don't resize for fullscreen mode - if ( !(t.isFullScreen || (mejs.MediaFeatures.hasTrueNativeFullScreen && document.webkitIsFullScreen)) ) { - t.setPlayerSize(t.width, t.height); - } - - // always adjust controls - t.setControlsSize(); - }); - - // This is a work-around for a bug in the YouTube iFrame player, which means - // we can't use the play() API for the initial playback on iOS or Android; - // user has to start playback directly by tapping on the iFrame. - if (t.media.pluginType == 'youtube' && ( mf.isiOS || mf.isAndroid ) ) { - t.container.find('.mejs-overlay-play').hide(); - t.container.find('.mejs-poster').hide(); - } - } - - // force autoplay for HTML5 - if (autoplay && media.pluginType == 'native') { - t.play(); - } - - - if (t.options.success) { - - if (typeof t.options.success == 'string') { - window[t.options.success](t.media, t.domNode, t); - } else { - t.options.success(t.media, t.domNode, t); - } - } - }, - - handleError: function(e) { - var t = this; - - if (t.controls) { - t.controls.hide(); - } - - // Tell user that the file cannot be played - if (t.options.error) { - t.options.error(e); - } - }, - - setPlayerSize: function(width,height) { - var t = this; - - if( !t.options.setDimensions ) { - return false; - } - - if (typeof width != 'undefined') { - t.width = width; - } - - if (typeof height != 'undefined') { - t.height = height; - } - - // check stretching modes - switch (t.options.stretching) { - case 'fill': - // The 'fill' effect only makes sense on video; for audio we will set the dimensions - if (t.isVideo) { - this.setFillMode(); - } else { - this.setDimensions(t.width, t.height); - } - break; - case 'responsive': - this.setResponsiveMode(); - break; - case 'none': - this.setDimensions(t.width, t.height); - break; - // This is the 'auto' mode - default: - if (this.hasFluidMode() === true) { - this.setResponsiveMode(); - } else { - this.setDimensions(t.width, t.height); - } - break; - } - }, - - hasFluidMode: function() { - var t = this; - - // detect 100% mode - use currentStyle for IE since css() doesn't return percentages - return (t.height.toString().indexOf('%') > 0 || (t.$node.css('max-width') !== 'none' && t.$node.css('max-width') !== 't.width') || (t.$node[0].currentStyle && t.$node[0].currentStyle.maxWidth === '100%')); - }, - - setResponsiveMode: function() { - var t = this; - - // do we have the native dimensions yet? - var nativeWidth = (function() { - if (t.isVideo) { - if (t.media.videoWidth && t.media.videoWidth > 0) { - return t.media.videoWidth; - } else if (t.media.getAttribute('width') !== null) { - return t.media.getAttribute('width'); - } else { - return t.options.defaultVideoWidth; - } - } else { - return t.options.defaultAudioWidth; - } - })(); - - var nativeHeight = (function() { - if (t.isVideo) { - if (t.media.videoHeight && t.media.videoHeight > 0) { - return t.media.videoHeight; - } else if (t.media.getAttribute('height') !== null) { - return t.media.getAttribute('height'); - } else { - return t.options.defaultVideoHeight; - } - } else { - return t.options.defaultAudioHeight; - } - })(); - - var parentWidth = t.container.parent().closest(':visible').width(), - parentHeight = t.container.parent().closest(':visible').height(), - newHeight = t.isVideo || !t.options.autosizeProgress ? parseInt(parentWidth * nativeHeight/nativeWidth, 10) : nativeHeight; - - // When we use percent, the newHeight can't be calculated so we get the container height - if (isNaN(newHeight) || ( parentHeight !== 0 && newHeight > parentHeight && parentHeight > nativeHeight)) { - newHeight = parentHeight; - } - - if (t.container.parent().length > 0 && t.container.parent()[0].tagName.toLowerCase() === 'body') { // && t.container.siblings().count == 0) { - parentWidth = $(window).width(); - newHeight = $(window).height(); - } - - if ( newHeight && parentWidth ) { - - // set outer container size - t.container - .width(parentWidth) - .height(newHeight); - - // set native <video> or <audio> and shims - t.$media.add(t.container.find('.mejs-shim')) - .width('100%') - .height('100%'); - - // if shim is ready, send the size to the embeded plugin - if (t.isVideo) { - if (t.media.setVideoSize) { - t.media.setVideoSize(parentWidth, newHeight); - } - } - - // set the layers - t.layers.children('.mejs-layer') - .width('100%') - .height('100%'); - } - }, - - setFillMode: function() { - var t = this, - parent = t.outerContainer; - - if (!parent.width()) { - parent.height(t.$media.width()); - } - - if (!parent.height()) { - parent.height(t.$media.height()); - } - - var parentWidth = parent.width(), - parentHeight = parent.height(); - - t.setDimensions('100%', '100%'); - - // This prevents an issue when displaying poster - t.container.find('.mejs-poster img').css('display', 'block'); - - targetElement = t.container.find('object, embed, iframe, video'); - - // calculate new width and height - var initHeight = t.height, - initWidth = t.width, - // scale to the target width - scaleX1 = parentWidth, - scaleY1 = (initHeight * parentWidth) / initWidth, - // scale to the target height - scaleX2 = (initWidth * parentHeight) / initHeight, - scaleY2 = parentHeight, - // now figure out which one we should use - bScaleOnWidth = !(scaleX2 > parentWidth), - finalWidth = bScaleOnWidth ? Math.floor(scaleX1) : Math.floor(scaleX2), - finalHeight = bScaleOnWidth ? Math.floor(scaleY1) : Math.floor(scaleY2); - - if (bScaleOnWidth) { - targetElement.height(finalHeight).width(parentWidth); - if (t.media.setVideoSize) { - t.media.setVideoSize(parentWidth, finalHeight); - } - } else { - targetElement.height(parentHeight).width(finalWidth); - if (t.media.setVideoSize) { - t.media.setVideoSize(finalWidth, parentHeight); - } - } - - targetElement.css({ - 'margin-left': Math.floor((parentWidth - finalWidth) / 2), - 'margin-top': 0 - }); - }, - - setDimensions: function(width, height) { - var t = this; - - t.container - .width(width) - .height(height); - - t.layers.children('.mejs-layer') - .width(width) - .height(height); - }, - - setControlsSize: function() { - var t = this, - usedWidth = 0, - railWidth = 0, - rail = t.controls.find('.mejs-time-rail'), - total = t.controls.find('.mejs-time-total'), - others = rail.siblings(), - lastControl = others.last(), - lastControlPosition = null; - - // skip calculation if hidden - if (!t.container.is(':visible') || !rail.length || !rail.is(':visible')) { - return; - } - - // allow the size to come from custom CSS - if (t.options && !t.options.autosizeProgress) { - // Also, frontends devs can be more flexible - // due the opportunity of absolute positioning. - railWidth = parseInt(rail.css('width'), 10); - } - - // attempt to autosize - if (railWidth === 0 || !railWidth) { - - // find the size of all the other controls besides the rail - others.each(function() { - var $this = $(this); - if ($this.css('position') != 'absolute' && $this.is(':visible')) { - usedWidth += $(this).outerWidth(true); - } - }); - - // fit the rail into the remaining space - railWidth = t.controls.width() - usedWidth - (rail.outerWidth(true) - rail.width()); - } - - // resize the rail, - // but then check if the last control (say, the fullscreen button) got pushed down - // this often happens when zoomed - do { - // outer area - rail.width(railWidth); - // dark space - total.width(railWidth - (total.outerWidth(true) - total.width())); - - if (lastControl.css('position') != 'absolute') { - lastControlPosition = lastControl.length ? lastControl.position() : null; - railWidth--; - } - } while (lastControlPosition !== null && lastControlPosition.top.toFixed(2) > 0 && railWidth > 0); - - t.container.trigger('controlsresize'); - }, - - - buildposter: function(player, controls, layers, media) { - var t = this, - poster = - $('<div class="mejs-poster mejs-layer">' + - '</div>') - .appendTo(layers), - posterUrl = player.$media.attr('poster'); - - // prioriy goes to option (this is useful if you need to support iOS 3.x (iOS completely fails with poster) - if (player.options.poster !== '') { - posterUrl = player.options.poster; - } - - // second, try the real poster - if ( posterUrl ) { - t.setPoster(posterUrl); - } else { - poster.hide(); - } - - media.addEventListener('play',function() { - poster.hide(); - }, false); - - if(player.options.showPosterWhenEnded && player.options.autoRewind){ - media.addEventListener('ended',function() { - poster.show(); - }, false); - } - }, - - setPoster: function(url) { - var t = this, - posterDiv = t.container.find('.mejs-poster'), - posterImg = posterDiv.find('img'); - - if (posterImg.length === 0) { - posterImg = $('<img width="100%" height="100%" alt="" />').appendTo(posterDiv); - } - - posterImg.attr('src', url); - posterDiv.css({'background-image' : 'url(' + url + ')'}); - }, - - buildoverlays: function(player, controls, layers, media) { - var t = this; - if (!player.isVideo) - return; - - var - loading = - $('<div class="mejs-overlay mejs-layer">'+ - '<div class="mejs-overlay-loading"><span></span></div>'+ - '</div>') - .hide() // start out hidden - .appendTo(layers), - error = - $('<div class="mejs-overlay mejs-layer">'+ - '<div class="mejs-overlay-error"></div>'+ - '</div>') - .hide() // start out hidden - .appendTo(layers), - // this needs to come last so it's on top - bigPlay = - $('<div class="mejs-overlay mejs-layer mejs-overlay-play">'+ - '<div class="mejs-overlay-button"></div>'+ - '</div>') - .appendTo(layers) - .bind('click', function() { // Removed 'touchstart' due issues on Samsung Android devices where a tap on bigPlay started and immediately stopped the video - if (t.options.clickToPlayPause) { - if (media.paused) { - media.play(); - } - } - }); - - /* - if (mejs.MediaFeatures.isiOS || mejs.MediaFeatures.isAndroid) { - bigPlay.remove(); - loading.remove(); - } - */ - - - // show/hide big play button - media.addEventListener('play',function() { - bigPlay.hide(); - loading.hide(); - controls.find('.mejs-time-buffering').hide(); - error.hide(); - }, false); - - media.addEventListener('playing', function() { - bigPlay.hide(); - loading.hide(); - controls.find('.mejs-time-buffering').hide(); - error.hide(); - }, false); - - media.addEventListener('seeking', function() { - loading.show(); - controls.find('.mejs-time-buffering').show(); - }, false); - - media.addEventListener('seeked', function() { - loading.hide(); - controls.find('.mejs-time-buffering').hide(); - }, false); - - media.addEventListener('pause',function() { - if (!mejs.MediaFeatures.isiPhone) { - bigPlay.show(); - } - }, false); - - media.addEventListener('waiting', function() { - loading.show(); - controls.find('.mejs-time-buffering').show(); - }, false); - - - // show/hide loading - media.addEventListener('loadeddata',function() { - // for some reason Chrome is firing this event - //if (mejs.MediaFeatures.isChrome && media.getAttribute && media.getAttribute('preload') === 'none') - // return; - - loading.show(); - controls.find('.mejs-time-buffering').show(); - // Firing the 'canplay' event after a timeout which isn't getting fired on some Android 4.1 devices (https://github.com/johndyer/mediaelement/issues/1305) - if (mejs.MediaFeatures.isAndroid) { - media.canplayTimeout = window.setTimeout( - function() { - if (document.createEvent) { - var evt = document.createEvent('HTMLEvents'); - evt.initEvent('canplay', true, true); - return media.dispatchEvent(evt); - } - }, 300 - ); - } - }, false); - media.addEventListener('canplay',function() { - loading.hide(); - controls.find('.mejs-time-buffering').hide(); - clearTimeout(media.canplayTimeout); // Clear timeout inside 'loadeddata' to prevent 'canplay' to fire twice - }, false); - - // error handling - media.addEventListener('error',function(e) { - t.handleError(e); - loading.hide(); - bigPlay.hide(); - error.show(); - error.find('.mejs-overlay-error').html("Error loading this resource"); - }, false); - - media.addEventListener('keydown', function(e) { - t.onkeydown(player, media, e); - }, false); - }, - - buildkeyboard: function(player, controls, layers, media) { - - var t = this; - - t.container.keydown(function () { - t.keyboardAction = true; - }); - - // listen for key presses - t.globalBind('keydown', function(event) { - player.hasFocus = $(event.target).closest('.mejs-container').length !== 0 - && $(event.target).closest('.mejs-container').attr('id') === player.$media.closest('.mejs-container').attr('id'); - return t.onkeydown(player, media, event); - }); - - - // check if someone clicked outside a player region, then kill its focus - t.globalBind('click', function(event) { - player.hasFocus = $(event.target).closest('.mejs-container').length !== 0; - }); - - }, - onkeydown: function(player, media, e) { - if (player.hasFocus && player.options.enableKeyboard) { - // find a matching key - for (var i = 0, il = player.options.keyActions.length; i < il; i++) { - var keyAction = player.options.keyActions[i]; - - for (var j = 0, jl = keyAction.keys.length; j < jl; j++) { - if (e.keyCode == keyAction.keys[j]) { - if (typeof(e.preventDefault) == "function") e.preventDefault(); - keyAction.action(player, media, e.keyCode, e); - return false; - } - } - } - } - - return true; - }, - - findTracks: function() { - var t = this, - tracktags = t.$media.find('track'); - - // store for use by plugins - t.tracks = []; - tracktags.each(function(index, track) { - - track = $(track); - - t.tracks.push({ - srclang: (track.attr('srclang')) ? track.attr('srclang').toLowerCase() : '', - src: track.attr('src'), - kind: track.attr('kind'), - label: track.attr('label') || '', - entries: [], - isLoaded: false - }); - }); - }, - changeSkin: function(className) { - this.container[0].className = 'mejs-container ' + className; - this.setPlayerSize(this.width, this.height); - this.setControlsSize(); - }, - play: function() { - this.load(); - this.media.play(); - }, - pause: function() { - try { - this.media.pause(); - } catch (e) {} - }, - load: function() { - if (!this.isLoaded) { - this.media.load(); - } - - this.isLoaded = true; - }, - setMuted: function(muted) { - this.media.setMuted(muted); - }, - setCurrentTime: function(time) { - this.media.setCurrentTime(time); - }, - getCurrentTime: function() { - return this.media.currentTime; - }, - setVolume: function(volume) { - this.media.setVolume(volume); - }, - getVolume: function() { - return this.media.volume; - }, - setSrc: function(src) { - this.media.setSrc(src); - }, - remove: function() { - var t = this, featureIndex, feature; - - t.container.prev('.mejs-offscreen').remove(); - - // invoke features cleanup - for (featureIndex in t.options.features) { - feature = t.options.features[featureIndex]; - if (t['clean' + feature]) { - try { - t['clean' + feature](t); - } catch (e) { - // TODO: report control error - //throw e; - // - // - } - } - } - - // grab video and put it back in place - if (!t.isDynamic) { - t.$media.prop('controls', true); - // detach events from the video - // TODO: detach event listeners better than this; - // also detach ONLY the events attached by this plugin! - t.$node.clone().insertBefore(t.container).show(); - t.$node.remove(); - } else { - t.$node.insertBefore(t.container); - } - - if (t.media.pluginType !== 'native') { - t.media.remove(); - } - - // Remove the player from the mejs.players object so that pauseOtherPlayers doesn't blow up when trying to pause a non existance flash api. - delete mejs.players[t.id]; - - if (typeof t.container == 'object') { - t.container.remove(); - } - t.globalUnbind(); - delete t.node.player; - }, - rebuildtracks: function(){ - var t = this; - t.findTracks(); - t.buildtracks(t, t.controls, t.layers, t.media); - }, - resetSize: function(){ - var t = this; - // webkit has trouble doing this without a delay - setTimeout(function () { - // - t.setPlayerSize(t.width, t.height); - t.setControlsSize(); - }, 50); - } - }; - - (function(){ - var rwindow = /^((after|before)print|(before)?unload|hashchange|message|o(ff|n)line|page(hide|show)|popstate|resize|storage)\b/; - - function splitEvents(events, id) { - // add player ID as an event namespace so it's easier to unbind them all later - var ret = {d: [], w: []}; - $.each((events || '').split(' '), function(k, v){ - var eventname = v + '.' + id; - if (eventname.indexOf('.') === 0) { - ret.d.push(eventname); - ret.w.push(eventname); - } - else { - ret[rwindow.test(v) ? 'w' : 'd'].push(eventname); - } - }); - ret.d = ret.d.join(' '); - ret.w = ret.w.join(' '); - return ret; - } - - mejs.MediaElementPlayer.prototype.globalBind = function(events, data, callback) { - var t = this; - var doc = t.node ? t.node.ownerDocument : document; - - events = splitEvents(events, t.id); - if (events.d) $(doc).bind(events.d, data, callback); - if (events.w) $(window).bind(events.w, data, callback); - }; - - mejs.MediaElementPlayer.prototype.globalUnbind = function(events, callback) { - var t = this; - var doc = t.node ? t.node.ownerDocument : document; - - events = splitEvents(events, t.id); - if (events.d) $(doc).unbind(events.d, callback); - if (events.w) $(window).unbind(events.w, callback); - }; - })(); - - // turn into jQuery plugin - if (typeof $ != 'undefined') { - $.fn.mediaelementplayer = function (options) { - if (options === false) { - this.each(function () { - var player = $(this).data('mediaelementplayer'); - if (player) { - player.remove(); - } - $(this).removeData('mediaelementplayer'); - }); - } - else { - this.each(function () { - $(this).data('mediaelementplayer', new mejs.MediaElementPlayer(this, options)); - }); - } - return this; - }; - - - $(document).ready(function() { - // auto enable using JSON attribute - $('.mejs-player').mediaelementplayer(); - }); - } - - // push out to window - window.MediaElementPlayer = mejs.MediaElementPlayer; - -})(mejs.$); - -(function($) { - - $.extend(mejs.MepDefaults, { - playText: mejs.i18n.t('Play'), - pauseText: mejs.i18n.t('Pause') - }); - - // PLAY/pause BUTTON - $.extend(MediaElementPlayer.prototype, { - buildplaypause: function(player, controls, layers, media) { - var - t = this, - op = t.options, - play = - $('<div class="mejs-button mejs-playpause-button mejs-play" >' + - '<button type="button" aria-controls="' + t.id + '" title="' + op.playText + '" aria-label="' + op.playText + '"></button>' + - '</div>') - .appendTo(controls) - .click(function(e) { - e.preventDefault(); - - if (media.paused) { - media.play(); - } else { - media.pause(); - } - - return false; - }), - play_btn = play.find('button'); - - - function togglePlayPause(which) { - if ('play' === which) { - play.removeClass('mejs-play').addClass('mejs-pause'); - play_btn.attr({ - 'title': op.pauseText, - 'aria-label': op.pauseText - }); - } else { - play.removeClass('mejs-pause').addClass('mejs-play'); - play_btn.attr({ - 'title': op.playText, - 'aria-label': op.playText - }); - } - }; - togglePlayPause('pse'); - - - media.addEventListener('play',function() { - togglePlayPause('play'); - }, false); - media.addEventListener('playing',function() { - togglePlayPause('play'); - }, false); - - - media.addEventListener('pause',function() { - togglePlayPause('pse'); - }, false); - media.addEventListener('paused',function() { - togglePlayPause('pse'); - }, false); - } - }); - -})(mejs.$); - -(function($) { - - $.extend(mejs.MepDefaults, { - stopText: 'Stop' - }); - - // STOP BUTTON - $.extend(MediaElementPlayer.prototype, { - buildstop: function(player, controls, layers, media) { - var t = this; - - $('<div class="mejs-button mejs-stop-button mejs-stop">' + - '<button type="button" aria-controls="' + t.id + '" title="' + t.options.stopText + '" aria-label="' + t.options.stopText + '"></button>' + - '</div>') - .appendTo(controls) - .click(function() { - if (!media.paused) { - media.pause(); - } - if (media.currentTime > 0) { - media.setCurrentTime(0); - media.pause(); - controls.find('.mejs-time-current').width('0px'); - controls.find('.mejs-time-handle').css('left', '0px'); - controls.find('.mejs-time-float-current').html( mejs.Utility.secondsToTimeCode(0, player.options)); - controls.find('.mejs-currenttime').html( mejs.Utility.secondsToTimeCode(0, player.options)); - layers.find('.mejs-poster').show(); - } - }); - } - }); - -})(mejs.$); - -(function($) { - - $.extend(mejs.MepDefaults, { - progessHelpText: mejs.i18n.t( - 'Use Left/Right Arrow keys to advance one second, Up/Down arrows to advance ten seconds.') - }); - - // progress/loaded bar - $.extend(MediaElementPlayer.prototype, { - buildprogress: function(player, controls, layers, media) { - - $('<div class="mejs-time-rail">' + - '<span class="mejs-time-total mejs-time-slider">' + - //'<span class="mejs-offscreen">' + this.options.progessHelpText + '</span>' + - '<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(controls); - controls.find('.mejs-time-buffering').hide(); - - var - t = this, - total = controls.find('.mejs-time-total'), - loaded = controls.find('.mejs-time-loaded'), - current = controls.find('.mejs-time-current'), - handle = controls.find('.mejs-time-handle'), - timefloat = controls.find('.mejs-time-float'), - timefloatcurrent = controls.find('.mejs-time-float-current'), - slider = controls.find('.mejs-time-slider'), - handleMouseMove = function (e) { - - var offset = total.offset(), - width = total.width(), - percentage = 0, - newTime = 0, - pos = 0, - x; - - // mouse or touch position relative to the object - if (e.originalEvent && e.originalEvent.changedTouches) { - x = e.originalEvent.changedTouches[0].pageX; - } else if (e.changedTouches) { // for Zepto - x = e.changedTouches[0].pageX; - } else { - x = e.pageX; - } - - if (media.duration) { - if (x < offset.left) { - x = offset.left; - } else if (x > width + offset.left) { - x = width + offset.left; - } - - pos = x - offset.left; - percentage = (pos / width); - newTime = (percentage <= 0.02) ? 0 : percentage * media.duration; - - // seek to where the mouse is - if (mouseIsDown && newTime !== media.currentTime) { - media.setCurrentTime(newTime); - } - - // position floating time box - if (!mejs.MediaFeatures.hasTouch) { - timefloat.css('left', pos); - timefloatcurrent.html( mejs.Utility.secondsToTimeCode(newTime, player.options) ); - timefloat.show(); - } - } - }, - mouseIsDown = false, - mouseIsOver = false, - lastKeyPressTime = 0, - startedPaused = false, - autoRewindInitial = player.options.autoRewind; - // Accessibility for slider - var updateSlider = function (e) { - - var seconds = media.currentTime, - timeSliderText = mejs.i18n.t('Time Slider'), - time = mejs.Utility.secondsToTimeCode(seconds, player.options), - duration = media.duration; - - slider.attr({ - 'aria-label': timeSliderText, - 'aria-valuemin': 0, - 'aria-valuemax': duration, - 'aria-valuenow': seconds, - 'aria-valuetext': time, - 'role': 'slider', - 'tabindex': 0 - }); - - }; - - var restartPlayer = function () { - var now = new Date(); - if (now - lastKeyPressTime >= 1000) { - media.play(); - } - }; - - slider.bind('focus', function (e) { - player.options.autoRewind = false; - }); - - slider.bind('blur', function (e) { - player.options.autoRewind = autoRewindInitial; - }); - - slider.bind('keydown', function (e) { - - if ((new Date() - lastKeyPressTime) >= 1000) { - startedPaused = media.paused; - } - - var keyCode = e.keyCode, - duration = media.duration, - seekTime = media.currentTime, - seekForward = player.options.defaultSeekForwardInterval(duration), - seekBackward = player.options.defaultSeekBackwardInterval(duration); - - switch (keyCode) { - case 37: // left - case 40: // Down - seekTime -= seekBackward; - break; - case 39: // Right - case 38: // Up - seekTime += seekForward; - break; - case 36: // Home - seekTime = 0; - break; - case 35: // end - seekTime = duration; - break; - case 32: // space - case 13: // enter - media.paused ? media.play() : media.pause(); - return; - default: - return; - } - - seekTime = seekTime < 0 ? 0 : (seekTime >= duration ? duration : Math.floor(seekTime)); - lastKeyPressTime = new Date(); - if (!startedPaused) { - media.pause(); - } - - if (seekTime < media.duration && !startedPaused) { - setTimeout(restartPlayer, 1100); - } - - media.setCurrentTime(seekTime); - - e.preventDefault(); - e.stopPropagation(); - return false; - }); - - - // handle clicks - //controls.find('.mejs-time-rail').delegate('span', 'click', handleMouseMove); - total - .bind('mousedown touchstart', function (e) { - // only handle left clicks or touch - if (e.which === 1 || e.which === 0) { - mouseIsDown = true; - handleMouseMove(e); - t.globalBind('mousemove.dur touchmove.dur', function(e) { - handleMouseMove(e); - }); - t.globalBind('mouseup.dur touchend.dur', function (e) { - mouseIsDown = false; - timefloat.hide(); - t.globalUnbind('.dur'); - }); - } - }) - .bind('mouseenter', function(e) { - mouseIsOver = true; - t.globalBind('mousemove.dur', function(e) { - handleMouseMove(e); - }); - if (!mejs.MediaFeatures.hasTouch) { - timefloat.show(); - } - }) - .bind('mouseleave',function(e) { - mouseIsOver = false; - if (!mouseIsDown) { - t.globalUnbind('.dur'); - timefloat.hide(); - } - }); - - // loading - media.addEventListener('progress', function (e) { - player.setProgressRail(e); - player.setCurrentRail(e); - }, false); - - // current time - media.addEventListener('timeupdate', function(e) { - player.setProgressRail(e); - player.setCurrentRail(e); - updateSlider(e); - }, false); - - t.container.on('controlsresize', function() { - player.setProgressRail(); - player.setCurrentRail(); - }); - - // store for later use - t.loaded = loaded; - t.total = total; - t.current = current; - t.handle = handle; - }, - setProgressRail: function(e) { - - var - t = this, - target = (e !== undefined) ? e.target : t.media, - percent = null; - - // newest HTML5 spec has buffered array (FF4, Webkit) - if (target && target.buffered && target.buffered.length > 0 && target.buffered.end && target.duration) { - // account for a real array with multiple values - always read the end of the last buffer - percent = target.buffered.end(target.buffered.length - 1) / target.duration; - } - // Some browsers (e.g., FF3.6 and Safari 5) cannot calculate target.bufferered.end() - // to be anything other than 0. If the byte count is available we use this instead. - // Browsers that support the else if do not seem to have the bufferedBytes value and - // should skip to there. Tested in Safari 5, Webkit head, FF3.6, Chrome 6, IE 7/8. - else if (target && target.bytesTotal !== undefined && target.bytesTotal > 0 && target.bufferedBytes !== undefined) { - percent = target.bufferedBytes / target.bytesTotal; - } - // Firefox 3 with an Ogg file seems to go this way - else if (e && e.lengthComputable && e.total !== 0) { - percent = e.loaded / e.total; - } - - // finally update the progress bar - if (percent !== null) { - percent = Math.min(1, Math.max(0, percent)); - // update loaded bar - if (t.loaded && t.total) { - t.loaded.width(t.total.width() * percent); - } - } - }, - setCurrentRail: function() { - - var t = this; - - if (t.media.currentTime !== undefined && t.media.duration) { - - // update bar and handle - if (t.total && t.handle) { - var - newWidth = Math.round(t.total.width() * t.media.currentTime / t.media.duration), - handlePos = newWidth - Math.round(t.handle.outerWidth(true) / 2); - - t.current.width(newWidth); - t.handle.css('left', handlePos); - } - } - - } - }); -})(mejs.$); - -(function($) { - - // options - $.extend(mejs.MepDefaults, { - duration: -1, - timeAndDurationSeparator: '<span> | </span>' - }); - - - // current and duration 00:00 / 00:00 - $.extend(MediaElementPlayer.prototype, { - buildcurrent: function(player, controls, layers, media) { - var t = this; - - $('<div class="mejs-time" role="timer" aria-live="off">' + - '<span class="mejs-currenttime">' + - mejs.Utility.secondsToTimeCode(0, player.options) + - '</span>'+ - '</div>') - .appendTo(controls); - - t.currenttime = t.controls.find('.mejs-currenttime'); - - media.addEventListener('timeupdate',function() { - player.updateCurrent(); - }, false); - }, - - - buildduration: function(player, controls, layers, media) { - var t = this; - - if (controls.children().last().find('.mejs-currenttime').length > 0) { - $(t.options.timeAndDurationSeparator + - '<span class="mejs-duration">' + - mejs.Utility.secondsToTimeCode(t.options.duration, t.options) + - '</span>') - .appendTo(controls.find('.mejs-time')); - } else { - - // add class to current time - controls.find('.mejs-currenttime').parent().addClass('mejs-currenttime-container'); - - $('<div class="mejs-time mejs-duration-container">'+ - '<span class="mejs-duration">' + - mejs.Utility.secondsToTimeCode(t.options.duration, t.options) + - '</span>' + - '</div>') - .appendTo(controls); - } - - t.durationD = t.controls.find('.mejs-duration'); - - media.addEventListener('timeupdate',function() { - player.updateDuration(); - }, false); - }, - - updateCurrent: function() { - var t = this; - - var currentTime = t.media.currentTime; - - if (isNaN(currentTime)) { - currentTime = 0; - } - - if (t.currenttime) { - t.currenttime.html(mejs.Utility.secondsToTimeCode(currentTime, t.options)); - } - }, - - updateDuration: function() { - var t = this; - - var duration = t.media.duration; - if (t.options.duration > 0) { - duration = t.options.duration; - } - - if (isNaN(duration)) { - duration = 0; - } - - //Toggle the long video class if the video is longer than an hour. - t.container.toggleClass("mejs-long-video", duration > 3600); - - if (t.durationD && duration > 0) { - t.durationD.html(mejs.Utility.secondsToTimeCode(duration, t.options)); - } - } - }); - -})(mejs.$); - -(function($) { - - $.extend(mejs.MepDefaults, { - muteText: mejs.i18n.t('Mute Toggle'), - allyVolumeControlText: mejs.i18n.t('Use Up/Down Arrow keys to increase or decrease volume.'), - hideVolumeOnTouchDevices: true, - - audioVolume: 'horizontal', - videoVolume: 'vertical' - }); - - $.extend(MediaElementPlayer.prototype, { - buildvolume: function(player, controls, layers, media) { - - // Android and iOS don't support volume controls - if ((mejs.MediaFeatures.isAndroid || mejs.MediaFeatures.isiOS) && this.options.hideVolumeOnTouchDevices) - return; - - var t = this, - mode = (t.isVideo) ? t.options.videoVolume : t.options.audioVolume, - mute = (mode == 'horizontal') ? - - // horizontal version - $('<div class="mejs-button mejs-volume-button mejs-mute">' + - '<button type="button" aria-controls="' + t.id + - '" title="' + t.options.muteText + - '" aria-label="' + t.options.muteText + - '"></button>'+ - '</div>' + - '<a href="javascript:void(0);" class="mejs-horizontal-volume-slider">' + // outer background - '<span class="mejs-offscreen">' + t.options.allyVolumeControlText + '</span>' + - '<div class="mejs-horizontal-volume-total"></div>'+ // line background - '<div class="mejs-horizontal-volume-current"></div>'+ // current volume - '<div class="mejs-horizontal-volume-handle"></div>'+ // handle - '</a>' - ) - .appendTo(controls) : - - // vertical version - $('<div class="mejs-button mejs-volume-button mejs-mute">'+ - '<button type="button" aria-controls="' + t.id + - '" title="' + t.options.muteText + - '" aria-label="' + t.options.muteText + - '"></button>'+ - '<a href="javascript:void(0);" class="mejs-volume-slider">'+ // outer background - '<span class="mejs-offscreen">' + t.options.allyVolumeControlText + '</span>' + - '<div class="mejs-volume-total"></div>'+ // line background - '<div class="mejs-volume-current"></div>'+ // current volume - '<div class="mejs-volume-handle"></div>'+ // handle - '</a>'+ - '</div>') - .appendTo(controls), - volumeSlider = t.container.find('.mejs-volume-slider, .mejs-horizontal-volume-slider'), - volumeTotal = t.container.find('.mejs-volume-total, .mejs-horizontal-volume-total'), - volumeCurrent = t.container.find('.mejs-volume-current, .mejs-horizontal-volume-current'), - volumeHandle = t.container.find('.mejs-volume-handle, .mejs-horizontal-volume-handle'), - - positionVolumeHandle = function(volume, secondTry) { - - if (!volumeSlider.is(':visible') && typeof secondTry == 'undefined') { - volumeSlider.show(); - positionVolumeHandle(volume, true); - volumeSlider.hide(); - return; - } - - // correct to 0-1 - volume = Math.max(0,volume); - volume = Math.min(volume,1); - - // ajust mute button style - if (volume === 0) { - mute.removeClass('mejs-mute').addClass('mejs-unmute'); - mute.children('button').attr('title', mejs.i18n.t('Unmute')).attr('aria-label', mejs.i18n.t('Unmute')); - } else { - mute.removeClass('mejs-unmute').addClass('mejs-mute'); - mute.children('button').attr('title', mejs.i18n.t('Mute')).attr('aria-label', mejs.i18n.t('Mute')); - } - - // top/left of full size volume slider background - var totalPosition = volumeTotal.position(); - // position slider - if (mode == 'vertical') { - var - // height of the full size volume slider background - totalHeight = volumeTotal.height(), - - // the new top position based on the current volume - // 70% volume on 100px height == top:30px - newTop = totalHeight - (totalHeight * volume); - - // handle - volumeHandle.css('top', Math.round(totalPosition.top + newTop - (volumeHandle.height() / 2))); - - // show the current visibility - volumeCurrent.height(totalHeight - newTop ); - volumeCurrent.css('top', totalPosition.top + newTop); - } else { - var - // height of the full size volume slider background - totalWidth = volumeTotal.width(), - - // the new left position based on the current volume - newLeft = totalWidth * volume; - - // handle - volumeHandle.css('left', Math.round(totalPosition.left + newLeft - (volumeHandle.width() / 2))); - - // rezize the current part of the volume bar - volumeCurrent.width( Math.round(newLeft) ); - } - }, - handleVolumeMove = function(e) { - - var volume = null, - totalOffset = volumeTotal.offset(); - - // calculate the new volume based on the moust position - if (mode === 'vertical') { - - var - railHeight = volumeTotal.height(), - newY = e.pageY - totalOffset.top; - - volume = (railHeight - newY) / railHeight; - - // the controls just hide themselves (usually when mouse moves too far up) - if (totalOffset.top === 0 || totalOffset.left === 0) { - return; - } - - } else { - var - railWidth = volumeTotal.width(), - newX = e.pageX - totalOffset.left; - - volume = newX / railWidth; - } - - // ensure the volume isn't outside 0-1 - volume = Math.max(0,volume); - volume = Math.min(volume,1); - - // position the slider and handle - positionVolumeHandle(volume); - - // set the media object (this will trigger the volumechanged event) - if (volume === 0) { - media.setMuted(true); - } else { - media.setMuted(false); - } - media.setVolume(volume); - }, - mouseIsDown = false, - mouseIsOver = false; - - // SLIDER - - mute - .hover(function() { - volumeSlider.show(); - mouseIsOver = true; - }, function() { - mouseIsOver = false; - - if (!mouseIsDown && mode == 'vertical') { - volumeSlider.hide(); - } - }); - - var updateVolumeSlider = function (e) { - - var volume = Math.floor(media.volume*100); - - volumeSlider.attr({ - 'aria-label': mejs.i18n.t('Volume Slider'), - 'aria-valuemin': 0, - 'aria-valuemax': 100, - 'aria-valuenow': volume, - 'aria-valuetext': volume+'%', - 'role': 'slider', - 'tabindex': 0 - }); - - }; - - volumeSlider - .bind('mouseover', function() { - mouseIsOver = true; - }) - .bind('mousedown', function (e) { - handleVolumeMove(e); - t.globalBind('mousemove.vol', function(e) { - handleVolumeMove(e); - }); - t.globalBind('mouseup.vol', function () { - mouseIsDown = false; - t.globalUnbind('.vol'); - - if (!mouseIsOver && mode == 'vertical') { - volumeSlider.hide(); - } - }); - mouseIsDown = true; - - return false; - }) - .bind('keydown', function (e) { - var keyCode = e.keyCode; - var volume = media.volume; - switch (keyCode) { - case 38: // Up - volume = Math.min(volume + 0.1, 1); - break; - case 40: // Down - volume = Math.max(0, volume - 0.1); - break; - default: - return true; - } - - mouseIsDown = false; - positionVolumeHandle(volume); - media.setVolume(volume); - return false; - }); - - // MUTE button - mute.find('button').click(function() { - media.setMuted( !media.muted ); - }); - - //Keyboard input - mute.find('button').bind('focus', function () { - volumeSlider.show(); - }); - - // listen for volume change events from other sources - media.addEventListener('volumechange', function(e) { - if (!mouseIsDown) { - if (media.muted) { - positionVolumeHandle(0); - mute.removeClass('mejs-mute').addClass('mejs-unmute'); - } else { - positionVolumeHandle(media.volume); - mute.removeClass('mejs-unmute').addClass('mejs-mute'); - } - } - updateVolumeSlider(e); - }, false); - - // mutes the media and sets the volume icon muted if the initial volume is set to 0 - if (player.options.startVolume === 0) { - media.setMuted(true); - } - - // shim gets the startvolume as a parameter, but we have to set it on the native <video> and <audio> elements - if (media.pluginType === 'native') { - media.setVolume(player.options.startVolume); - } - - t.container.on('controlsresize', function() { - positionVolumeHandle(media.volume); - }); - } - }); - -})(mejs.$); - -(function($) { - - $.extend(mejs.MepDefaults, { - usePluginFullScreen: true, - newWindowCallback: function() { return '';}, - fullscreenText: mejs.i18n.t('Fullscreen') - }); - - $.extend(MediaElementPlayer.prototype, { - - isFullScreen: false, - - isNativeFullScreen: false, - - isInIframe: false, - - // Possible modes - // (1) 'native-native' HTML5 video + browser fullscreen (IE10+, etc.) - // (2) 'plugin-native' plugin video + browser fullscreen (fails in some versions of Firefox) - // (3) 'fullwindow' Full window (retains all UI) - // usePluginFullScreen = true - // (4) 'plugin-click' Flash 1 - click through with pointer events - // (5) 'plugin-hover' Flash 2 - hover popup in flash (IE6-8) - fullscreenMode: '', - - buildfullscreen: function(player, controls, layers, media) { - - if (!player.isVideo) - return; - - player.isInIframe = (window.location != window.parent.location); - - // detect on start - media.addEventListener('play', function() { player.detectFullscreenMode(); }); - - // build button - var t = this, - hideTimeout = null, - fullscreenBtn = - $('<div class="mejs-button mejs-fullscreen-button">' + - '<button type="button" aria-controls="' + t.id + '" title="' + t.options.fullscreenText + '" aria-label="' + t.options.fullscreenText + '"></button>' + - '</div>') - .appendTo(controls) - .on('click', function() { - - // toggle fullscreen - var isFullScreen = (mejs.MediaFeatures.hasTrueNativeFullScreen && mejs.MediaFeatures.isFullScreen()) || player.isFullScreen; - - if (isFullScreen) { - player.exitFullScreen(); - } else { - player.enterFullScreen(); - } - }) - .on('mouseover', function() { - - // very old browsers with a plugin - if (t.fullscreenMode == 'plugin-hover') { - if (hideTimeout !== null) { - clearTimeout(hideTimeout); - delete hideTimeout; - } - - var buttonPos = fullscreenBtn.offset(), - containerPos = player.container.offset(); - - media.positionFullscreenButton(buttonPos.left - containerPos.left, buttonPos.top - containerPos.top, true); - } - - }) - .on('mouseout', function() { - - if (t.fullscreenMode == 'plugin-hover') { - if (hideTimeout !== null) { - clearTimeout(hideTimeout); - delete hideTimeout; - } - - hideTimeout = setTimeout(function() { - media.hideFullscreenButton(); - }, 1500); - } - - }); - - - - player.fullscreenBtn = fullscreenBtn; - - t.globalBind('keydown',function (e) { - if (e.keyCode == 27 && ((mejs.MediaFeatures.hasTrueNativeFullScreen && mejs.MediaFeatures.isFullScreen()) || t.isFullScreen)) { - player.exitFullScreen(); - } - }); - - t.normalHeight = 0; - t.normalWidth = 0; - - // setup native fullscreen event - if (mejs.MediaFeatures.hasTrueNativeFullScreen) { - - // chrome doesn't alays fire this in an iframe - var fullscreenChanged = function(e) { - if (player.isFullScreen) { - if (mejs.MediaFeatures.isFullScreen()) { - player.isNativeFullScreen = true; - // reset the controls once we are fully in full screen - player.setControlsSize(); - } else { - player.isNativeFullScreen = false; - // when a user presses ESC - // make sure to put the player back into place - player.exitFullScreen(); - } - } - }; - - player.globalBind(mejs.MediaFeatures.fullScreenEventName, fullscreenChanged); - } - - }, - - detectFullscreenMode: function() { - - var t = this, - mode = '', - features = mejs.MediaFeatures; - - if (features.hasTrueNativeFullScreen && t.media.pluginType === 'native') { - mode = 'native-native'; - } else if (features.hasTrueNativeFullScreen && t.media.pluginType !== 'native' && !features.hasFirefoxPluginMovingProblem) { - mode = 'plugin-native'; - } else if (t.usePluginFullScreen) { - if (mejs.MediaFeatures.supportsPointerEvents) { - mode = 'plugin-click'; - // this needs some special setup - t.createPluginClickThrough(); - } else { - mode = 'plugin-hover'; - } - - } else { - mode = 'fullwindow'; - } - - - t.fullscreenMode = mode; - return mode; - }, - - isPluginClickThroughCreated: false, - - createPluginClickThrough: function() { - - var t = this; - - // don't build twice - if (t.isPluginClickThroughCreated) { - return; - } - - // allows clicking through the fullscreen button and controls down directly to Flash - - /* - When a user puts his mouse over the fullscreen button, we disable the controls so that mouse events can go down to flash (pointer-events) - We then put a divs over the video and on either side of the fullscreen button - to capture mouse movement and restore the controls once the mouse moves outside of the fullscreen button - */ - - var fullscreenIsDisabled = false, - restoreControls = function() { - if (fullscreenIsDisabled) { - // hide the hovers - for (var i in hoverDivs) { - hoverDivs[i].hide(); - } - - // restore the control bar - t.fullscreenBtn.css('pointer-events', ''); - t.controls.css('pointer-events', ''); - - // prevent clicks from pausing video - t.media.removeEventListener('click', t.clickToPlayPauseCallback); - - // store for later - fullscreenIsDisabled = false; - } - }, - hoverDivs = {}, - hoverDivNames = ['top', 'left', 'right', 'bottom'], - i, len, - positionHoverDivs = function() { - var fullScreenBtnOffsetLeft = fullscreenBtn.offset().left - t.container.offset().left, - fullScreenBtnOffsetTop = fullscreenBtn.offset().top - t.container.offset().top, - fullScreenBtnWidth = fullscreenBtn.outerWidth(true), - fullScreenBtnHeight = fullscreenBtn.outerHeight(true), - containerWidth = t.container.width(), - containerHeight = t.container.height(); - - for (i in hoverDivs) { - hoverDivs[i].css({position: 'absolute', top: 0, left: 0}); //, backgroundColor: '#f00'}); - } - - // over video, but not controls - hoverDivs['top'] - .width( containerWidth ) - .height( fullScreenBtnOffsetTop ); - - // over controls, but not the fullscreen button - hoverDivs['left'] - .width( fullScreenBtnOffsetLeft ) - .height( fullScreenBtnHeight ) - .css({top: fullScreenBtnOffsetTop}); - - // after the fullscreen button - hoverDivs['right'] - .width( containerWidth - fullScreenBtnOffsetLeft - fullScreenBtnWidth ) - .height( fullScreenBtnHeight ) - .css({top: fullScreenBtnOffsetTop, - left: fullScreenBtnOffsetLeft + fullScreenBtnWidth}); - - // under the fullscreen button - hoverDivs['bottom'] - .width( containerWidth ) - .height( containerHeight - fullScreenBtnHeight - fullScreenBtnOffsetTop ) - .css({top: fullScreenBtnOffsetTop + fullScreenBtnHeight}); - }; - - t.globalBind('resize', function() { - positionHoverDivs(); - }); - - for (i = 0, len = hoverDivNames.length; i < len; i++) { - hoverDivs[hoverDivNames[i]] = $('<div class="mejs-fullscreen-hover" />').appendTo(t.container).mouseover(restoreControls).hide(); - } - - // on hover, kill the fullscreen button's HTML handling, allowing clicks down to Flash - fullscreenBtn.on('mouseover',function() { - - if (!t.isFullScreen) { - - var buttonPos = fullscreenBtn.offset(), - containerPos = player.container.offset(); - - // move the button in Flash into place - media.positionFullscreenButton(buttonPos.left - containerPos.left, buttonPos.top - containerPos.top, false); - - // allows click through - t.fullscreenBtn.css('pointer-events', 'none'); - t.controls.css('pointer-events', 'none'); - - // restore click-to-play - t.media.addEventListener('click', t.clickToPlayPauseCallback); - - // show the divs that will restore things - for (i in hoverDivs) { - hoverDivs[i].show(); - } - - positionHoverDivs(); - - fullscreenIsDisabled = true; - } - - }); - - // restore controls anytime the user enters or leaves fullscreen - media.addEventListener('fullscreenchange', function(e) { - t.isFullScreen = !t.isFullScreen; - // don't allow plugin click to pause video - messes with - // plugin's controls - if (t.isFullScreen) { - t.media.removeEventListener('click', t.clickToPlayPauseCallback); - } else { - t.media.addEventListener('click', t.clickToPlayPauseCallback); - } - restoreControls(); - }); - - - // the mouseout event doesn't work on the fullscren button, because we already killed the pointer-events - // so we use the document.mousemove event to restore controls when the mouse moves outside the fullscreen button - - t.globalBind('mousemove', function(e) { - - // if the mouse is anywhere but the fullsceen button, then restore it all - if (fullscreenIsDisabled) { - - var fullscreenBtnPos = fullscreenBtn.offset(); - - - if (e.pageY < fullscreenBtnPos.top || e.pageY > fullscreenBtnPos.top + fullscreenBtn.outerHeight(true) || - e.pageX < fullscreenBtnPos.left || e.pageX > fullscreenBtnPos.left + fullscreenBtn.outerWidth(true) - ) { - - fullscreenBtn.css('pointer-events', ''); - t.controls.css('pointer-events', ''); - - fullscreenIsDisabled = false; - } - } - }); - - - t.isPluginClickThroughCreated = true; - }, - - cleanfullscreen: function(player) { - player.exitFullScreen(); - }, - - containerSizeTimeout: null, - - enterFullScreen: function() { - - var t = this; - - if (mejs.MediaFeatures.hasiOSFullScreen) { - t.media.webkitEnterFullscreen(); - return; - } - - // set it to not show scroll bars so 100% will work - $(document.documentElement).addClass('mejs-fullscreen'); - - // store sizing - t.normalHeight = t.container.height(); - t.normalWidth = t.container.width(); - - - - // attempt to do true fullscreen - if (t.fullscreenMode === 'native-native' || t.fullscreenMode === 'plugin-native') { - - mejs.MediaFeatures.requestFullScreen(t.container[0]); - //return; - - if (t.isInIframe) { - // sometimes exiting from fullscreen doesn't work - // notably in Chrome <iframe>. Fixed in version 17 - setTimeout(function checkFullscreen() { - - if (t.isNativeFullScreen) { - var percentErrorMargin = 0.002, // 0.2% - windowWidth = $(window).width(), - screenWidth = screen.width, - absDiff = Math.abs(screenWidth - windowWidth), - marginError = screenWidth * percentErrorMargin; - - // check if the video is suddenly not really fullscreen - if (absDiff > marginError) { - // manually exit - t.exitFullScreen(); - } else { - // test again - setTimeout(checkFullscreen, 500); - } - } - - }, 1000); - } - - } else if (t.fullscreeMode == 'fullwindow') { - // move into position - - } - - // make full size - t.container - .addClass('mejs-container-fullscreen') - .width('100%') - .height('100%'); - //.css({position: 'fixed', left: 0, top: 0, right: 0, bottom: 0, overflow: 'hidden', width: '100%', height: '100%', 'z-index': 1000}); - - // Only needed for safari 5.1 native full screen, can cause display issues elsewhere - // Actually, it seems to be needed for IE8, too - //if (mejs.MediaFeatures.hasTrueNativeFullScreen) { - t.containerSizeTimeout = setTimeout(function() { - t.container.css({width: '100%', height: '100%'}); - t.setControlsSize(); - }, 500); - //} - - if (t.media.pluginType === 'native') { - t.$media - .width('100%') - .height('100%'); - } else { - t.container.find('.mejs-shim') - .width('100%') - .height('100%'); - - setTimeout(function() { - var win = $(window), - winW = win.width(), - winH = win.height(); - - t.media.setVideoSize(winW,winH); - }, 500); - } - - t.layers.children('div') - .width('100%') - .height('100%'); - - if (t.fullscreenBtn) { - t.fullscreenBtn - .removeClass('mejs-fullscreen') - .addClass('mejs-unfullscreen'); - } - - t.setControlsSize(); - t.isFullScreen = true; - - t.container.find('.mejs-captions-text').css('font-size', screen.width / t.width * 1.00 * 100 + '%'); - t.container.find('.mejs-captions-position').css('bottom', '45px'); - - t.container.trigger('enteredfullscreen'); - }, - - exitFullScreen: function() { - - var t = this; - - // Prevent container from attempting to stretch a second time - clearTimeout(t.containerSizeTimeout); - - // firefox can't adjust plugins - /* - if (t.media.pluginType !== 'native' && mejs.MediaFeatures.isFirefox) { - t.media.setFullscreen(false); - //player.isFullScreen = false; - return; - } - */ - - // come out of native fullscreen - if (mejs.MediaFeatures.hasTrueNativeFullScreen && (mejs.MediaFeatures.isFullScreen() || t.isFullScreen)) { - mejs.MediaFeatures.cancelFullScreen(); - } - - // restore scroll bars to document - $(document.documentElement).removeClass('mejs-fullscreen'); - - t.container - .removeClass('mejs-container-fullscreen') - .width(t.normalWidth) - .height(t.normalHeight); - - if (t.media.pluginType === 'native') { - t.$media - .width(t.normalWidth) - .height(t.normalHeight); - } else { - t.container.find('.mejs-shim') - .width(t.normalWidth) - .height(t.normalHeight); - - t.media.setVideoSize(t.normalWidth, t.normalHeight); - } - - t.layers.children('div') - .width(t.normalWidth) - .height(t.normalHeight); - - t.fullscreenBtn - .removeClass('mejs-unfullscreen') - .addClass('mejs-fullscreen'); - - t.setControlsSize(); - t.isFullScreen = false; - - t.container.find('.mejs-captions-text').css('font-size',''); - t.container.find('.mejs-captions-position').css('bottom', ''); - - t.container.trigger('exitedfullscreen'); - } - }); - -})(mejs.$); - -(function($) { - - // Speed - $.extend(mejs.MepDefaults, { - - // We also support to pass object like this: - // [{name: 'Slow', value: '0.75'}, {name: 'Normal', value: '1.00'}, ...] - speeds: ['2.00', '1.50', '1.25', '1.00', '0.75'], - - defaultSpeed: '1.00', - - speedChar: 'x' - - }); - - $.extend(MediaElementPlayer.prototype, { - - buildspeed: function(player, controls, layers, media) { - var t = this; - - if (t.media.pluginType == 'native') { - var - speedButton = null, - speedSelector = null, - playbackSpeed = null, - inputId = null; - - var speeds = []; - var defaultInArray = false; - for (var i=0, len=t.options.speeds.length; i < len; i++) { - var s = t.options.speeds[i]; - if (typeof(s) === 'string'){ - speeds.push({ - name: s + t.options.speedChar, - value: s - }); - if(s === t.options.defaultSpeed) { - defaultInArray = true; - } - } - else { - speeds.push(s); - if(s.value === t.options.defaultSpeed) { - defaultInArray = true; - } - } - } - - if (!defaultInArray) { - speeds.push({ - name: t.options.defaultSpeed + t.options.speedChar, - value: t.options.defaultSpeed - }); - } - - speeds.sort(function(a, b) { - return parseFloat(b.value) - parseFloat(a.value); - }); - - var getSpeedNameFromValue = function(value) { - for(i=0,len=speeds.length; i <len; i++) { - if (speeds[i].value === value) { - return speeds[i].name; - } - } - }; - - var html = '<div class="mejs-button mejs-speed-button">' + - '<button type="button">' + getSpeedNameFromValue(t.options.defaultSpeed) + '</button>' + - '<div class="mejs-speed-selector">' + - '<ul>'; - - for (i = 0, il = speeds.length; i<il; i++) { - inputId = t.id + '-speed-' + speeds[i].value; - html += '<li>' + - '<input type="radio" name="speed" ' + - 'value="' + speeds[i].value + '" ' + - 'id="' + inputId + '" ' + - (speeds[i].value === t.options.defaultSpeed ? ' checked' : '') + - ' />' + - '<label for="' + inputId + '" ' + - (speeds[i].value === t.options.defaultSpeed ? ' class="mejs-speed-selected"' : '') + - '>' + speeds[i].name + '</label>' + - '</li>'; - } - html += '</ul></div></div>'; - - speedButton = $(html).appendTo(controls); - speedSelector = speedButton.find('.mejs-speed-selector'); - - playbackSpeed = t.options.defaultSpeed; - - media.addEventListener('loadedmetadata', function(e) { - if (playbackSpeed) { - media.playbackRate = parseFloat(playbackSpeed); - } - }, true); - - speedSelector - .on('click', 'input[type="radio"]', function() { - var newSpeed = $(this).attr('value'); - playbackSpeed = newSpeed; - media.playbackRate = parseFloat(newSpeed); - speedButton.find('button').html(getSpeedNameFromValue(newSpeed)); - speedButton.find('.mejs-speed-selected').removeClass('mejs-speed-selected'); - speedButton.find('input[type="radio"]:checked').next().addClass('mejs-speed-selected'); - }); - speedButton - .one( 'mouseenter focusin', function() { - speedSelector - .height( - speedButton.find('.mejs-speed-selector ul').outerHeight(true) + - speedButton.find('.mejs-speed-translations').outerHeight(true)) - .css('top', (-1 * speedSelector.height()) + 'px'); - }); - } - } - }); - -})(mejs.$); - -(function($) { - - // add extra default options - $.extend(mejs.MepDefaults, { - // this will automatically turn on a <track> - startLanguage: '', - - tracksText: mejs.i18n.t('Captions/Subtitles'), - - // By default, no WAI-ARIA live region - don't make a - // screen reader speak captions over an audio track. - tracksAriaLive: false, - - // option to remove the [cc] button when no <track kind="subtitles"> are present - hideCaptionsButtonWhenEmpty: true, - - // If true and we only have one track, change captions to popup - toggleCaptionsButtonWhenOnlyOne: false, - - // #id or .class - slidesSelector: '' - }); - - $.extend(MediaElementPlayer.prototype, { - - hasChapters: false, - - cleartracks: function(player, controls, layers, media){ - if(player) { - if(player.captions) player.captions.remove(); - if(player.chapters) player.chapters.remove(); - if(player.captionsText) player.captionsText.remove(); - if(player.captionsButton) player.captionsButton.remove(); - } - }, - buildtracks: function(player, controls, layers, media) { - if (player.tracks.length === 0) - return; - - var t = this, - attr = t.options.tracksAriaLive ? - 'role="log" aria-live="assertive" aria-atomic="false"' : '', - i; - - if (t.domNode.textTracks) { // if browser will do native captions, prefer mejs captions, loop through tracks and hide - for (i = t.domNode.textTracks.length - 1; i >= 0; i--) { - t.domNode.textTracks[i].mode = "hidden"; - } - } - t.cleartracks(player, controls, layers, media); - player.chapters = - $('<div class="mejs-chapters mejs-layer"></div>') - .prependTo(layers).hide(); - player.captions = - $('<div class="mejs-captions-layer mejs-layer"><div class="mejs-captions-position mejs-captions-position-hover" ' + - attr + '><span class="mejs-captions-text"></span></div></div>') - .prependTo(layers).hide(); - player.captionsText = player.captions.find('.mejs-captions-text'); - player.captionsButton = - $('<div class="mejs-button mejs-captions-button">'+ - '<button type="button" aria-controls="' + t.id + '" title="' + t.options.tracksText + '" aria-label="' + t.options.tracksText + '"></button>'+ - '<div class="mejs-captions-selector">'+ - '<ul>'+ - '<li>'+ - '<input type="radio" name="' + player.id + '_captions" id="' + player.id + '_captions_none" value="none" checked="checked" />' + - '<label for="' + player.id + '_captions_none">' + mejs.i18n.t('None') +'</label>'+ - '</li>' + - '</ul>'+ - '</div>'+ - '</div>') - .appendTo(controls); - - - var subtitleCount = 0; - for (i=0; i<player.tracks.length; i++) { - if (player.tracks[i].kind == 'subtitles') { - subtitleCount++; - } - } - - // if only one language then just make the button a toggle - if (t.options.toggleCaptionsButtonWhenOnlyOne && subtitleCount == 1){ - // click - player.captionsButton.on('click',function() { - if (player.selectedTrack === null) { - lang = player.tracks[0].srclang; - } else { - lang = 'none'; - } - player.setTrack(lang); - }); - } else { - // hover or keyboard focus - player.captionsButton.on( 'mouseenter focusin', function() { - $(this).find('.mejs-captions-selector').removeClass('mejs-offscreen'); - }) - - // handle clicks to the language radio buttons - .on('click','input[type=radio]',function() { - lang = this.value; - player.setTrack(lang); - }); - - player.captionsButton.on( 'mouseleave focusout', function() { - $(this).find(".mejs-captions-selector").addClass("mejs-offscreen"); - }); - - } - - if (!player.options.alwaysShowControls) { - // move with controls - player.container - .bind('controlsshown', function () { - // push captions above controls - player.container.find('.mejs-captions-position').addClass('mejs-captions-position-hover'); - - }) - .bind('controlshidden', function () { - if (!media.paused) { - // move back to normal place - player.container.find('.mejs-captions-position').removeClass('mejs-captions-position-hover'); - } - }); - } else { - player.container.find('.mejs-captions-position').addClass('mejs-captions-position-hover'); - } - - player.trackToLoad = -1; - player.selectedTrack = null; - player.isLoadingTrack = false; - - // add to list - for (i=0; i<player.tracks.length; i++) { - if (player.tracks[i].kind == 'subtitles') { - player.addTrackButton(player.tracks[i].srclang, player.tracks[i].label); - } - } - - // start loading tracks - player.loadNextTrack(); - - media.addEventListener('timeupdate',function(e) { - player.displayCaptions(); - }, false); - - if (player.options.slidesSelector !== '') { - player.slidesContainer = $(player.options.slidesSelector); - - media.addEventListener('timeupdate',function(e) { - player.displaySlides(); - }, false); - - } - - media.addEventListener('loadedmetadata', function(e) { - player.displayChapters(); - }, false); - - player.container.hover( - function () { - // chapters - if (player.hasChapters) { - player.chapters.removeClass('mejs-offscreen'); - player.chapters.fadeIn(200).height(player.chapters.find('.mejs-chapter').outerHeight()); - } - }, - function () { - if (player.hasChapters && !media.paused) { - player.chapters.fadeOut(200, function() { - $(this).addClass('mejs-offscreen'); - $(this).css('display','block'); - }); - } - }); - - t.container.on('controlsresize', function() { - t.adjustLanguageBox(); - }); - - // check for autoplay - if (player.node.getAttribute('autoplay') !== null) { - player.chapters.addClass('mejs-offscreen'); - } - }, - - setTrack: function(lang){ - - var t = this, - i; - - if (lang == 'none') { - t.selectedTrack = null; - t.captionsButton.removeClass('mejs-captions-enabled'); - } else { - for (i=0; i<t.tracks.length; i++) { - if (t.tracks[i].srclang == lang) { - if (t.selectedTrack === null) - t.captionsButton.addClass('mejs-captions-enabled'); - t.selectedTrack = t.tracks[i]; - t.captions.attr('lang', t.selectedTrack.srclang); - t.displayCaptions(); - break; - } - } - } - }, - - loadNextTrack: function() { - var t = this; - - t.trackToLoad++; - if (t.trackToLoad < t.tracks.length) { - t.isLoadingTrack = true; - t.loadTrack(t.trackToLoad); - } else { - // add done? - t.isLoadingTrack = false; - - t.checkForTracks(); - } - }, - - loadTrack: function(index){ - var - t = this, - track = t.tracks[index], - after = function() { - - track.isLoaded = true; - - t.enableTrackButton(track.srclang, track.label); - - t.loadNextTrack(); - - }; - - - $.ajax({ - url: track.src, - dataType: "text", - success: function(d) { - - // parse the loaded file - if (typeof d == "string" && (/<tt\s+xml/ig).exec(d)) { - track.entries = mejs.TrackFormatParser.dfxp.parse(d); - } else { - track.entries = mejs.TrackFormatParser.webvtt.parse(d); - } - - after(); - - if (track.kind == 'chapters') { - t.media.addEventListener('play', function(e) { - if (t.media.duration > 0) { - t.displayChapters(track); - } - }, false); - } - - if (track.kind == 'slides') { - t.setupSlides(track); - } - }, - error: function() { - t.removeTrackButton(track.srclang); - t.loadNextTrack(); - } - }); - }, - - enableTrackButton: function(lang, label) { - var t = this; - - if (label === '') { - label = mejs.language.codes[lang] || lang; - } - - t.captionsButton - .find('input[value=' + lang + ']') - .prop('disabled',false) - .siblings('label') - .html( label ); - - // auto select - if (t.options.startLanguage == lang) { - $('#' + t.id + '_captions_' + lang).prop('checked', true).trigger('click'); - } - - t.adjustLanguageBox(); - }, - - removeTrackButton: function(lang) { - var t = this; - - t.captionsButton.find('input[value=' + lang + ']').closest('li').remove(); - - t.adjustLanguageBox(); - }, - - addTrackButton: function(lang, label) { - var t = this; - if (label === '') { - label = mejs.language.codes[lang] || lang; - } - - t.captionsButton.find('ul').append( - $('<li>'+ - '<input type="radio" name="' + t.id + '_captions" id="' + t.id + '_captions_' + lang + '" value="' + lang + '" disabled="disabled" />' + - '<label for="' + t.id + '_captions_' + lang + '">' + label + ' (loading)' + '</label>'+ - '</li>') - ); - - t.adjustLanguageBox(); - - // remove this from the dropdownlist (if it exists) - t.container.find('.mejs-captions-translations option[value=' + lang + ']').remove(); - }, - - adjustLanguageBox:function() { - var t = this; - // adjust the size of the outer box - t.captionsButton.find('.mejs-captions-selector').height( - t.captionsButton.find('.mejs-captions-selector ul').outerHeight(true) + - t.captionsButton.find('.mejs-captions-translations').outerHeight(true) - ); - }, - - checkForTracks: function() { - var - t = this, - hasSubtitles = false; - - // check if any subtitles - if (t.options.hideCaptionsButtonWhenEmpty) { - for (i=0; i<t.tracks.length; i++) { - if (t.tracks[i].kind == 'subtitles' && t.tracks[i].isLoaded) { - hasSubtitles = true; - break; - } - } - - if (!hasSubtitles) { - t.captionsButton.hide(); - t.setControlsSize(); - } - } - }, - - displayCaptions: function() { - - if (typeof this.tracks == 'undefined') - return; - - var - t = this, - i, - track = t.selectedTrack; - - if (track !== null && track.isLoaded) { - for (i=0; i<track.entries.times.length; i++) { - if (t.media.currentTime >= track.entries.times[i].start && t.media.currentTime <= track.entries.times[i].stop) { - // Set the line before the timecode as a class so the cue can be targeted if needed - t.captionsText.html(track.entries.text[i]).attr('class', 'mejs-captions-text ' + (track.entries.times[i].identifier || '')); - t.captions.show().height(0); - return; // exit out if one is visible; - } - } - t.captions.hide(); - } else { - t.captions.hide(); - } - }, - - setupSlides: function(track) { - var t = this; - - t.slides = track; - t.slides.entries.imgs = [t.slides.entries.text.length]; - t.showSlide(0); - - }, - - showSlide: function(index) { - if (typeof this.tracks == 'undefined' || typeof this.slidesContainer == 'undefined') { - return; - } - - var t = this, - url = t.slides.entries.text[index], - img = t.slides.entries.imgs[index]; - - if (typeof img == 'undefined' || typeof img.fadeIn == 'undefined') { - - t.slides.entries.imgs[index] = img = $('<img src="' + url + '">') - .on('load', function() { - img.appendTo(t.slidesContainer) - .hide() - .fadeIn() - .siblings(':visible') - .fadeOut(); - - }); - - } else { - - if (!img.is(':visible') && !img.is(':animated')) { - - // - - img.fadeIn() - .siblings(':visible') - .fadeOut(); - } - } - - }, - - displaySlides: function() { - - if (typeof this.slides == 'undefined') - return; - - var - t = this, - slides = t.slides, - i; - - for (i=0; i<slides.entries.times.length; i++) { - if (t.media.currentTime >= slides.entries.times[i].start && t.media.currentTime <= slides.entries.times[i].stop){ - - t.showSlide(i); - - return; // exit out if one is visible; - } - } - }, - - displayChapters: function() { - var - t = this, - i; - - for (i=0; i<t.tracks.length; i++) { - if (t.tracks[i].kind == 'chapters' && t.tracks[i].isLoaded) { - t.drawChapters(t.tracks[i]); - t.hasChapters = true; - break; - } - } - }, - - drawChapters: function(chapters) { - var - t = this, - i, - dur, - //width, - //left, - percent = 0, - usedPercent = 0; - - t.chapters.empty(); - - for (i=0; i<chapters.entries.times.length; i++) { - dur = chapters.entries.times[i].stop - chapters.entries.times[i].start; - percent = Math.floor(dur / t.media.duration * 100); - if (percent + usedPercent > 100 || // too large - i == chapters.entries.times.length-1 && percent + usedPercent < 100) // not going to fill it in - { - percent = 100 - usedPercent; - } - //width = Math.floor(t.width * dur / t.media.duration); - //left = Math.floor(t.width * chapters.entries.times[i].start / t.media.duration); - //if (left + width > t.width) { - // width = t.width - left; - //} - - t.chapters.append( $( - '<div class="mejs-chapter" rel="' + chapters.entries.times[i].start + '" style="left: ' + usedPercent.toString() + '%;width: ' + percent.toString() + '%;">' + - '<div class="mejs-chapter-block' + ((i==chapters.entries.times.length-1) ? ' mejs-chapter-block-last' : '') + '">' + - '<span class="ch-title">' + chapters.entries.text[i] + '</span>' + - '<span class="ch-time">' + mejs.Utility.secondsToTimeCode(chapters.entries.times[i].start, t.options) + '–' + mejs.Utility.secondsToTimeCode(chapters.entries.times[i].stop, t.options) + '</span>' + - '</div>' + - '</div>')); - usedPercent += percent; - } - - t.chapters.find('div.mejs-chapter').click(function() { - t.media.setCurrentTime( parseFloat( $(this).attr('rel') ) ); - if (t.media.paused) { - t.media.play(); - } - }); - - t.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', - // 'pt-pt':'Portuguese (Portugal)', - 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' - } - }; - - /* - Parses WebVTT format which should be formatted as - ================================ - WEBVTT - - 1 - 00:00:01,1 --> 00:00:05,000 - A line of text - - 2 - 00:01:15,1 --> 00:02:05,000 - A second line of text - - =============================== - - Adapted from: http://www.delphiki.com/html5/playr - */ - 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(trackText) { - var - i = 0, - lines = mejs.TrackFormatParser.split2(trackText, /\r?\n/), - entries = {text:[], times:[]}, - timecode, - text, - identifier; - for(; i<lines.length; i++) { - timecode = this.pattern_timecode.exec(lines[i]); - - if (timecode && i<lines.length) { - if ((i - 1) >= 0 && lines[i - 1] !== '') { - identifier = lines[i - 1]; - } - i++; - // grab all the (possibly multi-line) text that follows - text = lines[i]; - i++; - while(lines[i] !== '' && i<lines.length){ - text = text + '\n' + lines[i]; - i++; - } - text = $.trim(text).replace(/(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig, "<a href='$1' target='_blank'>$1</a>"); - // Text is in a different array so I can use .join - entries.text.push(text); - entries.times.push( - { - identifier: identifier, - start: (mejs.Utility.convertSMPTEtoSeconds(timecode[1]) === 0) ? 0.200 : mejs.Utility.convertSMPTEtoSeconds(timecode[1]), - stop: mejs.Utility.convertSMPTEtoSeconds(timecode[3]), - settings: timecode[5] - }); - } - identifier = ''; - } - return entries; - } - }, - // Thanks to Justin Capella: https://github.com/johndyer/mediaelement/pull/420 - dfxp: { - parse: function(trackText) { - trackText = $(trackText).filter("tt"); - var - i = 0, - container = trackText.children("div").eq(0), - lines = container.find("p"), - styleNode = trackText.find("#" + container.attr("style")), - styles, - text, - entries = {text:[], times:[]}; - - - if (styleNode.length) { - var attributes = styleNode.removeAttr("id").get(0).attributes; - if (attributes.length) { - styles = {}; - for (i = 0; i < attributes.length; i++) { - styles[attributes[i].name.split(":")[1]] = attributes[i].value; - } - } - } - - for(i = 0; i<lines.length; i++) { - var style; - var _temp_times = { - start: null, - stop: null, - style: null - }; - if (lines.eq(i).attr("begin")) _temp_times.start = mejs.Utility.convertSMPTEtoSeconds(lines.eq(i).attr("begin")); - if (!_temp_times.start && lines.eq(i-1).attr("end")) _temp_times.start = mejs.Utility.convertSMPTEtoSeconds(lines.eq(i-1).attr("end")); - if (lines.eq(i).attr("end")) _temp_times.stop = mejs.Utility.convertSMPTEtoSeconds(lines.eq(i).attr("end")); - if (!_temp_times.stop && lines.eq(i+1).attr("begin")) _temp_times.stop = mejs.Utility.convertSMPTEtoSeconds(lines.eq(i+1).attr("begin")); - if (styles) { - style = ""; - for (var _style in styles) { - style += _style + ":" + styles[_style] + ";"; - } - } - if (style) _temp_times.style = style; - if (_temp_times.start === 0) _temp_times.start = 0.200; - entries.times.push(_temp_times); - text = $.trim(lines.eq(i).html()).replace(/(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig, "<a href='$1' target='_blank'>$1</a>"); - entries.text.push(text); - if (entries.times.start === 0) entries.times.start = 2; - } - return entries; - } - }, - split2: function (text, regex) { - // normal version for compliant browsers - // see below for IE fix - return text.split(regex); - } - }; - - // test for browsers with bad String.split method. - if ('x\n\ny'.split(/\n/gi).length != 3) { - // add super slow IE8 and below version - mejs.TrackFormatParser.split2 = function(text, regex) { - var - parts = [], - chunk = '', - i; - - for (i=0; i<text.length; i++) { - chunk += text.substring(i,i+1); - if (regex.test(chunk)) { - parts.push(chunk.replace(regex, '')); - chunk = ''; - } - } - parts.push(chunk); - return parts; - }; - } - -})(mejs.$); - -/* -* ContextMenu Plugin -* -* -*/ - -(function($) { - -$.extend(mejs.MepDefaults, - { 'contextMenuItems': [ - // demo of a fullscreen option - { - render: function(player) { - - // check for fullscreen plugin - if (typeof player.enterFullScreen == 'undefined') - return null; - - if (player.isFullScreen) { - return mejs.i18n.t('Turn off Fullscreen'); - } else { - return mejs.i18n.t('Go Fullscreen'); - } - }, - click: function(player) { - if (player.isFullScreen) { - player.exitFullScreen(); - } else { - player.enterFullScreen(); - } - } - } - , - // demo of a mute/unmute button - { - render: function(player) { - if (player.media.muted) { - return mejs.i18n.t('Unmute'); - } else { - return mejs.i18n.t('Mute'); - } - }, - click: function(player) { - if (player.media.muted) { - player.setMuted(false); - } else { - player.setMuted(true); - } - } - }, - // separator - { - isSeparator: true - } - , - // demo of simple download video - { - render: function(player) { - return mejs.i18n.t('Download Video'); - }, - click: function(player) { - window.location.href = player.media.currentSrc; - } - } - ]} -); - - - $.extend(MediaElementPlayer.prototype, { - buildcontextmenu: function(player, controls, layers, media) { - - // create context menu - player.contextMenu = $('<div class="mejs-contextmenu"></div>') - .appendTo($('body')) - .hide(); - - // create events for showing context menu - player.container.bind('contextmenu', function(e) { - if (player.isContextMenuEnabled) { - e.preventDefault(); - player.renderContextMenu(e.clientX-1, e.clientY-1); - return false; - } - }); - player.container.bind('click', function() { - player.contextMenu.hide(); - }); - player.contextMenu.bind('mouseleave', function() { - - // - player.startContextMenuTimer(); - - }); - }, - - cleancontextmenu: function(player) { - player.contextMenu.remove(); - }, - - isContextMenuEnabled: true, - enableContextMenu: function() { - this.isContextMenuEnabled = true; - }, - disableContextMenu: function() { - this.isContextMenuEnabled = false; - }, - - contextMenuTimeout: null, - startContextMenuTimer: function() { - // - - var t = this; - - t.killContextMenuTimer(); - - t.contextMenuTimer = setTimeout(function() { - t.hideContextMenu(); - t.killContextMenuTimer(); - }, 750); - }, - killContextMenuTimer: function() { - var timer = this.contextMenuTimer; - - // - - if (timer != null) { - clearTimeout(timer); - delete timer; - timer = null; - } - }, - - hideContextMenu: function() { - this.contextMenu.hide(); - }, - - renderContextMenu: function(x,y) { - - // alway re-render the items so that things like "turn fullscreen on" and "turn fullscreen off" are always written correctly - var t = this, - html = '', - items = t.options.contextMenuItems; - - for (var i=0, il=items.length; i<il; i++) { - - if (items[i].isSeparator) { - html += '<div class="mejs-contextmenu-separator"></div>'; - } else { - - var rendered = items[i].render(t); - - // render can return null if the item doesn't need to be used at the moment - if (rendered != null) { - html += '<div class="mejs-contextmenu-item" data-itemindex="' + i + '" id="element-' + (Math.random()*1000000) + '">' + rendered + '</div>'; - } - } - } - - // position and show the context menu - t.contextMenu - .empty() - .append($(html)) - .css({top:y, left:x}) - .show(); - - // bind events - t.contextMenu.find('.mejs-contextmenu-item').each(function() { - - // which one is this? - var $dom = $(this), - itemIndex = parseInt( $dom.data('itemindex'), 10 ), - item = t.options.contextMenuItems[itemIndex]; - - // bind extra functionality? - if (typeof item.show != 'undefined') - item.show( $dom , t); - - // bind click action - $dom.click(function() { - // perform click action - if (typeof item.click != 'undefined') - item.click(t); - - // close - t.contextMenu.hide(); - }); - }); - - // stop the controls from hiding - setTimeout(function() { - t.killControlsTimer('rev3'); - }, 100); - - } - }); - -})(mejs.$); -(function($) { - // skip back button - - $.extend(mejs.MepDefaults, { - skipBackInterval: 30, - // %1 will be replaced with skipBackInterval in this string - skipBackText: mejs.i18n.t('Skip back %1 seconds') - }); - - $.extend(MediaElementPlayer.prototype, { - buildskipback: function(player, controls, layers, media) { - var - t = this, - // Replace %1 with skip back interval - backText = t.options.skipBackText.replace('%1', t.options.skipBackInterval), - // create the loop button - loop = - $('<div class="mejs-button mejs-skip-back-button">' + - '<button type="button" aria-controls="' + t.id + '" title="' + backText + '" aria-label="' + backText + '">' + t.options.skipBackInterval + '</button>' + - '</div>') - // append it to the toolbar - .appendTo(controls) - // add a click toggle event - .click(function() { - media.setCurrentTime(Math.max(media.currentTime - t.options.skipBackInterval, 0)); - $(this).find('button').blur(); - }); - } - }); - -})(mejs.$); - -/** - * Postroll plugin - */ -(function($) { - - $.extend(mejs.MepDefaults, { - postrollCloseText: mejs.i18n.t('Close') - }); - - // Postroll - $.extend(MediaElementPlayer.prototype, { - buildpostroll: function(player, controls, layers, media) { - var - t = this, - postrollLink = t.container.find('link[rel="postroll"]').attr('href'); - - if (typeof postrollLink !== 'undefined') { - player.postroll = - $('<div class="mejs-postroll-layer mejs-layer"><a class="mejs-postroll-close" onclick="$(this).parent().hide();return false;">' + t.options.postrollCloseText + '</a><div class="mejs-postroll-layer-content"></div></div>').prependTo(layers).hide(); - - t.media.addEventListener('ended', function (e) { - $.ajax({ - dataType: 'html', - url: postrollLink, - success: function (data, textStatus) { - layers.find('.mejs-postroll-layer-content').html(data); - } - }); - player.postroll.show(); - }, false); - } - } - }); - -})(mejs.$); \ No newline at end of file diff --git a/static/mediaelementjs/mediaelementplayer.min.css b/static/mediaelementjs/mediaelementplayer.min.css deleted file mode 100644 index fced6edc69c40853e20802b228cbd8a8eb5ca365..0000000000000000000000000000000000000000 --- a/static/mediaelementjs/mediaelementplayer.min.css +++ /dev/null @@ -1 +0,0 @@ -.mejs-offscreen{clip:rect(1px 1px 1px 1px);clip:rect(1px,1px,1px,1px);clip-path:polygon(0px 0,0 0,0 0,0 0);position:absolute!important;height:1px;width:1px;overflow:hidden}.mejs-container{position:relative;background:#000;font-family:Helvetica,Arial;text-align:left;vertical-align:top;text-indent:0}.mejs-fill-container,.mejs-fill-container .mejs-container{width:100%;height:100%}.mejs-fill-container{overflow:hidden}.mejs-container:focus{outline:0}.me-plugin{position:absolute}.mejs-embed,.mejs-embed body{width:100%;height:100%;margin:0;padding:0;background:#000;overflow:hidden}.mejs-fullscreen{overflow:hidden!important}.mejs-container-fullscreen{position:fixed;left:0;top:0;right:0;bottom:0;overflow:hidden;z-index:1000}.mejs-container-fullscreen .mejs-mediaelement,.mejs-container-fullscreen video{width:100%;height:100%}.mejs-clear{clear:both}.mejs-background{position:absolute;top:0;left:0}.mejs-mediaelement{position:absolute;top:0;left:0;width:100%;height:100%}.mejs-poster{position:absolute;top:0;left:0;background-size:contain;background-position:50% 50%;background-repeat:no-repeat}:root .mejs-poster img{display:none}.mejs-poster img{border:0;padding:0;border:0}.mejs-overlay{position:absolute;top:0;left:0}.mejs-overlay-play{cursor:pointer}.mejs-overlay-button{position:absolute;top:50%;left:50%;width:100px;height:100px;margin:-50px 0 0 -50px;background:url(bigplay.svg) no-repeat}.no-svg .mejs-overlay-button{background-image:url(bigplay.png)}.mejs-overlay:hover .mejs-overlay-button{background-position:0 -100px}.mejs-overlay-loading{position:absolute;top:50%;left:50%;width:80px;height:80px;margin:-40px 0 0 -40px;background:#333;background:url(background.png);background:rgba(0,0,0,.9);background:-webkit-gradient(linear,0 0,0 100%,from(rgba(50,50,50,.9)),to(rgba(0,0,0,.9)));background:-webkit-linear-gradient(top,rgba(50,50,50,.9),rgba(0,0,0,.9));background:-moz-linear-gradient(top,rgba(50,50,50,.9),rgba(0,0,0,.9));background:-o-linear-gradient(top,rgba(50,50,50,.9),rgba(0,0,0,.9));background:-ms-linear-gradient(top,rgba(50,50,50,.9),rgba(0,0,0,.9));background:linear-gradient(rgba(50,50,50,.9),rgba(0,0,0,.9))}.mejs-overlay-loading span{display:block;width:80px;height:80px;background:transparent url(loading.gif) 50% 50% no-repeat}.mejs-container .mejs-controls{position:absolute;list-style-type:none;margin:0;padding:0;bottom:0;left:0;background:url(background.png);background:rgba(0,0,0,.7);background:-webkit-gradient(linear,0 0,0 100%,from(rgba(50,50,50,.7)),to(rgba(0,0,0,.7)));background:-webkit-linear-gradient(top,rgba(50,50,50,.7),rgba(0,0,0,.7));background:-moz-linear-gradient(top,rgba(50,50,50,.7),rgba(0,0,0,.7));background:-o-linear-gradient(top,rgba(50,50,50,.7),rgba(0,0,0,.7));background:-ms-linear-gradient(top,rgba(50,50,50,.7),rgba(0,0,0,.7));background:linear-gradient(rgba(50,50,50,.7),rgba(0,0,0,.7));height:30px;width:100%}.mejs-container .mejs-controls div{list-style-type:none;background-image:none;display:block;float:left;margin:0;padding:0;width:26px;height:26px;font-size:11px;line-height:11px;font-family:Helvetica,Arial;border:0}.mejs-controls .mejs-button button{cursor:pointer;display:block;font-size:0;line-height:0;text-decoration:none;margin:7px 5px;padding:0;position:absolute;height:16px;width:16px;border:0;background:transparent url(controls.svg) no-repeat}.no-svg .mejs-controls .mejs-button button{background-image:url(controls.png)}.mejs-controls .mejs-button button:focus{outline:dotted 1px #999}.mejs-container .mejs-controls .mejs-time{color:#fff;display:block;height:17px;width:auto;padding:10px 3px 0;overflow:hidden;text-align:center;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}.mejs-container .mejs-controls .mejs-time a{color:#fff;font-size:11px;line-height:12px;display:block;float:left;margin:1px 2px 0 0;width:auto}.mejs-controls .mejs-play button{background-position:0 0}.mejs-controls .mejs-pause button{background-position:0 -16px}.mejs-controls .mejs-stop button{background-position:-112px 0}.mejs-controls div.mejs-time-rail{direction:ltr;width:200px;padding-top:5px}.mejs-controls .mejs-time-rail span,.mejs-controls .mejs-time-rail a{display:block;position:absolute;width:180px;height:10px;-webkit-border-radius:2px;-moz-border-radius:2px;border-radius:2px;cursor:pointer}.mejs-controls .mejs-time-rail .mejs-time-total{margin:5px;background:#333;background:rgba(50,50,50,.8);background:-webkit-gradient(linear,0 0,0 100%,from(rgba(30,30,30,.8)),to(rgba(60,60,60,.8)));background:-webkit-linear-gradient(top,rgba(30,30,30,.8),rgba(60,60,60,.8));background:-moz-linear-gradient(top,rgba(30,30,30,.8),rgba(60,60,60,.8));background:-o-linear-gradient(top,rgba(30,30,30,.8),rgba(60,60,60,.8));background:-ms-linear-gradient(top,rgba(30,30,30,.8),rgba(60,60,60,.8));background:linear-gradient(rgba(30,30,30,.8),rgba(60,60,60,.8))}.mejs-controls .mejs-time-rail .mejs-time-buffering{width:100%;background-image:-o-linear-gradient(-45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(0.25,rgba(255,255,255,.15)),color-stop(0.25,transparent),color-stop(0.5,transparent),color-stop(0.5,rgba(255,255,255,.15)),color-stop(0.75,rgba(255,255,255,.15)),color-stop(0.75,transparent),to(transparent));background-image:-webkit-linear-gradient(-45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-moz-linear-gradient(-45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-ms-linear-gradient(-45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(-45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);-webkit-background-size:15px 15px;-moz-background-size:15px 15px;-o-background-size:15px 15px;background-size:15px 15px;-webkit-animation:buffering-stripes 2s linear infinite;-moz-animation:buffering-stripes 2s linear infinite;-ms-animation:buffering-stripes 2s linear infinite;-o-animation:buffering-stripes 2s linear infinite;animation:buffering-stripes 2s linear infinite}@-webkit-keyframes buffering-stripes{from{background-position:0 0}to{background-position:30px 0}}@-moz-keyframes buffering-stripes{from{background-position:0 0}to{background-position:30px 0}}@-ms-keyframes buffering-stripes{from{background-position:0 0}to{background-position:30px 0}}@-o-keyframes buffering-stripes{from{background-position:0 0}to{background-position:30px 0}}@keyframes buffering-stripes{from{background-position:0 0}to{background-position:30px 0}}.mejs-controls .mejs-time-rail .mejs-time-loaded{background:#3caac8;background:rgba(60,170,200,.8);background:-webkit-gradient(linear,0 0,0 100%,from(rgba(44,124,145,.8)),to(rgba(78,183,212,.8)));background:-webkit-linear-gradient(top,rgba(44,124,145,.8),rgba(78,183,212,.8));background:-moz-linear-gradient(top,rgba(44,124,145,.8),rgba(78,183,212,.8));background:-o-linear-gradient(top,rgba(44,124,145,.8),rgba(78,183,212,.8));background:-ms-linear-gradient(top,rgba(44,124,145,.8),rgba(78,183,212,.8));background:linear-gradient(rgba(44,124,145,.8),rgba(78,183,212,.8));width:0}.mejs-controls .mejs-time-rail .mejs-time-current{background:#fff;background:rgba(255,255,255,.8);background:-webkit-gradient(linear,0 0,0 100%,from(rgba(255,255,255,.9)),to(rgba(200,200,200,.8)));background:-webkit-linear-gradient(top,rgba(255,255,255,.9),rgba(200,200,200,.8));background:-moz-linear-gradient(top,rgba(255,255,255,.9),rgba(200,200,200,.8));background:-o-linear-gradient(top,rgba(255,255,255,.9),rgba(200,200,200,.8));background:-ms-linear-gradient(top,rgba(255,255,255,.9),rgba(200,200,200,.8));background:linear-gradient(rgba(255,255,255,.9),rgba(200,200,200,.8));width:0}.mejs-controls .mejs-time-rail .mejs-time-handle{display:none;position:absolute;margin:0;width:10px;background:#fff;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;cursor:pointer;border:solid 2px #333;top:-2px;text-align:center}.mejs-controls .mejs-time-rail .mejs-time-float{position:absolute;display:none;background:#eee;width:36px;height:17px;border:solid 1px #333;top:-26px;margin-left:-18px;text-align:center;color:#111}.mejs-controls .mejs-time-rail .mejs-time-float-current{margin:2px;width:30px;display:block;text-align:center;left:0}.mejs-controls .mejs-time-rail .mejs-time-float-corner{position:absolute;display:block;width:0;height:0;line-height:0;border:solid 5px #eee;border-color:#eee transparent transparent;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;top:15px;left:13px}.mejs-long-video .mejs-controls .mejs-time-rail .mejs-time-float{width:48px}.mejs-long-video .mejs-controls .mejs-time-rail .mejs-time-float-current{width:44px}.mejs-long-video .mejs-controls .mejs-time-rail .mejs-time-float-corner{left:18px}.mejs-controls .mejs-fullscreen-button button{background-position:-32px 0}.mejs-controls .mejs-unfullscreen button{background-position:-32px -16px}.mejs-controls .mejs-volume-button{}.mejs-controls .mejs-mute button{background-position:-16px -16px}.mejs-controls .mejs-unmute button{background-position:-16px 0}.mejs-controls .mejs-volume-button{position:relative}.mejs-controls .mejs-volume-button .mejs-volume-slider{display:none;height:115px;width:25px;background:url(background.png);background:rgba(50,50,50,.7);-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;top:-115px;left:0;z-index:1;position:absolute;margin:0}.mejs-controls .mejs-volume-button:hover{-webkit-border-radius:0 0 4px 4px;-moz-border-radius:0 0 4px 4px;border-radius:0 0 4px 4px}.mejs-controls .mejs-volume-button .mejs-volume-slider .mejs-volume-total{position:absolute;left:11px;top:8px;width:2px;height:100px;background:#ddd;background:rgba(255,255,255,.5);margin:0}.mejs-controls .mejs-volume-button .mejs-volume-slider .mejs-volume-current{position:absolute;left:11px;top:8px;width:2px;height:100px;background:#ddd;background:rgba(255,255,255,.9);margin:0}.mejs-controls .mejs-volume-button .mejs-volume-slider .mejs-volume-handle{position:absolute;left:4px;top:-3px;width:16px;height:6px;background:#ddd;background:rgba(255,255,255,.9);cursor:N-resize;-webkit-border-radius:1px;-moz-border-radius:1px;border-radius:1px;margin:0}.mejs-controls a.mejs-horizontal-volume-slider{height:26px;width:56px;position:relative;display:block;float:left;vertical-align:middle}.mejs-controls .mejs-horizontal-volume-slider .mejs-horizontal-volume-total{position:absolute;left:0;top:11px;width:50px;height:8px;margin:0;padding:0;font-size:1px;-webkit-border-radius:2px;-moz-border-radius:2px;border-radius:2px;background:#333;background:rgba(50,50,50,.8);background:-webkit-gradient(linear,0 0,0 100%,from(rgba(30,30,30,.8)),to(rgba(60,60,60,.8)));background:-webkit-linear-gradient(top,rgba(30,30,30,.8),rgba(60,60,60,.8));background:-moz-linear-gradient(top,rgba(30,30,30,.8),rgba(60,60,60,.8));background:-o-linear-gradient(top,rgba(30,30,30,.8),rgba(60,60,60,.8));background:-ms-linear-gradient(top,rgba(30,30,30,.8),rgba(60,60,60,.8));background:linear-gradient(rgba(30,30,30,.8),rgba(60,60,60,.8))}.mejs-controls .mejs-horizontal-volume-slider .mejs-horizontal-volume-current{position:absolute;left:0;top:11px;width:50px;height:8px;margin:0;padding:0;font-size:1px;-webkit-border-radius:2px;-moz-border-radius:2px;border-radius:2px;background:#fff;background:rgba(255,255,255,.8);background:-webkit-gradient(linear,0 0,0 100%,from(rgba(255,255,255,.9)),to(rgba(200,200,200,.8)));background:-webkit-linear-gradient(top,rgba(255,255,255,.9),rgba(200,200,200,.8));background:-moz-linear-gradient(top,rgba(255,255,255,.9),rgba(200,200,200,.8));background:-o-linear-gradient(top,rgba(255,255,255,.9),rgba(200,200,200,.8));background:-ms-linear-gradient(top,rgba(255,255,255,.9),rgba(200,200,200,.8));background:linear-gradient(rgba(255,255,255,.9),rgba(200,200,200,.8))}.mejs-controls .mejs-horizontal-volume-slider .mejs-horizontal-volume-handle{display:none}.mejs-controls .mejs-captions-button{position:relative}.mejs-controls .mejs-captions-button button{background-position:-48px 0}.mejs-controls .mejs-captions-button .mejs-captions-selector{visibility:hidden;position:absolute;bottom:26px;right:-51px;width:85px;height:100px;background:url(background.png);background:rgba(50,50,50,.7);border:solid 1px transparent;padding:10px 10px 0;overflow:hidden;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.mejs-controls .mejs-captions-button:hover .mejs-captions-selector{visibility:visible}.mejs-controls .mejs-captions-button .mejs-captions-selector ul{margin:0;padding:0;display:block;list-style-type:none!important;overflow:hidden}.mejs-controls .mejs-captions-button .mejs-captions-selector ul li{margin:0 0 6px;padding:0;list-style-type:none!important;display:block;color:#fff;overflow:hidden}.mejs-controls .mejs-captions-button .mejs-captions-selector ul li input{clear:both;float:left;margin:3px 3px 0 5px}.mejs-controls .mejs-captions-button .mejs-captions-selector ul li label{width:55px;float:left;padding:4px 0 0;line-height:15px;font-family:helvetica,arial;font-size:10px}.mejs-controls .mejs-captions-button .mejs-captions-translations{font-size:10px;margin:0 0 5px}.mejs-chapters{position:absolute;top:0;left:0;-xborder-right:solid 1px #fff;width:10000px;z-index:1}.mejs-chapters .mejs-chapter{position:absolute;float:left;background:#222;background:rgba(0,0,0,.7);background:-webkit-gradient(linear,0 0,0 100%,from(rgba(50,50,50,.7)),to(rgba(0,0,0,.7)));background:-webkit-linear-gradient(top,rgba(50,50,50,.7),rgba(0,0,0,.7));background:-moz-linear-gradient(top,rgba(50,50,50,.7),rgba(0,0,0,.7));background:-o-linear-gradient(top,rgba(50,50,50,.7),rgba(0,0,0,.7));background:-ms-linear-gradient(top,rgba(50,50,50,.7),rgba(0,0,0,.7));background:linear-gradient(rgba(50,50,50,.7),rgba(0,0,0,.7));filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=0, startColorstr=#323232, endColorstr=#000000);overflow:hidden;border:0}.mejs-chapters .mejs-chapter .mejs-chapter-block{font-size:11px;color:#fff;padding:5px;display:block;border-right:solid 1px #333;border-bottom:solid 1px #333;cursor:pointer}.mejs-chapters .mejs-chapter .mejs-chapter-block-last{border-right:0}.mejs-chapters .mejs-chapter .mejs-chapter-block:hover{background:#666;background:rgba(102,102,102,.7);background:-webkit-gradient(linear,0 0,0 100%,from(rgba(102,102,102,.7)),to(rgba(50,50,50,.6)));background:-webkit-linear-gradient(top,rgba(102,102,102,.7),rgba(50,50,50,.6));background:-moz-linear-gradient(top,rgba(102,102,102,.7),rgba(50,50,50,.6));background:-o-linear-gradient(top,rgba(102,102,102,.7),rgba(50,50,50,.6));background:-ms-linear-gradient(top,rgba(102,102,102,.7),rgba(50,50,50,.6));background:linear-gradient(rgba(102,102,102,.7),rgba(50,50,50,.6));filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=0, startColorstr=#666666, endColorstr=#323232)}.mejs-chapters .mejs-chapter .mejs-chapter-block .ch-title{font-size:12px;font-weight:700;display:block;white-space:nowrap;text-overflow:ellipsis;margin:0 0 3px;line-height:12px}.mejs-chapters .mejs-chapter .mejs-chapter-block .ch-timespan{font-size:12px;line-height:12px;margin:3px 0 4px;display:block;white-space:nowrap;text-overflow:ellipsis}.mejs-captions-layer{position:absolute;bottom:0;left:0;text-align:center;line-height:20px;font-size:16px;color:#fff}.mejs-captions-layer a{color:#fff;text-decoration:underline}.mejs-captions-layer[lang=ar]{font-size:20px;font-weight:400}.mejs-captions-position{position:absolute;width:100%;bottom:15px;left:0}.mejs-captions-position-hover{bottom:35px}.mejs-captions-text{padding:3px 5px;background:url(background.png);background:rgba(20,20,20,.5);white-space:pre-wrap}.me-cannotplay{}.me-cannotplay a{color:#fff;font-weight:700}.me-cannotplay span{padding:15px;display:block}.mejs-controls .mejs-loop-off button{background-position:-64px -16px}.mejs-controls .mejs-loop-on button{background-position:-64px 0}.mejs-controls .mejs-backlight-off button{background-position:-80px -16px}.mejs-controls .mejs-backlight-on button{background-position:-80px 0}.mejs-controls .mejs-picturecontrols-button{background-position:-96px 0}.mejs-contextmenu{position:absolute;width:150px;padding:10px;border-radius:4px;top:0;left:0;background:#fff;border:solid 1px #999;z-index:1001}.mejs-contextmenu .mejs-contextmenu-separator{height:1px;font-size:0;margin:5px 6px;background:#333}.mejs-contextmenu .mejs-contextmenu-item{font-family:Helvetica,Arial;font-size:12px;padding:4px 6px;cursor:pointer;color:#333}.mejs-contextmenu .mejs-contextmenu-item:hover{background:#2C7C91;color:#fff}.mejs-controls .mejs-sourcechooser-button{position:relative}.mejs-controls .mejs-sourcechooser-button button{background-position:-128px 0}.mejs-controls .mejs-sourcechooser-button .mejs-sourcechooser-selector{visibility:hidden;position:absolute;bottom:26px;right:-10px;width:130px;height:100px;background:url(background.png);background:rgba(50,50,50,.7);border:solid 1px transparent;padding:10px;overflow:hidden;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.mejs-controls .mejs-sourcechooser-button .mejs-sourcechooser-selector ul{margin:0;padding:0;display:block;list-style-type:none!important;overflow:hidden}.mejs-controls .mejs-sourcechooser-button .mejs-sourcechooser-selector ul li{margin:0 0 6px;padding:0;list-style-type:none!important;display:block;color:#fff;overflow:hidden}.mejs-controls .mejs-sourcechooser-button .mejs-sourcechooser-selector ul li input{clear:both;float:left;margin:3px 3px 0 5px}.mejs-controls .mejs-sourcechooser-button .mejs-sourcechooser-selector ul li label{width:100px;float:left;padding:4px 0 0;line-height:15px;font-family:helvetica,arial;font-size:10px}.mejs-postroll-layer{position:absolute;bottom:0;left:0;width:100%;height:100%;background:url(background.png);background:rgba(50,50,50,.7);z-index:1000;overflow:hidden}.mejs-postroll-layer-content{width:100%;height:100%}.mejs-postroll-close{position:absolute;right:0;top:0;background:url(background.png);background:rgba(50,50,50,.7);color:#fff;padding:4px;z-index:100;cursor:pointer}div.mejs-speed-button{width:46px!important;position:relative}.mejs-controls .mejs-button.mejs-speed-button button{background:transparent;width:36px;font-size:11px;line-height:normal;color:#fff}.mejs-controls .mejs-speed-button .mejs-speed-selector{display:none;position:absolute;top:-100px;left:-10px;width:60px;height:100px;background:url(background.png);background:rgba(50,50,50,.7);border:solid 1px transparent;padding:0;overflow:hidden;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.mejs-controls .mejs-speed-button:hover>.mejs-speed-selector{display:block}.mejs-controls .mejs-speed-button .mejs-speed-selector ul li label.mejs-speed-selected{color:rgba(33,248,248,1)}.mejs-controls .mejs-speed-button .mejs-speed-selector ul{margin:0;padding:0;display:block;list-style-type:none!important;overflow:hidden}.mejs-controls .mejs-speed-button .mejs-speed-selector ul li{margin:0 0 6px;padding:0 10px;list-style-type:none!important;display:block;color:#fff;overflow:hidden}.mejs-controls .mejs-speed-button .mejs-speed-selector ul li input{clear:both;float:left;margin:3px 3px 0 5px;display:none}.mejs-controls .mejs-speed-button .mejs-speed-selector ul li label{width:60px;float:left;padding:4px 0 0;line-height:15px;font-family:helvetica,arial;font-size:11.5px;color:#fff;margin-left:5px;cursor:pointer}.mejs-controls .mejs-speed-button .mejs-speed-selector ul li:hover{background-color:#c8c8c8!important;background-color:rgba(255,255,255,.4)!important}.mejs-controls .mejs-button.mejs-jump-forward-button{background:transparent url(jumpforward.png) no-repeat;background-position:3px 3px}.mejs-controls .mejs-button.mejs-jump-forward-button button{background:transparent;font-size:9px;line-height:normal;color:#fff}.mejs-controls .mejs-button.mejs-skip-back-button{background:transparent url(skipback.png) no-repeat;background-position:3px 3px}.mejs-controls .mejs-button.mejs-skip-back-button button{background:transparent;font-size:9px;line-height:normal;color:#fff} \ No newline at end of file diff --git a/static/mediaelementjs/mediaelementplayer.min.js b/static/mediaelementjs/mediaelementplayer.min.js deleted file mode 100644 index 9723969ab35b683db21928317b6b3412cd4492ff..0000000000000000000000000000000000000000 --- a/static/mediaelementjs/mediaelementplayer.min.js +++ /dev/null @@ -1,14 +0,0 @@ -/*! - * - * MediaElementPlayer - * http://mediaelementjs.com/ - * - * Creates a controller bar for HTML5 <video> add <audio> tags - * using jQuery and MediaElement.js (HTML5 Flash/Silverlight wrapper) - * - * Copyright 2010-2013, John Dyer (http://j.hn/) - * License: MIT - * - */ -"undefined"!=typeof jQuery?mejs.$=jQuery:"undefined"!=typeof Zepto?(mejs.$=Zepto,Zepto.fn.outerWidth=function(a){var b=$(this).width();return a&&(b+=parseInt($(this).css("margin-right"),10),b+=parseInt($(this).css("margin-left"),10)),b}):"undefined"!=typeof ender&&(mejs.$=ender),function(a){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"],isVideo:!0,stretching:"auto",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());var c=Math.min(b.volume+.1,1);b.setVolume(c)}},{keys:[40],action:function(a,b){a.container.find(".mejs-volume-slider").css("display","block"),a.isVideo&&(a.showControls(),a.startControlsTimer());var c=Math.max(b.volume-.1,0);b.setVolume(c)}},{keys:[37,227],action:function(a,b){if(!isNaN(b.duration)&&b.duration>0){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)&&b.duration>0){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(b,c){if(!(this instanceof mejs.MediaElementPlayer))return new mejs.MediaElementPlayer(b,c);var d=this;return d.$media=d.$node=a(b),d.node=d.media=d.$media[0],d.node?"undefined"!=typeof d.node.player?d.node.player:("undefined"==typeof c&&(c=d.$node.data("mejsoptions")),d.options=a.extend({},mejs.MepDefaults,c),d.options.timeFormat||(d.options.timeFormat="mm:ss",d.options.alwaysShowHours&&(d.options.timeFormat="hh:mm:ss"),d.options.showTimecodeFrameCount&&(d.options.timeFormat+=":ff")),mejs.Utility.calculateTimeFormat(0,d.options,d.options.framesPerSecond||25),d.id="mep_"+mejs.mepIndex++,mejs.players[d.id]=d,d.init(),d):void 0},mejs.MediaElementPlayer.prototype={hasFocus:!1,controlsAreVisible:!0,init:function(){var b=this,c=mejs.MediaFeatures,d=a.extend(!0,{},b.options,{success:function(a,c){b.meReady(a,c)},error:function(a){b.handleError(a)}}),e=b.media.tagName.toLowerCase();if(b.isDynamic="audio"!==e&&"video"!==e,b.isDynamic?b.isVideo=b.options.isVideo:b.isVideo="audio"!==e&&b.options.isVideo,c.isiPad&&b.options.iPadUseNativeControls||c.isiPhone&&b.options.iPhoneUseNativeControls)b.$media.attr("controls","controls"),c.isiPad&&null!==b.media.getAttribute("autoplay")&&b.play();else if(c.isAndroid&&b.options.AndroidUseNativeControls);else{b.$media.removeAttr("controls");var f=b.isVideo?mejs.i18n.t("Video Player"):mejs.i18n.t("Audio Player");a('<span class="mejs-offscreen">'+f+"</span>").insertBefore(b.$media),b.container=a('<div id="'+b.id+'" class="mejs-container '+(mejs.MediaFeatures.svgAsImg?"svg":"no-svg")+'" tabindex="0" role="application" aria-label="'+f+'"><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(b.$media[0].className).insertBefore(b.$media).focus(function(a){if(!b.controlsAreVisible&&!b.hasFocus&&(b.showControls(!0),!b.hasMsNativeFullScreen)){var c=b.container.find(".mejs-playpause-button > button");c.focus()}}),"fill"!==b.options.stretching||b.container.parent("mejs-fill-container").length||(b.outerContainer=b.$media.parent(),b.container.wrap('<div class="mejs-fill-container"/>')),b.container.addClass((c.isAndroid?"mejs-android ":"")+(c.isiOS?"mejs-ios ":"")+(c.isiPad?"mejs-ipad ":"")+(c.isiPhone?"mejs-iphone ":"")+(b.isVideo?"mejs-video ":"mejs-audio ")),b.container.find(".mejs-mediaelement").append(b.$media),b.node.player=b,b.controls=b.container.find(".mejs-controls"),b.layers=b.container.find(".mejs-layers");var g=b.isVideo?"video":"audio",h=g.substring(0,1).toUpperCase()+g.substring(1);b.options[g+"Width"]>0||b.options[g+"Width"].toString().indexOf("%")>-1?b.width=b.options[g+"Width"]:""!==b.media.style.width&&null!==b.media.style.width?b.width=b.media.style.width:null!==b.media.getAttribute("width")?b.width=b.$media.attr("width"):b.width=b.options["default"+h+"Width"],b.options[g+"Height"]>0||b.options[g+"Height"].toString().indexOf("%")>-1?b.height=b.options[g+"Height"]:""!==b.media.style.height&&null!==b.media.style.height?b.height=b.media.style.height:null!==b.$media[0].getAttribute("height")?b.height=b.$media.attr("height"):b.height=b.options["default"+h+"Height"],b.setPlayerSize(b.width,b.height),d.pluginWidth=b.width,d.pluginHeight=b.height}mejs.MediaElement(b.$media[0],d),"undefined"!=typeof b.container&&b.controlsAreVisible&&b.container.trigger("controlsshown")},showControls:function(a){var b=this;a="undefined"==typeof a||a,b.controlsAreVisible||(a?(b.controls.removeClass("mejs-offscreen").stop(!0,!0).fadeIn(200,function(){b.controlsAreVisible=!0,b.container.trigger("controlsshown")}),b.container.find(".mejs-control").removeClass("mejs-offscreen").stop(!0,!0).fadeIn(200,function(){b.controlsAreVisible=!0})):(b.controls.removeClass("mejs-offscreen").css("display","block"),b.container.find(".mejs-control").removeClass("mejs-offscreen").css("display","block"),b.controlsAreVisible=!0,b.container.trigger("controlsshown")),b.setControlsSize())},hideControls:function(b){var c=this;b="undefined"==typeof b||b,!c.controlsAreVisible||c.options.alwaysShowControls||c.keyboardAction||(b?(c.controls.stop(!0,!0).fadeOut(200,function(){a(this).addClass("mejs-offscreen").css("display","block"),c.controlsAreVisible=!1,c.container.trigger("controlshidden")}),c.container.find(".mejs-control").stop(!0,!0).fadeOut(200,function(){a(this).addClass("mejs-offscreen").css("display","block")})):(c.controls.addClass("mejs-offscreen").css("display","block"),c.container.find(".mejs-control").addClass("mejs-offscreen").css("display","block"),c.controlsAreVisible=!1,c.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){var b=this;null!==b.controlsTimer&&(clearTimeout(b.controlsTimer),delete b.controlsTimer,b.controlsTimer=null)},controlsEnabled:!0,disableControls:function(){var a=this;a.killControlsTimer(),a.hideControls(!1),this.controlsEnabled=!1},enableControls:function(){var a=this;a.showControls(!1),a.controlsEnabled=!0},meReady:function(b,c){var d,e,f=this,g=mejs.MediaFeatures,h=c.getAttribute("autoplay"),i=!("undefined"==typeof h||null===h||"false"===h);if(!f.created){if(f.created=!0,f.media=b,f.domNode=c,!(g.isAndroid&&f.options.AndroidUseNativeControls||g.isiPad&&f.options.iPadUseNativeControls||g.isiPhone&&f.options.iPhoneUseNativeControls)){f.buildposter(f,f.controls,f.layers,f.media),f.buildkeyboard(f,f.controls,f.layers,f.media),f.buildoverlays(f,f.controls,f.layers,f.media),f.findTracks();for(d in f.options.features)if(e=f.options.features[d],f["build"+e])try{f["build"+e](f,f.controls,f.layers,f.media)}catch(j){}f.container.trigger("controlsready"),f.setPlayerSize(f.width,f.height),f.setControlsSize(),f.isVideo&&(mejs.MediaFeatures.hasTouch?f.$media.bind("touchstart",function(){f.controlsAreVisible?f.hideControls(!1):f.controlsEnabled&&f.showControls(!1)}):(f.clickToPlayPauseCallback=function(){f.options.clickToPlayPause&&(f.media.paused?f.play():f.pause())},f.media.addEventListener("click",f.clickToPlayPauseCallback,!1),f.container.bind("mouseenter",function(){f.controlsEnabled&&(f.options.alwaysShowControls||(f.killControlsTimer("enter"),f.showControls(),f.startControlsTimer(2500)))}).bind("mousemove",function(){f.controlsEnabled&&(f.controlsAreVisible||f.showControls(),f.options.alwaysShowControls||f.startControlsTimer(2500))}).bind("mouseleave",function(){f.controlsEnabled&&(f.media.paused||f.options.alwaysShowControls||f.startControlsTimer(1e3))})),f.options.hideVideoControlsOnLoad&&f.hideControls(!1),i&&!f.options.alwaysShowControls&&f.hideControls(),f.options.enableAutosize&&f.media.addEventListener("loadedmetadata",function(a){f.options.videoHeight<=0&&null===f.domNode.getAttribute("height")&&!isNaN(a.target.videoHeight)&&(f.setPlayerSize(a.target.videoWidth,a.target.videoHeight),f.setControlsSize(),f.media.setVideoSize(a.target.videoWidth,a.target.videoHeight))},!1)),f.media.addEventListener("play",function(){var a;for(a in mejs.players){var b=mejs.players[a];b.id==f.id||!f.options.pauseOtherPlayers||b.paused||b.ended||b.pause(),b.hasFocus=!1}f.hasFocus=!0},!1),f.media.addEventListener("ended",function(b){if(f.options.autoRewind)try{f.media.setCurrentTime(0),window.setTimeout(function(){a(f.container).find(".mejs-overlay-loading").parent().hide()},20)}catch(c){}f.media.pause(),f.setProgressRail&&f.setProgressRail(),f.setCurrentRail&&f.setCurrentRail(),f.options.loop?f.play():!f.options.alwaysShowControls&&f.controlsEnabled&&f.showControls()},!1),f.media.addEventListener("loadedmetadata",function(a){f.updateDuration&&f.updateDuration(),f.updateCurrent&&f.updateCurrent(),f.isFullScreen||(f.setPlayerSize(f.width,f.height),f.setControlsSize())},!1);var k=null;f.media.addEventListener("timeupdate",function(){k!==this.duration&&(k=this.duration,mejs.Utility.calculateTimeFormat(k,f.options,f.options.framesPerSecond||25),f.updateDuration&&f.updateDuration(),f.updateCurrent&&f.updateCurrent(),f.setControlsSize())},!1),f.container.focusout(function(b){if(b.relatedTarget){var c=a(b.relatedTarget);f.keyboardAction&&0===c.parents(".mejs-container").length&&(f.keyboardAction=!1,f.hideControls(!0))}}),setTimeout(function(){f.setPlayerSize(f.width,f.height),f.setControlsSize()},50),f.globalBind("resize",function(){f.isFullScreen||mejs.MediaFeatures.hasTrueNativeFullScreen&&document.webkitIsFullScreen||f.setPlayerSize(f.width,f.height),f.setControlsSize()}),"youtube"==f.media.pluginType&&(g.isiOS||g.isAndroid)&&(f.container.find(".mejs-overlay-play").hide(),f.container.find(".mejs-poster").hide())}i&&"native"==b.pluginType&&f.play(),f.options.success&&("string"==typeof f.options.success?window[f.options.success](f.media,f.domNode,f):f.options.success(f.media,f.domNode,f))}},handleError:function(a){var b=this;b.controls&&b.controls.hide(),b.options.error&&b.options.error(a)},setPlayerSize:function(a,b){var c=this;if(!c.options.setDimensions)return!1;switch("undefined"!=typeof a&&(c.width=a),"undefined"!=typeof b&&(c.height=b),c.options.stretching){case"fill":c.isVideo?this.setFillMode():this.setDimensions(c.width,c.height);break;case"responsive":this.setResponsiveMode();break;case"none":this.setDimensions(c.width,c.height);break;default:this.hasFluidMode()===!0?this.setResponsiveMode():this.setDimensions(c.width,c.height)}},hasFluidMode:function(){var a=this;return a.height.toString().indexOf("%")>0||"none"!==a.$node.css("max-width")&&"t.width"!==a.$node.css("max-width")||a.$node[0].currentStyle&&"100%"===a.$node[0].currentStyle.maxWidth},setResponsiveMode:function(){var b=this,c=function(){return b.isVideo?b.media.videoWidth&&b.media.videoWidth>0?b.media.videoWidth:null!==b.media.getAttribute("width")?b.media.getAttribute("width"):b.options.defaultVideoWidth:b.options.defaultAudioWidth}(),d=function(){return b.isVideo?b.media.videoHeight&&b.media.videoHeight>0?b.media.videoHeight:null!==b.media.getAttribute("height")?b.media.getAttribute("height"):b.options.defaultVideoHeight:b.options.defaultAudioHeight}(),e=b.container.parent().closest(":visible").width(),f=b.container.parent().closest(":visible").height(),g=b.isVideo||!b.options.autosizeProgress?parseInt(e*d/c,10):d;(isNaN(g)||0!==f&&g>f&&f>d)&&(g=f),b.container.parent().length>0&&"body"===b.container.parent()[0].tagName.toLowerCase()&&(e=a(window).width(),g=a(window).height()),g&&e&&(b.container.width(e).height(g),b.$media.add(b.container.find(".mejs-shim")).width("100%").height("100%"),b.isVideo&&b.media.setVideoSize&&b.media.setVideoSize(e,g),b.layers.children(".mejs-layer").width("100%").height("100%"))},setFillMode:function(){var a=this,b=a.outerContainer;b.width()||b.height(a.$media.width()),b.height()||b.height(a.$media.height());var c=b.width(),d=b.height();a.setDimensions("100%","100%"),a.container.find(".mejs-poster img").css("display","block"),targetElement=a.container.find("object, embed, iframe, video");var e=a.height,f=a.width,g=c,h=e*c/f,i=f*d/e,j=d,k=!(i>c),l=k?Math.floor(g):Math.floor(i),m=k?Math.floor(h):Math.floor(j);k?(targetElement.height(m).width(c),a.media.setVideoSize&&a.media.setVideoSize(c,m)):(targetElement.height(d).width(l),a.media.setVideoSize&&a.media.setVideoSize(l,d)),targetElement.css({"margin-left":Math.floor((c-l)/2),"margin-top":0})},setDimensions:function(a,b){var c=this;c.container.width(a).height(b),c.layers.children(".mejs-layer").width(a).height(b)},setControlsSize:function(){var b=this,c=0,d=0,e=b.controls.find(".mejs-time-rail"),f=b.controls.find(".mejs-time-total"),g=e.siblings(),h=g.last(),i=null;if(b.container.is(":visible")&&e.length&&e.is(":visible")){b.options&&!b.options.autosizeProgress&&(d=parseInt(e.css("width"),10)),0!==d&&d||(g.each(function(){var b=a(this);"absolute"!=b.css("position")&&b.is(":visible")&&(c+=a(this).outerWidth(!0))}),d=b.controls.width()-c-(e.outerWidth(!0)-e.width()));do e.width(d),f.width(d-(f.outerWidth(!0)-f.width())),"absolute"!=h.css("position")&&(i=h.length?h.position():null,d--);while(null!==i&&i.top.toFixed(2)>0&&d>0);b.container.trigger("controlsresize")}},buildposter:function(b,c,d,e){var f=this,g=a('<div class="mejs-poster mejs-layer"></div>').appendTo(d),h=b.$media.attr("poster");""!==b.options.poster&&(h=b.options.poster),h?f.setPoster(h):g.hide(),e.addEventListener("play",function(){g.hide()},!1),b.options.showPosterWhenEnded&&b.options.autoRewind&&e.addEventListener("ended",function(){g.show()},!1)},setPoster:function(b){var c=this,d=c.container.find(".mejs-poster"),e=d.find("img");0===e.length&&(e=a('<img width="100%" height="100%" alt="" />').appendTo(d)),e.attr("src",b),d.css({"background-image":"url("+b+")"})},buildoverlays:function(b,c,d,e){var f=this;if(b.isVideo){var g=a('<div class="mejs-overlay mejs-layer"><div class="mejs-overlay-loading"><span></span></div></div>').hide().appendTo(d),h=a('<div class="mejs-overlay mejs-layer"><div class="mejs-overlay-error"></div></div>').hide().appendTo(d),i=a('<div class="mejs-overlay mejs-layer mejs-overlay-play"><div class="mejs-overlay-button"></div></div>').appendTo(d).bind("click",function(){f.options.clickToPlayPause&&e.paused&&e.play()});e.addEventListener("play",function(){i.hide(),g.hide(),c.find(".mejs-time-buffering").hide(),h.hide()},!1),e.addEventListener("playing",function(){i.hide(),g.hide(),c.find(".mejs-time-buffering").hide(),h.hide()},!1),e.addEventListener("seeking",function(){g.show(),c.find(".mejs-time-buffering").show()},!1),e.addEventListener("seeked",function(){g.hide(),c.find(".mejs-time-buffering").hide()},!1),e.addEventListener("pause",function(){mejs.MediaFeatures.isiPhone||i.show()},!1),e.addEventListener("waiting",function(){g.show(),c.find(".mejs-time-buffering").show()},!1),e.addEventListener("loadeddata",function(){g.show(),c.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(),c.find(".mejs-time-buffering").hide(),clearTimeout(e.canplayTimeout)},!1),e.addEventListener("error",function(a){f.handleError(a),g.hide(),i.hide(),h.show(),h.find(".mejs-overlay-error").html("Error loading this resource")},!1),e.addEventListener("keydown",function(a){f.onkeydown(b,e,a)},!1)}},buildkeyboard:function(b,c,d,e){var f=this;f.container.keydown(function(){f.keyboardAction=!0}),f.globalBind("keydown",function(c){return b.hasFocus=0!==a(c.target).closest(".mejs-container").length&&a(c.target).closest(".mejs-container").attr("id")===b.$media.closest(".mejs-container").attr("id"),f.onkeydown(b,e,c)}),f.globalBind("click",function(c){b.hasFocus=0!==a(c.target).closest(".mejs-container").length})},onkeydown:function(a,b,c){if(a.hasFocus&&a.options.enableKeyboard)for(var d=0,e=a.options.keyActions.length;e>d;d++)for(var f=a.options.keyActions[d],g=0,h=f.keys.length;h>g;g++)if(c.keyCode==f.keys[g])return"function"==typeof c.preventDefault&&c.preventDefault(),f.action(a,b,c.keyCode,c),!1;return!0},findTracks:function(){var b=this,c=b.$media.find("track");b.tracks=[],c.each(function(c,d){d=a(d),b.tracks.push({srclang:d.attr("srclang")?d.attr("srclang").toLowerCase():"",src:d.attr("src"),kind:d.attr("kind"),label:d.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,c=this;c.container.prev(".mejs-offscreen").remove();for(a in c.options.features)if(b=c.options.features[a],c["clean"+b])try{c["clean"+b](c)}catch(d){}c.isDynamic?c.$node.insertBefore(c.container):(c.$media.prop("controls",!0),c.$node.clone().insertBefore(c.container).show(),c.$node.remove()),"native"!==c.media.pluginType&&c.media.remove(),delete mejs.players[c.id],"object"==typeof c.container&&c.container.remove(),c.globalUnbind(),delete c.node.player},rebuildtracks:function(){var a=this;a.findTracks(),a.buildtracks(a,a.controls,a.layers,a.media)},resetSize:function(){var a=this;setTimeout(function(){a.setPlayerSize(a.width,a.height),a.setControlsSize()},50)}},function(){function b(b,d){var e={d:[],w:[]};return a.each((b||"").split(" "),function(a,b){var f=b+"."+d;0===f.indexOf(".")?(e.d.push(f),e.w.push(f)):e[c.test(b)?"w":"d"].push(f)}),e.d=e.d.join(" "),e.w=e.w.join(" "),e}var c=/^((after|before)print|(before)?unload|hashchange|message|o(ff|n)line|page(hide|show)|popstate|resize|storage)\b/;mejs.MediaElementPlayer.prototype.globalBind=function(c,d,e){var f=this,g=f.node?f.node.ownerDocument:document;c=b(c,f.id),c.d&&a(g).bind(c.d,d,e),c.w&&a(window).bind(c.w,d,e)},mejs.MediaElementPlayer.prototype.globalUnbind=function(c,d){var e=this,f=e.node?e.node.ownerDocument:document;c=b(c,e.id),c.d&&a(f).unbind(c.d,d),c.w&&a(window).unbind(c.w,d)}}(),"undefined"!=typeof a&&(a.fn.mediaelementplayer=function(b){return b===!1?this.each(function(){var b=a(this).data("mediaelementplayer");b&&b.remove(),a(this).removeData("mediaelementplayer")}):this.each(function(){a(this).data("mediaelementplayer",new mejs.MediaElementPlayer(this,b))}),this},a(document).ready(function(){a(".mejs-player").mediaelementplayer()})),window.MediaElementPlayer=mejs.MediaElementPlayer}(mejs.$),function(a){a.extend(mejs.MepDefaults,{playText:mejs.i18n.t("Play"),pauseText:mejs.i18n.t("Pause")}),a.extend(MediaElementPlayer.prototype,{buildplaypause:function(b,c,d,e){function f(a){"play"===a?(i.removeClass("mejs-play").addClass("mejs-pause"),j.attr({title:h.pauseText,"aria-label":h.pauseText})):(i.removeClass("mejs-pause").addClass("mejs-play"),j.attr({title:h.playText,"aria-label":h.playText}))}var g=this,h=g.options,i=a('<div class="mejs-button mejs-playpause-button mejs-play" ><button type="button" aria-controls="'+g.id+'" title="'+h.playText+'" aria-label="'+h.playText+'"></button></div>').appendTo(c).click(function(a){return a.preventDefault(),e.paused?e.play():e.pause(),!1}),j=i.find("button");f("pse"),e.addEventListener("play",function(){f("play")},!1),e.addEventListener("playing",function(){f("play")},!1),e.addEventListener("pause",function(){f("pse")},!1),e.addEventListener("paused",function(){f("pse")},!1)}})}(mejs.$),function(a){a.extend(mejs.MepDefaults,{stopText:"Stop"}),a.extend(MediaElementPlayer.prototype,{buildstop:function(b,c,d,e){var f=this;a('<div class="mejs-button mejs-stop-button mejs-stop"><button type="button" aria-controls="'+f.id+'" title="'+f.options.stopText+'" aria-label="'+f.options.stopText+'"></button></div>').appendTo(c).click(function(){e.paused||e.pause(),e.currentTime>0&&(e.setCurrentTime(0),e.pause(),c.find(".mejs-time-current").width("0px"),c.find(".mejs-time-handle").css("left","0px"),c.find(".mejs-time-float-current").html(mejs.Utility.secondsToTimeCode(0,b.options)),c.find(".mejs-currenttime").html(mejs.Utility.secondsToTimeCode(0,b.options)),d.find(".mejs-poster").show())})}})}(mejs.$),function(a){a.extend(mejs.MepDefaults,{progessHelpText:mejs.i18n.t("Use Left/Right Arrow keys to advance one second, Up/Down arrows to advance ten seconds.")}),a.extend(MediaElementPlayer.prototype,{buildprogress:function(b,c,d,e){a('<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(c),c.find(".mejs-time-buffering").hide();var f=this,g=c.find(".mejs-time-total"),h=c.find(".mejs-time-loaded"),i=c.find(".mejs-time-current"),j=c.find(".mejs-time-handle"),k=c.find(".mejs-time-float"),l=c.find(".mejs-time-float-current"),m=c.find(".mejs-time-slider"),n=function(a){var c,d=g.offset(),f=g.width(),h=0,i=0,j=0;c=a.originalEvent&&a.originalEvent.changedTouches?a.originalEvent.changedTouches[0].pageX:a.changedTouches?a.changedTouches[0].pageX:a.pageX,e.duration&&(c<d.left?c=d.left:c>f+d.left&&(c=f+d.left),j=c-d.left,h=j/f,i=.02>=h?0:h*e.duration,o&&i!==e.currentTime&&e.setCurrentTime(i),mejs.MediaFeatures.hasTouch||(k.css("left",j),l.html(mejs.Utility.secondsToTimeCode(i,b.options)),k.show()))},o=!1,p=!1,q=0,r=!1,s=b.options.autoRewind,t=function(a){var c=e.currentTime,d=mejs.i18n.t("Time Slider"),f=mejs.Utility.secondsToTimeCode(c,b.options),g=e.duration;m.attr({"aria-label":d,"aria-valuemin":0,"aria-valuemax":g,"aria-valuenow":c,"aria-valuetext":f,role:"slider",tabindex:0})},u=function(){var a=new Date;a-q>=1e3&&e.play()};m.bind("focus",function(a){b.options.autoRewind=!1}),m.bind("blur",function(a){b.options.autoRewind=s}),m.bind("keydown",function(a){new Date-q>=1e3&&(r=e.paused);var c=a.keyCode,d=e.duration,f=e.currentTime,g=b.options.defaultSeekForwardInterval(d),h=b.options.defaultSeekBackwardInterval(d);switch(c){case 37:case 40:f-=h;break;case 39:case 38:f+=g;break;case 36:f=0;break;case 35:f=d;break;case 32:case 13:return void(e.paused?e.play():e.pause());default:return}return f=0>f?0:f>=d?d:Math.floor(f),q=new Date,r||e.pause(),f<e.duration&&!r&&setTimeout(u,1100),e.setCurrentTime(f),a.preventDefault(),a.stopPropagation(),!1}),g.bind("mousedown touchstart",function(a){(1===a.which||0===a.which)&&(o=!0,n(a),f.globalBind("mousemove.dur touchmove.dur",function(a){n(a)}),f.globalBind("mouseup.dur touchend.dur",function(a){o=!1,k.hide(),f.globalUnbind(".dur")}))}).bind("mouseenter",function(a){p=!0,f.globalBind("mousemove.dur",function(a){n(a)}),mejs.MediaFeatures.hasTouch||k.show()}).bind("mouseleave",function(a){p=!1,o||(f.globalUnbind(".dur"),k.hide())}),e.addEventListener("progress",function(a){b.setProgressRail(a),b.setCurrentRail(a)},!1),e.addEventListener("timeupdate",function(a){b.setProgressRail(a),b.setCurrentRail(a),t(a)},!1),f.container.on("controlsresize",function(){b.setProgressRail(),b.setCurrentRail()}),f.loaded=h,f.total=g,f.current=i,f.handle=j},setProgressRail:function(a){var b=this,c=void 0!==a?a.target:b.media,d=null;c&&c.buffered&&c.buffered.length>0&&c.buffered.end&&c.duration?d=c.buffered.end(c.buffered.length-1)/c.duration:c&&void 0!==c.bytesTotal&&c.bytesTotal>0&&void 0!==c.bufferedBytes?d=c.bufferedBytes/c.bytesTotal:a&&a.lengthComputable&&0!==a.total&&(d=a.loaded/a.total),null!==d&&(d=Math.min(1,Math.max(0,d)),b.loaded&&b.total&&b.loaded.width(b.total.width()*d))},setCurrentRail:function(){var a=this;if(void 0!==a.media.currentTime&&a.media.duration&&a.total&&a.handle){var b=Math.round(a.total.width()*a.media.currentTime/a.media.duration),c=b-Math.round(a.handle.outerWidth(!0)/2);a.current.width(b),a.handle.css("left",c)}}})}(mejs.$),function(a){a.extend(mejs.MepDefaults,{duration:-1,timeAndDurationSeparator:"<span> | </span>"}),a.extend(MediaElementPlayer.prototype,{buildcurrent:function(b,c,d,e){var f=this;a('<div class="mejs-time" role="timer" aria-live="off"><span class="mejs-currenttime">'+mejs.Utility.secondsToTimeCode(0,b.options)+"</span></div>").appendTo(c),f.currenttime=f.controls.find(".mejs-currenttime"),e.addEventListener("timeupdate",function(){b.updateCurrent()},!1)},buildduration:function(b,c,d,e){var f=this;c.children().last().find(".mejs-currenttime").length>0?a(f.options.timeAndDurationSeparator+'<span class="mejs-duration">'+mejs.Utility.secondsToTimeCode(f.options.duration,f.options)+"</span>").appendTo(c.find(".mejs-time")):(c.find(".mejs-currenttime").parent().addClass("mejs-currenttime-container"),a('<div class="mejs-time mejs-duration-container"><span class="mejs-duration">'+mejs.Utility.secondsToTimeCode(f.options.duration,f.options)+"</span></div>").appendTo(c)),f.durationD=f.controls.find(".mejs-duration"),e.addEventListener("timeupdate",function(){b.updateDuration()},!1)},updateCurrent:function(){var a=this,b=a.media.currentTime;isNaN(b)&&(b=0),a.currenttime&&a.currenttime.html(mejs.Utility.secondsToTimeCode(b,a.options))},updateDuration:function(){var a=this,b=a.media.duration;a.options.duration>0&&(b=a.options.duration),isNaN(b)&&(b=0),a.container.toggleClass("mejs-long-video",b>3600),a.durationD&&b>0&&a.durationD.html(mejs.Utility.secondsToTimeCode(b,a.options))}})}(mejs.$),function(a){a.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"}),a.extend(MediaElementPlayer.prototype,{buildvolume:function(b,c,d,e){if(!mejs.MediaFeatures.isAndroid&&!mejs.MediaFeatures.isiOS||!this.options.hideVolumeOnTouchDevices){var f=this,g=f.isVideo?f.options.videoVolume:f.options.audioVolume,h="horizontal"==g?a('<div class="mejs-button mejs-volume-button mejs-mute"><button type="button" aria-controls="'+f.id+'" title="'+f.options.muteText+'" aria-label="'+f.options.muteText+'"></button></div><a href="javascript:void(0);" class="mejs-horizontal-volume-slider"><span class="mejs-offscreen">'+f.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(c):a('<div class="mejs-button mejs-volume-button mejs-mute"><button type="button" aria-controls="'+f.id+'" title="'+f.options.muteText+'" aria-label="'+f.options.muteText+'"></button><a href="javascript:void(0);" class="mejs-volume-slider"><span class="mejs-offscreen">'+f.options.allyVolumeControlText+'</span><div class="mejs-volume-total"></div><div class="mejs-volume-current"></div><div class="mejs-volume-handle"></div></a></div>').appendTo(c),i=f.container.find(".mejs-volume-slider, .mejs-horizontal-volume-slider"),j=f.container.find(".mejs-volume-total, .mejs-horizontal-volume-total"),k=f.container.find(".mejs-volume-current, .mejs-horizontal-volume-current"),l=f.container.find(".mejs-volume-handle, .mejs-horizontal-volume-handle"),m=function(a,b){if(!i.is(":visible")&&"undefined"==typeof b)return i.show(),m(a,!0),void i.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 c=j.position();if("vertical"==g){var d=j.height(),e=d-d*a;l.css("top",Math.round(c.top+e-l.height()/2)),k.height(d-e),k.css("top",c.top+e)}else{var f=j.width(),n=f*a;l.css("left",Math.round(c.left+n-l.width()/2)),k.width(Math.round(n))}},n=function(a){var b=null,c=j.offset();if("vertical"===g){var d=j.height(),f=a.pageY-c.top;if(b=(d-f)/d,0===c.top||0===c.left)return}else{var h=j.width(),i=a.pageX-c.left;b=i/h}b=Math.max(0,b),b=Math.min(b,1),m(b),0===b?e.setMuted(!0):e.setMuted(!1),e.setVolume(b)},o=!1,p=!1;h.hover(function(){i.show(),p=!0},function(){p=!1,o||"vertical"!=g||i.hide()});var q=function(a){var b=Math.floor(100*e.volume);i.attr({"aria-label":mejs.i18n.t("Volume Slider"),"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":b,"aria-valuetext":b+"%",role:"slider",tabindex:0})};i.bind("mouseover",function(){p=!0}).bind("mousedown",function(a){return n(a),f.globalBind("mousemove.vol",function(a){n(a)}),f.globalBind("mouseup.vol",function(){o=!1,f.globalUnbind(".vol"),p||"vertical"!=g||i.hide()}),o=!0,!1}).bind("keydown",function(a){var b=a.keyCode,c=e.volume;switch(b){case 38:c=Math.min(c+.1,1);break;case 40:c=Math.max(0,c-.1);break;default:return!0}return o=!1,m(c),e.setVolume(c),!1}),h.find("button").click(function(){e.setMuted(!e.muted)}),h.find("button").bind("focus",function(){i.show()}),e.addEventListener("volumechange",function(a){o||(e.muted?(m(0),h.removeClass("mejs-mute").addClass("mejs-unmute")):(m(e.volume),h.removeClass("mejs-unmute").addClass("mejs-mute"))),q(a)},!1),0===b.options.startVolume&&e.setMuted(!0),"native"===e.pluginType&&e.setVolume(b.options.startVolume),f.container.on("controlsresize",function(){m(e.volume)})}}})}(mejs.$),function(a){a.extend(mejs.MepDefaults,{usePluginFullScreen:!0,newWindowCallback:function(){return""},fullscreenText:mejs.i18n.t("Fullscreen")}),a.extend(MediaElementPlayer.prototype,{isFullScreen:!1,isNativeFullScreen:!1,isInIframe:!1,fullscreenMode:"",buildfullscreen:function(b,c,d,e){if(b.isVideo){b.isInIframe=window.location!=window.parent.location,e.addEventListener("play",function(){b.detectFullscreenMode()});var f=this,g=null,h=a('<div class="mejs-button mejs-fullscreen-button"><button type="button" aria-controls="'+f.id+'" title="'+f.options.fullscreenText+'" aria-label="'+f.options.fullscreenText+'"></button></div>').appendTo(c).on("click",function(){var a=mejs.MediaFeatures.hasTrueNativeFullScreen&&mejs.MediaFeatures.isFullScreen()||b.isFullScreen;a?b.exitFullScreen():b.enterFullScreen()}).on("mouseover",function(){if("plugin-hover"==f.fullscreenMode){null!==g&&(clearTimeout(g),delete g);var a=h.offset(),c=b.container.offset();e.positionFullscreenButton(a.left-c.left,a.top-c.top,!0); -}}).on("mouseout",function(){"plugin-hover"==f.fullscreenMode&&(null!==g&&(clearTimeout(g),delete g),g=setTimeout(function(){e.hideFullscreenButton()},1500))});if(b.fullscreenBtn=h,f.globalBind("keydown",function(a){27==a.keyCode&&(mejs.MediaFeatures.hasTrueNativeFullScreen&&mejs.MediaFeatures.isFullScreen()||f.isFullScreen)&&b.exitFullScreen()}),f.normalHeight=0,f.normalWidth=0,mejs.MediaFeatures.hasTrueNativeFullScreen){var i=function(a){b.isFullScreen&&(mejs.MediaFeatures.isFullScreen()?(b.isNativeFullScreen=!0,b.setControlsSize()):(b.isNativeFullScreen=!1,b.exitFullScreen()))};b.globalBind(mejs.MediaFeatures.fullScreenEventName,i)}}},detectFullscreenMode:function(){var a=this,b="",c=mejs.MediaFeatures;return c.hasTrueNativeFullScreen&&"native"===a.media.pluginType?b="native-native":c.hasTrueNativeFullScreen&&"native"!==a.media.pluginType&&!c.hasFirefoxPluginMovingProblem?b="plugin-native":a.usePluginFullScreen?mejs.MediaFeatures.supportsPointerEvents?(b="plugin-click",a.createPluginClickThrough()):b="plugin-hover":b="fullwindow",a.fullscreenMode=b,b},isPluginClickThroughCreated:!1,createPluginClickThrough:function(){var b=this;if(!b.isPluginClickThroughCreated){var c,d,e=!1,f=function(){if(e){for(var a in g)g[a].hide();b.fullscreenBtn.css("pointer-events",""),b.controls.css("pointer-events",""),b.media.removeEventListener("click",b.clickToPlayPauseCallback),e=!1}},g={},h=["top","left","right","bottom"],i=function(){var a=fullscreenBtn.offset().left-b.container.offset().left,d=fullscreenBtn.offset().top-b.container.offset().top,e=fullscreenBtn.outerWidth(!0),f=fullscreenBtn.outerHeight(!0),h=b.container.width(),i=b.container.height();for(c in g)g[c].css({position:"absolute",top:0,left:0});g.top.width(h).height(d),g.left.width(a).height(f).css({top:d}),g.right.width(h-a-e).height(f).css({top:d,left:a+e}),g.bottom.width(h).height(i-f-d).css({top:d+f})};for(b.globalBind("resize",function(){i()}),c=0,d=h.length;d>c;c++)g[h[c]]=a('<div class="mejs-fullscreen-hover" />').appendTo(b.container).mouseover(f).hide();fullscreenBtn.on("mouseover",function(){if(!b.isFullScreen){var a=fullscreenBtn.offset(),d=player.container.offset();media.positionFullscreenButton(a.left-d.left,a.top-d.top,!1),b.fullscreenBtn.css("pointer-events","none"),b.controls.css("pointer-events","none"),b.media.addEventListener("click",b.clickToPlayPauseCallback);for(c in g)g[c].show();i(),e=!0}}),media.addEventListener("fullscreenchange",function(a){b.isFullScreen=!b.isFullScreen,b.isFullScreen?b.media.removeEventListener("click",b.clickToPlayPauseCallback):b.media.addEventListener("click",b.clickToPlayPauseCallback),f()}),b.globalBind("mousemove",function(a){if(e){var c=fullscreenBtn.offset();(a.pageY<c.top||a.pageY>c.top+fullscreenBtn.outerHeight(!0)||a.pageX<c.left||a.pageX>c.left+fullscreenBtn.outerWidth(!0))&&(fullscreenBtn.css("pointer-events",""),b.controls.css("pointer-events",""),e=!1)}}),b.isPluginClickThroughCreated=!0}},cleanfullscreen:function(a){a.exitFullScreen()},containerSizeTimeout:null,enterFullScreen:function(){var b=this;return mejs.MediaFeatures.hasiOSFullScreen?void b.media.webkitEnterFullscreen():(a(document.documentElement).addClass("mejs-fullscreen"),b.normalHeight=b.container.height(),b.normalWidth=b.container.width(),"native-native"===b.fullscreenMode||"plugin-native"===b.fullscreenMode?(mejs.MediaFeatures.requestFullScreen(b.container[0]),b.isInIframe&&setTimeout(function c(){if(b.isNativeFullScreen){var d=.002,e=a(window).width(),f=screen.width,g=Math.abs(f-e),h=f*d;g>h?b.exitFullScreen():setTimeout(c,500)}},1e3)):"fullwindow"==b.fullscreeMode,b.container.addClass("mejs-container-fullscreen").width("100%").height("100%"),b.containerSizeTimeout=setTimeout(function(){b.container.css({width:"100%",height:"100%"}),b.setControlsSize()},500),"native"===b.media.pluginType?b.$media.width("100%").height("100%"):(b.container.find(".mejs-shim").width("100%").height("100%"),setTimeout(function(){var c=a(window),d=c.width(),e=c.height();b.media.setVideoSize(d,e)},500)),b.layers.children("div").width("100%").height("100%"),b.fullscreenBtn&&b.fullscreenBtn.removeClass("mejs-fullscreen").addClass("mejs-unfullscreen"),b.setControlsSize(),b.isFullScreen=!0,b.container.find(".mejs-captions-text").css("font-size",screen.width/b.width*1*100+"%"),b.container.find(".mejs-captions-position").css("bottom","45px"),void b.container.trigger("enteredfullscreen"))},exitFullScreen:function(){var b=this;clearTimeout(b.containerSizeTimeout),mejs.MediaFeatures.hasTrueNativeFullScreen&&(mejs.MediaFeatures.isFullScreen()||b.isFullScreen)&&mejs.MediaFeatures.cancelFullScreen(),a(document.documentElement).removeClass("mejs-fullscreen"),b.container.removeClass("mejs-container-fullscreen").width(b.normalWidth).height(b.normalHeight),"native"===b.media.pluginType?b.$media.width(b.normalWidth).height(b.normalHeight):(b.container.find(".mejs-shim").width(b.normalWidth).height(b.normalHeight),b.media.setVideoSize(b.normalWidth,b.normalHeight)),b.layers.children("div").width(b.normalWidth).height(b.normalHeight),b.fullscreenBtn.removeClass("mejs-unfullscreen").addClass("mejs-fullscreen"),b.setControlsSize(),b.isFullScreen=!1,b.container.find(".mejs-captions-text").css("font-size",""),b.container.find(".mejs-captions-position").css("bottom",""),b.container.trigger("exitedfullscreen")}})}(mejs.$),function(a){a.extend(mejs.MepDefaults,{speeds:["2.00","1.50","1.25","1.00","0.75"],defaultSpeed:"1.00",speedChar:"x"}),a.extend(MediaElementPlayer.prototype,{buildspeed:function(b,c,d,e){var f=this;if("native"==f.media.pluginType){for(var g=null,h=null,i=null,j=null,k=[],l=!1,m=0,n=f.options.speeds.length;n>m;m++){var o=f.options.speeds[m];"string"==typeof o?(k.push({name:o+f.options.speedChar,value:o}),o===f.options.defaultSpeed&&(l=!0)):(k.push(o),o.value===f.options.defaultSpeed&&(l=!0))}l||k.push({name:f.options.defaultSpeed+f.options.speedChar,value:f.options.defaultSpeed}),k.sort(function(a,b){return parseFloat(b.value)-parseFloat(a.value)});var p=function(a){for(m=0,n=k.length;n>m;m++)if(k[m].value===a)return k[m].name},q='<div class="mejs-button mejs-speed-button"><button type="button">'+p(f.options.defaultSpeed)+'</button><div class="mejs-speed-selector"><ul>';for(m=0,il=k.length;m<il;m++)j=f.id+"-speed-"+k[m].value,q+='<li><input type="radio" name="speed" value="'+k[m].value+'" id="'+j+'" '+(k[m].value===f.options.defaultSpeed?" checked":"")+' /><label for="'+j+'" '+(k[m].value===f.options.defaultSpeed?' class="mejs-speed-selected"':"")+">"+k[m].name+"</label></li>";q+="</ul></div></div>",g=a(q).appendTo(c),h=g.find(".mejs-speed-selector"),i=f.options.defaultSpeed,e.addEventListener("loadedmetadata",function(a){i&&(e.playbackRate=parseFloat(i))},!0),h.on("click",'input[type="radio"]',function(){var b=a(this).attr("value");i=b,e.playbackRate=parseFloat(b),g.find("button").html(p(b)),g.find(".mejs-speed-selected").removeClass("mejs-speed-selected"),g.find('input[type="radio"]:checked').next().addClass("mejs-speed-selected")}),g.one("mouseenter focusin",function(){h.height(g.find(".mejs-speed-selector ul").outerHeight(!0)+g.find(".mejs-speed-translations").outerHeight(!0)).css("top",-1*h.height()+"px")})}}})}(mejs.$),function(a){a.extend(mejs.MepDefaults,{startLanguage:"",tracksText:mejs.i18n.t("Captions/Subtitles"),tracksAriaLive:!1,hideCaptionsButtonWhenEmpty:!0,toggleCaptionsButtonWhenOnlyOne:!1,slidesSelector:""}),a.extend(MediaElementPlayer.prototype,{hasChapters:!1,cleartracks:function(a,b,c,d){a&&(a.captions&&a.captions.remove(),a.chapters&&a.chapters.remove(),a.captionsText&&a.captionsText.remove(),a.captionsButton&&a.captionsButton.remove())},buildtracks:function(b,c,d,e){if(0!==b.tracks.length){var f,g=this,h=g.options.tracksAriaLive?'role="log" aria-live="assertive" aria-atomic="false"':"";if(g.domNode.textTracks)for(f=g.domNode.textTracks.length-1;f>=0;f--)g.domNode.textTracks[f].mode="hidden";g.cleartracks(b,c,d,e),b.chapters=a('<div class="mejs-chapters mejs-layer"></div>').prependTo(d).hide(),b.captions=a('<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(d).hide(),b.captionsText=b.captions.find(".mejs-captions-text"),b.captionsButton=a('<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="'+b.id+'_captions" id="'+b.id+'_captions_none" value="none" checked="checked" /><label for="'+b.id+'_captions_none">'+mejs.i18n.t("None")+"</label></li></ul></div></div>").appendTo(c);var i=0;for(f=0;f<b.tracks.length;f++)"subtitles"==b.tracks[f].kind&&i++;for(g.options.toggleCaptionsButtonWhenOnlyOne&&1==i?b.captionsButton.on("click",function(){null===b.selectedTrack?lang=b.tracks[0].srclang:lang="none",b.setTrack(lang)}):(b.captionsButton.on("mouseenter focusin",function(){a(this).find(".mejs-captions-selector").removeClass("mejs-offscreen")}).on("click","input[type=radio]",function(){lang=this.value,b.setTrack(lang)}),b.captionsButton.on("mouseleave focusout",function(){a(this).find(".mejs-captions-selector").addClass("mejs-offscreen")})),b.options.alwaysShowControls?b.container.find(".mejs-captions-position").addClass("mejs-captions-position-hover"):b.container.bind("controlsshown",function(){b.container.find(".mejs-captions-position").addClass("mejs-captions-position-hover")}).bind("controlshidden",function(){e.paused||b.container.find(".mejs-captions-position").removeClass("mejs-captions-position-hover")}),b.trackToLoad=-1,b.selectedTrack=null,b.isLoadingTrack=!1,f=0;f<b.tracks.length;f++)"subtitles"==b.tracks[f].kind&&b.addTrackButton(b.tracks[f].srclang,b.tracks[f].label);b.loadNextTrack(),e.addEventListener("timeupdate",function(a){b.displayCaptions()},!1),""!==b.options.slidesSelector&&(b.slidesContainer=a(b.options.slidesSelector),e.addEventListener("timeupdate",function(a){b.displaySlides()},!1)),e.addEventListener("loadedmetadata",function(a){b.displayChapters()},!1),b.container.hover(function(){b.hasChapters&&(b.chapters.removeClass("mejs-offscreen"),b.chapters.fadeIn(200).height(b.chapters.find(".mejs-chapter").outerHeight()))},function(){b.hasChapters&&!e.paused&&b.chapters.fadeOut(200,function(){a(this).addClass("mejs-offscreen"),a(this).css("display","block")})}),g.container.on("controlsresize",function(){g.adjustLanguageBox()}),null!==b.node.getAttribute("autoplay")&&b.chapters.addClass("mejs-offscreen")}},setTrack:function(a){var b,c=this;if("none"==a)c.selectedTrack=null,c.captionsButton.removeClass("mejs-captions-enabled");else for(b=0;b<c.tracks.length;b++)if(c.tracks[b].srclang==a){null===c.selectedTrack&&c.captionsButton.addClass("mejs-captions-enabled"),c.selectedTrack=c.tracks[b],c.captions.attr("lang",c.selectedTrack.srclang),c.displayCaptions();break}},loadNextTrack:function(){var a=this;a.trackToLoad++,a.trackToLoad<a.tracks.length?(a.isLoadingTrack=!0,a.loadTrack(a.trackToLoad)):(a.isLoadingTrack=!1,a.checkForTracks())},loadTrack:function(b){var c=this,d=c.tracks[b],e=function(){d.isLoaded=!0,c.enableTrackButton(d.srclang,d.label),c.loadNextTrack()};a.ajax({url:d.src,dataType:"text",success:function(a){"string"==typeof a&&/<tt\s+xml/gi.exec(a)?d.entries=mejs.TrackFormatParser.dfxp.parse(a):d.entries=mejs.TrackFormatParser.webvtt.parse(a),e(),"chapters"==d.kind&&c.media.addEventListener("play",function(a){c.media.duration>0&&c.displayChapters(d)},!1),"slides"==d.kind&&c.setupSlides(d)},error:function(){c.removeTrackButton(d.srclang),c.loadNextTrack()}})},enableTrackButton:function(b,c){var d=this;""===c&&(c=mejs.language.codes[b]||b),d.captionsButton.find("input[value="+b+"]").prop("disabled",!1).siblings("label").html(c),d.options.startLanguage==b&&a("#"+d.id+"_captions_"+b).prop("checked",!0).trigger("click"),d.adjustLanguageBox()},removeTrackButton:function(a){var b=this;b.captionsButton.find("input[value="+a+"]").closest("li").remove(),b.adjustLanguageBox()},addTrackButton:function(b,c){var d=this;""===c&&(c=mejs.language.codes[b]||b),d.captionsButton.find("ul").append(a('<li><input type="radio" name="'+d.id+'_captions" id="'+d.id+"_captions_"+b+'" value="'+b+'" disabled="disabled" /><label for="'+d.id+"_captions_"+b+'">'+c+" (loading)</label></li>")),d.adjustLanguageBox(),d.container.find(".mejs-captions-translations option[value="+b+"]").remove()},adjustLanguageBox:function(){var a=this;a.captionsButton.find(".mejs-captions-selector").height(a.captionsButton.find(".mejs-captions-selector ul").outerHeight(!0)+a.captionsButton.find(".mejs-captions-translations").outerHeight(!0))},checkForTracks:function(){var a=this,b=!1;if(a.options.hideCaptionsButtonWhenEmpty){for(i=0;i<a.tracks.length;i++)if("subtitles"==a.tracks[i].kind&&a.tracks[i].isLoaded){b=!0;break}b||(a.captionsButton.hide(),a.setControlsSize())}},displayCaptions:function(){if("undefined"!=typeof this.tracks){var a,b=this,c=b.selectedTrack;if(null!==c&&c.isLoaded){for(a=0;a<c.entries.times.length;a++)if(b.media.currentTime>=c.entries.times[a].start&&b.media.currentTime<=c.entries.times[a].stop)return b.captionsText.html(c.entries.text[a]).attr("class","mejs-captions-text "+(c.entries.times[a].identifier||"")),void b.captions.show().height(0);b.captions.hide()}else b.captions.hide()}},setupSlides:function(a){var b=this;b.slides=a,b.slides.entries.imgs=[b.slides.entries.text.length],b.showSlide(0)},showSlide:function(b){if("undefined"!=typeof this.tracks&&"undefined"!=typeof this.slidesContainer){var c=this,d=c.slides.entries.text[b],e=c.slides.entries.imgs[b];"undefined"==typeof e||"undefined"==typeof e.fadeIn?c.slides.entries.imgs[b]=e=a('<img src="'+d+'">').on("load",function(){e.appendTo(c.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,c=b.slides;for(a=0;a<c.entries.times.length;a++)if(b.media.currentTime>=c.entries.times[a].start&&b.media.currentTime<=c.entries.times[a].stop)return void b.showSlide(a)}},displayChapters:function(){var a,b=this;for(a=0;a<b.tracks.length;a++)if("chapters"==b.tracks[a].kind&&b.tracks[a].isLoaded){b.drawChapters(b.tracks[a]),b.hasChapters=!0;break}},drawChapters:function(b){var c,d,e=this,f=0,g=0;for(e.chapters.empty(),c=0;c<b.entries.times.length;c++)d=b.entries.times[c].stop-b.entries.times[c].start,f=Math.floor(d/e.media.duration*100),(f+g>100||c==b.entries.times.length-1&&100>f+g)&&(f=100-g),e.chapters.append(a('<div class="mejs-chapter" rel="'+b.entries.times[c].start+'" style="left: '+g.toString()+"%;width: "+f.toString()+'%;"><div class="mejs-chapter-block'+(c==b.entries.times.length-1?" mejs-chapter-block-last":"")+'"><span class="ch-title">'+b.entries.text[c]+'</span><span class="ch-time">'+mejs.Utility.secondsToTimeCode(b.entries.times[c].start,e.options)+"–"+mejs.Utility.secondsToTimeCode(b.entries.times[c].stop,e.options)+"</span></div></div>")),g+=f;e.chapters.find("div.mejs-chapter").click(function(){e.media.setCurrentTime(parseFloat(a(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(b){for(var c,d,e,f=0,g=mejs.TrackFormatParser.split2(b,/\r?\n/),h={text:[],times:[]};f<g.length;f++){if(c=this.pattern_timecode.exec(g[f]),c&&f<g.length){for(f-1>=0&&""!==g[f-1]&&(e=g[f-1]),f++,d=g[f],f++;""!==g[f]&&f<g.length;)d=d+"\n"+g[f],f++;d=a.trim(d).replace(/(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/gi,"<a href='$1' target='_blank'>$1</a>"),h.text.push(d),h.times.push({identifier:e,start:0===mejs.Utility.convertSMPTEtoSeconds(c[1])?.2:mejs.Utility.convertSMPTEtoSeconds(c[1]),stop:mejs.Utility.convertSMPTEtoSeconds(c[3]),settings:c[5]})}e=""}return h}},dfxp:{parse:function(b){b=a(b).filter("tt");var c,d,e=0,f=b.children("div").eq(0),g=f.find("p"),h=b.find("#"+f.attr("style")),i={text:[],times:[]};if(h.length){var j=h.removeAttr("id").get(0).attributes;if(j.length)for(c={},e=0;e<j.length;e++)c[j[e].name.split(":")[1]]=j[e].value}for(e=0;e<g.length;e++){var k,l={start:null,stop:null,style:null};if(g.eq(e).attr("begin")&&(l.start=mejs.Utility.convertSMPTEtoSeconds(g.eq(e).attr("begin"))),!l.start&&g.eq(e-1).attr("end")&&(l.start=mejs.Utility.convertSMPTEtoSeconds(g.eq(e-1).attr("end"))),g.eq(e).attr("end")&&(l.stop=mejs.Utility.convertSMPTEtoSeconds(g.eq(e).attr("end"))),!l.stop&&g.eq(e+1).attr("begin")&&(l.stop=mejs.Utility.convertSMPTEtoSeconds(g.eq(e+1).attr("begin"))),c){k="";for(var m in c)k+=m+":"+c[m]+";"}k&&(l.style=k),0===l.start&&(l.start=.2),i.times.push(l),d=a.trim(g.eq(e).html()).replace(/(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/gi,"<a href='$1' target='_blank'>$1</a>"),i.text.push(d),0===i.times.start&&(i.times.start=2)}return i}},split2:function(a,b){return a.split(b)}},3!="x\n\ny".split(/\n/gi).length&&(mejs.TrackFormatParser.split2=function(a,b){var c,d=[],e="";for(c=0;c<a.length;c++)e+=a.substring(c,c+1),b.test(e)&&(d.push(e.replace(b,"")),e="");return d.push(e),d})}(mejs.$),function(a){a.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}}]}),a.extend(MediaElementPlayer.prototype,{buildcontextmenu:function(b,c,d,e){b.contextMenu=a('<div class="mejs-contextmenu"></div>').appendTo(a("body")).hide(),b.container.bind("contextmenu",function(a){return b.isContextMenuEnabled?(a.preventDefault(),b.renderContextMenu(a.clientX-1,a.clientY-1),!1):void 0}),b.container.bind("click",function(){b.contextMenu.hide()}),b.contextMenu.bind("mouseleave",function(){b.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,a=null)},hideContextMenu:function(){this.contextMenu.hide()},renderContextMenu:function(b,c){for(var d=this,e="",f=d.options.contextMenuItems,g=0,h=f.length;h>g;g++)if(f[g].isSeparator)e+='<div class="mejs-contextmenu-separator"></div>';else{var i=f[g].render(d);null!=i&&(e+='<div class="mejs-contextmenu-item" data-itemindex="'+g+'" id="element-'+1e6*Math.random()+'">'+i+"</div>")}d.contextMenu.empty().append(a(e)).css({top:c,left:b}).show(),d.contextMenu.find(".mejs-contextmenu-item").each(function(){var b=a(this),c=parseInt(b.data("itemindex"),10),e=d.options.contextMenuItems[c];"undefined"!=typeof e.show&&e.show(b,d),b.click(function(){"undefined"!=typeof e.click&&e.click(d),d.contextMenu.hide()})}),setTimeout(function(){d.killControlsTimer("rev3")},100)}})}(mejs.$),function(a){a.extend(mejs.MepDefaults,{skipBackInterval:30,skipBackText:mejs.i18n.t("Skip back %1 seconds")}),a.extend(MediaElementPlayer.prototype,{buildskipback:function(b,c,d,e){var f=this,g=f.options.skipBackText.replace("%1",f.options.skipBackInterval);a('<div class="mejs-button mejs-skip-back-button"><button type="button" aria-controls="'+f.id+'" title="'+g+'" aria-label="'+g+'">'+f.options.skipBackInterval+"</button></div>").appendTo(c).click(function(){e.setCurrentTime(Math.max(e.currentTime-f.options.skipBackInterval,0)),a(this).find("button").blur()})}})}(mejs.$),function(a){a.extend(mejs.MepDefaults,{postrollCloseText:mejs.i18n.t("Close")}),a.extend(MediaElementPlayer.prototype,{buildpostroll:function(b,c,d,e){var f=this,g=f.container.find('link[rel="postroll"]').attr("href");"undefined"!=typeof g&&(b.postroll=a('<div class="mejs-postroll-layer mejs-layer"><a class="mejs-postroll-close" onclick="$(this).parent().hide();return false;">'+f.options.postrollCloseText+'</a><div class="mejs-postroll-layer-content"></div></div>').prependTo(d).hide(),f.media.addEventListener("ended",function(c){a.ajax({dataType:"html",url:g,success:function(a,b){d.find(".mejs-postroll-layer-content").html(a)}}),b.postroll.show()},!1))}})}(mejs.$); \ No newline at end of file diff --git a/static/mediaelementjs/mejs-skins.css b/static/mediaelementjs/mejs-skins.css deleted file mode 100644 index 5c27cf156fcd04effddbd141aae1b034b6eab8ff..0000000000000000000000000000000000000000 --- a/static/mediaelementjs/mejs-skins.css +++ /dev/null @@ -1,289 +0,0 @@ -/* TED player */ -.mejs-container.mejs-ted { - -} -.mejs-ted .mejs-controls { - background: #eee; - height: 65px; -} - -.mejs-ted .mejs-button, -.mejs-ted .mejs-time { - position: absolute; - background: #ddd; -} -.mejs-ted .mejs-controls .mejs-time-rail .mejs-time-total { - background-color: none; - background: url(controls-ted.png) repeat-x 0 -52px; - height: 6px; -} -.mejs-ted .mejs-controls .mejs-time-rail .mejs-time-buffering { - height: 6px; -} -.mejs-ted .mejs-controls .mejs-time-rail .mejs-time-loaded { - background-color: none; - background: url(controls-ted.png) repeat-x 0 -52px; - width: 0; - height: 6px; -} -.mejs-ted .mejs-controls .mejs-time-rail .mejs-time-current { - width: 0; - height: 6px; - background-color: none; - background: url(controls-ted.png) repeat-x 0 -59px; -} -.mejs-ted .mejs-controls .mejs-time-rail .mejs-time-handle { - display: block; - margin: 0; - width: 14px; - height: 21px; - top: -7px; - border: 0; - background: url(controls-ted.png) no-repeat 0 0; -} -.mejs-ted .mejs-controls .mejs-time-rail .mejs-time-float { - display: none; -} -.mejs-ted .mejs-controls .mejs-playpause-button { - top: 29px; - left: 9px; - width: 49px; - height: 28px; -} -.mejs-ted .mejs-controls .mejs-playpause-button button { - width: 49px; - height: 28px; - background: url(controls-ted.png) no-repeat -50px -23px; - margin: 0; - padding: 0; -} -.mejs-ted .mejs-controls .mejs-pause button { - background-position: 0 -23px; -} - -.mejs-ted .mejs-controls .mejs-fullscreen-button { - top: 34px; - right: 9px; - width: 17px; - height: 15px; - background : none; -} -.mejs-ted .mejs-controls .mejs-fullscreen-button button { - width: 19px; - height: 17px; - background: transparent url(controls-ted.png) no-repeat 0 -66px; - margin: 0; - padding: 0; -} -.mejs-ted .mejs-controls .mejs-unfullscreen button { - background: transparent url(controls-ted.png) no-repeat -21px -66px; - margin: 0; - padding: 0; -} -.mejs-ted .mejs-controls .mejs-volume-button { - top: 30px; - right: 35px; - width: 24px; - height: 22px; -} -.mejs-ted .mejs-controls .mejs-mute button { - background: url(controls-ted.png) no-repeat -15px 0; - width: 24px; - height: 22px; - margin: 0; - padding: 0; -} -.mejs-ted .mejs-controls .mejs-unmute button { - background: url(controls-ted.png) no-repeat -40px 0; - width: 24px; - height: 22px; - margin: 0; - padding: 0; -} -.mejs-ted .mejs-controls .mejs-volume-button .mejs-volume-slider { - background: #fff; - border: solid 1px #aaa; - border-width: 1px 1px 0 1px; - width: 22px; - height: 65px; - top: -65px; -} -.mejs-ted .mejs-controls .mejs-volume-button .mejs-volume-total { - background: url(controls-ted.png) repeat-y -41px -66px; - left: 8px; - width: 6px; - height: 50px; -} -.mejs-ted .mejs-controls .mejs-volume-button .mejs-volume-current { - left: 8px; - width: 6px; - background: url(controls-ted.png) repeat-y -48px -66px; - height: 50px; -} - -.mejs-ted .mejs-controls .mejs-volume-button .mejs-volume-handle { - display: none; -} - -.mejs-ted .mejs-controls .mejs-time span { - color: #333; -} -.mejs-ted .mejs-controls .mejs-currenttime-container { - position: absolute; - top: 32px; - right: 100px; - border: solid 1px #999; - background: #fff; - color: #333; - padding-top: 2px; - border-radius: 3px; - color: #333; -} -.mejs-ted .mejs-controls .mejs-duration-container { - - position: absolute; - top: 32px; - right: 65px; - border: solid 1px #999; - background: #fff; - color: #333; - padding-top: 2px; - border-radius: 3px; - color: #333; -} - -.mejs-ted .mejs-controls .mejs-time button{ - color: #333; -} -.mejs-ted .mejs-controls .mejs-captions-button { - display: none; -} -/* END: TED player */ - - -/* WMP player */ -.mejs-container.mejs-wmp { - -} -.mejs-wmp .mejs-controls { - background: transparent url(controls-wmp-bg.png) center 16px no-repeat; - height: 65px; -} - -.mejs-wmp .mejs-button, -.mejs-wmp .mejs-time { - position: absolute; - background: transparent; -} -.mejs-wmp .mejs-controls .mejs-time-rail .mejs-time-total { - background-color: transparent; - border: solid 1px #ccc; - height: 3px; -} -.mejs-wmp .mejs-controls .mejs-time-rail .mejs-time-buffering { - height: 3px; -} -.mejs-wmp .mejs-controls .mejs-time-rail .mejs-time-loaded { - background-color: rgba(255,255,255,0.3); - width: 0; - height: 3px; -} -.mejs-wmp .mejs-controls .mejs-time-rail .mejs-time-current { - width: 0; - height: 1px; - background-color: #014CB6; - border: solid 1px #7FC9FA; - border-width: 1px 0; - border-color: #7FC9FA #fff #619FF2 #fff; -} -.mejs-wmp .mejs-controls .mejs-time-rail .mejs-time-handle { - display: block; - margin: 0; - width: 16px; - height: 9px; - top: -3px; - border: 0; - background: url(controls-wmp.png) no-repeat 0 -80px; -} -.mejs-wmp .mejs-controls .mejs-time-rail .mejs-time-float { - display: none; -} -.mejs-wmp .mejs-controls .mejs-playpause-button { - top: 10px; - left: 50%; - margin: 10px 0 0 -20px; - width: 40px; - height: 40px; - -} -.mejs-wmp .mejs-controls .mejs-playpause-button button { - width: 40px; - height: 40px; - background: url(controls-wmp.png) no-repeat 0 0; - margin: 0; - padding: 0; -} -.mejs-wmp .mejs-controls .mejs-pause button { - background-position: 0 -40px; -} - -.mejs-wmp .mejs-controls .mejs-currenttime-container { - position: absolute; - top: 25px; - left: 50%; - margin-left: -93px; -} -.mejs-wmp .mejs-controls .mejs-duration-container { - position: absolute; - top: 25px; - left: 50%; - margin-left: -58px; -} - - -.mejs-wmp .mejs-controls .mejs-volume-button { - top: 32px; - right: 50%; - margin-right: -55px; - width: 20px; - height: 15px; -} -.mejs-wmp .mejs-controls .mejs-volume-button button { - margin: 0; - padding: 0; - background: url(controls-wmp.png) no-repeat -42px -17px; - width: 20px; - height: 15px; -} -.mejs-wmp .mejs-controls .mejs-unmute button { - margin: 0; - padding: 0; - background: url(controls-wmp.png) no-repeat -42px 0; - width: 20px; - height: 15px; -} -.mejs-wmp .mejs-controls .mejs-volume-button .mejs-volume-slider { - background: rgba(102,102,102,0.6); -} - -.mejs-wmp .mejs-controls .mejs-fullscreen-button { - top: 32px; - right: 50%; - margin-right: -82px; - width: 15px; - height: 14px; -} -.mejs-wmp .mejs-controls .mejs-fullscreen-button button { - margin: 0; - padding: 0; - background: url(controls-wmp.png) no-repeat -63px 0; - width: 15px; - height: 14px; -} -.mejs-wmp .mejs-controls .mejs-captions-button { - display: none; -} -/* END: WMP player */ - - - diff --git a/static/mediaelementjs/mep-feature-sourcechooser.js b/static/mediaelementjs/mep-feature-sourcechooser.js new file mode 100644 index 0000000000000000000000000000000000000000..cf56f77bf49c56bb6b094681c43db208a8e4f34c --- /dev/null +++ b/static/mediaelementjs/mep-feature-sourcechooser.js @@ -0,0 +1,92 @@ +// Source Chooser Plugin +(function($) { + + $.extend(mejs.MepDefaults, { + sourcechooserText: 'Source Chooser' + }); + + $.extend(MediaElementPlayer.prototype, { + buildsourcechooser: function(player, controls, layers, media) { + + var t = this; + + player.sourcechooserButton = + $('<div class="mejs-button mejs-sourcechooser-button">'+ + '<button type="button" aria-controls="' + t.id + '" title="' + t.options.sourcechooserText + '" aria-label="' + t.options.sourcechooserText + '"></button>'+ + '<div class="mejs-sourcechooser-selector">'+ + '<ul>'+ + '</ul>'+ + '</div>'+ + '</div>') + .appendTo(controls) + + // hover + .hover(function() { + $(this).find('.mejs-sourcechooser-selector').css('visibility','visible'); + }, function() { + $(this).find('.mejs-sourcechooser-selector').css('visibility','hidden'); + }) + + // handle clicks to the language radio buttons + .delegate('input[type=radio]', 'click', function() { + var src = this.value; + + if (media.currentSrc != src) { + var currentTime = media.currentTime; + var paused = media.paused; + media.pause(); + media.setSrc(src); + + media.addEventListener('loadedmetadata', function(e) { + media.currentTime = currentTime; + }, true); + + var canPlayAfterSourceSwitchHandler = function(e) { + if (!paused) { + media.play(); + } + media.removeEventListener("canplay", canPlayAfterSourceSwitchHandler, true); + }; + media.addEventListener('canplay', canPlayAfterSourceSwitchHandler, true); + media.load(); + } + }); + + // add to list + for (var i in this.node.children) { + var src = this.node.children[i]; + if (src.nodeName === 'SOURCE' && (media.canPlayType(src.type) == 'probably' || media.canPlayType(src.type) == 'maybe')) { + player.addSourceButton(src.src, src.title, src.type, media.src == src.src); + } + } + + }, + + addSourceButton: function(src, label, type, isCurrent) { + var t = this; + if (label === '' || label == undefined) { + label = src; + } + type = type.split('/')[1]; + + t.sourcechooserButton.find('ul').append( + $('<li>'+ + '<input type="radio" name="' + t.id + '_sourcechooser" id="' + t.id + '_sourcechooser_' + label + type + '" value="' + src + '" ' + (isCurrent ? 'checked="checked"' : '') + ' />'+ + '<label for="' + t.id + '_sourcechooser_' + label + type + '">' + label + ' (' + type + ')</label>'+ + '</li>') + ); + + t.adjustSourcechooserBox(); + + }, + + adjustSourcechooserBox: function() { + var t = this; + // adjust the size of the outer box + t.sourcechooserButton.find('.mejs-sourcechooser-selector').height( + t.sourcechooserButton.find('.mejs-sourcechooser-selector ul').outerHeight(true) + ); + } + }); + +})(mejs.$); diff --git a/templates/macros.html b/templates/macros.html index cc657625e28074646785f2712976d289e4f3e17d..b7ce893673dd80c87f3152cb3e1396af60615eeb 100644 --- a/templates/macros.html +++ b/templates/macros.html @@ -49,18 +49,23 @@ {% endmacro %} {% macro player(lecture, videos) %} -<script src="{{url_for('static', filename='mediaelementjs/mediaelement-and-player.min.js')}}"></script> -<link rel="stylesheet" href="{{url_for('static', filename='mediaelementjs/mediaelementplayer.css')}}" /> -<video class="mejs-player" width="640" height="360" style="width: 100%; height: 100%;"> +<script src="{{url_for('static', filename='mediaelementjs/mediaelement-and-player.js')}}"></script> +<script src="{{url_for('static', filename='mediaelementjs/mep-feature-sourcechooser.js')}}"></script> +<link rel="stylesheet" href="{{url_for('static', filename='mediaelementjs/mediaelementplayer.css')}}"/> +<video class="player" width="640" height="360" style="width: 100%; height: 100%;" controls="controls"> {% for v in videos %} - <source type="video/mp4" src="{{ config.VIDEOPREFIX }}/{{ v.path }}" /> + <source type="video/mp4" src="{{ config.VIDEOPREFIX }}/{{ v.path }}" title="{{ v.format_description }}"/> {% endfor %} </video> <script> -//$('.mejs-player').mediaelementplayer({ -// features: ['playpause','progress','current','duration','tracks','volume','fullscreen'], -// speeds: ['3.00', '2.50', '2.00', '1.50', '1.25', '1.00', '0.75'] -//}); + $(function($) + { + var player = new MediaElementPlayer('.player', { + features: [ + 'playpause', 'current', 'progress', 'duration', 'volume', 'tracks', 'sourcechooser', 'speed', 'fullscreen', + ], + }); + }); </script> {% endmacro %}