r+n.left){t=r+n.left}a=t-n.left;s=a/r;u=s<=.02?0:s*i.duration;if(p&&u!==i.currentTime){i.setCurrentTime(u)}if(!mejs.MediaFeatures.hasTouch){l.css("left",a);c.html(mejs.Utility.secondsToTimeCode(u));l.show()}}},p=false,d=false;o.bind("mousedown",function(e){if(e.which===1){p=true;h(e);s.globalBind("mousemove.dur",function(e){h(e)});s.globalBind("mouseup.dur",function(e){p=false;l.hide();s.globalUnbind(".dur")});return false}}).bind("mouseenter",function(e){d=true;s.globalBind("mousemove.dur",function(e){h(e)});if(!mejs.MediaFeatures.hasTouch){l.show()}}).bind("mouseleave",function(e){d=false;if(!p){s.globalUnbind(".dur");l.hide()}});i.addEventListener("progress",function(e){t.setProgressRail(e);t.setCurrentRail(e)},false);i.addEventListener("timeupdate",function(e){t.setProgressRail(e);t.setCurrentRail(e)},false);s.loaded=u;s.total=o;s.current=a;s.handle=f},setProgressRail:function(e){var t=this,n=e!=undefined?e.target:t.media,r=null;if(n&&n.buffered&&n.buffered.length>0&&n.buffered.end&&n.duration){r=n.buffered.end(0)/n.duration}else if(n&&n.bytesTotal!=undefined&&n.bytesTotal>0&&n.bufferedBytes!=undefined){r=n.bufferedBytes/n.bytesTotal}else if(e&&e.lengthComputable&&e.total!=0){r=e.loaded/e.total}if(r!==null){r=Math.min(1,Math.max(0,r));if(t.loaded&&t.total){t.loaded.width(t.total.width()*r)}}},setCurrentRail:function(){var e=this;if(e.media.currentTime!=undefined&&e.media.duration){if(e.total&&e.handle){var t=Math.round(e.total.width()*e.media.currentTime/e.media.duration),n=t-Math.round(e.handle.outerWidth(true)/2);e.current.width(t);e.handle.css("left",n)}}}})})(mejs.$);(function(e){e.extend(mejs.MepDefaults,{duration:-1,timeAndDurationSeparator:" | "});e.extend(MediaElementPlayer.prototype,{buildcurrent:function(t,n,r,i){var s=this;e(''+''+(t.options.alwaysShowHours?"00:":"")+(t.options.showTimecodeFrameCount?"00:00:00":"00:00")+""+"
").appendTo(n);s.currenttime=s.controls.find(".mejs-currenttime");i.addEventListener("timeupdate",function(){t.updateCurrent()},false)},buildduration:function(t,n,r,i){var s=this;if(s.controls.width()<260){return}if(n.children().last().find(".mejs-currenttime").length>0){e(s.options.timeAndDurationSeparator+''+(s.options.duration>0?mejs.Utility.secondsToTimeCode(s.options.duration,s.options.alwaysShowHours||s.media.duration>3600,s.options.showTimecodeFrameCount,s.options.framesPerSecond||25):(t.options.alwaysShowHours?"00:":"")+(t.options.showTimecodeFrameCount?"00:00:00":"00:00"))+"").appendTo(n.find(".mejs-time"))}else{n.find(".mejs-currenttime").parent().addClass("mejs-currenttime-container");e(''+''+(s.options.duration>0?mejs.Utility.secondsToTimeCode(s.options.duration,s.options.alwaysShowHours||s.media.duration>3600,s.options.showTimecodeFrameCount,s.options.framesPerSecond||25):(t.options.alwaysShowHours?"00:":"")+(t.options.showTimecodeFrameCount?"00:00:00":"00:00"))+""+"
").appendTo(n)}s.durationD=s.controls.find(".mejs-duration");i.addEventListener("timeupdate",function(){t.updateDuration()},false)},updateCurrent:function(){var e=this;if(e.currenttime){e.currenttime.html(mejs.Utility.secondsToTimeCode(e.media.currentTime,e.options.alwaysShowHours||e.media.duration>3600,e.options.showTimecodeFrameCount,e.options.framesPerSecond||25))}},updateDuration:function(){var e=this;e.container.toggleClass("mejs-long-video",e.media.duration>3600);if(e.durationD&&(e.options.duration>0||e.media.duration)){e.durationD.html(mejs.Utility.secondsToTimeCode(e.options.duration>0?e.options.duration:e.media.duration,e.options.alwaysShowHours,e.options.showTimecodeFrameCount,e.options.framesPerSecond||25))}}})})(mejs.$);(function(e){e.extend(mejs.MepDefaults,{muteText:"Mute Toggle",hideVolumeOnTouchDevices:true,audioVolume:"horizontal",videoVolume:"vertical"});e.extend(MediaElementPlayer.prototype,{buildvolume:function(t,n,r,i){if(mejs.MediaFeatures.hasTouch&&this.options.hideVolumeOnTouchDevices)return;var s=this;total=s.controls;var o=s.isVideo?s.options.videoVolume:s.options.audioVolume,u=o=="horizontal"?e(''+''+"
"+'").appendTo(n):e('").appendTo(n),a=s.container.find(".mejs-volume-slider, .mejs-horizontal-volume-slider"),f=s.container.find(".mejs-volume-total, .mejs-horizontal-volume-total"),l=s.container.find(".mejs-volume-current, .mejs-horizontal-volume-current"),c=s.container.find(".mejs-volume-handle, .mejs-horizontal-volume-handle"),h=function(e,t){if(!a.is(":visible")&&typeof t=="undefined"){a.show();h(e,true);a.hide();return}e=Math.max(0,e);e=Math.min(e,1);if(e==0){u.removeClass("mejs-mute").addClass("mejs-unmute")}else{u.removeClass("mejs-unmute").addClass("mejs-mute")}if(o=="vertical"){var n=f.height(),r=f.position(),i=n-n*e;c.css("top",Math.round(r.top+i-c.height()/2));l.height(n-i);l.css("top",r.top+i)}else{var s=f.width(),r=f.position(),p=s*e;c.css("left",Math.round(r.left+p-c.width()/2));l.width(Math.round(p))}},p=function(e){var t=null,n=f.offset();if(o=="vertical"){var r=f.height(),s=parseInt(f.css("top").replace(/px/,""),10),u=e.pageY-n.top;t=(r-u)/r;if(n.top==0||n.left==0)return}else{var a=f.width(),l=e.pageX-n.left;t=l/a}t=Math.max(0,t);t=Math.min(t,1);h(t);if(t==0){i.setMuted(true)}else{i.setMuted(false)}i.setVolume(t)},d=false,v=false;u.hover(function(){a.show();v=true},function(){v=false;if(!d&&o=="vertical"){a.hide()}});a.bind("mouseover",function(){v=true}).bind("mousedown",function(e){p(e);s.globalBind("mousemove.vol",function(e){p(e)});s.globalBind("mouseup.vol",function(){d=false;s.globalUnbind(".vol");if(!v&&o=="vertical"){a.hide()}});d=true;return false});u.find("button").click(function(){i.setMuted(!i.muted)});i.addEventListener("volumechange",function(e){if(!d){if(i.muted){h(0);u.removeClass("mejs-mute").addClass("mejs-unmute")}else{h(i.volume);u.removeClass("mejs-unmute").addClass("mejs-mute")}}},false);if(s.container.is(":visible")){h(t.options.startVolume);if(t.options.startVolume===0){i.setMuted(true)}if(i.pluginType==="native"){i.setVolume(t.options.startVolume)}}}})})(mejs.$);(function(e){e.extend(mejs.MepDefaults,{usePluginFullScreen:true,newWindowCallback:function(){return""},fullscreenText:mejs.i18n.t("Fullscreen")});e.extend(MediaElementPlayer.prototype,{isFullScreen:false,isNativeFullScreen:false,docStyleOverflow:null,isInIframe:false,buildfullscreen:function(t,n,r,i){if(!t.isVideo)return;t.isInIframe=window.location!=window.parent.location;if(mejs.MediaFeatures.hasTrueNativeFullScreen){var s=function(e){if(mejs.MediaFeatures.isFullScreen()){t.isNativeFullScreen=true;t.setControlsSize()}else{t.isNativeFullScreen=false;t.exitFullScreen()}};if(mejs.MediaFeatures.hasMozNativeFullScreen){t.globalBind(mejs.MediaFeatures.fullScreenEventName,s)}else{t.container.bind(mejs.MediaFeatures.fullScreenEventName,s)}}var o=this,u=0,a=0,f=t.container,l=e(''+''+"
").appendTo(n);if(o.media.pluginType==="native"||!o.options.usePluginFullScreen&&!mejs.MediaFeatures.isFirefox){l.click(function(){var e=mejs.MediaFeatures.hasTrueNativeFullScreen&&mejs.MediaFeatures.isFullScreen()||t.isFullScreen;if(e){t.exitFullScreen()}else{t.enterFullScreen()}})}else{var c=null,h=function(){var e=document.createElement("x"),t=document.documentElement,n=window.getComputedStyle,r;if(!("pointerEvents"in e.style)){return false}e.style.pointerEvents="auto";e.style.pointerEvents="x";t.appendChild(e);r=n&&n(e,"").pointerEvents==="auto";t.removeChild(e);return!!r}();if(h&&!mejs.MediaFeatures.isOpera){var p=false,d=function(){if(p){v.hide();m.hide();g.hide();l.css("pointer-events","");o.controls.css("pointer-events","");p=false}},v=e('').appendTo(o.container).mouseover(d),m=e('').appendTo(o.container).mouseover(d),g=e('').appendTo(o.container).mouseover(d),y=function(){var e={position:"absolute",top:0,left:0};v.css(e);m.css(e);g.css(e);v.width(o.container.width()).height(o.container.height()-o.controls.height());var t=l.offset().left-o.container.offset().left;fullScreenBtnWidth=l.outerWidth(true);m.width(t).height(o.controls.height()).css({top:o.container.height()-o.controls.height()});g.width(o.container.width()-t-fullScreenBtnWidth).height(o.controls.height()).css({top:o.container.height()-o.controls.height(),left:t+fullScreenBtnWidth})};o.globalBind("resize",function(){y()});l.mouseover(function(){if(!o.isFullScreen){var e=l.offset(),n=t.container.offset();i.positionFullscreenButton(e.left-n.left,e.top-n.top,false);l.css("pointer-events","none");o.controls.css("pointer-events","none");v.show();g.show();m.show();y();p=true}});i.addEventListener("fullscreenchange",function(e){d()})}else{l.mouseover(function(){if(c!==null){clearTimeout(c);delete c}var e=l.offset(),n=t.container.offset();i.positionFullscreenButton(e.left-n.left,e.top-n.top,true)}).mouseout(function(){if(c!==null){clearTimeout(c);delete c}c=setTimeout(function(){i.hideFullscreenButton()},1500)})}}t.fullscreenBtn=l;o.globalBind("keydown",function(e){if((mejs.MediaFeatures.hasTrueNativeFullScreen&&mejs.MediaFeatures.isFullScreen()||o.isFullScreen)&&e.keyCode==27){t.exitFullScreen()}})},cleanfullscreen:function(e){e.exitFullScreen()},enterFullScreen:function(){var t=this;if(t.media.pluginType!=="native"&&(mejs.MediaFeatures.isFirefox||t.options.usePluginFullScreen)){return}docStyleOverflow=document.documentElement.style.overflow;document.documentElement.style.overflow="hidden";normalHeight=t.container.height();normalWidth=t.container.width();if(t.media.pluginType==="native"){if(mejs.MediaFeatures.hasTrueNativeFullScreen){mejs.MediaFeatures.requestFullScreen(t.container[0]);if(t.isInIframe){setTimeout(function r(){if(t.isNativeFullScreen){if(e(window).width()!==screen.width){t.exitFullScreen()}else{setTimeout(r,500)}}},500)}}else if(mejs.MediaFeatures.hasSemiNativeFullScreen){t.media.webkitEnterFullscreen();return}}if(t.isInIframe){var n=t.options.newWindowCallback(this);if(n!==""){if(!mejs.MediaFeatures.hasTrueNativeFullScreen){t.pause();window.open(n,t.id,"top=0,left=0,width="+screen.availWidth+",height="+screen.availHeight+",resizable=yes,scrollbars=no,status=no,toolbar=no");return}else{setTimeout(function(){if(!t.isNativeFullScreen){t.pause();window.open(n,t.id,"top=0,left=0,width="+screen.availWidth+",height="+screen.availHeight+",resizable=yes,scrollbars=no,status=no,toolbar=no")}},250)}}}t.container.addClass("mejs-container-fullscreen").width("100%").height("100%");setTimeout(function(){t.container.css({width:"100%",height:"100%"});t.setControlsSize()},500);if(t.pluginType==="native"){t.$media.width("100%").height("100%")}else{t.container.find(".mejs-shim").width("100%").height("100%");t.media.setVideoSize(e(window).width(),e(window).height())}t.layers.children("div").width("100%").height("100%");if(t.fullscreenBtn){t.fullscreenBtn.removeClass("mejs-fullscreen").addClass("mejs-unfullscreen")}t.setControlsSize();t.isFullScreen=true},exitFullScreen:function(){var e=this;if(e.media.pluginType!=="native"&&mejs.MediaFeatures.isFirefox){e.media.setFullscreen(false);return}if(mejs.MediaFeatures.hasTrueNativeFullScreen&&(mejs.MediaFeatures.isFullScreen()||e.isFullScreen)){mejs.MediaFeatures.cancelFullScreen()}document.documentElement.style.overflow=docStyleOverflow;e.container.removeClass("mejs-container-fullscreen").width(normalWidth).height(normalHeight);if(e.pluginType==="native"){e.$media.width(normalWidth).height(normalHeight)}else{e.container.find("object embed").width(normalWidth).height(normalHeight);e.media.setVideoSize(normalWidth,normalHeight)}e.layers.children("div").width(normalWidth).height(normalHeight);e.fullscreenBtn.removeClass("mejs-unfullscreen").addClass("mejs-fullscreen");e.setControlsSize();e.isFullScreen=false}})})(mejs.$);(function(e){e.extend(mejs.MepDefaults,{startLanguage:"",tracksText:"Captions/Subtitles",hideCaptionsButtonWhenEmpty:true,toggleCaptionsButtonWhenOnlyOne:false,slidesSelector:""});e.extend(MediaElementPlayer.prototype,{hasChapters:false,buildtracks:function(t,n,r,i){if(!t.isVideo)return;if(t.tracks.length==0)return;var s=this,o,u="";t.chapters=e('').prependTo(r).hide();t.captions=e('').prependTo(r).hide();t.captionsText=t.captions.find(".mejs-captions-text");t.captionsButton=e('").appendTo(n);var a=0;for(o=0;o0){n.displayChapters(r)}},false)}if(r.kind=="slides"){n.setupSlides(r)}},error:function(){n.loadNextTrack()}})},enableTrackButton:function(t,n){var r=this;if(n===""){n=mejs.language.codes[t]||t}r.captionsButton.find("input[value="+t+"]").prop("disabled",false).siblings("label").html(n);if(r.options.startLanguage==t){e("#"+r.id+"_captions_"+t).click()}r.adjustLanguageBox()},addTrackButton:function(t,n){var r=this;if(n===""){n=mejs.language.codes[t]||t}r.captionsButton.find("ul").append(e(""+''+'"+""));r.adjustLanguageBox();r.container.find(".mejs-captions-translations option[value="+t+"]").remove()},adjustLanguageBox:function(){var e=this;e.captionsButton.find(".mejs-captions-selector").height(e.captionsButton.find(".mejs-captions-selector ul").outerHeight(true)+e.captionsButton.find(".mejs-captions-translations").outerHeight(true))},checkForTracks:function(){var e=this,t=false;if(e.options.hideCaptionsButtonWhenEmpty){for(i=0;i=n.entries.times[t].start&&e.media.currentTime<=n.entries.times[t].stop){e.captionsText.html(n.entries.text[t]);e.captions.show().height(0);return}}e.captions.hide()}else{e.captions.hide()}},setupSlides:function(e){var t=this;t.slides=e;t.slides.entries.imgs=[t.slides.entries.text.length];t.showSlide(0)},showSlide:function(t){if(typeof this.tracks=="undefined"||typeof this.slidesContainer=="undefined"){return}var n=this,r=n.slides.entries.text[t],i=n.slides.entries.imgs[t];if(typeof i=="undefined"||typeof i.fadeIn=="undefined"){n.slides.entries.imgs[t]=i=e('').on("load",function(){i.appendTo(n.slidesContainer).hide().fadeIn().siblings(":visible").fadeOut()})}else{if(!i.is(":visible")&&!i.is(":animated")){console.log("showing existing slide");i.fadeIn().siblings(":visible").fadeOut()}}},displaySlides:function(){if(typeof this.slides=="undefined")return;var e=this,t=e.slides,n;for(n=0;n=t.entries.times[n].start&&e.media.currentTime<=t.entries.times[n].stop){e.showSlide(n);return}}},displayChapters:function(){var e=this,t;for(t=0;t100||r==t.entries.times.length-1&&s+o<100){s=100-o}n.chapters.append(e(''+'
'+''+t.entries.text[r]+""+''+mejs.Utility.secondsToTimeCode(t.entries.times[r].start)+"–"+mejs.Utility.secondsToTimeCode(t.entries.times[r].stop)+""+"
"+"
"));o+=s}n.chapters.find("div.mejs-chapter").click(function(){n.media.setCurrentTime(parseFloat(e(this).attr("rel")));if(n.media.paused){n.media.play()}});n.chapters.show()}});mejs.language={codes:{af:"Afrikaans",sq:"Albanian",ar:"Arabic",be:"Belarusian",bg:"Bulgarian",ca:"Catalan",zh:"Chinese","zh-cn":"Chinese Simplified","zh-tw":"Chinese Traditional",hr:"Croatian",cs:"Czech",da:"Danish",nl:"Dutch",en:"English",et:"Estonian",tl:"Filipino",fi:"Finnish",fr:"French",gl:"Galician",de:"German",el:"Greek",ht:"Haitian Creole",iw:"Hebrew",hi:"Hindi",hu:"Hungarian",is:"Icelandic",id:"Indonesian",ga:"Irish",it:"Italian",ja:"Japanese",ko:"Korean",lv:"Latvian",lt:"Lithuanian",mk:"Macedonian",ms:"Malay",mt:"Maltese",no:"Norwegian",fa:"Persian",pl:"Polish",pt:"Portuguese",ro:"Romanian",ru:"Russian",sr:"Serbian",sk:"Slovak",sl:"Slovenian",es:"Spanish",sw:"Swahili",sv:"Swedish",tl:"Tagalog",th:"Thai",tr:"Turkish",uk:"Ukrainian",vi:"Vietnamese",cy:"Welsh",yi:"Yiddish"}};mejs.TrackFormatParser={webvvt:{pattern_identifier:/^([a-zA-z]+-)?[0-9]+$/,pattern_timecode:/^([0-9]{2}:[0-9]{2}:[0-9]{2}([,.][0-9]{1,3})?) --\> ([0-9]{2}:[0-9]{2}:[0-9]{2}([,.][0-9]{3})?)(.*)$/,parse:function(t){var n=0,r=mejs.TrackFormatParser.split2(t,/\r?\n/),i={text:[],times:[]},s,o;for(;n$1");i.text.push(o);i.times.push({start:mejs.Utility.convertSMPTEtoSeconds(s[1])==0?.2:mejs.Utility.convertSMPTEtoSeconds(s[1]),stop:mejs.Utility.convertSMPTEtoSeconds(s[3]),settings:s[5]})}}}return i}},dfxp:{parse:function(t){t=e(t).filter("tt");var n=0,r=t.children("div").eq(0),i=r.find("p"),s=t.find("#"+r.attr("style")),o,u,a,f,l={text:[],times:[]};if(s.length){var c=s.removeAttr("id").get(0).attributes;if(c.length){o={};for(n=0;n$1");l.text.push(f);if(l.times.start==0)l.times.start=2}return l}},split2:function(e,t){return e.split(t)}};if("x\n\ny".split(/\n/gi).length!=3){mejs.TrackFormatParser.split2=function(e,t){var n=[],r="",i;for(i=0;i