From fef45a792f05b4325de21d3f0c3f318535179d40 Mon Sep 17 00:00:00 2001 From: Rafael Miranda Date: Tue, 8 Nov 2016 15:38:23 -0500 Subject: [PATCH] Added fix for issue described in #1924 --- build/mediaelement-and-player.js | 5 ++++- build/mediaelement-and-player.min.js | 2 +- build/mediaelementplayer.js | 5 ++++- build/mediaelementplayer.min.js | 2 +- src/js/mediaelement-renderer-flv.js | 6 +++++- src/js/mediaelementplayer-player.js | 5 ++++- 6 files changed, 19 insertions(+), 6 deletions(-) diff --git a/build/mediaelement-and-player.js b/build/mediaelement-and-player.js index cb66bef14..bd68f01f5 100644 --- a/build/mediaelement-and-player.js +++ b/build/mediaelement-and-player.js @@ -7366,7 +7366,10 @@ if (jQuery !== undefined) { play: function () { var t = this; - t.load(); + // only load if the current time is 0 to ensure proper + if (t.media.getCurrentTime() <= 0) { + t.load(); + } t.media.play(); }, pause: function () { diff --git a/build/mediaelement-and-player.min.js b/build/mediaelement-and-player.min.js index ef505088f..f0709d005 100644 --- a/build/mediaelement-and-player.min.js +++ b/build/mediaelement-and-player.min.js @@ -36,6 +36,6 @@ function(a){"use strict";void 0===a.en&&(a.en={"mejs.plural-form":1,"mejs.downlo * License: MIT * */ -void 0!==jQuery?mejs.$=jQuery:void 0!==Zepto?(mejs.$=Zepto,Zepto.fn.outerWidth=function(a){var b=$(this).width();return a&&(b+=parseInt($(this).css("margin-right"),10),b+=parseInt($(this).css("margin-left"),10)),b}):void 0!==ender&&(mejs.$=ender),function(a,b,c,d,e){a.MepDefaults={poster:"",showPosterWhenEnded:!1,defaultVideoWidth:480,defaultVideoHeight:270,videoWidth:-1,videoHeight:-1,defaultAudioWidth:400,defaultAudioHeight:30,defaultSeekBackwardInterval:function(a){return.05*a.duration},defaultSeekForwardInterval:function(a){return.05*a.duration},setDimensions:!0,audioWidth:-1,audioHeight:-1,startVolume:.8,loop:!1,autoRewind:!0,enableAutosize:!0,timeFormat:"",alwaysShowHours:!1,showTimecodeFrameCount:!1,framesPerSecond:25,alwaysShowControls:!1,hideVideoControlsOnLoad:!1,clickToPlayPause:!0,controlsTimeoutDefault:1500,controlsTimeoutMouseEnter:2500,controlsTimeoutMouseLeave:1e3,iPadUseNativeControls:!1,iPhoneUseNativeControls:!1,AndroidUseNativeControls:!1,features:["playpause","current","progress","duration","tracks","volume","fullscreen"],isVideo:!0,stretching:"auto",enableKeyboard:!0,pauseOtherPlayers:!0,keyActions:[{keys:[32,179],action:function(b,c,d,e){a.MediaFeatures.isFirefox||(c.paused||c.ended?c.play():c.pause())}},{keys:[38],action:function(a,b,c,d){a.container.find(".mejs-volume-slider").css("display","block"),a.isVideo&&(a.showControls(),a.startControlsTimer());var e=Math.min(b.volume+.1,1);b.setVolume(e)}},{keys:[40],action:function(a,b,c,d){a.container.find(".mejs-volume-slider").css("display","block"),a.isVideo&&(a.showControls(),a.startControlsTimer());var e=Math.max(b.volume-.1,0);b.setVolume(e)}},{keys:[37,227],action:function(a,b,c,d){if(!isNaN(b.duration)&&b.duration>0){a.isVideo&&(a.showControls(),a.startControlsTimer());var e=Math.max(b.currentTime-a.options.defaultSeekBackwardInterval(b),0);b.setCurrentTime(e)}}},{keys:[39,228],action:function(a,b,c,d){if(!isNaN(b.duration)&&b.duration>0){a.isVideo&&(a.showControls(),a.startControlsTimer());var e=Math.min(b.currentTime+a.options.defaultSeekForwardInterval(b),b.duration);b.setCurrentTime(e)}}},{keys:[70],action:function(a,b,c,d){d.ctrlKey||"undefined"!=typeof a.enterFullScreen&&(a.isFullScreen?a.exitFullScreen():a.enterFullScreen())}},{keys:[77],action:function(a,b,c,d){a.container.find(".mejs-volume-slider").css("display","block"),a.isVideo&&(a.showControls(),a.startControlsTimer()),a.media.muted?a.setMuted(!1):a.setMuted(!0)}}]},a.mepIndex=0,a.players={},a.addEvent=function(a,b,c){a.addEventListener?a.addEventListener(b,c,!1):a.attachEvent&&(a["e"+b+c]=c,a[b+c]=function(){a["e"+b+c](window.event)},a.attachEvent("on"+b,a[b+c]))},a.removeEvent=function(a,b,c){a.removeEventListener?a.removeEventListener(b,c,!1):a.detachEvent&&(a.detachEvent("on"+b,a[b+c]),a[b+c]=null)},a.getElementsByClassName=function(a,b,c){if((b===e||null===b)&&(b=document),b.getElementsByClassName!==e&&null!==b.getElementsByClassName)return b.getElementsByClassName(a);(c===e||null===c)&&(c="*");var d,f=[],g=0,h=b.getElementsByTagName(c),j=h.length;for(i=0;i'+g+"").insertBefore(c.$media),c.container=b('
').addClass(c.$media[0].className).insertBefore(c.$media).focus(function(b){if(!c.controlsAreVisible&&!c.hasFocus&&c.controlsEnabled&&(c.showControls(!0),!c.hasMsNativeFullScreen)){var d=".mejs-playpause-button > button";a.Utility.isNodeAfter(b.relatedTarget,c.container[0])&&(d=".mejs-controls .mejs-button:last-child > button");var e=c.container.find(d);e.focus()}}),c.options.features.length||c.container.css("background","transparent").find(".mejs-controls").hide(),c.isVideo&&"fill"===c.options.stretching&&!c.container.parent("mejs-fill-container").length&&(c.outerContainer=c.$media.parent(),c.container.wrap('
')),c.container.addClass((d.isAndroid?"mejs-android ":"")+(d.isiOS?"mejs-ios ":"")+(d.isiPad?"mejs-ipad ":"")+(d.isiPhone?"mejs-iphone ":"")+(c.isVideo?"mejs-video ":"mejs-audio ")),c.container.find(".mejs-mediaelement").append(c.$media),c.node.player=c,c.controls=c.container.find(".mejs-controls"),c.layers=c.container.find(".mejs-layers");var h=c.isVideo?"video":"audio",i=h.substring(0,1).toUpperCase()+h.substring(1);c.options[h+"Width"]>0||c.options[h+"Width"].toString().indexOf("%")>-1?c.width=c.options[h+"Width"]:""!==c.media.style.width&&null!==c.media.style.width?c.width=c.media.style.width:null!==c.media.getAttribute("width")?c.width=c.$media.attr("width"):c.width=c.options["default"+i+"Width"],c.options[h+"Height"]>0||c.options[h+"Height"].toString().indexOf("%")>-1?c.height=c.options[h+"Height"]:""!==c.media.style.height&&null!==c.media.style.height?c.height=c.media.style.height:null!==c.$media[0].getAttribute("height")?c.height=c.$media.attr("height"):c.height=c.options["default"+i+"Height"],c.initialAspectRatio=c.height>c.width?c.width/c.height:c.height/c.width,c.setPlayerSize(c.width,c.height),e.pluginWidth=c.width,e.pluginHeight=c.height}else c.isVideo||c.options.features.length||c.$media.hide();a.MediaElement(c.$media[0],e),"undefined"!=typeof c.container&&c.options.features.length&&c.controlsAreVisible&&c.container.trigger("controlsshown")},showControls:function(a){var b=this;a=a===e||a,b.controlsAreVisible||(a?(b.controls.removeClass("mejs-offscreen").stop(!0,!0).fadeIn(200,function(){b.controlsAreVisible=!0,b.container.trigger("controlsshown")}),b.container.find(".mejs-control").removeClass("mejs-offscreen").stop(!0,!0).fadeIn(200,function(){b.controlsAreVisible=!0})):(b.controls.removeClass("mejs-offscreen").css("display","block"),b.container.find(".mejs-control").removeClass("mejs-offscreen").css("display","block"),b.controlsAreVisible=!0,b.container.trigger("controlsshown")),b.setControlsSize())},hideControls:function(a){var c=this;a=a===e||a,!c.controlsAreVisible||c.options.alwaysShowControls||c.keyboardAction||c.media.paused||c.media.ended||(a?(c.controls.stop(!0,!0).fadeOut(200,function(){b(this).addClass("mejs-offscreen").css("display","block"),c.controlsAreVisible=!1,c.container.trigger("controlshidden")}),c.container.find(".mejs-control").stop(!0,!0).fadeOut(200,function(){b(this).addClass("mejs-offscreen").css("display","block")})):(c.controls.addClass("mejs-offscreen").css("display","block"),c.container.find(".mejs-control").addClass("mejs-offscreen").css("display","block"),c.controlsAreVisible=!1,c.container.trigger("controlshidden")))},controlsTimer:null,startControlsTimer:function(a){var b=this;a="undefined"!=typeof a?a:b.options.controlsTimeoutDefault,b.killControlsTimer("start"),b.controlsTimer=setTimeout(function(){b.hideControls(),b.killControlsTimer("hide")},a)},killControlsTimer:function(a){var b=this;null!==b.controlsTimer&&(clearTimeout(b.controlsTimer),delete b.controlsTimer,b.controlsTimer=null)},controlsEnabled:!0,disableControls:function(){var a=this;a.killControlsTimer(),a.hideControls(!1),this.controlsEnabled=!1},enableControls:function(){var a=this;a.showControls(!1),a.controlsEnabled=!0},meReady:function(c,d){var f,g,h=this,i=a.MediaFeatures,j=d.getAttribute("autoplay"),k=!(j===e||null===j||"false"===j),l=null!==c.rendererName&&c.rendererName.match(/(native|html5)/);if(!h.created){if(h.created=!0,h.media=c,h.domNode=d,!(i.isAndroid&&h.options.AndroidUseNativeControls||i.isiPad&&h.options.iPadUseNativeControls||i.isiPhone&&h.options.iPhoneUseNativeControls)){if(!h.isVideo&&!h.options.features.length)return k&&l&&h.play(),void(h.options.success&&("string"==typeof h.options.success?window[h.options.success](h.media,h.domNode,h):h.options.success(h.media,h.domNode,h)));h.buildposter(h,h.controls,h.layers,h.media),h.buildkeyboard(h,h.controls,h.layers,h.media),h.buildoverlays(h,h.controls,h.layers,h.media),h.findTracks();for(f in h.options.features)if(g=h.options.features[f],h["build"+g])try{h["build"+g](h,h.controls,h.layers,h.media)}catch(m){}h.container.trigger("controlsready"),h.setPlayerSize(h.width,h.height),h.setControlsSize(),h.isVideo&&(a.MediaFeatures.hasTouch&&!h.options.alwaysShowControls?h.$media.bind("touchstart",function(){h.controlsAreVisible?h.hideControls(!1):h.controlsEnabled&&h.showControls(!1)}):(h.clickToPlayPauseCallback=function(){if(h.options.clickToPlayPause){var a=h.$media.closest(".mejs-container").find(".mejs-overlay-button"),b=a.attr("aria-pressed");h.media.paused&&b?h.pause():h.media.paused?h.play():h.pause(),a.attr("aria-pressed",!b)}},h.media.addEventListener("click",h.clickToPlayPauseCallback,!1),h.container.bind("mouseenter",function(){h.controlsEnabled&&(h.options.alwaysShowControls||(h.killControlsTimer("enter"),h.showControls(),h.startControlsTimer(h.options.controlsTimeoutMouseEnter)))}).bind("mousemove",function(){h.controlsEnabled&&(h.controlsAreVisible||h.showControls(),h.options.alwaysShowControls||h.startControlsTimer(h.options.controlsTimeoutMouseEnter))}).bind("mouseleave",function(){h.controlsEnabled&&(h.media.paused||h.options.alwaysShowControls||h.startControlsTimer(h.options.controlsTimeoutMouseLeave))})),h.options.hideVideoControlsOnLoad&&h.hideControls(!1),k&&!h.options.alwaysShowControls&&h.hideControls(),h.options.enableAutosize&&h.media.addEventListener("loadedmetadata",function(a){h.options.videoHeight<=0&&!h.domNode.getAttribute("height")&&!isNaN(a.target.videoHeight)&&(h.setPlayerSize(a.target.videoWidth,a.target.videoHeight),h.setControlsSize(),h.media.setSize(a.target.videoWidth,a.target.videoHeight))},!1)),h.media.addEventListener("play",function(){var b;h.hasFocus=!0;for(b in a.players){var c=a.players[b];c.id===h.id||!h.options.pauseOtherPlayers||c.paused||c.ended||(c.pause(),c.hasFocus=!1)}},!1),h.media.addEventListener("ended",function(a){if(h.options.autoRewind)try{h.media.setCurrentTime(0),window.setTimeout(function(){b(h.container).find(".mejs-overlay-loading").parent().hide()},20)}catch(c){}"function"==typeof h.media.stop?h.media.stop():h.media.pause(),h.setProgressRail&&h.setProgressRail(),h.setCurrentRail&&h.setCurrentRail(),h.options.loop?h.play():!h.options.alwaysShowControls&&h.controlsEnabled&&h.showControls()},!1),h.media.addEventListener("loadedmetadata",function(){a.Utility.calculateTimeFormat(h.duration,h.options,h.options.framesPerSecond||25),h.updateDuration&&h.updateDuration(),h.updateCurrent&&h.updateCurrent(),h.isFullScreen||(h.setPlayerSize(h.width,h.height),h.setControlsSize())},!1);var n=null;h.media.addEventListener("timeupdate",function(){n!==this.duration&&(n=this.duration,a.Utility.calculateTimeFormat(n,h.options,h.options.framesPerSecond||25),h.updateDuration&&h.updateDuration(),h.updateCurrent&&h.updateCurrent(),h.setControlsSize())},!1),h.container.focusout(function(a){if(a.relatedTarget){var c=b(a.relatedTarget);h.keyboardAction&&0===c.parents(".mejs-container").length&&(h.keyboardAction=!1,h.isVideo&&!h.options.alwaysShowControls&&h.hideControls(!0))}}),setTimeout(function(){h.setPlayerSize(h.width,h.height),h.setControlsSize()},50),h.globalBind("resize",function(){h.isFullScreen||a.MediaFeatures.hasTrueNativeFullScreen&&document.webkitIsFullScreen||h.setPlayerSize(h.width,h.height),h.setControlsSize()}),null!==h.media.rendererName&&h.media.rendererName.match(/youtube/)&&(i.isiOS||i.isAndroid)&&(h.container.find(".mejs-overlay-play").hide(),h.container.find(".mejs-poster").hide())}k&&l&&h.play(),h.options.success&&("string"==typeof h.options.success?window[h.options.success](h.media,h.domNode,h):h.options.success(h.media,h.domNode,h))}},handleError:function(a){var b=this;b.controls&&b.disableControls(),b.options.error&&b.options.error(a)},setPlayerSize:function(a,c){var d=this;if(!d.options.setDimensions)return!1;if("undefined"!=typeof a&&(d.width=a),"undefined"!=typeof c&&(d.height=c),"undefined"!=typeof FB&&d.isVideo){FB.Event.subscribe("xfbml.ready",function(){var a=b(d.media).children(".fb-video");return d.width=a.width(),d.height=a.height(),d.setDimensions(d.width,d.height),!1});var e=b(d.media).children(".fb-video");e.length&&(d.width=e.width(),d.height=e.height())}switch(d.options.stretching){case"fill":d.isVideo?d.setFillMode():d.setDimensions(d.width,d.height);break;case"responsive":d.setResponsiveMode();break;case"none":d.setDimensions(d.width,d.height);break;default:d.hasFluidMode()===!0?d.setResponsiveMode():d.setDimensions(d.width,d.height)}},hasFluidMode:function(){var a=this;return a.height.toString().indexOf("%")>-1||"none"!==a.$node.css("max-width")&&a.$node.css("max-width")!==a.width||a.$node[0].currentStyle&&"100%"===a.$node[0].currentStyle.maxWidth},setResponsiveMode:function(){var a,d=this,e=(function(){return d.isVideo?d.media.videoWidth&&d.media.videoWidth>0?d.media.videoWidth:null!==d.media.getAttribute("width")?d.media.getAttribute("width"):d.options.defaultVideoWidth:d.options.defaultAudioWidth}(),function(){return d.isVideo?d.media.videoHeight&&d.media.videoHeight>0?d.media.videoHeight:null!==d.media.getAttribute("height")?d.media.getAttribute("height"):d.options.defaultVideoHeight:d.options.defaultAudioHeight}()),f=function(){return ratio=1,d.isVideo?(d.media.videoWidth&&d.media.videoWidth>0&&d.media.videoHeight&&d.media.videoHeight>0?ratio=d.height>=d.width?d.media.videoWidth/d.media.videoHeight:d.media.videoHeight/d.media.videoWidth:ratio=d.initialAspectRatio,(isNaN(ratio)||ratio<.01||ratio>100)&&(ratio=1),ratio):ratio}(),g=d.container.parent().closest(":visible").width(),h=d.container.parent().closest(":visible").height();a=d.isVideo?d.height>=d.width?parseInt(g/f,10):parseInt(g*f,10):e,isNaN(a)&&(a=h),d.container.parent().length>0&&"body"===d.container.parent()[0].tagName.toLowerCase()&&(g=b(c).width(),a=b(c).height()),a&&g&&(d.container.width(g).height(a),d.$media.width("100%").height("100%"),d.isVideo&&d.media.setSize&&d.media.setSize(g,a),d.layers.children(".mejs-layer").width("100%").height("100%"))},setFillMode:function(){var a=this,b=a.outerContainer;"none"!==a.$node.css("height")&&a.$node.css("height")!==a.height&&a.$node.css("height",""),"none"!==a.$node.css("max-width")&&a.$node.css("max-width")!==a.width&&a.$node.css("max-width",""),"none"!==a.$node.css("max-height")&&a.$node.css("max-height")!==a.height&&a.$node.css("max-height",""),a.$node[0].currentStyle&&("100%"===a.$node[0].currentStyle.height&&(a.$node[0].currentStyle.height=""),"100%"===a.$node[0].currentStyle.maxWidth&&(a.$node[0].currentStyle.maxWidth=""),"100%"===a.$node[0].currentStyle.maxHeight&&(a.$node[0].currentStyle.maxHeight="")),b.width()||b.height(a.$media.width()),b.height()||b.height(a.$media.height());var c=b.width(),d=b.height();a.setDimensions("100%","100%"),a.container.find(".mejs-poster img").css("display","block"),targetElement=a.container.find("object, embed, iframe, video");var e=a.height,f=a.width,g=c,h=e*c/f,i=f*d/e,j=d,k=i>c==!1,l=k?Math.floor(g):Math.floor(i),m=k?Math.floor(h):Math.floor(j);k?(targetElement.height(m).width(c),a.media.setSize&&a.media.setSize(c,m)):(targetElement.height(d).width(l),a.media.setSize&&a.media.setSize(l,d)),targetElement.css({"margin-left":Math.floor((c-l)/2),"margin-top":0})},setDimensions:function(a,b){var c=this;c.container.width(a).height(b),c.layers.children(".mejs-layer").width(a).height(b)},setControlsSize:function(){var a=this,c=a.controls.find(".mejs-time-rail");if(a.container.is(":visible")&&c.length&&c.is(":visible")){var d=a.controls.children(),e=parseFloat(d.children(".mejs-time-total").css("margin-left")),f=0;c.siblings().each(function(){f+=b(this).outerWidth(!0)}),f+=2*e,c.width("100%").width("-="+f),a.container.trigger("controlsresize")}},buildposter:function(a,c,d,e){var f=this,g=b('
').appendTo(d),h=a.$media.attr("poster");""!==a.options.poster&&(h=a.options.poster),h?f.setPoster(h):g.hide(),e.addEventListener("play",function(){g.hide()},!1),a.options.showPosterWhenEnded&&a.options.autoRewind&&e.addEventListener("ended",function(){g.show()},!1)},setPoster:function(a){var c=this,d=c.container.find(".mejs-poster"),e=d.find("img");0===e.length&&(e=b('').appendTo(d)),e.attr("src",a),d.css({"background-image":"url("+a+")"})},buildoverlays:function(c,d,e,f){var g=this;if(c.isVideo){var h=b('
').hide().appendTo(e),i=b('
').hide().appendTo(e),j=b('
').appendTo(e).bind("click",function(){if(g.options.clickToPlayPause){var a=g.$media.closest(".mejs-container").find(".mejs-overlay-button"),b=a.attr("aria-pressed");f.paused?f.play():f.pause(),a.attr("aria-pressed",!!b)}});(a.Features.isiPhone||null!==g.media.rendererName&&g.media.rendererName.match(/(youtube|facebook)/))&&j.hide(),f.addEventListener("play",function(){j.hide(),h.hide(),d.find(".mejs-time-buffering").hide(),i.hide()},!1),f.addEventListener("playing",function(){j.hide(),h.hide(),d.find(".mejs-time-buffering").hide(),i.hide()},!1),f.addEventListener("seeking",function(){h.show(),d.find(".mejs-time-buffering").show()},!1),f.addEventListener("seeked",function(){h.hide(),d.find(".mejs-time-buffering").hide()},!1),f.addEventListener("pause",function(){a.MediaFeatures.isiPhone||j.show()},!1),f.addEventListener("waiting",function(){h.show(),d.find(".mejs-time-buffering").show()},!1),f.addEventListener("loadeddata",function(){h.show(),d.find(".mejs-time-buffering").show(),a.MediaFeatures.isAndroid&&(f.canplayTimeout=window.setTimeout(function(){if(document.createEvent){var a=document.createEvent("HTMLEvents");return a.initEvent("canplay",!0,!0),f.dispatchEvent(a)}},300))},!1),f.addEventListener("canplay",function(){h.hide(),d.find(".mejs-time-buffering").hide(),clearTimeout(f.canplayTimeout)},!1),f.addEventListener("error",function(a){g.handleError(a),h.hide(),j.hide(),i.show(),i.find(".mejs-overlay-error").html("Error loading this resource")},!1),f.addEventListener("keydown",function(a){g.onkeydown(c,f,a)},!1)}},buildkeyboard:function(a,c,d,e){var f=this;f.container.keydown(function(){f.keyboardAction=!0}),f.globalBind("keydown",function(c){return a.hasFocus=0!==b(c.target).closest(".mejs-container").length&&b(c.target).closest(".mejs-container").attr("id")===a.$media.closest(".mejs-container").attr("id"),f.onkeydown(a,e,c)}),f.globalBind("click",function(c){a.hasFocus=0!==b(c.target).closest(".mejs-container").length})},onkeydown:function(a,b,c){if(a.hasFocus&&a.options.enableKeyboard)for(var d=0,e=a.options.keyActions.length;e>d;d++)for(var f=a.options.keyActions[d],g=0,h=f.keys.length;h>g;g++)if(c.keyCode===f.keys[g])return"function"==typeof c.preventDefault&&c.preventDefault(),f.action(a,b,c.keyCode,c),!1;return!0},findTracks:function(){var a=this,c=a.$media.find("track");a.tracks=[],c.each(function(c,d){d=b(d),a.tracks.push({srclang:d.attr("srclang")?d.attr("srclang").toLowerCase():"",src:d.attr("src"),kind:d.attr("kind"),label:d.attr("label")||"",entries:[],isLoaded:!1})})},changeSkin:function(a){var b=this;b.container[0].className="mejs-container "+a,b.setPlayerSize(b.width,b.height),b.setControlsSize()},play:function(){var a=this;a.load(),a.media.play()},pause:function(){try{this.media.pause()}catch(a){}},load:function(){var a=this;a.isLoaded||a.media.load(),a.isLoaded=!0},setMuted:function(a){this.media.setMuted(a)},setCurrentTime:function(a){this.media.setCurrentTime(a)},getCurrentTime:function(){return this.media.currentTime},setVolume:function(a){this.media.setVolume(a)},getVolume:function(){return this.media.volume},setSrc:function(a){this.media.setSrc(a)},remove:function(){var b,c,d=this;d.container.prev(".mejs-offscreen").remove();for(b in d.options.features)if(c=d.options.features[b],d["clean"+c])try{d["clean"+c](d)}catch(e){}d.isDynamic?d.$node.insertBefore(d.container):(d.$media.prop("controls",!0),d.$node.clone().insertBefore(d.container).show(),d.$node.remove());var f=null!==d.media.rendererName&&d.media.rendererName.match(/(native|html5)/);f||d.media.remove(),delete a.players[d.id],"object"==typeof d.container&&d.container.remove(),d.globalUnbind(),delete d.node.player},rebuildtracks:function(){var a=this;a.findTracks(),a.buildtracks(a,a.controls,a.layers,a.media)},resetSize:function(){var a=this;setTimeout(function(){a.setPlayerSize(a.width,a.height),a.setControlsSize()},50)}},function(){function c(a,c){var e={d:[],w:[]};return b.each((a||"").split(" "),function(a,b){var f=b+"."+c;0===f.indexOf(".")?(e.d.push(f),e.w.push(f)):e[d.test(b)?"w":"d"].push(f)}),e.d=e.d.join(" "),e.w=e.w.join(" "),e}var d=/^((after|before)print|(before)?unload|hashchange|message|o(ff|n)line|page(hide|show)|popstate|resize|storage)\b/;a.MediaElementPlayer.prototype.globalBind=function(a,d,e){var f=this,g=f.node?f.node.ownerDocument:document;a=c(a,f.id),a.d&&b(g).bind(a.d,d,e),a.w&&b(window).bind(a.w,d,e)},a.MediaElementPlayer.prototype.globalUnbind=function(a,d){var e=this,f=e.node?e.node.ownerDocument:document;a=c(a,e.id),a.d&&b(f).unbind(a.d,d),a.w&&b(window).unbind(a.w,d)}}(),"undefined"!=typeof b&&(b.fn.mediaelementplayer=function(c){return c===!1?this.each(function(){var a=b(this).data("mediaelementplayer");a&&a.remove(),b(this).removeData("mediaelementplayer")}):this.each(function(){b(this).data("mediaelementplayer",new a.MediaElementPlayer(this,c))}),this},b(document).ready(function(){b(".mejs-player").mediaelementplayer()})),window.MediaElementPlayer=a.MediaElementPlayer}(mejs,mejs.$,window,document),function(a){a.extend(mejs.MepDefaults,{playText:"",pauseText:""}),a.extend(MediaElementPlayer.prototype,{buildplaypause:function(b,c,d,e){function f(a){"play"===a?(k.removeClass("mejs-play").addClass("mejs-pause"),l.attr({title:j,"aria-label":j})):(k.removeClass("mejs-pause").addClass("mejs-play"),l.attr({title:i,"aria-label":i}))}var g=this,h=g.options,i=h.playText?h.playText:mejs.i18n.t("mejs.play"),j=h.pauseText?h.pauseText:mejs.i18n.t("mejs.pause"),k=a('
').appendTo(c).click(function(a){return a.preventDefault(),e.paused?e.play():e.pause(),!1}),l=k.find("button");f("pse"),e.addEventListener("play",function(){f("play")},!1),e.addEventListener("playing",function(){f("play")},!1),e.addEventListener("pause",function(){f("pse")},!1),e.addEventListener("paused",function(){f("pse")},!1)}})}(mejs.$),function(a){a.extend(mejs.MepDefaults,{stopText:""}),a.extend(MediaElementPlayer.prototype,{buildstop:function(b,c,d,e){var f=this,g=f.options.stopText?f.options.stopText:mejs.i18n.t("mejs.stop");a('
').appendTo(c).click(function(){e.paused||e.pause(),e.currentTime>0&&(e.setCurrentTime(0),e.pause(),c.find(".mejs-time-current").width("0px"),c.find(".mejs-time-handle").css("left","0px"),c.find(".mejs-time-float-current").html(mejs.Utility.secondsToTimeCode(0,b.options.alwaysShowHours)),c.find(".mejs-currenttime").html(mejs.Utility.secondsToTimeCode(0,b.options.alwaysShowHours)),d.find(".mejs-poster").show())})}})}(mejs.$),function(a){a.extend(mejs.MepDefaults,{enableProgressTooltip:!0,progressHelpText:""}),a.extend(MediaElementPlayer.prototype,{buildprogress:function(b,c,d,e){var f=this,g=!1,h=!1,i=0,j=!1,k=b.options.autoRewind,l=(f.options.progressHelpText?f.options.progressHelpText:mejs.i18n.t("mejs.time-help-text"),b.options.enableProgressTooltip?'00:00':"");a('
'+l+"
").appendTo(c),c.find(".mejs-time-buffering").hide(),f.total=c.find(".mejs-time-total"),f.loaded=c.find(".mejs-time-loaded"),f.current=c.find(".mejs-time-current"),f.handle=c.find(".mejs-time-handle"),f.timefloat=c.find(".mejs-time-float"),f.timefloatcurrent=c.find(".mejs-time-float-current"),f.slider=c.find(".mejs-time-slider");var m=function(a){var c,d=f.total.offset(),h=f.total.width(),i=0,j=0,k=0;c=a.originalEvent&&a.originalEvent.changedTouches?a.originalEvent.changedTouches[0].pageX:a.changedTouches?a.changedTouches[0].pageX:a.pageX,e.duration&&(ch+d.left&&(c=h+d.left),k=c-d.left,i=k/h,j=.02>=i?0:i*e.duration,g&&j.toFixed(4)!==e.currentTime.toFixed(4)&&e.setCurrentTime(j),mejs.MediaFeatures.hasTouch||(f.timefloat.css("left",k),f.timefloatcurrent.html(mejs.Utility.secondsToTimeCode(j,b.options.alwaysShowHours)),f.timefloat.show()))},n=function(){var a=e.currentTime,c=mejs.i18n.t("mejs.time-slider"),d=mejs.Utility.secondsToTimeCode(a,b.options.alwaysShowHours),g=e.duration;f.slider.attr({role:"slider",tabindex:0}),e.paused?f.slider.attr({"aria-label":c,"aria-valuemin":0,"aria-valuemax":g,"aria-valuenow":a,"aria-valuetext":d}):f.slider.removeAttr("aria-label aria-valuemin aria-valuemax aria-valuenow aria-valuetext")},o=function(){var a=new Date;a-i>=1e3&&e.play()};f.slider.bind("focus",function(a){b.options.autoRewind=!1}),f.slider.bind("blur",function(a){b.options.autoRewind=k}),f.slider.bind("keydown",function(a){if(new Date-i>=1e3&&(j=e.paused),f.options.keyActions.length){var c=a.keyCode,d=e.duration,g=e.currentTime,h=b.options.defaultSeekForwardInterval(e),k=b.options.defaultSeekBackwardInterval(e);switch(c){case 37:case 40:g-=k;break;case 39:case 38:g+=h;break;case 36:g=0;break;case 35:g=d;break;case 32:return void(mejs.Utility.isFirefox||(e.paused?e.play():e.pause()));case 13:return void(e.paused?e.play():e.pause());default:return}g=0>g?0:g>=d?d:Math.floor(g),i=new Date,j||e.pause(),g0&&c.buffered.end&&c.duration?d=c.buffered.end(c.buffered.length-1)/c.duration:c&&void 0!==c.bytesTotal&&c.bytesTotal>0&&void 0!==c.bufferedBytes?d=c.bufferedBytes/c.bytesTotal:a&&a.lengthComputable&&0!==a.total&&(d=a.loaded/a.total),null!==d&&(d=Math.min(1,Math.max(0,d)),b.loaded&&b.total&&b.loaded.width(100*d+"%"))},setCurrentRail:function(){var a=this;if(void 0!==a.media.currentTime&&a.media.duration&&a.total&&a.handle){var b=Math.round(a.total.width()*a.media.currentTime/a.media.duration),c=b-Math.round(a.handle.outerWidth(!0)/2);b=a.media.currentTime/a.media.duration*100,a.current.width(b+"%"),a.handle.css("left",c)}}})}(mejs.$),function(a){a.extend(mejs.MepDefaults,{duration:0,timeAndDurationSeparator:" | "}),a.extend(MediaElementPlayer.prototype,{buildcurrent:function(b,c,d,e){var f=this;a('
'+mejs.Utility.secondsToTimeCode(0,b.options.alwaysShowHours)+"
").appendTo(c),f.currenttime=f.controls.find(".mejs-currenttime"),e.addEventListener("timeupdate",function(){f.controlsAreVisible&&b.updateCurrent()},!1)},buildduration:function(b,c,d,e){var f=this;c.children().last().find(".mejs-currenttime").length>0?a(f.options.timeAndDurationSeparator+''+mejs.Utility.secondsToTimeCode(f.options.duration,f.options.alwaysShowHours)+"").appendTo(c.find(".mejs-time")):(c.find(".mejs-currenttime").parent().addClass("mejs-currenttime-container"),a('
'+mejs.Utility.secondsToTimeCode(f.options.duration,f.options.alwaysShowHours)+"
").appendTo(c)),f.durationD=f.controls.find(".mejs-duration"),e.addEventListener("timeupdate",function(){f.controlsAreVisible&&b.updateDuration()},!1)},updateCurrent:function(){var a=this,b=a.media.currentTime;isNaN(b)&&(b=0),a.currenttime&&a.currenttime.html(mejs.Utility.secondsToTimeCode(b,a.options.alwaysShowHours))},updateDuration:function(){var a=this,b=a.media.duration;(isNaN(b)||b==1/0||0>b)&&(a.media.duration=a.options.duration=b=0),a.options.duration>0&&(b=a.options.duration),a.container.toggleClass("mejs-long-video",b>3600),a.durationD&&b>0&&a.durationD.html(mejs.Utility.secondsToTimeCode(b,a.options.alwaysShowHours))}})}(mejs.$),function(a){a.extend(mejs.MepDefaults,{muteText:mejs.i18n.t("mejs.mute-toggle"),allyVolumeControlText:mejs.i18n.t("mejs.volume-help-text"),hideVolumeOnTouchDevices:!0,audioVolume:"horizontal",videoVolume:"vertical"}),a.extend(MediaElementPlayer.prototype,{buildvolume:function(b,c,d,e){if(!mejs.MediaFeatures.isAndroid&&!mejs.MediaFeatures.isiOS||!this.options.hideVolumeOnTouchDevices){var f=this,g=f.isVideo?f.options.videoVolume:f.options.audioVolume,h="horizontal"===g?a('
'+f.options.allyVolumeControlText+'
').appendTo(c):a('').appendTo(c),i=f.container.find(".mejs-volume-slider, .mejs-horizontal-volume-slider"),j=f.container.find(".mejs-volume-total, .mejs-horizontal-volume-total"),k=f.container.find(".mejs-volume-current, .mejs-horizontal-volume-current"),l=f.container.find(".mejs-volume-handle, .mejs-horizontal-volume-handle"),m=function(a,b){ +void 0!==jQuery?mejs.$=jQuery:void 0!==Zepto?(mejs.$=Zepto,Zepto.fn.outerWidth=function(a){var b=$(this).width();return a&&(b+=parseInt($(this).css("margin-right"),10),b+=parseInt($(this).css("margin-left"),10)),b}):void 0!==ender&&(mejs.$=ender),function(a,b,c,d,e){a.MepDefaults={poster:"",showPosterWhenEnded:!1,defaultVideoWidth:480,defaultVideoHeight:270,videoWidth:-1,videoHeight:-1,defaultAudioWidth:400,defaultAudioHeight:30,defaultSeekBackwardInterval:function(a){return.05*a.duration},defaultSeekForwardInterval:function(a){return.05*a.duration},setDimensions:!0,audioWidth:-1,audioHeight:-1,startVolume:.8,loop:!1,autoRewind:!0,enableAutosize:!0,timeFormat:"",alwaysShowHours:!1,showTimecodeFrameCount:!1,framesPerSecond:25,alwaysShowControls:!1,hideVideoControlsOnLoad:!1,clickToPlayPause:!0,controlsTimeoutDefault:1500,controlsTimeoutMouseEnter:2500,controlsTimeoutMouseLeave:1e3,iPadUseNativeControls:!1,iPhoneUseNativeControls:!1,AndroidUseNativeControls:!1,features:["playpause","current","progress","duration","tracks","volume","fullscreen"],isVideo:!0,stretching:"auto",enableKeyboard:!0,pauseOtherPlayers:!0,keyActions:[{keys:[32,179],action:function(b,c,d,e){a.MediaFeatures.isFirefox||(c.paused||c.ended?c.play():c.pause())}},{keys:[38],action:function(a,b,c,d){a.container.find(".mejs-volume-slider").css("display","block"),a.isVideo&&(a.showControls(),a.startControlsTimer());var e=Math.min(b.volume+.1,1);b.setVolume(e)}},{keys:[40],action:function(a,b,c,d){a.container.find(".mejs-volume-slider").css("display","block"),a.isVideo&&(a.showControls(),a.startControlsTimer());var e=Math.max(b.volume-.1,0);b.setVolume(e)}},{keys:[37,227],action:function(a,b,c,d){if(!isNaN(b.duration)&&b.duration>0){a.isVideo&&(a.showControls(),a.startControlsTimer());var e=Math.max(b.currentTime-a.options.defaultSeekBackwardInterval(b),0);b.setCurrentTime(e)}}},{keys:[39,228],action:function(a,b,c,d){if(!isNaN(b.duration)&&b.duration>0){a.isVideo&&(a.showControls(),a.startControlsTimer());var e=Math.min(b.currentTime+a.options.defaultSeekForwardInterval(b),b.duration);b.setCurrentTime(e)}}},{keys:[70],action:function(a,b,c,d){d.ctrlKey||"undefined"!=typeof a.enterFullScreen&&(a.isFullScreen?a.exitFullScreen():a.enterFullScreen())}},{keys:[77],action:function(a,b,c,d){a.container.find(".mejs-volume-slider").css("display","block"),a.isVideo&&(a.showControls(),a.startControlsTimer()),a.media.muted?a.setMuted(!1):a.setMuted(!0)}}]},a.mepIndex=0,a.players={},a.addEvent=function(a,b,c){a.addEventListener?a.addEventListener(b,c,!1):a.attachEvent&&(a["e"+b+c]=c,a[b+c]=function(){a["e"+b+c](window.event)},a.attachEvent("on"+b,a[b+c]))},a.removeEvent=function(a,b,c){a.removeEventListener?a.removeEventListener(b,c,!1):a.detachEvent&&(a.detachEvent("on"+b,a[b+c]),a[b+c]=null)},a.getElementsByClassName=function(a,b,c){if((b===e||null===b)&&(b=document),b.getElementsByClassName!==e&&null!==b.getElementsByClassName)return b.getElementsByClassName(a);(c===e||null===c)&&(c="*");var d,f=[],g=0,h=b.getElementsByTagName(c),j=h.length;for(i=0;i'+g+"").insertBefore(c.$media),c.container=b('
').addClass(c.$media[0].className).insertBefore(c.$media).focus(function(b){if(!c.controlsAreVisible&&!c.hasFocus&&c.controlsEnabled&&(c.showControls(!0),!c.hasMsNativeFullScreen)){var d=".mejs-playpause-button > button";a.Utility.isNodeAfter(b.relatedTarget,c.container[0])&&(d=".mejs-controls .mejs-button:last-child > button");var e=c.container.find(d);e.focus()}}),c.options.features.length||c.container.css("background","transparent").find(".mejs-controls").hide(),c.isVideo&&"fill"===c.options.stretching&&!c.container.parent("mejs-fill-container").length&&(c.outerContainer=c.$media.parent(),c.container.wrap('
')),c.container.addClass((d.isAndroid?"mejs-android ":"")+(d.isiOS?"mejs-ios ":"")+(d.isiPad?"mejs-ipad ":"")+(d.isiPhone?"mejs-iphone ":"")+(c.isVideo?"mejs-video ":"mejs-audio ")),c.container.find(".mejs-mediaelement").append(c.$media),c.node.player=c,c.controls=c.container.find(".mejs-controls"),c.layers=c.container.find(".mejs-layers");var h=c.isVideo?"video":"audio",i=h.substring(0,1).toUpperCase()+h.substring(1);c.options[h+"Width"]>0||c.options[h+"Width"].toString().indexOf("%")>-1?c.width=c.options[h+"Width"]:""!==c.media.style.width&&null!==c.media.style.width?c.width=c.media.style.width:null!==c.media.getAttribute("width")?c.width=c.$media.attr("width"):c.width=c.options["default"+i+"Width"],c.options[h+"Height"]>0||c.options[h+"Height"].toString().indexOf("%")>-1?c.height=c.options[h+"Height"]:""!==c.media.style.height&&null!==c.media.style.height?c.height=c.media.style.height:null!==c.$media[0].getAttribute("height")?c.height=c.$media.attr("height"):c.height=c.options["default"+i+"Height"],c.initialAspectRatio=c.height>c.width?c.width/c.height:c.height/c.width,c.setPlayerSize(c.width,c.height),e.pluginWidth=c.width,e.pluginHeight=c.height}else c.isVideo||c.options.features.length||c.$media.hide();a.MediaElement(c.$media[0],e),"undefined"!=typeof c.container&&c.options.features.length&&c.controlsAreVisible&&c.container.trigger("controlsshown")},showControls:function(a){var b=this;a=a===e||a,b.controlsAreVisible||(a?(b.controls.removeClass("mejs-offscreen").stop(!0,!0).fadeIn(200,function(){b.controlsAreVisible=!0,b.container.trigger("controlsshown")}),b.container.find(".mejs-control").removeClass("mejs-offscreen").stop(!0,!0).fadeIn(200,function(){b.controlsAreVisible=!0})):(b.controls.removeClass("mejs-offscreen").css("display","block"),b.container.find(".mejs-control").removeClass("mejs-offscreen").css("display","block"),b.controlsAreVisible=!0,b.container.trigger("controlsshown")),b.setControlsSize())},hideControls:function(a){var c=this;a=a===e||a,!c.controlsAreVisible||c.options.alwaysShowControls||c.keyboardAction||c.media.paused||c.media.ended||(a?(c.controls.stop(!0,!0).fadeOut(200,function(){b(this).addClass("mejs-offscreen").css("display","block"),c.controlsAreVisible=!1,c.container.trigger("controlshidden")}),c.container.find(".mejs-control").stop(!0,!0).fadeOut(200,function(){b(this).addClass("mejs-offscreen").css("display","block")})):(c.controls.addClass("mejs-offscreen").css("display","block"),c.container.find(".mejs-control").addClass("mejs-offscreen").css("display","block"),c.controlsAreVisible=!1,c.container.trigger("controlshidden")))},controlsTimer:null,startControlsTimer:function(a){var b=this;a="undefined"!=typeof a?a:b.options.controlsTimeoutDefault,b.killControlsTimer("start"),b.controlsTimer=setTimeout(function(){b.hideControls(),b.killControlsTimer("hide")},a)},killControlsTimer:function(a){var b=this;null!==b.controlsTimer&&(clearTimeout(b.controlsTimer),delete b.controlsTimer,b.controlsTimer=null)},controlsEnabled:!0,disableControls:function(){var a=this;a.killControlsTimer(),a.hideControls(!1),this.controlsEnabled=!1},enableControls:function(){var a=this;a.showControls(!1),a.controlsEnabled=!0},meReady:function(c,d){var f,g,h=this,i=a.MediaFeatures,j=d.getAttribute("autoplay"),k=!(j===e||null===j||"false"===j),l=null!==c.rendererName&&c.rendererName.match(/(native|html5)/);if(!h.created){if(h.created=!0,h.media=c,h.domNode=d,!(i.isAndroid&&h.options.AndroidUseNativeControls||i.isiPad&&h.options.iPadUseNativeControls||i.isiPhone&&h.options.iPhoneUseNativeControls)){if(!h.isVideo&&!h.options.features.length)return k&&l&&h.play(),void(h.options.success&&("string"==typeof h.options.success?window[h.options.success](h.media,h.domNode,h):h.options.success(h.media,h.domNode,h)));h.buildposter(h,h.controls,h.layers,h.media),h.buildkeyboard(h,h.controls,h.layers,h.media),h.buildoverlays(h,h.controls,h.layers,h.media),h.findTracks();for(f in h.options.features)if(g=h.options.features[f],h["build"+g])try{h["build"+g](h,h.controls,h.layers,h.media)}catch(m){}h.container.trigger("controlsready"),h.setPlayerSize(h.width,h.height),h.setControlsSize(),h.isVideo&&(a.MediaFeatures.hasTouch&&!h.options.alwaysShowControls?h.$media.bind("touchstart",function(){h.controlsAreVisible?h.hideControls(!1):h.controlsEnabled&&h.showControls(!1)}):(h.clickToPlayPauseCallback=function(){if(h.options.clickToPlayPause){var a=h.$media.closest(".mejs-container").find(".mejs-overlay-button"),b=a.attr("aria-pressed");h.media.paused&&b?h.pause():h.media.paused?h.play():h.pause(),a.attr("aria-pressed",!b)}},h.media.addEventListener("click",h.clickToPlayPauseCallback,!1),h.container.bind("mouseenter",function(){h.controlsEnabled&&(h.options.alwaysShowControls||(h.killControlsTimer("enter"),h.showControls(),h.startControlsTimer(h.options.controlsTimeoutMouseEnter)))}).bind("mousemove",function(){h.controlsEnabled&&(h.controlsAreVisible||h.showControls(),h.options.alwaysShowControls||h.startControlsTimer(h.options.controlsTimeoutMouseEnter))}).bind("mouseleave",function(){h.controlsEnabled&&(h.media.paused||h.options.alwaysShowControls||h.startControlsTimer(h.options.controlsTimeoutMouseLeave))})),h.options.hideVideoControlsOnLoad&&h.hideControls(!1),k&&!h.options.alwaysShowControls&&h.hideControls(),h.options.enableAutosize&&h.media.addEventListener("loadedmetadata",function(a){h.options.videoHeight<=0&&!h.domNode.getAttribute("height")&&!isNaN(a.target.videoHeight)&&(h.setPlayerSize(a.target.videoWidth,a.target.videoHeight),h.setControlsSize(),h.media.setSize(a.target.videoWidth,a.target.videoHeight))},!1)),h.media.addEventListener("play",function(){var b;h.hasFocus=!0;for(b in a.players){var c=a.players[b];c.id===h.id||!h.options.pauseOtherPlayers||c.paused||c.ended||(c.pause(),c.hasFocus=!1)}},!1),h.media.addEventListener("ended",function(a){if(h.options.autoRewind)try{h.media.setCurrentTime(0),window.setTimeout(function(){b(h.container).find(".mejs-overlay-loading").parent().hide()},20)}catch(c){}"function"==typeof h.media.stop?h.media.stop():h.media.pause(),h.setProgressRail&&h.setProgressRail(),h.setCurrentRail&&h.setCurrentRail(),h.options.loop?h.play():!h.options.alwaysShowControls&&h.controlsEnabled&&h.showControls()},!1),h.media.addEventListener("loadedmetadata",function(){a.Utility.calculateTimeFormat(h.duration,h.options,h.options.framesPerSecond||25),h.updateDuration&&h.updateDuration(),h.updateCurrent&&h.updateCurrent(),h.isFullScreen||(h.setPlayerSize(h.width,h.height),h.setControlsSize())},!1);var n=null;h.media.addEventListener("timeupdate",function(){n!==this.duration&&(n=this.duration,a.Utility.calculateTimeFormat(n,h.options,h.options.framesPerSecond||25),h.updateDuration&&h.updateDuration(),h.updateCurrent&&h.updateCurrent(),h.setControlsSize())},!1),h.container.focusout(function(a){if(a.relatedTarget){var c=b(a.relatedTarget);h.keyboardAction&&0===c.parents(".mejs-container").length&&(h.keyboardAction=!1,h.isVideo&&!h.options.alwaysShowControls&&h.hideControls(!0))}}),setTimeout(function(){h.setPlayerSize(h.width,h.height),h.setControlsSize()},50),h.globalBind("resize",function(){h.isFullScreen||a.MediaFeatures.hasTrueNativeFullScreen&&document.webkitIsFullScreen||h.setPlayerSize(h.width,h.height),h.setControlsSize()}),null!==h.media.rendererName&&h.media.rendererName.match(/youtube/)&&(i.isiOS||i.isAndroid)&&(h.container.find(".mejs-overlay-play").hide(),h.container.find(".mejs-poster").hide())}k&&l&&h.play(),h.options.success&&("string"==typeof h.options.success?window[h.options.success](h.media,h.domNode,h):h.options.success(h.media,h.domNode,h))}},handleError:function(a){var b=this;b.controls&&b.disableControls(),b.options.error&&b.options.error(a)},setPlayerSize:function(a,c){var d=this;if(!d.options.setDimensions)return!1;if("undefined"!=typeof a&&(d.width=a),"undefined"!=typeof c&&(d.height=c),"undefined"!=typeof FB&&d.isVideo){FB.Event.subscribe("xfbml.ready",function(){var a=b(d.media).children(".fb-video");return d.width=a.width(),d.height=a.height(),d.setDimensions(d.width,d.height),!1});var e=b(d.media).children(".fb-video");e.length&&(d.width=e.width(),d.height=e.height())}switch(d.options.stretching){case"fill":d.isVideo?d.setFillMode():d.setDimensions(d.width,d.height);break;case"responsive":d.setResponsiveMode();break;case"none":d.setDimensions(d.width,d.height);break;default:d.hasFluidMode()===!0?d.setResponsiveMode():d.setDimensions(d.width,d.height)}},hasFluidMode:function(){var a=this;return a.height.toString().indexOf("%")>-1||"none"!==a.$node.css("max-width")&&a.$node.css("max-width")!==a.width||a.$node[0].currentStyle&&"100%"===a.$node[0].currentStyle.maxWidth},setResponsiveMode:function(){var a,d=this,e=(function(){return d.isVideo?d.media.videoWidth&&d.media.videoWidth>0?d.media.videoWidth:null!==d.media.getAttribute("width")?d.media.getAttribute("width"):d.options.defaultVideoWidth:d.options.defaultAudioWidth}(),function(){return d.isVideo?d.media.videoHeight&&d.media.videoHeight>0?d.media.videoHeight:null!==d.media.getAttribute("height")?d.media.getAttribute("height"):d.options.defaultVideoHeight:d.options.defaultAudioHeight}()),f=function(){return ratio=1,d.isVideo?(d.media.videoWidth&&d.media.videoWidth>0&&d.media.videoHeight&&d.media.videoHeight>0?ratio=d.height>=d.width?d.media.videoWidth/d.media.videoHeight:d.media.videoHeight/d.media.videoWidth:ratio=d.initialAspectRatio,(isNaN(ratio)||ratio<.01||ratio>100)&&(ratio=1),ratio):ratio}(),g=d.container.parent().closest(":visible").width(),h=d.container.parent().closest(":visible").height();a=d.isVideo?d.height>=d.width?parseInt(g/f,10):parseInt(g*f,10):e,isNaN(a)&&(a=h),d.container.parent().length>0&&"body"===d.container.parent()[0].tagName.toLowerCase()&&(g=b(c).width(),a=b(c).height()),a&&g&&(d.container.width(g).height(a),d.$media.width("100%").height("100%"),d.isVideo&&d.media.setSize&&d.media.setSize(g,a),d.layers.children(".mejs-layer").width("100%").height("100%"))},setFillMode:function(){var a=this,b=a.outerContainer;"none"!==a.$node.css("height")&&a.$node.css("height")!==a.height&&a.$node.css("height",""),"none"!==a.$node.css("max-width")&&a.$node.css("max-width")!==a.width&&a.$node.css("max-width",""),"none"!==a.$node.css("max-height")&&a.$node.css("max-height")!==a.height&&a.$node.css("max-height",""),a.$node[0].currentStyle&&("100%"===a.$node[0].currentStyle.height&&(a.$node[0].currentStyle.height=""),"100%"===a.$node[0].currentStyle.maxWidth&&(a.$node[0].currentStyle.maxWidth=""),"100%"===a.$node[0].currentStyle.maxHeight&&(a.$node[0].currentStyle.maxHeight="")),b.width()||b.height(a.$media.width()),b.height()||b.height(a.$media.height());var c=b.width(),d=b.height();a.setDimensions("100%","100%"),a.container.find(".mejs-poster img").css("display","block"),targetElement=a.container.find("object, embed, iframe, video");var e=a.height,f=a.width,g=c,h=e*c/f,i=f*d/e,j=d,k=i>c==!1,l=k?Math.floor(g):Math.floor(i),m=k?Math.floor(h):Math.floor(j);k?(targetElement.height(m).width(c),a.media.setSize&&a.media.setSize(c,m)):(targetElement.height(d).width(l),a.media.setSize&&a.media.setSize(l,d)),targetElement.css({"margin-left":Math.floor((c-l)/2),"margin-top":0})},setDimensions:function(a,b){var c=this;c.container.width(a).height(b),c.layers.children(".mejs-layer").width(a).height(b)},setControlsSize:function(){var a=this,c=a.controls.find(".mejs-time-rail");if(a.container.is(":visible")&&c.length&&c.is(":visible")){var d=a.controls.children(),e=parseFloat(d.children(".mejs-time-total").css("margin-left")),f=0;c.siblings().each(function(){f+=b(this).outerWidth(!0)}),f+=2*e,c.width("100%").width("-="+f),a.container.trigger("controlsresize")}},buildposter:function(a,c,d,e){var f=this,g=b('
').appendTo(d),h=a.$media.attr("poster");""!==a.options.poster&&(h=a.options.poster),h?f.setPoster(h):g.hide(),e.addEventListener("play",function(){g.hide()},!1),a.options.showPosterWhenEnded&&a.options.autoRewind&&e.addEventListener("ended",function(){g.show()},!1)},setPoster:function(a){var c=this,d=c.container.find(".mejs-poster"),e=d.find("img");0===e.length&&(e=b('').appendTo(d)),e.attr("src",a),d.css({"background-image":"url("+a+")"})},buildoverlays:function(c,d,e,f){var g=this;if(c.isVideo){var h=b('
').hide().appendTo(e),i=b('
').hide().appendTo(e),j=b('
').appendTo(e).bind("click",function(){if(g.options.clickToPlayPause){var a=g.$media.closest(".mejs-container").find(".mejs-overlay-button"),b=a.attr("aria-pressed");f.paused?f.play():f.pause(),a.attr("aria-pressed",!!b)}});(a.Features.isiPhone||null!==g.media.rendererName&&g.media.rendererName.match(/(youtube|facebook)/))&&j.hide(),f.addEventListener("play",function(){j.hide(),h.hide(),d.find(".mejs-time-buffering").hide(),i.hide()},!1),f.addEventListener("playing",function(){j.hide(),h.hide(),d.find(".mejs-time-buffering").hide(),i.hide()},!1),f.addEventListener("seeking",function(){h.show(),d.find(".mejs-time-buffering").show()},!1),f.addEventListener("seeked",function(){h.hide(),d.find(".mejs-time-buffering").hide()},!1),f.addEventListener("pause",function(){a.MediaFeatures.isiPhone||j.show()},!1),f.addEventListener("waiting",function(){h.show(),d.find(".mejs-time-buffering").show()},!1),f.addEventListener("loadeddata",function(){h.show(),d.find(".mejs-time-buffering").show(),a.MediaFeatures.isAndroid&&(f.canplayTimeout=window.setTimeout(function(){if(document.createEvent){var a=document.createEvent("HTMLEvents");return a.initEvent("canplay",!0,!0),f.dispatchEvent(a)}},300))},!1),f.addEventListener("canplay",function(){h.hide(),d.find(".mejs-time-buffering").hide(),clearTimeout(f.canplayTimeout)},!1),f.addEventListener("error",function(a){g.handleError(a),h.hide(),j.hide(),i.show(),i.find(".mejs-overlay-error").html("Error loading this resource")},!1),f.addEventListener("keydown",function(a){g.onkeydown(c,f,a)},!1)}},buildkeyboard:function(a,c,d,e){var f=this;f.container.keydown(function(){f.keyboardAction=!0}),f.globalBind("keydown",function(c){return a.hasFocus=0!==b(c.target).closest(".mejs-container").length&&b(c.target).closest(".mejs-container").attr("id")===a.$media.closest(".mejs-container").attr("id"),f.onkeydown(a,e,c)}),f.globalBind("click",function(c){a.hasFocus=0!==b(c.target).closest(".mejs-container").length})},onkeydown:function(a,b,c){if(a.hasFocus&&a.options.enableKeyboard)for(var d=0,e=a.options.keyActions.length;e>d;d++)for(var f=a.options.keyActions[d],g=0,h=f.keys.length;h>g;g++)if(c.keyCode===f.keys[g])return"function"==typeof c.preventDefault&&c.preventDefault(),f.action(a,b,c.keyCode,c),!1;return!0},findTracks:function(){var a=this,c=a.$media.find("track");a.tracks=[],c.each(function(c,d){d=b(d),a.tracks.push({srclang:d.attr("srclang")?d.attr("srclang").toLowerCase():"",src:d.attr("src"),kind:d.attr("kind"),label:d.attr("label")||"",entries:[],isLoaded:!1})})},changeSkin:function(a){var b=this;b.container[0].className="mejs-container "+a,b.setPlayerSize(b.width,b.height),b.setControlsSize()},play:function(){var a=this;a.media.getCurrentTime()<=0&&a.load(),a.media.play()},pause:function(){try{this.media.pause()}catch(a){}},load:function(){var a=this;a.isLoaded||a.media.load(),a.isLoaded=!0},setMuted:function(a){this.media.setMuted(a)},setCurrentTime:function(a){this.media.setCurrentTime(a)},getCurrentTime:function(){return this.media.currentTime},setVolume:function(a){this.media.setVolume(a)},getVolume:function(){return this.media.volume},setSrc:function(a){this.media.setSrc(a)},remove:function(){var b,c,d=this;d.container.prev(".mejs-offscreen").remove();for(b in d.options.features)if(c=d.options.features[b],d["clean"+c])try{d["clean"+c](d)}catch(e){}d.isDynamic?d.$node.insertBefore(d.container):(d.$media.prop("controls",!0),d.$node.clone().insertBefore(d.container).show(),d.$node.remove());var f=null!==d.media.rendererName&&d.media.rendererName.match(/(native|html5)/);f||d.media.remove(),delete a.players[d.id],"object"==typeof d.container&&d.container.remove(),d.globalUnbind(),delete d.node.player},rebuildtracks:function(){var a=this;a.findTracks(),a.buildtracks(a,a.controls,a.layers,a.media)},resetSize:function(){var a=this;setTimeout(function(){a.setPlayerSize(a.width,a.height),a.setControlsSize()},50)}},function(){function c(a,c){var e={d:[],w:[]};return b.each((a||"").split(" "),function(a,b){var f=b+"."+c;0===f.indexOf(".")?(e.d.push(f),e.w.push(f)):e[d.test(b)?"w":"d"].push(f)}),e.d=e.d.join(" "),e.w=e.w.join(" "),e}var d=/^((after|before)print|(before)?unload|hashchange|message|o(ff|n)line|page(hide|show)|popstate|resize|storage)\b/;a.MediaElementPlayer.prototype.globalBind=function(a,d,e){var f=this,g=f.node?f.node.ownerDocument:document;a=c(a,f.id),a.d&&b(g).bind(a.d,d,e),a.w&&b(window).bind(a.w,d,e)},a.MediaElementPlayer.prototype.globalUnbind=function(a,d){var e=this,f=e.node?e.node.ownerDocument:document;a=c(a,e.id),a.d&&b(f).unbind(a.d,d),a.w&&b(window).unbind(a.w,d)}}(),"undefined"!=typeof b&&(b.fn.mediaelementplayer=function(c){return c===!1?this.each(function(){var a=b(this).data("mediaelementplayer");a&&a.remove(),b(this).removeData("mediaelementplayer")}):this.each(function(){b(this).data("mediaelementplayer",new a.MediaElementPlayer(this,c))}),this},b(document).ready(function(){b(".mejs-player").mediaelementplayer()})),window.MediaElementPlayer=a.MediaElementPlayer}(mejs,mejs.$,window,document),function(a){a.extend(mejs.MepDefaults,{playText:"",pauseText:""}),a.extend(MediaElementPlayer.prototype,{buildplaypause:function(b,c,d,e){function f(a){"play"===a?(k.removeClass("mejs-play").addClass("mejs-pause"),l.attr({title:j,"aria-label":j})):(k.removeClass("mejs-pause").addClass("mejs-play"),l.attr({title:i,"aria-label":i}))}var g=this,h=g.options,i=h.playText?h.playText:mejs.i18n.t("mejs.play"),j=h.pauseText?h.pauseText:mejs.i18n.t("mejs.pause"),k=a('
').appendTo(c).click(function(a){return a.preventDefault(),e.paused?e.play():e.pause(),!1}),l=k.find("button");f("pse"),e.addEventListener("play",function(){f("play")},!1),e.addEventListener("playing",function(){f("play")},!1),e.addEventListener("pause",function(){f("pse")},!1),e.addEventListener("paused",function(){f("pse")},!1)}})}(mejs.$),function(a){a.extend(mejs.MepDefaults,{stopText:""}),a.extend(MediaElementPlayer.prototype,{buildstop:function(b,c,d,e){var f=this,g=f.options.stopText?f.options.stopText:mejs.i18n.t("mejs.stop");a('
').appendTo(c).click(function(){e.paused||e.pause(),e.currentTime>0&&(e.setCurrentTime(0),e.pause(),c.find(".mejs-time-current").width("0px"),c.find(".mejs-time-handle").css("left","0px"),c.find(".mejs-time-float-current").html(mejs.Utility.secondsToTimeCode(0,b.options.alwaysShowHours)),c.find(".mejs-currenttime").html(mejs.Utility.secondsToTimeCode(0,b.options.alwaysShowHours)),d.find(".mejs-poster").show())})}})}(mejs.$),function(a){a.extend(mejs.MepDefaults,{enableProgressTooltip:!0,progressHelpText:""}),a.extend(MediaElementPlayer.prototype,{buildprogress:function(b,c,d,e){var f=this,g=!1,h=!1,i=0,j=!1,k=b.options.autoRewind,l=(f.options.progressHelpText?f.options.progressHelpText:mejs.i18n.t("mejs.time-help-text"),b.options.enableProgressTooltip?'00:00':"");a('
'+l+"
").appendTo(c),c.find(".mejs-time-buffering").hide(),f.total=c.find(".mejs-time-total"),f.loaded=c.find(".mejs-time-loaded"),f.current=c.find(".mejs-time-current"),f.handle=c.find(".mejs-time-handle"),f.timefloat=c.find(".mejs-time-float"),f.timefloatcurrent=c.find(".mejs-time-float-current"),f.slider=c.find(".mejs-time-slider");var m=function(a){var c,d=f.total.offset(),h=f.total.width(),i=0,j=0,k=0;c=a.originalEvent&&a.originalEvent.changedTouches?a.originalEvent.changedTouches[0].pageX:a.changedTouches?a.changedTouches[0].pageX:a.pageX,e.duration&&(ch+d.left&&(c=h+d.left),k=c-d.left,i=k/h,j=.02>=i?0:i*e.duration,g&&j.toFixed(4)!==e.currentTime.toFixed(4)&&e.setCurrentTime(j),mejs.MediaFeatures.hasTouch||(f.timefloat.css("left",k),f.timefloatcurrent.html(mejs.Utility.secondsToTimeCode(j,b.options.alwaysShowHours)),f.timefloat.show()))},n=function(){var a=e.currentTime,c=mejs.i18n.t("mejs.time-slider"),d=mejs.Utility.secondsToTimeCode(a,b.options.alwaysShowHours),g=e.duration;f.slider.attr({role:"slider",tabindex:0}),e.paused?f.slider.attr({"aria-label":c,"aria-valuemin":0,"aria-valuemax":g,"aria-valuenow":a,"aria-valuetext":d}):f.slider.removeAttr("aria-label aria-valuemin aria-valuemax aria-valuenow aria-valuetext")},o=function(){var a=new Date;a-i>=1e3&&e.play()};f.slider.bind("focus",function(a){b.options.autoRewind=!1}),f.slider.bind("blur",function(a){b.options.autoRewind=k}),f.slider.bind("keydown",function(a){if(new Date-i>=1e3&&(j=e.paused),f.options.keyActions.length){var c=a.keyCode,d=e.duration,g=e.currentTime,h=b.options.defaultSeekForwardInterval(e),k=b.options.defaultSeekBackwardInterval(e);switch(c){case 37:case 40:g-=k;break;case 39:case 38:g+=h;break;case 36:g=0;break;case 35:g=d;break;case 32:return void(mejs.Utility.isFirefox||(e.paused?e.play():e.pause()));case 13:return void(e.paused?e.play():e.pause());default:return}g=0>g?0:g>=d?d:Math.floor(g),i=new Date,j||e.pause(),g0&&c.buffered.end&&c.duration?d=c.buffered.end(c.buffered.length-1)/c.duration:c&&void 0!==c.bytesTotal&&c.bytesTotal>0&&void 0!==c.bufferedBytes?d=c.bufferedBytes/c.bytesTotal:a&&a.lengthComputable&&0!==a.total&&(d=a.loaded/a.total),null!==d&&(d=Math.min(1,Math.max(0,d)),b.loaded&&b.total&&b.loaded.width(100*d+"%"))},setCurrentRail:function(){var a=this;if(void 0!==a.media.currentTime&&a.media.duration&&a.total&&a.handle){var b=Math.round(a.total.width()*a.media.currentTime/a.media.duration),c=b-Math.round(a.handle.outerWidth(!0)/2);b=a.media.currentTime/a.media.duration*100,a.current.width(b+"%"),a.handle.css("left",c)}}})}(mejs.$),function(a){a.extend(mejs.MepDefaults,{duration:0,timeAndDurationSeparator:" | "}),a.extend(MediaElementPlayer.prototype,{buildcurrent:function(b,c,d,e){var f=this;a('
'+mejs.Utility.secondsToTimeCode(0,b.options.alwaysShowHours)+"
").appendTo(c),f.currenttime=f.controls.find(".mejs-currenttime"),e.addEventListener("timeupdate",function(){f.controlsAreVisible&&b.updateCurrent()},!1)},buildduration:function(b,c,d,e){var f=this;c.children().last().find(".mejs-currenttime").length>0?a(f.options.timeAndDurationSeparator+''+mejs.Utility.secondsToTimeCode(f.options.duration,f.options.alwaysShowHours)+"").appendTo(c.find(".mejs-time")):(c.find(".mejs-currenttime").parent().addClass("mejs-currenttime-container"),a('
'+mejs.Utility.secondsToTimeCode(f.options.duration,f.options.alwaysShowHours)+"
").appendTo(c)),f.durationD=f.controls.find(".mejs-duration"),e.addEventListener("timeupdate",function(){f.controlsAreVisible&&b.updateDuration()},!1)},updateCurrent:function(){var a=this,b=a.media.currentTime;isNaN(b)&&(b=0),a.currenttime&&a.currenttime.html(mejs.Utility.secondsToTimeCode(b,a.options.alwaysShowHours))},updateDuration:function(){var a=this,b=a.media.duration;(isNaN(b)||b==1/0||0>b)&&(a.media.duration=a.options.duration=b=0),a.options.duration>0&&(b=a.options.duration),a.container.toggleClass("mejs-long-video",b>3600),a.durationD&&b>0&&a.durationD.html(mejs.Utility.secondsToTimeCode(b,a.options.alwaysShowHours))}})}(mejs.$),function(a){a.extend(mejs.MepDefaults,{muteText:mejs.i18n.t("mejs.mute-toggle"),allyVolumeControlText:mejs.i18n.t("mejs.volume-help-text"),hideVolumeOnTouchDevices:!0,audioVolume:"horizontal",videoVolume:"vertical"}),a.extend(MediaElementPlayer.prototype,{buildvolume:function(b,c,d,e){if(!mejs.MediaFeatures.isAndroid&&!mejs.MediaFeatures.isiOS||!this.options.hideVolumeOnTouchDevices){var f=this,g=f.isVideo?f.options.videoVolume:f.options.audioVolume,h="horizontal"===g?a('
'+f.options.allyVolumeControlText+'
').appendTo(c):a('').appendTo(c),i=f.container.find(".mejs-volume-slider, .mejs-horizontal-volume-slider"),j=f.container.find(".mejs-volume-total, .mejs-horizontal-volume-total"),k=f.container.find(".mejs-volume-current, .mejs-horizontal-volume-current"),l=f.container.find(".mejs-volume-handle, .mejs-horizontal-volume-handle"),m=function(a,b){ if(!i.is(":visible")&&void 0===b)return i.show(),m(a,!0),void i.hide();a=Math.max(0,a),a=Math.min(a,1),0===a?(h.removeClass("mejs-mute").addClass("mejs-unmute"),h.children("button").attr("title",mejs.i18n.t("mejs.unmute")).attr("aria-label",mejs.i18n.t("mejs.unmute"))):(h.removeClass("mejs-unmute").addClass("mejs-mute"),h.children("button").attr("title",mejs.i18n.t("mejs.mute")).attr("aria-label",mejs.i18n.t("mejs.mute")));var c=j.position();if("vertical"===g){var d=j.height(),e=d-d*a;l.css("top",Math.round(c.top+e-l.height()/2)),k.height(d-e),k.css("top",c.top+e)}else{var f=j.width(),n=f*a;l.css("left",Math.round(c.left+n-l.width()/2)),k.width(Math.round(n))}},n=function(a){var b=null,c=j.offset();if("vertical"===g){var d=j.height(),f=a.pageY-c.top;if(b=(d-f)/d,0===c.top||0===c.left)return}else{var h=j.width(),i=a.pageX-c.left;b=i/h}b=Math.max(0,b),b=Math.min(b,1),m(b),0===b?e.setMuted(!0):e.setMuted(!1),e.setVolume(b)},o=!1,p=!1;h.hover(function(){i.show(),p=!0},function(){p=!1,o||"vertical"!==g||i.hide()});var q=function(){var a=Math.floor(100*e.volume);i.attr({"aria-label":mejs.i18n.t("mejs.volume-slider"),"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":a,"aria-valuetext":a+"%",role:"slider",tabindex:0})};i.bind("mouseover",function(){p=!0}).bind("mousedown",function(a){return n(a),f.globalBind("mousemove.vol",function(a){n(a)}),f.globalBind("mouseup.vol",function(){o=!1,f.globalUnbind(".vol"),p||"vertical"!==g||i.hide()}),o=!0,!1}).bind("keydown",function(a){if(f.options.keyActions.length){var b=a.keyCode,c=e.volume;switch(b){case 38:c=Math.min(c+.1,1);break;case 40:c=Math.max(0,c-.1);break;default:return!0}return o=!1,m(c),e.setVolume(c),!1}}),h.find("button").click(function(){e.setMuted(!e.muted)}),h.find("button").on("focus",function(){i.show()}).on("blur",function(){i.hide()}),e.addEventListener("volumechange",function(a){o||(e.muted?(m(0),h.removeClass("mejs-mute").addClass("mejs-unmute")):(m(e.volume),h.removeClass("mejs-unmute").addClass("mejs-mute"))),q(a)},!1),0===b.options.startVolume&&e.setMuted(!0);var r=null!==f.media.rendererName&&f.media.rendererName.match(/(native|html5)/);r&&e.setVolume(b.options.startVolume),f.container.on("controlsresize",function(){e.muted?(m(0),h.removeClass("mejs-mute").addClass("mejs-unmute")):(m(e.volume),h.removeClass("mejs-unmute").addClass("mejs-mute"))})}}})}(mejs.$),function(a){a.extend(mejs.MepDefaults,{usePluginFullScreen:!0,fullscreenText:""}),a.extend(MediaElementPlayer.prototype,{isFullScreen:!1,isNativeFullScreen:!1,isInIframe:!1,isPluginClickThroughCreated:!1,fullscreenMode:"",containerSizeTimeout:null,buildfullscreen:function(b,c,d,e){if(b.isVideo){b.isInIframe=window.location!=window.parent.location,e.addEventListener("loadstart",function(){b.detectFullscreenMode()});var f=this,g=null,h=f.options.fullscreenText?f.options.fullscreenText:mejs.i18n.t("mejs.fullscreen"),i=a('
').appendTo(c).on("click",function(){var a=mejs.MediaFeatures.hasTrueNativeFullScreen&&mejs.MediaFeatures.isFullScreen()||b.isFullScreen;a?b.exitFullScreen():b.enterFullScreen()}).on("mouseover",function(){if("plugin-hover"===f.fullscreenMode){null!==g&&(clearTimeout(g),g=null);var a=i.offset(),c=b.container.offset();e.positionFullscreenButton(a.left-c.left,a.top-c.top,!0)}}).on("mouseout",function(){"plugin-hover"===f.fullscreenMode&&(null!==g&&clearTimeout(g),g=setTimeout(function(){e.hideFullscreenButton()},1500))});if(b.fullscreenBtn=i,f.globalBind("keydown",function(a){27===a.keyCode&&(mejs.MediaFeatures.hasTrueNativeFullScreen&&mejs.MediaFeatures.isFullScreen()||f.isFullScreen)&&b.exitFullScreen()}),f.normalHeight=0,f.normalWidth=0,mejs.MediaFeatures.hasTrueNativeFullScreen){var j=function(){b.isFullScreen&&(mejs.MediaFeatures.isFullScreen()?(b.isNativeFullScreen=!0,b.setControlsSize()):(b.isNativeFullScreen=!1,b.exitFullScreen()))};b.globalBind(mejs.MediaFeatures.fullScreenEventName,j)}}},detectFullscreenMode:function(){var a=this,b="",c=mejs.MediaFeatures,d=null!==a.media.rendererName&&a.media.rendererName.match(/(native|html5)/);return c.hasTrueNativeFullScreen&&d?b="native-native":!c.hasTrueNativeFullScreen||d||c.hasFirefoxPluginMovingProblem?a.usePluginFullScreen?mejs.MediaFeatures.supportsPointerEvents?(b="plugin-click",a.createPluginClickThrough()):b="plugin-hover":b="fullwindow":b="plugin-native",a.fullscreenMode=b,b},createPluginClickThrough:function(){var b=this;if(!b.isPluginClickThroughCreated){var c,d,e=!1,f=function(){if(e){for(var a in g)g[a].hide();b.fullscreenBtn.css("pointer-events",""),b.controls.css("pointer-events",""),b.media.removeEventListener("click",b.clickToPlayPauseCallback),e=!1}},g={},h=["top","left","right","bottom"],i=function(){var a=fullscreenBtn.offset().left-b.container.offset().left,d=fullscreenBtn.offset().top-b.container.offset().top,e=fullscreenBtn.outerWidth(!0),f=fullscreenBtn.outerHeight(!0),h=b.container.width(),i=b.container.height();for(c in g)g[c].css({position:"absolute",top:0,left:0});g.top.width(h).height(d),g.left.width(a).height(f).css({top:d}),g.right.width(h-a-e).height(f).css({top:d,left:a+e}),g.bottom.width(h).height(i-f-d).css({top:d+f})};for(b.globalBind("resize",function(){i()}),c=0,d=h.length;d>c;c++)g[h[c]]=a('
').appendTo(b.container).mouseover(f).hide();fullscreenBtn.on("mouseover",function(){if(!b.isFullScreen){var a=fullscreenBtn.offset(),d=player.container.offset();media.positionFullscreenButton(a.left-d.left,a.top-d.top,!1),b.fullscreenBtn.css("pointer-events","none"),b.controls.css("pointer-events","none"),b.media.addEventListener("click",b.clickToPlayPauseCallback);for(c in g)g[c].show();i(),e=!0}}),media.addEventListener("fullscreenchange",function(a){b.isFullScreen=!b.isFullScreen,b.isFullScreen?b.media.removeEventListener("click",b.clickToPlayPauseCallback):b.media.addEventListener("click",b.clickToPlayPauseCallback),f()}),b.globalBind("mousemove",function(a){if(e){var c=fullscreenBtn.offset();(a.pageYc.top+fullscreenBtn.outerHeight(!0)||a.pageXc.left+fullscreenBtn.outerWidth(!0))&&(fullscreenBtn.css("pointer-events",""),b.controls.css("pointer-events",""),e=!1)}}),b.isPluginClickThroughCreated=!0}},cleanfullscreen:function(a){a.exitFullScreen()},enterFullScreen:function(){var b=this,c=null!==b.media.rendererName&&b.media.rendererName.match(/(html5|native)/);if(mejs.MediaFeatures.isiOS&&mejs.MediaFeatures.hasiOSFullScreen&&"function"==typeof b.media.webkitEnterFullscreen)return void b.media.webkitEnterFullscreen();a(document.documentElement).addClass("mejs-fullscreen"),b.normalHeight=b.container.height(),b.normalWidth=b.container.width(),"native-native"===b.fullscreenMode||"plugin-native"===b.fullscreenMode?(mejs.MediaFeatures.requestFullScreen(b.container[0]),b.isInIframe&&setTimeout(function e(){if(b.isNativeFullScreen){var c=.002,d=a(window).width(),f=screen.width,g=Math.abs(f-d),h=f*c;g>h?b.exitFullScreen():setTimeout(e,500)}},1e3)):"fullwindow"===b.fullscreeMode,b.container.addClass("mejs-container-fullscreen").width("100%").height("100%"),b.containerSizeTimeout=setTimeout(function(){b.container.css({width:"100%",height:"100%"}),b.setControlsSize()},500),c?b.$media.width("100%").height("100%"):(b.container.find("iframe, embed, object").width("100%").height("100%"),b.options.setDimensions&&b.media.setSize(screen.width,screen.height)),b.layers.children("div").width("100%").height("100%"),b.fullscreenBtn&&b.fullscreenBtn.removeClass("mejs-fullscreen").addClass("mejs-unfullscreen"),b.setControlsSize(),b.isFullScreen=!0;var d=Math.min(screen.width/b.width,screen.height/b.height);b.container.find(".mejs-captions-text").css("font-size",100*d+"%"),b.container.find(".mejs-captions-text").css("line-height","normal"),b.container.find(".mejs-captions-position").css("bottom","45px"),b.container.trigger("enteredfullscreen")},exitFullScreen:function(){var b=this,c=null!==b.media.rendererName&&b.media.rendererName.match(/(native|html5)/);clearTimeout(b.containerSizeTimeout),mejs.MediaFeatures.hasTrueNativeFullScreen&&(mejs.MediaFeatures.isFullScreen()||b.isFullScreen)&&mejs.MediaFeatures.cancelFullScreen(),a(document.documentElement).removeClass("mejs-fullscreen"),b.container.removeClass("mejs-container-fullscreen"),b.options.setDimensions&&(b.container.width(b.normalWidth).height(b.normalHeight),c?b.$media.width(b.normalWidth).height(b.normalHeight):(b.container.find("iframe, embed, object").width(b.normalWidth).height(b.normalHeight),b.media.setSize(b.normalWidth,b.normalHeight)),b.layers.children("div").width(b.normalWidth).height(b.normalHeight)),b.fullscreenBtn.removeClass("mejs-unfullscreen").addClass("mejs-fullscreen"),b.setControlsSize(),b.isFullScreen=!1,b.container.find(".mejs-captions-text").css("font-size",""),b.container.find(".mejs-captions-text").css("line-height",""),b.container.find(".mejs-captions-position").css("bottom",""),b.container.trigger("exitedfullscreen")}})}(mejs.$),function(a){a.extend(mejs.MepDefaults,{speeds:["2.00","1.50","1.25","1.00","0.75"],defaultSpeed:"1.00",speedChar:"x"}),a.extend(MediaElementPlayer.prototype,{buildspeed:function(b,c,d,e){var f=this,g=null!==f.media.rendererName&&f.media.rendererName.match(/(native|html5)/);if(g){for(var h=null,i=null,j=null,k=null,l=[],m=!1,n=0,o=f.options.speeds.length;o>n;n++){var p=f.options.speeds[n];"string"==typeof p?(l.push({name:p+f.options.speedChar,value:p}),p===f.options.defaultSpeed&&(m=!0)):(l.push(p),p.value===f.options.defaultSpeed&&(m=!0))}m||l.push({name:f.options.defaultSpeed+f.options.speedChar,value:f.options.defaultSpeed}),l.sort(function(a,b){return parseFloat(b.value)-parseFloat(a.value)});var q=function(a){for(n=0,o=l.length;o>n;n++)if(l[n].value===a)return l[n].name},r='
    ';for(n=0,il=l.length;n";r+="
",h=a(r).appendTo(c),i=h.find(".mejs-speed-selector"),j=f.options.defaultSpeed,e.addEventListener("loadedmetadata",function(a){j&&(e.playbackRate=parseFloat(j))},!0),i.on("click",'input[type="radio"]',function(){var b=a(this).attr("value");j=b,e.playbackRate=parseFloat(b),h.find("button").html(q(b)),h.find(".mejs-speed-selected").removeClass("mejs-speed-selected"),h.find('input[type="radio"]:checked').next().addClass("mejs-speed-selected")}),h.one("mouseenter focusin",function(){i.height(h.find(".mejs-speed-selector ul").outerHeight(!0)+h.find(".mejs-speed-translations").outerHeight(!0)).css("top",-1*i.height()+"px")})}}})}(mejs.$),function(a){a.extend(mejs.MepDefaults,{startLanguage:"",tracksText:"",tracksAriaLive:!1,hideCaptionsButtonWhenEmpty:!0,toggleCaptionsButtonWhenOnlyOne:!1,slidesSelector:""}),a.extend(MediaElementPlayer.prototype,{hasChapters:!1,buildtracks:function(b,c,d,e){if(0!==b.tracks.length){var f,g,h=this,i=h.options.tracksAriaLive?'role="log" aria-live="assertive" aria-atomic="false"':"",j=h.options.tracksText?h.options.tracksText:mejs.i18n.t("mejs.captions-subtitles");if(h.domNode.textTracks)for(f=h.domNode.textTracks.length-1;f>=0;f--)h.domNode.textTracks[f].mode="hidden";h.cleartracks(b),b.chapters=a('
').prependTo(d).hide(),b.captions=a('
').prependTo(d).hide(),b.captionsText=b.captions.find(".mejs-captions-text"),b.captionsButton=a('
").appendTo(c);var k=0;for(f=0;ff;f++)g=b.tracks[f].kind,("subtitles"===g||"captions"===g)&&b.addTrackButton(b.tracks[f].srclang,b.tracks[f].label);b.loadNextTrack(),e.addEventListener("timeupdate",function(){b.displayCaptions()},!1),""!==b.options.slidesSelector&&(b.slidesContainer=a(b.options.slidesSelector),e.addEventListener("timeupdate",function(){b.displaySlides()},!1)),e.addEventListener("loadedmetadata",function(){b.displayChapters()},!1),b.container.hover(function(){b.hasChapters&&(b.chapters.removeClass("mejs-offscreen"),b.chapters.fadeIn(200).height(b.chapters.find(".mejs-chapter").outerHeight()))},function(){b.hasChapters&&!e.paused&&b.chapters.fadeOut(200,function(){a(this).addClass("mejs-offscreen"),a(this).css("display","block")})}),h.container.on("controlsresize",function(){h.adjustLanguageBox()}),null!==b.node.getAttribute("autoplay")&&b.chapters.addClass("mejs-offscreen")}},cleartracks:function(a){a&&(a.captions&&a.captions.remove(),a.chapters&&a.chapters.remove(),a.captionsText&&a.captionsText.remove(),a.captionsButton&&a.captionsButton.remove())},setTrack:function(a){var b,c=this;if("none"===a)c.selectedTrack=null,c.captionsButton.removeClass("mejs-captions-enabled");else for(b=0;b0&&c.displayChapters(d)},!1),"slides"==d.kind&&c.setupSlides(d)},error:function(){c.removeTrackButton(d.srclang),c.loadNextTrack()}})},enableTrackButton:function(b,c){var d=this;""===c&&(c=mejs.language.codes[b]||b),d.captionsButton.find("input[value="+b+"]").prop("disabled",!1).siblings("label").html(c),d.options.startLanguage===b&&a("#"+d.id+"_captions_"+b).prop("checked",!0).trigger("click"),d.adjustLanguageBox()},removeTrackButton:function(a){var b=this;b.captionsButton.find("input[value="+a+"]").closest("li").remove(),b.adjustLanguageBox()},addTrackButton:function(b,c){var d=this;""===c&&(c=mejs.language.codes[b]||b),d.captionsButton.find("ul").append(a('
  • ")),d.adjustLanguageBox(),d.container.find(".mejs-captions-translations option[value="+b+"]").remove()},adjustLanguageBox:function(){var a=this;a.captionsButton.find(".mejs-captions-selector").height(a.captionsButton.find(".mejs-captions-selector ul").outerHeight(!0)+a.captionsButton.find(".mejs-captions-translations").outerHeight(!0))},checkForTracks:function(){var a=this,b=!1;if(a.options.hideCaptionsButtonWhenEmpty){for(var c=0;c=c.entries.times[a].start&&b.media.currentTime<=c.entries.times[a].stop)return b.captionsText.html(c.entries.text[a]).attr("class","mejs-captions-text "+(c.entries.times[a].identifier||"")),void b.captions.show().height(0);b.captions.hide()}else b.captions.hide()}},setupSlides:function(a){var b=this;b.slides=a,b.slides.entries.imgs=[b.slides.entries.text.length],b.showSlide(0)},showSlide:function(b){if(void 0!==this.tracks&&void 0!==this.slidesContainer){var c=this,d=c.slides.entries.text[b],e=c.slides.entries.imgs[b];void 0===e||void 0===e.fadeIn?c.slides.entries.imgs[b]=e=a('').on("load",function(){e.appendTo(c.slidesContainer).hide().fadeIn().siblings(":visible").fadeOut()}):e.is(":visible")||e.is(":animated")||e.fadeIn().siblings(":visible").fadeOut()}},displaySlides:function(){if(void 0!==this.slides){var a,b=this,c=b.slides;for(a=0;a=c.entries.times[a].start&&b.media.currentTime<=c.entries.times[a].stop)return void b.showSlide(a)}},displayChapters:function(){var a,b=this;for(a=0;ac;c++)d=b.entries.times[c].stop-b.entries.times[c].start,f=Math.floor(d/e.media.duration*100),(f+g>100||c===b.entries.times.length-1&&100>f+g)&&(f=100-g),e.chapters.append(a('
    '+b.entries.text[c]+''+mejs.Utility.secondsToTimeCode(b.entries.times[c].start,e.options.alwaysShowHours)+"–"+mejs.Utility.secondsToTimeCode(b.entries.times[c].stop,e.options.alwaysShowHours)+"
    ")),g+=f;e.chapters.find("div.mejs-chapter").click(function(){e.media.setCurrentTime(parseFloat(a(this).attr("rel"))),e.media.paused&&e.media.play()}),e.chapters.show()}}),mejs.language={codes:{af:mejs.i18n.t("mejs.afrikaans"),sq:mejs.i18n.t("mejs.albanian"),ar:mejs.i18n.t("mejs.arabic"),be:mejs.i18n.t("mejs.belarusian"),bg:mejs.i18n.t("mejs.bulgarian"),ca:mejs.i18n.t("mejs.catalan"),zh:mejs.i18n.t("mejs.chinese"),"zh-cn":mejs.i18n.t("mejs.chinese-simplified"),"zh-tw":mejs.i18n.t("mejs.chines-traditional"),hr:mejs.i18n.t("mejs.croatian"),cs:mejs.i18n.t("mejs.czech"),da:mejs.i18n.t("mejs.danish"),nl:mejs.i18n.t("mejs.dutch"),en:mejs.i18n.t("mejs.english"),et:mejs.i18n.t("mejs.estonian"),fl:mejs.i18n.t("mejs.filipino"),fi:mejs.i18n.t("mejs.finnish"),fr:mejs.i18n.t("mejs.french"),gl:mejs.i18n.t("mejs.galician"),de:mejs.i18n.t("mejs.german"),el:mejs.i18n.t("mejs.greek"),ht:mejs.i18n.t("mejs.haitian-creole"),iw:mejs.i18n.t("mejs.hebrew"),hi:mejs.i18n.t("mejs.hindi"),hu:mejs.i18n.t("mejs.hungarian"),is:mejs.i18n.t("mejs.icelandic"),id:mejs.i18n.t("mejs.indonesian"),ga:mejs.i18n.t("mejs.irish"),it:mejs.i18n.t("mejs.italian"),ja:mejs.i18n.t("mejs.japanese"),ko:mejs.i18n.t("mejs.korean"),lv:mejs.i18n.t("mejs.latvian"),lt:mejs.i18n.t("mejs.lithuanian"),mk:mejs.i18n.t("mejs.macedonian"),ms:mejs.i18n.t("mejs.malay"),mt:mejs.i18n.t("mejs.maltese"),no:mejs.i18n.t("mejs.norwegian"),fa:mejs.i18n.t("mejs.persian"),pl:mejs.i18n.t("mejs.polish"),pt:mejs.i18n.t("mejs.portuguese"),ro:mejs.i18n.t("mejs.romanian"),ru:mejs.i18n.t("mejs.russian"),sr:mejs.i18n.t("mejs.serbian"),sk:mejs.i18n.t("mejs.slovak"),sl:mejs.i18n.t("mejs.slovenian"),es:mejs.i18n.t("mejs.spanish"),sw:mejs.i18n.t("mejs.swahili"),sv:mejs.i18n.t("mejs.swedish"),tl:mejs.i18n.t("mejs.tagalog"),th:mejs.i18n.t("mejs.thai"),tr:mejs.i18n.t("mejs.turkish"),uk:mejs.i18n.t("mejs.ukrainian"),vi:mejs.i18n.t("mejs.vietnamese"),cy:mejs.i18n.t("mejs.welsh"),yi:mejs.i18n.t("mejs.yiddish")}},mejs.TrackFormatParser={webvtt:{pattern_timecode:/^((?:[0-9]{1,2}:)?[0-9]{2}:[0-9]{2}([,.][0-9]{1,3})?) --\> ((?:[0-9]{1,2}:)?[0-9]{2}:[0-9]{2}([,.][0-9]{3})?)(.*)$/,parse:function(b){for(var c,d,e,f=0,g=mejs.TrackFormatParser.split2(b,/\r?\n/),h={text:[],times:[]};f=0&&""!==g[f-1]&&(e=g[f-1]),f++,d=g[f],f++;""!==g[f]&&f$1"),h.text.push(d),h.times.push({identifier:e,start:0===mejs.Utility.convertSMPTEtoSeconds(c[1])?.2:mejs.Utility.convertSMPTEtoSeconds(c[1]),stop:mejs.Utility.convertSMPTEtoSeconds(c[3]),settings:c[5]})}e=""}return h}},dfxp:{parse:function(b){b=a(b).filter("tt");var c,d,e=0,f=b.children("div").eq(0),g=f.find("p"),h=b.find("#"+f.attr("style")),i={text:[],times:[]};if(h.length){var j=h.removeAttr("id").get(0).attributes;if(j.length)for(c={},e=0;e$1"),i.text.push(d)}return i}},split2:function(a,b){return a.split(b)}},3!="x\n\ny".split(/\n/gi).length&&(mejs.TrackFormatParser.split2=function(a,b){var c,d=[],e="";for(c=0;c
    ').appendTo(c).hover(function(){clearTimeout(f),b.showSourcechooserSelector()},function(){f=setTimeout(function(){b.hideSourcechooserSelector()},500)}).on("keydown",function(c){var d=c.keyCode;switch(d){case 32:mejs.MediaFeatures.isFirefox||b.showSourcechooserSelector(),a(this).find(".mejs-sourcechooser-selector").find("input[type=radio]:checked").first().focus();break;case 13:b.showSourcechooserSelector(),a(this).find(".mejs-sourcechooser-selector").find("input[type=radio]:checked").first().focus();break;case 27:b.hideSourcechooserSelector(),a(this).find("button").focus();break;default:return!0}}).on("focusout",mejs.Utility.debounce(function(c){setTimeout(function(){var c=a(document.activeElement).closest(".mejs-sourcechooser-selector");c.length||b.hideSourcechooserSelector()},0)},100)).delegate("input[type=radio]","click",function(){a(this).attr("aria-selected",!0).attr("checked","checked"),a(this).closest(".mejs-sourcechooser-selector").find("input[type=radio]").not(this).attr("aria-selected","false").removeAttr("checked");var b=this.value;if(e.currentSrc!==b){var c=e.currentTime,d=e.paused;e.pause(),e.setSrc(b),e.load(),e.addEventListener("loadedmetadata",function(a){e.currentTime=c},!0);var f=function(a){d||e.play(),e.removeEventListener("canplay",f,!0)};e.addEventListener("canplay",f,!0),e.load()}}).delegate("button","click",function(c){a(this).siblings(".mejs-sourcechooser-selector").hasClass("mejs-offscreen")?(b.showSourcechooserSelector(),a(this).siblings(".mejs-sourcechooser-selector").find("input[type=radio]:checked").first().focus()):b.hideSourcechooserSelector()});for(var l in i){var m=i[l];void 0!==m.type&&"SOURCE"===m.nodeName&&null!==e.canPlayType&&b.addSourceButton(m.src,m.title,m.type,e.src===m.src)}}},addSourceButton:function(b,c,d,e){var f=this;(""===c||void 0===c)&&(c=b),d=d.split("/")[1],f.sourcechooserButton.find("ul").append(a('
  • ")),f.adjustSourcechooserBox()},adjustSourcechooserBox:function(){var a=this;a.sourcechooserButton.find(".mejs-sourcechooser-selector").height(a.sourcechooserButton.find(".mejs-sourcechooser-selector ul").outerHeight(!0))},hideSourcechooserSelector:function(){var a=this;void 0!==a.sourcechooserButton&&a.sourcechooserButton.find(".mejs-sourcechooser-selector").find("input[type=radio]").length&&this.sourcechooserButton.find(".mejs-sourcechooser-selector").addClass("mejs-offscreen").attr("aria-expanded","false").attr("aria-hidden","true").find("input[type=radio]").attr("tabindex","-1")},showSourcechooserSelector:function(){var a=this;void 0!==a.sourcechooserButton&&a.sourcechooserButton.find(".mejs-sourcechooser-selector").find("input[type=radio]").length&&this.sourcechooserButton.find(".mejs-sourcechooser-selector").removeClass("mejs-offscreen").attr("aria-expanded","true").attr("aria-hidden","false").find("input[type=radio]").attr("tabindex","0")}})}(mejs.$),function(a){a.extend(mejs.MepDefaults,{contextMenuItems:[{render:function(a){return void 0===a.enterFullScreen?null:a.isFullScreen?mejs.i18n.t("mejs.fullscreen-off"):mejs.i18n.t("mejs.fullscreen-on")},click:function(a){a.isFullScreen?a.exitFullScreen():a.enterFullScreen()}},{render:function(a){return a.media.muted?mejs.i18n.t("mejs.unmute"):mejs.i18n.t("mejs.mute")},click:function(a){a.media.muted?a.setMuted(!1):a.setMuted(!0)}},{isSeparator:!0},{render:function(a){return mejs.i18n.t("mejs.download-video")},click:function(a){window.location.href=a.media.currentSrc}}]}),a.extend(MediaElementPlayer.prototype,{buildcontextmenu:function(b,c,d,e){b.contextMenu=a('
    ').appendTo(a("body")).hide(),b.container.bind("contextmenu",function(a){return b.isContextMenuEnabled?(a.preventDefault(),b.renderContextMenu(a.clientX-1,a.clientY-1),!1):void 0}),b.container.bind("click",function(){b.contextMenu.hide()}),b.contextMenu.bind("mouseleave",function(){b.startContextMenuTimer()})},cleancontextmenu:function(a){a.contextMenu.remove()},isContextMenuEnabled:!0,enableContextMenu:function(){this.isContextMenuEnabled=!0},disableContextMenu:function(){this.isContextMenuEnabled=!1},contextMenuTimeout:null,startContextMenuTimer:function(){var a=this;a.killContextMenuTimer(),a.contextMenuTimer=setTimeout(function(){a.hideContextMenu(),a.killContextMenuTimer()},750)},killContextMenuTimer:function(){var a=this.contextMenuTimer;null!==a&&void 0!==a&&(clearTimeout(a),a=null)},hideContextMenu:function(){this.contextMenu.hide()},renderContextMenu:function(b,c){for(var d=this,e="",f=d.options.contextMenuItems,g=0,h=f.length;h>g;g++)if(f[g].isSeparator)e+='
    ';else{var i=f[g].render(d);null!==i&&void 0!==i&&(e+='
    '+i+"
    ")}d.contextMenu.empty().append(a(e)).css({top:c,left:b}).show(),d.contextMenu.find(".mejs-contextmenu-item").each(function(){var b=a(this),c=parseInt(b.data("itemindex"),10),e=d.options.contextMenuItems[c];"undefined"!=typeof e.show&&e.show(b,d),b.click(function(){"undefined"!=typeof e.click&&e.click(d),d.contextMenu.hide()})}),setTimeout(function(){d.killControlsTimer("rev3")},100)}})}(mejs.$),function(a){a.extend(mejs.MepDefaults,{skipBackInterval:30,skipBackText:""}),a.extend(MediaElementPlayer.prototype,{buildskipback:function(b,c,d,e){var f=this,g=mejs.i18n.t("mejs.time-skip-back",f.options.skipBackInterval),h=f.options.skipBackText?f.options.skipBackText.replace("%1",f.options.skipBackInterval):g;a('
    ").appendTo(c).click(function(){e.duration&&(e.setCurrentTime(Math.max(e.currentTime-f.options.skipBackInterval,0)),a(this).find("button").blur())})}})}(mejs.$),function(a){a.extend(mejs.MepDefaults,{jumpForwardInterval:30,jumpForwardText:""}),a.extend(MediaElementPlayer.prototype,{buildjumpforward:function(b,c,d,e){var f=this,g=mejs.i18n.t("mejs.time-jump-forward",f.options.jumpForwardInterval),h=f.options.jumpForwardText?f.options.jumpForwardText.replace("%1",f.options.jumpForwardInterval):g;a('
    ").appendTo(c).click(function(){e.duration&&(e.setCurrentTime(Math.min(e.currentTime+f.options.jumpForwardInterval,e.duration)),a(this).find("button").blur())})}})}(mejs.$),function(a){a.extend(mejs.MepDefaults,{postrollCloseText:""}),a.extend(MediaElementPlayer.prototype,{buildpostroll:function(b,c,d,e){var f=this,g=f.options.postrollCloseText?f.options.postrollCloseText:mejs.i18n.t("mejs.close"),h=f.container.find('link[rel="postroll"]').attr("href");void 0!==h&&(b.postroll=a('').prependTo(d).hide(),f.media.addEventListener("ended",function(c){a.ajax({dataType:"html",url:h,success:function(a,b){d.find(".mejs-postroll-layer-content").html(a)}}),b.postroll.show()},!1))}})}(mejs.$),function(a){a.extend(mejs.MepDefaults,{markerColor:"#E9BC3D",markers:[],markerCallback:function(){}}),a.extend(MediaElementPlayer.prototype,{buildmarkers:function(a,b,c,d){var e=0,f=-1,g=-1,h=-1,i=-1;for(e=0;e');d.addEventListener("durationchange",function(c){a.setmarkers(b)}),d.addEventListener("timeupdate",function(b){for(f=Math.floor(d.currentTime),h>f?i>f&&(i=-1):h=f,e=0;e=0&&(c=100*Math.floor(d.options.markers[e])/d.media.duration, a(b.find(".mejs-time-marker")[e]).css({width:"1px",left:c+"%",background:d.options.markerColor}))}})}(mejs.$); \ No newline at end of file diff --git a/build/mediaelementplayer.js b/build/mediaelementplayer.js index 457c25dd2..152967e4c 100644 --- a/build/mediaelementplayer.js +++ b/build/mediaelementplayer.js @@ -1547,7 +1547,10 @@ if (jQuery !== undefined) { play: function () { var t = this; - t.load(); + // only load if the current time is 0 to ensure proper + if (t.media.getCurrentTime() <= 0) { + t.load(); + } t.media.play(); }, pause: function () { diff --git a/build/mediaelementplayer.min.js b/build/mediaelementplayer.min.js index 1c78625df..a82ea80a3 100644 --- a/build/mediaelementplayer.min.js +++ b/build/mediaelementplayer.min.js @@ -9,6 +9,6 @@ * License: MIT * */ -void 0!==jQuery?mejs.$=jQuery:void 0!==Zepto?(mejs.$=Zepto,Zepto.fn.outerWidth=function(a){var b=$(this).width();return a&&(b+=parseInt($(this).css("margin-right"),10),b+=parseInt($(this).css("margin-left"),10)),b}):void 0!==ender&&(mejs.$=ender),function(a,b,c,d,e){a.MepDefaults={poster:"",showPosterWhenEnded:!1,defaultVideoWidth:480,defaultVideoHeight:270,videoWidth:-1,videoHeight:-1,defaultAudioWidth:400,defaultAudioHeight:30,defaultSeekBackwardInterval:function(a){return.05*a.duration},defaultSeekForwardInterval:function(a){return.05*a.duration},setDimensions:!0,audioWidth:-1,audioHeight:-1,startVolume:.8,loop:!1,autoRewind:!0,enableAutosize:!0,timeFormat:"",alwaysShowHours:!1,showTimecodeFrameCount:!1,framesPerSecond:25,alwaysShowControls:!1,hideVideoControlsOnLoad:!1,clickToPlayPause:!0,controlsTimeoutDefault:1500,controlsTimeoutMouseEnter:2500,controlsTimeoutMouseLeave:1e3,iPadUseNativeControls:!1,iPhoneUseNativeControls:!1,AndroidUseNativeControls:!1,features:["playpause","current","progress","duration","tracks","volume","fullscreen"],isVideo:!0,stretching:"auto",enableKeyboard:!0,pauseOtherPlayers:!0,keyActions:[{keys:[32,179],action:function(b,c,d,e){a.MediaFeatures.isFirefox||(c.paused||c.ended?c.play():c.pause())}},{keys:[38],action:function(a,b,c,d){a.container.find(".mejs-volume-slider").css("display","block"),a.isVideo&&(a.showControls(),a.startControlsTimer());var e=Math.min(b.volume+.1,1);b.setVolume(e)}},{keys:[40],action:function(a,b,c,d){a.container.find(".mejs-volume-slider").css("display","block"),a.isVideo&&(a.showControls(),a.startControlsTimer());var e=Math.max(b.volume-.1,0);b.setVolume(e)}},{keys:[37,227],action:function(a,b,c,d){if(!isNaN(b.duration)&&b.duration>0){a.isVideo&&(a.showControls(),a.startControlsTimer());var e=Math.max(b.currentTime-a.options.defaultSeekBackwardInterval(b),0);b.setCurrentTime(e)}}},{keys:[39,228],action:function(a,b,c,d){if(!isNaN(b.duration)&&b.duration>0){a.isVideo&&(a.showControls(),a.startControlsTimer());var e=Math.min(b.currentTime+a.options.defaultSeekForwardInterval(b),b.duration);b.setCurrentTime(e)}}},{keys:[70],action:function(a,b,c,d){d.ctrlKey||"undefined"!=typeof a.enterFullScreen&&(a.isFullScreen?a.exitFullScreen():a.enterFullScreen())}},{keys:[77],action:function(a,b,c,d){a.container.find(".mejs-volume-slider").css("display","block"),a.isVideo&&(a.showControls(),a.startControlsTimer()),a.media.muted?a.setMuted(!1):a.setMuted(!0)}}]},a.mepIndex=0,a.players={},a.addEvent=function(a,b,c){a.addEventListener?a.addEventListener(b,c,!1):a.attachEvent&&(a["e"+b+c]=c,a[b+c]=function(){a["e"+b+c](window.event)},a.attachEvent("on"+b,a[b+c]))},a.removeEvent=function(a,b,c){a.removeEventListener?a.removeEventListener(b,c,!1):a.detachEvent&&(a.detachEvent("on"+b,a[b+c]),a[b+c]=null)},a.getElementsByClassName=function(a,b,c){if((b===e||null===b)&&(b=document),b.getElementsByClassName!==e&&null!==b.getElementsByClassName)return b.getElementsByClassName(a);(c===e||null===c)&&(c="*");var d,f=[],g=0,h=b.getElementsByTagName(c),j=h.length;for(i=0;i'+g+"").insertBefore(c.$media),c.container=b('
    ').addClass(c.$media[0].className).insertBefore(c.$media).focus(function(b){if(!c.controlsAreVisible&&!c.hasFocus&&c.controlsEnabled&&(c.showControls(!0),!c.hasMsNativeFullScreen)){var d=".mejs-playpause-button > button";a.Utility.isNodeAfter(b.relatedTarget,c.container[0])&&(d=".mejs-controls .mejs-button:last-child > button");var e=c.container.find(d);e.focus()}}),c.options.features.length||c.container.css("background","transparent").find(".mejs-controls").hide(),c.isVideo&&"fill"===c.options.stretching&&!c.container.parent("mejs-fill-container").length&&(c.outerContainer=c.$media.parent(),c.container.wrap('
    ')),c.container.addClass((d.isAndroid?"mejs-android ":"")+(d.isiOS?"mejs-ios ":"")+(d.isiPad?"mejs-ipad ":"")+(d.isiPhone?"mejs-iphone ":"")+(c.isVideo?"mejs-video ":"mejs-audio ")),c.container.find(".mejs-mediaelement").append(c.$media),c.node.player=c,c.controls=c.container.find(".mejs-controls"),c.layers=c.container.find(".mejs-layers");var h=c.isVideo?"video":"audio",i=h.substring(0,1).toUpperCase()+h.substring(1);c.options[h+"Width"]>0||c.options[h+"Width"].toString().indexOf("%")>-1?c.width=c.options[h+"Width"]:""!==c.media.style.width&&null!==c.media.style.width?c.width=c.media.style.width:null!==c.media.getAttribute("width")?c.width=c.$media.attr("width"):c.width=c.options["default"+i+"Width"],c.options[h+"Height"]>0||c.options[h+"Height"].toString().indexOf("%")>-1?c.height=c.options[h+"Height"]:""!==c.media.style.height&&null!==c.media.style.height?c.height=c.media.style.height:null!==c.$media[0].getAttribute("height")?c.height=c.$media.attr("height"):c.height=c.options["default"+i+"Height"],c.initialAspectRatio=c.height>c.width?c.width/c.height:c.height/c.width,c.setPlayerSize(c.width,c.height),e.pluginWidth=c.width,e.pluginHeight=c.height}else c.isVideo||c.options.features.length||c.$media.hide();a.MediaElement(c.$media[0],e),"undefined"!=typeof c.container&&c.options.features.length&&c.controlsAreVisible&&c.container.trigger("controlsshown")},showControls:function(a){var b=this;a=a===e||a,b.controlsAreVisible||(a?(b.controls.removeClass("mejs-offscreen").stop(!0,!0).fadeIn(200,function(){b.controlsAreVisible=!0,b.container.trigger("controlsshown")}),b.container.find(".mejs-control").removeClass("mejs-offscreen").stop(!0,!0).fadeIn(200,function(){b.controlsAreVisible=!0})):(b.controls.removeClass("mejs-offscreen").css("display","block"),b.container.find(".mejs-control").removeClass("mejs-offscreen").css("display","block"),b.controlsAreVisible=!0,b.container.trigger("controlsshown")),b.setControlsSize())},hideControls:function(a){var c=this;a=a===e||a,!c.controlsAreVisible||c.options.alwaysShowControls||c.keyboardAction||c.media.paused||c.media.ended||(a?(c.controls.stop(!0,!0).fadeOut(200,function(){b(this).addClass("mejs-offscreen").css("display","block"),c.controlsAreVisible=!1,c.container.trigger("controlshidden")}),c.container.find(".mejs-control").stop(!0,!0).fadeOut(200,function(){b(this).addClass("mejs-offscreen").css("display","block")})):(c.controls.addClass("mejs-offscreen").css("display","block"),c.container.find(".mejs-control").addClass("mejs-offscreen").css("display","block"),c.controlsAreVisible=!1,c.container.trigger("controlshidden")))},controlsTimer:null,startControlsTimer:function(a){var b=this;a="undefined"!=typeof a?a:b.options.controlsTimeoutDefault,b.killControlsTimer("start"),b.controlsTimer=setTimeout(function(){b.hideControls(),b.killControlsTimer("hide")},a)},killControlsTimer:function(a){var b=this;null!==b.controlsTimer&&(clearTimeout(b.controlsTimer),delete b.controlsTimer,b.controlsTimer=null)},controlsEnabled:!0,disableControls:function(){var a=this;a.killControlsTimer(),a.hideControls(!1),this.controlsEnabled=!1},enableControls:function(){var a=this;a.showControls(!1),a.controlsEnabled=!0},meReady:function(c,d){var f,g,h=this,i=a.MediaFeatures,j=d.getAttribute("autoplay"),k=!(j===e||null===j||"false"===j),l=null!==c.rendererName&&c.rendererName.match(/(native|html5)/);if(!h.created){if(h.created=!0,h.media=c,h.domNode=d,!(i.isAndroid&&h.options.AndroidUseNativeControls||i.isiPad&&h.options.iPadUseNativeControls||i.isiPhone&&h.options.iPhoneUseNativeControls)){if(!h.isVideo&&!h.options.features.length)return k&&l&&h.play(),void(h.options.success&&("string"==typeof h.options.success?window[h.options.success](h.media,h.domNode,h):h.options.success(h.media,h.domNode,h)));h.buildposter(h,h.controls,h.layers,h.media),h.buildkeyboard(h,h.controls,h.layers,h.media),h.buildoverlays(h,h.controls,h.layers,h.media),h.findTracks();for(f in h.options.features)if(g=h.options.features[f],h["build"+g])try{h["build"+g](h,h.controls,h.layers,h.media)}catch(m){}h.container.trigger("controlsready"),h.setPlayerSize(h.width,h.height),h.setControlsSize(),h.isVideo&&(a.MediaFeatures.hasTouch&&!h.options.alwaysShowControls?h.$media.bind("touchstart",function(){h.controlsAreVisible?h.hideControls(!1):h.controlsEnabled&&h.showControls(!1)}):(h.clickToPlayPauseCallback=function(){if(h.options.clickToPlayPause){var a=h.$media.closest(".mejs-container").find(".mejs-overlay-button"),b=a.attr("aria-pressed");h.media.paused&&b?h.pause():h.media.paused?h.play():h.pause(),a.attr("aria-pressed",!b)}},h.media.addEventListener("click",h.clickToPlayPauseCallback,!1),h.container.bind("mouseenter",function(){h.controlsEnabled&&(h.options.alwaysShowControls||(h.killControlsTimer("enter"),h.showControls(),h.startControlsTimer(h.options.controlsTimeoutMouseEnter)))}).bind("mousemove",function(){h.controlsEnabled&&(h.controlsAreVisible||h.showControls(),h.options.alwaysShowControls||h.startControlsTimer(h.options.controlsTimeoutMouseEnter))}).bind("mouseleave",function(){h.controlsEnabled&&(h.media.paused||h.options.alwaysShowControls||h.startControlsTimer(h.options.controlsTimeoutMouseLeave))})),h.options.hideVideoControlsOnLoad&&h.hideControls(!1),k&&!h.options.alwaysShowControls&&h.hideControls(),h.options.enableAutosize&&h.media.addEventListener("loadedmetadata",function(a){h.options.videoHeight<=0&&!h.domNode.getAttribute("height")&&!isNaN(a.target.videoHeight)&&(h.setPlayerSize(a.target.videoWidth,a.target.videoHeight),h.setControlsSize(),h.media.setSize(a.target.videoWidth,a.target.videoHeight))},!1)),h.media.addEventListener("play",function(){var b;h.hasFocus=!0;for(b in a.players){var c=a.players[b];c.id===h.id||!h.options.pauseOtherPlayers||c.paused||c.ended||(c.pause(),c.hasFocus=!1)}},!1),h.media.addEventListener("ended",function(a){if(h.options.autoRewind)try{h.media.setCurrentTime(0),window.setTimeout(function(){b(h.container).find(".mejs-overlay-loading").parent().hide()},20)}catch(c){}"function"==typeof h.media.stop?h.media.stop():h.media.pause(),h.setProgressRail&&h.setProgressRail(),h.setCurrentRail&&h.setCurrentRail(),h.options.loop?h.play():!h.options.alwaysShowControls&&h.controlsEnabled&&h.showControls()},!1),h.media.addEventListener("loadedmetadata",function(){a.Utility.calculateTimeFormat(h.duration,h.options,h.options.framesPerSecond||25),h.updateDuration&&h.updateDuration(),h.updateCurrent&&h.updateCurrent(),h.isFullScreen||(h.setPlayerSize(h.width,h.height),h.setControlsSize())},!1);var n=null;h.media.addEventListener("timeupdate",function(){n!==this.duration&&(n=this.duration,a.Utility.calculateTimeFormat(n,h.options,h.options.framesPerSecond||25),h.updateDuration&&h.updateDuration(),h.updateCurrent&&h.updateCurrent(),h.setControlsSize())},!1),h.container.focusout(function(a){if(a.relatedTarget){var c=b(a.relatedTarget);h.keyboardAction&&0===c.parents(".mejs-container").length&&(h.keyboardAction=!1,h.isVideo&&!h.options.alwaysShowControls&&h.hideControls(!0))}}),setTimeout(function(){h.setPlayerSize(h.width,h.height),h.setControlsSize()},50),h.globalBind("resize",function(){h.isFullScreen||a.MediaFeatures.hasTrueNativeFullScreen&&document.webkitIsFullScreen||h.setPlayerSize(h.width,h.height),h.setControlsSize()}),null!==h.media.rendererName&&h.media.rendererName.match(/youtube/)&&(i.isiOS||i.isAndroid)&&(h.container.find(".mejs-overlay-play").hide(),h.container.find(".mejs-poster").hide())}k&&l&&h.play(),h.options.success&&("string"==typeof h.options.success?window[h.options.success](h.media,h.domNode,h):h.options.success(h.media,h.domNode,h))}},handleError:function(a){var b=this;b.controls&&b.disableControls(),b.options.error&&b.options.error(a)},setPlayerSize:function(a,c){var d=this;if(!d.options.setDimensions)return!1;if("undefined"!=typeof a&&(d.width=a),"undefined"!=typeof c&&(d.height=c),"undefined"!=typeof FB&&d.isVideo){FB.Event.subscribe("xfbml.ready",function(){var a=b(d.media).children(".fb-video");return d.width=a.width(),d.height=a.height(),d.setDimensions(d.width,d.height),!1});var e=b(d.media).children(".fb-video");e.length&&(d.width=e.width(),d.height=e.height())}switch(d.options.stretching){case"fill":d.isVideo?d.setFillMode():d.setDimensions(d.width,d.height);break;case"responsive":d.setResponsiveMode();break;case"none":d.setDimensions(d.width,d.height);break;default:d.hasFluidMode()===!0?d.setResponsiveMode():d.setDimensions(d.width,d.height)}},hasFluidMode:function(){var a=this;return a.height.toString().indexOf("%")>-1||"none"!==a.$node.css("max-width")&&a.$node.css("max-width")!==a.width||a.$node[0].currentStyle&&"100%"===a.$node[0].currentStyle.maxWidth},setResponsiveMode:function(){var a,d=this,e=(function(){return d.isVideo?d.media.videoWidth&&d.media.videoWidth>0?d.media.videoWidth:null!==d.media.getAttribute("width")?d.media.getAttribute("width"):d.options.defaultVideoWidth:d.options.defaultAudioWidth}(),function(){return d.isVideo?d.media.videoHeight&&d.media.videoHeight>0?d.media.videoHeight:null!==d.media.getAttribute("height")?d.media.getAttribute("height"):d.options.defaultVideoHeight:d.options.defaultAudioHeight}()),f=function(){return ratio=1,d.isVideo?(d.media.videoWidth&&d.media.videoWidth>0&&d.media.videoHeight&&d.media.videoHeight>0?ratio=d.height>=d.width?d.media.videoWidth/d.media.videoHeight:d.media.videoHeight/d.media.videoWidth:ratio=d.initialAspectRatio,(isNaN(ratio)||ratio<.01||ratio>100)&&(ratio=1),ratio):ratio}(),g=d.container.parent().closest(":visible").width(),h=d.container.parent().closest(":visible").height();a=d.isVideo?d.height>=d.width?parseInt(g/f,10):parseInt(g*f,10):e,isNaN(a)&&(a=h),d.container.parent().length>0&&"body"===d.container.parent()[0].tagName.toLowerCase()&&(g=b(c).width(),a=b(c).height()),a&&g&&(d.container.width(g).height(a),d.$media.width("100%").height("100%"),d.isVideo&&d.media.setSize&&d.media.setSize(g,a),d.layers.children(".mejs-layer").width("100%").height("100%"))},setFillMode:function(){var a=this,b=a.outerContainer;"none"!==a.$node.css("height")&&a.$node.css("height")!==a.height&&a.$node.css("height",""),"none"!==a.$node.css("max-width")&&a.$node.css("max-width")!==a.width&&a.$node.css("max-width",""),"none"!==a.$node.css("max-height")&&a.$node.css("max-height")!==a.height&&a.$node.css("max-height",""),a.$node[0].currentStyle&&("100%"===a.$node[0].currentStyle.height&&(a.$node[0].currentStyle.height=""),"100%"===a.$node[0].currentStyle.maxWidth&&(a.$node[0].currentStyle.maxWidth=""),"100%"===a.$node[0].currentStyle.maxHeight&&(a.$node[0].currentStyle.maxHeight="")),b.width()||b.height(a.$media.width()),b.height()||b.height(a.$media.height());var c=b.width(),d=b.height();a.setDimensions("100%","100%"),a.container.find(".mejs-poster img").css("display","block"),targetElement=a.container.find("object, embed, iframe, video");var e=a.height,f=a.width,g=c,h=e*c/f,i=f*d/e,j=d,k=i>c==!1,l=k?Math.floor(g):Math.floor(i),m=k?Math.floor(h):Math.floor(j);k?(targetElement.height(m).width(c),a.media.setSize&&a.media.setSize(c,m)):(targetElement.height(d).width(l),a.media.setSize&&a.media.setSize(l,d)),targetElement.css({"margin-left":Math.floor((c-l)/2),"margin-top":0})},setDimensions:function(a,b){var c=this;c.container.width(a).height(b),c.layers.children(".mejs-layer").width(a).height(b)},setControlsSize:function(){var a=this,c=a.controls.find(".mejs-time-rail");if(a.container.is(":visible")&&c.length&&c.is(":visible")){var d=a.controls.children(),e=parseFloat(d.children(".mejs-time-total").css("margin-left")),f=0;c.siblings().each(function(){f+=b(this).outerWidth(!0)}),f+=2*e,c.width("100%").width("-="+f),a.container.trigger("controlsresize")}},buildposter:function(a,c,d,e){var f=this,g=b('
    ').appendTo(d),h=a.$media.attr("poster");""!==a.options.poster&&(h=a.options.poster),h?f.setPoster(h):g.hide(),e.addEventListener("play",function(){g.hide()},!1),a.options.showPosterWhenEnded&&a.options.autoRewind&&e.addEventListener("ended",function(){g.show()},!1)},setPoster:function(a){var c=this,d=c.container.find(".mejs-poster"),e=d.find("img");0===e.length&&(e=b('').appendTo(d)),e.attr("src",a),d.css({"background-image":"url("+a+")"})},buildoverlays:function(c,d,e,f){var g=this;if(c.isVideo){var h=b('
    ').hide().appendTo(e),i=b('
    ').hide().appendTo(e),j=b('
    ').appendTo(e).bind("click",function(){if(g.options.clickToPlayPause){var a=g.$media.closest(".mejs-container").find(".mejs-overlay-button"),b=a.attr("aria-pressed");f.paused?f.play():f.pause(),a.attr("aria-pressed",!!b)}});(a.Features.isiPhone||null!==g.media.rendererName&&g.media.rendererName.match(/(youtube|facebook)/))&&j.hide(),f.addEventListener("play",function(){j.hide(),h.hide(),d.find(".mejs-time-buffering").hide(),i.hide()},!1),f.addEventListener("playing",function(){j.hide(),h.hide(),d.find(".mejs-time-buffering").hide(),i.hide()},!1),f.addEventListener("seeking",function(){h.show(),d.find(".mejs-time-buffering").show()},!1),f.addEventListener("seeked",function(){h.hide(),d.find(".mejs-time-buffering").hide()},!1),f.addEventListener("pause",function(){a.MediaFeatures.isiPhone||j.show()},!1),f.addEventListener("waiting",function(){h.show(),d.find(".mejs-time-buffering").show()},!1),f.addEventListener("loadeddata",function(){h.show(),d.find(".mejs-time-buffering").show(),a.MediaFeatures.isAndroid&&(f.canplayTimeout=window.setTimeout(function(){if(document.createEvent){var a=document.createEvent("HTMLEvents");return a.initEvent("canplay",!0,!0),f.dispatchEvent(a)}},300))},!1),f.addEventListener("canplay",function(){h.hide(),d.find(".mejs-time-buffering").hide(),clearTimeout(f.canplayTimeout)},!1),f.addEventListener("error",function(a){g.handleError(a),h.hide(),j.hide(),i.show(),i.find(".mejs-overlay-error").html("Error loading this resource")},!1),f.addEventListener("keydown",function(a){g.onkeydown(c,f,a)},!1)}},buildkeyboard:function(a,c,d,e){var f=this;f.container.keydown(function(){f.keyboardAction=!0}),f.globalBind("keydown",function(c){return a.hasFocus=0!==b(c.target).closest(".mejs-container").length&&b(c.target).closest(".mejs-container").attr("id")===a.$media.closest(".mejs-container").attr("id"),f.onkeydown(a,e,c)}),f.globalBind("click",function(c){a.hasFocus=0!==b(c.target).closest(".mejs-container").length})},onkeydown:function(a,b,c){if(a.hasFocus&&a.options.enableKeyboard)for(var d=0,e=a.options.keyActions.length;e>d;d++)for(var f=a.options.keyActions[d],g=0,h=f.keys.length;h>g;g++)if(c.keyCode===f.keys[g])return"function"==typeof c.preventDefault&&c.preventDefault(),f.action(a,b,c.keyCode,c),!1;return!0},findTracks:function(){var a=this,c=a.$media.find("track");a.tracks=[],c.each(function(c,d){d=b(d),a.tracks.push({srclang:d.attr("srclang")?d.attr("srclang").toLowerCase():"",src:d.attr("src"),kind:d.attr("kind"),label:d.attr("label")||"",entries:[],isLoaded:!1})})},changeSkin:function(a){var b=this;b.container[0].className="mejs-container "+a,b.setPlayerSize(b.width,b.height),b.setControlsSize()},play:function(){var a=this;a.load(),a.media.play()},pause:function(){try{this.media.pause()}catch(a){}},load:function(){var a=this;a.isLoaded||a.media.load(),a.isLoaded=!0},setMuted:function(a){this.media.setMuted(a)},setCurrentTime:function(a){this.media.setCurrentTime(a)},getCurrentTime:function(){return this.media.currentTime},setVolume:function(a){this.media.setVolume(a)},getVolume:function(){return this.media.volume},setSrc:function(a){this.media.setSrc(a)},remove:function(){var b,c,d=this;d.container.prev(".mejs-offscreen").remove();for(b in d.options.features)if(c=d.options.features[b],d["clean"+c])try{d["clean"+c](d)}catch(e){}d.isDynamic?d.$node.insertBefore(d.container):(d.$media.prop("controls",!0),d.$node.clone().insertBefore(d.container).show(),d.$node.remove());var f=null!==d.media.rendererName&&d.media.rendererName.match(/(native|html5)/);f||d.media.remove(),delete a.players[d.id],"object"==typeof d.container&&d.container.remove(),d.globalUnbind(),delete d.node.player},rebuildtracks:function(){var a=this;a.findTracks(),a.buildtracks(a,a.controls,a.layers,a.media)},resetSize:function(){var a=this;setTimeout(function(){a.setPlayerSize(a.width,a.height),a.setControlsSize()},50)}},function(){function c(a,c){var e={d:[],w:[]};return b.each((a||"").split(" "),function(a,b){var f=b+"."+c;0===f.indexOf(".")?(e.d.push(f),e.w.push(f)):e[d.test(b)?"w":"d"].push(f)}),e.d=e.d.join(" "),e.w=e.w.join(" "),e}var d=/^((after|before)print|(before)?unload|hashchange|message|o(ff|n)line|page(hide|show)|popstate|resize|storage)\b/;a.MediaElementPlayer.prototype.globalBind=function(a,d,e){var f=this,g=f.node?f.node.ownerDocument:document;a=c(a,f.id),a.d&&b(g).bind(a.d,d,e),a.w&&b(window).bind(a.w,d,e)},a.MediaElementPlayer.prototype.globalUnbind=function(a,d){var e=this,f=e.node?e.node.ownerDocument:document;a=c(a,e.id),a.d&&b(f).unbind(a.d,d),a.w&&b(window).unbind(a.w,d)}}(),"undefined"!=typeof b&&(b.fn.mediaelementplayer=function(c){return c===!1?this.each(function(){var a=b(this).data("mediaelementplayer");a&&a.remove(),b(this).removeData("mediaelementplayer")}):this.each(function(){b(this).data("mediaelementplayer",new a.MediaElementPlayer(this,c))}),this},b(document).ready(function(){b(".mejs-player").mediaelementplayer()})),window.MediaElementPlayer=a.MediaElementPlayer}(mejs,mejs.$,window,document),function(a){a.extend(mejs.MepDefaults,{playText:"",pauseText:""}),a.extend(MediaElementPlayer.prototype,{buildplaypause:function(b,c,d,e){function f(a){"play"===a?(k.removeClass("mejs-play").addClass("mejs-pause"),l.attr({title:j,"aria-label":j})):(k.removeClass("mejs-pause").addClass("mejs-play"),l.attr({title:i,"aria-label":i}))}var g=this,h=g.options,i=h.playText?h.playText:mejs.i18n.t("mejs.play"),j=h.pauseText?h.pauseText:mejs.i18n.t("mejs.pause"),k=a('
    ').appendTo(c).click(function(a){return a.preventDefault(),e.paused?e.play():e.pause(),!1}),l=k.find("button");f("pse"),e.addEventListener("play",function(){f("play")},!1),e.addEventListener("playing",function(){f("play")},!1),e.addEventListener("pause",function(){f("pse")},!1),e.addEventListener("paused",function(){f("pse")},!1)}})}(mejs.$),function(a){a.extend(mejs.MepDefaults,{stopText:""}),a.extend(MediaElementPlayer.prototype,{buildstop:function(b,c,d,e){var f=this,g=f.options.stopText?f.options.stopText:mejs.i18n.t("mejs.stop");a('
    ').appendTo(c).click(function(){e.paused||e.pause(),e.currentTime>0&&(e.setCurrentTime(0),e.pause(),c.find(".mejs-time-current").width("0px"),c.find(".mejs-time-handle").css("left","0px"),c.find(".mejs-time-float-current").html(mejs.Utility.secondsToTimeCode(0,b.options.alwaysShowHours)),c.find(".mejs-currenttime").html(mejs.Utility.secondsToTimeCode(0,b.options.alwaysShowHours)),d.find(".mejs-poster").show())})}})}(mejs.$),function(a){a.extend(mejs.MepDefaults,{enableProgressTooltip:!0,progressHelpText:""}),a.extend(MediaElementPlayer.prototype,{buildprogress:function(b,c,d,e){var f=this,g=!1,h=!1,i=0,j=!1,k=b.options.autoRewind,l=(f.options.progressHelpText?f.options.progressHelpText:mejs.i18n.t("mejs.time-help-text"),b.options.enableProgressTooltip?'00:00':"");a('
    '+l+"
    ").appendTo(c),c.find(".mejs-time-buffering").hide(),f.total=c.find(".mejs-time-total"),f.loaded=c.find(".mejs-time-loaded"),f.current=c.find(".mejs-time-current"),f.handle=c.find(".mejs-time-handle"),f.timefloat=c.find(".mejs-time-float"),f.timefloatcurrent=c.find(".mejs-time-float-current"),f.slider=c.find(".mejs-time-slider");var m=function(a){var c,d=f.total.offset(),h=f.total.width(),i=0,j=0,k=0;c=a.originalEvent&&a.originalEvent.changedTouches?a.originalEvent.changedTouches[0].pageX:a.changedTouches?a.changedTouches[0].pageX:a.pageX,e.duration&&(ch+d.left&&(c=h+d.left),k=c-d.left,i=k/h,j=.02>=i?0:i*e.duration,g&&j.toFixed(4)!==e.currentTime.toFixed(4)&&e.setCurrentTime(j),mejs.MediaFeatures.hasTouch||(f.timefloat.css("left",k),f.timefloatcurrent.html(mejs.Utility.secondsToTimeCode(j,b.options.alwaysShowHours)),f.timefloat.show()))},n=function(){var a=e.currentTime,c=mejs.i18n.t("mejs.time-slider"),d=mejs.Utility.secondsToTimeCode(a,b.options.alwaysShowHours),g=e.duration;f.slider.attr({role:"slider",tabindex:0}),e.paused?f.slider.attr({"aria-label":c,"aria-valuemin":0,"aria-valuemax":g,"aria-valuenow":a,"aria-valuetext":d}):f.slider.removeAttr("aria-label aria-valuemin aria-valuemax aria-valuenow aria-valuetext")},o=function(){var a=new Date;a-i>=1e3&&e.play()};f.slider.bind("focus",function(a){b.options.autoRewind=!1}),f.slider.bind("blur",function(a){b.options.autoRewind=k}),f.slider.bind("keydown",function(a){if(new Date-i>=1e3&&(j=e.paused),f.options.keyActions.length){var c=a.keyCode,d=e.duration,g=e.currentTime,h=b.options.defaultSeekForwardInterval(e),k=b.options.defaultSeekBackwardInterval(e);switch(c){case 37:case 40:g-=k;break;case 39:case 38:g+=h;break;case 36:g=0;break;case 35:g=d;break;case 32:return void(mejs.Utility.isFirefox||(e.paused?e.play():e.pause()));case 13:return void(e.paused?e.play():e.pause());default:return}g=0>g?0:g>=d?d:Math.floor(g),i=new Date,j||e.pause(),g0&&c.buffered.end&&c.duration?d=c.buffered.end(c.buffered.length-1)/c.duration:c&&void 0!==c.bytesTotal&&c.bytesTotal>0&&void 0!==c.bufferedBytes?d=c.bufferedBytes/c.bytesTotal:a&&a.lengthComputable&&0!==a.total&&(d=a.loaded/a.total),null!==d&&(d=Math.min(1,Math.max(0,d)),b.loaded&&b.total&&b.loaded.width(100*d+"%"))},setCurrentRail:function(){var a=this;if(void 0!==a.media.currentTime&&a.media.duration&&a.total&&a.handle){var b=Math.round(a.total.width()*a.media.currentTime/a.media.duration),c=b-Math.round(a.handle.outerWidth(!0)/2);b=a.media.currentTime/a.media.duration*100,a.current.width(b+"%"),a.handle.css("left",c)}}})}(mejs.$),function(a){a.extend(mejs.MepDefaults,{duration:0,timeAndDurationSeparator:" | "}),a.extend(MediaElementPlayer.prototype,{buildcurrent:function(b,c,d,e){var f=this;a('
    '+mejs.Utility.secondsToTimeCode(0,b.options.alwaysShowHours)+"
    ").appendTo(c),f.currenttime=f.controls.find(".mejs-currenttime"),e.addEventListener("timeupdate",function(){f.controlsAreVisible&&b.updateCurrent()},!1)},buildduration:function(b,c,d,e){var f=this;c.children().last().find(".mejs-currenttime").length>0?a(f.options.timeAndDurationSeparator+''+mejs.Utility.secondsToTimeCode(f.options.duration,f.options.alwaysShowHours)+"").appendTo(c.find(".mejs-time")):(c.find(".mejs-currenttime").parent().addClass("mejs-currenttime-container"),a('
    '+mejs.Utility.secondsToTimeCode(f.options.duration,f.options.alwaysShowHours)+"
    ").appendTo(c)),f.durationD=f.controls.find(".mejs-duration"),e.addEventListener("timeupdate",function(){f.controlsAreVisible&&b.updateDuration()},!1)},updateCurrent:function(){var a=this,b=a.media.currentTime;isNaN(b)&&(b=0),a.currenttime&&a.currenttime.html(mejs.Utility.secondsToTimeCode(b,a.options.alwaysShowHours))},updateDuration:function(){var a=this,b=a.media.duration;(isNaN(b)||b==1/0||0>b)&&(a.media.duration=a.options.duration=b=0),a.options.duration>0&&(b=a.options.duration),a.container.toggleClass("mejs-long-video",b>3600),a.durationD&&b>0&&a.durationD.html(mejs.Utility.secondsToTimeCode(b,a.options.alwaysShowHours))}})}(mejs.$),function(a){a.extend(mejs.MepDefaults,{muteText:mejs.i18n.t("mejs.mute-toggle"),allyVolumeControlText:mejs.i18n.t("mejs.volume-help-text"),hideVolumeOnTouchDevices:!0,audioVolume:"horizontal",videoVolume:"vertical"}),a.extend(MediaElementPlayer.prototype,{buildvolume:function(b,c,d,e){if(!mejs.MediaFeatures.isAndroid&&!mejs.MediaFeatures.isiOS||!this.options.hideVolumeOnTouchDevices){var f=this,g=f.isVideo?f.options.videoVolume:f.options.audioVolume,h="horizontal"===g?a('
    '+f.options.allyVolumeControlText+'
    ').appendTo(c):a('').appendTo(c),i=f.container.find(".mejs-volume-slider, .mejs-horizontal-volume-slider"),j=f.container.find(".mejs-volume-total, .mejs-horizontal-volume-total"),k=f.container.find(".mejs-volume-current, .mejs-horizontal-volume-current"),l=f.container.find(".mejs-volume-handle, .mejs-horizontal-volume-handle"),m=function(a,b){ +void 0!==jQuery?mejs.$=jQuery:void 0!==Zepto?(mejs.$=Zepto,Zepto.fn.outerWidth=function(a){var b=$(this).width();return a&&(b+=parseInt($(this).css("margin-right"),10),b+=parseInt($(this).css("margin-left"),10)),b}):void 0!==ender&&(mejs.$=ender),function(a,b,c,d,e){a.MepDefaults={poster:"",showPosterWhenEnded:!1,defaultVideoWidth:480,defaultVideoHeight:270,videoWidth:-1,videoHeight:-1,defaultAudioWidth:400,defaultAudioHeight:30,defaultSeekBackwardInterval:function(a){return.05*a.duration},defaultSeekForwardInterval:function(a){return.05*a.duration},setDimensions:!0,audioWidth:-1,audioHeight:-1,startVolume:.8,loop:!1,autoRewind:!0,enableAutosize:!0,timeFormat:"",alwaysShowHours:!1,showTimecodeFrameCount:!1,framesPerSecond:25,alwaysShowControls:!1,hideVideoControlsOnLoad:!1,clickToPlayPause:!0,controlsTimeoutDefault:1500,controlsTimeoutMouseEnter:2500,controlsTimeoutMouseLeave:1e3,iPadUseNativeControls:!1,iPhoneUseNativeControls:!1,AndroidUseNativeControls:!1,features:["playpause","current","progress","duration","tracks","volume","fullscreen"],isVideo:!0,stretching:"auto",enableKeyboard:!0,pauseOtherPlayers:!0,keyActions:[{keys:[32,179],action:function(b,c,d,e){a.MediaFeatures.isFirefox||(c.paused||c.ended?c.play():c.pause())}},{keys:[38],action:function(a,b,c,d){a.container.find(".mejs-volume-slider").css("display","block"),a.isVideo&&(a.showControls(),a.startControlsTimer());var e=Math.min(b.volume+.1,1);b.setVolume(e)}},{keys:[40],action:function(a,b,c,d){a.container.find(".mejs-volume-slider").css("display","block"),a.isVideo&&(a.showControls(),a.startControlsTimer());var e=Math.max(b.volume-.1,0);b.setVolume(e)}},{keys:[37,227],action:function(a,b,c,d){if(!isNaN(b.duration)&&b.duration>0){a.isVideo&&(a.showControls(),a.startControlsTimer());var e=Math.max(b.currentTime-a.options.defaultSeekBackwardInterval(b),0);b.setCurrentTime(e)}}},{keys:[39,228],action:function(a,b,c,d){if(!isNaN(b.duration)&&b.duration>0){a.isVideo&&(a.showControls(),a.startControlsTimer());var e=Math.min(b.currentTime+a.options.defaultSeekForwardInterval(b),b.duration);b.setCurrentTime(e)}}},{keys:[70],action:function(a,b,c,d){d.ctrlKey||"undefined"!=typeof a.enterFullScreen&&(a.isFullScreen?a.exitFullScreen():a.enterFullScreen())}},{keys:[77],action:function(a,b,c,d){a.container.find(".mejs-volume-slider").css("display","block"),a.isVideo&&(a.showControls(),a.startControlsTimer()),a.media.muted?a.setMuted(!1):a.setMuted(!0)}}]},a.mepIndex=0,a.players={},a.addEvent=function(a,b,c){a.addEventListener?a.addEventListener(b,c,!1):a.attachEvent&&(a["e"+b+c]=c,a[b+c]=function(){a["e"+b+c](window.event)},a.attachEvent("on"+b,a[b+c]))},a.removeEvent=function(a,b,c){a.removeEventListener?a.removeEventListener(b,c,!1):a.detachEvent&&(a.detachEvent("on"+b,a[b+c]),a[b+c]=null)},a.getElementsByClassName=function(a,b,c){if((b===e||null===b)&&(b=document),b.getElementsByClassName!==e&&null!==b.getElementsByClassName)return b.getElementsByClassName(a);(c===e||null===c)&&(c="*");var d,f=[],g=0,h=b.getElementsByTagName(c),j=h.length;for(i=0;i'+g+"").insertBefore(c.$media),c.container=b('
    ').addClass(c.$media[0].className).insertBefore(c.$media).focus(function(b){if(!c.controlsAreVisible&&!c.hasFocus&&c.controlsEnabled&&(c.showControls(!0),!c.hasMsNativeFullScreen)){var d=".mejs-playpause-button > button";a.Utility.isNodeAfter(b.relatedTarget,c.container[0])&&(d=".mejs-controls .mejs-button:last-child > button");var e=c.container.find(d);e.focus()}}),c.options.features.length||c.container.css("background","transparent").find(".mejs-controls").hide(),c.isVideo&&"fill"===c.options.stretching&&!c.container.parent("mejs-fill-container").length&&(c.outerContainer=c.$media.parent(),c.container.wrap('
    ')),c.container.addClass((d.isAndroid?"mejs-android ":"")+(d.isiOS?"mejs-ios ":"")+(d.isiPad?"mejs-ipad ":"")+(d.isiPhone?"mejs-iphone ":"")+(c.isVideo?"mejs-video ":"mejs-audio ")),c.container.find(".mejs-mediaelement").append(c.$media),c.node.player=c,c.controls=c.container.find(".mejs-controls"),c.layers=c.container.find(".mejs-layers");var h=c.isVideo?"video":"audio",i=h.substring(0,1).toUpperCase()+h.substring(1);c.options[h+"Width"]>0||c.options[h+"Width"].toString().indexOf("%")>-1?c.width=c.options[h+"Width"]:""!==c.media.style.width&&null!==c.media.style.width?c.width=c.media.style.width:null!==c.media.getAttribute("width")?c.width=c.$media.attr("width"):c.width=c.options["default"+i+"Width"],c.options[h+"Height"]>0||c.options[h+"Height"].toString().indexOf("%")>-1?c.height=c.options[h+"Height"]:""!==c.media.style.height&&null!==c.media.style.height?c.height=c.media.style.height:null!==c.$media[0].getAttribute("height")?c.height=c.$media.attr("height"):c.height=c.options["default"+i+"Height"],c.initialAspectRatio=c.height>c.width?c.width/c.height:c.height/c.width,c.setPlayerSize(c.width,c.height),e.pluginWidth=c.width,e.pluginHeight=c.height}else c.isVideo||c.options.features.length||c.$media.hide();a.MediaElement(c.$media[0],e),"undefined"!=typeof c.container&&c.options.features.length&&c.controlsAreVisible&&c.container.trigger("controlsshown")},showControls:function(a){var b=this;a=a===e||a,b.controlsAreVisible||(a?(b.controls.removeClass("mejs-offscreen").stop(!0,!0).fadeIn(200,function(){b.controlsAreVisible=!0,b.container.trigger("controlsshown")}),b.container.find(".mejs-control").removeClass("mejs-offscreen").stop(!0,!0).fadeIn(200,function(){b.controlsAreVisible=!0})):(b.controls.removeClass("mejs-offscreen").css("display","block"),b.container.find(".mejs-control").removeClass("mejs-offscreen").css("display","block"),b.controlsAreVisible=!0,b.container.trigger("controlsshown")),b.setControlsSize())},hideControls:function(a){var c=this;a=a===e||a,!c.controlsAreVisible||c.options.alwaysShowControls||c.keyboardAction||c.media.paused||c.media.ended||(a?(c.controls.stop(!0,!0).fadeOut(200,function(){b(this).addClass("mejs-offscreen").css("display","block"),c.controlsAreVisible=!1,c.container.trigger("controlshidden")}),c.container.find(".mejs-control").stop(!0,!0).fadeOut(200,function(){b(this).addClass("mejs-offscreen").css("display","block")})):(c.controls.addClass("mejs-offscreen").css("display","block"),c.container.find(".mejs-control").addClass("mejs-offscreen").css("display","block"),c.controlsAreVisible=!1,c.container.trigger("controlshidden")))},controlsTimer:null,startControlsTimer:function(a){var b=this;a="undefined"!=typeof a?a:b.options.controlsTimeoutDefault,b.killControlsTimer("start"),b.controlsTimer=setTimeout(function(){b.hideControls(),b.killControlsTimer("hide")},a)},killControlsTimer:function(a){var b=this;null!==b.controlsTimer&&(clearTimeout(b.controlsTimer),delete b.controlsTimer,b.controlsTimer=null)},controlsEnabled:!0,disableControls:function(){var a=this;a.killControlsTimer(),a.hideControls(!1),this.controlsEnabled=!1},enableControls:function(){var a=this;a.showControls(!1),a.controlsEnabled=!0},meReady:function(c,d){var f,g,h=this,i=a.MediaFeatures,j=d.getAttribute("autoplay"),k=!(j===e||null===j||"false"===j),l=null!==c.rendererName&&c.rendererName.match(/(native|html5)/);if(!h.created){if(h.created=!0,h.media=c,h.domNode=d,!(i.isAndroid&&h.options.AndroidUseNativeControls||i.isiPad&&h.options.iPadUseNativeControls||i.isiPhone&&h.options.iPhoneUseNativeControls)){if(!h.isVideo&&!h.options.features.length)return k&&l&&h.play(),void(h.options.success&&("string"==typeof h.options.success?window[h.options.success](h.media,h.domNode,h):h.options.success(h.media,h.domNode,h)));h.buildposter(h,h.controls,h.layers,h.media),h.buildkeyboard(h,h.controls,h.layers,h.media),h.buildoverlays(h,h.controls,h.layers,h.media),h.findTracks();for(f in h.options.features)if(g=h.options.features[f],h["build"+g])try{h["build"+g](h,h.controls,h.layers,h.media)}catch(m){}h.container.trigger("controlsready"),h.setPlayerSize(h.width,h.height),h.setControlsSize(),h.isVideo&&(a.MediaFeatures.hasTouch&&!h.options.alwaysShowControls?h.$media.bind("touchstart",function(){h.controlsAreVisible?h.hideControls(!1):h.controlsEnabled&&h.showControls(!1)}):(h.clickToPlayPauseCallback=function(){if(h.options.clickToPlayPause){var a=h.$media.closest(".mejs-container").find(".mejs-overlay-button"),b=a.attr("aria-pressed");h.media.paused&&b?h.pause():h.media.paused?h.play():h.pause(),a.attr("aria-pressed",!b)}},h.media.addEventListener("click",h.clickToPlayPauseCallback,!1),h.container.bind("mouseenter",function(){h.controlsEnabled&&(h.options.alwaysShowControls||(h.killControlsTimer("enter"),h.showControls(),h.startControlsTimer(h.options.controlsTimeoutMouseEnter)))}).bind("mousemove",function(){h.controlsEnabled&&(h.controlsAreVisible||h.showControls(),h.options.alwaysShowControls||h.startControlsTimer(h.options.controlsTimeoutMouseEnter))}).bind("mouseleave",function(){h.controlsEnabled&&(h.media.paused||h.options.alwaysShowControls||h.startControlsTimer(h.options.controlsTimeoutMouseLeave))})),h.options.hideVideoControlsOnLoad&&h.hideControls(!1),k&&!h.options.alwaysShowControls&&h.hideControls(),h.options.enableAutosize&&h.media.addEventListener("loadedmetadata",function(a){h.options.videoHeight<=0&&!h.domNode.getAttribute("height")&&!isNaN(a.target.videoHeight)&&(h.setPlayerSize(a.target.videoWidth,a.target.videoHeight),h.setControlsSize(),h.media.setSize(a.target.videoWidth,a.target.videoHeight))},!1)),h.media.addEventListener("play",function(){var b;h.hasFocus=!0;for(b in a.players){var c=a.players[b];c.id===h.id||!h.options.pauseOtherPlayers||c.paused||c.ended||(c.pause(),c.hasFocus=!1)}},!1),h.media.addEventListener("ended",function(a){if(h.options.autoRewind)try{h.media.setCurrentTime(0),window.setTimeout(function(){b(h.container).find(".mejs-overlay-loading").parent().hide()},20)}catch(c){}"function"==typeof h.media.stop?h.media.stop():h.media.pause(),h.setProgressRail&&h.setProgressRail(),h.setCurrentRail&&h.setCurrentRail(),h.options.loop?h.play():!h.options.alwaysShowControls&&h.controlsEnabled&&h.showControls()},!1),h.media.addEventListener("loadedmetadata",function(){a.Utility.calculateTimeFormat(h.duration,h.options,h.options.framesPerSecond||25),h.updateDuration&&h.updateDuration(),h.updateCurrent&&h.updateCurrent(),h.isFullScreen||(h.setPlayerSize(h.width,h.height),h.setControlsSize())},!1);var n=null;h.media.addEventListener("timeupdate",function(){n!==this.duration&&(n=this.duration,a.Utility.calculateTimeFormat(n,h.options,h.options.framesPerSecond||25),h.updateDuration&&h.updateDuration(),h.updateCurrent&&h.updateCurrent(),h.setControlsSize())},!1),h.container.focusout(function(a){if(a.relatedTarget){var c=b(a.relatedTarget);h.keyboardAction&&0===c.parents(".mejs-container").length&&(h.keyboardAction=!1,h.isVideo&&!h.options.alwaysShowControls&&h.hideControls(!0))}}),setTimeout(function(){h.setPlayerSize(h.width,h.height),h.setControlsSize()},50),h.globalBind("resize",function(){h.isFullScreen||a.MediaFeatures.hasTrueNativeFullScreen&&document.webkitIsFullScreen||h.setPlayerSize(h.width,h.height),h.setControlsSize()}),null!==h.media.rendererName&&h.media.rendererName.match(/youtube/)&&(i.isiOS||i.isAndroid)&&(h.container.find(".mejs-overlay-play").hide(),h.container.find(".mejs-poster").hide())}k&&l&&h.play(),h.options.success&&("string"==typeof h.options.success?window[h.options.success](h.media,h.domNode,h):h.options.success(h.media,h.domNode,h))}},handleError:function(a){var b=this;b.controls&&b.disableControls(),b.options.error&&b.options.error(a)},setPlayerSize:function(a,c){var d=this;if(!d.options.setDimensions)return!1;if("undefined"!=typeof a&&(d.width=a),"undefined"!=typeof c&&(d.height=c),"undefined"!=typeof FB&&d.isVideo){FB.Event.subscribe("xfbml.ready",function(){var a=b(d.media).children(".fb-video");return d.width=a.width(),d.height=a.height(),d.setDimensions(d.width,d.height),!1});var e=b(d.media).children(".fb-video");e.length&&(d.width=e.width(),d.height=e.height())}switch(d.options.stretching){case"fill":d.isVideo?d.setFillMode():d.setDimensions(d.width,d.height);break;case"responsive":d.setResponsiveMode();break;case"none":d.setDimensions(d.width,d.height);break;default:d.hasFluidMode()===!0?d.setResponsiveMode():d.setDimensions(d.width,d.height)}},hasFluidMode:function(){var a=this;return a.height.toString().indexOf("%")>-1||"none"!==a.$node.css("max-width")&&a.$node.css("max-width")!==a.width||a.$node[0].currentStyle&&"100%"===a.$node[0].currentStyle.maxWidth},setResponsiveMode:function(){var a,d=this,e=(function(){return d.isVideo?d.media.videoWidth&&d.media.videoWidth>0?d.media.videoWidth:null!==d.media.getAttribute("width")?d.media.getAttribute("width"):d.options.defaultVideoWidth:d.options.defaultAudioWidth}(),function(){return d.isVideo?d.media.videoHeight&&d.media.videoHeight>0?d.media.videoHeight:null!==d.media.getAttribute("height")?d.media.getAttribute("height"):d.options.defaultVideoHeight:d.options.defaultAudioHeight}()),f=function(){return ratio=1,d.isVideo?(d.media.videoWidth&&d.media.videoWidth>0&&d.media.videoHeight&&d.media.videoHeight>0?ratio=d.height>=d.width?d.media.videoWidth/d.media.videoHeight:d.media.videoHeight/d.media.videoWidth:ratio=d.initialAspectRatio,(isNaN(ratio)||ratio<.01||ratio>100)&&(ratio=1),ratio):ratio}(),g=d.container.parent().closest(":visible").width(),h=d.container.parent().closest(":visible").height();a=d.isVideo?d.height>=d.width?parseInt(g/f,10):parseInt(g*f,10):e,isNaN(a)&&(a=h),d.container.parent().length>0&&"body"===d.container.parent()[0].tagName.toLowerCase()&&(g=b(c).width(),a=b(c).height()),a&&g&&(d.container.width(g).height(a),d.$media.width("100%").height("100%"),d.isVideo&&d.media.setSize&&d.media.setSize(g,a),d.layers.children(".mejs-layer").width("100%").height("100%"))},setFillMode:function(){var a=this,b=a.outerContainer;"none"!==a.$node.css("height")&&a.$node.css("height")!==a.height&&a.$node.css("height",""),"none"!==a.$node.css("max-width")&&a.$node.css("max-width")!==a.width&&a.$node.css("max-width",""),"none"!==a.$node.css("max-height")&&a.$node.css("max-height")!==a.height&&a.$node.css("max-height",""),a.$node[0].currentStyle&&("100%"===a.$node[0].currentStyle.height&&(a.$node[0].currentStyle.height=""),"100%"===a.$node[0].currentStyle.maxWidth&&(a.$node[0].currentStyle.maxWidth=""),"100%"===a.$node[0].currentStyle.maxHeight&&(a.$node[0].currentStyle.maxHeight="")),b.width()||b.height(a.$media.width()),b.height()||b.height(a.$media.height());var c=b.width(),d=b.height();a.setDimensions("100%","100%"),a.container.find(".mejs-poster img").css("display","block"),targetElement=a.container.find("object, embed, iframe, video");var e=a.height,f=a.width,g=c,h=e*c/f,i=f*d/e,j=d,k=i>c==!1,l=k?Math.floor(g):Math.floor(i),m=k?Math.floor(h):Math.floor(j);k?(targetElement.height(m).width(c),a.media.setSize&&a.media.setSize(c,m)):(targetElement.height(d).width(l),a.media.setSize&&a.media.setSize(l,d)),targetElement.css({"margin-left":Math.floor((c-l)/2),"margin-top":0})},setDimensions:function(a,b){var c=this;c.container.width(a).height(b),c.layers.children(".mejs-layer").width(a).height(b)},setControlsSize:function(){var a=this,c=a.controls.find(".mejs-time-rail");if(a.container.is(":visible")&&c.length&&c.is(":visible")){var d=a.controls.children(),e=parseFloat(d.children(".mejs-time-total").css("margin-left")),f=0;c.siblings().each(function(){f+=b(this).outerWidth(!0)}),f+=2*e,c.width("100%").width("-="+f),a.container.trigger("controlsresize")}},buildposter:function(a,c,d,e){var f=this,g=b('
    ').appendTo(d),h=a.$media.attr("poster");""!==a.options.poster&&(h=a.options.poster),h?f.setPoster(h):g.hide(),e.addEventListener("play",function(){g.hide()},!1),a.options.showPosterWhenEnded&&a.options.autoRewind&&e.addEventListener("ended",function(){g.show()},!1)},setPoster:function(a){var c=this,d=c.container.find(".mejs-poster"),e=d.find("img");0===e.length&&(e=b('').appendTo(d)),e.attr("src",a),d.css({"background-image":"url("+a+")"})},buildoverlays:function(c,d,e,f){var g=this;if(c.isVideo){var h=b('
    ').hide().appendTo(e),i=b('
    ').hide().appendTo(e),j=b('
    ').appendTo(e).bind("click",function(){if(g.options.clickToPlayPause){var a=g.$media.closest(".mejs-container").find(".mejs-overlay-button"),b=a.attr("aria-pressed");f.paused?f.play():f.pause(),a.attr("aria-pressed",!!b)}});(a.Features.isiPhone||null!==g.media.rendererName&&g.media.rendererName.match(/(youtube|facebook)/))&&j.hide(),f.addEventListener("play",function(){j.hide(),h.hide(),d.find(".mejs-time-buffering").hide(),i.hide()},!1),f.addEventListener("playing",function(){j.hide(),h.hide(),d.find(".mejs-time-buffering").hide(),i.hide()},!1),f.addEventListener("seeking",function(){h.show(),d.find(".mejs-time-buffering").show()},!1),f.addEventListener("seeked",function(){h.hide(),d.find(".mejs-time-buffering").hide()},!1),f.addEventListener("pause",function(){a.MediaFeatures.isiPhone||j.show()},!1),f.addEventListener("waiting",function(){h.show(),d.find(".mejs-time-buffering").show()},!1),f.addEventListener("loadeddata",function(){h.show(),d.find(".mejs-time-buffering").show(),a.MediaFeatures.isAndroid&&(f.canplayTimeout=window.setTimeout(function(){if(document.createEvent){var a=document.createEvent("HTMLEvents");return a.initEvent("canplay",!0,!0),f.dispatchEvent(a)}},300))},!1),f.addEventListener("canplay",function(){h.hide(),d.find(".mejs-time-buffering").hide(),clearTimeout(f.canplayTimeout)},!1),f.addEventListener("error",function(a){g.handleError(a),h.hide(),j.hide(),i.show(),i.find(".mejs-overlay-error").html("Error loading this resource")},!1),f.addEventListener("keydown",function(a){g.onkeydown(c,f,a)},!1)}},buildkeyboard:function(a,c,d,e){var f=this;f.container.keydown(function(){f.keyboardAction=!0}),f.globalBind("keydown",function(c){return a.hasFocus=0!==b(c.target).closest(".mejs-container").length&&b(c.target).closest(".mejs-container").attr("id")===a.$media.closest(".mejs-container").attr("id"),f.onkeydown(a,e,c)}),f.globalBind("click",function(c){a.hasFocus=0!==b(c.target).closest(".mejs-container").length})},onkeydown:function(a,b,c){if(a.hasFocus&&a.options.enableKeyboard)for(var d=0,e=a.options.keyActions.length;e>d;d++)for(var f=a.options.keyActions[d],g=0,h=f.keys.length;h>g;g++)if(c.keyCode===f.keys[g])return"function"==typeof c.preventDefault&&c.preventDefault(),f.action(a,b,c.keyCode,c),!1;return!0},findTracks:function(){var a=this,c=a.$media.find("track");a.tracks=[],c.each(function(c,d){d=b(d),a.tracks.push({srclang:d.attr("srclang")?d.attr("srclang").toLowerCase():"",src:d.attr("src"),kind:d.attr("kind"),label:d.attr("label")||"",entries:[],isLoaded:!1})})},changeSkin:function(a){var b=this;b.container[0].className="mejs-container "+a,b.setPlayerSize(b.width,b.height),b.setControlsSize()},play:function(){var a=this;a.media.getCurrentTime()<=0&&a.load(),a.media.play()},pause:function(){try{this.media.pause()}catch(a){}},load:function(){var a=this;a.isLoaded||a.media.load(),a.isLoaded=!0},setMuted:function(a){this.media.setMuted(a)},setCurrentTime:function(a){this.media.setCurrentTime(a)},getCurrentTime:function(){return this.media.currentTime},setVolume:function(a){this.media.setVolume(a)},getVolume:function(){return this.media.volume},setSrc:function(a){this.media.setSrc(a)},remove:function(){var b,c,d=this;d.container.prev(".mejs-offscreen").remove();for(b in d.options.features)if(c=d.options.features[b],d["clean"+c])try{d["clean"+c](d)}catch(e){}d.isDynamic?d.$node.insertBefore(d.container):(d.$media.prop("controls",!0),d.$node.clone().insertBefore(d.container).show(),d.$node.remove());var f=null!==d.media.rendererName&&d.media.rendererName.match(/(native|html5)/);f||d.media.remove(),delete a.players[d.id],"object"==typeof d.container&&d.container.remove(),d.globalUnbind(),delete d.node.player},rebuildtracks:function(){var a=this;a.findTracks(),a.buildtracks(a,a.controls,a.layers,a.media)},resetSize:function(){var a=this;setTimeout(function(){a.setPlayerSize(a.width,a.height),a.setControlsSize()},50)}},function(){function c(a,c){var e={d:[],w:[]};return b.each((a||"").split(" "),function(a,b){var f=b+"."+c;0===f.indexOf(".")?(e.d.push(f),e.w.push(f)):e[d.test(b)?"w":"d"].push(f)}),e.d=e.d.join(" "),e.w=e.w.join(" "),e}var d=/^((after|before)print|(before)?unload|hashchange|message|o(ff|n)line|page(hide|show)|popstate|resize|storage)\b/;a.MediaElementPlayer.prototype.globalBind=function(a,d,e){var f=this,g=f.node?f.node.ownerDocument:document;a=c(a,f.id),a.d&&b(g).bind(a.d,d,e),a.w&&b(window).bind(a.w,d,e)},a.MediaElementPlayer.prototype.globalUnbind=function(a,d){var e=this,f=e.node?e.node.ownerDocument:document;a=c(a,e.id),a.d&&b(f).unbind(a.d,d),a.w&&b(window).unbind(a.w,d)}}(),"undefined"!=typeof b&&(b.fn.mediaelementplayer=function(c){return c===!1?this.each(function(){var a=b(this).data("mediaelementplayer");a&&a.remove(),b(this).removeData("mediaelementplayer")}):this.each(function(){b(this).data("mediaelementplayer",new a.MediaElementPlayer(this,c))}),this},b(document).ready(function(){b(".mejs-player").mediaelementplayer()})),window.MediaElementPlayer=a.MediaElementPlayer}(mejs,mejs.$,window,document),function(a){a.extend(mejs.MepDefaults,{playText:"",pauseText:""}),a.extend(MediaElementPlayer.prototype,{buildplaypause:function(b,c,d,e){function f(a){"play"===a?(k.removeClass("mejs-play").addClass("mejs-pause"),l.attr({title:j,"aria-label":j})):(k.removeClass("mejs-pause").addClass("mejs-play"),l.attr({title:i,"aria-label":i}))}var g=this,h=g.options,i=h.playText?h.playText:mejs.i18n.t("mejs.play"),j=h.pauseText?h.pauseText:mejs.i18n.t("mejs.pause"),k=a('
    ').appendTo(c).click(function(a){return a.preventDefault(),e.paused?e.play():e.pause(),!1}),l=k.find("button");f("pse"),e.addEventListener("play",function(){f("play")},!1),e.addEventListener("playing",function(){f("play")},!1),e.addEventListener("pause",function(){f("pse")},!1),e.addEventListener("paused",function(){f("pse")},!1)}})}(mejs.$),function(a){a.extend(mejs.MepDefaults,{stopText:""}),a.extend(MediaElementPlayer.prototype,{buildstop:function(b,c,d,e){var f=this,g=f.options.stopText?f.options.stopText:mejs.i18n.t("mejs.stop");a('
    ').appendTo(c).click(function(){e.paused||e.pause(),e.currentTime>0&&(e.setCurrentTime(0),e.pause(),c.find(".mejs-time-current").width("0px"),c.find(".mejs-time-handle").css("left","0px"),c.find(".mejs-time-float-current").html(mejs.Utility.secondsToTimeCode(0,b.options.alwaysShowHours)),c.find(".mejs-currenttime").html(mejs.Utility.secondsToTimeCode(0,b.options.alwaysShowHours)),d.find(".mejs-poster").show())})}})}(mejs.$),function(a){a.extend(mejs.MepDefaults,{enableProgressTooltip:!0,progressHelpText:""}),a.extend(MediaElementPlayer.prototype,{buildprogress:function(b,c,d,e){var f=this,g=!1,h=!1,i=0,j=!1,k=b.options.autoRewind,l=(f.options.progressHelpText?f.options.progressHelpText:mejs.i18n.t("mejs.time-help-text"),b.options.enableProgressTooltip?'00:00':"");a('
    '+l+"
    ").appendTo(c),c.find(".mejs-time-buffering").hide(),f.total=c.find(".mejs-time-total"),f.loaded=c.find(".mejs-time-loaded"),f.current=c.find(".mejs-time-current"),f.handle=c.find(".mejs-time-handle"),f.timefloat=c.find(".mejs-time-float"),f.timefloatcurrent=c.find(".mejs-time-float-current"),f.slider=c.find(".mejs-time-slider");var m=function(a){var c,d=f.total.offset(),h=f.total.width(),i=0,j=0,k=0;c=a.originalEvent&&a.originalEvent.changedTouches?a.originalEvent.changedTouches[0].pageX:a.changedTouches?a.changedTouches[0].pageX:a.pageX,e.duration&&(ch+d.left&&(c=h+d.left),k=c-d.left,i=k/h,j=.02>=i?0:i*e.duration,g&&j.toFixed(4)!==e.currentTime.toFixed(4)&&e.setCurrentTime(j),mejs.MediaFeatures.hasTouch||(f.timefloat.css("left",k),f.timefloatcurrent.html(mejs.Utility.secondsToTimeCode(j,b.options.alwaysShowHours)),f.timefloat.show()))},n=function(){var a=e.currentTime,c=mejs.i18n.t("mejs.time-slider"),d=mejs.Utility.secondsToTimeCode(a,b.options.alwaysShowHours),g=e.duration;f.slider.attr({role:"slider",tabindex:0}),e.paused?f.slider.attr({"aria-label":c,"aria-valuemin":0,"aria-valuemax":g,"aria-valuenow":a,"aria-valuetext":d}):f.slider.removeAttr("aria-label aria-valuemin aria-valuemax aria-valuenow aria-valuetext")},o=function(){var a=new Date;a-i>=1e3&&e.play()};f.slider.bind("focus",function(a){b.options.autoRewind=!1}),f.slider.bind("blur",function(a){b.options.autoRewind=k}),f.slider.bind("keydown",function(a){if(new Date-i>=1e3&&(j=e.paused),f.options.keyActions.length){var c=a.keyCode,d=e.duration,g=e.currentTime,h=b.options.defaultSeekForwardInterval(e),k=b.options.defaultSeekBackwardInterval(e);switch(c){case 37:case 40:g-=k;break;case 39:case 38:g+=h;break;case 36:g=0;break;case 35:g=d;break;case 32:return void(mejs.Utility.isFirefox||(e.paused?e.play():e.pause()));case 13:return void(e.paused?e.play():e.pause());default:return}g=0>g?0:g>=d?d:Math.floor(g),i=new Date,j||e.pause(),g0&&c.buffered.end&&c.duration?d=c.buffered.end(c.buffered.length-1)/c.duration:c&&void 0!==c.bytesTotal&&c.bytesTotal>0&&void 0!==c.bufferedBytes?d=c.bufferedBytes/c.bytesTotal:a&&a.lengthComputable&&0!==a.total&&(d=a.loaded/a.total),null!==d&&(d=Math.min(1,Math.max(0,d)),b.loaded&&b.total&&b.loaded.width(100*d+"%"))},setCurrentRail:function(){var a=this;if(void 0!==a.media.currentTime&&a.media.duration&&a.total&&a.handle){var b=Math.round(a.total.width()*a.media.currentTime/a.media.duration),c=b-Math.round(a.handle.outerWidth(!0)/2);b=a.media.currentTime/a.media.duration*100,a.current.width(b+"%"),a.handle.css("left",c)}}})}(mejs.$),function(a){a.extend(mejs.MepDefaults,{duration:0,timeAndDurationSeparator:" | "}),a.extend(MediaElementPlayer.prototype,{buildcurrent:function(b,c,d,e){var f=this;a('
    '+mejs.Utility.secondsToTimeCode(0,b.options.alwaysShowHours)+"
    ").appendTo(c),f.currenttime=f.controls.find(".mejs-currenttime"),e.addEventListener("timeupdate",function(){f.controlsAreVisible&&b.updateCurrent()},!1)},buildduration:function(b,c,d,e){var f=this;c.children().last().find(".mejs-currenttime").length>0?a(f.options.timeAndDurationSeparator+''+mejs.Utility.secondsToTimeCode(f.options.duration,f.options.alwaysShowHours)+"").appendTo(c.find(".mejs-time")):(c.find(".mejs-currenttime").parent().addClass("mejs-currenttime-container"),a('
    '+mejs.Utility.secondsToTimeCode(f.options.duration,f.options.alwaysShowHours)+"
    ").appendTo(c)),f.durationD=f.controls.find(".mejs-duration"),e.addEventListener("timeupdate",function(){f.controlsAreVisible&&b.updateDuration()},!1)},updateCurrent:function(){var a=this,b=a.media.currentTime;isNaN(b)&&(b=0),a.currenttime&&a.currenttime.html(mejs.Utility.secondsToTimeCode(b,a.options.alwaysShowHours))},updateDuration:function(){var a=this,b=a.media.duration;(isNaN(b)||b==1/0||0>b)&&(a.media.duration=a.options.duration=b=0),a.options.duration>0&&(b=a.options.duration),a.container.toggleClass("mejs-long-video",b>3600),a.durationD&&b>0&&a.durationD.html(mejs.Utility.secondsToTimeCode(b,a.options.alwaysShowHours))}})}(mejs.$),function(a){a.extend(mejs.MepDefaults,{muteText:mejs.i18n.t("mejs.mute-toggle"),allyVolumeControlText:mejs.i18n.t("mejs.volume-help-text"),hideVolumeOnTouchDevices:!0,audioVolume:"horizontal",videoVolume:"vertical"}),a.extend(MediaElementPlayer.prototype,{buildvolume:function(b,c,d,e){if(!mejs.MediaFeatures.isAndroid&&!mejs.MediaFeatures.isiOS||!this.options.hideVolumeOnTouchDevices){var f=this,g=f.isVideo?f.options.videoVolume:f.options.audioVolume,h="horizontal"===g?a('
    '+f.options.allyVolumeControlText+'
    ').appendTo(c):a('').appendTo(c),i=f.container.find(".mejs-volume-slider, .mejs-horizontal-volume-slider"),j=f.container.find(".mejs-volume-total, .mejs-horizontal-volume-total"),k=f.container.find(".mejs-volume-current, .mejs-horizontal-volume-current"),l=f.container.find(".mejs-volume-handle, .mejs-horizontal-volume-handle"),m=function(a,b){ if(!i.is(":visible")&&void 0===b)return i.show(),m(a,!0),void i.hide();a=Math.max(0,a),a=Math.min(a,1),0===a?(h.removeClass("mejs-mute").addClass("mejs-unmute"),h.children("button").attr("title",mejs.i18n.t("mejs.unmute")).attr("aria-label",mejs.i18n.t("mejs.unmute"))):(h.removeClass("mejs-unmute").addClass("mejs-mute"),h.children("button").attr("title",mejs.i18n.t("mejs.mute")).attr("aria-label",mejs.i18n.t("mejs.mute")));var c=j.position();if("vertical"===g){var d=j.height(),e=d-d*a;l.css("top",Math.round(c.top+e-l.height()/2)),k.height(d-e),k.css("top",c.top+e)}else{var f=j.width(),n=f*a;l.css("left",Math.round(c.left+n-l.width()/2)),k.width(Math.round(n))}},n=function(a){var b=null,c=j.offset();if("vertical"===g){var d=j.height(),f=a.pageY-c.top;if(b=(d-f)/d,0===c.top||0===c.left)return}else{var h=j.width(),i=a.pageX-c.left;b=i/h}b=Math.max(0,b),b=Math.min(b,1),m(b),0===b?e.setMuted(!0):e.setMuted(!1),e.setVolume(b)},o=!1,p=!1;h.hover(function(){i.show(),p=!0},function(){p=!1,o||"vertical"!==g||i.hide()});var q=function(){var a=Math.floor(100*e.volume);i.attr({"aria-label":mejs.i18n.t("mejs.volume-slider"),"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":a,"aria-valuetext":a+"%",role:"slider",tabindex:0})};i.bind("mouseover",function(){p=!0}).bind("mousedown",function(a){return n(a),f.globalBind("mousemove.vol",function(a){n(a)}),f.globalBind("mouseup.vol",function(){o=!1,f.globalUnbind(".vol"),p||"vertical"!==g||i.hide()}),o=!0,!1}).bind("keydown",function(a){if(f.options.keyActions.length){var b=a.keyCode,c=e.volume;switch(b){case 38:c=Math.min(c+.1,1);break;case 40:c=Math.max(0,c-.1);break;default:return!0}return o=!1,m(c),e.setVolume(c),!1}}),h.find("button").click(function(){e.setMuted(!e.muted)}),h.find("button").on("focus",function(){i.show()}).on("blur",function(){i.hide()}),e.addEventListener("volumechange",function(a){o||(e.muted?(m(0),h.removeClass("mejs-mute").addClass("mejs-unmute")):(m(e.volume),h.removeClass("mejs-unmute").addClass("mejs-mute"))),q(a)},!1),0===b.options.startVolume&&e.setMuted(!0);var r=null!==f.media.rendererName&&f.media.rendererName.match(/(native|html5)/);r&&e.setVolume(b.options.startVolume),f.container.on("controlsresize",function(){e.muted?(m(0),h.removeClass("mejs-mute").addClass("mejs-unmute")):(m(e.volume),h.removeClass("mejs-unmute").addClass("mejs-mute"))})}}})}(mejs.$),function(a){a.extend(mejs.MepDefaults,{usePluginFullScreen:!0,fullscreenText:""}),a.extend(MediaElementPlayer.prototype,{isFullScreen:!1,isNativeFullScreen:!1,isInIframe:!1,isPluginClickThroughCreated:!1,fullscreenMode:"",containerSizeTimeout:null,buildfullscreen:function(b,c,d,e){if(b.isVideo){b.isInIframe=window.location!=window.parent.location,e.addEventListener("loadstart",function(){b.detectFullscreenMode()});var f=this,g=null,h=f.options.fullscreenText?f.options.fullscreenText:mejs.i18n.t("mejs.fullscreen"),i=a('
    ').appendTo(c).on("click",function(){var a=mejs.MediaFeatures.hasTrueNativeFullScreen&&mejs.MediaFeatures.isFullScreen()||b.isFullScreen;a?b.exitFullScreen():b.enterFullScreen()}).on("mouseover",function(){if("plugin-hover"===f.fullscreenMode){null!==g&&(clearTimeout(g),g=null);var a=i.offset(),c=b.container.offset();e.positionFullscreenButton(a.left-c.left,a.top-c.top,!0)}}).on("mouseout",function(){"plugin-hover"===f.fullscreenMode&&(null!==g&&clearTimeout(g),g=setTimeout(function(){e.hideFullscreenButton()},1500))});if(b.fullscreenBtn=i,f.globalBind("keydown",function(a){27===a.keyCode&&(mejs.MediaFeatures.hasTrueNativeFullScreen&&mejs.MediaFeatures.isFullScreen()||f.isFullScreen)&&b.exitFullScreen()}),f.normalHeight=0,f.normalWidth=0,mejs.MediaFeatures.hasTrueNativeFullScreen){var j=function(){b.isFullScreen&&(mejs.MediaFeatures.isFullScreen()?(b.isNativeFullScreen=!0,b.setControlsSize()):(b.isNativeFullScreen=!1,b.exitFullScreen()))};b.globalBind(mejs.MediaFeatures.fullScreenEventName,j)}}},detectFullscreenMode:function(){var a=this,b="",c=mejs.MediaFeatures,d=null!==a.media.rendererName&&a.media.rendererName.match(/(native|html5)/);return c.hasTrueNativeFullScreen&&d?b="native-native":!c.hasTrueNativeFullScreen||d||c.hasFirefoxPluginMovingProblem?a.usePluginFullScreen?mejs.MediaFeatures.supportsPointerEvents?(b="plugin-click",a.createPluginClickThrough()):b="plugin-hover":b="fullwindow":b="plugin-native",a.fullscreenMode=b,b},createPluginClickThrough:function(){var b=this;if(!b.isPluginClickThroughCreated){var c,d,e=!1,f=function(){if(e){for(var a in g)g[a].hide();b.fullscreenBtn.css("pointer-events",""),b.controls.css("pointer-events",""),b.media.removeEventListener("click",b.clickToPlayPauseCallback),e=!1}},g={},h=["top","left","right","bottom"],i=function(){var a=fullscreenBtn.offset().left-b.container.offset().left,d=fullscreenBtn.offset().top-b.container.offset().top,e=fullscreenBtn.outerWidth(!0),f=fullscreenBtn.outerHeight(!0),h=b.container.width(),i=b.container.height();for(c in g)g[c].css({position:"absolute",top:0,left:0});g.top.width(h).height(d),g.left.width(a).height(f).css({top:d}),g.right.width(h-a-e).height(f).css({top:d,left:a+e}),g.bottom.width(h).height(i-f-d).css({top:d+f})};for(b.globalBind("resize",function(){i()}),c=0,d=h.length;d>c;c++)g[h[c]]=a('
    ').appendTo(b.container).mouseover(f).hide();fullscreenBtn.on("mouseover",function(){if(!b.isFullScreen){var a=fullscreenBtn.offset(),d=player.container.offset();media.positionFullscreenButton(a.left-d.left,a.top-d.top,!1),b.fullscreenBtn.css("pointer-events","none"),b.controls.css("pointer-events","none"),b.media.addEventListener("click",b.clickToPlayPauseCallback);for(c in g)g[c].show();i(),e=!0}}),media.addEventListener("fullscreenchange",function(a){b.isFullScreen=!b.isFullScreen,b.isFullScreen?b.media.removeEventListener("click",b.clickToPlayPauseCallback):b.media.addEventListener("click",b.clickToPlayPauseCallback),f()}),b.globalBind("mousemove",function(a){if(e){var c=fullscreenBtn.offset();(a.pageYc.top+fullscreenBtn.outerHeight(!0)||a.pageXc.left+fullscreenBtn.outerWidth(!0))&&(fullscreenBtn.css("pointer-events",""),b.controls.css("pointer-events",""),e=!1)}}),b.isPluginClickThroughCreated=!0}},cleanfullscreen:function(a){a.exitFullScreen()},enterFullScreen:function(){var b=this,c=null!==b.media.rendererName&&b.media.rendererName.match(/(html5|native)/);if(mejs.MediaFeatures.isiOS&&mejs.MediaFeatures.hasiOSFullScreen&&"function"==typeof b.media.webkitEnterFullscreen)return void b.media.webkitEnterFullscreen();a(document.documentElement).addClass("mejs-fullscreen"),b.normalHeight=b.container.height(),b.normalWidth=b.container.width(),"native-native"===b.fullscreenMode||"plugin-native"===b.fullscreenMode?(mejs.MediaFeatures.requestFullScreen(b.container[0]),b.isInIframe&&setTimeout(function e(){if(b.isNativeFullScreen){var c=.002,d=a(window).width(),f=screen.width,g=Math.abs(f-d),h=f*c;g>h?b.exitFullScreen():setTimeout(e,500)}},1e3)):"fullwindow"===b.fullscreeMode,b.container.addClass("mejs-container-fullscreen").width("100%").height("100%"),b.containerSizeTimeout=setTimeout(function(){b.container.css({width:"100%",height:"100%"}),b.setControlsSize()},500),c?b.$media.width("100%").height("100%"):(b.container.find("iframe, embed, object").width("100%").height("100%"),b.options.setDimensions&&b.media.setSize(screen.width,screen.height)),b.layers.children("div").width("100%").height("100%"),b.fullscreenBtn&&b.fullscreenBtn.removeClass("mejs-fullscreen").addClass("mejs-unfullscreen"),b.setControlsSize(),b.isFullScreen=!0;var d=Math.min(screen.width/b.width,screen.height/b.height);b.container.find(".mejs-captions-text").css("font-size",100*d+"%"),b.container.find(".mejs-captions-text").css("line-height","normal"),b.container.find(".mejs-captions-position").css("bottom","45px"),b.container.trigger("enteredfullscreen")},exitFullScreen:function(){var b=this,c=null!==b.media.rendererName&&b.media.rendererName.match(/(native|html5)/);clearTimeout(b.containerSizeTimeout),mejs.MediaFeatures.hasTrueNativeFullScreen&&(mejs.MediaFeatures.isFullScreen()||b.isFullScreen)&&mejs.MediaFeatures.cancelFullScreen(),a(document.documentElement).removeClass("mejs-fullscreen"),b.container.removeClass("mejs-container-fullscreen"),b.options.setDimensions&&(b.container.width(b.normalWidth).height(b.normalHeight),c?b.$media.width(b.normalWidth).height(b.normalHeight):(b.container.find("iframe, embed, object").width(b.normalWidth).height(b.normalHeight),b.media.setSize(b.normalWidth,b.normalHeight)),b.layers.children("div").width(b.normalWidth).height(b.normalHeight)),b.fullscreenBtn.removeClass("mejs-unfullscreen").addClass("mejs-fullscreen"),b.setControlsSize(),b.isFullScreen=!1,b.container.find(".mejs-captions-text").css("font-size",""),b.container.find(".mejs-captions-text").css("line-height",""),b.container.find(".mejs-captions-position").css("bottom",""),b.container.trigger("exitedfullscreen")}})}(mejs.$),function(a){a.extend(mejs.MepDefaults,{speeds:["2.00","1.50","1.25","1.00","0.75"],defaultSpeed:"1.00",speedChar:"x"}),a.extend(MediaElementPlayer.prototype,{buildspeed:function(b,c,d,e){var f=this,g=null!==f.media.rendererName&&f.media.rendererName.match(/(native|html5)/);if(g){for(var h=null,i=null,j=null,k=null,l=[],m=!1,n=0,o=f.options.speeds.length;o>n;n++){var p=f.options.speeds[n];"string"==typeof p?(l.push({name:p+f.options.speedChar,value:p}),p===f.options.defaultSpeed&&(m=!0)):(l.push(p),p.value===f.options.defaultSpeed&&(m=!0))}m||l.push({name:f.options.defaultSpeed+f.options.speedChar,value:f.options.defaultSpeed}),l.sort(function(a,b){return parseFloat(b.value)-parseFloat(a.value)});var q=function(a){for(n=0,o=l.length;o>n;n++)if(l[n].value===a)return l[n].name},r='
      ';for(n=0,il=l.length;n";r+="
    ",h=a(r).appendTo(c),i=h.find(".mejs-speed-selector"),j=f.options.defaultSpeed,e.addEventListener("loadedmetadata",function(a){j&&(e.playbackRate=parseFloat(j))},!0),i.on("click",'input[type="radio"]',function(){var b=a(this).attr("value");j=b,e.playbackRate=parseFloat(b),h.find("button").html(q(b)),h.find(".mejs-speed-selected").removeClass("mejs-speed-selected"),h.find('input[type="radio"]:checked').next().addClass("mejs-speed-selected")}),h.one("mouseenter focusin",function(){i.height(h.find(".mejs-speed-selector ul").outerHeight(!0)+h.find(".mejs-speed-translations").outerHeight(!0)).css("top",-1*i.height()+"px")})}}})}(mejs.$),function(a){a.extend(mejs.MepDefaults,{startLanguage:"",tracksText:"",tracksAriaLive:!1,hideCaptionsButtonWhenEmpty:!0,toggleCaptionsButtonWhenOnlyOne:!1,slidesSelector:""}),a.extend(MediaElementPlayer.prototype,{hasChapters:!1,buildtracks:function(b,c,d,e){if(0!==b.tracks.length){var f,g,h=this,i=h.options.tracksAriaLive?'role="log" aria-live="assertive" aria-atomic="false"':"",j=h.options.tracksText?h.options.tracksText:mejs.i18n.t("mejs.captions-subtitles");if(h.domNode.textTracks)for(f=h.domNode.textTracks.length-1;f>=0;f--)h.domNode.textTracks[f].mode="hidden";h.cleartracks(b),b.chapters=a('
    ').prependTo(d).hide(),b.captions=a('
    ').prependTo(d).hide(),b.captionsText=b.captions.find(".mejs-captions-text"),b.captionsButton=a('
    ").appendTo(c);var k=0;for(f=0;ff;f++)g=b.tracks[f].kind,("subtitles"===g||"captions"===g)&&b.addTrackButton(b.tracks[f].srclang,b.tracks[f].label);b.loadNextTrack(),e.addEventListener("timeupdate",function(){b.displayCaptions()},!1),""!==b.options.slidesSelector&&(b.slidesContainer=a(b.options.slidesSelector),e.addEventListener("timeupdate",function(){b.displaySlides()},!1)),e.addEventListener("loadedmetadata",function(){b.displayChapters()},!1),b.container.hover(function(){b.hasChapters&&(b.chapters.removeClass("mejs-offscreen"),b.chapters.fadeIn(200).height(b.chapters.find(".mejs-chapter").outerHeight()))},function(){b.hasChapters&&!e.paused&&b.chapters.fadeOut(200,function(){a(this).addClass("mejs-offscreen"),a(this).css("display","block")})}),h.container.on("controlsresize",function(){h.adjustLanguageBox()}),null!==b.node.getAttribute("autoplay")&&b.chapters.addClass("mejs-offscreen")}},cleartracks:function(a){a&&(a.captions&&a.captions.remove(),a.chapters&&a.chapters.remove(),a.captionsText&&a.captionsText.remove(),a.captionsButton&&a.captionsButton.remove())},setTrack:function(a){var b,c=this;if("none"===a)c.selectedTrack=null,c.captionsButton.removeClass("mejs-captions-enabled");else for(b=0;b0&&c.displayChapters(d)},!1),"slides"==d.kind&&c.setupSlides(d)},error:function(){c.removeTrackButton(d.srclang),c.loadNextTrack()}})},enableTrackButton:function(b,c){var d=this;""===c&&(c=mejs.language.codes[b]||b),d.captionsButton.find("input[value="+b+"]").prop("disabled",!1).siblings("label").html(c),d.options.startLanguage===b&&a("#"+d.id+"_captions_"+b).prop("checked",!0).trigger("click"),d.adjustLanguageBox()},removeTrackButton:function(a){var b=this;b.captionsButton.find("input[value="+a+"]").closest("li").remove(),b.adjustLanguageBox()},addTrackButton:function(b,c){var d=this;""===c&&(c=mejs.language.codes[b]||b),d.captionsButton.find("ul").append(a('
  • ")),d.adjustLanguageBox(),d.container.find(".mejs-captions-translations option[value="+b+"]").remove()},adjustLanguageBox:function(){var a=this;a.captionsButton.find(".mejs-captions-selector").height(a.captionsButton.find(".mejs-captions-selector ul").outerHeight(!0)+a.captionsButton.find(".mejs-captions-translations").outerHeight(!0))},checkForTracks:function(){var a=this,b=!1;if(a.options.hideCaptionsButtonWhenEmpty){for(var c=0;c=c.entries.times[a].start&&b.media.currentTime<=c.entries.times[a].stop)return b.captionsText.html(c.entries.text[a]).attr("class","mejs-captions-text "+(c.entries.times[a].identifier||"")),void b.captions.show().height(0);b.captions.hide()}else b.captions.hide()}},setupSlides:function(a){var b=this;b.slides=a,b.slides.entries.imgs=[b.slides.entries.text.length],b.showSlide(0)},showSlide:function(b){if(void 0!==this.tracks&&void 0!==this.slidesContainer){var c=this,d=c.slides.entries.text[b],e=c.slides.entries.imgs[b];void 0===e||void 0===e.fadeIn?c.slides.entries.imgs[b]=e=a('').on("load",function(){e.appendTo(c.slidesContainer).hide().fadeIn().siblings(":visible").fadeOut()}):e.is(":visible")||e.is(":animated")||e.fadeIn().siblings(":visible").fadeOut()}},displaySlides:function(){if(void 0!==this.slides){var a,b=this,c=b.slides;for(a=0;a=c.entries.times[a].start&&b.media.currentTime<=c.entries.times[a].stop)return void b.showSlide(a)}},displayChapters:function(){var a,b=this;for(a=0;ac;c++)d=b.entries.times[c].stop-b.entries.times[c].start,f=Math.floor(d/e.media.duration*100),(f+g>100||c===b.entries.times.length-1&&100>f+g)&&(f=100-g),e.chapters.append(a('
    '+b.entries.text[c]+''+mejs.Utility.secondsToTimeCode(b.entries.times[c].start,e.options.alwaysShowHours)+"–"+mejs.Utility.secondsToTimeCode(b.entries.times[c].stop,e.options.alwaysShowHours)+"
    ")),g+=f;e.chapters.find("div.mejs-chapter").click(function(){e.media.setCurrentTime(parseFloat(a(this).attr("rel"))),e.media.paused&&e.media.play()}),e.chapters.show()}}),mejs.language={codes:{af:mejs.i18n.t("mejs.afrikaans"),sq:mejs.i18n.t("mejs.albanian"),ar:mejs.i18n.t("mejs.arabic"),be:mejs.i18n.t("mejs.belarusian"),bg:mejs.i18n.t("mejs.bulgarian"),ca:mejs.i18n.t("mejs.catalan"),zh:mejs.i18n.t("mejs.chinese"),"zh-cn":mejs.i18n.t("mejs.chinese-simplified"),"zh-tw":mejs.i18n.t("mejs.chines-traditional"),hr:mejs.i18n.t("mejs.croatian"),cs:mejs.i18n.t("mejs.czech"),da:mejs.i18n.t("mejs.danish"),nl:mejs.i18n.t("mejs.dutch"),en:mejs.i18n.t("mejs.english"),et:mejs.i18n.t("mejs.estonian"),fl:mejs.i18n.t("mejs.filipino"),fi:mejs.i18n.t("mejs.finnish"),fr:mejs.i18n.t("mejs.french"),gl:mejs.i18n.t("mejs.galician"),de:mejs.i18n.t("mejs.german"),el:mejs.i18n.t("mejs.greek"),ht:mejs.i18n.t("mejs.haitian-creole"),iw:mejs.i18n.t("mejs.hebrew"),hi:mejs.i18n.t("mejs.hindi"),hu:mejs.i18n.t("mejs.hungarian"),is:mejs.i18n.t("mejs.icelandic"),id:mejs.i18n.t("mejs.indonesian"),ga:mejs.i18n.t("mejs.irish"),it:mejs.i18n.t("mejs.italian"),ja:mejs.i18n.t("mejs.japanese"),ko:mejs.i18n.t("mejs.korean"),lv:mejs.i18n.t("mejs.latvian"),lt:mejs.i18n.t("mejs.lithuanian"),mk:mejs.i18n.t("mejs.macedonian"),ms:mejs.i18n.t("mejs.malay"),mt:mejs.i18n.t("mejs.maltese"),no:mejs.i18n.t("mejs.norwegian"),fa:mejs.i18n.t("mejs.persian"),pl:mejs.i18n.t("mejs.polish"),pt:mejs.i18n.t("mejs.portuguese"),ro:mejs.i18n.t("mejs.romanian"),ru:mejs.i18n.t("mejs.russian"),sr:mejs.i18n.t("mejs.serbian"),sk:mejs.i18n.t("mejs.slovak"),sl:mejs.i18n.t("mejs.slovenian"),es:mejs.i18n.t("mejs.spanish"),sw:mejs.i18n.t("mejs.swahili"),sv:mejs.i18n.t("mejs.swedish"),tl:mejs.i18n.t("mejs.tagalog"),th:mejs.i18n.t("mejs.thai"),tr:mejs.i18n.t("mejs.turkish"),uk:mejs.i18n.t("mejs.ukrainian"),vi:mejs.i18n.t("mejs.vietnamese"),cy:mejs.i18n.t("mejs.welsh"),yi:mejs.i18n.t("mejs.yiddish")}},mejs.TrackFormatParser={webvtt:{pattern_timecode:/^((?:[0-9]{1,2}:)?[0-9]{2}:[0-9]{2}([,.][0-9]{1,3})?) --\> ((?:[0-9]{1,2}:)?[0-9]{2}:[0-9]{2}([,.][0-9]{3})?)(.*)$/,parse:function(b){for(var c,d,e,f=0,g=mejs.TrackFormatParser.split2(b,/\r?\n/),h={text:[],times:[]};f=0&&""!==g[f-1]&&(e=g[f-1]),f++,d=g[f],f++;""!==g[f]&&f$1"),h.text.push(d),h.times.push({identifier:e,start:0===mejs.Utility.convertSMPTEtoSeconds(c[1])?.2:mejs.Utility.convertSMPTEtoSeconds(c[1]),stop:mejs.Utility.convertSMPTEtoSeconds(c[3]),settings:c[5]})}e=""}return h}},dfxp:{parse:function(b){b=a(b).filter("tt");var c,d,e=0,f=b.children("div").eq(0),g=f.find("p"),h=b.find("#"+f.attr("style")),i={text:[],times:[]};if(h.length){var j=h.removeAttr("id").get(0).attributes;if(j.length)for(c={},e=0;e$1"),i.text.push(d)}return i}},split2:function(a,b){return a.split(b)}},3!="x\n\ny".split(/\n/gi).length&&(mejs.TrackFormatParser.split2=function(a,b){var c,d=[],e="";for(c=0;c
    ').appendTo(c).hover(function(){clearTimeout(f),b.showSourcechooserSelector()},function(){f=setTimeout(function(){b.hideSourcechooserSelector()},500)}).on("keydown",function(c){var d=c.keyCode;switch(d){case 32:mejs.MediaFeatures.isFirefox||b.showSourcechooserSelector(),a(this).find(".mejs-sourcechooser-selector").find("input[type=radio]:checked").first().focus();break;case 13:b.showSourcechooserSelector(),a(this).find(".mejs-sourcechooser-selector").find("input[type=radio]:checked").first().focus();break;case 27:b.hideSourcechooserSelector(),a(this).find("button").focus();break;default:return!0}}).on("focusout",mejs.Utility.debounce(function(c){setTimeout(function(){var c=a(document.activeElement).closest(".mejs-sourcechooser-selector");c.length||b.hideSourcechooserSelector()},0)},100)).delegate("input[type=radio]","click",function(){a(this).attr("aria-selected",!0).attr("checked","checked"),a(this).closest(".mejs-sourcechooser-selector").find("input[type=radio]").not(this).attr("aria-selected","false").removeAttr("checked");var b=this.value;if(e.currentSrc!==b){var c=e.currentTime,d=e.paused;e.pause(),e.setSrc(b),e.load(),e.addEventListener("loadedmetadata",function(a){e.currentTime=c},!0);var f=function(a){d||e.play(),e.removeEventListener("canplay",f,!0)};e.addEventListener("canplay",f,!0),e.load()}}).delegate("button","click",function(c){a(this).siblings(".mejs-sourcechooser-selector").hasClass("mejs-offscreen")?(b.showSourcechooserSelector(),a(this).siblings(".mejs-sourcechooser-selector").find("input[type=radio]:checked").first().focus()):b.hideSourcechooserSelector()});for(var l in i){var m=i[l];void 0!==m.type&&"SOURCE"===m.nodeName&&null!==e.canPlayType&&b.addSourceButton(m.src,m.title,m.type,e.src===m.src)}}},addSourceButton:function(b,c,d,e){var f=this;(""===c||void 0===c)&&(c=b),d=d.split("/")[1],f.sourcechooserButton.find("ul").append(a('
  • ")),f.adjustSourcechooserBox()},adjustSourcechooserBox:function(){var a=this;a.sourcechooserButton.find(".mejs-sourcechooser-selector").height(a.sourcechooserButton.find(".mejs-sourcechooser-selector ul").outerHeight(!0))},hideSourcechooserSelector:function(){var a=this;void 0!==a.sourcechooserButton&&a.sourcechooserButton.find(".mejs-sourcechooser-selector").find("input[type=radio]").length&&this.sourcechooserButton.find(".mejs-sourcechooser-selector").addClass("mejs-offscreen").attr("aria-expanded","false").attr("aria-hidden","true").find("input[type=radio]").attr("tabindex","-1")},showSourcechooserSelector:function(){var a=this;void 0!==a.sourcechooserButton&&a.sourcechooserButton.find(".mejs-sourcechooser-selector").find("input[type=radio]").length&&this.sourcechooserButton.find(".mejs-sourcechooser-selector").removeClass("mejs-offscreen").attr("aria-expanded","true").attr("aria-hidden","false").find("input[type=radio]").attr("tabindex","0")}})}(mejs.$),function(a){a.extend(mejs.MepDefaults,{contextMenuItems:[{render:function(a){return void 0===a.enterFullScreen?null:a.isFullScreen?mejs.i18n.t("mejs.fullscreen-off"):mejs.i18n.t("mejs.fullscreen-on")},click:function(a){a.isFullScreen?a.exitFullScreen():a.enterFullScreen()}},{render:function(a){return a.media.muted?mejs.i18n.t("mejs.unmute"):mejs.i18n.t("mejs.mute")},click:function(a){a.media.muted?a.setMuted(!1):a.setMuted(!0)}},{isSeparator:!0},{render:function(a){return mejs.i18n.t("mejs.download-video")},click:function(a){window.location.href=a.media.currentSrc}}]}),a.extend(MediaElementPlayer.prototype,{buildcontextmenu:function(b,c,d,e){b.contextMenu=a('
    ').appendTo(a("body")).hide(),b.container.bind("contextmenu",function(a){return b.isContextMenuEnabled?(a.preventDefault(),b.renderContextMenu(a.clientX-1,a.clientY-1),!1):void 0}),b.container.bind("click",function(){b.contextMenu.hide()}),b.contextMenu.bind("mouseleave",function(){b.startContextMenuTimer()})},cleancontextmenu:function(a){a.contextMenu.remove()},isContextMenuEnabled:!0,enableContextMenu:function(){this.isContextMenuEnabled=!0},disableContextMenu:function(){this.isContextMenuEnabled=!1},contextMenuTimeout:null,startContextMenuTimer:function(){var a=this;a.killContextMenuTimer(),a.contextMenuTimer=setTimeout(function(){a.hideContextMenu(),a.killContextMenuTimer()},750)},killContextMenuTimer:function(){var a=this.contextMenuTimer;null!==a&&void 0!==a&&(clearTimeout(a),a=null)},hideContextMenu:function(){this.contextMenu.hide()},renderContextMenu:function(b,c){for(var d=this,e="",f=d.options.contextMenuItems,g=0,h=f.length;h>g;g++)if(f[g].isSeparator)e+='
    ';else{var i=f[g].render(d);null!==i&&void 0!==i&&(e+='
    '+i+"
    ")}d.contextMenu.empty().append(a(e)).css({top:c,left:b}).show(),d.contextMenu.find(".mejs-contextmenu-item").each(function(){var b=a(this),c=parseInt(b.data("itemindex"),10),e=d.options.contextMenuItems[c];"undefined"!=typeof e.show&&e.show(b,d),b.click(function(){"undefined"!=typeof e.click&&e.click(d),d.contextMenu.hide()})}),setTimeout(function(){d.killControlsTimer("rev3")},100)}})}(mejs.$),function(a){a.extend(mejs.MepDefaults,{skipBackInterval:30,skipBackText:""}),a.extend(MediaElementPlayer.prototype,{buildskipback:function(b,c,d,e){var f=this,g=mejs.i18n.t("mejs.time-skip-back",f.options.skipBackInterval),h=f.options.skipBackText?f.options.skipBackText.replace("%1",f.options.skipBackInterval):g;a('
    ").appendTo(c).click(function(){e.duration&&(e.setCurrentTime(Math.max(e.currentTime-f.options.skipBackInterval,0)),a(this).find("button").blur())})}})}(mejs.$),function(a){a.extend(mejs.MepDefaults,{jumpForwardInterval:30,jumpForwardText:""}),a.extend(MediaElementPlayer.prototype,{buildjumpforward:function(b,c,d,e){var f=this,g=mejs.i18n.t("mejs.time-jump-forward",f.options.jumpForwardInterval),h=f.options.jumpForwardText?f.options.jumpForwardText.replace("%1",f.options.jumpForwardInterval):g;a('
    ").appendTo(c).click(function(){e.duration&&(e.setCurrentTime(Math.min(e.currentTime+f.options.jumpForwardInterval,e.duration)),a(this).find("button").blur())})}})}(mejs.$),function(a){a.extend(mejs.MepDefaults,{postrollCloseText:""}),a.extend(MediaElementPlayer.prototype,{buildpostroll:function(b,c,d,e){var f=this,g=f.options.postrollCloseText?f.options.postrollCloseText:mejs.i18n.t("mejs.close"),h=f.container.find('link[rel="postroll"]').attr("href");void 0!==h&&(b.postroll=a('').prependTo(d).hide(),f.media.addEventListener("ended",function(c){a.ajax({dataType:"html",url:h,success:function(a,b){d.find(".mejs-postroll-layer-content").html(a)}}),b.postroll.show()},!1))}})}(mejs.$),function(a){a.extend(mejs.MepDefaults,{markerColor:"#E9BC3D",markers:[],markerCallback:function(){}}),a.extend(MediaElementPlayer.prototype,{buildmarkers:function(a,b,c,d){var e=0,f=-1,g=-1,h=-1,i=-1;for(e=0;e');d.addEventListener("durationchange",function(c){a.setmarkers(b)}),d.addEventListener("timeupdate",function(b){for(f=Math.floor(d.currentTime),h>f?i>f&&(i=-1):h=f,e=0;e=0&&(c=100*Math.floor(d.options.markers[e])/d.media.duration, a(b.find(".mejs-time-marker")[e]).css({width:"1px",left:c+"%",background:d.options.markerColor}))}})}(mejs.$); \ No newline at end of file diff --git a/src/js/mediaelement-renderer-flv.js b/src/js/mediaelement-renderer-flv.js index 57e61c512..c20a4c08b 100644 --- a/src/js/mediaelement-renderer-flv.js +++ b/src/js/mediaelement-renderer-flv.js @@ -3,6 +3,8 @@ * * Uses flv.js, which is a JavaScript library which implements mechanisms to play flv files inspired by flv.js. * It relies on HTML5 video and MediaSource Extensions for playback. + * Currently, it can only play files with the same origin. + * * @see https://github.com/Bilibili/flv.js * */ @@ -142,6 +144,7 @@ canPlayType: function (type) { var mediaTypes = ['video/x-flv', 'video/flv']; + return mejs.MediaFeatures.hasMse && mediaTypes.indexOf(type) > -1; }, /** @@ -162,7 +165,7 @@ id = mediaElement.id + '_' + options.prefix, flvPlayer, stack = {} - ; + ; node = originalNode.cloneNode(true); options = mejs.Utils.extend(options, mediaElement.options); @@ -273,6 +276,7 @@ } } } + node.className = ''; originalNode.parentNode.insertBefore(node, originalNode); diff --git a/src/js/mediaelementplayer-player.js b/src/js/mediaelementplayer-player.js index 2305c2758..d707ca9e5 100644 --- a/src/js/mediaelementplayer-player.js +++ b/src/js/mediaelementplayer-player.js @@ -1518,7 +1518,10 @@ play: function () { var t = this; - t.load(); + // only load if the current time is 0 to ensure proper + if (t.media.getCurrentTime() <= 0) { + t.load(); + } t.media.play(); }, pause: function () {