!function(e){"use strict";function t(e,t){b.debug&&window.console&&console[t?"error":"log"](e)}function n(){var e,t,n,r=navigator.userAgent,a=navigator.appName,s=""+parseFloat(navigator.appVersion),o=parseInt(navigator.appVersion,10);return-1!==navigator.appVersion.indexOf("Windows NT")&&-1!==navigator.appVersion.indexOf("rv:11")?(a="IE",s="11;"):-1!==(t=r.indexOf("MSIE"))?(a="IE",s=r.substring(t+5)):-1!==(t=r.indexOf("Chrome"))?(a="Chrome",s=r.substring(t+7)):-1!==(t=r.indexOf("Safari"))?(a="Safari",s=r.substring(t+7),-1!==(t=r.indexOf("Version"))&&(s=r.substring(t+8))):-1!==(t=r.indexOf("Firefox"))?(a="Firefox",s=r.substring(t+8)):(e=r.lastIndexOf(" ")+1)<(t=r.lastIndexOf("/"))&&(a=r.substring(e,t),s=r.substring(t+1),a.toLowerCase()==a.toUpperCase()&&(a=navigator.appName)),-1!==(n=s.indexOf(";"))&&(s=s.substring(0,n)),-1!==(n=s.indexOf(" "))&&(s=s.substring(0,n)),o=parseInt(""+s,10),isNaN(o)&&(s=""+parseFloat(navigator.appVersion),o=parseInt(navigator.appVersion,10)),[a,o]}function r(e,t,n){return e.replace(new RegExp(t.replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1"),"g"),n)}function a(e,t){e.length||(e=[e]);for(var n=e.length-1;n>=0;n--){var r=n>0?t.cloneNode(!0):t,a=e[n],s=a.parentNode,o=a.nextSibling;r.appendChild(a),o?s.insertBefore(r,o):s.appendChild(r)}}function s(e,t,n){if(e)if(e.classList)e.classList[n?"add":"remove"](t);else{var r=(" "+e.className+" ").replace(/\s+/g," ").replace(" "+t+" ","");e.className=r+(n?" "+t:"")}}function o(e,t,n){e.addEventListener(t,n,!1)}function i(e,t,n){e.removeEventListener(t,n,!1)}function c(e,t){return Math.floor(e/t*100)}function l(e){var t=d().isFullScreen()?{x:0,y:0}:u(e.currentTarget);return{x:e.clientX-t.x,y:e.clientY-t.y}}function u(e){for(var t=0,n=0;e;)t+=e.offsetLeft-e.scrollLeft+e.clientLeft,n+=e.offsetTop-e.scrollTop+e.clientTop,e=e.offsetParent;return{x:t,y:n}}function p(e,t){for(var n in t)t[n]&&t[n].constructor&&t[n].constructor===Object?(e[n]=e[n]||{},p(e[n],t[n])):e[n]=t[n];return e}function d(){var e={supportsFullScreen:!1,isFullScreen:function(){return!1},requestFullScreen:function(){},cancelFullScreen:function(){},fullScreenEventName:"",element:null,prefix:""},t="webkit moz o ms khtml".split(" ");if("undefined"!=typeof document.cancelFullScreen)e.supportsFullScreen=!0;else for(var n=0,r=t.length;r>n;n++){if(e.prefix=t[n],"undefined"!=typeof document[e.prefix+"CancelFullScreen"]){e.supportsFullScreen=!0;break}if("undefined"!=typeof document.msExitFullscreen&&document.msFullscreenEnabled){e.prefix="ms",e.supportsFullScreen=!0;break}}return"webkit"===e.prefix&&navigator.userAgent.match(/Version\/[\d\.]+.*Safari/)&&(e.supportsFullScreen=!1),e.supportsFullScreen&&(e.fullScreenEventName="ms"==e.prefix?"MSFullscreenChange":e.prefix+"fullscreenchange",e.isFullScreen=function(){switch(this.prefix){case"":return document.fullScreen;case"webkit":return document.webkitIsFullScreen;case"ms":return null!==document.msFullscreenElement;default:return document[this.prefix+"FullScreen"]}},e.requestFullScreen=function(e){return""===this.prefix?e.requestFullScreen():e[this.prefix+("ms"==this.prefix?"RequestFullscreen":"RequestFullScreen")]("webkit"===this.prefix?e.ALLOW_KEYBOARD_INPUT:null)},e.cancelFullScreen=function(){return""===this.prefix?document.cancelFullScreen():document[this.prefix+("ms"==this.prefix?"ExitFullscreen":"CancelFullScreen")]()},e.element=function(){return""===this.prefix?document.fullscreenElement:document[this.prefix+"FullscreenElement"]}),e}function f(e){function u(){for(_.subcount=0;v(_.captions[_.subcount][0])<_.media.currentTime.toFixed(1);)if(_.subcount++,_.subcount>_.captions.length-1){_.subcount=_.captions.length-1;break}}function p(){s(_.container,b.classes.captions.enabled,!0),b.captions.defaultActive&&(s(_.container,b.classes.captions.active,!0),_.buttons.captions.setAttribute("checked","checked"))}function f(e){var t=[];return t=e.split(" --> "),g(t[0])}function v(e){var t=[];return t=e.split(" --> "),g(t[1])}function g(e){if(null===e||void 0===e)return 0;var t,n=[],r=[];return n=e.split(","),r=n[0].split(":"),t=Math.floor(60*r[0]*60)+Math.floor(60*r[1])+Math.floor(r[2])}function y(e){return _.container.querySelectorAll(e)}function h(e){return y(e)[0]}function x(){try{return window.self!==window.top}catch(e){return!0}}function k(){t("Injecting custom controls");var e=b.html;e=r(e,"{aria-label}",b.playAriaLabel),e=r(e,"{id}",_.random),_.container.insertAdjacentHTML("beforeend",e)}function w(){try{return _.controls=h(b.selectors.controls),_.buttons={},_.buttons.play=h(b.selectors.buttons.play),_.buttons.pause=h(b.selectors.buttons.pause),_.buttons.restart=h(b.selectors.buttons.restart),_.buttons.rewind=h(b.selectors.buttons.rewind),_.buttons.forward=h(b.selectors.buttons.forward),_.buttons.mute=h(b.selectors.buttons.mute),_.buttons.captions=h(b.selectors.buttons.captions),_.buttons.fullscreen=h(b.selectors.buttons.fullscreen),_.progress={},_.progress.container=h(b.selectors.progress.container),_.progress.buffer={},_.progress.buffer.bar=h(b.selectors.progress.buffer),_.progress.buffer.text=_.progress.buffer.bar.getElementsByTagName("span")[0],_.progress.played={},_.progress.played.bar=h(b.selectors.progress.played),_.progress.played.text=_.progress.played.bar.getElementsByTagName("span")[0],_.volume=h(b.selectors.buttons.volume),_.duration=h(b.selectors.duration),_.seekTime=y(b.selectors.seekTime),!0}catch(e){return t("It looks like there's a problem with your controls html. Bailing.",!0),!1}}function T(){if(_.media=_.container.querySelectorAll("audio, video")[0],!_.media)return t("No audio or video element found!",!0),!1;if(_.media.removeAttribute("controls"),_.type="video"==_.media.tagName.toLowerCase()?"video":"audio",s(_.container,b.classes[_.type],!0),s(_.container,b.classes.stopped,null===_.media.getAttribute("autoplay")),"video"===_.type){var e=document.createElement("div");e.setAttribute("class",b.classes.videoWrapper),a(_.media,e),_.videoContainer=e}}function S(){if("video"===_.type){_.videoContainer.insertAdjacentHTML("afterbegin","
"),_.captionsContainer=h(b.selectors.captions),_.isTextTracks=!1,_.media.textTracks&&(_.isTextTracks=!0);for(var e,n="",r=_.media.childNodes,a=0;a