mw.loader.implement("fullScreenApi",function(){(function(){var fullScreenApi={supportsFullScreen:false,isFullScreen:function(){return false;},requestFullScreen:function(){},cancelFullScreen:function(){},fullScreenEventName:'',prefix:''},browserPrefixes='webkit moz o ms khtml'.split(' ');if(typeof document.cancelFullScreen!='undefined'){fullScreenApi.supportsFullScreen=true;}else{for(var i=0,il=browserPrefixes.length;i<il;i++){fullScreenApi.prefix=browserPrefixes[i];if(typeof document[fullScreenApi.prefix+'CancelFullScreen']!='undefined'){fullScreenApi.supportsFullScreen=true;break;}}}if(fullScreenApi.supportsFullScreen){fullScreenApi.fullScreenEventName=fullScreenApi.prefix+'fullscreenchange';fullScreenApi.isFullScreen=function(doc){if(!doc){doc=document;}switch(this.prefix){case'':return doc.fullScreen;case'webkit':return doc.webkitIsFullScreen;default:return doc[this.prefix+'FullScreen'];}}
fullScreenApi.requestFullScreen=function(el){return(this.prefix==='')?el.requestFullScreen():el[this.prefix+'RequestFullScreen']();}
fullScreenApi.cancelFullScreen=function(el){return(this.prefix==='')?document.cancelFullScreen():document[this.prefix+'CancelFullScreen']();}}if(typeof jQuery!='undefined'){jQuery.fn.requestFullScreen=function(){return this.each(function(){var el=jQuery(this);if(fullScreenApi.supportsFullScreen){fullScreenApi.requestFullScreen(el);}});};}window.fullScreenApi=fullScreenApi;})();;},{},{});mw.loader.implement("jquery.debouncedresize",function(){(function($){var $event=$.event,$special,resizeTimeout;$special=$event.special.debouncedresize={setup:function(){$(this).on("resize",$special.handler);},teardown:function(){$(this).off("resize",$special.handler);},handler:function(event,execAsap){var context=this,args=arguments,dispatch=function(){event.type="debouncedresize";$event.dispatch.apply(context,args);};if(resizeTimeout){clearTimeout(resizeTimeout);}execAsap?dispatch():resizeTimeout=setTimeout(dispatch,$special.threshold);},threshold:150};})(jQuery);;},{},{});mw.loader.implement(
"jquery.embedMenu",function(){var allUIMenus=[];(function($){$.getLineItem=function(string,icon,callback,opt_class,opt_data){var $li=$('<li>').append($('<a>').attr('href','#').click(callback));if(!opt_class){opt_class='';}if(!opt_data){opt_data=[];}if(icon){$li.find('a').append($('<span style="float:left;"></span>').addClass('ui-icon ui-icon-'+icon).addClass(opt_class).data(opt_data));}$li.find('a').append($('<span>').text(string));return $li;};$.fn.embedMenu=function(options){var caller=this;var options=options;if(!caller.m){caller.m=new Menu(caller,options);allUIMenus.push(caller.m);$(this).mousedown(function(){if(!caller.m.menuOpen){caller.m.showLoading();};}).click(function(){if(caller.m.menuOpen==false){caller.m.showMenu();}else{caller.m.kill();};return false;});}if(options.autoShow){setTimeout(function(){caller.m.showLoading();caller.m.showMenu();},0);}if(options=='show'){caller.m.showMenu();}return this;};function Menu(caller,options){var menu=this;var caller=$(caller);mw.log(
'jquery.Menu:: target container: '+options.targetMenuContainer);var callerClassList='fg-menu-container ui-widget ui-widget-content ui-corner-all';if(options.targetMenuContainer){var container=$(options.targetMenuContainer).addClass(callerClassList).html(options.content)}else{var container=$('<div>').addClass(callerClassList).html(options.content);}this.menuOpen=false;this.menuExists=false;var options=jQuery.extend({content:null,autoShow:false,width:180,maxHeight:180,targetMenuContainer:null,zindex:2,positionOpts:{posX:'left',posY:'bottom',offsetX:0,offsetY:0,directionH:'right',directionV:'down',detectH:true,detectV:true,linkToFront:false},showSpeed:200,createMenuCallback:null,closeMenuCallback:null,callerOnState:'ui-state-active',loadingState:'ui-state-loading',linkHover:'ui-state-hover',linkHoverSecondary:'li-hover',crossSpeed:200,crumbDefaultText:'Choose an option:',backLink:true,backLinkText:'Back',flyOut:false,flyOutOnState:'ui-state-default',nextMenuLink:'ui-icon-triangle-1-e',
topLinkText:'All',nextCrumbLink:'ui-icon-carat-1-e'},options);container.css({'left':'0px','z-index':options.zindex});var killAllMenus=function(){$.each(allUIMenus,function(i){if(allUIMenus[i].menuOpen){allUIMenus[i].kill();};});};this.kill=function(){caller.removeClass(options.loadingState).removeClass('fg-menu-open').removeClass(options.callerOnState);container.find('li').removeClass(options.linkHoverSecondary).find('a').removeClass(options.linkHover);if(options.flyOutOnState){container.find('li a').removeClass(options.flyOutOnState);};if(options.callerOnState){caller.removeClass(options.callerOnState);};if(container.is('.fg-menu-ipod')){menu.resetDrilldownMenu();};if(container.is('.fg-menu-flyout')){menu.resetFlyoutMenu();};if(!options.keepPosition){container.parent().hide();}else{container.hide();}menu.menuOpen=false;if(typeof options.closeMenuCallback=='function'){options.closeMenuCallback();}$(document).unbind('click',killAllMenus);$(document).unbind('keydown');};this.showLoading=
function(){caller.addClass(options.loadingState);};this.showMenu=function(){mw.log('jquery.embedMenu:: show menu');killAllMenus();menu.create()
mw.log('jquery.embedMenu:: menu.create');caller.addClass('fg-menu-open').addClass(options.callerOnState);container.parent().show().click(function(){menu.kill();return false;});mw.log('jquery.embedMenu:: menu. binding container');container.hide().slideDown(options.showSpeed).find('.fg-menu:eq(0)');menu.menuOpen=true;caller.removeClass(options.loadingState);$(document).click(killAllMenus);$(document).keydown(function(event){var e;if(event.which!=""){e=event.which;}else if(event.charCode!=""){e=event.charCode;}else if(event.keyCode!=""){e=event.keyCode;}var menuType=($(event.target).parents('div').is('.fg-menu-flyout'))?'flyout':'ipod';switch(e){case 37:if(menuType=='flyout'){$(event.target).trigger('mouseout');if($('.'+options.flyOutOnState).size()>0){$('.'+options.flyOutOnState).trigger('mouseover');};};if(menuType=='ipod'){$(event.target).trigger('mouseout');if($('.fg-menu-footer').find('a').size()>0){$('.fg-menu-footer').find('a').trigger('click');};if($('.fg-menu-header').find('a').
size()>0){$('.fg-menu-current-crumb').prev().find('a').trigger('click');};if($('.fg-menu-current').prev().is('.fg-menu-indicator')){$('.fg-menu-current').prev().trigger('mouseover');};};return false;break;case 38:if($(event.target).is('.'+options.linkHover)){var prevLink=$(event.target).parent().prev().find('a:eq(0)');if(prevLink.size()>0){$(event.target).trigger('mouseout');prevLink.trigger('mouseover');};}else{container.find('a:eq(0)').trigger('mouseover');}return false;break;case 39:if($(event.target).is('.fg-menu-indicator')){if(menuType=='flyout'){$(event.target).next().find('a:eq(0)').trigger('mouseover');}else if(menuType=='ipod'){$(event.target).trigger('click');setTimeout(function(){$(event.target).next().find('a:eq(0)').trigger('mouseover');},options.crossSpeed);};};return false;break;case 40:if($(event.target).is('.'+options.linkHover)){var nextLink=$(event.target).parent().next().find('a:eq(0)');if(nextLink.size()>0){$(event.target).trigger('mouseout');nextLink.trigger(
'mouseover');};}else{container.find('a:eq(0)').trigger('mouseover');}return false;break;case 27:killAllMenus();break;case 13:if($(event.target).is('.fg-menu-indicator')&&menuType=='ipod'){$(event.target).trigger('click');setTimeout(function(){$(event.target).next().find('a:eq(0)').trigger('mouseover');},options.crossSpeed);};break;};});};this.create=function(){mw.log("jquery.embedMenu.create ");container.css({'width':options.width}).find('ul:first').not('.fg-menu-breadcrumb').addClass('fg-menu');if(!options.keepPosition){container.appendTo('body')}container.find('ul, li a').addClass('ui-corner-all');container.find('ul').attr('role','menu').eq(0).attr('aria-activedescendant','active-menuitem').attr('aria-labelledby',caller.attr('id'));container.find('li').attr('role','menuitem');container.find('li:has(ul)').attr('aria-haspopup','true').find('ul').attr('aria-expanded','false');container.find('a').attr('tabindex','-1');if(container.find('ul').size()>1){if(options.flyOut){mw.log(
"jquery.embedMenu:: call menu.flyout ");menu.flyout(container,options);}else{mw.log("jquery.embedMenu:: call menu.drilldown ");menu.drilldown(container,options);}}else{container.find('a').click(function(){menu.chooseItem(this);return false;});};if(options.linkHover){var allLinks=container.find('.fg-menu li a');allLinks.hover(function(){var menuitem=$(this);var menuli=menuitem.parent();if(!menuli.hasClass('divider')&&!menuli.hasClass('disabled')){$('.'+options.linkHover).removeClass(options.linkHover).blur().parent().removeAttr('id');$(this).addClass(options.linkHover).focus().parent().addClass('active-menuitem');}},function(){if(typeof menuitem!='undefined'&&!menuitem.hasClass('divider')&&!menuitem.hasClass('disabled')){$(this).removeClass(options.linkHover).blur().parent().removeClass('active-menuitem');}});};if(options.linkHoverSecondary){container.find('.fg-menu li').hover(function(){$(this).siblings('li').removeClass(options.linkHoverSecondary);if(options.flyOutOnState){$(this).
siblings('li').find('a').removeClass(options.flyOutOnState);}$(this).addClass(options.linkHoverSecondary);},function(){$(this).removeClass(options.linkHoverSecondary);});};if(!options.keepPosition){menu.setPosition(container,caller,options);}menu.menuExists=true;if(typeof options.createMenuCallback=='function'){options.createMenuCallback();}};this.chooseItem=function(item){menu.kill();if(options.selectItemCallback)options.selectItemCallback(item);};};Menu.prototype.flyout=function(container,options){var menu=this;this.resetFlyoutMenu=function(){var allLists=container.find('ul ul');allLists.removeClass('ui-widget-content').hide();};container.addClass('fg-menu-flyout').find('li:has(ul)').each(function(){var linkWidth=container.width();var showTimer,hideTimer;var allSubLists=$(this).find('ul');allSubLists.css({left:linkWidth,width:linkWidth}).hide();$(this).find('a:eq(0)').addClass('fg-menu-indicator').html('<span>'+$(this).find('a:eq(0)').html()+'</span><span class="ui-icon '+options.
nextMenuLink+'"></span>').hover(function(){clearTimeout(hideTimer);var subList=$(this).next();if(!fitVertical(subList,$(this).offset().top)){subList.css({top:'auto',bottom:0});};if(!fitHorizontal(subList,$(this).offset().left+100)){subList.css({left:'auto',right:linkWidth,'z-index':1005});};showTimer=setTimeout(function(){subList.addClass('ui-widget-content').show(options.showSpeed).attr('aria-expanded','true');},300);},function(){clearTimeout(showTimer);var subList=$(this).next();hideTimer=setTimeout(function(){subList.removeClass('ui-widget-content').hide(options.showSpeed).attr('aria-expanded','false');},400);});$(this).find('ul a').hover(function(){clearTimeout(hideTimer);if($(this).parents('ul').prev().is('a.fg-menu-indicator')){$(this).parents('ul').prev().addClass(options.flyOutOnState);}},function(){hideTimer=setTimeout(function(){allSubLists.hide(options.showSpeed);container.find(options.flyOutOnState).removeClass(options.flyOutOnState);},500);});});container.find('a').click(
function(){menu.chooseItem(this);return false;});};Menu.prototype.drilldown=function(container,options){var menu=this;var topList=container.find('.fg-menu');var breadcrumb=$('<ul class="fg-menu-breadcrumb ui-widget-header ui-corner-all ui-helper-clearfix"></ul>');var crumbDefaultHeader=$('<li class="fg-menu-breadcrumb-text">'+options.crumbDefaultText+'</li>');var firstCrumbText=(options.backLink)?options.backLinkText:options.topLinkText;var firstCrumbClass=(options.backLink)?'fg-menu-prev-list':'fg-menu-all-lists';var firstCrumbLinkClass=(options.backLink)?'ui-state-default ui-corner-all':'';var firstCrumbIcon=(options.backLink)?'<span class="ui-icon ui-icon-triangle-1-w"></span>':'';var firstCrumb=$('<li class="'+firstCrumbClass+'"><a href="#" class="'+firstCrumbLinkClass+'">'+firstCrumbIcon+firstCrumbText+'</a></li>');container.addClass('fg-menu-ipod');if(options.backLink){breadcrumb.addClass('fg-menu-footer').appendTo(container).hide();}else{breadcrumb.addClass('fg-menu-header').
prependTo(container);};breadcrumb.append(crumbDefaultHeader);var checkMenuHeight=function(el){if(el.height()>options.maxHeight){el.addClass('fg-menu-scroll')};el.css({height:options.maxHeight-30});};var resetChildMenu=function(el){el.removeClass('fg-menu-scroll').removeClass('fg-menu-current').height('auto');};this.resetDrilldownMenu=function(){$('.fg-menu-current').removeClass('fg-menu-current');topList.animate({left:0},options.crossSpeed,function(){$(this).find('ul').each(function(){$(this).hide();resetChildMenu($(this));});topList.addClass('fg-menu-current');});$('.fg-menu-all-lists').find('span').remove();breadcrumb.empty().append(crumbDefaultHeader);$('.fg-menu-footer').empty().hide();checkMenuHeight(topList);};topList.addClass('fg-menu-content fg-menu-current ui-widget-content ui-helper-clearfix').css({width:container.width()}).find('ul').css({width:container.width(),left:container.width()}).addClass('ui-widget-content').hide();checkMenuHeight(topList);topList.find('a').each(
function(){if($(this).next().is('ul')){$(this).addClass('fg-menu-indicator').each(function(){if(!$(this).hasClass('fg-menu-link')){$(this).addClass('fg-menu-link').html(nextMenuLink='<span>'+$(this).html()+'</span><span class="ui-icon '+options.nextMenuLink+'"></span>')}}).click(function(){var nextList=$(this).next();var parentUl=$(this).parents('ul:eq(0)');var parentLeft=(parentUl.is('.fg-menu-content'))?0:parseFloat(topList.css('left'));var nextLeftVal=Math.round(parentLeft-parseFloat(container.width()));var footer=$('.fg-menu-footer');resetChildMenu(parentUl);checkMenuHeight(nextList);topList.animate({left:nextLeftVal},options.crossSpeed);nextList.show().addClass('fg-menu-current').attr('aria-expanded','true');var setPrevMenu=function(backlink){var b=backlink;var c=$('.fg-menu-current');var prevList=c.parents('ul:eq(0)');c.hide().attr('aria-expanded','false');resetChildMenu(c);checkMenuHeight(prevList);prevList.addClass('fg-menu-current').attr('aria-expanded','true');if(prevList.
hasClass('fg-menu-content')){b.remove();footer.hide();};};if(options.backLink){if(footer.find('a').size()==0){footer.show();$('<a href="#"><span class="ui-icon ui-icon-triangle-1-w"></span> <span>Back</span></a>').appendTo(footer).click(function(){var b=$(this);var prevLeftVal=parseFloat(topList.css('left'))+container.width();topList.animate({left:prevLeftVal},options.crossSpeed,function(){setPrevMenu(b);});return false;});}}else{if(breadcrumb.find('li').size()==1){breadcrumb.empty().append(firstCrumb);firstCrumb.find('a').click(function(){menu.resetDrilldownMenu();return false;});}$('.fg-menu-current-crumb').removeClass('fg-menu-current-crumb');var crumbText=$(this).find('span:eq(0)').text();var newCrumb=$('<li class="fg-menu-current-crumb"><a href="javascript://" class="fg-menu-crumb">'+crumbText+'</a></li>');newCrumb.appendTo(breadcrumb).find('a').click(function(){if($(this).parent().is('.fg-menu-current-crumb')){menu.chooseItem(this);}else{var newLeftVal=-($('.fg-menu-current').
parents('ul').size()-1)*180;topList.animate({left:newLeftVal},options.crossSpeed,function(){setPrevMenu();});$(this).parent().addClass('fg-menu-current-crumb').find('span').remove();$(this).parent().nextAll().remove();};return false;});newCrumb.prev().append(' <span class="ui-icon '+options.nextCrumbLink+'"></span>');};return false;});}else{$(this).click(function(){menu.chooseItem(this);return false;});};});};Menu.prototype.setPosition=function(widget,caller,options){mw.log('jquery.embedMenu::setPosition');var el=widget;var referrer=caller;var dims={refX:referrer.offset().left,refY:referrer.offset().top,refW:referrer.getTotalWidth(),refH:referrer.getTotalHeight()};var options=options;var xVal,yVal;var helper=$('<div class="menuPositionHelper">');helper.css('z-index',options.zindex);if(isNaN(dims.refW)||isNaN(dims.refH)){dims.refH=16;dims.refW=23;}helper.css({'position':'absolute','left':dims.refX,'top':dims.refY,'width':dims.refW,'height':dims.refH});el.wrap(helper);xVal=yVal=0;switch(
options.positionOpts.posX){case'left':xVal=0;break;case'center':xVal=dims.refW/2;break;case'right':xVal=dims.refW;break;};switch(options.positionOpts.posY){case'top':yVal=0;break;case'center':yVal=dims.refH/2;break;case'bottom':yVal=dims.refH;break;};xVal+=(options.positionOpts.offsetX)?options.positionOpts.offsetX:0;yVal+=(options.positionOpts.offsetY)?options.positionOpts.offsetY:0;mw.log(" about to position: "+yVal);if(options.positionOpts.directionV=='up'){el.css({'top':'auto','bottom':yVal});if(options.positionOpts.detectV&&!fitVertical(el)){el.css({'bottom':'auto','top':yVal});}}else{el.css({'bottom':'auto','top':yVal});if(options.positionOpts.detectV&&!fitVertical(el)){el.css({'top':'auto','bottom':yVal});}};if(options.positionOpts.directionH=='left'){el.css({left:'auto',right:xVal});if(options.positionOpts.detectH&&!fitHorizontal(el)){el.css({right:'auto',left:xVal});}}else{el.css({right:'auto',left:xVal});if(options.positionOpts.detectH&&!fitHorizontal(el)){el.css({left:'auto'
,right:xVal});}};if(options.positionOpts.linkToFront){referrer.clone().addClass('linkClone').css({position:'absolute',top:0,right:'auto',bottom:'auto',left:0,width:referrer.width(),height:referrer.height()}).insertAfter(el);};};function sortBigToSmall(a,b){return b-a;};jQuery.fn.getTotalWidth=function(){return $(this).width()+parseInt($(this).css('paddingRight'))+parseInt($(this).css('paddingLeft'))+parseInt($(this).css('borderRightWidth'))+parseInt($(this).css('borderLeftWidth'));};jQuery.fn.getTotalHeight=function(){return $(this).height()+parseInt($(this).css('paddingTop'))+parseInt($(this).css('paddingBottom'))+parseInt($(this).css('borderTopWidth'))+parseInt($(this).css('borderBottomWidth'));};function getScrollTop(){return self.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop;};function getScrollLeft(){return self.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft;};function getWindowHeight(){var de=document.documentElement;return self
.innerHeight||(de&&de.clientHeight)||document.body.clientHeight;};function getWindowWidth(){var de=document.documentElement;return self.innerWidth||(de&&de.clientWidth)||document.body.clientWidth;};function fitHorizontal(el,leftOffset){var leftVal=parseInt(leftOffset)||$(el).offset().left;return(leftVal+$(el).width()<=getWindowWidth()+getScrollLeft()&&leftVal-getScrollLeft()>=0);};function fitVertical(el,topOffset){var topVal=parseInt(topOffset)||$(el).offset().top;return(topVal+$(el).height()<=getWindowHeight()+getScrollTop()&&topVal-getScrollTop()>=0);};Number.prototype.pxToEm=String.prototype.pxToEm=function(settings){settings=jQuery.extend({scope:'body',reverse:false},settings);var pxVal=(this=='')?0:parseFloat(this);var scopeVal;var getWindowWidth=function(){var de=document.documentElement;return self.innerWidth||(de&&de.clientWidth)||document.body.clientWidth;};if(settings.scope=='body'&&$.browser.msie&&(parseFloat($('body').css('font-size'))/getWindowWidth()).toFixed(1)>0.0){var
calcFontSize=function(){return(parseFloat($('body').css('font-size'))/getWindowWidth()).toFixed(3)*16;};scopeVal=calcFontSize();}else{scopeVal=parseFloat(jQuery(settings.scope).css("font-size"));};var result=(settings.reverse==true)?(pxVal*scopeVal).toFixed(2)+'px':(pxVal/scopeVal).toFixed(2)+'em';return result;};})(jQuery);;},{"css":[
".fg-menu-container{position:absolute;top:0;left:-999px;padding:.4em;overflow:hidden}.fg-menu-container.fg-menu-flyout{overflow:visible}.fg-menu,.fg-menu ul{list-style:none none;padding:0;margin:0}.fg-menu{position:relative}.fg-menu-flyout .fg-menu{position:static}.fg-menu ul{position:absolute;top:0}.fg-menu ul ul{top:-1px}.fg-menu-container.fg-menu-ipod .fg-menu-content,.fg-menu-container.fg-menu-ipod .fg-menu-content ul{background:none !important}.fg-menu.fg-menu-scroll,.fg-menu ul.fg-menu-scroll{overflow:scroll;overflow-x:hidden}.fg-menu li{clear:both;float:left;width:100%;margin:0;padding:0;border:0}.fg-menu li li{font-size:1em} .fg-menu-flyout ul ul{padding:.4em}.fg-menu-flyout li{position:relative}.fg-menu-scroll{overflow:scroll;overflow-x:hidden}.fg-menu-breadcrumb{margin:0;padding:0}.fg-menu-footer{margin-top:.4em;padding:.4em;position:absolute;bottom:2px;width:170px}.fg-menu-header{margin-bottom:.4em;padding:.4em}.fg-menu-breadcrumb li{float:left;list-style:none;margin:0;padding:0 .2em;font-size:.9em;opacity:.7}.fg-menu-breadcrumb li.fg-menu-prev-list,.fg-menu-breadcrumb li.fg-menu-current-crumb{clear:left;float:none;opacity:1}.fg-menu-breadcrumb li.fg-menu-current-crumb{padding-top:.2em}.fg-menu-breadcrumb a,.fg-menu-breadcrumb span{float:left}.fg-menu-footer a:link,.fg-menu-footer a:visited{float:left;width:100%;text-decoration:none}.fg-menu-footer a:hover,.fg-menu-footer a:active{}.fg-menu-footer a span{float:left;cursor:pointer}.fg-menu-breadcrumb .fg-menu-prev-list a:link,.fg-menu-breadcrumb .fg-menu-prev-list a:visited,.fg-menu-breadcrumb .fg-menu-prev-list a:hover,.fg-menu-breadcrumb .fg-menu-prev-list a:active{background-image:none;text-decoration:none}.fg-menu-breadcrumb .fg-menu-prev-list a{float:left;padding-right:.4em}.fg-menu-breadcrumb .fg-menu-prev-list a .ui-icon{float:left}.fg-menu-breadcrumb .fg-menu-current-crumb a:link,.fg-menu-breadcrumb .fg-menu-current-crumb a:visited,.fg-menu-breadcrumb .fg-menu-current-crumb a:hover,.fg-menu-breadcrumb .fg-menu-current-crumb a:active{display:block;background-image:none;font-size:1.3em;text-decoration:none} .fg-menu a:link,.fg-menu a:visited,.fg-menu a:hover,.fg-menu a:active{float:left;width:92%;padding:.3em 3%;text-decoration:none;outline:0 !important}.fg-menu a{border:1px dashed transparent}.fg-menu a.ui-state-default:link,.fg-menu a.ui-state-default:visited,.fg-menu a.ui-state-default:hover,.fg-menu a.ui-state-default:active,.fg-menu a.ui-state-hover:link,.fg-menu a.ui-state-hover:visited,.fg-menu a.ui-state-hover:hover,.fg-menu a.ui-state-hover:active,.fg-menu a.ui-state-active:link,.fg-menu a.ui-state-active:visited,.fg-menu a.ui-state-active:hover,.fg-menu a.ui-state-active:active{border-style:solid;font-weight:normal}.fg-menu a span{display:block;cursor:pointer} .fg-menu-indicator span{float:left}.fg-menu-indicator span.ui-icon{float:right}.fg-menu-content.ui-widget-content,.fg-menu-content ul.ui-widget-content{border:0} .fg-menu.fg-menu-has-icons a:link,.fg-menu.fg-menu-has-icons a:visited,.fg-menu.fg-menu-has-icons a:hover,.fg-menu.fg-menu-has-icons a:active{padding-left:20px}.fg-menu .horizontal-divider hr,.fg-menu .horizontal-divider span{padding:0;margin:5px .6em}.fg-menu .horizontal-divider hr{border:0;height:1px}.fg-menu .horizontal-divider span{font-size:.9em;text-transform:uppercase;padding-left:.2em}\n/* cache key: enwiki:resourceloader:filter:minify-css:7:07c1dbbd746dbcd172dda643369b3cb7 */"
]},{});mw.loader.implement("jquery.hoverIntent",function(){(function($){$.fn.hoverIntent=function(f,g){var cfg={sensitivity:7,interval:100,timeout:0};cfg=$.extend(cfg,g?{over:f,out:g}:f);var cX,cY,pX,pY;var track=function(ev){cX=ev.pageX;cY=ev.pageY;};var compare=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);if((Math.abs(pX-cX)+Math.abs(pY-cY))<cfg.sensitivity){$(ob).unbind("mousemove",track);ob.hoverIntent_s=1;return cfg.over.apply(ob,[ev]);}else{pX=cX;pY=cY;ob.hoverIntent_t=setTimeout(function(){compare(ev,ob);},cfg.interval);}};var delay=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);ob.hoverIntent_s=0;return cfg.out.apply(ob,[ev]);};var handleHover=function(e){var p=(e.type=="mouseover"?e.fromElement:e.toElement)||e.relatedTarget;while(p&&p!=this){try{p=p.parentNode;}catch(e){p=this;}}if(p==this){return false;}var ev=$.extend({},e);var ob=this;if(ob.hoverIntent_t){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);}if(e.type=="mouseover"){pX=ev.pageX
;pY=ev.pageY;$(ob).bind("mousemove",track);if(ob.hoverIntent_s!=1){ob.hoverIntent_t=setTimeout(function(){compare(ev,ob);},cfg.interval);}}else{$(ob).unbind("mousemove",track);if(ob.hoverIntent_s==1){ob.hoverIntent_t=setTimeout(function(){delay(ev,ob);},cfg.timeout);}}};return this.mouseover(handleHover).mouseout(handleHover);};})(jQuery);;},{},{});mw.loader.implement("jquery.ui.touchPunch",function(){(function($){jQuery.ui['touchPunch']=true;$.support.touch='ontouchend'in document;if(!$.support.touch){return;}var mouseProto=$.ui.mouse.prototype,_mouseInit=mouseProto._mouseInit,touchHandled;function simulateMouseEvent(event,simulatedType){if(event.originalEvent.touches.length>1){return;}event.preventDefault();var touch=event.originalEvent.changedTouches[0],simulatedEvent=document.createEvent('MouseEvents');simulatedEvent.initMouseEvent(simulatedType,true,true,window,1,touch.screenX,touch.screenY,touch.clientX,touch.clientY,false,false,false,false,0,null);event.target.dispatchEvent(
simulatedEvent);}mouseProto._touchStart=function(event){var self=this;if(touchHandled||!self._mouseCapture(event.originalEvent.changedTouches[0])){return;}touchHandled=true;self._touchMoved=false;simulateMouseEvent(event,'mouseover');simulateMouseEvent(event,'mousemove');simulateMouseEvent(event,'mousedown');};mouseProto._touchMove=function(event){if(!touchHandled){return;}this._touchMoved=true;simulateMouseEvent(event,'mousemove');};mouseProto._touchEnd=function(event){if(!touchHandled){return;}simulateMouseEvent(event,'mouseup');simulateMouseEvent(event,'mouseout');if(!this._touchMoved){simulateMouseEvent(event,'click');}touchHandled=false;};mouseProto._mouseInit=function(){var self=this;self.element.bind('touchstart',$.proxy(self,'_touchStart')).bind('touchmove',$.proxy(self,'_touchMove')).bind('touchend',$.proxy(self,'_touchEnd'));_mouseInit.call(self);};})(jQuery);;},{},{});mw.loader.implement("mediawiki.UtilitiesTime",function(){(function(mw){mw.seconds2npt=function(sec,show_ms){
if(isNaN(sec)){mw.log("Warning: mediawiki.UtilitiesTime, trying to get npt time on NaN:"+sec);return'0:00:00';}var tm=mw.seconds2Measurements(sec);if(show_ms){tm.seconds=Math.round(tm.seconds*1000)/1000;}else{tm.seconds=Math.round(tm.seconds);}if(tm.seconds<10){tm.seconds='0'+tm.seconds;}if(tm.hours==0){hoursStr='';}else{if(tm.minutes<10)tm.minutes='0'+tm.minutes;hoursStr=tm.hours+":";}return hoursStr+tm.minutes+":"+tm.seconds;};mw.seconds2Measurements=function(sec){var tm={};tm.days=Math.floor(sec/(3600*24));tm.hours=Math.floor(sec/3600);tm.minutes=Math.floor((sec/60)%60);tm.seconds=sec%60;return tm;};mw.measurements2seconds=function(timeMeasurements){var seconds=0;if(timeMeasurements.days){seconds+=parseInt(timeMeasurements.days,10)*24*3600;}if(timeMeasurements.hours){seconds+=parseInt(timeMeasurements.hours,10)*3600;}if(timeMeasurements.minutes){seconds+=parseInt(timeMeasurements.minutes,10)*60;}if(timeMeasurements.seconds){seconds+=parseInt(timeMeasurements.seconds,10);}if(
timeMeasurements.milliseconds){seconds+=parseFloat(timeMeasurements.milliseconds)/1000;}return seconds;};mw.npt2seconds=function(npt_str){if(!npt_str){return 0;}npt_str=npt_str.replace(/npt:|s/g,'');var hour=0;var min=0;var sec=0;times=npt_str.split(':');if(times.length==3){sec=times[2];min=times[1];hour=times[0];}else if(times.length==2){sec=times[1];min=times[0];}else{sec=times[0];}sec=sec.replace(/,\s?/,'.');return parseInt(hour*3600)+parseInt(min*60)+parseFloat(sec);};})(window.mediaWiki);;},{},{});mw.loader.implement("mediawiki.absoluteUrl",function(){(function(mw){mw.absoluteUrl=function(source,contextUrl){if(source.indexOf('http://')===0||source.indexOf('https://')===0){return source;}if(!contextUrl){contextUrl=document.URL;}var contextUrl=new mw.Uri(contextUrl);if(source.indexOf('//')===0){return contextUrl.protocol+':'+source;}if(contextUrl.directory==''&&contextUrl.protocol=='file'){var fileUrl=contextUrl.split('\\');fileUrl.pop();return fileUrl.join('\\')+'\\'+src;}if(source
.indexOf('/')===0){return contextUrl.protocol+'://'+contextUrl.getAuthority()+source;}else{return contextUrl.protocol+'://'+contextUrl.getAuthority()+contextUrl.path+source;}};})(window.mediaWiki);;},{},{});mw.loader.implement("mediawiki.client",function(){(function(mw){mw.isMobileDevice=function(){return(mw.isIphone()||mw.isIpod()||mw.isIpad()||mw.isAndroid())},mw.isIphone=function(){return(navigator.userAgent.indexOf('iPhone')!=-1&&!mw.isIpad());};mw.isIE9=function(){return(/msie 9/.test(navigator.userAgent.toLowerCase()));}
mw.isIphone4=function(){return(mw.isIphone()&&(window.devicePixelRatio&&window.devicePixelRatio>=2));};mw.isIpod=function(){return(navigator.userAgent.indexOf('iPod')!=-1);};mw.isIpad=function(){return(navigator.userAgent.indexOf('iPad')!=-1);};mw.isIpad3=function(){return/OS 3_/.test(navigator.userAgent)&&mw.isIpad();};mw.isAndroid40=function(){return(navigator.userAgent.indexOf('Android 4.0')!=-1);};mw.isAndroid2=function(){return(navigator.userAgent.indexOf('Android 2.')!=-1);};mw.isAndroid=function(){return(navigator.userAgent.indexOf('Android ')!=-1);};mw.isMobileChrome=function(){return(navigator.userAgent.indexOf('Android 4.')!=-1&&navigator.userAgent.indexOf('Chrome')!=-1)};mw.isIOS=function(){return(mw.isIphone()||mw.isIpod()||mw.isIpad());};mw.isIOS3=function(){return/OS 3_/.test(navigator.userAgent)&&mw.isIOS();};mw.isIOS4=function(){return/OS 4_/.test(navigator.userAgent)&&mw.isIOS();};mw.isIOS5=function(){return/OS 5_/.test(navigator.userAgent)&&mw.isIOS();};mw.
isHTML5FallForwardNative=function(){if(mw.isMobileHTML5()){return true;}if(document.URL.indexOf('forceMobileHTML5')!=-1){return true;}if(mw.supportsFlash()){return false;}if(mw.supportsHTML5()){return true;}return false;};mw.isMobileHTML5=function(){if(mw.isIphone()||mw.isIpod()||mw.isIpad()||mw.isAndroid2()){return true;}return false;};mw.supportsHTML5=function(){if(navigator.userAgent.indexOf('BlackBerry')!=-1){return false;}var dummyvid=document.createElement("video");if(dummyvid.canPlayType){return true;}return false;};mw.supportsFlash=function(){if(mw.config.get('EmbedPlayer.DisableHTML5FlashFallback')){return false;}var majorVersion=this.getFlashVersion().split(',').shift();if(majorVersion<10){return false;}else{return true;}},mw.getFlashVersion=function(){if(navigator.plugins&&navigator.plugins.length){try{if(navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin){return(navigator.plugins["Shockwave Flash 2.0"]||navigator.plugins["Shockwave Flash"]).description.
replace(/\D+/g,",").match(/^,?(.+),?$/)[1];}}catch(e){}}try{try{if(typeof ActiveXObject!='undefined'){var axo=new ActiveXObject('ShockwaveFlash.ShockwaveFlash.6');try{axo.AllowScriptAccess='always';}catch(e){return'6,0,0';}}}catch(e){}return new ActiveXObject('ShockwaveFlash.ShockwaveFlash').GetVariable('$version').replace(/\D+/g,',').match(/^,?(.+),?$/)[1];}catch(e){}return'0,0,0';};})(window.mediaWiki);;},{},{});mw.loader.implement("mw.Api",function(){(function(mw,$){mw.getTitleText=function(apiUrl,title,callback){if(!callback){title=apiUrl;callback=title;apiUrl=mw.getLocalApiUrl();}var request={'titles':title,'prop':'revisions','rvprop':'content'};mw.getJSON(apiUrl,request,function(data){if(!data||!data.query||!data.query.pages){callback(false);}var pages=data.query.pages;for(var i in pages){var page=pages[i];if(page['revisions']&&typeof page['revisions'][0]['*']!='undefined'){callback(page['revisions'][0]['*']);return;}}callback(false);});};mw.parseWikiText=function(wikitext,title,
callback){mw.log("mw.parseWikiText text length: "+wikitext.length+' title context: '+title);mw.load('JSON',function(){$.ajax({type:'POST',url:mw.getLocalApiUrl(),timeout:60000,data:{'action':'parse','format':'json','title':title,'text':wikitext},dataType:'text',success:function(data){var jsonData=JSON.parse(data);callback(jsonData.parse.text['*']);},error:function(XMLHttpRequest,textStatus,errorThrown){mw.log("Error: mw.parseWikiText:"+textStatus);callback("Error: failed to parse wikitext ");}});});}
mw.getJSON=function(){var url=false;url=(typeof arguments[0]=='string')?arguments[0]:mw.getLocalApiUrl();var data=null;data=(typeof arguments[0]=='object')?arguments[0]:null;if(!data&&typeof arguments[1]=='object'){data=arguments[1];}var callback=false;callback=(typeof arguments[1]=='function')?arguments[1]:false;var cbinx=1;if(!callback&&(typeof arguments[2]=='function')){callback=arguments[2];cbinx=2;}var timeoutCallback=false;timeoutCallback=(typeof arguments[cbinx+1]=='function')?arguments[cbinx+1]:false;if(!url){mw.log('Error: no api url for api request');return false;}if(!data['action']){data['action']='query';}if(!data['format']){data['format']='json';}var requestTimeOutFlag=false;var ranCallback=false;var myCallback=function(data){if(!requestTimeOutFlag){ranCallback=true;callback(data);}}
setTimeout(function(){if(!ranCallback){requestTimeOutFlag=true;mw.log("Error:: request timed out: "+url);if(timeoutCallback){timeoutCallback();}}},mw.config.get('AjaxRequestTimeout')*1000);if(mw.checkRequestPost(data)||data['_method']=='post'){if(!mw.isLocalDomain(url)){ranCallback=true;mw.load('ApiProxy',function(){mw.ApiProxy.doRequest(url,data,callback,timeoutCallback);});}else{$.post(url,data,myCallback,'json');}return;}if(!mw.isLocalDomain(url)){if(url.indexOf('callback=')==-1||data['callback']==-1){url+=(url.indexOf('?')==-1)?'?callback=?':'&callback=?';}}$.getJSON(url,data,myCallback);}
mw.checkRequestPost=function(data){if($.inArray(data['action'],mw.config.get('MediaWiki.ApiPostActions'))!=-1){return true;}if(data['prop']=='info'&&data['intoken']){return true;}if(data['meta']=='userinfo'){return true;}return false;}
mw.isLocalDomain=function(url){if((url.indexOf('http://')!=0&&url.indexOf('//')!=0&&url.indexOf('https://')!=0)||new mw.Uri(document.URL).host==new mw.Uri(url).host){return true;}return false;}
mw.getToken=function(apiUrl,title,callback){if(typeof title=='function'){callback=title;title=apiUrl;apiUrl=mw.getLocalApiUrl();}mw.log('mw:getToken');var request={'prop':'info','intoken':'edit','titles':title};mw.getJSON(apiUrl,request,function(data){for(var i in data.query.pages){if(data.query.pages[i]['edittoken']){callback(data.query.pages[i]['edittoken']);return;}}callback(false);});}
var apiUserNameCache={};mw.getUserName=function(apiUrl,callback,fresh){if(typeof apiUrl=='function'){var callback=apiUrl;var apiUrl=mw.getLocalApiUrl();}if(mw.isLocalDomain(apiUrl)){if(typeof wgUserName!='undefined'&&wgUserName!==null){callback(wgUserName)
return wgUserName;}}if(!fresh&&apiUserNameCache[apiUrl]){callback(apiUserNameCache[apiUrl]);return;}var request={'action':'query','meta':'userinfo'};mw.getJSON(apiUrl,request,function(data){if(!data||!data.query||!data.query.userinfo||!data.query.userinfo.name){mw.log(" No userName in response ");callback(false);return;}if(data.query.userinfo.id==0){callback(false);return;}apiUserNameCache[apiUrl]=data.query.userinfo.name;callback(data.query.userinfo.name);},function(){callback(false);});};mw.getApiProviderURL=function(providerId){if(mw.config.get('MediaWiki.ApiProviders')&&mw.config.get('MediaWiki.ApiProviders')[providerId]){return mw.config.get('MediaWiki.ApiProviders')[providerId].url;}return mw.getLocalApiUrl();};mw.getLocalApiUrl=function(){if(typeof mw.config.get('wgServer')!='undefined'&&typeof mw.config.get('wgScriptPath')!='undefined'){return mw.config.get('wgServer')+mw.config.get('wgScriptPath')+'/api.php';}mw.log('Error trying to get local api url without ')
return false;};})(window.mediaWiki,window.jQuery);;},{},{});mw.loader.implement("mw.EmbedPlayer",function(){(function(mw,$){"use strict";mw.processEmbedPlayers=function(playerSet,callback){mw.log('processEmbedPlayers:: playerSet: ',playerSet);var playerIdList=[];var areSelectedPlayersReady=function(){var playersLoaded=true;$.each(playerIdList,function(inx,playerId){if(!$('#'+playerId)[0].playerReadyFlag){playersLoaded=false;return false;}})
if(playersLoaded){if(callback){callback();}}}
var addPlayerElement=function(playerElement){var _this=this;mw.log('EmbedPlayer:: addElement:: '+playerElement.id);if(playerElement.pause){playerElement.pause();}$(mw).trigger('EmbedPlayerWaitForMetaCheck',playerElement);var waitForMeta=false;if(playerElement.waitForMeta!==false){waitForMeta=waitForMetaCheck(playerElement);}var ranPlayerSwapFlag=false;var runPlayerSwap=function(){if(ranPlayerSwapFlag){return;}ranPlayerSwapFlag=true;mw.log("processEmbedPlayers::runPlayerSwap::"+$(playerElement).attr('id'));var playerInterface=new mw.EmbedPlayer(playerElement);var inDomPlayer=swapEmbedPlayerElement(playerElement,playerInterface);mw.log("processEmbedPlayers::trigger:: EmbedPlayerNewPlayer "+inDomPlayer.id);$(mw).trigger('EmbedPlayerNewPlayer',inDomPlayer);$(inDomPlayer).bind('playerReady.swap',function(event,id){$(inDomPlayer).unbind('playerReady.swap');areSelectedPlayersReady();});mw.log("EmbedPlayer::addPlayerElement :trigger startPlayerBuildOut:"+inDomPlayer.id);$('#'+inDomPlayer.id).
triggerQueueCallback('startPlayerBuildOut',function(){inDomPlayer.checkPlayerSources();});};if(waitForMeta&&mw.config.get('EmbedPlayer.WaitForMeta')){mw.log('processEmbedPlayers::WaitForMeta ( video missing height ('+$(playerElement).attr('height')+'), width ('+$(playerElement).attr('width')+') or duration: '+$(playerElement).attr('duration'));$(playerElement).bind("loadedmetadata",runPlayerSwap);setTimeout(runPlayerSwap,5000);return;}else{runPlayerSwap();return;}};var waitForMetaCheck=function(playerElement){var waitForMeta=false;if(!playerElement){return false;}if(!playerElement.tagName||(playerElement.tagName.toLowerCase()!='audio'&&playerElement.tagName.toLowerCase()!='video')){return false;}if(!mw.EmbedTypes.getMediaPlayers().isSupportedPlayer('oggNative')&&!mw.EmbedTypes.getMediaPlayers().isSupportedPlayer('webmNative')&&!mw.EmbedTypes.getMediaPlayers().isSupportedPlayer('h264Native')&&!mw.EmbedTypes.getMediaPlayers().isSupportedPlayer('appleVdnPlayer')){return false;}var width=$
(playerElement).css('width');var height=$(playerElement).css('height');if($(playerElement).css('width')=='300px'&&$(playerElement).css('height')=='150px'){waitForMeta=true;}else{if($(playerElement).attr('duration')||$(playerElement).attr('durationHint')||$(playerElement).attr('data-durationhint')){return false;}else{waitForMeta=true;}}if($(playerElement).attr('width')==-1||$(playerElement).attr('height')==-1){waitForMeta=true;}if($(playerElement).attr('width')===0||$(playerElement).attr('height')===0){waitForMeta=true;}if(playerElement.height==150&&playerElement.width==300){waitForMeta=true;}if(waitForMeta&&($(playerElement).attr('src')||$(playerElement).find("source[src]").length!==0)){return true;}else{return false;}};var swapEmbedPlayerElement=function(targetElement,playerInterface){mw.log('processEmbedPlayers::swapEmbedPlayerElement: '+targetElement.id);var swapPlayerElement=document.createElement('div');$(swapPlayerElement).addClass('mwEmbedPlayer');for(var method in
playerInterface){if(method!='readyState'){swapPlayerElement[method]=playerInterface[method];}}swapPlayerElement.style.cssText=targetElement.style.cssText;swapPlayerElement.style.position='relative';var dataAttributes=mw.config.get("EmbedPlayer.DataAttributes");if(dataAttributes){$.each(dataAttributes,function(attrName,na){if($(targetElement).data(attrName)){$(swapPlayerElement).data(attrName,$(targetElement).data(attrName));}});}if(playerInterface.isPersistentNativePlayer()||(playerInterface.useNativePlayerControls()&&(targetElement.nodeName=='video'||targetElement.nodeName=='audio'))){$(targetElement).attr('id',playerInterface.pid).addClass('nativeEmbedPlayerPid').show().after($(swapPlayerElement).css('display','none'));}else{$(targetElement).replaceWith(swapPlayerElement);}if($('#loadingSpinner_'+playerInterface.id).length==0&&!$.browser.mozilla){if(playerInterface.useNativePlayerControls()||playerInterface.isPersistentNativePlayer()){var $spinner=$(targetElement).
getAbsoluteOverlaySpinner();}else{var $spinner=$(swapPlayerElement).getAbsoluteOverlaySpinner();}$spinner.attr('id','loadingSpinner_'+playerInterface.id);}return swapPlayerElement;};$(playerSet).each(function(index,playerElement){if(!$(playerElement).attr('id')){$(playerElement).attr("id",'mwe_vid'+(index));}playerIdList.push($(playerElement).attr("id"));if(playerElement.nodeName.toLowerCase()=='div'&&$(playerElement).attr('poster')){var posterSrc=$(playerElement).attr('poster');var width=$(playerElement).width();var height=$(playerElement).height();if(!width){var width='100%';}if(!height){var height='100%';}mw.log('EmbedPlayer:: set loading background: '+posterSrc);$(playerElement).append($('<img />').attr('src',posterSrc).css({'position':'absolute','width':width,'height':height}));}});var addedPlayersFlag=false;mw.log("processEmbedPlayers:: Do: "+$(playerSet).length+' players ');$(playerSet).each(function(index,playerElement){if($(playerElement).hasClass('nativeEmbedPlayerPid')){$(
'#loadingSpinner_'+$(playerElement).attr('id')).remove();mw.log('processEmbedPlayers::$.embedPlayer skip embedPlayer gennerated video: '+playerElement);}else{addedPlayersFlag=true;addPlayerElement(playerElement);}});if(!addedPlayersFlag){if(callback){callback();}}};})(window.mw,jQuery);(function(mw,$){"use strict";mw.mergeConfig('EmbedPlayer.Attributes',{"id":null,"width":null,"height":null,"src":null,"poster":null,"autoplay":false,"loop":false,"controls":true,"paused":true,"readyState":0,"networkState":0,"currentTime":0,"previousTime":0,"previousVolume":1,"volume":0.75,"preMuteVolume":0.75,"duration":null,'data-durationhint':null,'data-disablecontrols':null,'durationHint':null,"muted":false,'videoAspect':'4:3',"start":0,"end":null,"overlaycontrols":true,"usenativecontrols":false,'attributionbutton':true,'playerError':{},'data-blockPlayerDisplay':null,"startOffset":0,"downloadLink":true,"type":null});mw.mergeConfig('EmbedPlayer.SourceAttributes',['id','src','title','label',
'URLTimeEncoding','startOffset','start','end','default','title','titleKey']);mw.EmbedPlayer=function(element){return this.init(element);};mw.EmbedPlayer.prototype={'mediaElement':null,'supports':{},'playerReadyFlag':false,'loadError':false,'thumbnailUpdatingFlag':false,'stopped':true,'cmmlData':null,'serverSeekTime':0,'seeking':false,'bufferedPercent':0,'monitorTimerId':null,'bufferStartFlag':false,'bufferEndFlag':false,'pauseTime':null,'donePlayingCount':0,'_propagateEvents':true,'onDoneInterfaceFlag':true,'_checkHideSpinner':false,'_playContorls':true,'displayPlayer':true,'widgetLoaded':false,init:function(element){var _this=this;mw.log('EmbedPlayer: initEmbedPlayer: '+$(element).width());var playerAttributes=mw.config.get('EmbedPlayer.Attributes');this.rewriteElementTagName=element.tagName.toLowerCase();this.noPlayerFallbackHTML=$(element).html();for(var attr in playerAttributes){if(element.getAttribute(attr)!=null){if(element.getAttribute(attr)==''){this[attr]=true;}else{this[attr]
=element.getAttribute(attr);}}else{this[attr]=playerAttributes[attr];}if(this[attr]=="false")this[attr]=false;if(this[attr]=="true")this[attr]=true;}if(this.useNativePlayerControls()){_this.controls=true;}var sn=$(element).attr('class');if(sn&&sn!=''){var skinList=mw.config.get('EmbedPlayer.SkinList');for(var n=0;n<skinList.length;n++){if(sn.indexOf(skinList[n].toLowerCase())!==-1){this.skinName=skinList[n];}}}if(!this.skinName){this.skinName=mw.config.get('EmbedPlayer.DefaultSkin');}if(!this.monitorRate){this.monitorRate=mw.config.get('EmbedPlayer.MonitorRate');}if(this.startOffset&&this.startOffset.split(':').length>=2){this.startOffset=parseFloat(mw.npt2seconds(this.startOffset));}this.startOffset=parseFloat(this.startOffset);if($(element).attr('duration')){_this.duration=$(element).attr('duration');}if(_this['data-durationhint']){_this.durationHint=_this['data-durationhint'];}if(_this.durationHint&&!_this.duration){_this.duration=mw.npt2seconds(_this.durationHint);}this.duration=
parseFloat(this.duration);mw.log('EmbedPlayer::init:'+this.id+" duration is: "+this.duration);if(_this['data-disablecontrols']){_this.disablecontrols=_this['data-disablecontrols'];}this.pid='pid_'+this.id;this.mediaElement=new mw.MediaElement(element);this.bindHelper('updateLayout',function(){_this.updateLayout();});},bindHelper:function(name,callback){$(this).bind(name,callback);return this;},unbindHelper:function(bindName){if(bindName){$(this).unbind(bindName);}return this;},triggerQueueCallback:function(name,callback){$(this).triggerQueueCallback(name,callback);},triggerHelper:function(name,obj){try{$(this).trigger(name,obj);}catch(e){}},stopEventPropagation:function(){mw.log("EmbedPlayer:: stopEventPropagation");this.stopMonitor();this._propagateEvents=false;},restoreEventPropagation:function(){mw.log("EmbedPlayer:: restoreEventPropagation");this._propagateEvents=true;this.startMonitor();},enablePlayControls:function(){mw.log("EmbedPlayer:: enablePlayControls");if(this.
useNativePlayerControls()){return;}this._playContorls=true;this.getInterface().find('.play-btn').buttonHover().css('cursor','pointer');this.controlBuilder.enableSeekBar();$(this).trigger('onEnableInterfaceComponents');},disablePlayControls:function(){if(this.useNativePlayerControls()){return;}this._playContorls=false;this.getInterface().find('.play-btn').unbind('mouseenter mouseleave').css('cursor','default');this.controlBuilder.disableSeekBar();$(this).trigger('onDisableInterfaceComponents');},updateFeatureSupport:function(){$(this).trigger('updateFeatureSupportEvent',this.supports);return;},applyIntrinsicAspect:function(){var $this=$(this);if(this.getInterface().find('.playerPoster').length){var img=this.getInterface().find('.playerPoster')[0];var pHeight=$this.height();if(img.naturalWidth&&img.naturalHeight){var pWidth=parseInt(img.naturalWidth/img.naturalHeight*pHeight);if(pWidth>$this.width()){pWidth=$this.width();pHeight=parseInt(img.naturalHeight/img.naturalWidth*pWidth);}$(img)
.css({'height':pHeight+'px','width':pWidth+'px','left':(($this.width()-pWidth)*.5)+'px','top':(($this.height()-pHeight)*.5)+'px','position':'absolute'});}}},loadPlayerSize:function(element){this.height=element.height>0?element.height+'':$(element).css('height');this.width=element.width>0?element.width+'':$(element).css('width');if(this.height=='32px'||this.height=='32px'){this.width='100%';this.height='100%';}mw.log('EmbedPlayer::loadPlayerSize: css size:'+this.width+' h: '+this.height);if(this.height.indexOf('100%')!=-1||this.width.indexOf('100%')!=-1){var $relativeParent=$(element).parents().filter(function(){return $(this).is('body')||$(this).css('position')=='relative';}).slice(0,1);this.width=$relativeParent.width();this.height=$relativeParent.height();}this.height=parseInt(this.height);this.width=parseInt(this.width);this.height=(this.height==0||isNaN(this.height)&&$(element).attr('height'))?parseInt($(element).attr('height')):this.height;this.width=(this.width==0||isNaN(this.
width)&&$(element).attr('width'))?parseInt($(element).attr('width')):this.width;if(this.isAudio()&&this.height=='32'){this.height=20;}if(this.isAudio()&&this.videoAspect){var aspect=this.videoAspect.split(':');if(this.height&&!this.width){this.width=parseInt(this.height*(aspect[0]/aspect[1]));}if(this.width&&!this.height){var apectRatio=(aspect[1]/aspect[0]);this.height=parseInt(this.width*(aspect[1]/aspect[0]));}}if((isNaN(this.height)||isNaN(this.width))||(this.height==-1||this.width==-1)||((this.height==150||this.height==64)&&this.width==300)){var defaultSize=mw.config.get('EmbedPlayer.DefaultSize').split('x');if(isNaN(this.width)){this.width=defaultSize[0];}if(this.isAudio()){this.height=20;}else{this.height=defaultSize[1];}}},getPlayerWidth:function(){if($.browser.mozilla&&parseFloat($.browser.version)<2){return($(this).parent().parent().width());}return $(this).width();},getPlayerHeight:function(){return $(this).height();},checkPlayerSources:function(){mw.log(
'EmbedPlayer::checkPlayerSources: '+this.id);var _this=this;$(_this).trigger('preCheckPlayerSources');$(_this).triggerQueueCallback('checkPlayerSourcesEvent',function(){_this.setupSourcePlayer();});},getTextTracks:function(){if(!this.mediaElement){return[];}return this.mediaElement.getTextTracks();},emptySources:function(){if(this.mediaElement){this.mediaElement.sources=[];this.mediaElement.selectedSource=null;}this.prevPlayer=this.selectedPlayer;},switchPlaySource:function(source,switchCallback,doneCallback){var _this=this;var targetPlayer=mw.EmbedTypes.getMediaPlayers().defaultPlayer(source.mimeType);if(targetPlayer.library!=this.selectedPlayer.library){this.selectedPlayer=targetPlayer;this.updatePlaybackInterface(function(){_this.playerSwitchSource(source,switchCallback,doneCallback);});}else{_this.playerSwitchSource(source,switchCallback,doneCallback);}},playerSwitchSource:function(source,switchCallback,doneCallback){mw.log("Error player interface must support actual source switch"
);},setupSourcePlayer:function(){var _this=this;mw.log("EmbedPlayer::setupSourcePlayer: "+this.id+' sources: '+this.mediaElement.sources.length);if(mw.config.get('EmbedPlayer.ReplaceSources')){this.emptySources();$.each(mw.config.get('EmbedPlayer.ReplaceSources'),function(inx,source){_this.mediaElement.tryAddSource(source);});}this.mediaElement.autoSelectSource();if(this.mediaElement.selectedSource){this.selectedPlayer=mw.EmbedTypes.getMediaPlayers().defaultPlayer(this.mediaElement.selectedSource.mimeType);if(this.selectedPlayer&&(!this.prevPlayer||this.prevPlayer.library!=this.selectedPlayer.library)){this.updatePlaybackInterface();return;}}if(!this.selectedPlayer||!this.mediaElement.selectedSource){this.showPlayerError();mw.log("EmbedPlayer:: setupSourcePlayer > player ready ( but with errors ) ");}else{$(this).trigger('layoutReady');this.getInterface().find('.control-bar').show();this.addLargePlayBtn();}this.playerReadyFlag=true;$(this).trigger('playerReady');this.
triggerWidgetLoaded();},updatePlaybackInterface:function(callback){var _this=this;mw.log("EmbedPlayer::updatePlaybackInterface: duration is: "+this.getDuration()+' playerId: '+this.id);if(this.instanceOf){$(this).data('previousInstanceOf',this.instanceOf);var tmpObj=window['mw.EmbedPlayer'+this.instanceOf];for(var i in tmpObj){if(typeof this['parent_'+i]!='undefined'){this[i]=this['parent_'+i];}else{this[i]=null;}}}mw.log('EmbedPlayer::updatePlaybackInterface: embedding with '+this.selectedPlayer.library);this.selectedPlayer.load(function(){_this.updateLoadedPlayerInterface(callback);});},updateLoadedPlayerInterface:function(callback){var _this=this;mw.log('EmbedPlayer::updateLoadedPlayerInterface '+_this.selectedPlayer.library+" player loaded for "+_this.id);var playerInterface=mw['EmbedPlayer'+_this.selectedPlayer.library];if(playerInterface.init){playerInterface.init();}for(var method in playerInterface){if(typeof _this[method]!='undefined'&&!_this['parent_'+method]){_this['parent_'
+method]=_this[method];}_this[method]=playerInterface[method];}_this.updateFeatureSupport();_this.getDuration();_this.showPlayer();if(callback&&$.isFunction(callback)){callback();}},selectPlayer:function(player){mw.log("EmbedPlayer:: selectPlayer "+player.id);var _this=this;if(this.selectedPlayer.id!=player.id){this.selectedPlayer=player;this.updatePlaybackInterface(function(){_this.getInterface().find('.track').remove();if(!_this.useNativePlayerControls()&&_this.controls&&_this.controlBuilder.isOverlayControls()){_this.controlBuilder.showControlBar();_this.getInterface().hoverIntent({'sensitivity':4,'timeout':2000,'over':function(){_this.controlBuilder.showControlBar();},'out':function(){_this.controlBuilder.hideControlBar();}});}});}},getTimeRange:function(){var end_time=(this.controlBuilder.longTimeDisp)?'/'+mw.seconds2npt(this.getDuration()):'';var defaultTimeRange='0:00'+end_time;if(!this.mediaElement){return defaultTimeRange;}if(!this.mediaElement.selectedSource){return defaultTimeRange
;}if(!this.mediaElement.selectedSource.endNpt){return defaultTimeRange;}return this.mediaElement.selectedSource.startNpt+this.mediaElement.selectedSource.endNpt;},getDuration:function(){if(isNaN(this.duration)&&this.mediaElement&&this.mediaElement.selectedSource&&typeof this.mediaElement.selectedSource.durationHint!='undefined'){this.duration=this.mediaElement.selectedSource.durationHint;}return this.duration;},getHeight:function(){return this.getInterface().height();},getWidth:function(){return this.getInterface().width();},isAudio:function(){return(this.rewriteElementTagName=='audio'||(this.mediaElement&&this.mediaElement.selectedSource&&this.mediaElement.selectedSource.mimeType.indexOf('audio/')!==-1));},embedPlayerHTML:function(){return'Error: function embedPlayerHTML should be implemented by embed player interface ';},seek:function(percent){var _this=this;this.seeking=true;$(this).trigger('preSeek',percent);if(percent<0){percent=0;}if(percent>1){percent=1;}this.updatePlayHead(
percent);if(this.supportsURLTimeEncoding()){mw.log('EmbedPlayer::seek:: updated serverSeekTime: '+mw.seconds2npt(this.serverSeekTime)+' currentTime: '+_this.currentTime);if(_this.currentTime==_this.serverSeekTime){return;}this.stop();this.didSeekJump=true;this.serverSeekTime=mw.npt2seconds(this.startNpt)+parseFloat(percent*this.getDuration());}this.controlBuilder.onSeek();},setCurrentTime:function(time,callback){mw.log('Error: EmbedPlayer, setCurrentTime not overriden');if($.isFunction(callback)){callback();}},triggeredEndDone:false,postSequence:false,onClipDone:function(){var _this=this;if(!_this._propagateEvents){return;}mw.log('EmbedPlayer::onClipDone: propagate:'+_this._propagateEvents+' id:'+this.id+' doneCount:'+this.donePlayingCount+' stop state:'+this.isStopped());if(!this.isStopped()){this.stopped=true;this.controlBuilder.showControlBar();if(!this.onDoneInterfaceFlag){this.stopEventPropagation();}mw.log("EmbedPlayer:: trigger: ended ( inteface continue pre-check: "+this.
onDoneInterfaceFlag+' )');$(this).trigger('ended');mw.log("EmbedPlayer::onClipDone:Trigged ended, continue? "+this.onDoneInterfaceFlag);if(!this.onDoneInterfaceFlag){this.restoreEventPropagation();return;}if(this.onDoneInterfaceFlag){mw.log("EmbedPlayer:: trigger: playbackComplete");$(this).trigger('playbackComplete');mw.log("EmbedPlayer:: trigger: postEnded");$(this).trigger('postEnded');}if(this.onDoneInterfaceFlag){mw.log("EmbedPlayer::onDoneInterfaceFlag=true do interface done");this.stopEventPropagation();_this.donePlayingCount++;this.setCurrentTime(0.01,function(){_this.stop();_this.restoreEventPropagation();if(_this.loop){_this.stopped=false;_this.play();return;}else{_this.pause();}if(mw.config.get('EmbedPlayer.ForceLargeReplayButton')===true){_this.addLargePlayBtn();}else{if($(_this).data('hideEndPlayButton')||!_this.useLargePlayBtn()){_this.hideLargePlayBtn();}else{_this.addLargePlayBtn();}}mw.log("EmbedPlayer:: trigger: onEndedDone");if(!_this.triggeredEndDone){_this.
triggeredEndDone=true;$(_this).trigger('onEndedDone',[_this.id]);}})}}},showThumbnail:function(){var _this=this;mw.log('EmbedPlayer::showThumbnail::'+this.stopped);this.controlBuilder.closeMenuOverlay();this.updatePosterHTML();this.paused=true;this.stopped=true;if(!this.useNativePlayerControls()){mw.log("mediaLoaded");$(this).trigger('mediaLoaded');}},showPlayer:function(){mw.log('EmbedPlayer:: showPlayer: '+this.id+' interface: w:'+this.width+' h:'+this.height);var _this=this;this.hideSpinnerAndPlayBtn();if(!this.useNativePlayerControls()&&this.isPersistentNativePlayer()){$(this).show();}if(this.controls){if(this.useNativePlayerControls()){if(this.getPlayerElement()){$(this.getPlayerElement()).attr('controls',"true");}}else{this.controlBuilder.addControls();}}this.updatePosterHTML();this.updateTemporalUrl();if(this.displayPlayer===false){_this.getVideoHolder().hide();_this.getInterface().height(_this.getComponentsHeight());_this.triggerHelper('updateLayout');}this.updateLayout();this.
addLargePlayBtn();this.playerReadyFlag=true;mw.log("EmbedPlayer:: Trigger: playerReady");$(this).trigger('playerReady');this.triggerWidgetLoaded();if(this['data-blockPlayerDisplay']){this.blockPlayerDisplay();return;}if(this.getError()){this.showErrorMsg(this.getError());return;}if(this.isStopped()&&this.autoplay&&(!mw.isIOS()||mw.isIpad3())){mw.log('EmbedPlayer::showPlayer::Do autoPlay');_this.play();}},getComponentsHeight:function(){var height=0;this.getInterface().find('.block').each(function(){height+=$(this).outerHeight(true);});var offset=(mw.isIOS())?5:0;return height+offset;},updateLayout:function(){this.applyIntrinsicAspect();if(!mw.config.get('EmbedPlayer.IsIframeServer')){return;}var windowHeight;if(mw.isIOS()&&!this.controlBuilder.isInFullScreen()){windowHeight=$(window.parent.document.getElementById(this.id)).height();}else{windowHeight=window.innerHeight;}var newHeight=windowHeight-this.getComponentsHeight();var currentHeight=this.getVideoHolder().height();if(
currentHeight!==newHeight){mw.log('EmbedPlayer: updateLayout:: window: '+windowHeight+', components: '+this.getComponentsHeight()+', videoHolder old height: '+currentHeight+', new height: '+newHeight);this.getVideoHolder().height(newHeight);}},getInterface:function(){if(!this.$interface){this.controlBuilder=new mw.PlayerControlBuilder(this);this.$interface=$(this).wrap($('<div />').addClass('mwPlayerContainer '+this.controlBuilder.playerClass).append($('<div />').addClass('videoHolder'))).parent().parent();if(this.style.cssText){this.$interface[0].style.cssText=this.style.cssText;}this.style.cssText='';if(!this.useLargePlayBtn()){this.$interface.css('pointer-events','none');}}return this.$interface;},updateTemporalUrl:function(){var sourceHash=/[^\#]+$/.exec(this.getSrc()).toString();if(sourceHash.indexOf('t=')===0){var times=sourceHash.substr(2).split(',');if(times[0]){this.currentTime=mw.npt2seconds(times[0].toString());}if(times[1]){this.pauseTime=mw.npt2seconds(times[1].toString())
;if(this.pauseTime<this.currentTime){this.pauseTime=null;}}this.updatePlayHead(this.currentTime/this.duration);this.controlBuilder.setStatus(mw.seconds2npt(this.currentTime));}},setError:function(errorObj){var _this=this;if(typeof errorObj=='string'){this.playerError={'title':_this.getKalturaMsg('ks-GENERIC_ERROR_TITLE'),'message':errorObj}
return;}this.playerError=errorObj;},getError:function(){if(!$.isEmptyObject(this.playerError)){return this.playerError;}return null;},showErrorMsg:function(errorObj){this.hideSpinnerAndPlayBtn();if(this.controlBuilder){if(mw.config.get("EmbedPlayer.ShowPlayerAlerts")){var alertObj=$.extend(errorObj,{'isModal':true,'keepOverlay':true,'noButtons':true,'isError':true});this.controlBuilder.displayAlert(alertObj);}}return;},blockPlayerDisplay:function(){this.showErrorMsg();this.getInterface().find('.error').hide();},showPlayerError:function(){var _this=this;var $this=$(this);mw.log("EmbedPlayer::showPlayerError");this.hideSpinnerAndPlayBtn();$this.trigger('mediaLoadError');$this.trigger('mediaError');if(this['data-blockPlayerDisplay']){this.blockPlayerDisplay();return;}if(this.getError()){this.showErrorMsg(this.getError());return;}this.showNoInlinePlabackSupport();},showNoInlinePlabackSupport:function(){var _this=this;var $this=$(this);if(this.mediaElement.sources.length==0||!mw.config.get(
'EmbedPlayer.NotPlayableDownloadLink')){return;}this.isLinkPlayer=true;this.updatePosterHTML();this.addLargePlayBtn();var downloadUrl=this.mediaElement.sources[0].getSrc();this.triggerHelper('directDownloadLink',function(dlUrl){if(dlUrl){downloadUrl=dlUrl;}});var $pBtn=this.getInterface().find('.play-btn-large').attr('title',mw.msg('mwe-embedplayer-play_clip')).show().unbind('click').click(function(){_this.triggerHelper('firstPlay',[_this.id]);_this.triggerHelper('playing');return true;});if(!$pBtn.parent('a').length){$pBtn.wrap($('<a />').attr("target","_blank"));}$pBtn.parent('a').attr("href",downloadUrl);$(this).trigger('showInlineDownloadLink');},updateVideoTimeReq:function(timeRequest){mw.log('EmbedPlayer::updateVideoTimeReq:'+timeRequest);var timeParts=timeRequest.split('/');this.updateVideoTime(timeParts[0],timeParts[1]);},updateVideoTime:function(startNpt,endNpt){this.mediaElement.updateSourceTimes(startNpt,endNpt);this.controlBuilder.setStatus(startNpt+'/'+endNpt);this.
updatePlayHead(0);if(this.supportsURLTimeEncoding()){this.serverSeekTime=0;}else{this.serverSeekTime=mw.npt2seconds(startNpt);}},updateThumbTimeNPT:function(time){this.updateThumbTime(mw.npt2seconds(time)-parseInt(this.startOffset));},updateThumbTime:function(floatSeconds){var _this=this;if(typeof this.orgThumSrc=='undefined'){this.orgThumSrc=this.poster;}if(this.orgThumSrc.indexOf('t=')!==-1){this.lastThumbUrl=mw.replaceUrlParams(this.orgThumSrc,{'t':mw.seconds2npt(floatSeconds+parseInt(this.startOffset))});if(!this.thumbnailUpdatingFlag){this.updatePoster(this.lastThumbUrl,false);this.lastThumbUrl=null;}}},updateThumbPerc:function(percent){return this.updateThumbTime((this.getDuration()*percent));},updatePosterSrc:function(posterSrc){if(!posterSrc){posterSrc=mw.config.get('EmbedPlayer.BlackPixel');}this.poster=posterSrc;this.updatePosterHTML();this.applyIntrinsicAspect();},changeMedia:function(callback){var _this=this;var $this=$(this);mw.log('EmbedPlayer:: changeMedia ');this.
emptySources();$this.trigger('onChangeMedia');this.firstPlay=true;this.donePlayingCount=0;this.triggeredEndDone=false;this.preSequence=false;this.postSequence=false;this.setCurrentTime(0.01);this.updatePlayHead(0);this.controlBuilder.setStatus(this.getTimeRange());this.pauseLoading();this.setError(null);this['data-blockPlayerDisplay']=null
$this.attr('data-blockPlayerDisplay','');this.getInterface().find('.error').remove();this.controlBuilder.closeAlert();this.controlBuilder.closeMenuOverlay();this.getInterface().find('.control-bar').show();this.hideLargePlayBtn();var bindName='playerReady.changeMedia';$this.unbind(bindName).bind(bindName,function(){mw.log('EmbedPlayer::changeMedia playerReady callback');_this.hideSpinnerAndPlayBtn();if(_this.getError()){_this.showErrorMsg(_this.getError());return;}if(_this.controlBuilder){_this.controlBuilder.showControlBar();}if(_this.autoplay){_this.hideLargePlayBtn();}else{_this.addLargePlayBtn();}var source=_this.getSource();if((_this.isPersistentNativePlayer()||_this.useNativePlayerControls())&&source){_this.switchPlaySource(source,function(){_this.changeMediaStarted=false;$this.trigger('onChangeMediaDone');if(_this.autoplay){_this.play();}else{_this.pause();_this.addLargePlayBtn();}if(callback){callback()}});return;}_this.changeMediaStarted=false;_this.stop();if(_this.autoplay){
_this.play();}else{_this.addLargePlayBtn();}$this.trigger('onChangeMediaDone');if(callback){callback();}});$this.triggerQueueCallback('checkPlayerSourcesEvent',function(){_this.setupSourcePlayer();});},isImagePlayScreen:function(){return(this.useNativePlayerControls()&&!this.isLinkPlayer&&mw.isIphone()&&mw.config.get('EmbedPlayer.iPhoneShowHTMLPlayScreen'));},triggerWidgetLoaded:function(){if(!this.widgetLoaded){this.widgetLoaded=true;mw.log("EmbedPlayer:: Trigger: widgetLoaded");this.triggerHelper('widgetLoaded');}},updatePosterHTML:function(){mw.log('EmbedPlayer:updatePosterHTML::'+this.id);var _this=this;var thumb_html='';var class_atr='';var style_atr='';if(this.isImagePlayScreen()){this.addPlayScreenWithNativeOffScreen();return;}var posterSrc=(this.poster)?this.poster:mw.config.get('EmbedPlayer.BlackPixel');if(this.isPersistentNativePlayer()){var $vid=$('#'+this.pid).show();$vid.attr('poster',posterSrc);if($.browser.mozilla){$vid.hide();setTimeout(function(){$vid.show();},0);}}
else{$('#'+this.pid).hide();$(this).html($('<img />').css({'position':'absolute','top':0,'left':0,'right':0,'bottom':0}).attr({'src':posterSrc}).addClass('playerPoster').load(function(){_this.applyIntrinsicAspect();})).show();}if(this.useLargePlayBtn()&&this.controlBuilder&&this.height>this.controlBuilder.getComponentHeight('playButtonLarge')){this.addLargePlayBtn();}},addPlayScreenWithNativeOffScreen:function(){mw.log("Error: EmbedPlayer, Must override 'addPlayScreenWithNativeOffScreen' with player inteface");return;},useLargePlayBtn:function(){if(this.isPersistantPlayBtn()){return true;}return!this.useNativePlayerControls();},isPersistantPlayBtn:function(){return mw.isAndroid2()||(mw.isIphone()&&mw.config.get('EmbedPlayer.iPhoneShowHTMLPlayScreen'));},useNativePlayerControls:function(){if(this.usenativecontrols===true){return true;}if(mw.config.get('EmbedPlayer.NativeControls')===true){return true;}if(mw.config.get('EmbedPlayer.WebKitPlaysInline')===true&&mw.isIphone()){return false;
}if(mw.isAndroid2()||mw.isIpod()||mw.isIphone()){return true;}if(mw.isIpad()){if(mw.config.get('EmbedPlayer.EnableIpadHTMLControls')===true){return false;}else{return true;}}return false;},isPersistentNativePlayer:function(){if(this.isLinkPlayer){return false;}if($('#'+this.pid).length==0){return $('#'+this.id).hasClass('persistentNativePlayer');}return $('#'+this.pid).hasClass('persistentNativePlayer');},isTouchDevice:function(){return mw.isIpad()||mw.isAndroid40()||mw.isMobileChrome();},hideLargePlayBtn:function(){if(this.getInterface()){this.getInterface().find('.play-btn-large').hide();}},addLargePlayBtn:function(){if(this.isPauseLoading){mw.log("EmbedPlayer:: addLargePlayBtn ( skip play button, during load )");return;}if(this.useNativePlayerControls()){this.getInterface().css('pointer-events','auto');}if(mw.config.get('EmbedPlayer.WebKitPlaysInline')&&mw.isIphone()){return;}if(this.getInterface().find('.play-btn-large').length){this.getInterface().find('.play-btn-large').show();}
else{this.getVideoHolder().append(this.controlBuilder.getComponent('playButtonLarge'));}},getVideoHolder:function(){return this.getInterface().find('.videoHolder');},getNativePlayerHtml:function(){return $('<div />').css('width',this.getWidth()).html('Error: Trying to get native html5 player without native support for codec');},applyMediaElementBindings:function(){mw.log("Warning applyMediaElementBindings should be implemented by player interface");return;},getSharingEmbedCode:function(){switch(mw.config.get('EmbedPlayer.ShareEmbedMode')){case'iframe':return this.getShareIframeObject();break;case'videojs':return this.getShareEmbedVideoJs();break;}},getWikiEmbedCode:function(){if(this.apiTitleKey){return'[[File:'+this.apiTitleKey+']]';}else{return false;}},getShareIframeObject:function(){var iframeUrl=this.getIframeSourceUrl();var embedCode='&lt;iframe src=&quot;'+mw.html.escape(iframeUrl)+'&quot; ';embedCode+='width=&quot;'+this.getPlayerWidth()+'&quot; ';embedCode+='height=&quot;'+
this.getPlayerHeight()+'&quot; ';embedCode+='frameborder=&quot;0&quot; ';embedCode+='webkitAllowFullScreen mozallowfullscreen allowFullScreen';embedCode+='&gt;&lt/iframe&gt;';return embedCode;},getIframeSourceUrl:function(){var iframeUrl=false;this.triggerHelper('getShareIframeSrc',[function(localIframeSrc){if(iframeUrl){mw.log("Error multiple modules binding getShareIframeSrc");}iframeUrl=localIframeSrc;},this.id]);if(iframeUrl){return iframeUrl;}var iframeUrl=mw.getMwEmbedPath()+'mwEmbedFrame.php?';var params={'src[]':[]};for(var i=0;i<this.mediaElement.sources.length;i++){var source=this.mediaElement.sources[i];if(source.src){params['src[]'].push(mw.absoluteUrl(source.src));}}if(this.poster){params.poster=this.poster;}if(this.skinName){params.skin=this.skinName;}if(this.duration){params.durationHint=parseFloat(this.duration);}iframeUrl+=$.param(params);return iframeUrl;},getShareEmbedVideoJs:function(){var embedtag=(this.isAudio())?'audio':'video';var embedCode=
'&lt;script type=&quot;text/javascript&quot; '+'src=&quot;'+mw.html.escape(mw.absoluteUrl(mw.getMwEmbedSrc()))+'&quot;&gt;&lt;/script&gt'+'&lt;'+embedtag+' ';if(this.poster){embedCode+='poster=&quot;'+mw.html.escape(mw.absoluteUrl(this.poster))+'&quot; ';}if(this.skinName){embedCode+='class=&quot;'+mw.html.escape(this.skinName)+'&quot; ';}if(this.duration){embedCode+='durationHint=&quot;'+parseFloat(this.duration)+'&quot; ';}if(this.width||this.height){embedCode+='style=&quot;';embedCode+=(this.width)?'width:'+this.width+'px;':'';embedCode+=(this.height)?'height:'+this.height+'px;':'';embedCode+='&quot; ';}embedCode+='&gt;';for(var i=0;i<this.mediaElement.sources.length;i++){var source=this.mediaElement.sources[i];if(source.src){embedCode+='&lt;source src=&quot;'+mw.absoluteUrl(source.src)+'&quot; &gt;&lt;/source&gt;';}}embedCode+='&lt;/video&gt;';return embedCode;},firstPlay:true,preSequence:false,inPreSequence:false,replayEventCount:0,play:function(){var _this=this;var $this=$(this);
mw.log("EmbedPlayer:: play: "+this._propagateEvents+' poster: '+this.stopped);this.absoluteStartPlayTime=new Date().getTime();if(_this.isStopped()&&(_this.preSequence==false||(_this.sequenceProxy&&_this.sequenceProxy.isInSequence==false))){if(!_this.selectedPlayer){_this.showPlayerError();return false;}else{_this.embedPlayerHTML();}}_this.stopped=false;if(!this.preSequence){this.preSequence=true;mw.log("EmbedPlayer:: trigger preSequence ");this.triggerHelper('preSequence');this.playInterfaceUpdate();if(_this.sequenceProxy&&_this.sequenceProxy.isInSequence){mw.log("EmbedPlayer:: isInSequence, do NOT play content");return false;}}if(this.firstPlay&&this._propagateEvents){this.firstPlay=false;this.triggerHelper('firstPlay',[_this.id]);}if(this.paused===true){this.paused=false;mw.log("EmbedPlayer:: trigger play event::"+!this.paused+' events:'+this._propagateEvents);if(this._propagateEvents){this.triggerHelper('onplay');}}if(this.donePlayingCount>0&&!this.paused&&this._propagateEvents){
this.replayEventCount++;this.triggeredEndDone=false;if(this.replayEventCount<=this.donePlayingCount){mw.log("EmbedPlayer::play> trigger replayEvent");this.triggerHelper('replayEvent');}}if(this.currentTime<this.startTime){$this.bind('playing.startTime',function(){$this.unbind('playing.startTime');if(!mw.isIOS()){_this.setCurrentTime(_this.startTime);_this.startTime=0;}else{setTimeout(function(){_this.setCurrentTime(_this.startTime,function(){_this.play();});_this.startTime=0;},500)}_this.startTime=0;});}this.playInterfaceUpdate();if(_this._playContorls){return true;}else{return false;}},playInterfaceUpdate:function(){var _this=this;mw.log('EmbedPlayer:: playInterfaceUpdate');if(this.controlBuilder){this.controlBuilder.closeMenuOverlay();}this.getInterface().find('.error').remove();this.hideLargePlayBtn();this.getInterface().find('.play-btn span').removeClass('ui-icon-play').addClass('ui-icon-pause');this.hideSpinnerOncePlaying();this.getInterface().find('.play-btn').unbind('click').
click(function(){if(_this._playContorls){_this.pause();}}).attr('title',mw.msg('mwe-embedplayer-pause_clip'));},pauseLoading:function(){this.pause();this.addPlayerSpinner();this.isPauseLoading=true;},addPlayerSpinner:function(){var sId='loadingSpinner_'+this.id;$('#'+sId).remove();this.hideLargePlayBtn();$(this).show().getAbsoluteOverlaySpinner().attr('id',sId);},hideSpinner:function(){$('#loadingSpinner_'+this.id+',.loadingSpinner').remove();},hideSpinnerAndPlayBtn:function(){this.isPauseLoading=false;this.hideSpinner();this.hideLargePlayBtn();},hideSpinnerOncePlaying:function(){this._checkHideSpinner=true;},pause:function(){var _this=this;if(this.paused===false){this.paused=true;if(this._propagateEvents){mw.log('EmbedPlayer:trigger pause:'+this.paused);$(this).trigger('onpause');}}_this.pauseInterfaceUpdate();},pauseInterfaceUpdate:function(){var _this=this;mw.log("EmbedPlayer::pauseInterfaceUpdate");this.getInterface().find('.play-btn span').removeClass('ui-icon-pause').addClass(
'ui-icon-play');this.getInterface().find('.play-btn').unbind('click').click(function(){if(_this._playContorls){_this.play();}}).attr('title',mw.msg('mwe-embedplayer-play_clip'));},load:function(){mw.log('Waring:: the load method should be overided by player interface');},stop:function(){var _this=this;mw.log('EmbedPlayer::stop:'+this.id);this.stopped=true;this.preSequence=false;$(this).trigger('doStop');this.didSeekJump=false;this.currentTime=this.previousTime=this.serverSeekTime=0;this.stopMonitor();if(!this.paused){this.pause();}if(this.useLargePlayBtn()){this.addLargePlayBtn();this.pauseInterfaceUpdate();}if(!this.isPersistentNativePlayer()){this.showThumbnail();this.bufferedPercent=0;this.controlBuilder.setStatus(this.getTimeRange());}this.updatePlayHead(0);this.controlBuilder.setStatus(this.getTimeRange());this.bufferedPercent=0;this.updateBufferStatus();},toggleMute:function(userAction){mw.log('EmbedPlayer::toggleMute> (old state:) '+this.muted);if(this.muted){this.muted=false;
var percent=this.preMuteVolume;}else{this.muted=true;this.preMuteVolume=this.volume;var percent=0;}this.setVolume(percent,true);this.setInterfaceVolume(percent);$(this).trigger('onToggleMute');},setVolume:function(percent,triggerChange){var _this=this;if(isNaN(percent)){return;}this.previousVolume=this.volume;this.volume=percent;if(percent!=0){this.muted=false;}this.setPlayerElementVolume(percent);if(triggerChange){$(_this).trigger('volumeChanged',percent);}},setInterfaceVolume:function(percent){if(this.supports['volumeControl']&&this.getInterface().find('.volume-slider').length){this.getInterface().find('.volume-slider').slider('value',percent*100);}},setPlayerElementVolume:function(percent){mw.log('Error player does not support volume adjustment');},getPlayerElementVolume:function(){return this.volume;},getPlayerElementMuted:function(){return this.muted;},fullscreen:function(){this.controlBuilder.toggleFullscreen();},postEmbedActions:function(){return;},isPlaying:function(){if(this.
stopped){return false;}else if(this.paused){return false;}else{return true;}},isStopped:function(){return this.stopped;},stopMonitor:function(){clearInterval(this.monitorInterval);this.monitorInterval=0;},startMonitor:function(){this.monitor();},monitor:function(){var _this=this;_this.syncCurrentTime();_this.updatePlayheadStatus();_this.syncVolume();_this.syncMonitor()
if(_this._propagateEvents){$(_this).trigger('monitorEvent',[_this.id]);if(_this.progressEventData){$(_this).trigger('progress',_this.progressEventData);}}},syncMonitor:function(){var _this=this;if(!this.isStopped()){if(!this.monitorInterval){this.monitorInterval=setInterval(function(){if(_this.monitor)_this.monitor();},this.monitorRate);}}else{this.stopMonitor();}},syncVolume:function(){var _this=this;if(Math.round(_this.volume*100)!=Math.round(_this.previousVolume*100)){_this.setInterfaceVolume(_this.volume);}_this.previousVolume=_this.volume;_this.volume=this.getPlayerElementVolume();if(_this.muted!=_this.getPlayerElementMuted()&&!_this.isStopped()){mw.log("EmbedPlayer::syncVolume: muted does not mach embed player");_this.toggleMute();_this.muted=_this.getPlayerElementMuted();}},syncCurrentTime:function(){var _this=this;if(_this._checkHideSpinner&&_this.currentTime!=_this.getPlayerElementTime()){_this._checkHideSpinner=false;_this.hideSpinnerAndPlayBtn();if(_this.isPersistantPlayBtn(
)){_this.addLargePlayBtn();}else{_this.hideLargePlayBtn();}}if(parseInt(_this.previousTime)!=parseInt(_this.currentTime)&&!this.userSlide&&!this.seeking&&!this.isStopped()){if(_this.getDuration()&&_this.currentTime<=_this.getDuration()){var seekPercent=_this.currentTime/_this.getDuration();mw.log("EmbedPlayer::syncCurrentTime::"+_this.previousTime+' != '+_this.currentTime+" javascript based currentTime update to "+seekPercent+' == '+_this.currentTime);_this.previousTime=_this.currentTime;this.seek(seekPercent);}}_this.currentTime=_this.getPlayerElementTime();if(_this.serverSeekTime&&_this.supportsURLTimeEncoding()){_this.currentTime=parseInt(_this.serverSeekTime)+parseInt(_this.getPlayerElementTime());}_this.previousTime=_this.currentTime;if(_this.pauseTime&&_this.currentTime>_this.pauseTime){_this.pause();_this.pauseTime=null;}},updatePlayheadStatus:function(){var _this=this;if(this.currentTime>=0&&this.duration){if(!this.userSlide&&!this.seeking){if(parseInt(this.startOffset)!=0){
this.updatePlayHead((this.currentTime-this.startOffset)/this.duration);var et=(this.controlBuilder.longTimeDisp)?'/'+mw.seconds2npt(parseFloat(this.startOffset)+parseFloat(this.duration)):'';this.controlBuilder.setStatus(mw.seconds2npt(this.currentTime)+et);}else{var ct=(this.getPlayerElement())?this.getPlayerElement().currentTime||this.currentTime:this.currentTime;this.updatePlayHead(ct/this.duration);var et=(this.controlBuilder.longTimeDisp)?'/'+mw.seconds2npt(this.duration):'';this.controlBuilder.setStatus(mw.seconds2npt(this.currentTime)+et);}}var endPresentationTime=(this.startOffset)?(this.startOffset+this.duration):this.duration;if(this.currentTime>=endPresentationTime&&!this.isStopped()){mw.log("EmbedPlayer::updatePlayheadStatus > should run clip done :: "+this.currentTime+' > '+endPresentationTime);this.onClipDone();}}else{if(this.isStopped()){this.controlBuilder.setStatus(this.getTimeRange());}else if(this.paused){this.controlBuilder.setStatus(mw.msg('mwe-embedplayer-paused')
);}else if(this.isPlaying()){if(this.currentTime&&!this.duration)this.controlBuilder.setStatus(mw.seconds2npt(this.currentTime)+' /');else this.controlBuilder.setStatus(" - - - ");}else{this.controlBuilder.setStatus(this.getTimeRange());}}},getPlayerElementTime:function(){mw.log("Error: getPlayerElementTime should be implemented by embed library");},getPlayerElement:function(){mw.log("Error: getPlayerElement should be implemented by embed library, or you may be calling this event too soon");},updateBufferStatus:function(){var $buffer=this.getInterface().find('.mw_buffer');if(this.bufferedPercent!=0){if(this.bufferedPercent>1){this.bufferedPercent=1;}$buffer.css({"width":(this.bufferedPercent*100)+'%'});$(this).trigger('updateBufferPercent',this.bufferedPercent);}else{$buffer.css("width",'0px');}if(this.bufferedPercent>0&&!this.bufferStartFlag){this.bufferStartFlag=true;mw.log("EmbedPlayer::bufferStart");$(this).trigger('bufferStartEvent');}if(this.bufferedPercent==1&&!this.
bufferEndFlag){this.bufferEndFlag=true;$(this).trigger('bufferEndEvent');}},updatePlayHead:function(perc){if(this.getInterface()){var $playHead=this.getInterface().find('.play_head');if(!this.useNativePlayerControls()&&$playHead.length!=0){var val=parseInt(perc*1000);$playHead.slider('value',val);}}$(this).trigger('updatePlayHeadPercent',perc);},getSrc:function(serverSeekTime){if(serverSeekTime){this.serverSeekTime=serverSeekTime;}if(this.currentTime&&!this.serverSeekTime){this.serverSeekTime=this.currentTime;}if(!this.mediaElement){return false;}if(!this.mediaElement.selectedSource){this.mediaElement.autoSelectSource();};if(this.mediaElement.selectedSource){if(this.supportsURLTimeEncoding()){return this.mediaElement.selectedSource.getSrc(this.serverSeekTime);}else{return this.mediaElement.selectedSource.getSrc();}}return false;},getSource:function(){this.mediaElement.autoSelectSource();return this.mediaElement.selectedSource;},getCompatibleSource:function(videoFiles){var $media=$(
'<video />');$.each(videoFiles,function(inx,source){$media.append($('<source />').attr({'src':source.src,'type':source.type}));mw.log("EmbedPlayer::getCompatibleSource: add "+source.src+' of type:'+source.type);});var myMediaElement=new mw.MediaElement($media[0]);var source=myMediaElement.autoSelectSource();if(source){mw.log("EmbedPlayer::getCompatibleSource: "+source.getSrc());return source;}mw.log("Error:: could not find compatible source");return false;},supportsURLTimeEncoding:function(){var timeUrls=mw.config.get('EmbedPlayer.EnableURLTimeEncoding');if(timeUrls=='none'){return false;}else if(timeUrls=='always'){return this.mediaElement.selectedSource.URLTimeEncoding;}else if(timeUrls=='flash'){if(this.mediaElement.selectedSource&&this.mediaElement.selectedSource.URLTimeEncoding){return(this.instanceOf=='Kplayer');}}else{mw.log("Error:: invalid config value for EmbedPlayer.EnableURLTimeEncoding:: "+mw.config.get('EmbedPlayer.EnableURLTimeEncoding'));}return false;}};})(window.mw,
window.jQuery);(function(mw,$){"use strict";mw.PlayerControlBuilder=function(embedPlayer,options){return this.init(embedPlayer,options);};mw.PlayerControlBuilder.prototype={playerClass:'mv-player',longTimeDisp:true,volumeLayout:'vertical',height:mw.config.get('EmbedPlayer.ControlsHeight'),supportedComponents:{'options':true},supportedMenuItems:{'playerSelect':true,'download':true,'share':true,'aboutPlayerLibrary':true},inFullScreen:false,addWarningFlag:false,displayOptionsMenuFlag:false,hideControlBarCallback:false,controlsDisabled:false,bindPostfix:'.controlBuilder',init:function(embedPlayer){var _this=this;this.embedPlayer=embedPlayer;var skinClass=embedPlayer.skinName.substr(0,1).toUpperCase()+embedPlayer.skinName.substr(1);if(mw['PlayerSkin'+skinClass]){_this=$.extend(true,{},this,mw['PlayerSkin'+skinClass]);}if(_this.embedPlayer.mediaElement.getPlayableSources().length<=1&&_this.supportedMenuItems.playerSelect){delete _this.supportedMenuItems.playerSelect;}return _this;},getHeight
:function(){return this.height;},addControls:function(){var embedPlayer=this.embedPlayer;var _this=this;embedPlayer.getInterface().find('.control-bar,.overlay-win').remove();_this.displayOptionsMenuFlag=false;var $controlBar=$('<div />').addClass('ui-state-default ui-widget-header ui-helper-clearfix control-bar').css('height',this.height);if(_this.isOverlayControls()){$controlBar.hide();}else{$controlBar.addClass('block');}if(embedPlayer.isAudio()&&embedPlayer.getInterface().height()==0){embedPlayer.getInterface().css({'height':this.height});}embedPlayer.getInterface().append($controlBar);if($.browser.mozilla&&parseFloat($.browser.version)<2){embedPlayer.triggerHelper('resizeIframeContainer',[{'height':embedPlayer.height+$controlBar.height()-1}]);}this.addControlComponents();this.addControlBindings();},addControlComponents:function(){var _this=this;var embedPlayer=this.embedPlayer;var $controlBar=embedPlayer.getInterface().find('.control-bar');this.availableWidth=embedPlayer.
getPlayerWidth();mw.log('PlayerControlsBuilder:: addControlComponents into:'+this.availableWidth);this.supportedComponents=$.extend(this.supportedComponents,embedPlayer.supports);if(mw.config.get('EmbedPlayer.AttributionButton')&&embedPlayer.attributionbutton){this.supportedComponents['attributionButton']=true;}if(mw.config.get('EmbedPlayer.EnableFullscreen')===false){this.supportedComponents['fullscreen']=false;}if(mw.config.get('EmbedPlayer.EnableOptionsMenu')===false){this.supportedComponents['options']=false;}if(mw.config.get('EmbedPlayer.EnableVolumeControl')===false){this.supportedComponents['volumeControl']=false;}if(embedPlayer.mediaElement.getPlayableSources().length==1){this.supportedComponents['sourceSwitch']=false;}var source=embedPlayer.mediaElement.getPlayableSources()[0];if(!embedPlayer.disablecontrols&&source){embedPlayer.disablecontrols=source.disablecontrols;}if(embedPlayer.disablecontrols){embedPlayer.disablecontrols.split(',').forEach(function(key){mw.log(
'PlayerControlBuilder:: disabled component via flag:'+key);_this.supportedComponents[key]=false;});}$(embedPlayer).trigger('addControlBarComponent',this);var components=[];var largestPos=0;var addComponent=function(componentId){if(_this.supportedComponents[componentId]){if(_this.availableWidth>=_this.components[componentId].w){_this.availableWidth-=_this.components[componentId].w;var position=_this.components[componentId].position?_this.components[componentId].position:largestPos+1
if(position>largestPos){largestPos=position;}components.push({'id':componentId,'position':position});}else{mw.log('PlayerControlBuilder:: Not enough space for control component:'+componentId);}}};var addComponents=function(){components.sort(function(a,b){return b.position-a.position;});for(var i=0;i<components.length;i++){$controlBar.append(_this.getComponent(components[i]['id']));}}
for(var componentId in this.components){if(this.components[componentId]===false){continue;}if(componentId=='playHead'){continue;}if(componentId=='timeDisplay'&&!mw.config.get('EmbedPlayer.EnableTimeDisplay')){continue;}if(componentId=='fullscreen'&&this.embedPlayer.isAudio()){continue;}if(componentId=='sourceSwitch'&&this.availableWidth<320){continue;}addComponent(componentId);}if(this.availableWidth>30){addComponent('playHead');}addComponents();$(embedPlayer).trigger('controlBarBuildDone');},getAspectPlayerWindowCss:function(windowSize){var embedPlayer=this.embedPlayer;var _this=this;if(!windowSize){var windowSize={'width':$(window).width(),'height':$(window).height()};}windowSize.width=parseInt(windowSize.width);windowSize.height=parseInt(windowSize.height);if(!_this.isOverlayControls()){windowSize.height=windowSize.height-this.height;}var targetWidth=windowSize.width;var targetHeight=targetWidth*(1/_this.getIntrinsicAspect());if(targetHeight>windowSize.height){targetHeight=
windowSize.height;targetWidth=parseInt(targetHeight*_this.getIntrinsicAspect());}var offsetTop=0;offsetTop+=(targetHeight<windowSize.height)?(windowSize.height-targetHeight)/2:0;var offsetLeft=(targetWidth<windowSize.width)?parseInt(windowSize.width-targetWidth)/2:0;var position=(mw.isIOS4()&&mw.isIphone())?'static':'absolute';mw.log('PlayerControlBuilder::getAspectPlayerWindowCss: '+' h:'+targetHeight+' w:'+targetWidth+' t:'+offsetTop+' l:'+offsetLeft);return{'position':position,'height':parseInt(targetHeight),'width':parseInt(targetWidth),'top':parseInt(offsetTop),'left':parseInt(offsetLeft)};},getIntrinsicAspect:function(){var vid=this.embedPlayer.getPlayerElement();if(vid&&vid.videoWidth&&vid.videoHeight){return vid.videoWidth/vid.videoHeight;}if(this.embedPlayer.mediaElement&&this.embedPlayer.mediaElement.selectedSource){var ss=this.embedPlayer.mediaElement.selectedSource;if(ss.aspect){return ss.aspect;}if(ss.width&&ss.height){return ss.width/ss.height}}var img=this.embedPlayer.
getInterface().find('.playerPoster')[0];if(img&&img.naturalWidth&&img.naturalHeight){return img.naturalWidth/img.naturalHeight}return this.embedPlayer.getWidth()/this.embedPlayer.getHeight()},getPlayButtonPosition:function(){var _this=this;return{'position':'absolute','left':'50%','top':'50%','margin-left':-.5*this.getComponentWidth('playButtonLarge'),'margin-top':-.5*this.getComponentHeight('playButtonLarge')};},isInFullScreen:function(){return this.inFullScreen;},toggleFullscreen:function(forceClose){var _this=this;if(this.isInFullScreen()){this.restoreWindowPlayer();}else{this.doFullScreenPlayer();}return false;},doFullScreenPlayer:function(callback){mw.log("PlayerControlBuilder:: doFullScreenPlayer");var _this=this;var doc=window.document;var context=window;this.verticalScrollPosition=doc.all?doc.scrollTop:context.pageYOffset;var embedPlayer=this.embedPlayer;var $interface=embedPlayer.getInterface();if(this.isInFullScreen()==true){return;}this.inFullScreen=true;$interface.addClass(
'fullscreen');if(_this.isOverlayControls()&&!embedPlayer.isTouchDevice()){_this.addFullscreenMouseMoveHideShowControls();}$(embedPlayer).trigger('fullScreenStoreVerticalScroll');if(window.fullScreenApi.supportsFullScreen){_this.preFullscreenPlayerSize=this.getPlayerSize();var fullscreenHeight=null;var fsTarget=this.getFsTarget();var escapeFullscreen=function(event){if(!window.fullScreenApi.isFullScreen(window.document)){_this.restoreWindowPlayer();}}
fsTarget.removeEventListener(fullScreenApi.fullScreenEventName,escapeFullscreen);fsTarget.addEventListener(fullScreenApi.fullScreenEventName,escapeFullscreen);window.fullScreenApi.requestFullScreen(fsTarget);if($.browser.mozilla){_this.fullscreenRestoreCheck=setInterval(function(){if(fullscreenHeight&&$(window).height()<fullscreenHeight){clearInterval(_this.fullscreenRestoreCheck);_this.restoreWindowPlayer();}if(!fullscreenHeight&&_this.preFullscreenPlayerSize.height!=$(window).height()){fullscreenHeight=$(window).height();}},250);}}else{var vid=this.embedPlayer.getPlayerElement();if(mw.config.get('EmbedPlayer.EnableIpadNativeFullscreen')&&vid&&vid.webkitSupportsFullscreen){this.doHybridNativeFullscreen();return;}else{this.doContextTargetFullscreen();}}$(window).keyup(function(event){if(event.keyCode==27){_this.restoreWindowPlayer();}});$(embedPlayer).trigger('onOpenFullScreen');setTimeout(function(){_this.addControls();},100)},doContextTargetFullscreen:function(){var _this=this,doc=
window.document,$doc=$(doc),$target=$(this.getFsTarget()),context=window;this.parentsAbsoluteList=[];this.parentsRelativeList=[];this.orginalParnetViewPortContent=$doc.find('meta[name="viewport"]').attr('content');this.orginalTargetElementLayout={'style':$target[0].style.cssText,'width':$target.width(),'height':$target.height()};mw.log("PlayerControls:: doParentIframeFullscreen> verticalScrollPosition:"+this.verticalScrollPosition);context.scroll(0,0);if(!$doc.find('meta[name="viewport"]').length){$doc.find('head').append($('<meta />').attr('name','viewport'));}$doc.find('meta[name="viewport"]').attr('content','initial-scale=1; maximum-scale=1; minimum-scale=1;');var playerCssPosition=(mw.isIOS())?'absolute':'fixed';$target.parents().each(function(){var $parent=$(this);if($parent.css('position')=='absolute'){_this.parentsAbsoluteList.push($parent);$parent.css('position','static');}if($parent.css('position')=='relative'){_this.parentsRelativeList.push($parent);$parent.css('position',
'static');}});$target.css({'z-index':mw.config.get('EmbedPlayer.FullScreenZIndex'),'position':playerCssPosition,'top':'0px','left':'0px','margin':0}).data('isFullscreen',true);var updateTargetSize=function(){context.scroll(0,0);$target.css({'width':context.innerWidth,'height':context.innerHeight});_this.embedPlayer.applyIntrinsicAspect();};updateTargetSize();$(context).bind('orientationchange',function(e){if(_this.isInFullScreen()){updateTargetSize();}});document.ontouchmove=function(e){if(_this.isInFullScreen()){e.preventDefault();}};},restoreContextPlayer:function(){var _this=this,doc=window.document,$doc=$(doc),$target=$(this.getFsTarget()),context=window;mw.log("PlayerControlsBuilder:: restoreContextPlayer> verticalScrollPosition:"+this.verticalScrollPosition);if(this.orginalParnetViewPortContent){$doc.find('meta[name="viewport"]').attr('content',this.orginalParnetViewPortContent);}else{$doc.find('meta[name="viewport"]').attr('content',
'initial-scale=1; maximum-scale=8; minimum-scale=1;');}if(this.orginalTargetElementLayout){$target[0].style.cssText=this.orginalTargetElementLayout.style;$target.attr({'width':this.orginalTargetElementLayout.width,'height':this.orginalTargetElementLayout.height});_this.embedPlayer.applyIntrinsicAspect();}$doc.find(_this.parentsAbsoluteList).each(function(){$(this).css('position','absolute');});$doc.find(_this.parentsRelativeList).each(function(){$(this).css('position','relative');});},doHybridNativeFullscreen:function(){var vid=this.embedPlayer.getPlayerElement();var _this=this;vid.webkitEnterFullscreen();this.fsIntervalID=setInterval(function(){var currentFS=vid.webkitDisplayingFullscreen;if(_this.isInFullScreen()&&!currentFS){_this.inFullScreen=false;$(_this.embedPlayer).trigger('onCloseFullScreen');clearInterval(_this.fsIntervalID);}},250);},getWindowSize:function(){return{'width':$(window).width(),'height':$(window).height()};},doDomFullscreen:function(){var _this=this;var
embedPlayer=this.embedPlayer;var $interface=embedPlayer.getInterface();$('.mw-fullscreen-overlay').remove();_this.preFullscreenPlayerSize=this.getPlayerSize();$interface.after($('<div />').addClass('mw-fullscreen-overlay').css('z-index',mw.config.get('EmbedPlayer.FullScreenZIndex')).hide().fadeIn("slow"));if(!this.windowPositionStyle){this.windowPositionStyle=$interface.css('position');}if(!this.windowZindex){this.windowZindex=$interface.css('z-index');}this.windowOffset=this.getWindowOffset();$interface.css({'position':'fixed','z-index':mw.config.get('EmbedPlayer.FullScreenZIndex')+1,'top':this.windowOffset.top,'left':this.windowOffset.left});if(embedPlayer.isPersistentNativePlayer()){$(embedPlayer.getPlayerElement()).css({'z-index':mw.config.get('EmbedPlayer.FullScreenZIndex')+1,'position':'absolute'});}_this.parentsAbsolute=[];$('body').css('overflow','hidden');var topOffset='0px';var leftOffset='0px';if($interface.offsetParent()[0].tagName&&$interface.offsetParent()[0].tagName.
toLowerCase()!='body'){topOffset=-this.windowOffset.top+'px';leftOffset=-this.windowOffset.left+'px';}$interface.css('overlow','hidden');$interface.parents().each(function(){if($(this).css('position')=='absolute'){_this.parentsAbsolute.push($(this));$(this).css('position',null);mw.log('PlayerControlBuilder::  should update position: '+$(this).css('position'));}});$(window).keyup(function(event){if(event.keyCode==27){_this.restoreWindowPlayer();}});},addFullscreenMouseMoveHideShowControls:function(){var _this=this;_this.mouseMovedFlag=false;_this.embedPlayer.getInterface().mousemove(function(e){_this.mouseMovedFlag=true;});var checkMovedMouse=function(){if(_this.isInFullScreen()){if(_this.mouseMovedFlag){_this.mouseMovedFlag=false;_this.showControlBar();setTimeout(checkMovedMouse,3000);}else{_this.hideControlBar();setTimeout(checkMovedMouse,250);}return;}};_this.showControlBar();checkMovedMouse();},getWindowOffset:function(){var windowOffset=this.embedPlayer.getInterface().offset();
windowOffset.top=windowOffset.top-$(document).scrollTop();windowOffset.left=windowOffset.left-$(document).scrollLeft();this.windowOffset=windowOffset;return this.windowOffset;},displayFullscreenTip:function(){var _this=this;if(mw.isMobileDevice()){return;}if($.browser.safari&&!/chrome/.test(navigator.userAgent.toLowerCase())){return;}var toolTipMsg=(navigator.userAgent.indexOf('Mac OS X')!=-1)?mw.msg('mwe-embedplayer-fullscreen-tip-osx'):mw.msg('mwe-embedplayer-fullscreen-tip');var $targetTip=this.addWarningBinding('EmbedPlayer.FullscreenTip',$('<h3/>').html(toolTipMsg));$targetTip.show();var hideTip=function(){mw.setConfig('EmbedPlayer.FullscreenTip',false);$targetTip.fadeOut('fast');};$(this.embedPlayer).bind('onCloseFullScreen',hideTip);setTimeout(hideTip,5000);$(document).keyup(function(event){if(event.keyCode==122){hideTip();}return true;});},getPlayerSize:function(){var height=$(window).height()-this.getHeight();if(mw.config.get('EmbedPlayer.IsIframeServer')){return{'height':
height,'width':$(window).width()}}else{return{'height':this.embedPlayer.getInterface().height(),'width':this.embedPlayer.getInterface().width()}}},getFsTarget:function(){var $interface=this.embedPlayer.getInterface();return $interface[0];},restoreWindowPlayer:function(){var _this=this;mw.log("PlayerControlBuilder :: restoreWindowPlayer");var embedPlayer=this.embedPlayer;if(this.isInFullScreen()===false){return;}this.inFullScreen=false;embedPlayer.getInterface().removeClass('fullscreen');if(window.fullScreenApi.supportsFullScreen){var fsTarget=this.getFsTarget();window.fullScreenApi.cancelFullScreen(fsTarget);}this.restoreContextPlayer();$(document).unbind('touchend.fullscreen');$(embedPlayer).trigger('onCloseFullScreen');setTimeout(function(){window.scroll(0,_this.verticalScrollPosition);},100);setTimeout(function(){_this.addControls();},100)},restoreDomPlayer:function(){var _this=this;var embedPlayer=this.embedPlayer;var $interface=embedPlayer.$interface;var interfaceHeight=(_this.
isOverlayControls())?embedPlayer.getHeight():embedPlayer.getHeight()+_this.getHeight();mw.log('restoreWindowPlayer:: h:'+interfaceHeight+' w:'+embedPlayer.getWidth());$('.mw-fullscreen-overlay').remove('slow');mw.log('restore embedPlayer:: '+embedPlayer.getWidth()+' h: '+embedPlayer.getHeight());embedPlayer.getInterface().css({'width':_this.preFullscreenPlayerSize.width,'height':_this.preFullscreenPlayerSize.height});var topPos={'position':_this.windowPositionStyle,'z-index':_this.windowZindex,'overlow':'visible','top':'0px','left':'0px'};$([$interface,$interface.find('.playerPoster'),embedPlayer]).css(topPos);if(embedPlayer.getPlayerElement()){$(embedPlayer.getPlayerElement()).css(topPos)}$('body').css('overflow','auto');if(embedPlayer.isPersistentNativePlayer()){$(embedPlayer.getPlayerElement()).css({'z-index':'auto'});}},getOverlayWidth:function(){return(this.embedPlayer.getPlayerWidth()<300)?300:this.embedPlayer.getPlayerWidth();},getOverlayHeight:function(){return(this.embedPlayer
.getPlayerHeight()<200)?200:this.embedPlayer.getPlayerHeight();},addControlBindings:function(){var embedPlayer=this.embedPlayer;var _this=this;var $interface=embedPlayer.getInterface();_this.onControlBar=false;$(embedPlayer).unbind(this.bindPostfix);var bindFirstPlay=false;_this.addRightClickBinding();_this.addPlayerClickBindings();$(embedPlayer).bind('onplay'+this.bindPostfix,function(){embedPlayer.controlBuilder.addRightClickBinding();});$(embedPlayer).bind('timeupdate'+this.bindPostfix,function(){embedPlayer.updatePlayheadStatus()});$(embedPlayer).bind('progress'+this.bindPostfix,function(event,jEvent,id){var embedPlayer=$('#'+id)[0];embedPlayer.updateBufferStatus();});$(embedPlayer).bind('onEnableInterfaceComponents'+this.bindPostfix,function(){embedPlayer.controlBuilder.controlsDisabled=false;embedPlayer.controlBuilder.addPlayerClickBindings();});$(embedPlayer).bind('onDisableInterfaceComponents'+this.bindPostfix,function(){embedPlayer.controlBuilder.controlsDisabled=true;
embedPlayer.controlBuilder.removePlayerClickBindings();});var bindSpaceUp=function(){$(window).bind('keyup'+_this.bindPostfix,function(e){if(e.keyCode==32){if(embedPlayer.paused){embedPlayer.play();}else{embedPlayer.pause();}return false;}});};var bindSpaceDown=function(){$(window).unbind('keyup'+_this.bindPostfix);};$(window).on("debouncedresize",function(){embedPlayer.triggerHelper('updateLayout');});if(!_this.isOverlayControls()){$interface.show().hover(bindSpaceUp,bindSpaceDown);$(embedPlayer).bind('touchstart'+this.bindPostfix,function(){embedPlayer._playContorls=true;mw.log("PlayerControlBuilder:: touchstart:"+' isPause:'+embedPlayer.paused);if(embedPlayer.paused){embedPlayer.play();}else{embedPlayer.pause();}});}else{$(embedPlayer).bind('touchstart'+this.bindPostfix,function(){if(embedPlayer.getInterface().find('.control-bar').is(':visible')){if(embedPlayer.paused){embedPlayer.play();}else{embedPlayer.pause();}}else{_this.showControlBar();}clearTimeout(_this.
hideControlBarCallback);_this.hideControlBarCallback=setTimeout(function(){_this.hideControlBar();},60000);return true;});var hoverIntentConfig={'sensitivity':100,'timeout':1000,'over':function(e){if(mw.isIE9()){clearTimeout(_this.hideControlBarCallback);_this.hideControlBarCallback=false;}_this.showControlBar();bindSpaceUp();},'out':function(e){_this.hideControlBar();bindSpaceDown();}};if(mw.isIE9()){$(embedPlayer.getPlayerElement()).hoverIntent(hoverIntentConfig);embedPlayer.getInterface().find('.control-bar').hover(function(e){_this.onControlBar=true;embedPlayer.getInterface().find('.control-bar').show();},function(e){if(!_this.hideControlBarCallback){_this.hideControlBarCallback=setTimeout(function(){_this.hideControlBar();},1000);}_this.onControlBar=false;});}else{if(!mw.isIpad()){$interface.hoverIntent(hoverIntentConfig);}}}if(_this.checkNativeWarning()){_this.addWarningBinding('EmbedPlayer.ShowNativeWarning',mw.msg('mwe-embedplayer-for_best_experience',$('<div>').append($(
'<a />').attr({'href':'http://www.mediawiki.org/wiki/Extension:TimedMediaHandler/Client_download','target':'_new'}))[0].innerHTML));}if($.browser.msie&&$.browser.version<=6){$('#'+embedPlayer.id+' .play-btn-large').pngFix();}this.doVolumeBinding();if(this.addSkinControlBindings&&typeof(this.addSkinControlBindings)=='function'){this.addSkinControlBindings();}mw.log('trigger::addControlBindingsEvent');$(embedPlayer).trigger('addControlBindingsEvent');},removePlayerClickBindings:function(){$(this.embedPlayer).unbind("click"+this.bindPostfix).unbind("dblclick"+this.bindPostfix);},addPlayerClickBindings:function(){var _this=this;var embedPlayer=this.embedPlayer;document.ontouchmove=function(e){if(_this.isInFullScreen()){e.preventDefault();}};this.removePlayerClickBindings();if(this.supportedComponents['fullscreen']){$(embedPlayer).bind("dblclick"+_this.bindPostfix,function(){embedPlayer.fullscreen();});}var dblClickTime=300;var lastClickTime=0;var didDblClick=false;var playerClickCb=
function(event){if(event.currentTarget.id!=embedPlayer.id){embedPlayer=$('#'+event.currentTarget.id)[0];}mw.log("PlayerControlBuilder:: click:"+embedPlayer.id+' isPause:'+embedPlayer.paused);if(embedPlayer.useNativePlayerControls()||_this.isControlsDisabled()||embedPlayer.isTouchDevice()){return true;}var clickTime=new Date().getTime();if(clickTime-lastClickTime<dblClickTime){didDblClick=true;setTimeout(function(){didDblClick=false;},dblClickTime+10);}lastClickTime=clickTime;setTimeout(function(){if(!didDblClick){if(embedPlayer.paused){embedPlayer.play();}else{embedPlayer.pause();}}},dblClickTime);return true;};if(embedPlayer.attachEvent){embedPlayer.attachEvent("onclick",playerClickCb);}else{embedPlayer.addEventListener('click',playerClickCb,false);}},addRightClickBinding:function(){var embedPlayer=this.embedPlayer;if(mw.config.get('EmbedPlayer.EnableRightClick')===false){document.oncontextmenu=function(e){return false;};$(embedPlayer).mousedown(function(e){if(e.button==2){return false
;}});}},hideControlBar:function(){var animateDuration='fast';var _this=this;if(_this.displayOptionsMenuFlag||_this.keepControlBarOnScreen){setTimeout(function(){_this.hideControlBar();},200);return;}if(this.onControlBar===true){return;}this.embedPlayer.getInterface().find('.control-bar').fadeOut(animateDuration);$(this.embedPlayer).trigger('onHideControlBar',[{'bottom':15},this.embedPlayer.id]);},restoreControlsHover:function(){if(this.isOverlayControls()){this.keepControlBarOnScreen=false;}},showControlBar:function(keepOnScreen){var animateDuration='fast';if(!this.embedPlayer)return;if(this.embedPlayer.getPlayerElement&&!this.embedPlayer.isPersistentNativePlayer()){$(this.embedPlayer.getPlayerElement()).css('z-index','1');}mw.log('PlayerControlBuilder:: ShowControlBar,  keep on screen: '+keepOnScreen);this.embedPlayer.getInterface().find('.control-bar').fadeIn(animateDuration);if(keepOnScreen){this.keepControlBarOnScreen=true;}$(this.embedPlayer).trigger('onShowControlBar',[{'bottom':
this.getHeight()+15},this.embedPlayer.id]);},isOverlayControls:function(){if(!this.embedPlayer.supports['overlays']){return false;}if(this.embedPlayer.overlaycontrols===false){return false;}if(this.embedPlayer.isAudio()){return false;}if(mw.config.get('EmbedPlayer.OverlayControls')===false){return false;}if(this.embedPlayer.controls===false){return false;}return true;},isControlsDisabled:function(){return this.controlsDisabled;},checkNativeWarning:function(){if(mw.config.get('EmbedPlayer.ShowNativeWarning')===false){return false;}if(this.embedPlayer.instanceOf=='ImageOverlay'){return false;}if(parseInt(this.embedPlayer.getPlayerHeight())<199){return false;}if(this.embedPlayer.instanceOf=='Native'){return false;}if(/chrome/.test(navigator.userAgent.toLowerCase())&&mw.EmbedTypes.getMediaPlayers().getMIMETypePlayers('video/webm').length){return false;}if((mw.EmbedTypes.getMediaPlayers().getMIMETypePlayers('video/h264').length&&this.embedPlayer.mediaElement.getSources('video/h264').length)
||(mw.EmbedTypes.getMediaPlayers().getMIMETypePlayers('video/x-flv').length&&this.embedPlayer.mediaElement.getSources('video/x-flv').length)||(mw.EmbedTypes.getMediaPlayers().getMIMETypePlayers('application/vnd.apple.mpegurl').length&&this.embedPlayer.mediaElement.getSources('application/vnd.apple.mpegurl').length)||(mw.EmbedTypes.getMediaPlayers().getMIMETypePlayers('audio/mpeg').length&&this.embedPlayer.mediaElement.getSources('audio/mpeg').length)){return false;}return true;},addWarningBinding:function(preferenceId,warningMsg,hideDisableUi){mw.log('mw.PlayerControlBuilder: addWarningBinding: '+preferenceId+' wm: '+warningMsg);var embedPlayer=this.embedPlayer;var _this=this;if(embedPlayer.getWidth()<200){return false;}if(mw.config.get(preferenceId)===true&&$.cookie(preferenceId)=='hidewarning'){return;}var warnId="warningOverlay_"+embedPlayer.id;$('#'+warnId).remove();var $targetWarning=$('<div />').attr({'id':warnId}).addClass('ui-corner-all').css({'position':'absolute','background'
:'#FFF','color':'#111','top':'10px','left':'10px','right':'10px','padding':'4px','z-index':2}).html(warningMsg);embedPlayer.getInterface().append($targetWarning);$targetWarning.append($('<br />'));if(!hideDisableUi){$targetWarning.append($('<input type="checkbox" />').attr({'id':'ffwarn_'+embedPlayer.id,'name':'ffwarn_'+embedPlayer.id}).click(function(){mw.log("WarningBindinng:: set "+preferenceId+' to hidewarning ');$.cookie(preferenceId,'hidewarning',{expires:30});mw.setConfig(preferenceId,false);$('#warningOverlay_'+embedPlayer.id).fadeOut('slow');_this.addWarningFlag=false;}));$targetWarning.append($('<label />').text(mw.msg('mwe-embedplayer-do_not_warn_again')).attr('for','ffwarn_'+embedPlayer.id));}return $targetWarning;},doVolumeBinding:function(){var embedPlayer=this.embedPlayer;var _this=this;embedPlayer.getInterface().find('.volume_control').unbind().buttonHover().click(function(){mw.log('Volume control toggle');embedPlayer.toggleMute();});if(this.volumeLayout=='vertical'){
var hoverOverDelay=false;var $targetvol=embedPlayer.getInterface().find('.vol_container').hide();embedPlayer.getInterface().find('.volume_control').hover(function(){$targetvol.addClass('vol_container_top');if(embedPlayer&&embedPlayer.isPlaying&&embedPlayer.isPlaying()&&!embedPlayer.supports['overlays']){$targetvol.removeClass('vol_container_top').addClass('vol_container_below');}$targetvol.fadeIn('fast');hoverOverDelay=true;},function(){hoverOverDelay=false;setTimeout(function(){if(!hoverOverDelay){$targetvol.fadeOut('fast');}},500);});}var userSlide=false;var sliderConf={range:"min",value:80,min:0,max:100,slide:function(event,ui){var percent=ui.value/100;mw.log('PlayerControlBuilder::slide:update volume:'+percent);embedPlayer.setVolume(percent);userSlide=true;},change:function(event,ui){var percent=ui.value/100;if(percent==0){embedPlayer.getInterface().find('.volume_control span').removeClass('ui-icon-volume-on').addClass('ui-icon-volume-off');}else{embedPlayer.getInterface().find(
'.volume_control span').removeClass('ui-icon-volume-off').addClass('ui-icon-volume-on');}mw.log('PlayerControlBuilder::change:update volume:'+percent);embedPlayer.setVolume(percent,userSlide);userSlide=false;}};if(this.volumeLayout=='vertical'){sliderConf['orientation']="vertical";}embedPlayer.getInterface().find('.volume-slider').slider(sliderConf);},getOptionsMenu:function(){var $optionsMenu=$('<ul />');for(var menuItemKey in this.optionMenuItems){if($.inArray(menuItemKey,mw.config.get('EmbedPlayer.EnabledOptionsMenuItems'))===-1){continue;}$optionsMenu.append(this.optionMenuItems[menuItemKey](this));}return $optionsMenu;},onClipDone:function(){},onSeek:function(){this.setStatus(mw.msg('mwe-embedplayer-seeking'));this.embedPlayer.addPlayerSpinner();this.embedPlayer.hideSpinnerOncePlaying();},setStatus:function(value){if(this.embedPlayer.getInterface()){this.embedPlayer.getInterface().find('.time-disp').text(value);}},optionMenuItems:{'share':function(ctrlObj){return $.getLineItem(mw.
msg('mwe-embedplayer-share'),'mail-closed',function(){ctrlObj.displayMenuOverlay(ctrlObj.getShare());$(ctrlObj.embedPlayer).trigger('showShareEvent');});},'aboutPlayerLibrary':function(ctrlObj){return $.getLineItem(mw.msg('mwe-embedplayer-about-library'),'info',function(){ctrlObj.displayMenuOverlay(ctrlObj.aboutPlayerLibrary());$(ctrlObj.embedPlayer).trigger('aboutPlayerLibrary');});}},closeMenuOverlay:function(){var _this=this;var embedPlayer=this.embedPlayer;var $overlay=embedPlayer.getInterface().find('.overlay-win,.ui-widget-overlay,.ui-widget-shadow');this.displayOptionsMenuFlag=false;$overlay.fadeOut("slow",function(){$overlay.remove();});if(embedPlayer.isStopped()&&(embedPlayer.sequenceProxy&&embedPlayer.sequenceProxy.isInSequence==false)){embedPlayer.getInterface().find('.play-btn-large').fadeIn('slow');}$(embedPlayer).trigger('closeMenuOverlay');return false;},displayMenuOverlay:function(overlayContent,closeCallback,hideCloseButton){var _this=this;var embedPlayer=this.
embedPlayer;mw.log('PlayerControlBuilder:: displayMenuOverlay');this.displayOptionsMenuFlag=true;if(!this.supportedComponents['overlays']){embedPlayer.stop();}embedPlayer.hideLargePlayBtn();if(embedPlayer.getInterface().find('.overlay-win').length!=0){embedPlayer.getInterface().find('.overlay-content').html(overlayContent);return;}embedPlayer.getInterface().append($('<div />').addClass('ui-widget-overlay').css({'height':'100%','width':'100%','z-index':2}));var $closeButton=[];if(!hideCloseButton){$closeButton=$('<div />').addClass('ui-state-default ui-corner-all ui-icon_link rButton').css({'position':'absolute','cursor':'pointer','top':'2px','right':'2px'}).click(function(){_this.closeMenuOverlay();if(closeCallback){closeCallback();}}).append($('<span />').addClass('ui-icon ui-icon-closethick'));}var controlBarHeight=embedPlayer.getInterface().find('.control-bar').height();var overlayWidth=(embedPlayer.getWidth()-30);var overlayHeight=(embedPlayer.getHeight()-(controlBarHeight+30));var
overlayTop=(((embedPlayer.getInterface().height()-controlBarHeight)-overlayHeight)/2);var overlayLeft=((embedPlayer.getInterface().width()-overlayWidth)/2);var overlayMenuCss={'height':overlayHeight+'px','width':overlayWidth+'px','position':'absolute','top':overlayTop+'px','left':overlayLeft+'px','margin':'0 10px 10px 0','overflow':'auto','padding':'4px','z-index':3};var $overlayMenu=$('<div />').addClass('overlay-win ui-state-default ui-widget-header ui-corner-all').css(overlayMenuCss).append($closeButton,$('<div />').addClass('overlay-content').append(overlayContent));embedPlayer.getInterface().prepend($overlayMenu).find('.overlay-win').fadeIn("slow");$(embedPlayer).trigger('displayMenuOverlay');return false;},closeAlert:function(keepOverlay){var embedPlayer=this.embedPlayer;var $alert=$('#alertContainer');mw.log('mw.PlayerControlBuilder::closeAlert');if(!keepOverlay||(mw.isIpad()&&this.inFullScreen)){embedPlayer.controlBuilder.closeMenuOverlay();if(mw.isIpad()){embedPlayer.
disablePlayControls();}}$alert.remove();return false;},displayAlert:function(alertObj){var embedPlayer=this.embedPlayer;var callback;mw.log('PlayerControlBuilder::displayAlert:: '+alertObj.title);if(embedPlayer.getInterface().find('.overlay-win').length!=0){return;}if(typeof alertObj.callbackFunction=='string'){if(alertObj.isExternal){try{callback=window.parent[alertObj.callbackFunction];}catch(e){}}else{callback=window[alertObj.callbackFunction];}}else if(typeof alertObj.callbackFunction=='function'){callback=alertObj.callbackFunction;}else{mw.log("PlayerControlBuilder :: displayAlert :: Error: bad callback type");callback=function(){};}var $container=$('<div />').attr('id','alertContainer').addClass('alert-container');var $title=$('<div />').text(alertObj.title).addClass('alert-title alert-text');if(alertObj.props&&alertObj.props.titleTextColor){$title.removeClass('alert-text');$title.css('color',mw.getHexColor(alertObj.props.titleTextColor));}var $message=$('<div />').text(alertObj.
message).addClass('alert-message alert-text');if(alertObj.isError){$message.addClass('error');}if(alertObj.props&&alertObj.props.textColor){$message.removeClass('alert-text');$message.css('color',mw.getHexColor(alertObj.props.textColor));}var $buttonsContainer=$('<div />').addClass('alert-buttons-container');if(alertObj.props&&alertObj.props.buttonRowSpacing){$buttonsContainer.css('margin-top',alertObj.props.buttonRowSpacing);}var $buttonSet=alertObj.buttons||[];var buttonsNum=$buttonSet.length;if(buttonsNum==0&&!alertObj.noButtons){$buttonSet=["OK"];buttonsNum++;}$.each($buttonSet,function(i){var label=this.toString();var $currentButton=$('<button />').addClass('alert-button').text(label).click(function(eventObject){callback(eventObject);embedPlayer.controlBuilder.closeAlert(alertObj.keepOverlay);});if(alertObj.props&&alertObj.props.buttonHeight){$currentButton.css('height',alertObj.props.buttonHeight);}if(buttonsNum>1){if(i<buttonsNum-1){if(alertObj.props&&alertObj.props.
buttonSpacing){$currentButton.css('margin-right',alertObj.props.buttonSpacing);}}}$buttonsContainer.append($currentButton);})
$container.append($title,$message,$buttonsContainer);return embedPlayer.controlBuilder.displayMenuOverlay($container,false,true);},aboutPlayerLibrary:function(){return $('<div />').append($('<h2 />').text(mw.msg('mwe-embedplayer-about-library')),$('<span />').append(mw.msg('mwe-embedplayer-about-library-desc',$('<div>').append($('<a />').attr({'href':mw.config.get('EmbedPlayer.LibraryPage'),'target':'_new'}))[0].innerHTML)));},getShare:function(){var embedPlayer=this.embedPlayer;var embed_code=embedPlayer.getSharingEmbedCode();var embed_wiki_code=embedPlayer.getWikiEmbedCode();var _this=this;var $shareInterface=$('<div />');var $shareList=$('<ul />');$shareList.append($('<li />').text(mw.msg('mwe-embedplayer-embed_site_or_blog')));$shareInterface.append($('<h2 />').text(mw.msg('mwe-embedplayer-share_this_video')));if(embed_wiki_code){$shareInterface.append($('<ul />').append($('<li />').text(mw.msg('mwe-embedplayer-embed_wiki'))),$('<textarea />').attr('rows',1).html(embed_wiki_code).
click(function(){$(this).select();}),$('<br />'));}$shareInterface.append($shareList);$shareInterface.append($('<textarea />').attr('rows',4).html(embed_code).click(function(){$(this).select();}),$('<br />'),$('<br />'));return $shareInterface;},getPlayerSelect:function(){mw.log('PlayerControlBuilder::getPlayerSelect: source:'+this.embedPlayer.mediaElement.selectedSource.getSrc()+' player: '+this.embedPlayer.selectedPlayer.id);var embedPlayer=this.embedPlayer;var _this=this;var $playerSelect=$('<div />').append($('<h2 />').text(mw.msg('mwe-embedplayer-choose_player')));$.each(embedPlayer.mediaElement.getPlayableSources(),function(sourceId,source){var isPlayable=(typeof mw.EmbedTypes.getMediaPlayers().defaultPlayer(source.getMIMEType())=='object');var isSelected=(source.getSrc()==embedPlayer.mediaElement.selectedSource.getSrc());$playerSelect.append($('<h3 />').text(source.getTitle()));if(isPlayable){var $playerList=$('<ul />');var supportingPlayers=mw.EmbedTypes.getMediaPlayers().
getMIMETypePlayers(source.getMIMEType());for(var i=0;i<supportingPlayers.length;i++){if(embedPlayer.selectedPlayer.id==supportingPlayers[i].id&&isSelected){var $playerLine=$('<span />').append($('<a />').attr({'href':'#'}).addClass('active').text(supportingPlayers[i].getName()).click(function(){embedPlayer.controlBuilder.closeMenuOverlay();return false;}));}else{$playerLine=$('<a />').attr({'href':'#','id':'sc_'+sourceId+'_'+supportingPlayers[i].id}).addClass('ui-corner-all').text(supportingPlayers[i].getName()).click(function(){var iparts=$(this).attr('id').replace(/sc_/,'').split('_');var sourceId=iparts[0];var player_id=iparts[1];mw.log('PlayerControlBuilder:: source id: '+sourceId+' player id: '+player_id);embedPlayer.controlBuilder.closeMenuOverlay();if(_this.isInFullScreen()){_this.restoreWindowPlayer();}embedPlayer.mediaElement.setSourceByIndex(sourceId);var playableSources=embedPlayer.mediaElement.getPlayableSources();mw.EmbedTypes.getMediaPlayers().setPlayerPreference(
player_id,playableSources[sourceId].getMIMEType());embedPlayer.stop();return false;}).hover(function(){$(this).addClass('active');},function(){$(this).removeClass('active');});}$playerList.append($('<li />').append($playerLine));}$playerSelect.append($playerList);}else{$playerSelect.append(mw.msg('mwe-embedplayer-no-player',source.getTitle()));}});return $playerSelect;},showDownload:function($target){var _this=this;var embedPlayer=this.embedPlayer;_this.showDownloadWithSources($target);},showDownloadWithSources:function($target){var _this=this;mw.log('PlayerControlBuilder:: showDownloadWithSources::'+$target.length);var embedPlayer=this.embedPlayer;$target.empty();$target.append($('<div />'));$target=$target.find('div');var $mediaList=$('<ul />');var $textList=$('<ul />');$.each(embedPlayer.mediaElement.getSources(),function(index,source){if(source.getSrc()){mw.log("showDownloadWithSources:: Add src: "+source.getTitle());var fileName=source.mwtitle;if(!fileName){var path=new mw.Uri(
source.getSrc()).path;var pathParts=path.split('/');fileName=pathParts[pathParts.length-1];}var $dlLine=$('<li />').append($('<a />').attr({'href':source.getSrc(),'download':fileName}).text(source.getTitle()));if(source.getSrc().indexOf('?t=')!==-1){$target.append($dlLine);}else if(this.getMIMEType().indexOf('text')===0){$textList.append($dlLine);}else{$mediaList.append($dlLine);}}});if($mediaList.find('li').length!=0){$target.append($('<h2 />').text(mw.msg('mwe-embedplayer-download_full')),$mediaList);}if($textList.find('li').length!=0){$target.append($('<h2 />').html(mw.msg('mwe-embedplayer-download_text')),$textList);}},getSwitchSourceMenu:function(){var _this=this;var embedPlayer=this.embedPlayer;var $sourceMenu=$('<ul />');function addToSourceMenu(source){var icon=(source.getSrc()==embedPlayer.mediaElement.selectedSource.getSrc())?'bullet':'radio-on';$sourceMenu.append($.getLineItem(source.getShortTitle(),icon,function(){mw.log('PlayerControlBuilder::SwitchSourceMenu: '+source.
getSrc());$(this).parent().siblings().find('span.ui-icon').removeClass('ui-icon-bullet').addClass('ui-icon-radio-on');$(this).find('span.ui-icon').removeClass('ui-icon-radio-on').addClass('ui-icon-bullet');embedPlayer.getInterface().find('.source-switch').text(source.getShortTitle());embedPlayer.mediaElement.setSource(source);if(!_this.embedPlayer.isStopped()){var oldMediaTime=_this.embedPlayer.getPlayerElement().currentTime;var oldPaused=_this.embedPlayer.paused;embedPlayer.playerSwitchSource(source,function(vid){embedPlayer.setCurrentTime(oldMediaTime,function(){if(oldPaused){embedPlayer.pause();}});});}}));}$.each(this.embedPlayer.mediaElement.getPlayableSources(),function(sourceIndex,source){var supportingPlayers=mw.EmbedTypes.getMediaPlayers().getMIMETypePlayers(source.getMIMEType());for(var i=0;i<supportingPlayers.length;i++){if(supportingPlayers[i].library=='Native'){addToSourceMenu(source);}}});return $sourceMenu;},getComponent:function(componentId){if(this.components[
componentId]){return this.components[componentId].o(this);}else{return false;}},getComponentHeight:function(componentId){if(this.components[componentId]&&this.components[componentId].h){return this.components[componentId].h;}return 0;},getComponentWidth:function(componentId){if(this.components[componentId]&&this.components[componentId].w){return this.components[componentId].w;}return 0;},disableSeekBar:function(){var $playHead=this.embedPlayer.getInterface().find(".play_head");if($playHead.length){$playHead.slider("option","disabled",true);}},enableSeekBar:function(){var $playHead=this.embedPlayer.getInterface().find(".play_head");if($playHead.length){$playHead.slider("option","disabled",false);}},components:{'pause':{'w':28,'position':1,'o':function(ctrlObj){return $('<div />').attr('title',mw.msg('mwe-embedplayer-play_clip')).addClass("ui-state-default ui-corner-all ui-icon_link lButton play-btn").append($('<span />').addClass("ui-icon ui-icon-play")).buttonHover().click(function(){
ctrlObj.embedPlayer.play();return false;});}},'volumeControl':{'w':28,'position':7,'o':function(ctrlObj){mw.log('PlayerControlBuilder::Set up volume control for: '+ctrlObj.embedPlayer.id);var $volumeOut=$('<span />');if(ctrlObj.volumeLayout=='horizontal'){$volumeOut.append($('<div />').addClass("ui-slider ui-slider-horizontal rButton volume-slider"));}$volumeOut.append($('<div />').attr('title',mw.msg('mwe-embedplayer-volume_control')).addClass("ui-state-default ui-corner-all ui-icon_link rButton volume_control").append($('<span />').addClass("ui-icon ui-icon-volume-on")));if(ctrlObj.volumeLayout=='vertical'){$volumeOut.find('.volume_control').append($('<div />').hide().addClass("vol_container ui-corner-all").append($('<div />').addClass("volume-slider")));}return $volumeOut.html();}},'playButtonLarge':{'w':70,'h':53,'position':2,'o':function(ctrlObj){return $('<div />').attr({'title':mw.msg('mwe-embedplayer-play_clip'),'class':"play-btn-large"}).css(ctrlObj.getPlayButtonPosition()).
click(function(){ctrlObj.embedPlayer.play();return false;});}},'attributionButton':{'w':28,'position':3,'o':function(ctrlObj){var buttonConfig=mw.config.get('EmbedPlayer.AttributionButton');if(buttonConfig.iconurl){var $icon=$('<img />').attr('src',buttonConfig.iconurl);}else{var $icon=$('<span />').addClass('ui-icon');if(buttonConfig['class']){$icon.addClass(buttonConfig['class']);}}if(typeof buttonConfig.style!='object'){buttonConfig.style={};}if(buttonConfig.style.width){this.w=parseInt(buttonConfig.style.width);}else{buttonConfig.style.width=parseInt(this.w)+'px';}return $('<div />').addClass('rButton').css({'top':'1px','left':'2px'}).css(buttonConfig.style).append($('<a />').attr({'href':buttonConfig.href,'title':buttonConfig.title,'target':'_new'}).append($icon));}},'timeDisplay':{'w':mw.config.get('EmbedPlayer.TimeDisplayWidth'),'position':6,'o':function(ctrlObj){return $('<div />').addClass("ui-widget time-disp").append(ctrlObj.embedPlayer.getTimeRange());}},'options':{'w':28,
'position':10,'o':function(ctrlObj){return $('<div />').attr('title',mw.msg('mwe-embedplayer-player_options')).addClass('ui-state-default ui-corner-all ui-icon_link rButton options-btn').append($('<span />').addClass('ui-icon ui-icon-wrench')).buttonHover().embedMenu({'content':ctrlObj.getOptionsMenu(),'zindex':mw.config.get('EmbedPlayer.FullScreenZIndex')+2,'positionOpts':{'directionV':'up','offsetY':30,'directionH':'left','offsetX':-28}});}},'fullscreen':{'w':24,'position':8,'o':function(ctrlObj){var $btn=$('<div />').attr('title',mw.msg('mwe-embedplayer-player_fullscreen')).addClass("ui-state-default ui-corner-all ui-icon_link rButton fullscreen-btn").append($('<span />').addClass("ui-icon ui-icon-arrow-4-diag")).buttonHover();if((mw.config.get('EmbedPlayer.IsIframeServer')&&mw.isIpad3())||mw.config.get("EmbedPlayer.NewWindowFullscreen")||(mw.config.get('EmbedPlayer.IsIframeServer')&&mw.config.get('EmbedPlayer.EnableIframeApi')===false)){var url=ctrlObj.embedPlayer.
getIframeSourceUrl();return $('<a />').attr({'href':url,'target':'_new'}).click(function(){var url=$(this).attr('href');var iframeMwConfig={};iframeMwConfig['EmbedPlayer.IsFullscreenIframe']=true;iframeMwConfig['EmbedPlayer.IframeCurrentTime']=ctrlObj.embedPlayer.currentTime;iframeMwConfig['EmbedPlayer.IframeIsPlaying']=ctrlObj.embedPlayer.isPlaying();iframeMwConfig['EmbedPlayer.IframeParentUrl']=document.URL;url+='#'+encodeURIComponent(JSON.stringify({'mwConfig':iframeMwConfig,'playerId':playerId}));ctrlObj.embedPlayer.pause();var newwin=window.open(url,ctrlObj.embedPlayer.id,'width='+screen.width+', height='+(screen.height-90)+', top=0, left=0'+', fullscreen=yes');if(newwin===null){return true;}if(window.focus){newwin.focus();}return false;}).append($btn);}else{return $btn.click(function(){ctrlObj.embedPlayer.fullscreen();});}}},'sourceSwitch':{'w':70,'position':9,'o':function(ctrlObj){var $menuContainer=$('<div />').addClass('swMenuContainer').hide();ctrlObj.embedPlayer.getInterface
().append($menuContainer)
return $('<div />').addClass('ui-widget source-switch').append(ctrlObj.embedPlayer.mediaElement.selectedSource.getShortTitle()).embedMenu({'content':ctrlObj.getSwitchSourceMenu(),'zindex':mw.config.get('EmbedPlayer.FullScreenZIndex')+2,'keepPosition':true,'targetMenuContainer':$menuContainer,'width':130,'showSpeed':0,'createMenuCallback':function(){var $interface=ctrlObj.embedPlayer.getInterface();var $sw=$interface.find('.source-switch');var $swMenuContainer=$interface.find('.swMenuContainer');var height=$swMenuContainer.find('li').length*30;var top=$interface.height()-height-ctrlObj.getHeight()-6;$menuContainer.css({'position':'absolute','left':$sw[0].offsetLeft,'top':top,'bottom':ctrlObj.getHeight(),'height':height})
ctrlObj.showControlBar(true);},'closeMenuCallback':function(){ctrlObj.restoreControlsHover()}});}},'playHead':{'w':0,'position':5,'o':function(ctrlObj){var sliderConfig={range:"min",value:0,min:0,max:1000,start:function(event,ui){var id=(embedPlayer.pc!=null)?embedPlayer.pc.pp.id:embedPlayer.id;embedPlayer.userSlide=true;$(id+' .play-btn-large').fadeOut('fast');embedPlayer.startTimeSec=(embedPlayer.instanceOf=='mvPlayList')?0:mw.npt2seconds(embedPlayer.getTimeRange().split('/')[0]);},slide:function(event,ui){var perc=ui.value/1000;embedPlayer.jumpTime=mw.seconds2npt(parseFloat(parseFloat(embedPlayer.getDuration())*perc)+embedPlayer.startTimeSec);if(_this.longTimeDisp){ctrlObj.setStatus(mw.msg('mwe-embedplayer-seek_to',embedPlayer.jumpTime));}else{ctrlObj.setStatus(embedPlayer.jumpTime);}if(embedPlayer.isPlaying==false){embedPlayer.updateThumbPerc(perc);}},change:function(event,ui){if(embedPlayer.userSlide){embedPlayer.userSlide=false;embedPlayer.seeking=true;var perc=ui.value/1000;
embedPlayer.seekTimeSec=mw.npt2seconds(embedPlayer.jumpTime,true);mw.log('PlayerControlBuilder:: seek to: '+embedPlayer.jumpTime+' perc:'+perc+' sts:'+embedPlayer.seekTimeSec);ctrlObj.setStatus(mw.msg('mwe-embedplayer-seeking'));if(embedPlayer.isStopped()){embedPlayer.play();}embedPlayer.seek(perc);}}};var embedPlayer=ctrlObj.embedPlayer;var _this=this;var $playHead=$('<div />').addClass("play_head").css({"position":'absolute',"left":'33px',"right":((embedPlayer.getPlayerWidth()-ctrlObj.availableWidth-33))+'px'}).slider(sliderConfig);$playHead.find('.ui-slider-handle').css('z-index',4);$playHead.find('.ui-slider-range').addClass('ui-corner-all').css('z-index',2);$playHead.append($('<div />').addClass("ui-slider-range ui-slider-range-min ui-widget-header").addClass("ui-state-highlight ui-corner-all mw_buffer"));function showPosition(event){var pos=(event.clientX-$playHead.offset().left)/$playHead.width();var time=mw.seconds2npt(parseFloat(embedPlayer.getDuration())*pos+(embedPlayer.
startTimeSec||0));$playHead.attr('title',time);}$playHead.on({mouseenter:showPosition,mouseleave:function(event){$playHead.attr({title:''});},mousemove:showPosition});return $playHead;}}}};})(window.mediaWiki,window.jQuery);;},{"css":[
".mwPlayerContainer,video{width:100%;height:100%}.mwPlayerContainer{position:relative;height:100%;background:#000}.videoHolder{position:absolute;top:0px;left:0px;right:0px;bottom:0px;overflow:hidden}.mwPlayerContainer.fullscreen{position:absolute !important;width:100% !important;height:100%! important;z-index:9999;min-height:100%;top:0;left:0;margin:0}.mwEmbedPlayer{width:100%;height:100%;overflow:hidden;position:absolute;top:0;left:0}.player_select_list{color:white;font-size:10pt; }.player_select_list a:visited{color:white}.mv_playhead{position:absolute;top:0;left:0;width:17px;height:21px; }.mv_status{font-family:\"Times New Roman\",Times,serif;font-size:14px;float:left}.set_ogg_player_pref{text-align:left}.large_play_button{display:block;width:130px;height:96px;margin:auto; position:absolute;z-index:3;cursor:pointer} .ui-icon_link{padding:.4em 1em .4em 20px;text-decoration:none;position:relative}.ui-icon_link span.ui-icon{margin:0 5px 0 0;position:absolute;left:0.2em;right:auto;top:50%;margin-top:-8px;zoom:1}.ui-icon_link span.ui-text{position:absolute;left:0.2em;right:auto;margin-top:-3px;zoom:1}.ui-progressbar-value{ background-image:url('images/pbar-ani.gif')}.kplayer .ui-widget-overlay{background:black;opacity:.40;filter:Alpha(Opacity=40)}.kplayer .ui-widget-content input{padding:5px}.kplayer .ui-widget-content a{color:#222}ul.ui-provider-selection{list-style-type:none;margin:0 0 0.6em 0;overflow:hidden;padding:0;text-align:center}ul.ui-provider-selection li{border-left:1px solid black;float:left;line-height:1.1em;margin:0 0.5em 0 -0.5em;padding:0 0.5em;color:blue;list-style-image:none;cursor:pointer}ul.ui-provider-selection li .ui-selected{color:black;font-weight:bold}ul.ui-provider-selection li a.ui-active{color:black;font-weight:bold}ul.ui-provider-selection li a{color:blue;text-decoration:none}.fg-menu .ui-icon{position:relative;top:-1px}.ui-dialog-buttonpane a{float:right;margin-right:10px} .mv-player .overlay-win{background:transparent;border:0} .mv-player .overlay-content{padding:10px}.mv-player .overlay-content h3{display:block;font-size:16px;font-weight:bold;color:#fff;font-family:arial}.mv-player .overlay-win h2{font-size:18px;margin-top:0}.mv-player .overlay-content div{font-size:12px;color:#fff;font-weight:bold}.mv-player .overlay-content div a{color:#00a8ff }.mv-player .overlay-content div a:hover{color:#3abcff }.mv-player .overlay-content ul{list-style:none;margin:0 0 10px 0;padding:0}.mv-player .vol_container{background:#272727;opacity:.80;filter:Alpha(Opacity=80);position:absolute;left:0px}.mv-player .ui-icon ui-icon-closethick{border:1px solid #606060;background:#222;font-weight:normal;color:#EEE}.mv-player .overlay-win textarea{background:#e4e4e4;height:35px;padding:6px;color:#666;border:0}.mv-player .overlay-content .copycode{padding:8px 12px;font-weight:bold;float:right;cursor:pointer}.control-bar .ui-icon_link{border:0}.control-bar .ui-state-hover{border:0}\n/* cache key: enwiki:resourceloader:filter:minify-css:7:aee8474c0ed48fb8c62dd4ec7be3c879 */"
]},{"mwe-embedplayer-credit-title":"Title: $1","mwe-embedplayer-credit-date":"Date: $1","mwe-embedplayer-credit-author":"Author: $1","mwe-embedplayer-nocredits":"No credits available","mwe-embedplayer-loading_plugin":"Loading plugin ...","mwe-embedplayer-select_playback":"Set playback preference","mwe-embedplayer-link_back":"Link back","mwe-embedplayer-error_swap_vid":"Error: mwEmbed was unable to swap the video tag for the mwEmbed interface","mwe-embedplayer-add_to_end_of_sequence":"Add to end of sequence","mwe-embedplayer-missing_video_stream":"The video file for this stream is missing","mwe-embedplayer-play_clip":"Play clip","mwe-embedplayer-pause_clip":"Pause clip","mwe-embedplayer-volume_control":"Volume control","mwe-embedplayer-player_options":"Player options","mwe-embedplayer-timed_text":"Timed text","mwe-embedplayer-player_fullscreen":"Fullscreen","mwe-embedplayer-next_clip_msg":"Play next clip","mwe-embedplayer-prev_clip_msg":"Play previous clip",
"mwe-embedplayer-current_clip_msg":"Continue playing this clip","mwe-embedplayer-seek_to":"Seek $1","mwe-embedplayer-paused":"paused","mwe-embedplayer-download_segment":"Download selection:","mwe-embedplayer-download_full":"Download full video file:","mwe-embedplayer-download_right_click":"To download, right click and select \u003Ci\u003ESave link as...\u003C/i\u003E","mwe-embedplayer-download_clip":"Download video","mwe-embedplayer-download_text":"Download text","mwe-embedplayer-download":"Download","mwe-embedplayer-share":"Share","mwe-embedplayer-credits":"Credits","mwe-embedplayer-about-library":"About Kaltura player","mwe-embedplayer-about-library-desc":"Kaltura's HTML5 media library enables you to take advantage of the HTML5 \u0026lt;video\u0026gt; and \u0026lt;audio\u0026gt; tags today with a consistent player interface across all major browsers.\n\n[$1 More about the Kaltura player library].","mwe-embedplayer-clip_linkback":"Clip source page","mwe-embedplayer-choose_player":
"Choose video player","mwe-embedplayer-no-player":"No player available for $1","mwe-embedplayer-share_this_video":"Share this video","mwe-embedplayer-video_credits":"Video credits","mwe-embedplayer-no-video_credits":"No credits available","mwe-embedplayer-kaltura-platform-title":"Kaltura open source video platform","mwe-embedplayer-menu_btn":"Menu","mwe-embedplayer-close_btn":"Close","mwe-embedplayer-ogg-player-vlc-player":"VLC player","mwe-embedplayer-ogg-player-oggNative":"HTML5 Ogg player","mwe-embedplayer-ogg-player-mp3Native":"HTML5 MP3 player","mwe-embedplayer-ogg-player-aacNative":"HTML5 AAC player","mwe-embedplayer-ogg-player-h264Native":"HTML5 H.264 player","mwe-embedplayer-ogg-player-webmNative":"HTML5 WebM player","mwe-embedplayer-ogg-player-oggPlugin":"Generic Ogg plugin","mwe-embedplayer-ogg-player-quicktime-mozilla":"QuickTime plugin","mwe-embedplayer-ogg-player-quicktime-activex":"QuickTime ActiveX","mwe-embedplayer-ogg-player-cortado":"Java Cortado",
"mwe-embedplayer-ogg-player-flowplayer":"Flowplayer","mwe-embedplayer-ogg-player-kplayer":"Kaltura player","mwe-embedplayer-ogg-player-selected":"(selected)","mwe-embedplayer-ogg-player-omtkplayer":"OMTK Flash Vorbis","mwe-embedplayer-for_best_experience":"For a better video playback experience we recommend a [$1 HTML5 video browser].","mwe-embedplayer-download-warn":"No compatible in-browser player was detected: for in-browser playback, please download the [$1 latest Firefox]","mwe-embedplayer-fullscreen-tip":"Press \u003Cb\u003EF11\u003C/b\u003E toggle \u003Ci\u003Eweb browser\u003C/i\u003E fullscreen","mwe-embedplayer-fullscreen-tip-osx":"Press \u003Cb\u003Eshift \u2318 F\u003C/b\u003E to toggle fullscreen","mwe-embedplayer-do_not_warn_again":"In the future, do not show this message","mwe-embedplayer-playerSelect":"Players","mwe-embedplayer-read_before_embed":
"\u003Ca href=\"http://mediawiki.org/wiki/Security_Notes_on_Remote_Embedding\" target=\"new\"\u003ERead this\u003C/a\u003E before embedding.","mwe-embedplayer-embed_site_or_blog":"Embed on a page","mwe-embedplayer-embed_wiki":"Embed on a wiki","mwe-embedplayer-related_videos":"Related videos","mwe-embedplayer-seeking":"seeking","mwe-embedplayer-buffering":"buffering","mwe-embedplayer-video-h264":"H.264 video","mwe-embedplayer-video-webm":"WebM video","mwe-embedplayer-video-flv":"Flash video","mwe-embedplayer-video-ogg":"Ogg video","mwe-embedplayer-video-audio":"Ogg audio","mwe-embedplayer-audio-mpeg":"MPEG audio","mwe-embedplayer-video-3gp":"3GP video","mwe-embedplayer-video-mpeg":"MPEG video","mwe-embedplayer-video-msvideo":"AVI video","mwe-embedplayer-missing-source":"No source video was found"});mw.loader.implement("mw.EmbedPlayerNative",function(){(function(mw,$){"use strict";mw.EmbedPlayerNative={instanceOf:'Native',onlyLoadFlag:false,onLoadedCallback:null,prevCurrentTime:-1,
progressEventData:null,mediaLoadedFlag:null,keepPlayerOffScreenFlag:null,isFirstEmbedPlay:null,currentSeekTargetTime:null,nativeEvents:['loadstart','progress','suspend','abort','error','emptied','stalled','play','pause','loadedmetadata','loadeddata','waiting','playing','canplay','canplaythrough','seeking','seeked','timeupdate','ended','ratechange','durationchange','volumechange'],supports:{'playHead':true,'pause':true,'fullscreen':true,'sourceSwitch':true,'timeDisplay':true,'volumeControl':true,'overlays':true},updateFeatureSupport:function(){if(this.useNativePlayerControls()){this.supports.overlays=false;this.supports.volumeControl=false;}if(mw.isIpad()){this.supports.volumeControl=false;}if(this.getPlayerElement()&&this.getSrc()){$(this.getPlayerElement()).attr('src',this.getSrc());}if(this.getPlayerElement()){this.applyMediaElementBindings();}this.parent_updateFeatureSupport();},addPlayScreenWithNativeOffScreen:function(){var _this=this;this.hidePlayerOffScreen();this.
keepPlayerOffScreenFlag=true;this.addLargePlayBtn();this.$interface.find('.play-btn-large').click(function(){_this.$interface.find('.play-btn-large').hide();_this.addPlayerSpinner();_this.hideSpinnerOncePlaying();});var posterSrc=(this.poster)?this.poster:mw.config.get('EmbedPlayer.BlackPixel');if($(this).find('.playerPoster').length){$(this).find('.playerPoster').attr('src',posterSrc);}else{$(this).append($('<img />').css({'margin':'0','width':'100%','height':'100%'}).attr('src',posterSrc).addClass('playerPoster'))}$(this).show();},embedPlayerHTML:function(){var _this=this;var vid=_this.getPlayerElement();this.isFirstEmbedPlay=true;if(this.useLargePlayBtn()){this.addLargePlayBtn();}if(vid&&$(vid).attr('src')==this.getSrc(this.currentTime)){_this.postEmbedActions();return;}mw.log("EmbedPlayerNative::embedPlayerHTML > play url:"+this.getSrc(this.currentTime)+' startOffset: '+this.start_ntp+' end: '+this.end_ntp);if(this.isPersistentNativePlayer()&&vid){_this.postEmbedActions();return;}
_this.bufferStartFlag=false;_this.bufferEndFlag=false;$(this).html(_this.getNativePlayerHtml());_this.postEmbedActions();},getNativePlayerHtml:function(playerAttributes,cssSet){if(!playerAttributes){playerAttributes={};}if(!playerAttributes['id']){playerAttributes['id']=this.pid;}if(!playerAttributes['src']){playerAttributes['src']=this.getSrc(this.currentTime);}if(this.autoplay){playerAttributes['autoplay']='true';}if(!cssSet){cssSet={};}if(!cssSet['width'])cssSet['width']='100%';if(!cssSet['height'])cssSet['height']='100%';if(this.loop){playerAttributes['loop']='true';}var tagName=this.isAudio()?'audio':'video';return $('<'+tagName+' />').addClass('nativeEmbedPlayerPid').attr(playerAttributes).css(cssSet)},postEmbedActions:function(){var _this=this;var vid=this.getPlayerElement();if(!vid){return;}if($(vid).attr('src')!=this.getSrc(this.currentTime)){$(vid).attr('src',this.getSrc(this.currentTime));}if(mw.config.get('EmbedPlayer.WebKitPlaysInline')){$(vid).attr('webkit-playsinline',1)
;}if(mw.config.get('EmbedPlayer.WebKitAllowAirplay')){$(vid).attr('x-webkit-airplay',"allow");}if(this.useNativePlayerControls()){$(vid).attr('controls',"true");}_this.applyMediaElementBindings();if(this.currentTime!=vid.currentTime){var waitReadyStateCount=0;var checkReadyState=function(){if(vid.readyState>0){vid.currentTime=this.currentTime;return;}if(waitReadyStateCount>1000){mw.log("Error: EmbedPlayerNative: could not run native seek");return;}waitReadyStateCount++;setTimeout(function(){checkReadyState();},10);};}if(!_this.loop){vid.load();}},applyMediaElementBindings:function(){var _this=this;mw.log("EmbedPlayerNative::MediaElementBindings");var vid=this.getPlayerElement();if(!vid){mw.log(" Error: applyMediaElementBindings without player elemnet");return;}$.each(_this.nativeEvents,function(inx,eventName){$(vid).unbind(eventName+'.embedPlayerNative').bind(eventName+'.embedPlayerNative',function(){if(_this._propagateEvents){var argArray=$.makeArray(arguments);argArray.push(_this.id)
;if(_this['_on'+eventName]){_this['_on'+eventName].apply(_this,argArray);}else{$(_this).trigger(eventName,argArray);}}});});},monitor:function(){var _this=this;var vid=_this.getPlayerElement();if(vid&&vid.buffered&&vid.buffered.end&&vid.duration){try{this.bufferedPercent=(vid.buffered.end(0)/vid.duration);}catch(e){}}_this.parent_monitor();},seek:function(percent,stopAfterSeek){if(percent<0){percent=0;}if(percent>1){percent=1;}mw.log('EmbedPlayerNative::seek p: '+percent+' : '+this.supportsURLTimeEncoding()+' dur: '+this.getDuration()+' sts:'+this.seekTimeSec);this.triggerHelper('preSeek',percent);this.seeking=true;this.currentTime=(percent*this.duration).toFixed(2);mw.log('EmbedPlayerNative::seek:trigger');this.triggerHelper('seeking');this.controlBuilder.onSeek();if(this.supportsURLTimeEncoding()){if(percent<this.bufferedPercent&&this.playerElement.duration&&!this.didSeekJump){mw.log("EmbedPlayerNative::seek local seek "+percent+' is already buffered < '+this.bufferedPercent);this.
doNativeSeek(percent);}else{this.parent_seek(percent);}}else{this.doNativeSeek(percent);}},doNativeSeek:function(percent,callback){var _this=this;if((navigator.userAgent.indexOf('Chrome')===-1)&&_this.playerElement.seeking){return;}mw.log('EmbedPlayerNative::doNativeSeek::'+percent);this.seeking=true;this.seekTimeSec=0;if(mw.isIOS()){this.hidePlayerOffScreen();}this.setCurrentTime((percent*this.duration),function(){_this.currentTime=_this.getPlayerElement().currentTime;if(_this.seeking){_this.seeking=false;$(_this).trigger('seeked');}_this.restorePlayerOnScreen();_this.monitor();if(callback){callback();}});},doPlayThenSeek:function(percent){mw.log('EmbedPlayerNative::doPlayThenSeek::'+percent+' isPaused '+this.paused);var _this=this;var oldPauseState=this.paused;this.play();var retryCount=0;var readyForSeek=function(){_this.getPlayerElement();if(_this.playerElement&&_this.playerElement.duration){_this.doNativeSeek(percent,function(){if(oldPauseState){_this.pause();}});}else{if(
retryCount<800){setTimeout(readyForSeek,10);retryCount++;}else{mw.log('EmbedPlayerNative:: Error: doPlayThenSeek failed :'+_this.playerElement.duration);}}};readyForSeek();},setCurrentTime:function(seekTime,callback,callbackCount){var _this=this;if(!callbackCount){callbackCount=0;}mw.log("EmbedPlayerNative:: setCurrentTime seekTime:"+seekTime+' count:'+callbackCount);$(this).data('currentSeekTarget',seekTime);var vid=this.getPlayerElement();var callbackHandler=function(){if($.isFunction(callback)){callback();callback=null;}}
if(vid.readyState<1){if(callbackCount>=40){mw.log("Error:: EmbedPlayerNative: with seek request, media never in ready state");callbackHandler();return;}setTimeout(function(){if($(_this).data('currentSeekTarget')!=seekTime){mw.log("EmbedPlayerNative:: expired seek target");return;}_this.setCurrentTime(seekTime,callback,callbackCount+1);},100);return;}if(vid.currentTime.toFixed(2)==seekTime.toFixed(2)){mw.log("EmbedPlayerNative:: setCurrentTime: current time matches seek target: "+vid.currentTime.toFixed(2)+' == '+seekTime.toFixed(2));callbackHandler();return;}var seekBind='seeked.nativeSeekBind';$(vid).unbind(seekBind);$(vid).bind(seekBind,function(event){$(vid).unbind(seekBind);if(seekTime==0&&vid.currentTime==0){callbackHandler();return;}if(vid.currentTime>0){callbackHandler();}else{mw.log("Error:: EmbedPlayerNative: seek callback without time updatet "+vid.currentTime);}});setTimeout(function(){if($(_this).data('currentSeekTarget')!=seekTime){mw.log(
"EmbedPlayerNative:: Expired seek target");return;}if($.isFunction(callback)){if(Math.abs(vid.currentTime-seekTime)<5){mw.log("EmbedPlayerNative:: Seek time is within 5 seconds of target, sucessfull seek");callback();}else{mw.log("Error:: EmbedPlayerNative: Seek still has not made a callback after 5 seconds, retry");_this.setCurrentTime(seekTime,callback,callbackCount++);}}},5000);try{_this.currentSeekTargetTime=seekTime.toFixed(2);vid.currentTime=_this.currentSeekTargetTime;}catch(e){mw.log("Error:: EmbedPlayerNative: Could not set video tag seekTime");callbackHandler();return;}if(!vid.seeking){mw.log("Error:: not entering seek state, play and wait for positive time");vid.play();setTimeout(function(){_this.waitForPositiveCurrentTime(function(){mw.log("EmbedPlayerNative:: Got possitive time:"+vid.currentTime.toFixed(3)+", trying to seek again");_this.setCurrentTime(seekTime,callback,callbackCount+1);});},mw.config.get('EmbedPlayer.MonitorRate'));}},waitForPositiveCurrentTime:function(
callback){var _this=this;var vid=this.getPlayerElement();this.waitForPositiveCurrentTimeCount++;if(vid.currentTime>0){mw.log('EmbedPlayerNative:: waitForPositiveCurrentTime success');callback();}else if(this.waitForPositiveCurrentTimeCount>200){mw.log("Error:: waitForPositiveCurrentTime failed to reach possitve time");callback();}else{setTimeout(function(){_this.waitForPositiveCurrentTime(callback)},50)}},getPlayerElementTime:function(){var _this=this;this.getPlayerElement();if(!this.playerElement){mw.log('EmbedPlayerNative::getPlayerElementTime: '+this.id+' not in dom ( stop monitor)');this.stop();return false;}var ct=this.playerElement.currentTime;if(!ct||isNaN(ct)||ct<0||!isFinite(ct)){return 0;}return this.playerElement.currentTime;},updatePosterSrc:function(src){if(this.getPlayerElement()){$(this.getPlayerElement()).attr('poster',src);}this.parent_updatePosterSrc(src);},emptySources:function(){$(this.getPlayerElement()).attr('src',null);this.parent_emptySources();},
playerSwitchSource:function(source,switchCallback,doneCallback){var _this=this;var src=source.getSrc();var vid=this.getPlayerElement();var switchBindPostfix='.playerSwitchSource';this.isPauseLoading=false;if(!src||src==vid.src){if($.isFunction(switchCallback)){switchCallback(vid);}if($.isFunction(doneCallback)){doneCallback();}return;}mw.log('EmbedPlayerNative:: playerSwitchSource: '+src+' native time: '+vid.currentTime);this.currentTime=0;this.previousTime=0;if(vid){try{$(vid).unbind(switchBindPostfix);vid.pause();var orginalControlsState=vid.controls;vid.removeAttribute('controls');_this.seeking=false;_this.addPlayerSpinner();vid.src=src;vid.load();_this.hidePlayerOffScreen();$(vid).bind('loadedmetadata'+switchBindPostfix,function(){$(vid).unbind('loadedmetadata'+switchBindPostfix);mw.log("EmbedPlayerNative:: playerSwitchSource> loadedmetadata callback for:"+src+' switchCallback: '+switchCallback);if(!mw.isAndroid40()){_this.duration=vid.duration;}if($.isFunction(switchCallback)){vid
.play();}});var handleSwitchCallback=function(){_this.restorePlayerOnScreen();_this.hideSpinnerAndPlayBtn();vid.controls=orginalControlsState;if($.isFunction(switchCallback)){switchCallback(vid);switchCallback=null;}}
$(vid).bind('playing'+switchBindPostfix,function(){$(vid).unbind('playing'+switchBindPostfix);mw.log("EmbedPlayerNative:: playerSwitchSource> playing callback");handleSwitchCallback();});if($.isFunction(doneCallback)){$(vid).bind('ended'+switchBindPostfix,function(event){$(vid).unbind(switchBindPostfix);doneCallback();return false;});}vid.play();setTimeout(function(){if(vid.readyState===0&&$.isFunction(switchCallback)){mw.log("EmbedPlayerNative:: possible iOS play without gesture failed, issue callback");handleSwitchCallback();_this.pause();if(!_this.useLargePlayBtn()){_this.addLargePlayBtn();}}},5000);}catch(e){mw.log("Error: EmbedPlayerNative Error in switching source playback");}}},hidePlayerOffScreen:function(vid){var vid=this.getPlayerElement();$(vid).css({'position':'absolute','left':'-4048px'});},restorePlayerOnScreen:function(vid){var vid=this.getPlayerElement();if(this.keepPlayerOffScreenFlag){return;}$(this).find('.playerPoster').remove();$(vid).css({'left':'0px'});},pause:
function(){this.getPlayerElement();this.parent_pause();if(this.playerElement){this.playerElement.pause();}},play:function(){var _this=this;if(this.isStopped()&&this._playContorls){this.restorePlayerOnScreen();}if(_this.parent_play()){if(this.getPlayerElement()&&this.getPlayerElement().play){mw.log("EmbedPlayerNative:: issue native play call");if(this.isPauseLoading){this.hideSpinnerOncePlaying();}this.getPlayerElement().play();this.monitor();}}else{mw.log("EmbedPlayerNative:: parent play returned false, don't issue play on native element");}},stop:function(){var _this=this;if(this.playerElement&&this.playerElement.currentTime){this.playerElement.currentTime=0;this.playerElement.pause();}this.parent_stop();},toggleMute:function(){this.parent_toggleMute();this.getPlayerElement();if(this.playerElement)this.playerElement.muted=this.muted;},setPlayerElementVolume:function(percent){if(this.getPlayerElement()){if(percent!=0){this.playerElement.muted=false;}this.playerElement.volume=percent;}}
,getPlayerElementVolume:function(){if(this.getPlayerElement()){return this.playerElement.volume;}},getPlayerElementMuted:function(){if(this.getPlayerElement()){return this.playerElement.muted;}},getNativeDuration:function(){if(this.playerElement){return this.playerElement.duration;}},load:function(callback){this.getPlayerElement();if(!this.playerElement){mw.log('EmbedPlayerNative::load() ... doEmbed');this.onlyLoadFlag=true;this.embedPlayerHTML();this.onLoadedCallback=callback;}else{this.playerElement.load();if(callback){callback();}}},getPlayerElement:function(){this.playerElement=$('#'+this.pid).get(0);return this.playerElement;},_onseeking:function(){mw.log("EmbedPlayerNative::onSeeking "+this.seeking+' new time: '+this.getPlayerElement().currentTime);if(this.seeking&&Math.round(this.getPlayerElement().currentTime-this.currentSeekTargetTime)>2){mw.log("Error:: EmbedPlayerNative Seek time missmatch: target:"+this.getPlayerElement().currentTime+' actual '+this.currentSeekTargetTime+
', note apple HLS can only seek to 10 second targets');}if(!this.seeking){this.currentSeekTargetTime=this.getPlayerElement().currentTime;this.seeking=true;this.controlBuilder.onSeek();mw.log("EmbedPlayerNative::seeking:trigger:: "+this.seeking);if(this._propagateEvents){this.triggerHelper('seeking');}}},_onseeked:function(){mw.log("EmbedPlayerNative::onSeeked "+this.seeking+' ct:'+this.playerElement.currentTime);this.previousTime=this.currentTime=this.playerElement.currentTime;if(this.seeking){if(Math.abs(this.currentSeekTargetTime-this.getPlayerElement().currentTime)>2){mw.log("Error:: EmbedPlayerNative:seeked triggred with time mismatch: target:"+this.currentSeekTargetTime+' actual:'+this.getPlayerElement().currentTime);return;}this.seeking=false;if(this._propagateEvents){mw.log("EmbedPlayerNative:: trigger: seeked");this.triggerHelper('seeked');}}this.hideSpinner();if(this.isStopped()){this.addLargePlayBtn();}this.monitor();},_onpause:function(){var _this=this;var timeSincePlay=Math
.abs(this.absoluteStartPlayTime-new Date().getTime());mw.log("EmbedPlayerNative:: OnPaused:: propagate:"+this._propagateEvents+' time since play: '+timeSincePlay+' isNative=true');if(timeSincePlay>mw.config.get('EmbedPlayer.MonitorRate')){_this.parent_pause();}else{this.getPlayerElement().play();}},_onplay:function(){mw.log("EmbedPlayerNative:: OnPlay:: propogate:"+this._propagateEvents+' paused: '+this.paused);if(this.useNativePlayerControls()){this.$interface.css('pointer-events','none');}if(!this.isFirstEmbedPlay&&this._propagateEvents&&this.paused){this.parent_play();}else{this.playInterfaceUpdate();}this.isFirstEmbedPlay=false;},_onloadedmetadata:function(){this.getPlayerElement();if(this.playerElement&&!isNaN(this.playerElement.duration)&&isFinite(this.playerElement.duration)){mw.log('EmbedPlayerNative :onloadedmetadata metadata ready Update duration:'+this.playerElement.duration+' old dur: '+this.getDuration());if(!mw.isAndroid40()){this.duration=this.playerElement.duration;}}if
(!this.paused&&this._propagateEvents){this.getPlayerElement().play();}if(typeof this.onLoadedCallback=='function'){this.onLoadedCallback();}if(!this.mediaLoadedFlag){$(this).trigger('mediaLoaded');this.mediaLoadedFlag=true;}},_onended:function(event){var _this=this;if(this.getPlayerElement()){mw.log('EmbedPlayer:native: onended:'+this.playerElement.currentTime+' real dur:'+this.getDuration()+' ended '+this._propagateEvents);if(this._propagateEvents){this.onClipDone();}}},onClipDone:function(){var _this=this;$(this).unbind('onEndedDone.onClipDone').bind('onEndedDone.onClipDone',function(){_this.addPlayScreenWithNativeOffScreen();if(!_this.isImagePlayScreen()){_this.keepPlayerOffScreenFlag=false;}});this.parent_onClipDone();}};})(mediaWiki,jQuery);;},{},{});mw.loader.implement("mw.EmbedTypes",function(){(function(mw,$){"use strict";var kplayer=new mw.MediaPlayer('kplayer',['video/x-flv','video/h264','video/mp4; codecs="avc1.42E01E"','video/mp4; codecs="avc1.42E01E, mp4a.40.2"',
'audio/mpeg'],'Kplayer');var cortadoPlayer=new mw.MediaPlayer('cortado',['video/ogg','video/ogg; codecs="theora"','video/ogg; codecs="theora,vorbis"','audio/ogg','audio/ogg; codecs="vorbis"','application/ogg'],'Java');var oggNativePlayer=new mw.MediaPlayer('oggNative',['video/ogg','video/ogg; codecs="theora"','video/ogg; codecs="theora, vorbis"','audio/ogg','audio/ogg; codecs="vorbis"','application/ogg'],'Native');var h264NativePlayer=new mw.MediaPlayer('h264Native',['video/h264','video/mp4; codecs="avc1.42E01E, mp4a.40.2"'],'Native');var appleVdnPlayer=new mw.MediaPlayer('appleVdn',['application/vnd.apple.mpegurl','application/vnd.apple.mpegurl; codecs="avc1.42E01E"'],'Native');var mp3NativePlayer=new mw.MediaPlayer('mp3Native',['audio/mpeg','audio/mp3'],'Native');var aacNativePlayer=new mw.MediaPlayer('aacNative',['audio/mp4','audio/mp4; codecs="mp4a.40.5"'],'Native');var webmNativePlayer=new mw.MediaPlayer('webmNative',['video/webm','video/webm; codecs="vp8"',
'video/webm; codecs="vp8, vorbis"'],'Native');var imageOverlayPlayer=new mw.MediaPlayer('imageOverlay',['image/jpeg','image/png'],'ImageOverlay');mw.EmbedTypes={mediaPlayers:null,detect_done:false,init:function(){this.detect();this.detect_done=true;},getMediaPlayers:function(){if(this.mediaPlayers){return this.mediaPlayers;}this.mediaPlayers=new mw.MediaPlayers();this.detectPlayers();return this.mediaPlayers;},supportedMimeType:function(mimeType){for(var i=0;i<navigator.plugins.length;i++){var plugin=navigator.plugins[i];if(typeof plugin[mimeType]!="undefined"){return true;}}return false;},addFlashPlayer:function(){if(!mw.config.get('EmbedPlayer.DisableHTML5FlashFallback')){this.mediaPlayers.addPlayer(kplayer);}},addJavaPlayer:function(){if(!mw.config.get('EmbedPlayer.DisableJava')){mw.log("EmbedTypes::addJavaPlayer: adding cortadoPlayer");this.mediaPlayers.addPlayer(cortadoPlayer);}},detectPlayers:function(){mw.log("EmbedTypes::detectPlayers running detect");this.mediaPlayers.
addPlayer(imageOverlayPlayer);try{var javaEnabled=navigator.javaEnabled();}catch(e){}var uniqueMimesOnly=$.browser.opera||$.browser.safari;if(javaEnabled&&(navigator.appName=='Opera')){this.addJavaPlayer();}if(mw.supportsFlash()){this.addFlashPlayer();}if($.browser.msie){if(this.testActiveX('JavaWebStart.isInstalled')){this.addJavaPlayer();}}if(!mw.config.get('EmbedPlayer.DisableVideoTagSupport')&&(typeof HTMLVideoElement=='object'||typeof HTMLVideoElement=='function')){try{var dummyvid=document.createElement("video");if(dummyvid.canPlayType){if(dummyvid.canPlayType('video/webm; codecs="vp8, vorbis"')){this.mediaPlayers.addPlayer(webmNativePlayer);}if(this.supportedMimeType('audio/mpeg')){this.mediaPlayers.addPlayer(mp3NativePlayer);}if(dummyvid.canPlayType('audio/mp4; codecs="mp4a.40.5"')){this.mediaPlayers.addPlayer(aacNativePlayer);}if(dummyvid.canPlayType('video/mp4; codecs="avc1.42E01E, mp4a.40.2"')){this.mediaPlayers.addPlayer(h264NativePlayer);if(mw.isIOS()||dummyvid.canPlayType
('application/vnd.apple.mpegurl; codecs="avc1.42E01E"')){if(navigator.userAgent.indexOf('Android 3.')==-1){this.mediaPlayers.addPlayer(appleVdnPlayer);}}}if(mw.isAndroid2()){this.mediaPlayers.addPlayer(h264NativePlayer);}if(dummyvid.canPlayType('video/ogg; codecs="theora,vorbis"')){this.mediaPlayers.addPlayer(oggNativePlayer);}else if(this.supportedMimeType('video/ogg')){this.mediaPlayers.addPlayer(oggNativePlayer);}}}catch(e){mw.log('could not run canPlayType '+e);}}if(navigator.mimeTypes&&navigator.mimeTypes.length>0){for(var i=0;i<navigator.mimeTypes.length;i++){var type=navigator.mimeTypes[i].type;var semicolonPos=type.indexOf(';');if(semicolonPos>-1){type=type.substr(0,semicolonPos);}var pluginName=navigator.mimeTypes[i].enabledPlugin?navigator.mimeTypes[i].enabledPlugin.name:'';if(!pluginName){pluginName='';}if(type=='application/x-java-applet'){this.addJavaPlayer();continue;}if((type=='video/mpeg'||type=='video/x-msvideo')){}if(type=='application/ogg'){continue;}else if(
uniqueMimesOnly){if(type=='application/x-vlc-player'){continue;}else if(type=='video/quicktime'){continue;}}}}mw.log("EmbedPlayer::trigger:embedPlayerUpdateMediaPlayersEvent");$(mw).trigger('embedPlayerUpdateMediaPlayersEvent',this.mediaPlayers);},testActiveX:function(name){mw.log("EmbedPlayer::detect: test testActiveX: "+name);var hasObj=true;try{var obj=new ActiveXObject(''+name);}catch(e){hasObj=false;}return hasObj;}};})(mediaWiki,jQuery);;},{},{});mw.loader.implement("mw.MediaElement",function(){(function(mw,$){"use strict";mw.MediaElement=function(element){this.init(element);};mw.MediaElement.prototype={sources:null,addedROEData:false,selectedSource:null,init:function(videoElement){var _this=this;mw.log("EmbedPlayer::mediaElement:init:"+videoElement.id);this.parentEmbedId=videoElement.id;this.sources=new Array();if(videoElement){if($(videoElement).attr("src")){_this.tryAddSource(videoElement);}$(videoElement).find('source,track').each(function(){_this.tryAddSource(this);});}},
updateSourceTimes:function(startNpt,endNpt){var _this=this;$.each(this.sources,function(inx,mediaSource){mediaSource.updateSrcTime(startNpt,endNpt);});},getTextTracks:function(){var textTracks=[];$.each(this.sources,function(inx,source){if(source.nodeName=='track'||(source.mimeType&&source.mimeType.indexOf('text/')!==-1)){textTracks.push(source);}});return textTracks;},getSources:function(mimeFilter){if(!mimeFilter){return this.sources;}var source_set=new Array();for(var i=0;i<this.sources.length;i++){if(this.sources[i].mimeType&&this.sources[i].mimeType.indexOf(mimeFilter)!=-1){source_set.push(this.sources[i]);}}return source_set;},getSourceById:function(sourceId){for(var i=0;i<this.sources.length;i++){if(this.sources[i].id==sourceId){return this.sources[i];}}return null;},setSourceByIndex:function(index){mw.log('EmbedPlayer::mediaElement:selectSource: '+index);var oldSrc=this.selectedSource.getSrc();var playableSources=this.getPlayableSources();for(var i=0;i<playableSources.length;i++
){if(i==index){this.selectedSource=playableSources[i];break;}}if(oldSrc!=this.selectedSource.getSrc()){$('#'+this.parentEmbedId).trigger('SourceChange');}},setSource:function(source){var oldSrc=this.selectedSource.getSrc();this.selectedSource=source;if(oldSrc!=this.selectedSource.getSrc()){$('#'+this.parentEmbedId).trigger('SourceChange');}},autoSelectSource:function(){mw.log('EmbedPlayer::mediaElement::autoSelectSource');var _this=this;var playableSources=this.getPlayableSources();var flash_flag=false,ogg_flag=false;if(playableSources.length==0){return false;}var setSelectedSource=function(source){_this.selectedSource=source;return _this.selectedSource;};$(this).trigger('onSelectSource',playableSources);if(_this.selectedSource){mw.log('MediaElement::autoSelectSource: Set via trigger::'+_this.selectedSource.getTitle());return _this.selectedSource;}$.each(playableSources,function(inx,source){if(source.markedDefault){mw.log('MediaElement::autoSelectSource: Set via marked default: '+
source.markedDefault);return setSelectedSource(source);;}});var vndSources=this.getPlayableSources('application/vnd.apple.mpegurl')
if(vndSources.length&&mw.EmbedTypes.getMediaPlayers().getMIMETypePlayers('application/vnd.apple.mpegurl').length){var desktopVdn,mobileVdn;$.each(vndSources,function(inx,source){if(source.getFlavorId()&&source.getFlavorId().toLowerCase()=='iphonenew'){mobileVdn=source;}else{desktopVdn=source;}})
if(mw.isIphone()&&mobileVdn){setSelectedSource(mobileVdn);}else if(desktopVdn){setSelectedSource(desktopVdn);}}if(this.selectedSource){mw.log('MediaElement::autoSelectSource: Set via Adaptive HLS: source flavor id:'+_this.selectedSource.getFlavorId()+' src: '+_this.selectedSource.getSrc());return this.selectedSource;}if($.cookie('EmbedPlayer.UserBandwidth')){var bandwidthDelta=999999999;var bandwidthTarget=$.cookie('EmbedPlayer.UserBandwidth');$.each(playableSources,function(inx,source){if(source.bandwidth){var player=mw.EmbedTypes.getMediaPlayers().defaultPlayer(source.mimeType);if(!player||player.library!='Native'){return true;}if(Math.abs(source.bandwidth-bandwidthTarget)<bandwidthDelta){bandwidthDelta=Math.abs(source.bandwidth-bandwidthTarget);setSelectedSource(source);}}});}if(this.selectedSource){mw.log('MediaElement::autoSelectSource: Set via bandwidth prefrence: source '+this.selectedSource.bandwidth+' user: '+$.cookie('EmbedPlayer.UserBandwidth'));return this.selectedSource;}
var nativePlayableSources=[];$.each(playableSources,function(inx,source){var mimeType=source.mimeType;var player=mw.EmbedTypes.getMediaPlayers().defaultPlayer(mimeType);if(player&&player.library=='Native'){nativePlayableSources.push(source);}});var namedSourceSet={};$.each(playableSources,function(inx,source){var mimeType=source.mimeType;var player=mw.EmbedTypes.getMediaPlayers().defaultPlayer(mimeType);if(player&&player.library=='Native'){switch(player.id){case'mp3Native':var shortName='mp3';break;case'aacNative':var shortName='aac';break;case'oggNative':var shortName='ogg';break;case'webmNative':var shortName='webm';break;case'h264Native':var shortName='h264';break;case'appleVdn':var shortName='appleVdn';break;}if(!namedSourceSet[shortName]){namedSourceSet[shortName]=[];}namedSourceSet[shortName].push(source);}});var codecPref=mw.config.get('EmbedPlayer.CodecPreference');if(mw.isAndroid40()){if(codecPref&&codecPref[0]=='webm'){codecPref[0]='h264';codecPref[1]='webm';}}if(codecPref){
for(var i=0;i<codecPref.length;i++){var codec=codecPref[i];if(!namedSourceSet[codec]){continue;}if(namedSourceSet[codec].length==1){mw.log('MediaElement::autoSelectSource: Set 1 source via EmbedPlayer.CodecPreference: '+namedSourceSet[codec][0].getTitle());return setSelectedSource(namedSourceSet[codec][0]);}else if(namedSourceSet[codec].length>1){var minSizeDelta=null;if(this.parentEmbedId){var displayWidth=$('#'+this.parentEmbedId).width();$.each(namedSourceSet[codec],function(inx,source){if(source.width&&displayWidth){var sizeDelta=Math.abs(source.width-displayWidth);mw.log('MediaElement::autoSelectSource: size delta : '+sizeDelta+' for s:'+source.width);if(minSizeDelta==null||sizeDelta<minSizeDelta){minSizeDelta=sizeDelta;setSelectedSource(source);}}});}if(this.selectedSource){mw.log('MediaElement::autoSelectSource: from  '+this.selectedSource.mimeType+' because of resolution:'+this.selectedSource.width+' close to: '+displayWidth);return this.selectedSource;}if(namedSourceSet[codec]
[0]){return setSelectedSource(namedSourceSet[codec][0]);}}};}$.each(playableSources,function(inx,source){var mimeType=source.mimeType;var player=mw.EmbedTypes.getMediaPlayers().defaultPlayer(mimeType);if(mimeType=='video/h264'&&player&&(player.library=='Native'||player.library=='Kplayer')){if(source){mw.log('MediaElement::autoSelectSource: Set h264 via native or flash fallback:'+source.getTitle());return setSelectedSource(source);}}});if(!this.selectedSource&&playableSources[0]){mw.log('MediaElement::autoSelectSource: Set via first source: '+playableSources[0].getTitle()+' mime: '+playableSources[0].getMIMEType());return setSelectedSource(playableSources[0]);}return false;},isOgg:function(mimeType){if(mimeType=='video/ogg'||mimeType=='ogg/video'||mimeType=='video/annodex'||mimeType=='application/ogg'){return true;}return false;},getPosterSrc:function(){return this.poster;},hasStreamOfMIMEType:function(mimeType){for(var i=0;i<this.sources.length;i++){if(this.sources[i].getMIMEType()==
mimeType){return true;}}return false;},isPlayableType:function(mimeType){if(mw.EmbedTypes.getMediaPlayers().defaultPlayer(mimeType)){mw.log("isPlayableType:: "+mimeType);return true;}else{return false;}},tryAddSource:function(element){var newSrc=$(element).attr('src');if(newSrc){for(var i=0;i<this.sources.length;i++){if(this.sources[i].src==newSrc){this.sources[i].updateSource(element);return this.sources[i];}}}var source=new mw.MediaSource(element);this.sources.push(source);return source;},getPlayableSources:function(mimeFilter){var playableSources=[];for(var i=0;i<this.sources.length;i++){if(this.isPlayableType(this.sources[i].mimeType)&&(!mimeFilter||this.sources[i].mimeType.indexOf(mimeFilter)!=-1)){playableSources.push(this.sources[i]);}};mw.log("MediaElement::GetPlayableSources mimeFilter:"+mimeFilter+" "+playableSources.length+' sources playable out of '+this.sources.length);return playableSources;}};})(mediaWiki,jQuery);;},{},{});mw.loader.implement("mw.MediaPlayer",function(){
(function(mw,$){"use strict";mw.MediaPlayer=function(id,supportedTypes,library){this.id=id;this.supportedTypes=supportedTypes;this.library=library;this.loaded=false;this.loading_callbacks=new Array();return this;};mw.MediaPlayer.prototype={id:null,supportedTypes:null,library:null,loaded:false,supportsMIMEType:function(type){for(var i=0;i<this.supportedTypes.length;i++){if(this.supportedTypes[i]==type)return true;}return false;},getName:function(){return mw.msg('mwe-embedplayer-ogg-player-'+this.id);},load:function(callback){mw.load(['mw.EmbedPlayer'+this.library.substr(0,1).toUpperCase()+this.library.substr(1)],function(){if(callback){callback();}});}};})(mediaWiki,jQuery);;},{},{});mw.loader.implement("mw.MediaPlayers",function(){(function(mw,$){"use strict";mw.MediaPlayers=function(){this.init();};mw.MediaPlayers.prototype={players:null,preference:{},defaultPlayers:{},init:function(){this.players=new Array();this.loadPreferences();this.defaultPlayers['video/x-flv']=['Kplayer','Vlc'];
this.defaultPlayers['video/h264']=['Native','Kplayer','Vlc'];this.defaultPlayers['application/vnd.apple.mpegurl']=['Native'];this.defaultPlayers['video/ogg']=['Native','Vlc','Java','Generic'];this.defaultPlayers['video/webm']=['Native','Vlc'];this.defaultPlayers['application/ogg']=['Native','Vlc','Java','Generic'];this.defaultPlayers['audio/ogg']=['Native','Vlc','Java'];this.defaultPlayers['audio/mpeg']=['Native','Kplayer'];this.defaultPlayers['audio/mp3']=['Native','Kplayer'];this.defaultPlayers['audio/mp4']=['Native'];this.defaultPlayers['video/mp4']=['Native','Vlc'];this.defaultPlayers['video/mpeg']=['Vlc'];this.defaultPlayers['video/x-msvideo']=['Vlc'];this.defaultPlayers['image/jpeg']=['ImageOverlay'];this.defaultPlayers['image/png']=['ImageOverlay'];},addPlayer:function(player){for(var i=0;i<this.players.length;i++){if(this.players[i].id==player.id){return;}}this.players.push(player);},isSupportedPlayer:function(playerId){for(var i=0;i<this.players.length;i++){if(this.players[i].
id==playerId){return true;}}return false;},getMIMETypePlayers:function(mimeType){var mimePlayers=new Array();var _this=this;var baseMimeType=mimeType.split(';')[0];if(this.defaultPlayers[baseMimeType]){$.each(this.defaultPlayers[baseMimeType],function(d,lib){var library=_this.defaultPlayers[baseMimeType][d];for(var i=0;i<_this.players.length;i++){if(_this.players[i].library==library&&_this.players[i].supportsMIMEType(mimeType)){mimePlayers.push(_this.players[i]);}}});}return mimePlayers;},defaultPlayer:function(mimeType){var mimePlayers=this.getMIMETypePlayers(mimeType);if(mimePlayers.length>0){for(var i=0;i<mimePlayers.length;i++){if(mimePlayers[i].librayr=='Native'){return mimePlayers[i];}if(mimePlayers[i].id==this.preference[mimeType]){return mimePlayers[i];}}return mimePlayers[0];}return null;},setFormatPreference:function(mimeFormat){this.preference['formatPreference']=mimeFormat;$.cookie('EmbedPlayer.Preference',JSON.stringify(this.preference));},loadPreferences:function(){this.
preference={};if($.cookie('EmbedPlayer.Preference')){this.preference=JSON.parse($.cookie('EmbedPlayer.Preference'));}},setPlayerPreference:function(playerId,mimeType){var selectedPlayer=null;for(var i=0;i<this.players.length;i++){if(this.players[i].id==playerId){selectedPlayer=this.players[i];mw.log('EmbedPlayer::setPlayerPreference: choosing '+playerId+' for '+mimeType);this.preference[mimeType]=playerId;$.cookie('EmbedPlayer.Preference',JSON.stringify(this.preference));break;}}if(selectedPlayer){$('.mwEmbedPlayer').each(function(inx,playerTarget){var embedPlayer=$(playerTarget).get(0);if(embedPlayer.mediaElement.selectedSource&&(embedPlayer.mediaElement.selectedSource.mimeType==mimeType)){embedPlayer.selectPlayer(selectedPlayer);}});}}};})(mediaWiki,jQuery);;},{},{});mw.loader.implement("mw.MediaSource",function(){(function(mw,$){"use strict";mw.mergeConfig('EmbedPlayer.SourceAttributes',['id','src','title','URLTimeEncoding','nodeName','data-startoffset','data-durationhint',
'data-shorttitle','data-width','data-height','data-bandwidth','data-sizebytes','data-framerate','data-flavorid','data-aspect','data-title','data-mwtitle','data-mwprovider','data-disablecontrols','data-dir','start','end','default']);mw.MediaSource=function(element){this.init(element);};mw.MediaSource.prototype={mimeType:null,uri:null,title:null,markedDefault:false,URLTimeEncoding:false,startOffset:0,duration:0,id:null,startNpt:null,endNpt:null,srclang:null,init:function(element){var _this=this;this.src=$(element).attr('src');var pUrl=new mw.Uri(this.src);if(typeof pUrl.query['t']!='undefined'){this.URLTimeEncoding=true;}var sourceAttr=mw.config.get('EmbedPlayer.SourceAttributes');$.each(sourceAttr,function(inx,attr){if($(element).attr(attr)){var attrName=(attr.indexOf('data-')===0)?attr.substr(5):attr
_this[attrName]=$(element).attr(attr);}});if(this.label){this.title=this.label;}if($(element).attr('type')){this.mimeType=$(element).attr('type');}else if($(element).attr('content-type')){this.mimeType=$(element).attr('content-type');}else if($(element)[0].tagName.toLowerCase()=='audio'){this.mimeType='audio/ogg';}else{this.mimeType=this.detectType(this.src);}if(this.mimeType=='video/theora'){this.mimeType='video/ogg';}if(this.mimeType=='audio/vorbis'){this.mimeType='audio/ogg';}if($(element).parent().attr('category')){this.category=$(element).parent().attr('category');}if($(element).attr('default')){this.markedDefault=true;}this.getURLDuration();},updateSource:function(element){if($(element).attr("title")){this.title=$(element).attr("title");}},updateSrcTime:function(startNpt,endNpt){if(this.URLTimeEncoding){if(!mw.npt2seconds(startNpt)){startNpt=this.startNpt;}if(!mw.npt2seconds(endNpt)){endNpt=this.endNpt;}this.src=mw.replaceUrlParams(this.src,{'t':startNpt+'/'+endNpt});this.
getURLDuration();}},setDuration:function(duration){this.duration=duration;if(!this.endNpt){this.endNpt=mw.seconds2npt(this.startOffset+duration);}},getMIMEType:function(){if(this.mimeType){return this.mimeType;}this.mimeType=this.detectType(this.src);return this.mimeType;},setSrc:function(src){this.src=src;},getSrc:function(serverSeekTime){if(!serverSeekTime||!this.URLTimeEncoding){return this.src;}var endvar='';if(this.endNpt){endvar='/'+this.endNpt;}return mw.replaceUrlParams(this.src,{'t':mw.seconds2npt(serverSeekTime)+endvar});},getTitle:function(){if(this.title){return this.title;}if(this.label){return this.label;}var mimeType=this.getMIMEType().split(';')[0];switch(mimeType){case'video/h264':case'video/mp4':return mw.msg('mwe-embedplayer-video-h264');break;case'video/x-flv':return mw.msg('mwe-embedplayer-video-flv');break;case'video/webm':return mw.msg('mwe-embedplayer-video-webm');break;case'video/ogg':return mw.msg('mwe-embedplayer-video-ogg');break;case'audio/ogg':return mw.
msg('mwe-embedplayer-video-audio');break;case'audio/mpeg':return mw.msg('mwe-embedplayer-audio-mpeg');break;case'video/3gp':return mw.msg('mwe-embedplayer-video-3gp');break;case'video/mpeg':return mw.msg('mwe-embedplayer-video-mpeg');break;case'video/x-msvideo':return mw.msg('mwe-embedplayer-video-msvideo');break;}try{var fileName=new mw.Uri(mw.absoluteUrl(this.getSrc())).path.split('/').pop();if(fileName){return fileName;}}catch(e){}return this.mimeType;},getShortTitle:function(){var _this=this;if(this.shorttitle){return this.shorttitle;}var longTitle=this.getTitle();if(longTitle.length>20){longTitle=longTitle.substring(0,17)+"...";}return longTitle},getURLDuration:function(){if(this.URLTimeEncoding){var annoURL=new mw.Uri(this.src);if(annoURL.query.t){var times=annoURL.query.t.split('/');this.startNpt=times[0];this.endNpt=times[1];this.startOffset=mw.npt2seconds(this.startNpt);this.duration=mw.npt2seconds(this.endNpt)-this.startOffset;}else{if(this.startOffset){this.startNpt=mw.
seconds2npt(this.startOffset);}if(this.duration){this.endNpt=mw.seconds2npt(parseInt(this.duration)+parseInt(this.startOffset));}}}},getExt:function(uri){var urlParts=new mw.Uri(uri);var ext=(urlParts.file)?/[^.]+$/.exec(urlParts.file):/[^.]+$/.exec(uri);ext=/[^#]*/g.exec(ext.toString());ext=ext||'';return ext.toString().toLowerCase();},getFlavorId:function(){if(this.flavorid){return this.flavorid;}return;},detectType:function(uri){switch(this.getExt(uri)){case'smil':case'sml':return'application/smil';break;case'm4v':case'mp4':return'video/h264';break;case'm3u8':return'application/vnd.apple.mpegurl';break;case'webm':return'video/webm';break;case'3gp':return'video/3gp';break;case'srt':return'text/x-srt';break;case'flv':return'video/x-flv';break;case'ogg':case'ogv':return'video/ogg';break;case'oga':return'audio/ogg';break;case'mp3':return'audio/mpeg';case'm4a':return'audio/mp4';break;case'anx':return'video/ogg';break;case'xml':return'text/xml';break;case'avi':return'video/x-msvideo';
break;case'mpg':return'video/mpeg';break;case'mpeg':return'video/mpeg';break;}mw.log("Error: could not detect type of media src: "+uri);},getBitrate:function(){if(this.bandwidth){return this.bandwidth/1024;}return 0;},getSize:function(){if(this.sizebytes){return this.sizebytes;}return 0;}};})(mediaWiki,jQuery);;},{},{});mw.loader.implement("mw.MediaWikiPlayerSupport",function(){(function(mw,$){mw.mergeConfig('EmbedPlayer.Attributes',{"data-mwtitle":null,"data-mwprovider":null});$(mw).bind('EmbedPlayerNewPlayer',function(event,embedPlayer){mw.addMediaWikiPlayerSupport(embedPlayer);});mw.addMediaWikiPlayerSupport=function(embedPlayer){if(!embedPlayer['data-mwtitle']){return false;}else{var apiTitleKey=embedPlayer['data-mwtitle'];embedPlayer.apiTitleKey=apiTitleKey;}var apiProvider=embedPlayer['data-mwprovider'];if(!apiProvider){apiProvider=mw.config.get('EmbedPlayer.ApiProvider');}function loadPlayerSources(callback){var request={'prop':'imageinfo','titles':'File:'+unescape(apiTitleKey).
replace(/^(File:|Image:)/,''),'iiprop':'url|size|dimensions|metadata','iiurlwidth':embedPlayer.getWidth(),'redirects':true};mw.getJSON(mw.getApiProviderURL(apiProvider),request,function(data){if(data.query.pages){for(var i in data.query.pages){if(i=='-1'){callback(false);return;}var page=data.query.pages[i];}}else{callback(false);return;}if(!page.imageinfo||!page.imageinfo[0]){callback(false);return;}var imageinfo=page.imageinfo[0];embedPlayer.poster=imageinfo.thumburl;embedPlayer.mediaElement.tryAddSource($('<source />').attr('src',imageinfo.url).get(0));if(imageinfo.metadata[2]['name']=='length'){embedPlayer.duration=imageinfo.metadata[2]['value'];}if(imageinfo.height!=0&&imageinfo.width!=0){embedPlayer.height=parseInt(embedPlayer.width*(imageinfo.height/imageinfo.width));}$(embedPlayer).css('height',embedPlayer.height);callback();});}function doCreditLine(resourceHTML,articleUrl){var titleStr=embedPlayer.apiTitleKey.replace(/_/g,' ');var $creditLine=$('<div />');$creditLine.append($
('<span>').html(mw.msg('mwe-embedplayer-credit-title',$('<div>').append($('<a/>').attr({'href':articleUrl,'title':titleStr}).text(titleStr))[0].innerHTML)));var $page=$(resourceHTML);var $author=$page.find('#fileinfotpl_aut');if($author.length){$authorText=$author.next()
$authorText.find('br').remove();var $links=$authorText.find('a');if($links.length){$links.each(function(i,authorLink){var $authorLink=$(authorLink);var authUrl=$authorLink.attr('href');authUrl=mw.absoluteUrl(authUrl,articleUrl);$authorLink.attr('href',authUrl);});}$creditLine.append($('<br />'),mw.msg('mwe-embedplayer-credit-author',$authorText.html()))}var $date=$page.find('#fileinfotpl_date');if($date.length){$date=$date.next();$date.find('br').remove();$creditLine.append($('<br />'),mw.msg('mwe-embedplayer-credit-date',$date.html()))}var imgSize={};if(embedPlayer.isAudio()){imgSize.height=imgSize.width=(embedPlayer.controlBuilder.getOverlayWidth()<250)?45:80;}else{imgSize.width=(embedPlayer.controlBuilder.getOverlayWidth()<250)?45:120;imgSize.height=parseInt(imgSize.width*(embedPlayer.getHeight()/embedPlayer.getWidth()));}return $('<div/>').addClass('creditline').append($('<a/>').attr({'href':articleUrl,'title':titleStr}).html($('<img/>').attr({'border':0,'src':embedPlayer.poster}).
css(imgSize))).append($creditLine);};var $creditsCache=false;function showCredits($target,callback){if($creditsCache){$target.html($creditsCache);callback(true);return;}var apiUrl=mw.getApiProviderURL(apiProvider);var fileTitle='File:'+unescape(apiTitleKey).replace(/^File:|^Image:/,'');var request={'action':'parse','page':fileTitle,'smaxage':3600,'maxage':3600};var articleUrl='';mw.getJSON(apiUrl,request,function(data){descUrl=apiUrl.replace('api.php','index.php');descUrl+='?title='+encodeURIComponent(fileTitle);if(data&&data.parse&&data.parse.text&&data.parse.text['*']){$creditsCache=doCreditLine(data.parse.text['*'],descUrl);}else{$creditsCache=doCreditLine(false,descUrl);}$target.html($creditsCache);callback(true);});};$(embedPlayer).bind('showCredits',function(event,$target,callback){if($target.data('playerId')!=embedPlayer.id){return;}showCredits($target,callback);});$(embedPlayer).bind('onEndedDone',function(event,id){if(embedPlayer.id!=id){return;}if(embedPlayer.isAudio()){
embedPlayer.setCurrentTime(0);return;}var cb=embedPlayer.controlBuilder;cb.checkMenuOverlay();cb.showMenuOverlay();cb.showMenuItem('credits');});$(embedPlayer).bind('showInlineDownloadLink',function(){if(embedPlayer.controlBuilder.checkNativeWarning()){embedPlayer.controlBuilder.addWarningBinding('EmbedPlayer.ShowNativeWarning',mw.msg('mwe-embedplayer-for_best_experience',$('<div>').append($('<a />').attr({'href':'http://www.mediawiki.org/wiki/Extension:TimedMediaHandler/Client_download','target':'_new'}))[0].innerHTML),true);}});$(embedPlayer).bind('TimedText_BuildCCMenu',function(event,$menu,id){if(id!=embedPlayer.id){_this=$('#'+id)[0].timedText;embedPlayer=_this.embedPlayer;}if(embedPlayer.apiTitleKey){if($menu.find('.add-timed-text').length){return;}var addTextPage=mw.getApiProviderURL(apiProvider).replace('api.php','index.php')+'?title=TimedText:'+unescape(embedPlayer.apiTitleKey).replace(/^File:|^Image:/,'');var $li=$.getLineItem(mw.msg('mwe-timedtext-upload-timed-text'),
'script',function(){window.location=addTextPage;});$li.addClass('add-timed-text').find("a").attr({'href':addTextPage,'target':'_new'});$menu.append($li);}});$(embedPlayer).bind('checkPlayerSourcesEvent',function(event,callback){if(embedPlayer.mediaElement.sources.length==0){loadPlayerSources(callback);}else{callback();}});$(mw).bind('TimedText_LoadTextSource',function(event,source,callback){if(!source['mwtitle']||!source['mwprovider']){callback();return;}var apiUrl=mw.getApiProviderURL(source['mwprovider']);var request={'action':'parse','page':source['mwtitle'],'smaxage':3600,'maxage':3600};mw.getJSON(apiUrl,request,function(data){if(data&&data['parse']&&data['parse']['text']&&data['parse']['text']['*']){source.loaded=true;source.mimeType='text/mw-srt';source.captions=source.getCaptions(data['parse']['text']['*']);callback();}else{mw.log("Error: MediaWiki api error in getting timed text:",data);callback();}});});$(embedPlayer).bind('getShareIframeSrc',function(event,callback,id){if(id
!=embedPlayer.id){embedPlayer=$('#'+id)[0];}var iframeUrl=false;if(embedPlayer['data-mwprovider']=='wikimediacommons'){iframeUrl='//commons.wikimedia.org/wiki/File:'+unescape(embedPlayer.apiTitleKey).replace(/^(File:|Image:)/,'');}else{if(mw.config.get('wgServer')&&mw.config.get('wgArticlePath')){iframeUrl=mw.config.get('wgServer')+mw.config.get('wgArticlePath').replace(/\$1/,'File:'+unescape(embedPlayer.apiTitleKey).replace(/^(File:|Image:)/,''))}}if(iframeUrl){iframeUrl+='?embedplayer=yes';}callback(iframeUrl);});};})(window.mediaWiki,window.jQuery);;},{},{});mw.loader.implement("mw.PlayerSkinKskin",function(){(function(mw,$){"use strict";mw.PlayerSkinKskin={playerClass:'k-player',longTimeDisp:false,height:20,volumeLayout:'horizontal',supportedMenuItems:{'credits':true},currentMenuItem:null,components:{'pause':{'w':28},'volumeControl':{'w':40},'playButtonLarge':{'h':55},'options':{'w':52,'o':function(ctrlObj){return $('<div />').attr('title',mw.msg('mwe-embedplayer-player_options')).
addClass("ui-state-default ui-corner-bl rButton k-options").append($('<span />').text(mw.msg('mwe-embedplayer-menu_btn')));}},'attributionButton':false,'timeDisplay':{'w':52},'optionsMenu':{'w':0,'o':function(ctrlObj){var embedPlayer=ctrlObj.embedPlayer;var $menuOverlay=$('<div />').addClass('overlay-win k-menu ui-widget-content').css({'width':'100%','position':'absolute','top':'0px','bottom':(ctrlObj.getHeight()+2)+'px','z-index':'3'});var userAgent=navigator.userAgent.toLowerCase();if(userAgent.indexOf('safari')!=-1){$menuOverlay.css('opacity','0.9');}if(embedPlayer.getPlayerHeight()<ctrlObj.getOverlayHeight()){var topPos=(ctrlObj.isOverlayControls())?embedPlayer.getPlayerHeight():embedPlayer.getPlayerHeight()+ctrlObj.getHeight();if(embedPlayer.isAudio()){topPos=ctrlObj.embedPlayer.getInterface().height();}$menuOverlay.css({'top':topPos+'px','bottom':null,'width':ctrlObj.getOverlayWidth(),'height':ctrlObj.getOverlayHeight()+'px'});$(embedPlayer).parents('.thumbinner').css('overflow',
'visible');}var $menuBar=$('<ul />').addClass('k-menu-bar');delete ctrlObj.supportedMenuItems['aboutPlayerLibrary'];for(var menuItem in ctrlObj.supportedMenuItems){$menuBar.append($('<li />').addClass('k-'+menuItem+'-btn').attr('rel',menuItem).append($('<a />').attr({'title':mw.msg('mwe-embedplayer-'+menuItem),'href':'#'})));}$menuOverlay.append($menuBar);var $menuScreens=$('<div />').addClass('k-menu-screens').css({'position':'absolute','top':'0px','left':'0px','bottom':'0px','right':'45px','overflow':'hidden'});for(var menuItem in ctrlObj.supportedMenuItems){$menuScreens.append($('<div />').addClass('menu-screen menu-'+menuItem));}$menuOverlay.append($menuScreens);return $menuOverlay;}}},getOverlayWidth:function(){return(this.embedPlayer.getPlayerWidth()<220)?220:this.embedPlayer.getPlayerWidth();},getOverlayHeight:function(){return(this.embedPlayer.getPlayerHeight()<160)?160:this.embedPlayer.getPlayerHeight();},addSkinControlBindings:function(){var embedPlayer=this.embedPlayer;var
_this=this;this.$playerTarget=embedPlayer.$interface;this.$playerTarget.find('.k-options').unbind().click(function(){_this.checkMenuOverlay();var $kmenu=_this.$playerTarget.find('.k-menu');if($kmenu.is(':visible')){_this.closeMenuOverlay();}else{_this.showMenuOverlay();if(!_this.currentMenuItem){_this.showMenuItem('credits');_this.$playerTarget.find('.menu-screen').hide();_this.$playerTarget.find('.menu-credits').fadeIn("fast");}}});},checkMenuOverlay:function(){var _this=this;var embedPlayer=this.embedPlayer;if(_this.$playerTarget.find('.k-menu').length==0){if(!embedPlayer.supports['overlays']){embedPlayer.stop();}_this.addMenuBinding();}},closeMenuOverlay:function(){mw.log("PlayerSkinKskin:: close menu overlay");var embedPlayer=this.embedPlayer;var $optionsMenu=embedPlayer.getInterface().find('.k-options');var $kmenu=embedPlayer.getInterface().find('.k-menu');$kmenu.fadeOut("fast",function(){$optionsMenu.find('span').text(mw.msg('mwe-embedplayer-menu_btn'));});if(!embedPlayer.
isPlaying()){embedPlayer.getInterface().find('.play-btn-large').fadeIn('fast');}this.showControlBar();this.displayOptionsMenuFlag=false;},showMenuOverlay:function($ktxt){var $optionsMenu=this.$playerTarget.find('.k-options');var $kmenu=this.$playerTarget.find('.k-menu');$kmenu.fadeIn("fast",function(){$optionsMenu.find('span').text(mw.msg('mwe-embedplayer-close_btn'));});this.$playerTarget.find('.play-btn-large').fadeOut('fast');$(this.embedPlayer).trigger('displayMenuOverlay');this.displayOptionsMenuFlag=true;},addMenuBinding:function(){var _this=this;var embedPlayer=this.embedPlayer;var $playerTarget=embedPlayer.$interface;if($playerTarget.find('.k-menu').length!=0)return false;$playerTarget.append(_this.getComponent('optionsMenu'));$playerTarget.find('.k-menu').hide();for(var menuItem in _this.supportedMenuItems){$playerTarget.find('.k-'+menuItem+'-btn').click(function(){var mk=$(this).attr('rel');var $targetItem=$playerTarget.find('.menu-'+mk);_this.showMenuItem(mk);$playerTarget.
find('.menu-screen').hide();$targetItem.fadeIn("fast");return false;});}},showMenuItem:function(menuItem){var embedPlayer=this.embedPlayer;this.currentMenuItem=menuItem;switch(menuItem){case'credits':this.showCredits();break;case'playerSelect':embedPlayer.$interface.find('.menu-playerSelect').html(this.getPlayerSelect());break;case'download':embedPlayer.$interface.find('.menu-download').text(mw.msg('mwe-loading_txt'));this.showDownload(embedPlayer.$interface.find('.menu-download'));break;case'share':embedPlayer.$interface.find('.menu-share').html(this.getShare());break;}},showCredits:function(){var embedPlayer=this.embedPlayer;var _this=this;var $target=embedPlayer.$interface.find('.menu-credits');$target.empty().append($('<h2 />').text(mw.msg('mwe-embedplayer-credits')),$('<div />').addClass("credits_box ui-corner-all").append($('<div/>').loadingSpinner().css({'position':'absolute','top':'50%','left':'50%'})));if(mw.config.get('EmbedPlayer.KalturaAttribution')==true){$target.append($(
'<div />').addClass('k-attribution').attr({'title':mw.msg('mwe-embedplayer-kaltura-platform-title')}).click(function(){window.location='http://html5video.org';}));}var $creditBox=$target.find('.credits_box');$creditBox.data('playerId',embedPlayer.id);$(embedPlayer).triggerQueueCallback('showCredits',$creditBox,function(addedCredits){if(!addedCredits){$creditBox.find('.credits_box').text(mw.msg('mwe-embedplayer-nocredits'))}});}};})(window.mw,jQuery);;},{"css":[
".k-player{color:#FFF;background-color:#000}.k-player .ui-widget-content{color:#555}.k-player .ui-widget-content a{color:#555} .k-player .play-btn-large{width:70px;height:55px;background:url(//bits.wikimedia.org/static-1.22wmf13/extensions/TimedMediaHandler/MwEmbedModules/EmbedPlayer/resources/skins/kskin/images/ksprite.png?2013-08-15T15:16:40Z) no-repeat 0px -433px;position:absolute;cursor:pointer;border:none}@print{.k-player .play-btn-large{display:none}} .k-player .play-btn-large:hover{background:url(//bits.wikimedia.org/static-1.22wmf13/extensions/TimedMediaHandler/MwEmbedModules/EmbedPlayer/resources/skins/kskin/images/ksprite.png?2013-08-15T15:16:40Z) no-repeat 0px -377px} .k-player .control-bar .ui-icon,.k-player .control-bar .ui-icon{background:transparent url(//bits.wikimedia.org/static-1.22wmf13/extensions/TimedMediaHandler/MwEmbedModules/EmbedPlayer/resources/skins/kskin/images/ksprite.png?2013-08-15T15:16:40Z) no-repeat scroll 0 -48px}.k-player .ui-state-default .ui-icon-arrow-4-diag{background-position:0 -32px} .k-player .ui-state-hover .ui-icon-arrow-4-diag{background-position:-16px -32px}.k-player .ui-state-hover .ui-icon-volume-on{background-position:-16px -48px} .k-player .ui-state-default .ui-icon-comment{background-position:0px -65px}.k-player .ui-state-default .ui-icon-play{background:url(//bits.wikimedia.org/static-1.22wmf13/extensions/TimedMediaHandler/MwEmbedModules/EmbedPlayer/resources/skins/kskin/images/ksprite.png?2013-08-15T15:16:40Z) no-repeat 0 0}.k-player .ui-state-hover .ui-icon-play{background-position:-16px 0}.k-player .ui-state-default .ui-icon-pause{background:url(//bits.wikimedia.org/static-1.22wmf13/extensions/TimedMediaHandler/MwEmbedModules/EmbedPlayer/resources/skins/kskin/images/ksprite.png?2013-08-15T15:16:40Z) no-repeat 0 -17px}.k-player .ui-state-hover .ui-icon-pause{background-position:-16px -17px}.k-player .control-bar{border:1px solid #c8c8c8;border-top:0px;border-right:0px;height:21px;padding:2px 0 0 6px;margin-top:0px;background:url(//bits.wikimedia.org/static-1.22wmf13/extensions/TimedMediaHandler/MwEmbedModules/EmbedPlayer/resources/skins/kskin/images/ksprite.png?2013-08-15T15:16:40Z) repeat-x 0 -81px;!important;font:normal 11px arial,sans-serif;color:#555;position:absolute;bottom:0px;left:0px;right:0px;z-index:2}.k-player .play_head{background:url(//bits.wikimedia.org/static-1.22wmf13/extensions/TimedMediaHandler/MwEmbedModules/EmbedPlayer/resources/skins/kskin/images/ksprite.png?2013-08-15T15:16:40Z) repeat-x scroll 0 -350px transparent;display:inline; float:left;margin-left:10px;border:1px solid #EEEEEE;height:8px;margin:5px 2px 0 0px;position:relative; direction:ltr}.k-player .play_head .ui-slider-handle{background:url(//bits.wikimedia.org/static-1.22wmf13/extensions/TimedMediaHandler/MwEmbedModules/EmbedPlayer/resources/skins/kskin/images/ksprite.png?2013-08-15T15:16:40Z) no-repeat scroll -67px -341px transparent !important;border:1px solid #888888;display:block;height:8px;margin:-1px 0 0 -5px;position:absolute;top:0;width:8px;cursor:pointer;-moz-border-radius:5px 5px 5px 5px;border-radius:5px 5px 5px 5px;-webkit-border-radius:5px 5px 5px 5px}.k-player .ui-corner-all{border-radius:5px 5px 5px 5px !important;-webkit-border-radius:5px 5px 5px 5px !important;-moz-border-radius:5px 5px 5px 5px !important}.k-player ul.fg-menu{margin:0.3em 0 0 .3em;font-size:1.2em;padding:0px}.k-player .fg-menu-container{padding:0px; right:16px}.ui-dialog-content .k-player ul.fg-menu{font-size:1.2em}.k-player .time-disp{border:medium none;display:inline;color:#555555;font:11px arial,sans-serif;line-height:20px;overflow:hidden;width:39px; float:right}.k-player .source-switch{border:medium none;display:inline;color:#555;font:11px arial,sans-serif;line-height:20px;overflow:hidden;width:70px;cursor:pointer; float:right;text-align:center}.k-player .lButton{cursor:pointer; float:left;list-style:none outside none;margin:2px;padding:0px 0;width:19px;height:16px;position:relative;background:none repeat scroll 0 0 transparent !important;border:medium none}.k-player .rButton{cursor:pointer; float:right;list-style:none outside none;margin-top:2px;padding:0px 0;width:22px;height:16px;position:relative;background:none repeat scroll 0 0 transparent !important;border:medium none}.k-player .k-options{border:1px solid #AAAAAA !important;color:#555555 !important; float:right;height:21px;margin-top:-2px;margin-right:0px;width:50px;background:none repeat scroll 0 0 transparent !important;font-family:Lucida Grande,Lucida Sans,Arial,sans-serif;font-size:11px;text-transform:uppercase;text-align:center}.k-player .k-options span{position:relative;top:4px}.k-player .k-menu-screens{ float:left;font-size:14px;text-align:left;padding:5px 5px 10px 5px}.k-player ul.k-menu-bar{background:url(//bits.wikimedia.org/static-1.22wmf13/extensions/TimedMediaHandler/MwEmbedModules/EmbedPlayer/resources/skins/kskin/images/ksprite.png?2013-08-15T15:16:40Z) no-repeat scroll -99px -104px transparent;bottom:5px;height:128px;list-style:none outside none;padding:0 0 5px;position:absolute; right:0;margin-left:0}.k-player .k-menu{background:none repeat scroll 0 0 #181818;border:medium none;display:none;left:0;position:absolute;top:0}.k-player .k-menu-bar li a{background:url(//bits.wikimedia.org/static-1.22wmf13/extensions/TimedMediaHandler/MwEmbedModules/EmbedPlayer/resources/skins/kskin/images/ksprite.png?2013-08-15T15:16:40Z) no-repeat scroll -51px -110px transparent;display:block;height:32px;margin-left:1px;overflow:hidden;text-indent:99999px;width:49px}.k-menu-bar li a:hover{background-position:-1px -110px}.k-menu-bar li.k-download-btn a{background-position:-51px -203px}.k-menu-bar li.k-download-btn a:hover{background-position:-1px -203px}.k-menu-bar li.k-share-btn a{background-position:-51px -172px}.k-menu-bar li.k-share-btn a:hover{background-position:-1px -172px}.k-menu-bar li.k-credits-btn a{background-position:-51px -141px}.k-menu-bar li.k-credits-btn a:hover{background-position:-1px -141px}.k-menu-screens p{margin:6px 0}.k-menu-screens a img{border:none}.k-menu-screens ul{padding:0;margin:6px 0 0;list-style:none outside none}.k-edit-screen{width:370px;height:223px;padding-top:77px;text-align:center;background:#181818;color:#fff}.k-edit-screen div{}.k-edit-screen a{color:#7BB8FC}.k-edit-screen a img{border:none}.k-menu-screens h2,.k-menu-screens h3{padding:0 0 5px 15px;clear:both;font-size:12px;color:#999;border-bottom:0}.k-menu-screens p{margin:6px 0}.k-menu-screens a img{border:none}.k-menu-screens ul{padding:0;margin:6px 0 0;list-style:none outside none}.k-menu-screens li{margin-bottom:6px}.k-menu-screens li a{padding-left:22px;padding-right:22px;background:url(//bits.wikimedia.org/static-1.22wmf13/extensions/TimedMediaHandler/MwEmbedModules/EmbedPlayer/resources/skins/kskin/images/ksprite.png?2013-08-15T15:16:40Z) no-repeat -85px -274px;text-decoration:none;color:#BBB}.k-menu-screens li a.active,.k-menu-screens li a:hover .active{background-position:-85px -245px}.k-menu-screens li a:hover{background-position:-85px -259px}.k-menu textarea{background:none repeat scroll 0 0 transparent;border-color:#000000 -moz-use-text-color -moz-use-text-color #000000;border-style:solid none none solid;border-width:2px medium medium 2px;color:#CCCCCC;font:11px arial,sans-serif;overflow:hidden;padding-left:2px;width:95%}.menu-screen.menu-share button{background:url(//bits.wikimedia.org/static-1.22wmf13/extensions/TimedMediaHandler/MwEmbedModules/EmbedPlayer/resources/skins/kskin/images/ksprite.png?2013-08-15T15:16:40Z) no-repeat scroll 0 -81px #D4D4D4;border:1px solid #000000;color:#000000;float:right;height:34px;padding:0 5px 3px;font-size:1em}.k-player .menu-screen{height:100%;overflow-y:auto;overflow-x:hidden}.k-player .menu-screen.menu-share div.ui-state-highlight{background:none repeat scroll 0 0 transparent;border-color:#554926;color:#FFE96E;float:left;padding:2px 5px}.k-player .menu-screen.menu-share div.ui-state-highlight a{color:#FFE96E;font-weight:bold}.k-player .volume_control{ margin-right:2px;width:16px}.k-player .volume_control span{margin-right:0px}.k-player .volume-slider{width:20px; direction:ltr}.k-player .volume-slider .ui-slider-range{-moz-border-radius:0 0 0 0;background:url(//bits.wikimedia.org/static-1.22wmf13/extensions/TimedMediaHandler/MwEmbedModules/EmbedPlayer/resources/skins/kskin/images/ksprite.png?2013-08-15T15:16:40Z) repeat-x scroll -66px -306px transparent !important;height:17px;position:absolute}.k-player .volume-slider a.ui-slider-handle{background:none repeat scroll 0 0 transparent;border:medium none;display:block;height:18px;margin:-3px 5px 0 -1px;position:absolute;width:8px}.k-player .ui-slider-horizontal .ui-slider-range-min{ left:0}.k-player .credits_box{background-attachment:scroll;background-color:white;background-image:none;background-position:0 0;bottom:20px;left:20px;position:absolute;right:20px;top:30px;overflow:hidden}.k-player .credits_box a{color:#666;text-decoration:underline}.k-player .creditline img{float:left;width:90px;margin:4px}.k-player .k-attribution{position:absolute;bottom:5px;right :20px;background:url(//bits.wikimedia.org/static-1.22wmf13/extensions/TimedMediaHandler/MwEmbedModules/EmbedPlayer/resources/skins/kskin/images/kaltura_open_source_video_platform.png?2013-08-15T15:16:40Z);width :51px;height :12px;cursor:pointer}\n/* cache key: enwiki:resourceloader:filter:minify-css:7:da8f7d2ec5c186948254b82410b06e0d */"
]},{});mw.loader.implement("mw.TextSource",function(){(function(mw,$){"use strict";mw.TextSource=function(source){return this.init(source);};mw.TextSource.prototype={loaded:false,captions:[],styleCss:{},prevIndex:0,init:function(source,textProvider){for(var i in source){this[i]=source[i];}if(!this.kind){this.kind='subtitle';}if(textProvider){this.textProvider=textProvider;}return this;},load:function(callback){var _this=this;mw.log("TextSource:: load src "+_this.getSrc());if(!callback){callback=function(){return;};}if(this.loaded){return callback();}if(!this.getSrc()){mw.log("Error: TextSource no source url for text track");return callback();}$(mw).triggerQueueCallback('TimedText_LoadTextSource',_this,function(){if(_this.loaded){callback();}else{new mw.ajaxProxy({url:_this.getSrc(),success:function(resultXML){_this.captions=_this.getCaptions(resultXML);_this.loaded=true;mw.log("mw.TextSource :: loaded from "+_this.getSrc()+" Found: "+_this.captions.length+' captions');callback();},
error:function(){mw.log("Error: TextSource Error with http response");_this.loaded=true;callback();}});}})},getCaptionForTime:function(time){var prevCaption=this.captions[this.prevIndex];var captionSet={};if(prevCaption&&time>=prevCaption.start){var startIndex=this.prevIndex;}else{var startIndex=0;}var firstCapIndex=0;for(var i=startIndex;i<this.captions.length;i++){var caption=this.captions[i];if(caption.end==0||caption.end==-1)continue;if(time>=caption.start&&time<=caption.end){if(!firstCapIndex){firstCapIndex=caption.start;}captionSet[i]=caption;}if(caption.start>time){break;}}this.prevIndex=firstCapIndex;return captionSet;},isOverlay:function(){return this.mimeType=='text/xml';},getCaptions:function(data){switch(this.mimeType){case'text/mw-srt':return this.getCaptiosnFromMediaWikiSrt(data);break;case'text/x-srt':return this.getCaptionsFromSrt(data);break;case'text/xml':return this.getCaptionsFromTMML(data);break;}return[];},getStyleCssById:function(styleId){if(this.styleCss[styleId
]){return this.styleCss[styleId];}return{};},getCaptionsFromTMML:function(data){var _this=this;mw.log("TextSource::getCaptionsFromTMML",data);var captions=[];var xml=($(data).find("tt").length)?data:$.parseXML(data);try{if(!xml||$(xml).find('parsererror').length){mw.log("Error: close caption parse error: "+$(xml).find('parsererror').text());return captions;}}catch(e){mw.log("Error: close caption parse error: "+e.toString());return captions;}var bodyStyleId=$(xml).find('body').attr('style');$(xml).find('style').each(function(inx,style){var cssObject={};$(style.attributes).each(function(inx,attr){var attrName=attr.name;if(attrName.substr(0,4)!=='tts:'){return true;}var cssName='';for(var c=4;c<attrName.length;c++){if(attrName[c].toLowerCase()!=attrName[c]){cssName+='-'+attrName[c].toLowerCase();}else{cssName+=attrName[c]}}cssObject[cssName]=attr.nodeValue;});_this.styleCss[$(style).attr('id')]=cssObject;});$(xml).find('p').each(function(inx,p){var content='';$.each(p.childNodes,function(
inx,node){content+=_this.convertTTML2HTML(node);});var end=null;if($(p).attr('end')){end=mw.npt2seconds($(p).attr('end'));}if(!end&&$(p).attr('dur')){end=mw.npt2seconds($(p).attr('begin'))+mw.npt2seconds($(p).attr('dur'));}var captionObj={'start':mw.npt2seconds($(p).attr('begin')),'end':end,'content':content};var $meta=$(p).find('metadata');if($meta.length){captionObj['css']={'position':'absolute'};if($meta.attr('cccol')){captionObj['css']['left']=($meta.attr('cccol')/35)*100+'%';}if($meta.attr('ccrow')){captionObj['css']['top']=($meta.attr('ccrow')/15)*100+'%';}}if($(p).attr('tts:textAlign')){if(!captionObj['css']){captionObj['css']={};}captionObj['css']['text-align']=$(p).attr('tts:textAlign');if(captionObj['css']['text-align']=='right'&&captionObj['css']['left']){captionObj['css']['left']=null;}}if($(p).attr('style')){captionObj['styleId']=$(p).attr('style');}else{captionObj['styleId']=bodyStyleId;}captions.push(captionObj);});return captions;},convertTTML2HTML:function(node){var
_this=this;if(node.nodeType==3){return node.textContent;}if(node.nodeName=='metadata'){return'';}if(node.nodeName=='br'){return'<br />';}var ttsStyleMap={'tts:color':'color','tts:fontWeight':'font-weight','tts:fontStyle':'font-style'};if(node.childNodes.length){var nodeString='';var styleVal='';for(var attr in ttsStyleMap){if(node.getAttribute(attr)){styleVal+=ttsStyleMap[attr]+':'+node.getAttribute(attr)+';';}}nodeString+='<'+node.nodeName+' style="'+styleVal+'" >';$.each(node.childNodes,function(inx,childNode){nodeString+=_this.convertTTML2HTML(childNode);});nodeString+='</'+node.nodeName+'>';return nodeString;}},getCaptionsFromSrt:function(data){mw.log("TextSource::getCaptionsFromSrt");var _this=this;try{var xml=$.parseXML(data);if(xml&&$(xml).find('parsererror').length==0){return this.getCaptionsFromTMML(data);}}catch(e){}var srt=data.replace(/\r+/g,'');srt=srt.replace(/^\s+|\s+$/g,'');srt=srt.replace(/<[a-zA-Z\/][^>]*>/g,'');var captions=[];var caplist=srt.split('\n\n');for(var i=
0;i<caplist.length;i++){var captionText="";var caption=false;captionText=caplist[i];var s=captionText.split(/\n/);if(s.length<2){continue;}if(s[0].match(/^\d+$/)&&s[1].match(/\d+:\d+:\d+/)){var m=s[1].match(/(\d+):(\d+):(\d+)(?:,(\d+))?\s*--?>\s*(\d+):(\d+):(\d+)(?:,(\d+))?/);if(m){caption=_this.match2caption(m);}else{continue;}if(caption){caption['content']=s.slice(2).join("<br>");}}else{continue;}captions.push(caption);}return captions;},getCaptiosnFromMediaWikiSrt:function(data){mw.log("TimedText::getCaptiosnFromMediaWikiSrt:");var _this=this;var captions=[];var curentCap={'content':''};var parseNextAsTime=false;$('<div>'+data+'</div>').find('p').each(function(){var currentPtext=$(this).html();var m=currentPtext.replace('--&gt;','-->').match(/\d+\s([\d\-]+):([\d\-]+):([\d\-]+)(?:,([\d\-]+))?\s*--?>\s*([\d\-]+):([\d\-]+):([\d\-]+)(?:,([\d\-]+))?\n?(.*)/);if(m){captions.push(_this.match2caption(m));return true;}if(parseInt(currentPtext)==currentPtext){if(curentCap.content!=''){
captions.push(curentCap);}curentCap={'content':''};return true;}var m=currentPtext.replace('--&gt;','-->').match(/(\d+):(\d+):(\d+)(?:,(\d+))?\s*--?>\s*(\d+):(\d+):(\d+)(?:,(\d+))?/);if(m){curentCap=_this.match2caption(m);return true;}if(currentPtext!='<br>'){curentCap['content']+=currentPtext;}});if(curentCap.length!=0){captions.push(curentCap);}mw.log("TimedText::getCaptiosnFromMediaWikiSrt found "+captions.length+' captions');return captions;},match2caption:function(m){var caption={};var startMs=(m[4])?parseInt(m[4],10):0;var endMs=(m[8])?parseInt(m[8],10):0;caption['start']=this.timeParts2seconds(m[1],m[2],m[3],startMs);caption['end']=this.timeParts2seconds(m[5],m[6],m[7],endMs);if(m[9]){caption['content']=$.trim(m[9]);}return caption;},timeParts2seconds:function(hours,min,sec,ms){return mw.measurements2seconds({'hours':hours,'minutes':min,'seconds':sec,'milliseconds':ms});}};})(window.mediaWiki,window.jQuery);;},{},{});mw.loader.implement("mw.TimedText",function(){(function(mw,$){
"use strict";mw.mergeConfig('EmbedPlayer.SourceAttributes',['srclang','kind','label']);mw.TimedText=function(embedPlayer){return this.init(embedPlayer);};mw.TimedText.prototype={config:{'layout':'ontop','userLanguage':mw.config.get('wgUserLanguage')||'en','userKind':'subtitles'},defaultDisplayMode:'ontop',lastLayout:'ontop',bindPostFix:'.timedText',options:{},enabledSources:[],firstLoad:true,currentLangKey:null,currentLangDir:null,prevText:[],textSources:[],validCategoriesKeys:["CC","SUB","TAD","KTV","TIK","AR","NB","META","TRX","LRC","LIN","CUE"],init:function(embedPlayer){var _this=this;mw.log("TimedText: init() ");this.embedPlayer=embedPlayer;if(embedPlayer.useNativePlayerControls()){return this;}var preferenceConfig=$.cookie('TimedText.Preferences');if(preferenceConfig!=="false"&&preferenceConfig!=null){this.config=JSON.parse(preferenceConfig);}$(this.embedPlayer).bind('onChangeMedia'+this.bindPostFix,function(){_this.destroy();});_this.destroy();_this.addPlayerBindings();return this
;},destroy:function(){$(this.embedPlayer).unbind(this.bindPostFix);this.enabledSources=[];this.textSources=[];},addPlayerBindings:function(){var _this=this;var embedPlayer=this.embedPlayer;_this.addInterface();$(embedPlayer).bind('timeupdate'+this.bindPostFix,function(event,jEvent,id){_this=$('#'+id)[0].timedText;_this.monitor();});$(embedPlayer).bind('firstPlay'+this.bindPostFix,function(event,id){_this=$('#'+id)[0].timedText;_this.setupTextSources();$('#textMenuContainer_'+_this.embedPlayer.id).hide();});$(embedPlayer).bind('onChangeMedia'+this.bindPostFix,function(){_this.destroy();_this.updateLayout();_this.setupTextSources();$('#textMenuContainer_'+embedPlayer.id).hide();});$(embedPlayer).bind('onCloseFullScreen'+this.bindPostFix+' onOpenFullScreen'+this.bindPostFix,function(){var textOffset=_this.embedPlayer.controlBuilder.inFullScreen?mw.config.get("TimedText.BottomPadding")*2:mw.config.get("TimedText.BottomPadding");var textCss=_this.getInterfaceSizeTextCss({'width':embedPlayer
.getInterface().width(),'height':embedPlayer.getInterface().height()});mw.log('TimedText::set text size for: : '+embedPlayer.getInterface().width()+' = '+textCss['font-size']);if(embedPlayer.controlBuilder.isOverlayControls()&&!embedPlayer.getInterface().find('.control-bar').is(':hidden')){textOffset+=_this.embedPlayer.controlBuilder.getHeight();}embedPlayer.getInterface().find('.track').css(textCss).css({'bottom':textOffset+'px'});});$(embedPlayer).bind('updateLayout'+this.bindPostFix,function(){var textCss=_this.getInterfaceSizeTextCss({'width':embedPlayer.getPlayerWidth(),'height':embedPlayer.getPlayerHeight()});mw.log('TimedText::updateLayout: '+textCss['font-size']);embedPlayer.getInterface().find('.track').css(textCss);});$(embedPlayer).bind('onShowControlBar'+this.bindPostFix,function(event,layout,id){var embedPlayer=$('#'+id)[0];if(embedPlayer.controlBuilder.isOverlayControls()){embedPlayer.getInterface().find('.track').stop().animate(layout,'fast');}});$(embedPlayer).bind(
'onHideControlBar'+this.bindPostFix,function(event,layout,id){var embedPlayer=$('#'+id)[0];if(embedPlayer.controlBuilder.isOverlayControls()){embedPlayer.getInterface().find('.track').stop().animate(layout,'fast');}});$(embedPlayer).bind('AdSupport_StartAdPlayback'+this.bindPostFix,function(){if($('#textMenuContainer_'+embedPlayer.id).length){$('#textMenuContainer_'+embedPlayer.id).hide();}var $textButton=embedPlayer.getInterface().find('.timed-text');if($textButton.length){$textButton.unbind('click');}_this.lastLayout=_this.getLayoutMode();_this.setLayoutMode('off');});$(embedPlayer).bind('AdSupport_EndAdPlayback'+this.bindPostFix,function(){var $textButton=embedPlayer.getInterface().find('.timed-text');if($textButton.length){_this.bindTextButton($textButton);}_this.setLayoutMode(_this.lastLayout);});},addInterface:function(){var _this=this;$(_this.embedPlayer).bind('addControlBarComponent'+this.bindPostFix,function(event,controlBar){if(controlBar.supportedComponents['timedText']!==
false&&_this.includeCaptionButton()){controlBar.supportedComponents['timedText']=true;controlBar.components['timedText']=_this.getTimedTextButton();}});},includeCaptionButton:function(){return mw.config.get('TimedText.ShowInterface')=='always'||this.embedPlayer.getTextTracks().length;},getCurrentLangKey:function(){return this.currentLangKey;},getCurrentLangDir:function(){if(!this.currentLangDir){var source=this.getSourceByLanguage(this.getCurrentLangKey());this.currentLangDir=source.dir;}return this.currentLangDir;},getTimedTextButton:function(){var _this=this;return{'w':30,'position':6.9,'o':function(ctrlObj){var $textButton=$('<div />').attr('title',mw.msg('mwe-embedplayer-timed_text')).addClass("ui-state-default ui-corner-all ui-icon_link rButton timed-text").append($('<span />').addClass("ui-icon ui-icon-comment")).buttonHover();_this.bindTextButton($textButton);return $textButton;}};},bindTextButton:function($textButton){var _this=this;$textButton.unbind('click.textMenu').bind(
'click.textMenu',function(){_this.showTextMenu();return true;});},getInterfaceSizeTextCss:function(size){return{'font-size':this.getInterfaceSizePercent(size)+'%'};},showTextMenu:function(){var embedPlayer=this.embedPlayer;var loc=embedPlayer.getInterface().find('.rButton.timed-text').offset();mw.log('TimedText::showTextMenu:: '+embedPlayer.id+' location: ',loc);var $menuButton=this.embedPlayer.getInterface().find('.timed-text');if($menuButton[0].m){$menuButton.embedMenu('show');}else{this.buildMenu(true);}},getTextMenuContainer:function(){var textMenuId='textMenuContainer_'+this.embedPlayer.id;if(!$('#'+textMenuId).length){this.embedPlayer.getInterface().append($('<div>').addClass('ui-widget ui-widget-content ui-corner-all').attr('id',textMenuId).css({'position':'absolute','z-index':10,'height':'180px','width':'180px','font-size':'12px','display':'none','overflow':'auto'}));}return $('#'+textMenuId);},getInterfaceSizePercent:function(size){var sizeFactor=4;if(size.height/size.width<.7
){sizeFactor=6;}var textSize=size.width/sizeFactor;if(textSize<95){textSize=95;}if(textSize>150){textSize=150;}return textSize;},setupTextSources:function(callback){mw.log('TimedText::setupTextSources');var _this=this;_this.loadTextSources(function(){_this.autoSelectSource();_this.loadEnabledSources();if(callback){callback();}});},buildMenu:function(autoShow){var _this=this;var embedPlayer=this.embedPlayer;_this.setupTextSources(function(){var $menuButton=_this.embedPlayer.getInterface().find('.timed-text');var positionOpts={};if(_this.embedPlayer.supports['overlays']){var positionOpts={'directionV':'up','offsetY':_this.embedPlayer.controlBuilder.getHeight(),'directionH':'left','offsetX':-28};}if(!_this.embedPlayer.getInterface()){mw.log("TimedText:: interface called before interface ready, just wait for interface");return;}var $menuButton=_this.embedPlayer.getInterface().find('.timed-text');var ctrlObj=_this.embedPlayer.controlBuilder;$menuButton.embedMenu({'content':_this.getMainMenu
(),'zindex':mw.config.get('EmbedPlayer.FullScreenZIndex')+2,'crumbDefaultText':' ','autoShow':autoShow,'keepPosition':true,'showSpeed':0,'height':100,'width':300,'targetMenuContainer':_this.getTextMenuContainer(),'positionOpts':positionOpts,'backLinkText':mw.msg('mwe-timedtext-back-btn'),'createMenuCallback':function(){var $interface=_this.embedPlayer.getInterface();var $textContainer=_this.getTextMenuContainer();var textHeight=130;var top=$interface.height()-textHeight-ctrlObj.getHeight()-6;if(top<0){top=0;}if(_this.embedPlayer.isAudio()){top=_this.embedPlayer.controlBuilder.getHeight()+4;}$textContainer.css({'top':top,'height':textHeight,'position':'absolute','left':$menuButton[0].offsetLeft-165,'bottom':ctrlObj.getHeight()})
ctrlObj.showControlBar(true);},'closeMenuCallback':function(){ctrlObj.restoreControlsHover();}});});},monitor:function(){var embedPlayer=this.embedPlayer;var currentTime=embedPlayer.currentTime;var textCategories=[];var source=this.enabledSources[0];if(source){this.updateSourceDisplay(source,currentTime);}},loadTextSources:function(callback){var _this=this;if(this.textSources.length){callback(this.textSources);return;}this.textSources=[];$.each(this.embedPlayer.getTextTracks(),function(inx,textSource){_this.textSources.push(new mw.TextSource(textSource));});callback(_this.textSources);},getLayoutMode:function(){if(this.config.layout=='ontop'&&!this.embedPlayer.supports['overlays']){this.config.layout='below';}return this.config.layout;},autoSelectSource:function(){var _this=this;if(this.enabledSources.length){return false;}this.enabledSources=[];var setDefault=false;$.each(this.textSources,function(inx,source){if(source['default']){_this.enableSource(source);setDefault=true;return false
;}});if(setDefault){return true;}var setLocalPref=false;$.each(this.textSources,function(inx,source){if(_this.config.userLanguage==source.srclang.toLowerCase()&&_this.config.userKind==source.kind){_this.enableSource(source);setLocalPref=true;return false;}});if(setLocalPref){return true;}var setEnglish=false;if(this.enabledSources.length==0){for(var i=0;i<this.textSources.length;i++){var source=this.textSources[i];if(source.srclang.toLowerCase()=='en'){_this.enableSource(source);setEnglish=true;return false;}}}if(setEnglish){return true;}var setFirst=false;if(this.enabledSources.length==0){for(var i=0;i<this.textSources.length;i++){var source=this.textSources[i];_this.enableSource(source);setFirst=true;return false;}}if(setFirst){return true;}return false;},enableSource:function(source){var _this=this;if(!_this.enabledSources.length){_this.enabledSources.push(source);_this.currentLangKey=source.srclang;_this.currentLangDir=null;return;}var sourceEnabled=false;$.each(this.enabledSources
,function(inx,enabledSource){if(source.id==enabledSource.id){sourceEnabled=true;}});if(!sourceEnabled){_this.enabledSources.push(source);_this.currentLangKey=source.srclang;_this.currentLangDir=null;}},loadCurrentSubSource:function(callback){mw.log("loadCurrentSubSource:: enabled source:"+this.enabledSources.length);for(var i=0;i<this.enabledSources.length;i++){var source=this.enabledSources[i];if(source.kind=='SUB'){source.load(function(){callback(source);return;});}}return false;},getSubCaptions:function(langKey,callback){for(var i=0;i<this.textSources.length;i++){var source=this.textSources[i];if(source.srclang.toLowerCase()===langKey){var source=this.textSources[i];source.load(function(){callback(source.captions);});}}},loadEnabledSources:function(){var _this=this;mw.log("TimedText:: loadEnabledSources "+this.enabledSources.length);$.each(this.enabledSources,function(inx,enabledSource){if(enabledSource.isOverlay()&&_this.config.layout=='ontop'){_this.setLayoutMode('ontop');}
enabledSource.load(function(){$(_this.embedPlayer).trigger('loadedTextSource',enabledSource);});});},isSourceEnabled:function(source){if(this.getLayoutMode()=='off'){return false;}var isEnabled=false;$.each(this.enabledSources,function(inx,enabledSource){if(source.id){if(source.id===enabledSource.id){isEnabled=true;}}if(source.src){if(source.src==enabledSource.src){isEnabled=true;}}});return isEnabled;},markActive:function(source){var $menu=$('#textMenuContainer_'+this.embedPlayer.id);if($menu.length){var $captionRows=$menu.find('.captionRow');if($captionRows.length){$captionRows.each(function(){$(this).removeClass('ui-icon-bullet ui-icon-radio-on');var iconClass=($(this).data('caption-id')===source.id)?'ui-icon-bullet':'ui-icon-radio-on';$(this).addClass(iconClass);});}}},markLayoutActive:function(layoutMode){var $menu=$('#textMenuContainer_'+this.embedPlayer.id);if($menu.length){var $layoutRows=$menu.find('.layoutRow');if($layoutRows.length){$layoutRows.each(function(){$(this).
removeClass('ui-icon-bullet ui-icon-radio-on');var iconClass=($(this).data('layoutMode')===layoutMode)?'ui-icon-bullet':'ui-icon-radio-on';$(this).addClass(iconClass);});}}},getSourceByLanguage:function(langKey){for(var i=0;i<this.textSources.length;i++){var source=this.textSources[i];if(source.srclang==langKey){return source;}}return false;},getMainMenu:function(){var _this=this;var $menu=_this.getLanguageMenu();if(_this.textSources.length==0){$menu.append($.getLineItem(mw.msg('mwe-timedtext-no-subs'),'close'));}else{$menu.append($.getLineItem(mw.msg('mwe-timedtext-layout-off'),(_this.getLayoutMode()=='off')?'bullet':'radio-on',function(){_this.setLayoutMode('off');},'layoutRow',{'layoutMode':'off'}))}$(_this.embedPlayer).trigger('TimedText_BuildCCMenu',[$menu,_this.embedPlayer.id]);if($menu.children('li').length==1){$menu.find('li > ul > li').detach().appendTo($menu);$menu.find('li').eq(0).remove();}return $menu;},getLiSource:function(source){var _this=this;var sourceIcon=(this.
isSourceEnabled(source))?'bullet':'radio-on';if(source.title){return $.getLineItem(source.title,sourceIcon,function(){_this.selectTextSource(source);},'captionRow',{'caption-id':source.id});}if(source.srclang){var langKey=source.srclang.toLowerCase();return $.getLineItem(mw.msg('mwe-timedtext-key-language',langKey,_this.getLanguageName(langKey)),sourceIcon,function(){_this.selectTextSource(source);},'captionRow',{'caption-id':source.id});}},getLanguageName:function(lang_key){if(mw.Language.names[lang_key]){return mw.Language.names[lang_key];}return false;},setLayoutMode:function(layoutMode){var _this=this;mw.log("TimedText:: setLayoutMode: "+layoutMode+' ( old mode: '+_this.config.layout+' )');if((layoutMode!=_this.config.layout)||_this.firstLoad){_this.config.layout=layoutMode;_this.updateLayout();_this.firstLoad=false;}_this.markLayoutActive(layoutMode);},toggleCaptions:function(){mw.log("TimedText:: toggleCaptions was:"+this.config.layout);if(this.config.layout=='off'){this.
setLayoutMode(this.defaultDisplayMode);}else{this.setLayoutMode('off');}},updateLayout:function(){mw.log("TimedText:: updateLayout ");var $playerTarget=this.embedPlayer.getInterface();if($playerTarget){$playerTarget.find('.captionContainer,.captionsOverlay').remove();}this.refreshDisplay();},selectTextSource:function(source){var _this=this;mw.log("TimedText:: selectTextSource: select lang: "+source.srclang);_this.setLayoutMode(_this.lastLayout);this.bindTextButton(this.embedPlayer.getInterface().find('timed-text'));this.currentLangKey=source.srclang;this.currentLangDir=null;if(source.srclang){this.config.userLanguage=source.srclang;}if(source.kind){this.config.userKind=source.kind;}this.enabledSources=[];this.enabledSources.push(source);if(!source.loaded){var $playerTarget=this.embedPlayer.getInterface();$playerTarget.find('.track').text(mw.msg('mwe-timedtext-loading-text'));source.load(function(){_this.refreshDisplay();});}else{_this.refreshDisplay();}_this.markActive(source);$(this.
embedPlayer).trigger('TimedText_ChangeSource');},refreshDisplay:function(){$.cookie('TimedText.Preferences',JSON.stringify(this.config));this.prevText=[];mw.log('TimedText:: bind menu refresh display');this.buildMenu();this.resizeInterface();this.displayTextTarget($('<span /> ').text(''));this.monitor();},getLanguageMenu:function(){var _this=this;var categorySourceList={};var sourcesWithCategoryCount=0;var sourcesWithoutCategory=[];for(var i=0;i<this.textSources.length;i++){var source=this.textSources[i];if(source.kind){var categoryKey=source.kind;if(!categorySourceList[categoryKey]){categorySourceList[categoryKey]=[];sourcesWithCategoryCount++;}categorySourceList[categoryKey].push(_this.getLiSource(source));}else{sourcesWithoutCategory.push(_this.getLiSource(source));}}var $langMenu=$('<ul>');if(sourcesWithCategoryCount>1){for(var categoryKey in categorySourceList){var $catChildren=$('<ul>');for(var i=0;i<categorySourceList[categoryKey].length;i++){$catChildren.append(
categorySourceList[categoryKey][i]);}$langMenu.append($.getLineItem(mw.msg('mwe-timedtext-textcat-'+categoryKey.toLowerCase())).append($catChildren));}}else{for(var categoryKey in categorySourceList){for(var i=0;i<categorySourceList[categoryKey].length;i++){$langMenu.append(categorySourceList[categoryKey][i]);}}}for(var i=0;i<sourcesWithoutCategory.length;i++){$langMenu.append(sourcesWithoutCategory[i]);}return $langMenu;},updateSourceDisplay:function(source,time){var _this=this;if(this.timeOffset){time=time+parseInt(this.timeOffset);}var activeCaptions=source.getCaptionForTime(time);var addedCaption=false;$.each(activeCaptions,function(capId,caption){var $cap=_this.embedPlayer.getInterface().find('.track[data-capId="'+capId+'"]');if(caption.content!=$cap.html()){$cap.remove();_this.addCaption(source,capId,caption);addedCaption=true;}});_this.embedPlayer.getInterface().find('.track').each(function(inx,caption){if(!activeCaptions[$(caption).attr('data-capId')]){if(addedCaption){$(
caption).remove();}else{$(caption).fadeOut(mw.config.get('EmbedPlayer.MonitorRate'),function(){$(this).remove();});}}});},addCaption:function(source,capId,caption){if(this.getLayoutMode()=='off'){return;}var $textTarget=$('<div />').addClass('track').attr('data-capId',capId).hide();$textTarget.append($('<span />').addClass('ttmlStyled').css('pointer-events','auto').css(this.getCaptionCss()).html(caption.content));$textTarget.attr('lang',source.srclang.toLowerCase());$textTarget.find('a').attr('target','_blank');if(this.getLayoutMode()=='ontop'){if(caption.css){$textTarget.css(caption.css);}else{$textTarget.css(this.getDefaultStyle());}}this.displayTextTarget($textTarget);$textTarget.css(this.getInterfaceSizeTextCss({'width':this.embedPlayer.getInterface().width(),'height':this.embedPlayer.getInterface().height()}));if(caption.styleId){var capCss=source.getStyleCssById(caption.styleId);$textTarget.find('span.ttmlStyled').css(capCss);}$textTarget.fadeIn('fast');},displayTextTarget:
function($textTarget){var embedPlayer=this.embedPlayer;var $interface=embedPlayer.getInterface();var controlBarHeight=embedPlayer.controlBuilder.getHeight();if(this.getLayoutMode()=='off'){if(embedPlayer.isAudio()){$interface.find('.overlay-win').css('top',controlBarHeight);$interface.css('height',controlBarHeight);}return;}if(this.getLayoutMode()=='ontop'){this.addTextOverlay($textTarget);}else if(this.getLayoutMode()=='below'){this.addTextBelowVideo($textTarget);}else{mw.log("Possible Error, layout mode not recognized: "+this.getLayoutMode());}if(embedPlayer.isAudio()&&embedPlayer.getInterface().height()<80){$interface.find('.overlay-win').css('top',80);$interface.css('height',80);$interface.find('.captionsOverlay').css('bottom',embedPlayer.controlBuilder.getHeight())}},getDefaultStyle:function(){var defaultBottom=15;if(this.embedPlayer.controlBuilder.isOverlayControls()&&!this.embedPlayer.getInterface().find('.control-bar').is(':hidden')){defaultBottom+=this.embedPlayer.
controlBuilder.getHeight();}var baseCss={'position':'absolute','bottom':defaultBottom,'width':'100%','display':'block','opacity':.8,'text-align':'center','z-index':2};baseCss=$.extend(baseCss,this.getInterfaceSizeTextCss({'width':this.embedPlayer.getInterface().width(),'height':this.embedPlayer.getInterface().height()}));return baseCss;},addTextOverlay:function($textTarget){var _this=this;var $captionsOverlayTarget=this.embedPlayer.getInterface().find('.captionsOverlay');var layoutCss={'left':0,'top':0,'bottom':0,'right':0,'position':'absolute','direction':this.getCurrentLangDir()};if($captionsOverlayTarget.length==0){$captionsOverlayTarget=$('<div />').addClass('captionsOverlay').css(layoutCss).css('pointer-events','none');this.embedPlayer.getVideoHolder().append($captionsOverlayTarget);}$captionsOverlayTarget.append($textTarget);},addTextBelowVideo:function($textTarget){var $playerTarget=this.embedPlayer.getInterface();this.embedPlayer.controlBuilder.keepControlBarOnScreen=true;if(!
$playerTarget.find('.captionContainer').length||this.embedPlayer.useNativePlayerControls()){this.addBelowVideoCaptionContainer();}$playerTarget.find('.captionContainer').html($textTarget.css({'color':'white'}));},addBelowVideoCaptionContainer:function(){var _this=this;mw.log("TimedText:: addBelowVideoCaptionContainer");var $playerTarget=this.embedPlayer.getInterface();if($playerTarget.find('.captionContainer').length){return;}this.embedPlayer.getVideoHolder().after($('<div>').addClass('captionContainer block').css({'width':'100%','height':mw.config.get('TimedText.BelowVideoBlackBoxHeight')+'px','background-color':'#000','text-align':'center','padding-top':'5px'}));_this.embedPlayer.triggerHelper('updateLayout');},resizeInterface:function(){var _this=this;if(!_this.embedPlayer.controlBuilder){return;}if(!_this.embedPlayer.controlBuilder.inFullScreen&&_this.originalPlayerHeight){_this.embedPlayer.triggerHelper('resizeIframeContainer',[{'height':_this.originalPlayerHeight}]);}else{_this.
embedPlayer.triggerHelper('updateLayout');}},getCaptionCss:function(){return{};}};})(window.mediaWiki,window.jQuery);;},{"css":[".track span{color:white;letter-spacing:0.04em;text-align:center;padding:0.2em; background-color:#333}.track span a{text-decoration:none;color :#BBF}.track span a:visited{color :#BBF}\n/* cache key: enwiki:resourceloader:filter:minify-css:7:e409cfb4b15fbc99bfb4ec9173ac10fe */"]},{"mwe-timedtext-editor":"Timed text editor","mwe-timedtext-stage-transcribe":"Transcribe","mwe-timedtext-stage-sync":"Sync","mwe-timedtext-stage-translate":"Translate","mwe-timedtext-stage-upload":"Upload from local file","mwe-timedtext-select-language":"Select language","mwe-timedtext-file-language":"Subtitle file language","mwe-timedtext-back-btn":"Back","mwe-timedtext-choose-text":"Choose text","mwe-timedtext-upload-timed-text":"Add subtitles","mwe-timedtext-loading-text-edit":"Loading timed text editor","mwe-timedtext-search":"Search clip","mwe-timedtext-layout":"Layout",
"mwe-timedtext-layout-ontop":"On top of video","mwe-timedtext-layout-below":"Below video","mwe-timedtext-layout-off":"Hide subtitles","mwe-timedtext-loading-text":"Loading text ...","mwe-timedtext-key-language":"$1, $2","mwe-timedtext-textcat-cc":"Captions","mwe-timedtext-textcat-sub":"Subtitles","mwe-timedtext-textcat-tad":"Audio description","mwe-timedtext-textcat-ktv":"Karaoke","mwe-timedtext-textcat-tik":"Ticker text","mwe-timedtext-textcat-ar":"Active regions","mwe-timedtext-textcat-nb":"Annotation","mwe-timedtext-textcat-meta":"Timed metadata","mwe-timedtext-textcat-trx":"Transcript","mwe-timedtext-textcat-lrc":"Lyrics","mwe-timedtext-textcat-lin":"Linguistic markup","mwe-timedtext-textcat-cue":"Cue points","mwe-timedtext-language-subtitles-for-clip":"$1 subtitles for clip: $2","mwe-timedtext-language-no-subtitles-for-clip":"No $1 subtitles were found for clip: $2","mwe-timedtext-request-subs":"Request transcription","mwe-timedtext-no-subs":"No text tracks available",
"mwe-timedtext-request-subs-desc":"Add a request for this video file to be transcribed","mwe-timedtext-request-subs-done":"Transcription request added. [$1 See all transcribe requests]","mwe-timedtext-request-subs-fail":"Failed to add transcription request. Are you logged in?","mwe-timedtext-request-already-done":"A transcription of this video has already been requested. [$1 See all transcribe requests]"});mw.loader.implement("mw.ajaxProxy",function(){(function(mw,$){var ajaxProxy=function(options){if(!$.isFunction(options.success)){mw.log("mw.ajaxProxy :: Error: missing success callback.");return;}if(!options.url){mw.log("mw.ajaxProxy :: Error: missing url to proxy.");}var defaults={error:function(){},proxyUrl:mw.config.get('Mw.XmlProxyUrl'),proxyType:'jsonp',startWithProxy:false};this.options=$.extend({},defaults,options);this.ajax();};ajaxProxy.prototype={ajax:function(useProxy){var _this=this;if(_this.options.startWithProxy){_this.proxy();return;}var ajaxOptions={success:function(
result){_this.handleResult(result);}};if(useProxy){ajaxOptions.url=_this.options.proxyUrl+encodeURIComponent(_this.options.url);ajaxOptions.error=function(){mw.log("mw.ajaxProxy :: Error: request failed with proxy.");_this.options.error();};}else{ajaxOptions.url=_this.options.url;ajaxOptions.error=function(jqXHR,textStatus,errorThrown){mw.log("mw.ajaxProxy :: Error: cross domain request failed, trying with proxy");_this.proxy();};}try{$.ajax(ajaxOptions);}catch(e){}},proxy:function(){var _this=this;if(_this.options.proxyUrl){if(_this.options.proxyType=='jsonp'){$.ajax({url:_this.options.proxyUrl+'?url='+encodeURIComponent(_this.options.url)+'&callback=?',dataType:'json',success:function(result){_this.handleResult(result,true);},error:function(error){mw.log("mw.ajaxProxy :: Error: could not load:",error);_this.options.error();}});}else{_this.ajax(true);}}else{mw.log("mw.ajaxProxy :: Error: please setup proxy configuration");this.options.error();}},handleResult:function(result,isJsonP){
var _this=this;if(isJsonP){if(result['http_code']=='ERROR'||result['http_code']==0){mw.log("mw.ajaxProxy :: Error: load error with http response");_this.options.error();return;}try{var resultXML=$.parseXML(result['contents']);}catch(e){mw.log("mw.ajaxProxy :: Error: could not parse:",resultXML);_this.options.error();return;}_this.options.success(resultXML);}else{_this.options.success(result);}}};mw.ajaxProxy=ajaxProxy;})(window.mw,window.jQuery);;},{},{});
/* cache key: enwiki:resourceloader:filter:minify-js:7:7fef209bf6f7accdfa6d242bc1d94863 */