!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.videojs=t()}(this,function(){var e="7.2.4",t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function i(e,t){return e(t={exports:{}},t.exports),t.exports}var r,n="undefined"!=typeof window?window:void 0!==t?t:"undefined"!=typeof self?self:{},a={},s=Object.freeze({default:a}),o=s&&a||s,u=void 0!==t?t:"undefined"!=typeof window?window:{};"undefined"!=typeof document?r=document:(r=u["__GLOBAL_DOCUMENT_CACHE@4"])||(r=u["__GLOBAL_DOCUMENT_CACHE@4"]=o);var l=r,d=void 0,c="info",h=[],f=function(e,t){var i=d.levels[c],r=new RegExp("^("+i+")$");if("log"!==e&&t.unshift(e.toUpperCase()+":"),h&&h.push([].concat(t)),t.unshift("VIDEOJS:"),n.console){var a=n.console[e];a||"debug"!==e||(a=n.console.info||n.console.log),a&&i&&r.test(e)}};(d=function(){for(var e=arguments.length,t=Array(e),i=0;i1?t-1:0),r=1;r0&&void 0!==arguments[0]?arguments[0]:"div",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments[3],n=l.createElement(e);return Object.getOwnPropertyNames(t).forEach(function(e){var i=t[e];-1!==e.indexOf("aria-")||"role"===e||"type"===e?(p.warn(g(O,e,i)),n.setAttribute(e,i)):"textContent"===e?N(n,i):n[e]=i}),Object.getOwnPropertyNames(i).forEach(function(e){n.setAttribute(e,i[e])}),r&&ie(n,r),n}function N(e,t){return void 0===e.textContent?e.innerText=t:e.textContent=t,e}function B(e,t){t.firstChild?t.insertBefore(e,t.firstChild):t.appendChild(e)}function F(e,t){return D(t),e.classList?e.classList.contains(t):(i=t,new RegExp("(^|\\s)"+i+"($|\\s)")).test(e.className);var i}function j(e,t){return e.classList?e.classList.add(t):F(e,t)||(e.className=(e.className+" "+t).trim()),e}function H(e,t){return e.classList?e.classList.remove(t):(D(t),e.className=e.className.split(/\s+/).filter(function(e){return e!==t}).join(" ")),e}function G(e,t,i){var r=F(e,t);if("function"==typeof i&&(i=i(e,t)),"boolean"!=typeof i&&(i=!r),i!==r)return i?j(e,t):H(e,t),e}function V(e,t){Object.getOwnPropertyNames(t).forEach(function(i){var r=t[i];null===r||void 0===r||!1===r?e.removeAttribute(i):e.setAttribute(i,!0===r?"":r)})}function W(e){var t={},i=",autoplay,stretch,fluent,controls,playsinline,loop,muted,default,defaultMuted,";if(e&&e.attributes&&e.attributes.length>0)for(var r=e.attributes,n=r.length-1;n>=0;n--){var a=r[n].name,s=r[n].value;"boolean"!=typeof e[a]&&-1===i.indexOf(","+a+",")||(s=null!==s),t[a]=s}return t}function q(e,t){return e.getAttribute(t)}function X(e,t,i){e.setAttribute(t,i)}function z(e,t){e.removeAttribute(t)}function K(){l.body.focus(),l.onselectstart=function(){return!1}}function Y(){l.onselectstart=function(){return!0}}function Q(e){if(e&&e.getBoundingClientRect&&e.parentNode){var t=e.getBoundingClientRect(),i={};return["bottom","height","left","right","top","width"].forEach(function(e){void 0!==t[e]&&(i[e]=t[e])}),i.height||(i.height=parseFloat(M(e,"height"))),i.width||(i.width=parseFloat(M(e,"width"))),i}}function J(e){var t=void 0;if(e.getBoundingClientRect&&e.parentNode&&(t=e.getBoundingClientRect()),!t)return{left:0,top:0};var i=l.documentElement,r=l.body,a=i.clientLeft||r.clientLeft||0,s=n.pageXOffset||r.scrollLeft,o=t.left+s-a,u=i.clientTop||r.clientTop||0,d=n.pageYOffset||r.scrollTop,c=t.top+d-u;return{left:Math.round(o),top:Math.round(c)}}function Z(e,t){var i={},r=J(e),n=e.offsetWidth,a=e.offsetHeight,s=r.top,o=r.left,u=t.pageY,l=t.pageX;return t.changedTouches&&(l=t.changedTouches[0].pageX,u=t.changedTouches[0].pageY),i.y=Math.max(0,Math.min(1,(s-u+a)/a)),i.x=Math.max(0,Math.min(1,(l-o)/n)),i}function $(e){return k(e)&&3===e.nodeType}function ee(e){for(;e.firstChild;)e.removeChild(e.firstChild);return e}function te(e){return"function"==typeof e&&(e=e()),(Array.isArray(e)?e:[e]).map(function(e){return"function"==typeof e&&(e=e()),L(e)||$(e)?e:"string"==typeof e&&/\S/.test(e)?l.createTextNode(e):void 0}).filter(function(e){return e})}function ie(e,t){return te(t).forEach(function(t){return e.appendChild(t)}),e}function re(e,t){return ie(ee(e),t)}function ne(e){return void 0===e.button&&void 0===e.buttons||(0===e.button&&void 0===e.buttons||0===e.button&&1===e.buttons)}var ae=P("querySelector"),se=P("querySelectorAll"),oe=Object.freeze({isReal:I,isEl:L,isInFrame:x,createEl:U,textContent:N,prependTo:B,hasClass:F,addClass:j,removeClass:H,toggleClass:G,setAttributes:V,getAttributes:W,getAttribute:q,setAttribute:X,removeAttribute:z,blockTextSelection:K,unblockTextSelection:Y,getBoundingClientRect:Q,findPosition:J,getPointerPosition:Z,isTextNode:$,emptyEl:ee,normalizeContent:te,appendContent:ie,insertContent:re,isSingleLeftClick:ne,$:ae,$$:se}),ue=1;function le(){return ue++}var de={},ce="vdata"+(new Date).getTime();function he(e){var t=e[ce];return t||(t=e[ce]=le()),de[t]||(de[t]={}),de[t]}function fe(e){var t=e[ce];return!!t&&!!Object.getOwnPropertyNames(de[t]).length}function pe(e){var t=e[ce];if(t){delete de[t];try{delete e[ce]}catch(t){e.removeAttribute?e.removeAttribute(ce):e[ce]=null}}}function me(e,t){var i=he(e);0===i.handlers[t].length&&(delete i.handlers[t],e.removeEventListener?e.removeEventListener(t,i.dispatcher,!1):e.detachEvent&&e.detachEvent("on"+t,i.dispatcher)),Object.getOwnPropertyNames(i.handlers).length<=0&&(delete i.handlers,delete i.dispatcher,delete i.disabled),0===Object.getOwnPropertyNames(i).length&&pe(e)}function ge(e,t,i,r){i.forEach(function(i){e(t,i,r)})}function ve(e){function t(){return!0}function i(){return!1}if(!e||!e.isPropagationStopped){var r=e||n.event;for(var a in e={},r)"layerX"!==a&&"layerY"!==a&&"keyLocation"!==a&&"webkitMovementX"!==a&&"webkitMovementY"!==a&&("returnValue"===a&&r.preventDefault||(e[a]=r[a]));if(e.target||(e.target=e.srcElement||l),e.relatedTarget||(e.relatedTarget=e.fromElement===e.target?e.toElement:e.fromElement),e.preventDefault=function(){r.preventDefault&&r.preventDefault(),e.returnValue=!1,r.returnValue=!1,e.defaultPrevented=!0},e.defaultPrevented=!1,e.stopPropagation=function(){r.stopPropagation&&r.stopPropagation(),e.cancelBubble=!0,r.cancelBubble=!0,e.isPropagationStopped=t},e.isPropagationStopped=i,e.stopImmediatePropagation=function(){r.stopImmediatePropagation&&r.stopImmediatePropagation(),e.isImmediatePropagationStopped=t,e.stopPropagation()},e.isImmediatePropagationStopped=i,null!==e.clientX&&void 0!==e.clientX){var s=l.documentElement,o=l.body;e.pageX=e.clientX+(s&&s.scrollLeft||o&&o.scrollLeft||0)-(s&&s.clientLeft||o&&o.clientLeft||0),e.pageY=e.clientY+(s&&s.scrollTop||o&&o.scrollTop||0)-(s&&s.clientTop||o&&o.clientTop||0)}e.which=e.charCode||e.keyCode,null!==e.button&&void 0!==e.button&&(e.button=1&e.button?0:4&e.button?1:2&e.button?2:0)}return e}var ye=!1;!function(){try{var e=Object.defineProperty({},"passive",{get:function(){ye=!0}});n.addEventListener("test",null,e),n.removeEventListener("test",null,e)}catch(e){}}();var _e=["touchstart","touchmove"];function be(e,t,i){if(Array.isArray(t))return ge(be,e,t,i);var r=he(e);if(r.handlers||(r.handlers={}),r.handlers[t]||(r.handlers[t]=[]),i.guid||(i.guid=le()),r.handlers[t].push(i),r.dispatcher||(r.disabled=!1,r.dispatcher=function(t,i){if(!r.disabled){t=ve(t);var n=r.handlers[t.type];if(n)for(var a=n.slice(0),s=0,o=a.length;s-1&&(n={passive:!0}),e.addEventListener(t,r.dispatcher,n)}else e.attachEvent&&e.attachEvent("on"+t,r.dispatcher)}function we(e,t,i){if(fe(e)){var r=he(e);if(r.handlers){if(Array.isArray(t))return ge(we,e,t,i);var n=function(e,t){r.handlers[t]=[],me(e,t)};if(void 0!==t){var a=r.handlers[t];if(a)if(i){if(i.guid)for(var s=0;s0)for(var n=0,a=r.length;n=t&&(e.apply(void 0,arguments),i=r)}},Le=function(e,t,i){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:n,a=void 0,s=function(){var n=this,s=arguments,o=function(){a=null,o=null,i||e.apply(n,s)};!a&&i&&e.apply(n,s),r.clearTimeout(a),a=r.setTimeout(o,t)};return s.cancel=function(){r.clearTimeout(a),a=null},s},xe=function(){};xe.prototype.allowedEvents_={},xe.prototype.on=function(e,t){var i=this.addEventListener;this.addEventListener=function(){},be(this,e,t),this.addEventListener=i},xe.prototype.addEventListener=xe.prototype.on,xe.prototype.off=function(e,t){we(this,e,t)},xe.prototype.removeEventListener=xe.prototype.off,xe.prototype.one=function(e,t){var i=this.addEventListener;this.addEventListener=function(){},Te(this,e,t),this.addEventListener=i},xe.prototype.trigger=function(e){var t=e.type||e;"string"==typeof e&&(e={type:t}),e=ve(e),this.allowedEvents_[t]&&this["on"+t]&&this["on"+t](e),Ee(this,e)},xe.prototype.dispatchEvent=xe.prototype.trigger;var Pe=void 0;xe.prototype.queueTrigger=function(e){var t=this;Pe||(Pe=new Map);var i=e.type||e,r=Pe.get(this);r||(r=new Map,Pe.set(this,r));var a=r.get(i);r.delete(i),n.clearTimeout(a);var s=n.setTimeout(function(){0===r.size&&(r=null,Pe.delete(t)),t.trigger(e)},0);r.set(i,s)};var Ue=function(e){return e instanceof xe||!!e.eventBusEl_&&["on","one","off","trigger"].every(function(t){return"function"==typeof e[t]})},Ne=function(e){return"string"==typeof e&&/\S/.test(e)||Array.isArray(e)&&!!e.length},Be=function(e){if(!e.nodeName&&!Ue(e))throw new Error("Invalid target; must be a DOM node or evented object.")},Fe=function(e){if(!Ne(e))throw new Error("Invalid event type; must be a non-empty string or array.")},je=function(e){if("function"!=typeof e)throw new Error("Invalid listener; must be a function.")},He=function(e,t){var i=t.length<3||t[0]===e||t[0]===e.eventBusEl_,r=void 0,n=void 0,a=void 0;return i?(r=e.eventBusEl_,t.length>=3&&t.shift(),n=t[0],a=t[1]):(r=t[0],n=t[1],a=t[2]),Be(r),Fe(n),je(a),{isTargetingSelf:i,target:r,type:n,listener:a=De(e,a)}},Ge=function(e,t,i,r){Be(e),e.nodeName?Se[t](e,i,r):e[t](i,r)},Ve={on:function(){for(var e=this,t=arguments.length,i=Array(t),r=0;r1&&void 0!==arguments[1]?arguments[1]:{}).eventBusKey;if(t){if(!e[t].nodeName)throw new Error('The eventBusKey "'+t+'" does not refer to an element.');e.eventBusEl_=e[t]}else e.eventBusEl_=U("span",{className:"vjs-event-bus"});return A(e,Ve),e.on("dispose",function(){e.off(),n.setTimeout(function(){e.eventBusEl_=null},0)}),e}var qe={state:{},setState:function(e){var t=this;"function"==typeof e&&(e=e());var i=void 0;return S(e,function(e,r){t.state[r]!==e&&((i=i||{})[r]={from:t.state[r],to:e}),t.state[r]=e}),i&&Ue(this)&&this.trigger({changes:i,type:"statechanged"}),i}};function Xe(e,t){return A(e,qe),e.state=A({},e.state,t),"function"==typeof e.handleStateChanged&&Ue(e)&&e.on("statechanged",e.handleStateChanged),e}function ze(e){return"string"!=typeof e?e:e.charAt(0).toUpperCase()+e.slice(1)}function Ke(){for(var e={},t=arguments.length,i=Array(t),r=0;r=0;e--)this.children_[e].dispose&&this.children_[e].dispose();this.children_=null,this.childIndex_=null,this.childNameIndex_=null,this.el_&&(this.el_.parentNode&&this.el_.parentNode.removeChild(this.el_),pe(this.el_),this.el_=null),this.player_=null},e.prototype.player=function(){return this.player_},e.prototype.options=function(e){return p.warn("this.options() has been deprecated and will be moved to the constructor in 6.0"),e?(this.options_=Ke(this.options_,e),this.options_):this.options_},e.prototype.el=function(){return this.el_},e.prototype.createEl=function(e,t,i){return U(e,t,i)},e.prototype.localize=function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e,r=this.player_.language&&this.player_.language(),n=this.player_.languages&&this.player_.languages(),a=n&&n[r],s=r&&r.split("-")[0],o=n&&n[s],u=i;return a&&a[e]?u=a[e]:o&&o[e]&&(u=o[e]),t&&(u=u.replace(/\{(\d+)\}/g,function(e,i){var r=t[i-1],n=r;return void 0===r&&(n=e),n})),u},e.prototype.contentEl=function(){return this.contentEl_||this.el_},e.prototype.id=function(){return this.id_},e.prototype.name=function(){return this.name_},e.prototype.children=function(){return this.children_},e.prototype.getChildById=function(e){return this.childIndex_[e]},e.prototype.getChild=function(e){if(e)return e=ze(e),this.childNameIndex_[e]},e.prototype.addChild=function(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.children_.length,n=void 0,a=void 0;if("string"==typeof t){a=ze(t);var s=i.componentClass||a;i.name=a;var o=e.getComponent(s);if(!o)throw new Error("Component "+s+" does not exist");if("function"!=typeof o)return null;n=new o(this.player_||this,i)}else n=t;if(this.children_.splice(r,0,n),"function"==typeof n.id&&(this.childIndex_[n.id()]=n),(a=a||n.name&&ze(n.name()))&&(this.childNameIndex_[a]=n),"function"==typeof n.el&&n.el()){var u=this.contentEl().children[r]||null;this.contentEl().insertBefore(n.el(),u)}return n},e.prototype.removeChild=function(e){if("string"==typeof e&&(e=this.getChild(e)),e&&this.children_){for(var t=!1,i=this.children_.length-1;i>=0;i--)if(this.children_[i]===e){t=!0,this.children_.splice(i,1);break}if(t){this.childIndex_[e.id()]=null,this.childNameIndex_[e.name()]=null;var r=e.el();r&&r.parentNode===this.contentEl()&&this.contentEl().removeChild(e.el())}}},e.prototype.initChildren=function(){var t=this,i=this.options_.children;if(i){var r=this.options_,n=void 0,a=e.getComponent("Tech");(n=Array.isArray(i)?i:Object.keys(i)).concat(Object.keys(this.options_).filter(function(e){return!n.some(function(t){return"string"==typeof t?e===t:e===t.name})})).map(function(e){var r=void 0,n=void 0;return"string"==typeof e?n=i[r=e]||t.options_[r]||{}:(r=e.name,n=e),{name:r,opts:n}}).filter(function(t){var i=e.getComponent(t.opts.componentClass||ze(t.name));return i&&!a.isTech(i)}).forEach(function(e){var i=e.name,n=e.opts;if(void 0!==r[i]&&(n=r[i]),!1!==n){!0===n&&(n={}),n.playerOptions=t.options_.playerOptions;var a=t.addChild(i,n);a&&(t[i]=a)}})}},e.prototype.buildCSSClass=function(){return""},e.prototype.ready=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(e)return this.isReady_?void(t?e.call(this):this.setTimeout(e,1)):(this.readyQueue_=this.readyQueue_||[],void this.readyQueue_.push(e))},e.prototype.triggerReady=function(){this.isReady_=!0,this.setTimeout(function(){var e=this.readyQueue_;this.readyQueue_=[],e&&e.length>0&&e.forEach(function(e){e.call(this)},this),this.trigger("ready")},1)},e.prototype.$=function(e,t){return ae(e,t||this.contentEl())},e.prototype.$$=function(e,t){return se(e,t||this.contentEl())},e.prototype.hasClass=function(e){return F(this.el_,e)},e.prototype.addClass=function(e){j(this.el_,e)},e.prototype.removeClass=function(e){H(this.el_,e)},e.prototype.toggleClass=function(e,t){G(this.el_,e,t)},e.prototype.show=function(){this.removeClass("vjs-hidden")},e.prototype.hide=function(){this.addClass("vjs-hidden")},e.prototype.lockShowing=function(){this.addClass("vjs-lock-showing")},e.prototype.unlockShowing=function(){this.removeClass("vjs-lock-showing")},e.prototype.getAttribute=function(e){return q(this.el_,e)},e.prototype.setAttribute=function(e,t){X(this.el_,e,t)},e.prototype.removeAttribute=function(e){z(this.el_,e)},e.prototype.width=function(e,t){return this.dimension("width",e,t)},e.prototype.height=function(e,t){return this.dimension("height",e,t)},e.prototype.dimensions=function(e,t){this.width(e,!0),this.height(t)},e.prototype.dimension=function(e,t,i){if(void 0!==t)return null!==t&&t==t||(t=0),-1!==(""+t).indexOf("%")||-1!==(""+t).indexOf("px")?this.el_.style[e]=t:this.el_.style[e]="auto"===t?"":t+"px",void(i||this.trigger("componentresize"));if(!this.el_)return 0;var r=this.el_.style[e],n=r.indexOf("px");return-1!==n?parseInt(r.slice(0,n),10):parseInt(this.el_["offset"+ze(e)],10)},e.prototype.currentDimension=function(e){var t=0;if("width"!==e&&"height"!==e)throw new Error("currentDimension only accepts width or height value");if("function"==typeof n.getComputedStyle){var i=n.getComputedStyle(this.el_);t=i.getPropertyValue(e)||i[e]}if(0===(t=parseFloat(t))){var r="offset"+ze(e);t=this.el_[r]}return t},e.prototype.currentDimensions=function(){return{width:this.currentDimension("width"),height:this.currentDimension("height")}},e.prototype.currentWidth=function(){return this.currentDimension("width")},e.prototype.currentHeight=function(){return this.currentDimension("height")},e.prototype.focus=function(){this.el_.focus()},e.prototype.blur=function(){this.el_.blur()},e.prototype.emitTapEvents=function(){var e=0,t=null,i=void 0;this.on("touchstart",function(r){1===r.touches.length&&(t={pageX:r.touches[0].pageX,pageY:r.touches[0].pageY},e=(new Date).getTime(),i=!0)}),this.on("touchmove",function(e){if(e.touches.length>1)i=!1;else if(t){var r=e.touches[0].pageX-t.pageX,n=e.touches[0].pageY-t.pageY;Math.sqrt(r*r+n*n)>10&&(i=!1)}});var r=function(){i=!1};this.on("touchleave",r),this.on("touchcancel",r),this.on("touchend",function(r){(t=null,!0===i)&&((new Date).getTime()-e<200&&(r.preventDefault(),this.trigger("tap")))})},e.prototype.enableTouchActivity=function(){if(this.player()&&this.player().reportUserActivity){var e=De(this.player(),this.player().reportUserActivity),t=void 0;this.on("touchstart",function(){e(),this.clearInterval(t),t=this.setInterval(e,250)});var i=function(i){e(),this.clearInterval(t)};this.on("touchmove",e),this.on("touchend",i),this.on("touchcancel",i)}},e.prototype.setTimeout=function(e,t){var i,r,a=this;return e=De(this,e),i=n.setTimeout(function(){a.off("dispose",r),e()},t),(r=function(){return a.clearTimeout(i)}).guid="vjs-timeout-"+i,this.on("dispose",r),i},e.prototype.clearTimeout=function(e){n.clearTimeout(e);var t=function(){};return t.guid="vjs-timeout-"+e,this.off("dispose",t),e},e.prototype.setInterval=function(e,t){var i=this;e=De(this,e);var r=n.setInterval(e,t),a=function(){return i.clearInterval(r)};return a.guid="vjs-interval-"+r,this.on("dispose",a),r},e.prototype.clearInterval=function(e){n.clearInterval(e);var t=function(){};return t.guid="vjs-interval-"+e,this.off("dispose",t),e},e.prototype.requestAnimationFrame=function(e){var t,i,r=this;return this.supportsRaf_?(e=De(this,e),t=n.requestAnimationFrame(function(){r.off("dispose",i),e()}),(i=function(){return r.cancelAnimationFrame(t)}).guid="vjs-raf-"+t,this.on("dispose",i),t):this.setTimeout(e,1e3/60)},e.prototype.cancelAnimationFrame=function(e){if(this.supportsRaf_){n.cancelAnimationFrame(e);var t=function(){};return t.guid="vjs-raf-"+e,this.off("dispose",t),e}return this.clearTimeout(e)},e.registerComponent=function(t,i){if("string"!=typeof t||!t)throw new Error('Illegal component name, "'+t+'"; must be a non-empty string.');var r=e.getComponent("Tech"),n=r&&r.isTech(i),a=e===i||e.prototype.isPrototypeOf(i.prototype);if(n||!a){var s=void 0;throw s=n?"techs must be registered using Tech.registerTech()":"must be a Component subclass",new Error('Illegal component, "'+t+'"; '+s+".")}t=ze(t),e.components_||(e.components_={});var o=e.getComponent("Player");if("Player"===t&&o&&o.players){var u=o.players,l=Object.keys(u);if(u&&l.length>0&&l.map(function(e){return u[e]}).every(Boolean))throw new Error("Can not register Player component after player has been created.")}return e.components_[t]=i,i},e.getComponent=function(t){if(t)return t=ze(t),e.components_&&e.components_[t]?e.components_[t]:void 0},e}();Ye.prototype.supportsRaf_="function"==typeof n.requestAnimationFrame&&"function"==typeof n.cancelAnimationFrame,Ye.registerComponent("Component",Ye);var Qe,Je=n.navigator&&n.navigator.userAgent||"",Ze=/AppleWebKit\/([\d.]+)/i.exec(Je),$e=Ze?parseFloat(Ze.pop()):null,et=/iPad/i.test(Je),tt=/iPhone/i.test(Je)&&!et,it=/iPod/i.test(Je),rt=tt||et||it,nt=(Qe=Je.match(/OS (\d+)_/i))&&Qe[1]?Qe[1]:null,at=/Android/i.test(Je),st=function(){var e=Je.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);if(!e)return null;var t=e[1]&&parseFloat(e[1]),i=e[2]&&parseFloat(e[2]);return t&&i?parseFloat(e[1]+"."+e[2]):t||null}(),ot=at&&st<5&&$e<537,ut=/Firefox/i.test(Je),lt=/Edge/i.test(Je),dt=!lt&&(/Chrome/i.test(Je)||/CriOS/i.test(Je)),ct=function(){var e=Je.match(/(Chrome|CriOS)\/(\d+)/);return e&&e[2]?parseFloat(e[2]):null}(),ht=function(){var e=/MSIE\s(\d+)\.\d/.exec(Je),t=e&&parseFloat(e[1]);return!t&&/Trident\/7.0/i.test(Je)&&/rv:11.0/.test(Je)&&(t=11),t}(),ft=/Safari/i.test(Je)&&!dt&&!at&&!lt,pt=(ft||rt)&&!dt,mt=I()&&("ontouchstart"in n||n.navigator.maxTouchPoints||n.DocumentTouch&&n.document instanceof n.DocumentTouch),gt=Object.freeze({IS_IPAD:et,IS_IPHONE:tt,IS_IPOD:it,IS_IOS:rt,IOS_VERSION:nt,IS_ANDROID:at,ANDROID_VERSION:st,IS_NATIVE_ANDROID:ot,IS_FIREFOX:ut,IS_EDGE:lt,IS_CHROME:dt,CHROME_VERSION:ct,IE_VERSION:ht,IS_SAFARI:ft,IS_ANY_SAFARI:pt,TOUCH_ENABLED:mt});function vt(e,t,i,r){return function(e,t,i){if("number"!=typeof t||t<0||t>i)throw new Error("Failed to execute '"+e+"' on 'TimeRanges': The index provided ("+t+") is non-numeric or out of bounds (0-"+i+").")}(e,r,i.length-1),i[r][t]}function yt(e){return void 0===e||0===e.length?{length:0,start:function(){throw new Error("This TimeRanges object is empty")},end:function(){throw new Error("This TimeRanges object is empty")}}:{length:e.length,start:vt.bind(null,"start",0,e),end:vt.bind(null,"end",1,e)}}function _t(e,t){return Array.isArray(e)?yt(e):void 0===e||void 0===t?yt():yt([[e,t]])}function bt(e,t){var i=0,r=void 0,n=void 0;if(!t)return 0;e&&e.length||(e=_t(0,0));for(var a=0;at&&(n=t),i+=n-r;return i/t}for(var wt={},Et=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror"],["webkitRequestFullScreen","webkitCancelFullScreen","webkitCurrentFullScreenElement","webkitCancelFullScreen","webkitfullscreenchange","webkitfullscreenerror"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError"]],Tt=Et[0],St=void 0,At=0;At0&&void 0!==arguments[0]?arguments[0]:[];y(this,t);var r=b(this,e.call(this));r.tracks_=[],Object.defineProperty(r,"length",{get:function(){return this.tracks_.length}});for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:[];y(this,t);for(var r=i.length-1;r>=0;r--)if(i[r].enabled){Ft(i,i[r]);break}var n=b(this,e.call(this,i));return n.changing_=!1,n}return _(t,e),t.prototype.addTrack=function(t){var i=this;t.enabled&&Ft(this,t),e.prototype.addTrack.call(this,t),t.addEventListener&&t.addEventListener("enabledchange",function(){i.changing_||(i.changing_=!0,Ft(i,t),i.changing_=!1,i.trigger("change"))})},t}(Nt),Ht=function(e,t){for(var i=0;i0&&void 0!==arguments[0]?arguments[0]:[];y(this,t);for(var r=i.length-1;r>=0;r--)if(i[r].selected){Ht(i,i[r]);break}var n=b(this,e.call(this,i));return n.changing_=!1,Object.defineProperty(n,"selectedIndex",{get:function(){for(var e=0;e0&&void 0!==arguments[0]?arguments[0]:[];y(this,e),this.trackElements_=[],Object.defineProperty(this,"length",{get:function(){return this.trackElements_.length}});for(var i=0,r=t.length;i0&&void 0!==arguments[0]?arguments[0]:{};y(this,t);var r=b(this,e.call(this)),n={id:i.id||"vjs_track_"+le(),kind:i.kind||"",label:i.label||"",language:i.language||""},a=function(e){Object.defineProperty(r,e,{get:function(){return n[e]},set:function(){}})};for(var s in n)a(s);return r}return _(t,e),t}(xe),Jt=function(e){var t=["protocol","hostname","port","pathname","search","hash","host"],i=l.createElement("a");i.href=e;var r=""===i.host&&"file:"!==i.protocol,a=void 0;r&&((a=l.createElement("div")).innerHTML='',i=a.firstChild,a.setAttribute("style","display:none; position:absolute;"),l.body.appendChild(a));for(var s={},o=0;ox',e=t.firstChild.href}return e},$t=function(e){if("string"==typeof e){var t=/^(\/?)([\s\S]*?)((?:\.{1,2}|[^\/]+?)(\.([^\.\/\?]+)))(?:[\/]*|[\?].*)$/i.exec(e);if(t)return t.pop().toLowerCase()}return""},ei=function(e){var t=n.location,i=Jt(e);return(":"===i.protocol?t.protocol:i.protocol)+i.host!==t.protocol+t.host},ti=Object.freeze({parseUrl:Jt,getAbsoluteURL:Zt,getFileExtension:$t,isCrossOrigin:ei}),ii=function(e){var t=ri.call(e);return"[object Function]"===t||"function"==typeof e&&"[object RegExp]"!==t||"undefined"!=typeof window&&(e===window.setTimeout||e===window.alert||e===window.confirm||e===window.prompt)},ri=Object.prototype.toString;var ni=Object.freeze({default:ii,__moduleExports:ii}),ai=i(function(e,t){(t=e.exports=function(e){return e.replace(/^\s*|\s*$/g,"")}).left=function(e){return e.replace(/^\s*/,"")},t.right=function(e){return e.replace(/\s*$/,"")}}),si=ai.left,oi=ai.right,ui=Object.freeze({default:ai,__moduleExports:ai,left:si,right:oi}),li=ni&&ii||ni,di=function(e,t,i){if(!li(t))throw new TypeError("iterator must be a function");arguments.length<3&&(i=this);"[object Array]"===ci.call(e)?function(e,t,i){for(var r=0,n=e.length;r0&&(u=setTimeout(function(){if(!s){s=!0,o.abort("timeout");var e=new Error("XMLHttpRequest timeout");e.code="ETIMEDOUT",r(e)}},e.timeout)),o.setRequestHeader)for(a in h)h.hasOwnProperty(a)&&o.setRequestHeader(a,h[a]);else e.headers&&function(e){for(var t in e)if(e.hasOwnProperty(t))return!1}(e.headers);return"responseType"in e&&(o.responseType=e.responseType),"beforeSend"in e&&"function"==typeof e.beforeSend&&e.beforeSend(o),o.send(c||null),o}Ai.XMLHttpRequest=n.XMLHttpRequest||function(){},Ai.XDomainRequest="withCredentials"in new Ai.XMLHttpRequest?Ai.XMLHttpRequest:n.XDomainRequest,function(e,t){for(var i=0;i0&&(n.console&&n.console.groupCollapsed&&n.console.groupCollapsed("Text Track parsing errors for "+t.src),r.forEach(function(e){return p.error(e)}),n.console&&n.console.groupEnd&&n.console.groupEnd()),i.flush()},Mi=function(e,t){var i={uri:e},r=ei(e);r&&(i.cors=r),Ti(i,De(this,function(e,i,r){if(e)return p.error(e,i);if(t.loaded_=!0,"function"!=typeof n.WebVTT){if(t.tech_){var a=function(){return Ri(r,t)};t.tech_.on("vttjsloaded",a),t.tech_.on("vttjserror",function(){p.error("vttjs failed to load, stopping trying to process "+t.src),t.tech_.off("vttjsloaded",a)})}}else Ri(r,t)}))},Oi=function(e){function t(){var i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(y(this,t),!i.tech)throw new Error("A tech was not provided.");var r=Ke(i,{kind:Kt[i.kind]||"subtitles",language:i.language||i.srclang||""}),n=Yt[r.mode]||"disabled",a=r.default;"metadata"!==r.kind&&"chapters"!==r.kind||(n="hidden");var s=b(this,e.call(this,r));s.tech_=r.tech,s.cues_=[],s.activeCues_=[];var o=new qt(s.cues_),u=new qt(s.activeCues_),l=!1,d=De(s,function(){this.activeCues=this.activeCues,l&&(this.trigger("cuechange"),l=!1)});return"disabled"!==n&&s.tech_.ready(function(){s.tech_.on("timeupdate",d)},!0),Object.defineProperties(s,{default:{get:function(){return a},set:function(){}},mode:{get:function(){return n},set:function(e){var t=this;Yt[e]&&("disabled"!==(n=e)?this.tech_.ready(function(){t.tech_.on("timeupdate",d)},!0):this.tech_.off("timeupdate",d),this.trigger("modechange"))}},cues:{get:function(){return this.loaded_?o:null},set:function(){}},activeCues:{get:function(){if(!this.loaded_)return null;if(0===this.cues.length)return u;for(var e=this.tech_.currentTime(),t=[],i=0,r=this.cues.length;i=e?t.push(n):n.startTime===n.endTime&&n.startTime<=e&&n.startTime+.5>=e&&t.push(n)}if(l=!1,t.length!==this.activeCues_.length)l=!0;else for(var a=0;a0&&void 0!==arguments[0]?arguments[0]:{};y(this,t);var r=Ke(i,{kind:zt[i.kind]||""}),n=b(this,e.call(this,r)),a=!1;return Object.defineProperty(n,"enabled",{get:function(){return a},set:function(e){"boolean"==typeof e&&e!==a&&(a=e,this.trigger("enabledchange"))}}),r.enabled&&(n.enabled=r.enabled),n.loaded_=!0,n}return _(t,e),t}(Qt),Di=function(e){function t(){var i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};y(this,t);var r=Ke(i,{kind:Xt[i.kind]||""}),n=b(this,e.call(this,r)),a=!1;return Object.defineProperty(n,"selected",{get:function(){return a},set:function(e){"boolean"==typeof e&&e!==a&&(a=e,this.trigger("selectedchange"))}}),r.selected&&(n.selected=r.selected),n}return _(t,e),t}(Qt),Ii=0,Li=2,xi=function(e){function t(){var i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};y(this,t);var r=b(this,e.call(this)),n=void 0,a=new Oi(i);return r.kind=a.kind,r.src=a.src,r.srclang=a.language,r.label=a.label,r.default=a.default,Object.defineProperties(r,{readyState:{get:function(){return n}},track:{get:function(){return a}}}),n=Ii,a.addEventListener("loadeddata",function(){n=Li,r.trigger({type:"load",target:r})}),r}return _(t,e),t}(xe);xi.prototype.allowedEvents_={load:"load"},xi.NONE=Ii,xi.LOADING=1,xi.LOADED=Li,xi.ERROR=3;var Pi={audio:{ListClass:jt,TrackClass:Ci,capitalName:"Audio"},video:{ListClass:Gt,TrackClass:Di,capitalName:"Video"},text:{ListClass:Vt,TrackClass:Oi,capitalName:"Text"}};Object.keys(Pi).forEach(function(e){Pi[e].getterName=e+"Tracks",Pi[e].privateName=e+"Tracks_"});var Ui={remoteText:{ListClass:Vt,TrackClass:Oi,capitalName:"RemoteText",getterName:"remoteTextTracks",privateName:"remoteTextTracks_"},remoteTextEl:{ListClass:Wt,TrackClass:xi,capitalName:"RemoteTextTrackEls",getterName:"remoteTextTrackEls",privateName:"remoteTextTrackEls_"}},Ni=Ke(Pi,Ui);Ui.names=Object.keys(Ui),Pi.names=Object.keys(Pi),Ni.names=[].concat(Ui.names).concat(Pi.names);var Bi=Object.create||function(){function e(){}return function(t){if(1!==arguments.length)throw new Error("Object.create shim only accepts one parameter.");return e.prototype=t,new e}}();function Fi(e,t){this.name="ParsingError",this.code=e.code,this.message=t||e.message}function ji(e){function t(e,t,i,r){return 3600*(0|e)+60*(0|t)+(0|i)+(0|r)/1e3}var i=e.match(/^(\d+):(\d{2})(:\d{2})?\.(\d{3})/);return i?i[3]?t(i[1],i[2],i[3].replace(":",""),i[4]):i[1]>59?t(i[1],i[2],0,i[4]):t(0,i[1],i[2],i[4]):null}function Hi(){this.values=Bi(null)}function Gi(e,t,i,r){var n=r?e.split(r):[e];for(var a in n)if("string"==typeof n[a]){var s=n[a].split(i);if(2===s.length)t(s[0],s[1])}}function Vi(e,t,i){var r=e;function n(){var t=ji(e);if(null===t)throw new Fi(Fi.Errors.BadTimeStamp,"Malformed timestamp: "+r);return e=e.replace(/^[^\sa-zA-Z-]+/,""),t}function a(){e=e.replace(/^\s+/,"")}if(a(),t.startTime=n(),a(),"--\x3e"!==e.substr(0,3))throw new Fi(Fi.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '--\x3e'): "+r);e=e.substr(3),a(),t.endTime=n(),a(),function(e,t){var r=new Hi;Gi(e,function(e,t){switch(e){case"region":for(var n=i.length-1;n>=0;n--)if(i[n].id===t){r.set(e,i[n].region);break}break;case"vertical":r.alt(e,t,["rl","lr"]);break;case"line":var a=t.split(","),s=a[0];r.integer(e,s),r.percent(e,s)&&r.set("snapToLines",!1),r.alt(e,s,["auto"]),2===a.length&&r.alt("lineAlign",a[1],["start","middle","end"]);break;case"position":a=t.split(","),r.percent(e,a[0]),2===a.length&&r.alt("positionAlign",a[1],["start","middle","end"]);break;case"size":r.percent(e,t);break;case"align":r.alt(e,t,["start","middle","end","left","right"])}},/:/,/\s/),t.region=r.get("region",null),t.vertical=r.get("vertical",""),t.line=r.get("line","auto"),t.lineAlign=r.get("lineAlign","start"),t.snapToLines=r.get("snapToLines",!0),t.size=r.get("size",100),t.align=r.get("align","middle"),t.position=r.get("position",{start:0,left:0,middle:50,end:100,right:100},t.align),t.positionAlign=r.get("positionAlign",{start:"start",left:"start",middle:"middle",end:"end",right:"end"},t.align)}(e,t)}Fi.prototype=Bi(Error.prototype),Fi.prototype.constructor=Fi,Fi.Errors={BadSignature:{code:0,message:"Malformed WebVTT signature."},BadTimeStamp:{code:1,message:"Malformed time stamp."}},Hi.prototype={set:function(e,t){this.get(e)||""===t||(this.values[e]=t)},get:function(e,t,i){return i?this.has(e)?this.values[e]:t[i]:this.has(e)?this.values[e]:t},has:function(e){return e in this.values},alt:function(e,t,i){for(var r=0;r=0&&t<=100)&&(this.set(e,t),!0)}};var Wi={"&":"&","<":"<",">":">","‎":"‎","‏":"‏"," ":" "},qi={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"},Xi={v:"title",lang:"lang"},zi={rt:"ruby"};function Ki(e,t){function i(){if(!t)return null;var e,i=t.match(/^([^<]*)(<[^>]*>?)?/);return e=i[1]?i[1]:i[2],t=t.substr(e.length),e}function r(e){return Wi[e]}function n(e){for(;f=e.match(/&(amp|lt|gt|lrm|rlm|nbsp);/);)e=e.replace(f[0],r);return e}function a(e,t){return!zi[t.localName]||zi[t.localName]===e.localName}function s(t,i){var r=qi[t];if(!r)return null;var n=e.document.createElement(r);n.localName=r;var a=Xi[t];return a&&i&&(n[a]=i.trim()),n}for(var o,u=e.document.createElement("div"),l=u,d=[];null!==(o=i());)if("<"!==o[0])l.appendChild(e.document.createTextNode(n(o)));else{if("/"===o[1]){d.length&&d[d.length-1]===o.substr(2).replace(">","")&&(d.pop(),l=l.parentNode);continue}var c,h=ji(o.substr(1,o.length-2));if(h){c=e.document.createProcessingInstruction("timestamp",h),l.appendChild(c);continue}var f=o.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!f)continue;if(!(c=s(f[1],f[3])))continue;if(!a(l,c))continue;f[2]&&(c.className=f[2].substr(1).replace("."," ")),d.push(f[1]),l.appendChild(c),l=c}return u}var Yi=[[1470,1470],[1472,1472],[1475,1475],[1478,1478],[1488,1514],[1520,1524],[1544,1544],[1547,1547],[1549,1549],[1563,1563],[1566,1610],[1645,1647],[1649,1749],[1765,1766],[1774,1775],[1786,1805],[1807,1808],[1810,1839],[1869,1957],[1969,1969],[1984,2026],[2036,2037],[2042,2042],[2048,2069],[2074,2074],[2084,2084],[2088,2088],[2096,2110],[2112,2136],[2142,2142],[2208,2208],[2210,2220],[8207,8207],[64285,64285],[64287,64296],[64298,64310],[64312,64316],[64318,64318],[64320,64321],[64323,64324],[64326,64449],[64467,64829],[64848,64911],[64914,64967],[65008,65020],[65136,65140],[65142,65276],[67584,67589],[67592,67592],[67594,67637],[67639,67640],[67644,67644],[67647,67669],[67671,67679],[67840,67867],[67872,67897],[67903,67903],[67968,68023],[68030,68031],[68096,68096],[68112,68115],[68117,68119],[68121,68147],[68160,68167],[68176,68184],[68192,68223],[68352,68405],[68416,68437],[68440,68466],[68472,68479],[68608,68680],[126464,126467],[126469,126495],[126497,126498],[126500,126500],[126503,126503],[126505,126514],[126516,126519],[126521,126521],[126523,126523],[126530,126530],[126535,126535],[126537,126537],[126539,126539],[126541,126543],[126545,126546],[126548,126548],[126551,126551],[126553,126553],[126555,126555],[126557,126557],[126559,126559],[126561,126562],[126564,126564],[126567,126570],[126572,126578],[126580,126583],[126585,126588],[126590,126590],[126592,126601],[126603,126619],[126625,126627],[126629,126633],[126635,126651],[1114109,1114109]];function Qi(e){for(var t=0;t=i[0]&&e<=i[1])return!0}return!1}function Ji(){}function Zi(e,t,i){Ji.call(this),this.cue=t,this.cueDiv=Ki(e,t.text);var r={color:"rgba(255, 255, 255, 1)",backgroundColor:"rgba(0, 0, 0, 0.8)",position:"relative",left:0,right:0,top:0,bottom:0,display:"inline",writingMode:""===t.vertical?"horizontal-tb":"lr"===t.vertical?"vertical-lr":"vertical-rl",unicodeBidi:"plaintext"};this.applyStyles(r,this.cueDiv),this.div=e.document.createElement("div"),r={direction:function(e){var t=[],i="";if(!e||!e.childNodes)return"ltr";function r(e,t){for(var i=t.childNodes.length-1;i>=0;i--)e.push(t.childNodes[i])}function n(e){if(!e||!e.length)return null;var t=e.pop(),i=t.textContent||t.innerText;if(i){var a=i.match(/^.*(\n|\r)/);return a?(e.length=0,a[0]):i}return"ruby"===t.tagName?n(e):t.childNodes?(r(e,t),n(e)):void 0}for(r(t,e);i=n(t);)for(var a=0;a=0&&e.line<=100))return e.line;if(!e.track||!e.track.textTrackList||!e.track.textTrackList.mediaElement)return-1;for(var t=e.track,i=t.textTrackList,r=0,n=0;nc&&(d=d<0?-1:1,d*=Math.ceil(c/l)*l),s<0&&(d+=""===a.vertical?i.height:i.width,o=o.reverse()),n.move(h,d)}else{var f=n.lineHeight/i.height*100;switch(a.lineAlign){case"middle":s-=f/2;break;case"end":s-=f}switch(a.vertical){case"":t.applyStyles({top:t.formatStyle(s,"%")});break;case"rl":t.applyStyles({left:t.formatStyle(s,"%")});break;case"lr":t.applyStyles({right:t.formatStyle(s,"%")})}o=["+y","-x","+x","-y"],n=new $i(t)}var p=function(e,t){for(var n,a=new $i(e),s=1,o=0;ou&&(n=new $i(e),s=u),e=new $i(a)}return n||a}(n,o);t.move(p.toCSSCompatValues(i))}function tr(){}Ji.prototype.applyStyles=function(e,t){for(var i in t=t||this.div,e)e.hasOwnProperty(i)&&(t.style[i]=e[i])},Ji.prototype.formatStyle=function(e,t){return 0===e?0:e+t},Zi.prototype=Bi(Ji.prototype),Zi.prototype.constructor=Zi,$i.prototype.move=function(e,t){switch(t=void 0!==t?t:this.lineHeight,e){case"+x":this.left+=t,this.right+=t;break;case"-x":this.left-=t,this.right-=t;break;case"+y":this.top+=t,this.bottom+=t;break;case"-y":this.top-=t,this.bottom-=t}},$i.prototype.overlaps=function(e){return this.lefte.left&&this.tope.top},$i.prototype.overlapsAny=function(e){for(var t=0;t=e.top&&this.bottom<=e.bottom&&this.left>=e.left&&this.right<=e.right},$i.prototype.overlapsOppositeAxis=function(e,t){switch(t){case"+x":return this.lefte.right;case"+y":return this.tope.bottom}},$i.prototype.intersectPercentage=function(e){return Math.max(0,Math.min(this.right,e.right)-Math.max(this.left,e.left))*Math.max(0,Math.min(this.bottom,e.bottom)-Math.max(this.top,e.top))/(this.height*this.width)},$i.prototype.toCSSCompatValues=function(e){return{top:this.top-e.top,bottom:e.bottom-this.bottom,left:this.left-e.left,right:e.right-this.right,height:this.height,width:this.width}},$i.getSimpleBoxPosition=function(e){var t=e.div?e.div.offsetHeight:e.tagName?e.offsetHeight:0,i=e.div?e.div.offsetWidth:e.tagName?e.offsetWidth:0,r=e.div?e.div.offsetTop:e.tagName?e.offsetTop:0;return{left:(e=e.div?e.div.getBoundingClientRect():e.tagName?e.getBoundingClientRect():e).left,right:e.right,top:e.top||r,height:e.height||t,bottom:e.bottom||r+(e.height||t),width:e.width||i}},tr.StringDecoder=function(){return{decode:function(e){if(!e)return"";if("string"!=typeof e)throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(e))}}},tr.convertCueToDOMTree=function(e,t){return e&&t?Ki(e,t):null};tr.processCues=function(e,t,i){if(!e||!t||!i)return null;for(;i.firstChild;)i.removeChild(i.firstChild);var r=e.document.createElement("div");if(r.style.position="absolute",r.style.left="0",r.style.right="0",r.style.top="0",r.style.bottom="0",r.style.margin="1.5%",i.appendChild(r),function(e){for(var t=0;t100)throw new Error("Position must be between 0 and 100.");f=e,this.hasBeenReset=!0}},positionAlign:{enumerable:!0,get:function(){return p},set:function(e){var t=or(e);if(!t)throw new SyntaxError("An invalid or illegal string was specified.");p=t,this.hasBeenReset=!0}},size:{enumerable:!0,get:function(){return m},set:function(e){if(e<0||e>100)throw new Error("Size must be between 0 and 100.");m=e,this.hasBeenReset=!0}},align:{enumerable:!0,get:function(){return g},set:function(e){var t=or(e);if(!t)throw new SyntaxError("An invalid or illegal string was specified.");g=t,this.hasBeenReset=!0}}}),this.displayState=void 0}ur.prototype.getCueAsHTML=function(){return WebVTT.convertCueToDOMTree(window,this.text)};var lr=ur,dr=Object.freeze({default:lr,__moduleExports:lr}),cr={"":!0,up:!0};function hr(e){return"number"==typeof e&&e>=0&&e<=100}var fr=function(){var e=100,t=3,i=0,r=100,n=0,a=100,s="";Object.defineProperties(this,{width:{enumerable:!0,get:function(){return e},set:function(t){if(!hr(t))throw new Error("Width must be between 0 and 100.");e=t}},lines:{enumerable:!0,get:function(){return t},set:function(e){if("number"!=typeof e)throw new TypeError("Lines must be set to a number.");t=e}},regionAnchorY:{enumerable:!0,get:function(){return r},set:function(e){if(!hr(e))throw new Error("RegionAnchorX must be between 0 and 100.");r=e}},regionAnchorX:{enumerable:!0,get:function(){return i},set:function(e){if(!hr(e))throw new Error("RegionAnchorY must be between 0 and 100.");i=e}},viewportAnchorY:{enumerable:!0,get:function(){return a},set:function(e){if(!hr(e))throw new Error("ViewportAnchorY must be between 0 and 100.");a=e}},viewportAnchorX:{enumerable:!0,get:function(){return n},set:function(e){if(!hr(e))throw new Error("ViewportAnchorX must be between 0 and 100.");n=e}},scroll:{enumerable:!0,get:function(){return s},set:function(e){var t=function(e){return"string"==typeof e&&!!cr[e.toLowerCase()]&&e.toLowerCase()}(e);if(!1===t)throw new SyntaxError("An invalid or illegal string was specified.");s=t}}})},pr=Object.freeze({default:fr,__moduleExports:fr}),mr=rr&&ir||rr,gr=dr&&lr||dr,vr=pr&&fr||pr,yr=i(function(e){var t=e.exports={WebVTT:mr,VTTCue:gr,VTTRegion:vr};n.vttjs=t,n.WebVTT=t.WebVTT;var i=t.VTTCue,r=t.VTTRegion,a=n.VTTCue,s=n.VTTRegion;t.shim=function(){n.VTTCue=i,n.VTTRegion=r},t.restore=function(){n.VTTCue=a,n.VTTRegion=s},n.VTTCue||t.shim()});yr.WebVTT,yr.VTTCue,yr.VTTRegion;var _r=function(e){function t(){var i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){};y(this,t),i.reportTouchActivity=!1;var n=b(this,e.call(this,null,i,r));return n.hasStarted_=!1,n.on("playing",function(){this.hasStarted_=!0}),n.on("loadstart",function(){this.hasStarted_=!1}),Ni.names.forEach(function(e){var t=Ni[e];i&&i[t.getterName]&&(n[t.privateName]=i[t.getterName])}),n.featuresProgressEvents||n.manualProgressOn(),n.featuresTimeupdateEvents||n.manualTimeUpdatesOn(),["Text","Audio","Video"].forEach(function(e){!1===i["native"+e+"Tracks"]&&(n["featuresNative"+e+"Tracks"]=!1)}),!1===i.nativeCaptions||!1===i.nativeTextTracks?n.featuresNativeTextTracks=!1:!0!==i.nativeCaptions&&!0!==i.nativeTextTracks||(n.featuresNativeTextTracks=!0),n.featuresNativeTextTracks||n.emulateTextTracks(),n.autoRemoteTextTracks_=new Ni.text.ListClass,n.initTrackListeners(),i.nativeControlsForTouch||n.emitTapEvents(),n.constructor&&(n.name_=n.constructor.name||"Unknown Tech"),n}return _(t,e),t.prototype.triggerSourceset=function(e){var t=this;this.isReady_||this.one("ready",function(){return t.setTimeout(function(){return t.triggerSourceset(e)},1)}),this.trigger({src:e,type:"sourceset"})},t.prototype.manualProgressOn=function(){this.on("durationchange",this.onDurationChange),this.manualProgress=!0,this.one("ready",this.trackProgress)},t.prototype.manualProgressOff=function(){this.manualProgress=!1,this.stopTrackingProgress(),this.off("durationchange",this.onDurationChange)},t.prototype.trackProgress=function(e){this.stopTrackingProgress(),this.progressInterval=this.setInterval(De(this,function(){var e=this.bufferedPercent();this.bufferedPercent_!==e&&this.trigger("progress"),this.bufferedPercent_=e,1===e&&this.stopTrackingProgress()}),500)},t.prototype.onDurationChange=function(e){this.duration_=this.duration()},t.prototype.buffered=function(){return _t(0,0)},t.prototype.bufferedPercent=function(){return bt(this.buffered(),this.duration_)},t.prototype.stopTrackingProgress=function(){this.clearInterval(this.progressInterval)},t.prototype.manualTimeUpdatesOn=function(){this.manualTimeUpdates=!0,this.on("play",this.trackCurrentTime),this.on("pause",this.stopTrackingCurrentTime)},t.prototype.manualTimeUpdatesOff=function(){this.manualTimeUpdates=!1,this.stopTrackingCurrentTime(),this.off("play",this.trackCurrentTime),this.off("pause",this.stopTrackingCurrentTime)},t.prototype.trackCurrentTime=function(){this.currentTimeInterval&&this.stopTrackingCurrentTime(),this.currentTimeInterval=this.setInterval(function(){this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},250)},t.prototype.stopTrackingCurrentTime=function(){this.clearInterval(this.currentTimeInterval),this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},t.prototype.dispose=function(){this.clearTracks(Pi.names),this.manualProgress&&this.manualProgressOff(),this.manualTimeUpdates&&this.manualTimeUpdatesOff(),e.prototype.dispose.call(this)},t.prototype.clearTracks=function(e){var t=this;(e=[].concat(e)).forEach(function(e){for(var i=t[e+"Tracks"]()||[],r=i.length;r--;){var n=i[r];"text"===e&&t.removeRemoteTextTrack(n),i.removeTrack(n)}})},t.prototype.cleanupAutoTextTracks=function(){for(var e=this.autoRemoteTextTracks_||[],t=e.length;t--;){var i=e[t];this.removeRemoteTextTrack(i)}},t.prototype.reset=function(){},t.prototype.error=function(e){return void 0!==e&&(this.error_=new Rt(e),this.trigger("error")),this.error_},t.prototype.played=function(){return this.hasStarted_?_t(0,0):_t()},t.prototype.setCurrentTime=function(){this.manualTimeUpdates&&this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},t.prototype.initTrackListeners=function(){var e=this;Pi.names.forEach(function(t){var i=Pi[t],r=function(){e.trigger(t+"trackchange")},n=e[i.getterName]();n.addEventListener("removetrack",r),n.addEventListener("addtrack",r),e.on("dispose",function(){n.removeEventListener("removetrack",r),n.removeEventListener("addtrack",r)})})},t.prototype.addWebVttScript_=function(){var e=this;if(!n.WebVTT)if(l.body.contains(this.el())){if(!this.options_["vtt.js"]&&R(yr)&&Object.keys(yr).length>0)return void this.trigger("vttjsloaded");var t=l.createElement("script");t.src=this.options_["vtt.js"]||"https://vjs.zencdn.net/vttjs/0.14.1/vtt.min.js",t.onload=function(){e.trigger("vttjsloaded")},t.onerror=function(){e.trigger("vttjserror")},this.on("dispose",function(){t.onload=null,t.onerror=null}),n.WebVTT=!0,this.el().parentNode.appendChild(t)}else this.ready(this.addWebVttScript_)},t.prototype.emulateTextTracks=function(){var e=this,t=this.textTracks(),i=this.remoteTextTracks(),r=function(e){return t.addTrack(e.track)},n=function(e){return t.removeTrack(e.track)};i.on("addtrack",r),i.on("removetrack",n),this.addWebVttScript_();var a=function(){return e.trigger("texttrackchange")},s=function(){a();for(var e=0;e4&&void 0!==arguments[4]?arguments[4]:{},a=e.textTracks();n.kind=t,i&&(n.label=i),r&&(n.language=r),n.tech=e;var s=new Ni.text.TrackClass(n);return a.addTrack(s),s}(this,e,t,i)},t.prototype.createRemoteTextTrack=function(e){var t=Ke(e,{tech:this});return new Ui.remoteTextEl.TrackClass(t)},t.prototype.addRemoteTextTrack=function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments[1],r=this.createRemoteTextTrack(t);return!0!==i&&!1!==i&&(p.warn('Calling addRemoteTextTrack without explicitly setting the "manualCleanup" parameter to `true` is deprecated and default to `false` in future version of video.js'),i=!0),this.remoteTextTrackEls().addTrackElement_(r),this.remoteTextTracks().addTrack(r.track),!0!==i&&this.ready(function(){return e.autoRemoteTextTracks_.addTrack(r.track)}),r},t.prototype.removeRemoteTextTrack=function(e){var t=this.remoteTextTrackEls().getTrackElementByTrack_(e);this.remoteTextTrackEls().removeTrackElement_(t),this.remoteTextTracks().removeTrack(e),this.autoRemoteTextTracks_.removeTrack(e)},t.prototype.getVideoPlaybackQuality=function(){return{}},t.prototype.setPoster=function(){},t.prototype.playsinline=function(){},t.prototype.setPlaysinline=function(){},t.prototype.overrideNativeAudioTracks=function(){},t.prototype.overrideNativeVideoTracks=function(){},t.prototype.canPlayType=function(){return""},t.canPlayType=function(){return""},t.canPlaySource=function(e,i){return t.canPlayType(e.type)},t.isTech=function(e){return e.prototype instanceof t||e instanceof t||e===t},t.registerTech=function(e,i){if(t.techs_||(t.techs_={}),!t.isTech(i))throw new Error("Tech "+e+" must be a Tech");if(!t.canPlayType)throw new Error("Techs must have a static canPlayType method on them");if(!t.canPlaySource)throw new Error("Techs must have a static canPlaySource method on them");return e=ze(e),t.techs_[e]=i,"Tech"!==e&&t.defaultTechOrder_.push(e),i},t.getTech=function(e){if(e)return e=ze(e),t.techs_&&t.techs_[e]?t.techs_[e]:n&&n.videojs&&n.videojs[e]?(p.warn("The "+e+" tech was added to the videojs object when it should be registered using videojs.registerTech(name, tech)"),n.videojs[e]):void 0},t}(Ye);Ni.names.forEach(function(e){var t=Ni[e];_r.prototype[t.getterName]=function(){return this[t.privateName]=this[t.privateName]||new t.ListClass,this[t.privateName]}}),_r.prototype.featuresVolumeControl=!0,_r.prototype.featuresMuteControl=!0,_r.prototype.featuresFullscreenResize=!1,_r.prototype.featuresPlaybackRate=!1,_r.prototype.featuresProgressEvents=!1,_r.prototype.featuresSourceset=!1,_r.prototype.featuresTimeupdateEvents=!1,_r.prototype.featuresNativeTextTracks=!1,_r.withSourceHandlers=function(e){e.registerSourceHandler=function(t,i){var r=e.sourceHandlers;r||(r=e.sourceHandlers=[]),void 0===i&&(i=r.length),r.splice(i,0,t)},e.canPlayType=function(t){for(var i=e.sourceHandlers||[],r=void 0,n=0;n0&&void 0!==arguments[0]?arguments[0]:{};var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];var r=arguments[2];var n=arguments[3];var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[];var s=arguments.length>5&&void 0!==arguments[5]&&arguments[5];var o=i[0],u=i.slice(1);if("string"==typeof o)e(t,br[o],r,n,a,s);else if(o){var l=function(e,t){var i=wr[e.id()],r=null;if(void 0===i||null===i)return r=t(e),wr[e.id()]=[[t,r]],r;for(var n=0;n3&&void 0!==arguments[3]?arguments[3]:null,n="call"+ze(i),a=e.reduce(Mr(n),r),s=a===Er,o=s?null:t[i](a);return function(e,t,i,r){for(var n=e.length-1;n>=0;n--){var a=e[n];a[t]&&a[t](r,i)}}(e,i,o,s),o}var Ar={buffered:1,currentTime:1,duration:1,seekable:1,played:1,paused:1},kr={setCurrentTime:1},Rr={play:1,pause:1};function Mr(e){return function(t,i){return t===Er?Er:i[e]?i[e](t):t}}var Or={opus:"video/ogg",ogv:"video/ogg",mp4:"video/mp4",mov:"video/mp4",m4v:"video/mp4",mkv:"video/x-matroska",mp3:"audio/mpeg",aac:"audio/aac",oga:"audio/ogg",m3u8:"application/x-mpegURL"},Cr=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=$t(e);return Or[t.toLowerCase()]||""};function Dr(e){var t=Cr(e.src);return!e.type&&t&&(e.type=t),e}var Ir=function(e){function t(i,r,n){y(this,t);var a=Ke({createEl:!1},r),s=b(this,e.call(this,i,a,n));if(r.playerOptions.sources&&0!==r.playerOptions.sources.length)i.src(r.playerOptions.sources);else for(var o=0,u=r.playerOptions.techOrder;o0&&void 0!==arguments[0]?arguments[0]:"div",i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};i=A({innerHTML:'',className:this.buildCSSClass(),tabIndex:0},i),"button"===t&&p.error("Creating a ClickableComponent with an HTML element of "+t+" is not supported; use a Button instead."),r=A({role:"button"},r),this.tabIndex_=i.tabIndex;var n=e.prototype.createEl.call(this,t,i,r);return this.createControlTextEl(n),n},t.prototype.dispose=function(){this.controlTextEl_=null,e.prototype.dispose.call(this)},t.prototype.createControlTextEl=function(e){return this.controlTextEl_=U("span",{className:"vjs-control-text"},{"aria-live":"polite"}),e&&e.appendChild(this.controlTextEl_),this.controlText(this.controlText_,e),this.controlTextEl_},t.prototype.controlText=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.el();if(void 0===e)return this.controlText_||"Need Text";var i=this.localize(e);this.controlText_=e,N(this.controlTextEl_,i),this.nonIconControl||t.setAttribute("title",i)},t.prototype.buildCSSClass=function(){return"vjs-control vjs-button "+e.prototype.buildCSSClass.call(this)},t.prototype.enable=function(){this.enabled_||(this.enabled_=!0,this.removeClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","false"),void 0!==this.tabIndex_&&this.el_.setAttribute("tabIndex",this.tabIndex_),this.on(["tap","click"],this.handleClick),this.on("focus",this.handleFocus),this.on("blur",this.handleBlur))},t.prototype.disable=function(){this.enabled_=!1,this.addClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","true"),void 0!==this.tabIndex_&&this.el_.removeAttribute("tabIndex"),this.off(["tap","click"],this.handleClick),this.off("focus",this.handleFocus),this.off("blur",this.handleBlur)},t.prototype.handleClick=function(e){},t.prototype.handleFocus=function(e){be(l,"keydown",De(this,this.handleKeyPress))},t.prototype.handleKeyPress=function(t){32===t.which||13===t.which?(t.preventDefault(),this.trigger("click")):e.prototype.handleKeyPress&&e.prototype.handleKeyPress.call(this,t)},t.prototype.handleBlur=function(e){we(l,"keydown",De(this,this.handleKeyPress))},t}(Ye);Ye.registerComponent("ClickableComponent",Lr);var xr=function(e){function t(i,r){y(this,t);var n=b(this,e.call(this,i,r));return n.update(),i.on("posterchange",De(n,n.update)),n}return _(t,e),t.prototype.dispose=function(){this.player().off("posterchange",this.update),e.prototype.dispose.call(this)},t.prototype.createEl=function(){return U("div",{className:"vjs-poster",tabIndex:-1})},t.prototype.update=function(e){var t=this.player().poster();this.setSrc(t),t?this.show():this.hide()},t.prototype.setSrc=function(e){var t="";e&&(t='url("'+e+'")'),this.el_.style.backgroundImage=t},t.prototype.handleClick=function(e){this.player_.controls()&&(this.player_.paused()?Dt(this.player_.play()):this.player_.pause())},t}(Lr);Ye.registerComponent("PosterImage",xr);var Pr={monospace:"monospace",sansSerif:"sans-serif",serif:"serif",monospaceSansSerif:'"Andale Mono", "Lucida Console", monospace',monospaceSerif:'"Courier New", monospace',proportionalSansSerif:"sans-serif",proportionalSerif:"serif",casual:'"Comic Sans MS", Impact, fantasy',script:'"Monotype Corsiva", cursive',smallcaps:'"Andale Mono", "Lucida Console", monospace, sans-serif'};function Ur(e,t){var i=void 0;if(4===e.length)i=e[1]+e[1]+e[2]+e[2]+e[3]+e[3];else{if(7!==e.length)throw new Error("Invalid color code provided, "+e+"; must be formatted as e.g. #f0e or #f604e2.");i=e.slice(1)}return"rgba("+parseInt(i.slice(0,2),16)+","+parseInt(i.slice(2,4),16)+","+parseInt(i.slice(4,6),16)+","+t+")"}function Nr(e,t,i){try{e.style[t]=i}catch(e){return}}var Br=function(e){function t(i,r,a){y(this,t);var s=b(this,e.call(this,i,r,a)),o=De(s,s.updateDisplay);return i.on("loadstart",De(s,s.toggleDisplay)),i.on("texttrackchange",o),i.on("loadstart",De(s,s.preselectTrack)),i.ready(De(s,function(){if(i.tech_&&i.tech_.featuresNativeTextTracks)this.hide();else{i.on("fullscreenchange",o),i.on("playerresize",o),n.addEventListener("orientationchange",o),i.on("dispose",function(){return n.removeEventListener("orientationchange",o)});for(var e=this.options_.playerOptions.tracks||[],t=0;t1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};t=A({innerHTML:'',className:this.buildCSSClass()},t),i=A({type:"button"},i);var r=Ye.prototype.createEl.call(this,"button",t,i);return this.createControlTextEl(r),r},t.prototype.addChild=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=this.constructor.name;return p.warn("Adding an actionable (user controllable) child to a Button ("+i+") is not supported; use a ClickableComponent instead."),Ye.prototype.addChild.call(this,e,t)},t.prototype.enable=function(){e.prototype.enable.call(this),this.el_.removeAttribute("disabled")},t.prototype.disable=function(){e.prototype.disable.call(this),this.el_.setAttribute("disabled","disabled")},t.prototype.handleKeyPress=function(t){32!==t.which&&13!==t.which&&e.prototype.handleKeyPress.call(this,t)},t}(Lr);Ye.registerComponent("Button",jr);var Hr=function(e){function t(i,r){y(this,t);var n=b(this,e.call(this,i,r));return n.mouseused_=!1,n.on("mousedown",n.handleMouseDown),n}return _(t,e),t.prototype.buildCSSClass=function(){return"vjs-big-play-button"},t.prototype.handleClick=function(e){var t=this.player_.play();if(this.mouseused_&&e.clientX&&e.clientY)Dt(t);else{var i=this.player_.getChild("controlBar"),r=i&&i.getChild("playToggle");if(r){var n=function(){return r.focus()};Ct(t)?t.then(n,function(){}):this.setTimeout(n,1)}else this.player_.focus()}},t.prototype.handleKeyPress=function(t){this.mouseused_=!1,e.prototype.handleKeyPress.call(this,t)},t.prototype.handleMouseDown=function(e){this.mouseused_=!0},t}(jr);Hr.prototype.controlText_="Play Video",Ye.registerComponent("BigPlayButton",Hr);var Gr=function(e){function t(i,r){y(this,t);var n=b(this,e.call(this,i,r));return n.controlText(r&&r.controlText||n.localize("Close")),n}return _(t,e),t.prototype.buildCSSClass=function(){return"vjs-close-button "+e.prototype.buildCSSClass.call(this)},t.prototype.handleClick=function(e){this.trigger({type:"close",bubbles:!1})},t}(jr);Ye.registerComponent("CloseButton",Gr);var Vr=function(e){function t(i,r){y(this,t);var n=b(this,e.call(this,i,r));return n.on(i,"play",n.handlePlay),n.on(i,"pause",n.handlePause),n.on(i,"ended",n.handleEnded),n}return _(t,e),t.prototype.buildCSSClass=function(){return"vjs-play-control "+e.prototype.buildCSSClass.call(this)},t.prototype.handleClick=function(e){this.player_.paused()?this.player_.play():this.player_.pause()},t.prototype.handleSeeked=function(e){this.removeClass("vjs-ended"),this.player_.paused()?this.handlePause(e):this.handlePlay(e)},t.prototype.handlePlay=function(e){this.removeClass("vjs-ended"),this.removeClass("vjs-paused"),this.addClass("vjs-playing"),this.controlText("Pause")},t.prototype.handlePause=function(e){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.controlText("Play")},t.prototype.handleEnded=function(e){this.removeClass("vjs-playing"),this.addClass("vjs-ended"),this.controlText("Replay"),this.one(this.player_,"seeked",this.handleSeeked)},t}(jr);Vr.prototype.controlText_="Play",Ye.registerComponent("PlayToggle",Vr);var Wr=function(e,t){e=e<0?0:e;var i=Math.floor(e%60),r=Math.floor(e/60%60),n=Math.floor(e/3600),a=Math.floor(t/60%60),s=Math.floor(t/3600);return(isNaN(e)||e===1/0)&&(n=r=i="-"),(n=n>0||s>0?n+":":"")+(r=((n||a>=10)&&r<10?"0"+r:r)+":")+(i=i<10?"0"+i:i)},qr=Wr;function Xr(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;return qr(e,t)}var zr=function(e){function t(i,r){y(this,t);var n=b(this,e.call(this,i,r));return n.throttledUpdateContent=Ie(De(n,n.updateContent),25),n.on(i,"timeupdate",n.throttledUpdateContent),n}return _(t,e),t.prototype.createEl=function(t){var i=this.buildCSSClass(),r=e.prototype.createEl.call(this,"div",{className:i+" vjs-time-control vjs-control",innerHTML:''+this.localize(this.labelText_)+" "});return this.contentEl_=U("span",{className:i+"-display"},{"aria-live":"off"}),this.updateTextNode_(),r.appendChild(this.contentEl_),r},t.prototype.dispose=function(){this.contentEl_=null,this.textNode_=null,e.prototype.dispose.call(this)},t.prototype.updateTextNode_=function(){if(this.contentEl_){for(;this.contentEl_.firstChild;)this.contentEl_.removeChild(this.contentEl_.firstChild);this.textNode_=l.createTextNode(this.formattedTime_||this.formatTime_(0)),this.contentEl_.appendChild(this.textNode_)}},t.prototype.formatTime_=function(e){return Xr(e)},t.prototype.updateFormattedTime_=function(e){var t=this.formatTime_(e);t!==this.formattedTime_&&(this.formattedTime_=t,this.requestAnimationFrame(this.updateTextNode_))},t.prototype.updateContent=function(e){},t}(Ye);zr.prototype.labelText_="Time",zr.prototype.controlText_="Time",Ye.registerComponent("TimeDisplay",zr);var Kr=function(e){function t(i,r){y(this,t);var n=b(this,e.call(this,i,r));return n.on(i,"ended",n.handleEnded),n}return _(t,e),t.prototype.buildCSSClass=function(){return"vjs-current-time"},t.prototype.updateContent=function(e){var t=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();this.updateFormattedTime_(t)},t.prototype.handleEnded=function(e){this.player_.duration()&&this.updateFormattedTime_(this.player_.duration())},t}(zr);Kr.prototype.labelText_="Current Time",Kr.prototype.controlText_="Current Time",Ye.registerComponent("CurrentTimeDisplay",Kr);var Yr=function(e){function t(i,r){y(this,t);var n=b(this,e.call(this,i,r));return n.on(i,"durationchange",n.updateContent),n.on(i,"loadedmetadata",n.throttledUpdateContent),n}return _(t,e),t.prototype.buildCSSClass=function(){return"vjs-duration"},t.prototype.updateContent=function(e){var t=this.player_.duration();t&&this.duration_!==t&&(this.duration_=t,this.updateFormattedTime_(t))},t}(zr);Yr.prototype.labelText_="Duration",Yr.prototype.controlText_="Duration",Ye.registerComponent("DurationDisplay",Yr);var Qr=function(e){function t(){return y(this,t),b(this,e.apply(this,arguments))}return _(t,e),t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-time-control vjs-time-divider",innerHTML:"
/
"})},t}(Ye);Ye.registerComponent("TimeDivider",Qr);var Jr=function(e){function t(i,r){y(this,t);var n=b(this,e.call(this,i,r));return n.on(i,"durationchange",n.throttledUpdateContent),n.on(i,"ended",n.handleEnded),n}return _(t,e),t.prototype.buildCSSClass=function(){return"vjs-remaining-time"},t.prototype.formatTime_=function(t){return"-"+e.prototype.formatTime_.call(this,t)},t.prototype.updateContent=function(e){this.player_.duration()&&(this.player_.remainingTimeDisplay?this.updateFormattedTime_(this.player_.remainingTimeDisplay()):this.updateFormattedTime_(this.player_.remainingTime()))},t.prototype.handleEnded=function(e){this.player_.duration()&&this.updateFormattedTime_(0)},t}(zr);Jr.prototype.labelText_="Remaining Time",Jr.prototype.controlText_="Remaining Time",Ye.registerComponent("RemainingTimeDisplay",Jr);var Zr=function(e){function t(i,r){y(this,t);var n=b(this,e.call(this,i,r));return n.updateShowing(),n.on(n.player(),"durationchange",n.updateShowing),n}return _(t,e),t.prototype.createEl=function(){var t=e.prototype.createEl.call(this,"div",{className:"vjs-live-control vjs-control"});return this.contentEl_=U("div",{className:"vjs-live-display",innerHTML:''+this.localize("Stream Type")+" "+this.localize("LIVE")},{"aria-live":"off"}),t.appendChild(this.contentEl_),t},t.prototype.dispose=function(){this.contentEl_=null,e.prototype.dispose.call(this)},t.prototype.updateShowing=function(e){this.player().duration()===1/0?this.show():this.hide()},t}(Ye);Ye.registerComponent("LiveDisplay",Zr);var $r=function(e){function t(i,r){y(this,t);var n=b(this,e.call(this,i,r));return n.bar=n.getChild(n.options_.barName),n.vertical(!!n.options_.vertical),n.enable(),n}return _(t,e),t.prototype.enabled=function(){return this.enabled_},t.prototype.enable=function(){this.enabled()||(this.on("mousedown",this.handleMouseDown),this.on("touchstart",this.handleMouseDown),this.on("focus",this.handleFocus),this.on("blur",this.handleBlur),this.on("click",this.handleClick),this.on(this.player_,"controlsvisible",this.update),this.playerEvent&&this.on(this.player_,this.playerEvent,this.update),this.removeClass("disabled"),this.setAttribute("tabindex",0),this.enabled_=!0)},t.prototype.disable=function(){if(this.enabled()){var e=this.bar.el_.ownerDocument;this.off("mousedown",this.handleMouseDown),this.off("touchstart",this.handleMouseDown),this.off("focus",this.handleFocus),this.off("blur",this.handleBlur),this.off("click",this.handleClick),this.off(this.player_,"controlsvisible",this.update),this.off(e,"mousemove",this.handleMouseMove),this.off(e,"mouseup",this.handleMouseUp),this.off(e,"touchmove",this.handleMouseMove),this.off(e,"touchend",this.handleMouseUp),this.removeAttribute("tabindex"),this.addClass("disabled"),this.playerEvent&&this.off(this.player_,this.playerEvent,this.update),this.enabled_=!1}},t.prototype.createEl=function(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return i.className=i.className+" vjs-slider",i=A({tabIndex:0},i),r=A({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100,tabIndex:0},r),e.prototype.createEl.call(this,t,i,r)},t.prototype.handleMouseDown=function(e){var t=this.bar.el_.ownerDocument;"mousedown"===e.type&&e.preventDefault(),"touchstart"!==e.type||dt||e.preventDefault(),K(),this.addClass("vjs-sliding"),this.trigger("slideractive"),this.on(t,"mousemove",this.handleMouseMove),this.on(t,"mouseup",this.handleMouseUp),this.on(t,"touchmove",this.handleMouseMove),this.on(t,"touchend",this.handleMouseUp),this.handleMouseMove(e)},t.prototype.handleMouseMove=function(e){},t.prototype.handleMouseUp=function(){var e=this.bar.el_.ownerDocument;Y(),this.removeClass("vjs-sliding"),this.trigger("sliderinactive"),this.off(e,"mousemove",this.handleMouseMove),this.off(e,"mouseup",this.handleMouseUp),this.off(e,"touchmove",this.handleMouseMove),this.off(e,"touchend",this.handleMouseUp),this.update()},t.prototype.update=function(){if(this.el_){var e=this.getPercent(),t=this.bar;if(t){("number"!=typeof e||e!=e||e<0||e===1/0)&&(e=0);var i=(100*e).toFixed(2)+"%",r=t.el().style;return this.vertical()?r.height=i:r.width=i,e}}},t.prototype.calculateDistance=function(e){var t=Z(this.el_,e);return this.vertical()?t.y:t.x},t.prototype.handleFocus=function(){this.on(this.bar.el_.ownerDocument,"keydown",this.handleKeyPress)},t.prototype.handleKeyPress=function(e){37===e.which||40===e.which?(e.preventDefault(),this.stepBack()):38!==e.which&&39!==e.which||(e.preventDefault(),this.stepForward())},t.prototype.handleBlur=function(){this.off(this.bar.el_.ownerDocument,"keydown",this.handleKeyPress)},t.prototype.handleClick=function(e){e.stopImmediatePropagation(),e.preventDefault()},t.prototype.vertical=function(e){if(void 0===e)return this.vertical_||!1;this.vertical_=!!e,this.vertical_?this.addClass("vjs-slider-vertical"):this.addClass("vjs-slider-horizontal")},t}(Ye);Ye.registerComponent("Slider",$r);var en=function(e){function t(i,r){y(this,t);var n=b(this,e.call(this,i,r));return n.partEls_=[],n.on(i,"progress",n.update),n}return _(t,e),t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-load-progress",innerHTML:''+this.localize("Loaded")+": 0%"})},t.prototype.dispose=function(){this.partEls_=null,e.prototype.dispose.call(this)},t.prototype.update=function(e){var t=this.player_.buffered(),i=this.player_.duration(),r=this.player_.bufferedEnd(),n=this.partEls_,a=function(e,t){var i=e/t||0;return 100*(i>=1?1:i)+"%"};this.el_.style.width=a(r,i);for(var s=0;st.length;d--)this.el_.removeChild(n[d-1]);n.length=t.length},t}(Ye);Ye.registerComponent("LoadProgressBar",en);var tn=function(e){function t(){return y(this,t),b(this,e.apply(this,arguments))}return _(t,e),t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-time-tooltip"})},t.prototype.update=function(e,t,i){var r=Q(this.el_),n=Q(this.player_.el()),a=e.width*t;if(n&&r){var s=e.left-n.left+a,o=e.width-a+(n.right-e.right),u=r.width/2;sr.width&&(u=r.width),this.el_.style.right="-"+u+"px",N(this.el_,i)}},t}(Ye);Ye.registerComponent("TimeTooltip",tn);var rn=function(e){function t(){return y(this,t),b(this,e.apply(this,arguments))}return _(t,e),t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-play-progress vjs-slider-bar",innerHTML:''+this.localize("Progress")+": 0%"})},t.prototype.update=function(e,t){var i=this;this.rafId_&&this.cancelAnimationFrame(this.rafId_),this.rafId_=this.requestAnimationFrame(function(){var r=Xr(i.player_.scrubbing()?i.player_.getCache().currentTime:i.player_.currentTime(),i.player_.duration()),n=i.getChild("timeTooltip");n&&n.update(e,t,r)})},t}(Ye);rn.prototype.options_={children:[]},rt||at||rn.prototype.options_.children.push("timeTooltip"),Ye.registerComponent("PlayProgressBar",rn);var nn=function(e){function t(i,r){y(this,t);var n=b(this,e.call(this,i,r));return n.update=Ie(De(n,n.update),25),n}return _(t,e),t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-mouse-display"})},t.prototype.update=function(e,t){var i=this;this.rafId_&&this.cancelAnimationFrame(this.rafId_),this.rafId_=this.requestAnimationFrame(function(){var r=i.player_.duration(),n=Xr(t*r,r);i.el_.style.left=e.width*t+"px",i.getChild("timeTooltip").update(e,t,n)})},t}(Ye);nn.prototype.options_={children:["timeTooltip"]},Ye.registerComponent("MouseTimeDisplay",nn);var an=function(e){function t(i,r){y(this,t);var n=b(this,e.call(this,i,r));return n.setEventHandlers_(),n}return _(t,e),t.prototype.setEventHandlers_=function(){var e=this;this.update=Ie(De(this,this.update),30),this.on(this.player_,"timeupdate",this.update),this.on(this.player_,"ended",this.handleEnded),this.updateInterval=null,this.on(this.player_,["playing"],function(){e.clearInterval(e.updateInterval),e.updateInterval=e.setInterval(function(){e.requestAnimationFrame(function(){e.update()})},30)}),this.on(this.player_,["ended","pause","waiting"],function(){e.clearInterval(e.updateInterval)}),this.on(this.player_,["timeupdate","ended"],this.update)},t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-progress-holder"},{"aria-label":this.localize("Progress Bar")})},t.prototype.update_=function(e,t){var i=this.player_.duration();this.el_.setAttribute("aria-valuenow",(100*t).toFixed(2)),this.el_.setAttribute("aria-valuetext",this.localize("progress bar timing: currentTime={1} duration={2}",[Xr(e,i),Xr(i,i)],"{1} of {2}")),this.bar.update(Q(this.el_),t)},t.prototype.update=function(t){var i=e.prototype.update.call(this);return this.update_(this.getCurrentTime_(),i),i},t.prototype.getCurrentTime_=function(){return this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime()},t.prototype.handleEnded=function(e){this.update_(this.player_.duration(),1)},t.prototype.getPercent=function(){var e=this.getCurrentTime_()/this.player_.duration();return e>=1?1:e||0},t.prototype.handleMouseDown=function(t){ne(t)&&(t.stopPropagation(),this.player_.scrubbing(!0),this.videoWasPlaying=!this.player_.paused(),this.player_.pause(),e.prototype.handleMouseDown.call(this,t))},t.prototype.handleMouseMove=function(e){if(ne(e)){var t=this.calculateDistance(e)*this.player_.duration();t===this.player_.duration()&&(t-=.1),this.player_.currentTime(t)}},t.prototype.enable=function(){e.prototype.enable.call(this);var t=this.getChild("mouseTimeDisplay");t&&t.show()},t.prototype.disable=function(){e.prototype.disable.call(this);var t=this.getChild("mouseTimeDisplay");t&&t.hide()},t.prototype.handleMouseUp=function(t){e.prototype.handleMouseUp.call(this,t),t&&t.stopPropagation(),this.player_.scrubbing(!1),this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:!0}),this.videoWasPlaying&&Dt(this.player_.play())},t.prototype.stepForward=function(){this.player_.currentTime(this.player_.currentTime()+5)},t.prototype.stepBack=function(){this.player_.currentTime(this.player_.currentTime()-5)},t.prototype.handleAction=function(e){this.player_.paused()?this.player_.play():this.player_.pause()},t.prototype.handleKeyPress=function(t){32===t.which||13===t.which?(t.preventDefault(),this.handleAction(t)):e.prototype.handleKeyPress&&e.prototype.handleKeyPress.call(this,t)},t}($r);an.prototype.options_={children:["loadProgressBar","playProgressBar"],barName:"playProgressBar"},rt||at||an.prototype.options_.children.splice(1,0,"mouseTimeDisplay"),an.prototype.playerEvent="timeupdate",Ye.registerComponent("SeekBar",an);var sn=function(e){function t(i,r){y(this,t);var n=b(this,e.call(this,i,r));return n.handleMouseMove=Ie(De(n,n.handleMouseMove),25),n.throttledHandleMouseSeek=Ie(De(n,n.handleMouseSeek),25),n.enable(),n}return _(t,e),t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-progress-control vjs-control"})},t.prototype.handleMouseMove=function(e){var t=this.getChild("seekBar");if(t){var i=t.getChild("mouseTimeDisplay"),r=t.el(),n=Q(r),a=Z(r,e).x;a>1?a=1:a<0&&(a=0),i&&i.update(n,a)}},t.prototype.handleMouseSeek=function(e){var t=this.getChild("seekBar");t&&t.handleMouseMove(e)},t.prototype.enabled=function(){return this.enabled_},t.prototype.disable=function(){this.children().forEach(function(e){return e.disable&&e.disable()}),this.enabled()&&(this.off(["mousedown","touchstart"],this.handleMouseDown),this.off(this.el_,"mousemove",this.handleMouseMove),this.handleMouseUp(),this.addClass("disabled"),this.enabled_=!1)},t.prototype.enable=function(){this.children().forEach(function(e){return e.enable&&e.enable()}),this.enabled()||(this.on(["mousedown","touchstart"],this.handleMouseDown),this.on(this.el_,"mousemove",this.handleMouseMove),this.removeClass("disabled"),this.enabled_=!0)},t.prototype.handleMouseDown=function(e){var t=this.el_.ownerDocument,i=this.getChild("seekBar");i&&i.handleMouseDown(e),this.on(t,"mousemove",this.throttledHandleMouseSeek),this.on(t,"touchmove",this.throttledHandleMouseSeek),this.on(t,"mouseup",this.handleMouseUp),this.on(t,"touchend",this.handleMouseUp)},t.prototype.handleMouseUp=function(e){var t=this.el_.ownerDocument,i=this.getChild("seekBar");i&&i.handleMouseUp(e),this.off(t,"mousemove",this.throttledHandleMouseSeek),this.off(t,"touchmove",this.throttledHandleMouseSeek),this.off(t,"mouseup",this.handleMouseUp),this.off(t,"touchend",this.handleMouseUp)},t}(Ye);sn.prototype.options_={children:["seekBar"]},Ye.registerComponent("ProgressControl",sn);var on=function(e){function t(i,r){y(this,t);var n=b(this,e.call(this,i,r));return n.on(i,"fullscreenchange",n.handleFullscreenChange),!1===l[wt.fullscreenEnabled]&&n.disable(),n}return _(t,e),t.prototype.buildCSSClass=function(){return"vjs-fullscreen-control "+e.prototype.buildCSSClass.call(this)},t.prototype.handleFullscreenChange=function(e){this.player_.isFullscreen()?this.controlText("Non-Fullscreen"):this.controlText("Fullscreen")},t.prototype.handleClick=function(e){this.player_.isFullscreen()?this.player_.exitFullscreen():this.player_.requestFullscreen()},t}(jr);on.prototype.controlText_="Fullscreen",Ye.registerComponent("FullscreenToggle",on);var un=function(e,t){t.tech_&&!t.tech_.featuresVolumeControl&&e.addClass("vjs-hidden"),e.on(t,"loadstart",function(){t.tech_.featuresVolumeControl?e.removeClass("vjs-hidden"):e.addClass("vjs-hidden")})},ln=function(e){function t(){return y(this,t),b(this,e.apply(this,arguments))}return _(t,e),t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-volume-level",innerHTML:''})},t}(Ye);Ye.registerComponent("VolumeLevel",ln);var dn=function(e){function t(i,r){y(this,t);var n=b(this,e.call(this,i,r));return n.on("slideractive",n.updateLastVolume_),n.on(i,"volumechange",n.updateARIAAttributes),i.ready(function(){return n.updateARIAAttributes()}),n}return _(t,e),t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-volume-bar vjs-slider-bar"},{"aria-label":this.localize("Volume Level"),"aria-live":"polite"})},t.prototype.handleMouseDown=function(t){ne(t)&&e.prototype.handleMouseDown.call(this,t)},t.prototype.handleMouseMove=function(e){ne(e)&&(this.checkMuted(),this.player_.volume(this.calculateDistance(e)))},t.prototype.checkMuted=function(){this.player_.muted()&&this.player_.muted(!1)},t.prototype.getPercent=function(){return this.player_.muted()?0:this.player_.volume()},t.prototype.stepForward=function(){this.checkMuted(),this.player_.volume(this.player_.volume()+.1)},t.prototype.stepBack=function(){this.checkMuted(),this.player_.volume(this.player_.volume()-.1)},t.prototype.updateARIAAttributes=function(e){var t=this.player_.muted()?0:this.volumeAsPercentage_();this.el_.setAttribute("aria-valuenow",t),this.el_.setAttribute("aria-valuetext",t+"%")},t.prototype.volumeAsPercentage_=function(){return Math.round(100*this.player_.volume())},t.prototype.updateLastVolume_=function(){var e=this,t=this.player_.volume();this.one("sliderinactive",function(){0===e.player_.volume()&&e.player_.lastVolume_(t)})},t}($r);dn.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"},dn.prototype.playerEvent="volumechange",Ye.registerComponent("VolumeBar",dn);var cn=function(e){function t(i){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};y(this,t),r.vertical=r.vertical||!1,(void 0===r.volumeBar||R(r.volumeBar))&&(r.volumeBar=r.volumeBar||{},r.volumeBar.vertical=r.vertical);var n=b(this,e.call(this,i,r));return un(n,i),n.throttledHandleMouseMove=Ie(De(n,n.handleMouseMove),25),n.on("mousedown",n.handleMouseDown),n.on("touchstart",n.handleMouseDown),n.on(n.volumeBar,["focus","slideractive"],function(){n.volumeBar.addClass("vjs-slider-active"),n.addClass("vjs-slider-active"),n.trigger("slideractive")}),n.on(n.volumeBar,["blur","sliderinactive"],function(){n.volumeBar.removeClass("vjs-slider-active"),n.removeClass("vjs-slider-active"),n.trigger("sliderinactive")}),n}return _(t,e),t.prototype.createEl=function(){var t="vjs-volume-horizontal";return this.options_.vertical&&(t="vjs-volume-vertical"),e.prototype.createEl.call(this,"div",{className:"vjs-volume-control vjs-control "+t})},t.prototype.handleMouseDown=function(e){var t=this.el_.ownerDocument;this.on(t,"mousemove",this.throttledHandleMouseMove),this.on(t,"touchmove",this.throttledHandleMouseMove),this.on(t,"mouseup",this.handleMouseUp),this.on(t,"touchend",this.handleMouseUp)},t.prototype.handleMouseUp=function(e){var t=this.el_.ownerDocument;this.off(t,"mousemove",this.throttledHandleMouseMove),this.off(t,"touchmove",this.throttledHandleMouseMove),this.off(t,"mouseup",this.handleMouseUp),this.off(t,"touchend",this.handleMouseUp)},t.prototype.handleMouseMove=function(e){this.volumeBar.handleMouseMove(e)},t}(Ye);cn.prototype.options_={children:["volumeBar"]},Ye.registerComponent("VolumeControl",cn);var hn=function(e,t){t.tech_&&!t.tech_.featuresMuteControl&&e.addClass("vjs-hidden"),e.on(t,"loadstart",function(){t.tech_.featuresMuteControl?e.removeClass("vjs-hidden"):e.addClass("vjs-hidden")})},fn=function(e){function t(i,r){y(this,t);var n=b(this,e.call(this,i,r));return hn(n,i),n.on(i,["loadstart","volumechange"],n.update),n}return _(t,e),t.prototype.buildCSSClass=function(){return"vjs-mute-control "+e.prototype.buildCSSClass.call(this)},t.prototype.handleClick=function(e){var t=this.player_.volume(),i=this.player_.lastVolume_();if(0===t){var r=i<.1?.1:i;this.player_.volume(r),this.player_.muted(!1)}else this.player_.muted(!this.player_.muted())},t.prototype.update=function(e){this.updateIcon_(),this.updateControlText_()},t.prototype.updateIcon_=function(){var e=this.player_.volume(),t=3;rt&&this.player_.muted(this.player_.tech_.el_.muted),0===e||this.player_.muted()?t=0:e<.33?t=1:e<.67&&(t=2);for(var i=0;i<4;i++)H(this.el_,"vjs-vol-"+i);j(this.el_,"vjs-vol-"+t)},t.prototype.updateControlText_=function(){var e=this.player_.muted()||0===this.player_.volume()?"Unmute":"Mute";this.controlText()!==e&&this.controlText(e)},t}(jr);fn.prototype.controlText_="Mute",Ye.registerComponent("MuteToggle",fn);var pn=function(e){function t(i){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};y(this,t),void 0!==r.inline?r.inline=r.inline:r.inline=!0,(void 0===r.volumeControl||R(r.volumeControl))&&(r.volumeControl=r.volumeControl||{},r.volumeControl.vertical=!r.inline);var n=b(this,e.call(this,i,r));return n.on(i,["loadstart"],n.volumePanelState_),n.on(n.volumeControl,["slideractive"],n.sliderActive_),n.on(n.volumeControl,["sliderinactive"],n.sliderInactive_),n}return _(t,e),t.prototype.sliderActive_=function(){this.addClass("vjs-slider-active")},t.prototype.sliderInactive_=function(){this.removeClass("vjs-slider-active")},t.prototype.volumePanelState_=function(){this.volumeControl.hasClass("vjs-hidden")&&this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-hidden"),this.volumeControl.hasClass("vjs-hidden")&&!this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-mute-toggle-only")},t.prototype.createEl=function(){var t="vjs-volume-panel-horizontal";return this.options_.inline||(t="vjs-volume-panel-vertical"),e.prototype.createEl.call(this,"div",{className:"vjs-volume-panel vjs-control "+t})},t}(Ye);pn.prototype.options_={children:["muteToggle","volumeControl"]},Ye.registerComponent("VolumePanel",pn);var mn=function(e){function t(i,r){y(this,t);var n=b(this,e.call(this,i,r));return r&&(n.menuButton_=r.menuButton),n.focusedChild_=-1,n.on("keydown",n.handleKeyPress),n}return _(t,e),t.prototype.addItem=function(e){this.addChild(e),e.on("click",De(this,function(t){this.menuButton_&&(this.menuButton_.unpressButton(),"CaptionSettingsMenuItem"!==e.name()&&this.menuButton_.focus())}))},t.prototype.createEl=function(){var t=this.options_.contentElType||"ul";this.contentEl_=U(t,{className:"vjs-menu-content"}),this.contentEl_.setAttribute("role","menu");var i=e.prototype.createEl.call(this,"div",{append:this.contentEl_,className:"vjs-menu"});return i.appendChild(this.contentEl_),be(i,"click",function(e){e.preventDefault(),e.stopImmediatePropagation()}),i},t.prototype.dispose=function(){this.contentEl_=null,e.prototype.dispose.call(this)},t.prototype.handleKeyPress=function(e){37===e.which||40===e.which?(e.preventDefault(),this.stepForward()):38!==e.which&&39!==e.which||(e.preventDefault(),this.stepBack())},t.prototype.stepForward=function(){var e=0;void 0!==this.focusedChild_&&(e=this.focusedChild_+1),this.focus(e)},t.prototype.stepBack=function(){var e=0;void 0!==this.focusedChild_&&(e=this.focusedChild_-1),this.focus(e)},t.prototype.focus=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=this.children().slice();t.length&&t[0].className&&/vjs-menu-title/.test(t[0].className)&&t.shift(),t.length>0&&(e<0?e=0:e>=t.length&&(e=t.length-1),this.focusedChild_=e,t[e].el_.focus())},t}(Ye);Ye.registerComponent("Menu",mn);var gn=function(e){function t(i){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};y(this,t);var n=b(this,e.call(this,i,r));n.menuButton_=new jr(i,r),n.menuButton_.controlText(n.controlText_),n.menuButton_.el_.setAttribute("aria-haspopup","true");var a=jr.prototype.buildCSSClass();return n.menuButton_.el_.className=n.buildCSSClass()+" "+a,n.menuButton_.removeClass("vjs-control"),n.addChild(n.menuButton_),n.update(),n.enabled_=!0,n.on(n.menuButton_,"tap",n.handleClick),n.on(n.menuButton_,"click",n.handleClick),n.on(n.menuButton_,"focus",n.handleFocus),n.on(n.menuButton_,"blur",n.handleBlur),n.on("keydown",n.handleSubmenuKeyPress),n}return _(t,e),t.prototype.update=function(){var e=this.createMenu();this.menu&&(this.menu.dispose(),this.removeChild(this.menu)),this.menu=e,this.addChild(e),this.buttonPressed_=!1,this.menuButton_.el_.setAttribute("aria-expanded","false"),this.items&&this.items.length<=this.hideThreshold_?this.hide():this.show()},t.prototype.createMenu=function(){var e=new mn(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title){var t=U("li",{className:"vjs-menu-title",innerHTML:ze(this.options_.title),tabIndex:-1});this.hideThreshold_+=1,e.children_.unshift(t),B(t,e.contentEl())}if(this.items=this.createItems(),this.items)for(var i=0;i1&&void 0!==arguments[1]?arguments[1]:this.menuButton_.el();return this.menuButton_.controlText(e,t)},t.prototype.handleClick=function(e){this.one(this.menu.contentEl(),"mouseleave",De(this,function(e){this.unpressButton(),this.el_.blur()})),this.buttonPressed_?this.unpressButton():this.pressButton()},t.prototype.focus=function(){this.menuButton_.focus()},t.prototype.blur=function(){this.menuButton_.blur()},t.prototype.handleFocus=function(){be(l,"keydown",De(this,this.handleKeyPress))},t.prototype.handleBlur=function(){we(l,"keydown",De(this,this.handleKeyPress))},t.prototype.handleKeyPress=function(e){27===e.which||9===e.which?(this.buttonPressed_&&this.unpressButton(),9!==e.which&&(e.preventDefault(),this.menuButton_.el_.focus())):38!==e.which&&40!==e.which||this.buttonPressed_||(this.pressButton(),e.preventDefault())},t.prototype.handleSubmenuKeyPress=function(e){27!==e.which&&9!==e.which||(this.buttonPressed_&&this.unpressButton(),9!==e.which&&(e.preventDefault(),this.menuButton_.el_.focus()))},t.prototype.pressButton=function(){if(this.enabled_){if(this.buttonPressed_=!0,this.menu.lockShowing(),this.menuButton_.el_.setAttribute("aria-expanded","true"),rt&&x())return;this.menu.focus()}},t.prototype.unpressButton=function(){this.enabled_&&(this.buttonPressed_=!1,this.menu.unlockShowing(),this.menuButton_.el_.setAttribute("aria-expanded","false"))},t.prototype.disable=function(){this.unpressButton(),this.enabled_=!1,this.addClass("vjs-disabled"),this.menuButton_.disable()},t.prototype.enable=function(){this.enabled_=!0,this.removeClass("vjs-disabled"),this.menuButton_.enable()},t}(Ye);Ye.registerComponent("MenuButton",gn);var vn=function(e){function t(i,r){y(this,t);var n=r.tracks,a=b(this,e.call(this,i,r));if(a.items.length<=1&&a.hide(),!n)return b(a);var s=De(a,a.update);return n.addEventListener("removetrack",s),n.addEventListener("addtrack",s),a.player_.on("ready",s),a.player_.on("dispose",function(){n.removeEventListener("removetrack",s),n.removeEventListener("addtrack",s)}),a}return _(t,e),t}(gn);Ye.registerComponent("TrackButton",vn);var yn=function(e){function t(i,r){y(this,t);var n=b(this,e.call(this,i,r));return n.selectable=r.selectable,n.isSelected_=r.selected||!1,n.multiSelectable=r.multiSelectable,n.selected(n.isSelected_),n.selectable?n.multiSelectable?n.el_.setAttribute("role","menuitemcheckbox"):n.el_.setAttribute("role","menuitemradio"):n.el_.setAttribute("role","menuitem"),n}return _(t,e),t.prototype.createEl=function(t,i,r){return this.nonIconControl=!0,e.prototype.createEl.call(this,"li",A({className:"vjs-menu-item",innerHTML:''+this.localize(this.options_.label)+"",tabIndex:-1},i),r)},t.prototype.handleClick=function(e){this.selected(!0)},t.prototype.selected=function(e){this.selectable&&(e?(this.addClass("vjs-selected"),this.el_.setAttribute("aria-checked","true"),this.controlText(", selected"),this.isSelected_=!0):(this.removeClass("vjs-selected"),this.el_.setAttribute("aria-checked","false"),this.controlText(""),this.isSelected_=!1))},t}(Lr);Ye.registerComponent("MenuItem",yn);var _n=function(e){function t(i,r){y(this,t);var a=r.track,s=i.textTracks();r.label=a.label||a.language||"Unknown",r.selected="showing"===a.mode;var o=b(this,e.call(this,i,r));o.track=a;var u=function(){for(var e=arguments.length,t=Array(e),i=0;i-1?"showing"!==s.mode&&(s.mode="showing"):"disabled"!==s.mode&&(s.mode="disabled")}},t.prototype.handleTracksChange=function(e){var t="showing"===this.track.mode;t!==this.isSelected_&&this.selected(t)},t.prototype.handleSelectedLanguageChange=function(e){if("showing"===this.track.mode){var t=this.player_.cache_.selectedLanguage;if(t&&t.enabled&&t.language===this.track.language&&t.kind!==this.track.kind)return;this.player_.cache_.selectedLanguage={enabled:!0,language:this.track.language,kind:this.track.kind}}},t.prototype.dispose=function(){this.track=null,e.prototype.dispose.call(this)},t}(yn);Ye.registerComponent("TextTrackMenuItem",_n);var bn=function(e){function t(i,r){return y(this,t),r.track={player:i,kind:r.kind,kinds:r.kinds,default:!1,mode:"disabled"},r.kinds||(r.kinds=[r.kind]),r.label?r.track.label=r.label:r.track.label=r.kinds.join(" and ")+" off",r.selectable=!0,r.multiSelectable=!1,b(this,e.call(this,i,r))}return _(t,e),t.prototype.handleTracksChange=function(e){for(var t=this.player().textTracks(),i=!0,r=0,n=t.length;r-1&&"showing"===a.mode){i=!1;break}}i!==this.isSelected_&&this.selected(i)},t.prototype.handleSelectedLanguageChange=function(e){for(var t=this.player().textTracks(),i=!0,r=0,n=t.length;r-1&&"showing"===a.mode){i=!1;break}}i&&(this.player_.cache_.selectedLanguage={enabled:!1})},t}(_n);Ye.registerComponent("OffTextTrackMenuItem",bn);var wn=function(e){function t(i){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return y(this,t),r.tracks=i.textTracks(),b(this,e.call(this,i,r))}return _(t,e),t.prototype.createItems=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:_n,i=void 0;this.label_&&(i=this.label_+" off"),e.push(new bn(this.player_,{kinds:this.kinds_,kind:this.kind_,label:i})),this.hideThreshold_+=1;var r=this.player_.textTracks();Array.isArray(this.kinds_)||(this.kinds_=[this.kind_]);for(var n=0;n-1){var s=new t(this.player_,{track:a,selectable:!0,multiSelectable:!1});s.addClass("vjs-"+a.kind+"-menu-item"),e.push(s)}}return e},t}(vn);Ye.registerComponent("TextTrackButton",wn);var En=function(e){function t(i,r){y(this,t);var n=r.track,a=r.cue,s=i.currentTime();r.selectable=!0,r.multiSelectable=!1,r.label=a.text,r.selected=a.startTime<=s&&s=0;t--){var i=e[t];if(i.kind===this.kind_)return i}},t.prototype.getMenuCaption=function(){return this.track_&&this.track_.label?this.track_.label:this.localize(ze(this.kind_))},t.prototype.createMenu=function(){return this.options_.title=this.getMenuCaption(),e.prototype.createMenu.call(this)},t.prototype.createItems=function(){var e=[];if(!this.track_)return e;var t=this.track_.cues;if(!t)return e;for(var i=0,r=t.length;i