').appendTo(t.container).mouseover(restoreControls),
- controlsLeftHoverDiv = $('
').appendTo(t.container).mouseover(restoreControls),
- controlsRightHoverDiv = $('
').appendTo(t.container).mouseover(restoreControls),
- positionHoverDivs = function() {
- var style = {position: 'absolute', top: 0, left: 0}; //, backgroundColor: '#f00'};
- videoHoverDiv.css(style);
- controlsLeftHoverDiv.css(style);
- controlsRightHoverDiv.css(style);
-
- // over video, but not controls
- videoHoverDiv
- .width( t.container.width() )
- .height( t.container.height() - t.controls.height() );
-
- // over controls, but not the fullscreen button
- var fullScreenBtnOffset = fullscreenBtn.offset().left - t.container.offset().left;
- fullScreenBtnWidth = fullscreenBtn.outerWidth(true);
-
- controlsLeftHoverDiv
- .width( fullScreenBtnOffset )
- .height( t.controls.height() )
- .css({top: t.container.height() - t.controls.height()});
-
- // after the fullscreen button
- controlsRightHoverDiv
- .width( t.container.width() - fullScreenBtnOffset - fullScreenBtnWidth )
- .height( t.controls.height() )
- .css({top: t.container.height() - t.controls.height(),
- left: fullScreenBtnOffset + fullScreenBtnWidth});
- };
-
- $(document).resize(function() {
- positionHoverDivs();
- });
-
- // on hover, kill the fullscreen button's HTML handling, allowing clicks down to Flash
- fullscreenBtn
- .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
- fullscreenBtn.css('pointer-events', 'none');
- t.controls.css('pointer-events', 'none');
-
- // show the divs that will restore things
- videoHoverDiv.show();
- controlsRightHoverDiv.show();
- controlsLeftHoverDiv.show();
- positionHoverDivs();
-
- fullscreenIsDisabled = true;
- }
-
- });
-
- // restore controls anytime the user enters or leaves fullscreen
- media.addEventListener('fullscreenchange', function(e) {
- 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
- /*
- $(document).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;
- }
- }
- });
- */
-
-
- } else {
-
- // the hover state will show the fullscreen button in Flash to hover up and click
-
- fullscreenBtn
- .mouseover(function() {
-
- 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);
-
- })
- .mouseout(function() {
-
- if (hideTimeout !== null) {
- clearTimeout(hideTimeout);
- delete hideTimeout;
- }
-
- hideTimeout = setTimeout(function() {
- media.hideFullscreenButton();
- }, 1500);
-
-
- });
- }
- }
-
- player.fullscreenBtn = fullscreenBtn;
-
- $(document).bind('keydown',function (e) {
- if (((mejs.MediaFeatures.hasTrueNativeFullScreen && mejs.MediaFeatures.isFullScreen()) || t.isFullScreen) && e.keyCode == 27) {
- player.exitFullScreen();
- }
- });
-
- },
- enterFullScreen: function() {
-
- var t = this;
-
- // firefox+flash can't adjust plugin sizes without resetting :(
- if (t.media.pluginType !== 'native' && (mejs.MediaFeatures.isFirefox || t.options.usePluginFullScreen)) {
- //t.media.setFullscreen(true);
- //player.isFullScreen = true;
- return;
- }
-
- // store overflow
- docStyleOverflow = document.documentElement.style.overflow;
- // set it to not show scroll bars so 100% will work
- document.documentElement.style.overflow = 'hidden';
-
- // store sizing
- normalHeight = t.container.height();
- normalWidth = t.container.width();
-
- // attempt to do true fullscreen (Safari 5.1 and Firefox Nightly only for now)
- if (t.media.pluginType === 'native') {
- if (mejs.MediaFeatures.hasTrueNativeFullScreen) {
-
- mejs.MediaFeatures.requestFullScreen(t.container[0]);
- //return;
-
- if (t.isInIframe) {
- // sometimes exiting from fullscreen doesn't work
- // notably in Chrome
';
- } 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 += '
' + rendered + '
';
- }
- }
- }
-
- // 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);
-
- }
- });
-
+/*
+* 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 "Turn off Fullscreen";
+ } else {
+ return "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 "Unmute";
+ } else {
+ return "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 "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 = $('')
+ .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() {
+
+ //console.log('context hover out');
+ player.startContextMenuTimer();
+
+ });
+ },
+
+ isContextMenuEnabled: true,
+ enableContextMenu: function() {
+ this.isContextMenuEnabled = true;
+ },
+ disableContextMenu: function() {
+ this.isContextMenuEnabled = false;
+ },
+
+ contextMenuTimeout: null,
+ startContextMenuTimer: function() {
+ //console.log('startContextMenuTimer');
+
+ var t = this;
+
+ t.killContextMenuTimer();
+
+ t.contextMenuTimer = setTimeout(function() {
+ t.hideContextMenu();
+ t.killContextMenuTimer();
+ }, 750);
+ },
+ killContextMenuTimer: function() {
+ var timer = this.contextMenuTimer;
+
+ //console.log('killContextMenuTimer', timer);
+
+ 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
';
+ } 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 += '
' + rendered + '
';
+ }
+ }
+ }
+
+ // 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.$);
diff --git a/podlove-web-player/mediaelement/mediaelement-and-player.min.js b/podlove-web-player/mediaelement/mediaelement-and-player.min.js
index 38d034171..c31dccb34 100755
--- a/podlove-web-player/mediaelement/mediaelement-and-player.min.js
+++ b/podlove-web-player/mediaelement/mediaelement-and-player.min.js
@@ -10,10 +10,12 @@
* Copyright 2010-2012, John Dyer (http://j.hn)
* Dual licensed under the MIT or GPL Version 2 licenses.
*
-*/var mejs=mejs||{};mejs.version="2.9.1";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/x-flv","audio/flv","audio/x-flv","audio/mp3","audio/m4a","audio/mpeg","video/youtube","video/x-youtube"]}],youtube:[{version:null,types:["video/youtube","video/x-youtube"]}],vimeo:[{version:null,types:["video/vimeo"]}]};
+*/var mejs=mejs||{};mejs.version="2.9.5";mejs.meIndex=0;
+mejs.plugins={silverlight:[{version:[3,0],types:["video/mp4","video/m4v","video/mov","video/wmv","audio/wma","audio/m4a","audio/mp3","audio/wav","audio/mpeg"]}],flash:[{version:[9,0,124],types:["video/mp4","video/m4v","video/mov","video/flv","video/rtmp","video/x-flv","audio/flv","audio/x-flv","audio/mp3","audio/m4a","audio/mpeg","video/youtube","video/x-youtube"]}],youtube:[{version:null,types:["video/youtube","video/x-youtube"]}],vimeo:[{version:null,types:["video/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");b.innerHTML='
x';return b.firstChild.href},getScriptPath:function(a){for(var b=0,c,d="",e="",g,f=document.getElementsByTagName("script"),j=f.length,h=a.length;b
-1){d=g.substring(0,g.indexOf(e));break}}if(d!=="")break}return d},secondsToTimeCode:function(a,b,c,d){if(typeof c=="undefined")c=false;else if(typeof d=="undefined")d=25;var e=Math.floor(a/3600)%24,g=Math.floor(a/60)%60,f=Math.floor(a%60);a=Math.floor((a%1*d).toFixed(3));return(b||e>0?(e<10?"0"+e:e)+":":"")+(g<10?"0"+g:g)+":"+(f<10?"0"+f:f)+(c?":"+(a<10?"0"+a:a):"")},timeCodeToSeconds:function(a,b,c,d){if(typeof c=="undefined")c=false;else if(typeof d=="undefined")d=25;a=a.split(":");b=parseInt(a[0],
-10);var e=parseInt(a[1],10),g=parseInt(a[2],10),f=0,j=0;if(c)f=parseInt(a[3])/d;return j=b*3600+e*60+g+f},removeSwf:function(a){var b=document.getElementById(a);if(b&&b.nodeName=="OBJECT")if(mejs.MediaFeatures.isIE){b.style.display="none";(function(){b.readyState==4?mejs.Utility.removeObjectInIE(a):setTimeout(arguments.callee,10)})()}else b.parentNode.removeChild(b)},removeObjectInIE:function(a){if(a=document.getElementById(a)){for(var b in a)if(typeof a[b]=="function")a[b]=null;a.parentNode.removeChild(a)}}};
+10);var e=parseInt(a[1],10),g=parseInt(a[2],10),f=0,j=0;if(c)f=parseInt(a[3])/d;return j=b*3600+e*60+g+f},convertSMPTEtoSeconds:function(a){if(typeof a!="string")return false;a=a.replace(",",".");var b=0,c=a.indexOf(".")!=-1?a.split(".")[1].length:0,d=1;a=a.split(":").reverse();for(var e=0;e0)d=Math.pow(60,e);b+=Number(a[e])*d}return Number(b.toFixed(c))},removeSwf:function(a){var b=document.getElementById(a);if(b&&b.nodeName=="OBJECT")if(mejs.MediaFeatures.isIE){b.style.display=
+"none";(function(){b.readyState==4?mejs.Utility.removeObjectInIE(a):setTimeout(arguments.callee,10)})()}else b.parentNode.removeChild(b)},removeObjectInIE:function(a){if(a=document.getElementById(a)){for(var b in a)if(typeof a[b]=="function")a[b]=null;a.parentNode.removeChild(a)}}};
mejs.PluginDetector={hasPluginVersion:function(a,b){var c=this.plugins[a];b[1]=b[1]||0;b[2]=b[2]||0;return c[0]>b[0]||c[0]==b[0]&&c[1]>b[1]||c[0]==b[0]&&c[1]==b[1]&&c[2]>=b[2]?true:false},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=[0,0,0],g;if(typeof this.nav.plugins!="undefined"&&typeof this.nav.plugins[a]=="object"){if((c=this.nav.plugins[a].description)&&
!(typeof this.nav.mimeTypes!="undefined"&&this.nav.mimeTypes[b]&&!this.nav.mimeTypes[b].enabledPlugin)){e=c.replace(a,"").replace(/^\s+/,"").replace(/\sr/gi,".").split(".");for(a=0;a0&&g[0].url!==null&&this.getTypeFromFile(g[0].url).indexOf("audio")>-1)h.isVideo=false;if(mejs.MediaFeatures.isBustedAndroid)a.canPlayType=function(m){return m.match(/video\/(mp4|m4v)/gi)!==null?"maybe":""};if(c&&(b.mode==="auto"||b.mode==="native")){if(!d){f=document.createElement(h.isVideo?"video":"audio");a.parentNode.insertBefore(f,a);a.style.display="none";h.htmlMediaElement=a=f}for(f=0;f0)h.url=g[0].url;return h},formatType:function(a,b){return a&&!b?this.getTypeFromFile(a):b&&~b.indexOf(";")?b.substr(0,b.indexOf(";")):b},getTypeFromFile:function(a){a=a.substring(a.lastIndexOf(".")+1);return(/(mp4|m4v|ogg|ogv|webm|flv|wmv|mpeg|mov)/gi.test(a)?"video":"audio")+"/"+a},createErrorMessage:function(a,b,c){var d=a.htmlMediaElement,e=document.createElement("div");e.className="me-cannotplay";try{e.style.width=d.width+"px";e.style.height=d.height+"px"}catch(g){}e.innerHTML=c!==
-""?'':'Download File';d.parentNode.insertBefore(e,d);d.style.display="none";b.error(d)},createPlugin:function(a,b,c,d,e,g){c=a.htmlMediaElement;var f=1,j=1,h="me_"+a.method+"_"+mejs.meIndex++,l=new mejs.PluginMediaElement(h,a.method,a.url),k=document.createElement("div"),m;l.tagName=c.tagName;for(m=0;m0?b.videoWidth:c.getAttribute("width")!==null?c.getAttribute("width"):b.defaultVideoWidth;j=b.videoHeight>0?b.videoHeight:c.getAttribute("height")!==null?c.getAttribute("height"):b.defaultVideoHeight;f=mejs.Utility.encodeUrl(f);j=mejs.Utility.encodeUrl(j)}else if(b.enablePluginDebug){f=320;j=240}l.success=
-b.success;mejs.MediaPluginBridge.registerPluginElement(h,l,c);k.className="me-plugin";k.id=h+"_container";a.isVideo?c.parentNode.insertBefore(k,c):document.body.insertBefore(k,document.body.childNodes[0]);d=["id="+h,"isvideo="+(a.isVideo?"true":"false"),"autoplay="+(d?"true":"false"),"preload="+e,"width="+f,"startvolume="+b.startVolume,"timerrate="+b.timerRate,"height="+j];if(a.url!==null)a.method=="flash"?d.push("file="+mejs.Utility.encodeUrl(a.url)):d.push("file="+a.url);b.enablePluginDebug&&d.push("debug=true");
-b.enablePluginSmoothing&&d.push("smoothing=true");g&&d.push("controls=true");if(b.pluginVars)d=d.concat(b.pluginVars);switch(a.method){case "silverlight":k.innerHTML='';break;case "flash":if(mejs.MediaFeatures.isIE){a=document.createElement("div");k.appendChild(a);a.outerHTML=''}else k.innerHTML=
+j=this.formatType(e,j.getAttribute("type"));g.push({type:j,url:e})}}if(!d&&g.length>0&&g[0].url!==null&&this.getTypeFromFile(g[0].url).indexOf("audio")>-1)h.isVideo=false;if(mejs.MediaFeatures.isBustedAndroid)a.canPlayType=function(m){return m.match(/video\/(mp4|m4v)/gi)!==null?"maybe":""};if(c&&(b.mode==="auto"||b.mode==="auto_plugin"||b.mode==="native")){if(!d){f=document.createElement(h.isVideo?"video":"audio");a.parentNode.insertBefore(f,a);a.style.display="none";h.htmlMediaElement=a=f}for(f=
+0;f0)h.url=g[0].url;return h},formatType:function(a,b){return a&&!b?this.getTypeFromFile(a):b&&~b.indexOf(";")?b.substr(0,b.indexOf(";")):b},getTypeFromFile:function(a){a=a.substring(a.lastIndexOf(".")+1);return(/(mp4|m4v|ogg|ogv|webm|webmv|flv|wmv|mpeg|mov)/gi.test(a)?"video":"audio")+"/"+this.getTypeFromExtension(a)},getTypeFromExtension:function(a){switch(a){case "mp4":case "m4v":return"mp4";
+case "webm":case "webma":case "webmv":return"webm";case "ogg":case "oga":case "ogv":return"ogg";default:return a}},createErrorMessage:function(a,b,c){var d=a.htmlMediaElement,e=document.createElement("div");e.className="me-cannotplay";try{e.style.width=d.width+"px";e.style.height=d.height+"px"}catch(g){}e.innerHTML=c!==""?'':'Download File';d.parentNode.insertBefore(e,d);d.style.display="none";
+b.error(d)},createPlugin:function(a,b,c,d,e,g){c=a.htmlMediaElement;var f=1,j=1,h="me_"+a.method+"_"+mejs.meIndex++,l=new mejs.PluginMediaElement(h,a.method,a.url),k=document.createElement("div"),m;l.tagName=c.tagName;for(m=0;m0?b.videoWidth:c.getAttribute("width")!==null?c.getAttribute("width"):b.defaultVideoWidth;j=b.videoHeight>0?b.videoHeight:c.getAttribute("height")!==null?c.getAttribute("height"):b.defaultVideoHeight;f=mejs.Utility.encodeUrl(f);j=mejs.Utility.encodeUrl(j)}else if(b.enablePluginDebug){f=320;j=240}l.success=b.success;mejs.MediaPluginBridge.registerPluginElement(h,l,c);k.className="me-plugin";k.id=h+"_container";a.isVideo?c.parentNode.insertBefore(k,c):document.body.insertBefore(k,document.body.childNodes[0]);
+d=["id="+h,"isvideo="+(a.isVideo?"true":"false"),"autoplay="+(d?"true":"false"),"preload="+e,"width="+f,"startvolume="+b.startVolume,"timerrate="+b.timerRate,"flashstreamer="+b.flashStreamer,"height="+j];if(a.url!==null)a.method=="flash"?d.push("file="+mejs.Utility.encodeUrl(a.url)):d.push("file="+a.url);b.enablePluginDebug&&d.push("debug=true");b.enablePluginSmoothing&&d.push("smoothing=true");g&&d.push("controls=true");if(b.pluginVars)d=d.concat(b.pluginVars);switch(a.method){case "silverlight":k.innerHTML=
+'';break;case "flash":if(mejs.MediaFeatures.isIE){a=document.createElement("div");
+k.appendChild(a);a.outerHTML=''}else k.innerHTML=
'';break;case "youtube":b=a.url.substr(a.url.lastIndexOf("=")+1);youtubeSettings={container:k,containerId:k.id,pluginMediaElement:l,pluginId:h,videoId:b,
-height:j,width:f};mejs.PluginDetector.hasPluginVersion("flash",[10,0,0])?mejs.YouTubeApi.createFlash(youtubeSettings):mejs.YouTubeApi.enqueueIframe(youtubeSettings);break;case "vimeo":console.log("vimeoid");l.vimeoid=a.url.substr(a.url.lastIndexOf("/")+1);k.innerHTML=''}c.style.display=
-"none";return l},updateNative:function(a,b){var c=a.htmlMediaElement,d;for(d in mejs.HtmlMediaElement)c[d]=mejs.HtmlMediaElement[d];b.success(c,c);return c}};
+height:j,width:f};mejs.PluginDetector.hasPluginVersion("flash",[10,0,0])?mejs.YouTubeApi.createFlash(youtubeSettings):mejs.YouTubeApi.enqueueIframe(youtubeSettings);break;case "vimeo":l.vimeoid=a.url.substr(a.url.lastIndexOf("/")+1);k.innerHTML=''}c.style.display="none";return l},updateNative:function(a,b){var c=a.htmlMediaElement,d;for(d in mejs.HtmlMediaElement)c[d]=mejs.HtmlMediaElement[d];b.success(c,c);return c}};
mejs.YouTubeApi={isIframeStarted:false,isIframeLoaded:false,loadIframeApi:function(){if(!this.isIframeStarted){var a=document.createElement("script");a.src="http://www.youtube.com/player_api";var b=document.getElementsByTagName("script")[0];b.parentNode.insertBefore(a,b);this.isIframeStarted=true}},iframeQueue:[],enqueueIframe:function(a){if(this.isLoaded)this.createIframe(a);else{this.loadIframeApi();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},events:{onReady:function(){a.pluginMediaElement.pluginApi=c;mejs.MediaPluginBridge.initPlugin(a.pluginId);setInterval(function(){mejs.YouTubeApi.createEvent(c,b,"timeupdate")},250)},onStateChange:function(d){mejs.YouTubeApi.handleStateChange(d.data,c,b)}}})},createEvent:function(a,b,c){c={type:c,target:b};if(a&&a.getDuration){b.currentTime=c.currentTime=a.getCurrentTime();b.duration=c.duration=a.getDuration();c.paused=b.paused;
c.ended=b.ended;c.muted=a.isMuted();c.volume=a.getVolume()/100;c.bytesTotal=a.getVideoBytesTotal();c.bufferedBytes=a.getVideoBytesLoaded();var d=c.bufferedBytes/c.bytesTotal*c.duration;c.target.buffered=c.buffered={start:function(){return 0},end:function(){return d},length:1}}b.dispatchEvent(c.type,c)},iFrameReady:function(){for(this.isIframeLoaded=this.isLoaded=true;this.iframeQueue.length>0;)this.createIframe(this.iframeQueue.pop())},flashPlayers:{},createFlash:function(a){this.flashPlayers[a.pluginId]=
@@ -69,81 +71,83 @@ c,"pause");break;case 3:mejs.YouTubeApi.createEvent(b,c,"progress")}}};function
* Dual licensed under the MIT or GPL Version 2 licenses.
*
*/if(typeof jQuery!="undefined")mejs.$=jQuery;else if(typeof ender!="undefined")mejs.$=ender;
-(function(f){mejs.MepDefaults={poster:"",defaultVideoWidth:480,defaultVideoHeight:270,videoWidth:-1,videoHeight:-1,defaultAudioWidth:400,defaultAudioHeight:30,audioWidth:-1,audioHeight:-1,startVolume:0.8,loop:false,enableAutosize:true,alwaysShowHours:false,showTimecodeFrameCount:false,framesPerSecond:25,autosizeProgress:true,alwaysShowControls:false,iPadUseNativeControls:false,iPhoneUseNativeControls:false,AndroidUseNativeControls:false,features:["playpause","current","progress","duration","tracks",
-"volume","fullscreen"],isVideo:true,enableKeyboard:true,pauseOtherPlayers:true,keyActions:[{keys:[32,179],action:function(a,b){b.paused||b.ended?b.play():b.pause()}},{keys:[38],action:function(a,b){b.setVolume(Math.min(b.volume+0.1,1))}},{keys:[40],action:function(a,b){b.setVolume(Math.max(b.volume-0.1,0))}},{keys:[37,227],action:function(a,b){if(!isNaN(b.duration)&&b.duration>0){if(a.isVideo){a.showControls();a.startControlsTimer()}b.setCurrentTime(Math.max(b.currentTime-b.duration*0.05,0))}}},{keys:[39,
-228],action:function(a,b){if(!isNaN(b.duration)&&b.duration>0){if(a.isVideo){a.showControls();a.startControlsTimer()}b.setCurrentTime(Math.min(b.currentTime+b.duration*0.05,b.duration))}}},{keys:[70],action:function(a){if(typeof a.enterFullScreen!="undefined")a.isFullScreen?a.exitFullScreen():a.enterFullScreen()}}]};mejs.mepIndex=0;mejs.players=[];mejs.MediaElementPlayer=function(a,b){if(!(this instanceof mejs.MediaElementPlayer))return new mejs.MediaElementPlayer(a,b);this.$media=this.$node=f(a);
-this.node=this.media=this.$media[0];if(typeof this.node.player!="undefined")return this.node.player;else this.node.player=this;if(typeof b=="undefined")b=this.$node.data("mejsoptions");this.options=f.extend({},mejs.MepDefaults,b);mejs.players.push(this);this.init();return this};mejs.MediaElementPlayer.prototype={hasFocus:false,controlsAreVisible:true,init:function(){var a=this,b=mejs.MediaFeatures,c=f.extend(true,{},a.options,{success:function(e,g){a.meReady(e,g)},error:function(e){a.handleError(e)}}),
-d=a.media.tagName.toLowerCase();a.isDynamic=d!=="audio"&&d!=="video";a.isVideo=a.isDynamic?a.options.isVideo:d!=="audio"&&a.options.isVideo;if(b.isiPad&&a.options.iPadUseNativeControls||b.isiPhone&&a.options.iPhoneUseNativeControls){a.$media.attr("controls","controls");if(b.isiPad&&a.media.getAttribute("autoplay")!==null){a.media.load();a.media.play()}}else if(!(b.isAndroid&&a.AndroidUseNativeControls)){a.$media.removeAttr("controls");a.id="mep_"+mejs.mepIndex++;a.container=f('').addClass(a.$media[0].className).insertBefore(a.$media);
-a.container.addClass((b.isAndroid?"mejs-android ":"")+(b.isiOS?"mejs-ios ":"")+(b.isiPad?"mejs-ipad ":"")+(b.isiPhone?"mejs-iphone ":"")+(a.isVideo?"mejs-video ":"mejs-audio "));if(b.isiOS){b=a.$media.clone();a.container.find(".mejs-mediaelement").append(b);a.$media.remove();a.$node=a.$media=b;a.node=a.media=b[0]}else a.container.find(".mejs-mediaelement").append(a.$media);a.controls=a.container.find(".mejs-controls");a.layers=a.container.find(".mejs-layers");b=d.substring(0,1).toUpperCase()+d.substring(1);
-a.width=a.options[d+"Width"]>0||a.options[d+"Width"].toString().indexOf("%")>-1?a.options[d+"Width"]:a.media.style.width!==""&&a.media.style.width!==null?a.media.style.width:a.media.getAttribute("width")!==null?a.$media.attr("width"):a.options["default"+b+"Width"];a.height=a.options[d+"Height"]>0||a.options[d+"Height"].toString().indexOf("%")>-1?a.options[d+"Height"]:a.media.style.height!==""&&a.media.style.height!==null?a.media.style.height:a.$media[0].getAttribute("height")!==null?a.$media.attr("height"):
-a.options["default"+b+"Height"];a.setPlayerSize(a.width,a.height);c.pluginWidth=a.height;c.pluginHeight=a.width}mejs.MediaElement(a.$media[0],c)},showControls:function(a){var b=this;a=typeof a=="undefined"||a;if(!b.controlsAreVisible){if(a){b.controls.css("visibility","visible").stop(true,true).fadeIn(200,function(){b.controlsAreVisible=true});b.container.find(".mejs-control").css("visibility","visible").stop(true,true).fadeIn(200,function(){b.controlsAreVisible=true})}else{b.controls.css("visibility",
-"visible").css("display","block");b.container.find(".mejs-control").css("visibility","visible").css("display","block");b.controlsAreVisible=true}b.setControlsSize()}},hideControls:function(a){var b=this;a=typeof a=="undefined"||a;if(b.controlsAreVisible)if(a){b.controls.stop(true,true).fadeOut(200,function(){f(this).css("visibility","hidden").css("display","block");b.controlsAreVisible=false});b.container.find(".mejs-control").stop(true,true).fadeOut(200,function(){f(this).css("visibility","hidden").css("display",
-"block")})}else{b.controls.css("visibility","hidden").css("display","block");b.container.find(".mejs-control").css("visibility","hidden").css("display","block");b.controlsAreVisible=false}},controlsTimer:null,startControlsTimer:function(a){var b=this;a=typeof a!="undefined"?a:1500;b.killControlsTimer("start");b.controlsTimer=setTimeout(function(){b.hideControls();b.killControlsTimer("hide")},a)},killControlsTimer:function(){if(this.controlsTimer!==null){clearTimeout(this.controlsTimer);delete this.controlsTimer;
-this.controlsTimer=null}},controlsEnabled:true,disableControls:function(){this.killControlsTimer();this.hideControls(false);this.controlsEnabled=false},enableControls:function(){this.showControls(false);this.controlsEnabled=true},meReady:function(a,b){var c=this,d=mejs.MediaFeatures,e=b.getAttribute("autoplay");e=!(typeof e=="undefined"||e===null||e==="false");var g;if(!c.created){c.created=true;c.media=a;c.domNode=b;if(!(d.isAndroid&&c.options.AndroidUseNativeControls)&&!(d.isiPad&&c.options.iPadUseNativeControls)&&
-!(d.isiPhone&&c.options.iPhoneUseNativeControls)){c.buildposter(c,c.controls,c.layers,c.media);c.buildkeyboard(c,c.controls,c.layers,c.media);c.buildoverlays(c,c.controls,c.layers,c.media);c.findTracks();for(g in c.options.features){d=c.options.features[g];if(c["build"+d])try{c["build"+d](c,c.controls,c.layers,c.media)}catch(k){}}c.container.trigger("controlsready");c.setPlayerSize(c.width,c.height);c.setControlsSize();if(c.isVideo){if(mejs.MediaFeatures.hasTouch)c.$media.bind("touchstart",function(){if(c.controlsAreVisible)c.hideControls(false);
-else c.controlsEnabled&&c.showControls(false)});else{(c.media.pluginType=="native"?c.$media:f(c.media.pluginElement)).click(function(){a.paused?a.play():a.pause()});c.container.bind("mouseenter mouseover",function(){if(c.controlsEnabled)if(!c.options.alwaysShowControls){c.killControlsTimer("enter");c.showControls();c.startControlsTimer(2500)}}).bind("mousemove",function(){if(c.controlsEnabled){c.controlsAreVisible||c.showControls();c.options.alwaysShowControls||c.startControlsTimer(2500)}}).bind("mouseleave",
-function(){c.controlsEnabled&&!c.media.paused&&!c.options.alwaysShowControls&&c.startControlsTimer(1E3)})}e&&!c.options.alwaysShowControls&&c.hideControls();c.options.enableAutosize&&c.media.addEventListener("loadedmetadata",function(h){if(c.options.videoHeight<=0&&c.domNode.getAttribute("height")===null&&!isNaN(h.target.videoHeight)){c.setPlayerSize(h.target.videoWidth,h.target.videoHeight);c.setControlsSize();c.media.setVideoSize(h.target.videoWidth,h.target.videoHeight)}},false)}a.addEventListener("play",
-function(){for(var h=0,o=mejs.players.length;h0){var c=this.media.videoWidth&&this.media.videoWidth>0?this.media.videoWidth:this.options.defaultVideoWidth,
-d=this.media.videoHeight&&this.media.videoHeight>0?this.media.videoHeight:this.options.defaultVideoHeight,e=this.container.parent().width();c=parseInt(e*d/c,10);if(this.container.parent()[0].tagName.toLowerCase()==="body"){e=f(window).width();c=f(window).height()}this.container.width(e).height(c);this.$media.width("100%").height("100%");this.container.find("object, embed, iframe").width("100%").height("100%");this.media.setVideoSize&&this.media.setVideoSize(e,c);this.layers.children(".mejs-layer").width("100%").height("100%")}else{this.container.width(this.width).height(this.height);
-this.layers.children(".mejs-layer").width(this.width).height(this.height)}},setControlsSize:function(){var a=0,b=0,c=this.controls.find(".mejs-time-rail"),d=this.controls.find(".mejs-time-total");this.controls.find(".mejs-time-current");this.controls.find(".mejs-time-loaded");var e=c.siblings();if(this.options&&!this.options.autosizeProgress)b=parseInt(c.css("width"));if(b===0||!b){e.each(function(){if(f(this).css("position")!="absolute")a+=f(this).outerWidth(true)});b=this.controls.width()-a-(c.outerWidth(true)-
-c.width())}c.width(b);d.width(b-(d.outerWidth(true)-d.width()));this.setProgressRail&&this.setProgressRail();this.setCurrentRail&&this.setCurrentRail()},buildposter:function(a,b,c,d){var e=f('').appendTo(c);b=a.$media.attr("poster");if(a.options.poster!=="")b=a.options.poster;b!==""&&b!=null?this.setPoster(b):e.hide();d.addEventListener("play",function(){e.hide()},false)},setPoster:function(a){var b=this.container.find(".mejs-poster"),c=b.find("img");if(c.length==
-0)c=f('').appendTo(b);c.attr("src",a)},buildoverlays:function(a,b,c,d){if(a.isVideo){var e=f('').hide().appendTo(c),g=f('').hide().appendTo(c),k=f('').appendTo(c).click(function(){d.paused?d.play():
-d.pause()});d.addEventListener("play",function(){k.hide();e.hide();b.find(".mejs-time-buffering").hide();g.hide()},false);d.addEventListener("playing",function(){k.hide();e.hide();b.find(".mejs-time-buffering").hide();g.hide()},false);d.addEventListener("seeking",function(){e.show();b.find(".mejs-time-buffering").show()},false);d.addEventListener("seeked",function(){e.hide();b.find(".mejs-time-buffering").hide()},false);d.addEventListener("pause",function(){mejs.MediaFeatures.isiPhone||k.show()},
-false);d.addEventListener("waiting",function(){e.show();b.find(".mejs-time-buffering").show()},false);d.addEventListener("loadeddata",function(){e.show();b.find(".mejs-time-buffering").show()},false);d.addEventListener("canplay",function(){e.hide();b.find(".mejs-time-buffering").hide()},false);d.addEventListener("error",function(){e.hide();b.find(".mejs-time-buffering").hide();g.show();g.find("mejs-overlay-error").html("Error loading this resource")},false)}},buildkeyboard:function(a,b,c,d){f(document).keydown(function(e){if(a.hasFocus&&
-a.options.enableKeyboard)for(var g=0,k=a.options.keyActions.length;g ').appendTo(b).click(function(g){g.preventDefault();d.paused?d.play():d.pause();return false});d.addEventListener("play",function(){e.removeClass("mejs-play").addClass("mejs-pause")},false);
-d.addEventListener("playing",function(){e.removeClass("mejs-play").addClass("mejs-pause")},false);d.addEventListener("pause",function(){e.removeClass("mejs-pause").addClass("mejs-play")},false);d.addEventListener("paused",function(){e.removeClass("mejs-pause").addClass("mejs-play")},false)}})})(mejs.$);
-(function(f){f.extend(mejs.MepDefaults,{stopText:"Stop"});f.extend(MediaElementPlayer.prototype,{buildstop:function(a,b,c,d){f('