A self hosted livestreaming server.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
 
 
 
 
 
 
satyr/site/videojs/alt/video.core.novtt.min.js

12 lines
187 KiB

/**
* @license
* Video.js 7.5.5 <http://videojs.com/>
* Copyright Brightcove, Inc. <https://www.brightcove.com/>
* Available under Apache License Version 2.0
* <https://github.com/videojs/video.js/blob/master/LICENSE>
*
* Includes vtt.js <https://github.com/mozilla/vtt.js>
* Available under Apache License Version 2.0
* <https://github.com/mozilla/vtt.js/blob/master/LICENSE>
*/
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("global/window"),require("global/document")):"function"==typeof define&&define.amd?define(["global/window","global/document"],t):(e=e||self).videojs=t(e.window,e.document)}(this,function(h,d){h=h&&h.hasOwnProperty("default")?h.default:h,d=d&&d.hasOwnProperty("default")?d.default:d;var p="7.5.5";function f(e,t){e.prototype=Object.create(t.prototype),(e.prototype.constructor=e).__proto__=t}function s(e,t){return(s=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function o(e,t,n){return(o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(e){return!1}}()?Reflect.construct:function(e,t,n){var i=[null];i.push.apply(i,t);var r=new(Function.bind.apply(e,i));return n&&s(r,n.prototype),r}).apply(null,arguments)}function v(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function t(e,t){return t||(t=e.slice(0)),e.raw=t,e}var l=[],e=function(o,a){return function(e,t,n){var i=a.levels[t],r=new RegExp("^("+i+")$");if("log"!==e&&n.unshift(e.toUpperCase()+":"),n.unshift(o+":"),l&&l.push([].concat(n)),h.console){var s=h.console[e];s||"debug"!==e||(s=h.console.info||h.console.log),s&&i&&r.test(e)&&s[Array.isArray(n)?"apply":"call"](h.console,n)}}};var g=function t(n){var i,r="info",s=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];i("log",r,t)};return i=e(n,s),s.createLogger=function(e){return t(n+": "+e)},s.levels={all:"debug|log|warn|error",off:"",debug:"debug|log|warn|error",info:"log|warn|error",warn:"warn|error",error:"error",DEFAULT:r},s.level=function(e){if("string"==typeof e){if(!s.levels.hasOwnProperty(e))throw new Error('"'+e+'" in not a valid log level');r=e}return r},(s.history=function(){return l?[].concat(l):[]}).filter=function(t){return(l||[]).filter(function(e){return new RegExp(".*"+t+".*").test(e[0])})},s.history.clear=function(){l&&(l.length=0)},s.history.disable=function(){null!==l&&(l.length=0,l=null)},s.history.enable=function(){null===l&&(l=[])},s.error=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return i("error",r,t)},s.warn=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return i("warn",r,t)},s.debug=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return i("debug",r,t)},s}("VIDEOJS"),y=g.createLogger;var _=function(e){for(var t="",n=0;n<arguments.length;n++)t+=e[n].replace(/\n\r?\s*/g,"")+(arguments[n+1]||"");return t},n=Object.prototype.toString,r=function(e){return b(e)?Object.keys(e):[]};function a(t,n){r(t).forEach(function(e){return n(t[e],e)})}function m(n){for(var e=arguments.length,t=new Array(1<e?e-1:0),i=1;i<e;i++)t[i-1]=arguments[i];return Object.assign?Object.assign.apply(Object,[n].concat(t)):(t.forEach(function(e){e&&a(e,function(e,t){n[t]=e})}),n)}function b(e){return!!e&&"object"==typeof e}function c(e){return b(e)&&"[object Object]"===n.call(e)&&e.constructor===Object}function i(e,t){if(!e||!t)return"";if("function"!=typeof h.getComputedStyle)return"";var n=h.getComputedStyle(e);return n?n[t]:""}function u(){var e=t(["Setting attributes in the second argument of createEl()\n has been deprecated. Use the third argument instead.\n createEl(type, properties, attributes). Attempting to set "," to ","."]);return u=function(){return e},e}function T(e){return"string"==typeof e&&/\S/.test(e)}function k(e){if(/\s/.test(e))throw new Error("class has illegal whitespace characters")}function C(){return d===h.document}function E(e){return b(e)&&1===e.nodeType}function S(){try{return h.parent!==h.self}catch(e){return!0}}function w(i){return function(e,t){if(!T(e))return d[i](null);T(t)&&(t=d.querySelector(t));var n=E(t)?t:d;return n[i]&&n[i](e)}}function x(e,n,t,i){void 0===e&&(e="div"),void 0===n&&(n={}),void 0===t&&(t={});var r=d.createElement(e);return Object.getOwnPropertyNames(n).forEach(function(e){var t=n[e];-1!==e.indexOf("aria-")||"role"===e||"type"===e?(g.warn(_(u(),e,t)),r.setAttribute(e,t)):"textContent"===e?j(r,t):r[e]=t}),Object.getOwnPropertyNames(t).forEach(function(e){r.setAttribute(e,t[e])}),i&&X(r,i),r}function j(e,t){return"undefined"==typeof e.textContent?e.innerText=t:e.textContent=t,e}function P(e,t){t.firstChild?t.insertBefore(e,t.firstChild):t.appendChild(e)}function A(e,t){return k(t),e.classList?e.classList.contains(t):(n=t,new RegExp("(^|\\s)"+n+"($|\\s)")).test(e.className);var n}function M(e,t){return e.classList?e.classList.add(t):A(e,t)||(e.className=(e.className+" "+t).trim()),e}function D(e,t){return e.classList?e.classList.remove(t):(k(t),e.className=e.className.split(/\s+/).filter(function(e){return e!==t}).join(" ")),e}function L(e,t,n){var i=A(e,t);if("function"==typeof n&&(n=n(e,t)),"boolean"!=typeof n&&(n=!i),n!==i)return n?M(e,t):D(e,t),e}function N(n,i){Object.getOwnPropertyNames(i).forEach(function(e){var t=i[e];null===t||"undefined"==typeof t||!1===t?n.removeAttribute(e):n.setAttribute(e,!0===t?"":t)})}function O(e){var t={},n=",autoplay,controls,playsinline,loop,muted,default,defaultMuted,";if(e&&e.attributes&&0<e.attributes.length)for(var i=e.attributes,r=i.length-1;0<=r;r--){var s=i[r].name,o=i[r].value;"boolean"!=typeof e[s]&&-1===n.indexOf(","+s+",")||(o=null!==o),t[s]=o}return t}function I(e,t){return e.getAttribute(t)}function R(e,t,n){e.setAttribute(t,n)}function F(e,t){e.removeAttribute(t)}function B(){d.body.focus(),d.onselectstart=function(){return!1}}function H(){d.onselectstart=function(){return!0}}function V(e){if(e&&e.getBoundingClientRect&&e.parentNode){var t=e.getBoundingClientRect(),n={};return["bottom","height","left","right","top","width"].forEach(function(e){void 0!==t[e]&&(n[e]=t[e])}),n.height||(n.height=parseFloat(i(e,"height"))),n.width||(n.width=parseFloat(i(e,"width"))),n}}function z(e){var t;if(e.getBoundingClientRect&&e.parentNode&&(t=e.getBoundingClientRect()),!t)return{left:0,top:0};var n=d.documentElement,i=d.body,r=n.clientLeft||i.clientLeft||0,s=h.pageXOffset||i.scrollLeft,o=t.left+s-r,a=n.clientTop||i.clientTop||0,l=h.pageYOffset||i.scrollTop,c=t.top+l-a;return{left:Math.round(o),top:Math.round(c)}}function W(e,t){var n={},i=z(e),r=e.offsetWidth,s=e.offsetHeight,o=i.top,a=i.left,l=t.pageY,c=t.pageX;return t.changedTouches&&(c=t.changedTouches[0].pageX,l=t.changedTouches[0].pageY),n.y=Math.max(0,Math.min(1,(o-l+s)/s)),n.x=Math.max(0,Math.min(1,(c-a)/r)),n}function K(e){return b(e)&&3===e.nodeType}function U(e){for(;e.firstChild;)e.removeChild(e.firstChild);return e}function q(e){return"function"==typeof e&&(e=e()),(Array.isArray(e)?e:[e]).map(function(e){return"function"==typeof e&&(e=e()),E(e)||K(e)?e:"string"==typeof e&&/\S/.test(e)?d.createTextNode(e):void 0}).filter(function(e){return e})}function X(t,e){return q(e).forEach(function(e){return t.appendChild(e)}),t}function $(e,t){return X(U(e),t)}function G(e){return void 0===e.button&&void 0===e.buttons||(0===e.button&&void 0===e.buttons||0===e.button&&1===e.buttons)}var Y=w("querySelector"),Q=w("querySelectorAll"),J=Object.freeze({isReal:C,isEl:E,isInFrame:S,createEl:x,textContent:j,prependTo:P,hasClass:A,addClass:M,removeClass:D,toggleClass:L,setAttributes:N,getAttributes:O,getAttribute:I,setAttribute:R,removeAttribute:F,blockTextSelection:B,unblockTextSelection:H,getBoundingClientRect:V,findPosition:z,getPointerPosition:W,isTextNode:K,emptyEl:U,normalizeContent:q,appendContent:X,insertContent:$,isSingleLeftClick:G,$:Y,$$:Q}),Z=1;function ee(){return Z++}var te={},ne="vdata"+(new Date).getTime();function ie(e){var t=e[ne];return t||(t=e[ne]=ee()),te[t]||(te[t]={}),te[t]}function re(e){var t=e[ne];return!!t&&!!Object.getOwnPropertyNames(te[t]).length}function se(t){var e=t[ne];if(e){delete te[e];try{delete t[ne]}catch(e){t.removeAttribute?t.removeAttribute(ne):t[ne]=null}}}function oe(e,t){var n=ie(e);0===n.handlers[t].length&&(delete n.handlers[t],e.removeEventListener?e.removeEventListener(t,n.dispatcher,!1):e.detachEvent&&e.detachEvent("on"+t,n.dispatcher)),Object.getOwnPropertyNames(n.handlers).length<=0&&(delete n.handlers,delete n.dispatcher,delete n.disabled),0===Object.getOwnPropertyNames(n).length&&se(e)}function ae(t,n,e,i){e.forEach(function(e){t(n,e,i)})}function le(e){function t(){return!0}function n(){return!1}if(!e||!e.isPropagationStopped){var i=e||h.event;for(var r in e={},i)"layerX"!==r&&"layerY"!==r&&"keyLocation"!==r&&"webkitMovementX"!==r&&"webkitMovementY"!==r&&("returnValue"===r&&i.preventDefault||(e[r]=i[r]));if(e.target||(e.target=e.srcElement||d),e.relatedTarget||(e.relatedTarget=e.fromElement===e.target?e.toElement:e.fromElement),e.preventDefault=function(){i.preventDefault&&i.preventDefault(),e.returnValue=!1,i.returnValue=!1,e.defaultPrevented=!0},e.defaultPrevented=!1,e.stopPropagation=function(){i.stopPropagation&&i.stopPropagation(),e.cancelBubble=!0,i.cancelBubble=!0,e.isPropagationStopped=t},e.isPropagationStopped=n,e.stopImmediatePropagation=function(){i.stopImmediatePropagation&&i.stopImmediatePropagation(),e.isImmediatePropagationStopped=t,e.stopPropagation()},e.isImmediatePropagationStopped=n,null!==e.clientX&&void 0!==e.clientX){var s=d.documentElement,o=d.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 ce=!1;!function(){try{var e=Object.defineProperty({},"passive",{get:function(){ce=!0}});h.addEventListener("test",null,e),h.removeEventListener("test",null,e)}catch(e){}}();var ue=["touchstart","touchmove"];function he(o,e,t){if(Array.isArray(e))return ae(he,o,e,t);var a=ie(o);if(a.handlers||(a.handlers={}),a.handlers[e]||(a.handlers[e]=[]),t.guid||(t.guid=ee()),a.handlers[e].push(t),a.dispatcher||(a.disabled=!1,a.dispatcher=function(e,t){if(!a.disabled){e=le(e);var n=a.handlers[e.type];if(n)for(var i=n.slice(0),r=0,s=i.length;r<s&&!e.isImmediatePropagationStopped();r++)try{i[r].call(o,e,t)}catch(e){g.error(e)}}}),1===a.handlers[e].length)if(o.addEventListener){var n=!1;ce&&-1<ue.indexOf(e)&&(n={passive:!0}),o.addEventListener(e,a.dispatcher,n)}else o.attachEvent&&o.attachEvent("on"+e,a.dispatcher)}function de(e,t,n){if(re(e)){var i=ie(e);if(i.handlers){if(Array.isArray(t))return ae(de,e,t,n);var r=function(e,t){i.handlers[t]=[],oe(e,t)};if(void 0!==t){var s=i.handlers[t];if(s)if(n){if(n.guid)for(var o=0;o<s.length;o++)s[o].guid===n.guid&&s.splice(o--,1);oe(e,t)}else r(e,t)}else for(var a in i.handlers)Object.prototype.hasOwnProperty.call(i.handlers||{},a)&&r(e,a)}}}function pe(e,t,n){var i=re(e)?ie(e):{},r=e.parentNode||e.ownerDocument;if("string"==typeof t?t={type:t,target:e}:t.target||(t.target=e),t=le(t),i.dispatcher&&i.dispatcher.call(e,t,n),r&&!t.isPropagationStopped()&&!0===t.bubbles)pe.call(null,r,t,n);else if(!r&&!t.defaultPrevented&&t.target&&t.target[t.type]){var s=ie(t.target);t.target[t.type]&&(s.disabled=!0,"function"==typeof t.target[t.type]&&t.target[t.type](),s.disabled=!1)}return!t.defaultPrevented}function fe(t,n,i){if(Array.isArray(n))return ae(fe,t,n,i);var e=function e(){de(t,n,e),i.apply(this,arguments)};e.guid=i.guid=i.guid||ee(),he(t,n,e)}var ve,ge=Object.freeze({fixEvent:le,on:he,off:de,trigger:pe,one:fe}),ye=!1,_e=function(){if(C()&&!1!==ve.options.autoSetup){var e=Array.prototype.slice.call(d.getElementsByTagName("video")),t=Array.prototype.slice.call(d.getElementsByTagName("audio")),n=Array.prototype.slice.call(d.getElementsByTagName("video-js")),i=e.concat(t,n);if(i&&0<i.length)for(var r=0,s=i.length;r<s;r++){var o=i[r];if(!o||!o.getAttribute){me(1);break}void 0===o.player&&null!==o.getAttribute("data-setup")&&ve(o)}else ye||me(1)}};function me(e,t){t&&(ve=t),h.setTimeout(_e,e)}C()&&"complete"===d.readyState?ye=!0:fe(h,"load",function(){ye=!0});var be,Te=function(e){var t=d.createElement("style");return t.className=e,t},ke=function(e,t){e.styleSheet?e.styleSheet.cssText=t:e.textContent=t},Ce=function(e,t,n){t.guid||(t.guid=ee());var i=function(){return t.apply(e,arguments)};return i.guid=n?n+"_"+t.guid:t.guid,i},Ee=function(t,n){var i=Date.now();return function(){var e=Date.now();n<=e-i&&(t.apply(void 0,arguments),i=e)}},Se=function(){};Se.prototype.allowedEvents_={},Se.prototype.addEventListener=Se.prototype.on=function(e,t){var n=this.addEventListener;this.addEventListener=function(){},he(this,e,t),this.addEventListener=n},Se.prototype.removeEventListener=Se.prototype.off=function(e,t){de(this,e,t)},Se.prototype.one=function(e,t){var n=this.addEventListener;this.addEventListener=function(){},fe(this,e,t),this.addEventListener=n},Se.prototype.dispatchEvent=Se.prototype.trigger=function(e){var t=e.type||e;"string"==typeof e&&(e={type:t}),e=le(e),this.allowedEvents_[t]&&this["on"+t]&&this["on"+t](e),pe(this,e)},Se.prototype.queueTrigger=function(e){var t=this;be||(be=new Map);var n=e.type||e,i=be.get(this);i||(i=new Map,be.set(this,i));var r=i.get(n);i.delete(n),h.clearTimeout(r);var s=h.setTimeout(function(){0===i.size&&(i=null,be.delete(t)),t.trigger(e)},0);i.set(n,s)};var we=function(t){return t instanceof Se||!!t.eventBusEl_&&["on","one","off","trigger"].every(function(e){return"function"==typeof t[e]})},xe=function(e){return"string"==typeof e&&/\S/.test(e)||Array.isArray(e)&&!!e.length},je=function(e){if(!e.nodeName&&!we(e))throw new Error("Invalid target; must be a DOM node or evented object.")},Pe=function(e){if(!xe(e))throw new Error("Invalid event type; must be a non-empty string or array.")},Ae=function(e){if("function"!=typeof e)throw new Error("Invalid listener; must be a function.")},Me=function(e,t){var n,i,r,s=t.length<3||t[0]===e||t[0]===e.eventBusEl_;return r=s?(n=e.eventBusEl_,3<=t.length&&t.shift(),i=t[0],t[1]):(n=t[0],i=t[1],t[2]),je(n),Pe(i),Ae(r),{isTargetingSelf:s,target:n,type:i,listener:r=Ce(e,r)}},De=function(e,t,n,i){je(e),e.nodeName?ge[t](e,n,i):e[t](n,i)},Le={on:function(){for(var e=this,t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];var r=Me(this,n),s=r.isTargetingSelf,o=r.target,a=r.type,l=r.listener;if(De(o,"on",a,l),!s){var c=function(){return e.off(o,a,l)};c.guid=l.guid;var u=function(){return e.off("dispose",c)};u.guid=l.guid,De(this,"on","dispose",c),De(o,"on","dispose",u)}},one:function(){for(var r=this,e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var i=Me(this,t),s=i.isTargetingSelf,o=i.target,a=i.type,l=i.listener;if(s)De(o,"one",a,l);else{var c=function e(){r.off(o,a,e);for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];l.apply(null,n)};c.guid=l.guid,De(o,"one",a,c)}},off:function(e,t,n){if(!e||xe(e))de(this.eventBusEl_,e,t);else{var i=e,r=t;je(i),Pe(r),Ae(n),n=Ce(this,n),this.off("dispose",n),i.nodeName?(de(i,r,n),de(i,"dispose",n)):we(i)&&(i.off(r,n),i.off("dispose",n))}},trigger:function(e,t){return pe(this.eventBusEl_,e,t)}};function Ne(e,t){void 0===t&&(t={});var n=t.eventBusKey;if(n){if(!e[n].nodeName)throw new Error('The eventBusKey "'+n+'" does not refer to an element.');e.eventBusEl_=e[n]}else e.eventBusEl_=x("span",{className:"vjs-event-bus"});return m(e,Le),e.eventedCallbacks&&e.eventedCallbacks.forEach(function(e){e()}),e.on("dispose",function(){e.off(),h.setTimeout(function(){e.eventBusEl_=null},0)}),e}var Oe={state:{},setState:function(e){var n,i=this;return"function"==typeof e&&(e=e()),a(e,function(e,t){i.state[t]!==e&&((n=n||{})[t]={from:i.state[t],to:e}),i.state[t]=e}),n&&we(this)&&this.trigger({changes:n,type:"statechanged"}),n}};function Ie(e,t){return m(e,Oe),e.state=m({},e.state,t),"function"==typeof e.handleStateChanged&&we(e)&&e.on("statechanged",e.handleStateChanged),e}function Re(e){return"string"!=typeof e?e:e.charAt(0).toUpperCase()+e.slice(1)}function Fe(){for(var n={},e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return t.forEach(function(e){e&&a(e,function(e,t){c(e)?(c(n[t])||(n[t]={}),n[t]=Fe(n[t],e)):n[t]=e})}),n}var Be=function(){function c(e,t,n){if(!e&&this.play?this.player_=e=this:this.player_=e,this.parentComponent_=null,this.options_=Fe({},this.options_),t=this.options_=Fe(this.options_,t),this.id_=t.id||t.el&&t.el.id,!this.id_){var i=e&&e.id&&e.id()||"no_player";this.id_=i+"_component_"+ee()}this.name_=t.name||null,t.el?this.el_=t.el:!1!==t.createEl&&(this.el_=this.createEl()),!1!==t.evented&&Ne(this,{eventBusKey:this.el_?"el_":null}),Ie(this,this.constructor.defaultState),this.children_=[],this.childIndex_={},!(this.childNameIndex_={})!==t.initChildren&&this.initChildren(),this.ready(n),!1!==t.reportTouchActivity&&this.enableTouchActivity()}var e=c.prototype;return e.dispose=function(){if(this.trigger({type:"dispose",bubbles:!1}),this.children_)for(var e=this.children_.length-1;0<=e;e--)this.children_[e].dispose&&this.children_[e].dispose();this.children_=null,this.childIndex_=null,this.childNameIndex_=null,this.parentComponent_=null,this.el_&&(this.el_.parentNode&&this.el_.parentNode.removeChild(this.el_),se(this.el_),this.el_=null),this.player_=null},e.player=function(){return this.player_},e.options=function(e){return g.warn("this.options() has been deprecated and will be moved to the constructor in 6.0"),e&&(this.options_=Fe(this.options_,e)),this.options_},e.el=function(){return this.el_},e.createEl=function(e,t,n){return x(e,t,n)},e.localize=function(e,r,t){void 0===t&&(t=e);var n=this.player_.language&&this.player_.language(),i=this.player_.languages&&this.player_.languages(),s=i&&i[n],o=n&&n.split("-")[0],a=i&&i[o],l=t;return s&&s[e]?l=s[e]:a&&a[e]&&(l=a[e]),r&&(l=l.replace(/\{(\d+)\}/g,function(e,t){var n=r[t-1],i=n;return"undefined"==typeof n&&(i=e),i})),l},e.contentEl=function(){return this.contentEl_||this.el_},e.id=function(){return this.id_},e.name=function(){return this.name_},e.children=function(){return this.children_},e.getChildById=function(e){return this.childIndex_[e]},e.getChild=function(e){if(e)return e=Re(e),this.childNameIndex_[e]},e.addChild=function(e,t,n){var i,r;if(void 0===t&&(t={}),void 0===n&&(n=this.children_.length),"string"==typeof e){r=Re(e);var s=t.componentClass||r;t.name=r;var o=c.getComponent(s);if(!o)throw new Error("Component "+s+" does not exist");if("function"!=typeof o)return null;i=new o(this.player_||this,t)}else i=e;if(i.parentComponent_&&i.parentComponent_.removeChild(i),this.children_.splice(n,0,i),i.parentComponent_=this,"function"==typeof i.id&&(this.childIndex_[i.id()]=i),(r=r||i.name&&Re(i.name()))&&(this.childNameIndex_[r]=i),"function"==typeof i.el&&i.el()){var a=this.contentEl().children[n]||null;this.contentEl().insertBefore(i.el(),a)}return i},e.removeChild=function(e){if("string"==typeof e&&(e=this.getChild(e)),e&&this.children_){for(var t=!1,n=this.children_.length-1;0<=n;n--)if(this.children_[n]===e){t=!0,this.children_.splice(n,1);break}if(t){e.parentComponent_=null,this.childIndex_[e.id()]=null,this.childNameIndex_[e.name()]=null;var i=e.el();i&&i.parentNode===this.contentEl()&&this.contentEl().removeChild(e.el())}}},e.initChildren=function(){var r=this,i=this.options_.children;if(i){var e,s=this.options_,n=c.getComponent("Tech");(e=Array.isArray(i)?i:Object.keys(i)).concat(Object.keys(this.options_).filter(function(t){return!e.some(function(e){return"string"==typeof e?t===e:t===e.name})})).map(function(e){var t,n;return n="string"==typeof e?i[t=e]||r.options_[t]||{}:(t=e.name,e),{name:t,opts:n}}).filter(function(e){var t=c.getComponent(e.opts.componentClass||Re(e.name));return t&&!n.isTech(t)}).forEach(function(e){var t=e.name,n=e.opts;if(void 0!==s[t]&&(n=s[t]),!1!==n){!0===n&&(n={}),n.playerOptions=r.options_.playerOptions;var i=r.addChild(t,n);i&&(r[t]=i)}})}},e.buildCSSClass=function(){return""},e.ready=function(e,t){if(void 0===t&&(t=!1),e)return this.isReady_?void(t?e.call(this):this.setTimeout(e,1)):(this.readyQueue_=this.readyQueue_||[],void this.readyQueue_.push(e))},e.triggerReady=function(){this.isReady_=!0,this.setTimeout(function(){var e=this.readyQueue_;this.readyQueue_=[],e&&0<e.length&&e.forEach(function(e){e.call(this)},this),this.trigger("ready")},1)},e.$=function(e,t){return Y(e,t||this.contentEl())},e.$$=function(e,t){return Q(e,t||this.contentEl())},e.hasClass=function(e){return A(this.el_,e)},e.addClass=function(e){M(this.el_,e)},e.removeClass=function(e){D(this.el_,e)},e.toggleClass=function(e,t){L(this.el_,e,t)},e.show=function(){this.removeClass("vjs-hidden")},e.hide=function(){this.addClass("vjs-hidden")},e.lockShowing=function(){this.addClass("vjs-lock-showing")},e.unlockShowing=function(){this.removeClass("vjs-lock-showing")},e.getAttribute=function(e){return I(this.el_,e)},e.setAttribute=function(e,t){R(this.el_,e,t)},e.removeAttribute=function(e){F(this.el_,e)},e.width=function(e,t){return this.dimension("width",e,t)},e.height=function(e,t){return this.dimension("height",e,t)},e.dimensions=function(e,t){this.width(e,!0),this.height(t)},e.dimension=function(e,t,n){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(n||this.trigger("componentresize"));if(!this.el_)return 0;var i=this.el_.style[e],r=i.indexOf("px");return-1!==r?parseInt(i.slice(0,r),10):parseInt(this.el_["offset"+Re(e)],10)},e.currentDimension=function(e){var t=0;if("width"!==e&&"height"!==e)throw new Error("currentDimension only accepts width or height value");if("function"==typeof h.getComputedStyle){var n=h.getComputedStyle(this.el_);t=n.getPropertyValue(e)||n[e]}if(0===(t=parseFloat(t))){var i="offset"+Re(e);t=this.el_[i]}return t},e.currentDimensions=function(){return{width:this.currentDimension("width"),height:this.currentDimension("height")}},e.currentWidth=function(){return this.currentDimension("width")},e.currentHeight=function(){return this.currentDimension("height")},e.focus=function(){this.el_.focus()},e.blur=function(){this.el_.blur()},e.handleKeyDown=function(e){this.player_&&(e.stopPropagation(),this.player_.handleKeyDown(e))},e.handleKeyPress=function(e){this.handleKeyDown(e)},e.emitTapEvents=function(){var i,t=0,r=null;this.on("touchstart",function(e){1===e.touches.length&&(r={pageX:e.touches[0].pageX,pageY:e.touches[0].pageY},t=(new Date).getTime(),i=!0)}),this.on("touchmove",function(e){if(1<e.touches.length)i=!1;else if(r){var t=e.touches[0].pageX-r.pageX,n=e.touches[0].pageY-r.pageY;10<Math.sqrt(t*t+n*n)&&(i=!1)}});var e=function(){i=!1};this.on("touchleave",e),this.on("touchcancel",e),this.on("touchend",function(e){!(r=null)===i&&((new Date).getTime()-t<200&&(e.preventDefault(),this.trigger("tap")))})},e.enableTouchActivity=function(){if(this.player()&&this.player().reportUserActivity){var t,n=Ce(this.player(),this.player().reportUserActivity);this.on("touchstart",function(){n(),this.clearInterval(t),t=this.setInterval(n,250)});var e=function(e){n(),this.clearInterval(t)};this.on("touchmove",n),this.on("touchend",e),this.on("touchcancel",e)}},e.setTimeout=function(e,t){var n,i,r=this;return e=Ce(this,e),n=h.setTimeout(function(){r.off("dispose",i),e()},t),(i=function(){return r.clearTimeout(n)}).guid="vjs-timeout-"+n,this.on("dispose",i),n},e.clearTimeout=function(e){h.clearTimeout(e);var t=function(){};return t.guid="vjs-timeout-"+e,this.off("dispose",t),e},e.setInterval=function(e,t){var n=this;e=Ce(this,e);var i=h.setInterval(e,t),r=function(){return n.clearInterval(i)};return r.guid="vjs-interval-"+i,this.on("dispose",r),i},e.clearInterval=function(e){h.clearInterval(e);var t=function(){};return t.guid="vjs-interval-"+e,this.off("dispose",t),e},e.requestAnimationFrame=function(e){var t,n,i=this;return this.supportsRaf_?(e=Ce(this,e),t=h.requestAnimationFrame(function(){i.off("dispose",n),e()}),(n=function(){return i.cancelAnimationFrame(t)}).guid="vjs-raf-"+t,this.on("dispose",n),t):this.setTimeout(e,1e3/60)},e.cancelAnimationFrame=function(e){if(this.supportsRaf_){h.cancelAnimationFrame(e);var t=function(){};return t.guid="vjs-raf-"+e,this.off("dispose",t),e}return this.clearTimeout(e)},c.registerComponent=function(e,t){if("string"!=typeof e||!e)throw new Error('Illegal component name, "'+e+'"; must be a non-empty string.');var n,i=c.getComponent("Tech"),r=i&&i.isTech(t),s=c===t||c.prototype.isPrototypeOf(t.prototype);if(r||!s)throw n=r?"techs must be registered using Tech.registerTech()":"must be a Component subclass",new Error('Illegal component, "'+e+'"; '+n+".");e=Re(e),c.components_||(c.components_={});var o=c.getComponent("Player");if("Player"===e&&o&&o.players){var a=o.players,l=Object.keys(a);if(a&&0<l.length&&l.map(function(e){return a[e]}).every(Boolean))throw new Error("Can not register Player component after player has been created.")}return c.components_[e]=t},c.getComponent=function(e){if(e)return e=Re(e),c.components_&&c.components_[e]?c.components_[e]:void 0},c}();Be.prototype.supportsRaf_="function"==typeof h.requestAnimationFrame&&"function"==typeof h.cancelAnimationFrame,Be.registerComponent("Component",Be);var He,Ve,ze,We,Ke=h.navigator&&h.navigator.userAgent||"",Ue=/AppleWebKit\/([\d.]+)/i.exec(Ke),qe=Ue?parseFloat(Ue.pop()):null,Xe=/iPad/i.test(Ke),$e=/iPhone/i.test(Ke)&&!Xe,Ge=/iPod/i.test(Ke),Ye=$e||Xe||Ge,Qe=(He=Ke.match(/OS (\d+)_/i))&&He[1]?He[1]:null,Je=/Android/i.test(Ke),Ze=function(){var e=Ke.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);if(!e)return null;var t=e[1]&&parseFloat(e[1]),n=e[2]&&parseFloat(e[2]);return t&&n?parseFloat(e[1]+"."+e[2]):t||null}(),et=Je&&Ze<5&&qe<537,tt=/Firefox/i.test(Ke),nt=/Edge/i.test(Ke),it=!nt&&(/Chrome/i.test(Ke)||/CriOS/i.test(Ke)),rt=(Ve=Ke.match(/(Chrome|CriOS)\/(\d+)/))&&Ve[2]?parseFloat(Ve[2]):null,st=(ze=/MSIE\s(\d+)\.\d/.exec(Ke),!(We=ze&&parseFloat(ze[1]))&&/Trident\/7.0/i.test(Ke)&&/rv:11.0/.test(Ke)&&(We=11),We),ot=/Safari/i.test(Ke)&&!it&&!Je&&!nt,at=(ot||Ye)&&!it,lt=C()&&("ontouchstart"in h||h.navigator.maxTouchPoints||h.DocumentTouch&&h.document instanceof h.DocumentTouch),ct=Object.freeze({IS_IPAD:Xe,IS_IPHONE:$e,IS_IPOD:Ge,IS_IOS:Ye,IOS_VERSION:Qe,IS_ANDROID:Je,ANDROID_VERSION:Ze,IS_NATIVE_ANDROID:et,IS_FIREFOX:tt,IS_EDGE:nt,IS_CHROME:it,CHROME_VERSION:rt,IE_VERSION:st,IS_SAFARI:ot,IS_ANY_SAFARI:at,TOUCH_ENABLED:lt});function ut(e,t,n,i){return function(e,t,n){if("number"!=typeof t||t<0||n<t)throw new Error("Failed to execute '"+e+"' on 'TimeRanges': The index provided ("+t+") is non-numeric or out of bounds (0-"+n+").")}(e,i,n.length-1),n[i][t]}function ht(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:ut.bind(null,"start",0,e),end:ut.bind(null,"end",1,e)}}function dt(e,t){return Array.isArray(e)?ht(e):void 0===e||void 0===t?ht():ht([[e,t]])}function pt(e,t){var n,i,r=0;if(!t)return 0;e&&e.length||(e=dt(0,0));for(var s=0;s<e.length;s++)n=e.start(s),t<(i=e.end(s))&&(i=t),r+=i-n;return r/t}for(var ft,vt={},gt=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror","fullscreen"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror","-webkit-full-screen"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror","-moz-full-screen"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError","-ms-fullscreen"]],yt=gt[0],_t=!1,mt=0;mt<gt.length;mt++)if(gt[mt][1]in d){ft=gt[mt];break}if(ft){for(var bt=0;bt<ft.length;bt++)vt[yt[bt]]=ft[bt];_t=ft[0]===yt[0]}function Tt(e){if(e instanceof Tt)return e;"number"==typeof e?this.code=e:"string"==typeof e?this.message=e:b(e)&&("number"==typeof e.code&&(this.code=e.code),m(this,e)),this.message||(this.message=Tt.defaultMessages[this.code]||"")}Tt.prototype.code=0,Tt.prototype.message="",Tt.prototype.status=null,Tt.errorTypes=["MEDIA_ERR_CUSTOM","MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED","MEDIA_ERR_ENCRYPTED"],Tt.defaultMessages={1:"You aborted the media playback",2:"A network error caused the media download to fail part-way.",3:"The media playback was aborted due to a corruption problem or because the media used features your browser did not support.",4:"The media could not be loaded, either because the server or network failed or because the format is not supported.",5:"The media is encrypted and we do not have the keys to decrypt it."};for(var kt=0;kt<Tt.errorTypes.length;kt++)Tt[Tt.errorTypes[kt]]=kt,Tt.prototype[Tt.errorTypes[kt]]=kt;var Ct=function(e,t){var n,i=null;try{n=JSON.parse(e,t)}catch(e){i=e}return[i,n]};function Et(e){return null!=e&&"function"==typeof e.then}function St(e){Et(e)&&e.then(null,function(e){})}var wt=function(i){return["kind","label","language","id","inBandMetadataTrackDispatchType","mode","src"].reduce(function(e,t,n){return i[t]&&(e[t]=i[t]),e},{cues:i.cues&&Array.prototype.map.call(i.cues,function(e){return{startTime:e.startTime,endTime:e.endTime,text:e.text,id:e.id}})})},xt=function(e){var t=e.$$("track"),n=Array.prototype.map.call(t,function(e){return e.track});return Array.prototype.map.call(t,function(e){var t=wt(e.track);return e.src&&(t.src=e.src),t}).concat(Array.prototype.filter.call(e.textTracks(),function(e){return-1===n.indexOf(e)}).map(wt))},jt=function(e,n){return e.forEach(function(e){var t=n.addRemoteTextTrack(e).track;!e.src&&e.cues&&e.cues.forEach(function(e){return t.addCue(e)})}),n.textTracks()};function Pt(e,t){return e(t={exports:{}},t.exports),t.exports}var At=Pt(function(e,t){function n(e){if(e&&"object"==typeof e){var t=e.which||e.keyCode||e.charCode;t&&(e=t)}if("number"==typeof e)return o[e];var n,i=String(e);return(n=r[i.toLowerCase()])?n:(n=s[i.toLowerCase()])||(1===i.length?i.charCodeAt(0):void 0)}n.isEventKey=function(e,t){if(e&&"object"==typeof e){var n=e.which||e.keyCode||e.charCode;if(null==n)return!1;if("string"==typeof t){var i;if(i=r[t.toLowerCase()])return i===n;if(i=s[t.toLowerCase()])return i===n}else if("number"==typeof t)return t===n;return!1}};var r=(t=e.exports=n).code=t.codes={backspace:8,tab:9,enter:13,shift:16,ctrl:17,alt:18,"pause/break":19,"caps lock":20,esc:27,space:32,"page up":33,"page down":34,end:35,home:36,left:37,up:38,right:39,down:40,insert:45,delete:46,command:91,"left command":91,"right command":93,"numpad *":106,"numpad +":107,"numpad -":109,"numpad .":110,"numpad /":111,"num lock":144,"scroll lock":145,"my computer":182,"my calculator":183,";":186,"=":187,",":188,"-":189,".":190,"/":191,"`":192,"[":219,"\\":220,"]":221,"'":222},s=t.aliases={windows:91,"⇧":16,"⌥":18,"⌃":17,"⌘":91,ctl:17,control:17,option:18,pause:19,break:19,caps:20,return:13,escape:27,spc:32,spacebar:32,pgup:33,pgdn:34,ins:45,del:46,cmd:91};for(i=97;i<123;i++)r[String.fromCharCode(i)]=i-32;for(var i=48;i<58;i++)r[i-48]=i;for(i=1;i<13;i++)r["f"+i]=i+111;for(i=0;i<10;i++)r["numpad "+i]=i+96;var o=t.names=t.title={};for(i in r)o[r[i]]=i;for(var a in s)r[a]=s[a]}),Mt=(At.code,At.codes,At.aliases,At.names,At.title,"vjs-modal-dialog"),Dt=function(i){function e(e,t){var n;return(n=i.call(this,e,t)||this).opened_=n.hasBeenOpened_=n.hasBeenFilled_=!1,n.closeable(!n.options_.uncloseable),n.content(n.options_.content),n.contentEl_=x("div",{className:Mt+"-content"},{role:"document"}),n.descEl_=x("p",{className:Mt+"-description vjs-control-text",id:n.el().getAttribute("aria-describedby")}),j(n.descEl_,n.description()),n.el_.appendChild(n.descEl_),n.el_.appendChild(n.contentEl_),n}f(e,i);var t=e.prototype;return t.createEl=function(){return i.prototype.createEl.call(this,"div",{className:this.buildCSSClass(),tabIndex:-1},{"aria-describedby":this.id()+"_description","aria-hidden":"true","aria-label":this.label(),role:"dialog"})},t.dispose=function(){this.contentEl_=null,this.descEl_=null,this.previouslyActiveEl_=null,i.prototype.dispose.call(this)},t.buildCSSClass=function(){return Mt+" vjs-hidden "+i.prototype.buildCSSClass.call(this)},t.label=function(){return this.localize(this.options_.label||"Modal Window")},t.description=function(){var e=this.options_.description||this.localize("This is a modal window.");return this.closeable()&&(e+=" "+this.localize("This modal can be closed by pressing the Escape key or activating the close button.")),e},t.open=function(){if(!this.opened_){var e=this.player();this.trigger("beforemodalopen"),this.opened_=!0,(this.options_.fillAlways||!this.hasBeenOpened_&&!this.hasBeenFilled_)&&this.fill(),this.wasPlaying_=!e.paused(),this.options_.pauseOnOpen&&this.wasPlaying_&&e.pause(),this.on("keydown",this.handleKeyDown),this.hadControls_=e.controls(),e.controls(!1),this.show(),this.conditionalFocus_(),this.el().setAttribute("aria-hidden","false"),this.trigger("modalopen"),this.hasBeenOpened_=!0}},t.opened=function(e){return"boolean"==typeof e&&this[e?"open":"close"](),this.opened_},t.close=function(){if(this.opened_){var e=this.player();this.trigger("beforemodalclose"),this.opened_=!1,this.wasPlaying_&&this.options_.pauseOnOpen&&e.play(),this.off("keydown",this.handleKeyDown),this.hadControls_&&e.controls(!0),this.hide(),this.el().setAttribute("aria-hidden","true"),this.trigger("modalclose"),this.conditionalBlur_(),this.options_.temporary&&this.dispose()}},t.closeable=function(e){if("boolean"==typeof e){var t=this.closeable_=!!e,n=this.getChild("closeButton");if(t&&!n){var i=this.contentEl_;this.contentEl_=this.el_,n=this.addChild("closeButton",{controlText:"Close Modal Dialog"}),this.contentEl_=i,this.on(n,"close",this.close)}!t&&n&&(this.off(n,"close",this.close),this.removeChild(n),n.dispose())}return this.closeable_},t.fill=function(){this.fillWith(this.content())},t.fillWith=function(e){var t=this.contentEl(),n=t.parentNode,i=t.nextSibling;this.trigger("beforemodalfill"),this.hasBeenFilled_=!0,n.removeChild(t),this.empty(),$(t,e),this.trigger("modalfill"),i?n.insertBefore(t,i):n.appendChild(t);var r=this.getChild("closeButton");r&&n.appendChild(r.el_)},t.empty=function(){this.trigger("beforemodalempty"),U(this.contentEl()),this.trigger("modalempty")},t.content=function(e){return"undefined"!=typeof e&&(this.content_=e),this.content_},t.conditionalFocus_=function(){var e=d.activeElement,t=this.player_.el_;this.previouslyActiveEl_=null,(t.contains(e)||t===e)&&(this.previouslyActiveEl_=e,this.focus())},t.conditionalBlur_=function(){this.previouslyActiveEl_&&(this.previouslyActiveEl_.focus(),this.previouslyActiveEl_=null)},t.handleKeyDown=function(e){if(e.stopPropagation(),At.isEventKey(e,"Escape")&&this.closeable())return e.preventDefault(),void this.close();if(At.isEventKey(e,"Tab")){for(var t,n=this.focusableEls_(),i=this.el_.querySelector(":focus"),r=0;r<n.length;r++)if(i===n[r]){t=r;break}d.activeElement===this.el_&&(t=0),e.shiftKey&&0===t?(n[n.length-1].focus(),e.preventDefault()):e.shiftKey||t!==n.length-1||(n[0].focus(),e.preventDefault())}},t.focusableEls_=function(){var e=this.el_.querySelectorAll("*");return Array.prototype.filter.call(e,function(e){return(e instanceof h.HTMLAnchorElement||e instanceof h.HTMLAreaElement)&&e.hasAttribute("href")||(e instanceof h.HTMLInputElement||e instanceof h.HTMLSelectElement||e instanceof h.HTMLTextAreaElement||e instanceof h.HTMLButtonElement)&&!e.hasAttribute("disabled")||e instanceof h.HTMLIFrameElement||e instanceof h.HTMLObjectElement||e instanceof h.HTMLEmbedElement||e.hasAttribute("tabindex")&&-1!==e.getAttribute("tabindex")||e.hasAttribute("contenteditable")})},e}(Be);Dt.prototype.options_={pauseOnOpen:!0,temporary:!0},Be.registerComponent("ModalDialog",Dt);var Lt=function(i){function e(e){var t;void 0===e&&(e=[]),(t=i.call(this)||this).tracks_=[],Object.defineProperty(v(v(t)),"length",{get:function(){return this.tracks_.length}});for(var n=0;n<e.length;n++)t.addTrack(e[n]);return t}f(e,i);var t=e.prototype;return t.addTrack=function(e){var t=this.tracks_.length;""+t in this||Object.defineProperty(this,t,{get:function(){return this.tracks_[t]}}),-1===this.tracks_.indexOf(e)&&(this.tracks_.push(e),this.trigger({track:e,type:"addtrack",target:this}))},t.removeTrack=function(e){for(var t,n=0,i=this.length;n<i;n++)if(this[n]===e){(t=this[n]).off&&t.off(),this.tracks_.splice(n,1);break}t&&this.trigger({track:t,type:"removetrack",target:this})},t.getTrackById=function(e){for(var t=null,n=0,i=this.length;n<i;n++){var r=this[n];if(r.id===e){t=r;break}}return t},e}(Se);for(var Nt in Lt.prototype.allowedEvents_={change:"change",addtrack:"addtrack",removetrack:"removetrack"},Lt.prototype.allowedEvents_)Lt.prototype["on"+Nt]=null;var Ot=function(e,t){for(var n=0;n<e.length;n++)Object.keys(e[n]).length&&t.id!==e[n].id&&(e[n].enabled=!1)},It=function(i){function e(e){var t;void 0===e&&(e=[]);for(var n=e.length-1;0<=n;n--)if(e[n].enabled){Ot(e,e[n]);break}return(t=i.call(this,e)||this).changing_=!1,t}f(e,i);var t=e.prototype;return t.addTrack=function(e){var t=this;e.enabled&&Ot(this,e),i.prototype.addTrack.call(this,e),e.addEventListener&&(e.enabledChange_=function(){t.changing_||(t.changing_=!0,Ot(t,e),t.changing_=!1,t.trigger("change"))},e.addEventListener("enabledchange",e.enabledChange_))},t.removeTrack=function(e){i.prototype.removeTrack.call(this,e),e.removeEventListener&&e.enabledChange_&&(e.removeEventListener("enabledchange",e.enabledChange_),e.enabledChange_=null)},e}(Lt),Rt=function(e,t){for(var n=0;n<e.length;n++)Object.keys(e[n]).length&&t.id!==e[n].id&&(e[n].selected=!1)},Ft=function(i){function e(e){var t;void 0===e&&(e=[]);for(var n=e.length-1;0<=n;n--)if(e[n].selected){Rt(e,e[n]);break}return(t=i.call(this,e)||this).changing_=!1,Object.defineProperty(v(v(t)),"selectedIndex",{get:function(){for(var e=0;e<this.length;e++)if(this[e].selected)return e;return-1},set:function(){}}),t}f(e,i);var t=e.prototype;return t.addTrack=function(e){var t=this;e.selected&&Rt(this,e),i.prototype.addTrack.call(this,e),e.addEventListener&&(e.selectedChange_=function(){t.changing_||(t.changing_=!0,Rt(t,e),t.changing_=!1,t.trigger("change"))},e.addEventListener("selectedchange",e.selectedChange_))},t.removeTrack=function(e){i.prototype.removeTrack.call(this,e),e.removeEventListener&&e.selectedChange_&&(e.removeEventListener("selectedchange",e.selectedChange_),e.selectedChange_=null)},e}(Lt),Bt=function(n){function e(){return n.apply(this,arguments)||this}f(e,n);var t=e.prototype;return t.addTrack=function(e){var t=this;n.prototype.addTrack.call(this,e),this.queueChange_||(this.queueChange_=function(){return t.queueTrigger("change")}),this.triggerSelectedlanguagechange||(this.triggerSelectedlanguagechange_=function(){return t.trigger("selectedlanguagechange")}),e.addEventListener("modechange",this.queueChange_);-1===["metadata","chapters"].indexOf(e.kind)&&e.addEventListener("modechange",this.triggerSelectedlanguagechange_)},t.removeTrack=function(e){n.prototype.removeTrack.call(this,e),e.removeEventListener&&(this.queueChange_&&e.removeEventListener("modechange",this.queueChange_),this.selectedlanguagechange_&&e.removeEventListener("modechange",this.triggerSelectedlanguagechange_))},e}(Lt),Ht=function(){function e(e){void 0===e&&(e=[]),this.trackElements_=[],Object.defineProperty(this,"length",{get:function(){return this.trackElements_.length}});for(var t=0,n=e.length;t<n;t++)this.addTrackElement_(e[t])}var t=e.prototype;return t.addTrackElement_=function(e){var t=this.trackElements_.length;""+t in this||Object.defineProperty(this,t,{get:function(){return this.trackElements_[t]}}),-1===this.trackElements_.indexOf(e)&&this.trackElements_.push(e)},t.getTrackElementByTrack_=function(e){for(var t,n=0,i=this.trackElements_.length;n<i;n++)if(e===this.trackElements_[n].track){t=this.trackElements_[n];break}return t},t.removeTrackElement_=function(e){for(var t=0,n=this.trackElements_.length;t<n;t++)if(e===this.trackElements_[t]){this.trackElements_[t].track&&"function"==typeof this.trackElements_[t].track.off&&this.trackElements_[t].track.off(),"function"==typeof this.trackElements_[t].off&&this.trackElements_[t].off(),this.trackElements_.splice(t,1);break}},e}(),Vt=function(){function t(e){t.prototype.setCues_.call(this,e),Object.defineProperty(this,"length",{get:function(){return this.length_}})}var e=t.prototype;return e.setCues_=function(e){var t=this.length||0,n=0,i=e.length;this.cues_=e,this.length_=e.length;var r=function(e){""+e in this||Object.defineProperty(this,""+e,{get:function(){return this.cues_[e]}})};if(t<i)for(n=t;n<i;n++)r.call(this,n)},e.getCueById=function(e){for(var t=null,n=0,i=this.length;n<i;n++){var r=this[n];if(r.id===e){t=r;break}}return t},t}(),zt={alternative:"alternative",captions:"captions",main:"main",sign:"sign",subtitles:"subtitles",commentary:"commentary"},Wt={alternative:"alternative",descriptions:"descriptions",main:"main","main-desc":"main-desc",translation:"translation",commentary:"commentary"},Kt={subtitles:"subtitles",captions:"captions",descriptions:"descriptions",chapters:"chapters",metadata:"metadata"},Ut={disabled:"disabled",hidden:"hidden",showing:"showing"},qt=function(s){function e(e){var t;void 0===e&&(e={}),t=s.call(this)||this;var n={id:e.id||"vjs_track_"+ee(),kind:e.kind||"",label:e.label||"",language:e.language||""},i=function(e){Object.defineProperty(v(v(t)),e,{get:function(){return n[e]},set:function(){}})};for(var r in n)i(r);return t}return f(e,s),e}(Se),Xt=function(e){var t=["protocol","hostname","port","pathname","search","hash","host"],n=d.createElement("a");n.href=e;var i,r=""===n.host&&"file:"!==n.protocol;r&&((i=d.createElement("div")).innerHTML='<a href="'+e+'"></a>',n=i.firstChild,i.setAttribute("style","display:none; position:absolute;"),d.body.appendChild(i));for(var s={},o=0;o<t.length;o++)s[t[o]]=n[t[o]];return"http:"===s.protocol&&(s.host=s.host.replace(/:80$/,"")),"https:"===s.protocol&&(s.host=s.host.replace(/:443$/,"")),s.protocol||(s.protocol=h.location.protocol),r&&d.body.removeChild(i),s},$t=function(e){if(!e.match(/^https?:\/\//)){var t=d.createElement("div");t.innerHTML='<a href="'+e+'">x</a>',e=t.firstChild.href}return e},Gt=function(e){if("string"==typeof e){var t=/^(\/?)([\s\S]*?)((?:\.{1,2}|[^\/]+?)(\.([^\.\/\?]+)))(?:[\/]*|[\?].*)$/i.exec(e);if(t)return t.pop().toLowerCase()}return""},Yt=function(e){var t=h.location,n=Xt(e);return(":"===n.protocol?t.protocol:n.protocol)+n.host!==t.protocol+t.host},Qt=Object.freeze({parseUrl:Xt,getAbsoluteURL:$t,getFileExtension:Gt,isCrossOrigin:Yt}),Jt=function(e){var t=Zt.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)},Zt=Object.prototype.toString;var en=Pt(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*$/,"")}}),tn=(en.left,en.right,Function.prototype.toString),nn=/^\s*class\b/,rn=function(e){try{var t=tn.call(e);return nn.test(t)}catch(e){return!1}},sn=Object.prototype.toString,on="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag,an=function(e){if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;if("function"==typeof e&&!e.prototype)return!0;if(on)return function(e){try{return!rn(e)&&(tn.call(e),!0)}catch(e){return!1}}(e);if(rn(e))return!1;var t=sn.call(e);return"[object Function]"===t||"[object GeneratorFunction]"===t},ln=Object.prototype.toString,cn=Object.prototype.hasOwnProperty,un=function(e,t,n){if(!an(t))throw new TypeError("iterator must be a function");var i;3<=arguments.length&&(i=n),"[object Array]"===ln.call(e)?function(e,t,n){for(var i=0,r=e.length;i<r;i++)cn.call(e,i)&&(null==n?t(e[i],i,e):t.call(n,e[i],i,e))}(e,t,i):"string"==typeof e?function(e,t,n){for(var i=0,r=e.length;i<r;i++)null==n?t(e.charAt(i),i,e):t.call(n,e.charAt(i),i,e)}(e,t,i):function(e,t,n){for(var i in e)cn.call(e,i)&&(null==n?t(e[i],i,e):t.call(n,e[i],i,e))}(e,t,i)},hn=function(e){if(!e)return{};var s={};return un(en(e).split("\n"),function(e){var t,n=e.indexOf(":"),i=en(e.slice(0,n)).toLowerCase(),r=en(e.slice(n+1));"undefined"==typeof s[i]?s[i]=r:(t=s[i],"[object Array]"===Object.prototype.toString.call(t)?s[i].push(r):s[i]=[s[i],r])}),s},dn=function(){for(var e={},t=0;t<arguments.length;t++){var n=arguments[t];for(var i in n)pn.call(n,i)&&(e[i]=n[i])}return e},pn=Object.prototype.hasOwnProperty;var fn=gn;function vn(e,t,n){var i=e;return Jt(t)?(n=t,"string"==typeof e&&(i={uri:e})):i=dn(t,{uri:e}),i.callback=n,i}function gn(e,t,n){return yn(t=vn(e,t,n))}function yn(i){if("undefined"==typeof i.callback)throw new Error("callback argument missing");var r=!1,s=function(e,t,n){r||(r=!0,i.callback(e,t,n))};function t(e){return clearTimeout(l),e instanceof Error||(e=new Error(""+(e||"Unknown XMLHttpRequest Error"))),e.statusCode=0,s(e,v)}function e(){if(!o){var e;clearTimeout(l),e=i.useXDR&&void 0===a.status?200:1223===a.status?204:a.status;var t=v,n=null;return 0!==e?(t={body:function(){var e=void 0;if(e=a.response?a.response:a.responseText||function(e){if("document"===e.responseType)return e.responseXML;var t=e.responseXML&&"parsererror"===e.responseXML.documentElement.nodeName;return""!==e.responseType||t?null:e.responseXML}(a),f)try{e=JSON.parse(e)}catch(e){}return e}(),statusCode:e,method:u,headers:{},url:c,rawRequest:a},a.getAllResponseHeaders&&(t.headers=hn(a.getAllResponseHeaders()))):n=new Error("Internal XMLHttpRequest Error"),s(n,t,t.body)}}var n,o,a=i.xhr||null;a||(a=i.cors||i.useXDR?new gn.XDomainRequest:new gn.XMLHttpRequest);var l,c=a.url=i.uri||i.url,u=a.method=i.method||"GET",h=i.body||i.data,d=a.headers=i.headers||{},p=!!i.sync,f=!1,v={body:void 0,headers:{},statusCode:0,method:u,url:c,rawRequest:a};if("json"in i&&!1!==i.json&&(f=!0,d.accept||d.Accept||(d.Accept="application/json"),"GET"!==u&&"HEAD"!==u&&(d["content-type"]||d["Content-Type"]||(d["Content-Type"]="application/json"),h=JSON.stringify(!0===i.json?h:i.json))),a.onreadystatechange=function(){4===a.readyState&&setTimeout(e,0)},a.onload=e,a.onerror=t,a.onprogress=function(){},a.onabort=function(){o=!0},a.ontimeout=t,a.open(u,c,!p,i.username,i.password),p||(a.withCredentials=!!i.withCredentials),!p&&0<i.timeout&&(l=setTimeout(function(){if(!o){o=!0,a.abort("timeout");var e=new Error("XMLHttpRequest timeout");e.code="ETIMEDOUT",t(e)}},i.timeout)),a.setRequestHeader)for(n in d)d.hasOwnProperty(n)&&a.setRequestHeader(n,d[n]);else if(i.headers&&!function(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0}(i.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in i&&(a.responseType=i.responseType),"beforeSend"in i&&"function"==typeof i.beforeSend&&i.beforeSend(a),a.send(h||null),a}gn.XMLHttpRequest=h.XMLHttpRequest||function(){},gn.XDomainRequest="withCredentials"in new gn.XMLHttpRequest?gn.XMLHttpRequest:h.XDomainRequest,function(e,t){for(var n=0;n<e.length;n++)t(e[n])}(["get","put","post","patch","head","delete"],function(i){gn["delete"===i?"del":i]=function(e,t,n){return(t=vn(e,t,n)).method=i.toUpperCase(),yn(t)}});var _n=function(e,t){var n=new h.WebVTT.Parser(h,h.vttjs,h.WebVTT.StringDecoder()),i=[];n.oncue=function(e){t.addCue(e)},n.onparsingerror=function(e){i.push(e)},n.onflush=function(){t.trigger({type:"loadeddata",target:t})},n.parse(e),0<i.length&&(h.console&&h.console.groupCollapsed&&h.console.groupCollapsed("Text Track parsing errors for "+t.src),i.forEach(function(e){return g.error(e)}),h.console&&h.console.groupEnd&&h.console.groupEnd()),n.flush()},mn=function(c){function e(e){var t;if(void 0===e&&(e={}),!e.tech)throw new Error("A tech was not provided.");var n=Fe(e,{kind:Kt[e.kind]||"subtitles",language:e.language||e.srclang||""}),i=Ut[n.mode]||"disabled",r=n.default;"metadata"!==n.kind&&"chapters"!==n.kind||(i="hidden"),(t=c.call(this,n)||this).tech_=n.tech,t.cues_=[],t.activeCues_=[];var s=new Vt(t.cues_),o=new Vt(t.activeCues_),a=!1,l=Ce(v(v(t)),function(){this.activeCues=this.activeCues,a&&(this.trigger("cuechange"),a=!1)});return"disabled"!==i&&t.tech_.ready(function(){t.tech_.on("timeupdate",l)},!0),Object.defineProperties(v(v(t)),{default:{get:function(){return r},set:function(){}},mode:{get:function(){return i},set:function(e){var t=this;Ut[e]&&("disabled"!==(i=e)?this.tech_.ready(function(){t.tech_.on("timeupdate",l)},!0):this.tech_.off("timeupdate",l),this.trigger("modechange"))}},cues:{get:function(){return this.loaded_?s:null},set:function(){}},activeCues:{get:function(){if(!this.loaded_)return null;if(0===this.cues.length)return o;for(var e=this.tech_.currentTime(),t=[],n=0,i=this.cues.length;n<i;n++){var r=this.cues[n];r.startTime<=e&&r.endTime>=e?t.push(r):r.startTime===r.endTime&&r.startTime<=e&&r.startTime+.5>=e&&t.push(r)}if(a=!1,t.length!==this.activeCues_.length)a=!0;else for(var s=0;s<t.length;s++)-1===this.activeCues_.indexOf(t[s])&&(a=!0);return this.activeCues_=t,o.setCues_(this.activeCues_),o},set:function(){}}}),n.src?(t.src=n.src,function(e,s){var t={uri:e},n=Yt(e);n&&(t.cors=n),fn(t,Ce(this,function(e,t,n){if(e)return g.error(e,t);if(s.loaded_=!0,"function"!=typeof h.WebVTT){if(s.tech_){var i,r=function(){g.error("vttjs failed to load, stopping trying to process "+s.src),s.tech_.off("vttjsloaded",i)};i=function(){return s.tech_.off("vttjserror",r),_n(n,s)},s.tech_.one("vttjsloaded",i),s.tech_.one("vttjserror",r)}}else _n(n,s)}))}(n.src,v(v(t)))):t.loaded_=!0,t}f(e,c);var t=e.prototype;return t.addCue=function(e){var t=e;if(h.vttjs&&!(e instanceof h.vttjs.VTTCue)){for(var n in t=new h.vttjs.VTTCue(e.startTime,e.endTime,e.text),e)n in t||(t[n]=e[n]);t.id=e.id,t.originalCue_=e}for(var i=this.tech_.textTracks(),r=0;r<i.length;r++)i[r]!==this&&i[r].removeCue(t);this.cues_.push(t),this.cues.setCues_(this.cues_)},t.removeCue=function(e){for(var t=this.cues_.length;t--;){var n=this.cues_[t];if(n===e||n.originalCue_&&n.originalCue_===e){this.cues_.splice(t,1),this.cues.setCues_(this.cues_);break}}},e}(qt);mn.prototype.allowedEvents_={cuechange:"cuechange"};var bn=function(r){function e(e){var t;void 0===e&&(e={});var n=Fe(e,{kind:Wt[e.kind]||""});t=r.call(this,n)||this;var i=!1;return Object.defineProperty(v(v(t)),"enabled",{get:function(){return i},set:function(e){"boolean"==typeof e&&e!==i&&(i=e,this.trigger("enabledchange"))}}),n.enabled&&(t.enabled=n.enabled),t.loaded_=!0,t}return f(e,r),e}(qt),Tn=function(r){function e(e){var t;void 0===e&&(e={});var n=Fe(e,{kind:zt[e.kind]||""});t=r.call(this,n)||this;var i=!1;return Object.defineProperty(v(v(t)),"selected",{get:function(){return i},set:function(e){"boolean"==typeof e&&e!==i&&(i=e,this.trigger("selectedchange"))}}),n.selected&&(t.selected=n.selected),t}return f(e,r),e}(qt),kn=function(r){function e(e){var t,n;void 0===e&&(e={}),t=r.call(this)||this;var i=new mn(e);return t.kind=i.kind,t.src=i.src,t.srclang=i.language,t.label=i.label,t.default=i.default,Object.defineProperties(v(v(t)),{readyState:{get:function(){return n}},track:{get:function(){return i}}}),n=0,i.addEventListener("loadeddata",function(){n=2,t.trigger({type:"load",target:v(v(t))})}),t}return f(e,r),e}(Se);kn.prototype.allowedEvents_={load:"load"},kn.NONE=0,kn.LOADING=1,kn.LOADED=2,kn.ERROR=3;var Cn={audio:{ListClass:It,TrackClass:bn,capitalName:"Audio"},video:{ListClass:Ft,TrackClass:Tn,capitalName:"Video"},text:{ListClass:Bt,TrackClass:mn,capitalName:"Text"}};Object.keys(Cn).forEach(function(e){Cn[e].getterName=e+"Tracks",Cn[e].privateName=e+"Tracks_"});var En={remoteText:{ListClass:Bt,TrackClass:mn,capitalName:"RemoteText",getterName:"remoteTextTracks",privateName:"remoteTextTracks_"},remoteTextEl:{ListClass:Ht,TrackClass:kn,capitalName:"RemoteTextTrackEls",getterName:"remoteTextTrackEls",privateName:"remoteTextTrackEls_"}},Sn=Fe(Cn,En);En.names=Object.keys(En),Cn.names=Object.keys(Cn),Sn.names=[].concat(En.names).concat(Cn.names);var wn={};var xn=function(t){function n(n,e){var i;return void 0===n&&(n={}),void 0===e&&(e=function(){}),n.reportTouchActivity=!1,(i=t.call(this,null,n,e)||this).hasStarted_=!1,i.on("playing",function(){this.hasStarted_=!0}),i.on("loadstart",function(){this.hasStarted_=!1}),Sn.names.forEach(function(e){var t=Sn[e];n&&n[t.getterName]&&(i[t.privateName]=n[t.getterName])}),i.featuresProgressEvents||i.manualProgressOn(),i.featuresTimeupdateEvents||i.manualTimeUpdatesOn(),["Text","Audio","Video"].forEach(function(e){!1===n["native"+e+"Tracks"]&&(i["featuresNative"+e+"Tracks"]=!1)}),!1===n.nativeCaptions||!1===n.nativeTextTracks?i.featuresNativeTextTracks=!1:!0!==n.nativeCaptions&&!0!==n.nativeTextTracks||(i.featuresNativeTextTracks=!0),i.featuresNativeTextTracks||i.emulateTextTracks(),i.autoRemoteTextTracks_=new Sn.text.ListClass,i.initTrackListeners(),n.nativeControlsForTouch||i.emitTapEvents(),i.constructor&&(i.name_=i.constructor.name||"Unknown Tech"),i}f(n,t);var e=n.prototype;return e.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"})},e.manualProgressOn=function(){this.on("durationchange",this.onDurationChange),this.manualProgress=!0,this.one("ready",this.trackProgress)},e.manualProgressOff=function(){this.manualProgress=!1,this.stopTrackingProgress(),this.off("durationchange",this.onDurationChange)},e.trackProgress=function(e){this.stopTrackingProgress(),this.progressInterval=this.setInterval(Ce(this,function(){var e=this.bufferedPercent();this.bufferedPercent_!==e&&this.trigger("progress"),1===(this.bufferedPercent_=e)&&this.stopTrackingProgress()}),500)},e.onDurationChange=function(e){this.duration_=this.duration()},e.buffered=function(){return dt(0,0)},e.bufferedPercent=function(){return pt(this.buffered(),this.duration_)},e.stopTrackingProgress=function(){this.clearInterval(this.progressInterval)},e.manualTimeUpdatesOn=function(){this.manualTimeUpdates=!0,this.on("play",this.trackCurrentTime),this.on("pause",this.stopTrackingCurrentTime)},e.manualTimeUpdatesOff=function(){this.manualTimeUpdates=!1,this.stopTrackingCurrentTime(),this.off("play",this.trackCurrentTime),this.off("pause",this.stopTrackingCurrentTime)},e.trackCurrentTime=function(){this.currentTimeInterval&&this.stopTrackingCurrentTime(),this.currentTimeInterval=this.setInterval(function(){this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},250)},e.stopTrackingCurrentTime=function(){this.clearInterval(this.currentTimeInterval),this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},e.dispose=function(){this.clearTracks(Cn.names),this.manualProgress&&this.manualProgressOff(),this.manualTimeUpdates&&this.manualTimeUpdatesOff(),t.prototype.dispose.call(this)},e.clearTracks=function(e){var r=this;(e=[].concat(e)).forEach(function(e){for(var t=r[e+"Tracks"]()||[],n=t.length;n--;){var i=t[n];"text"===e&&r.removeRemoteTextTrack(i),t.removeTrack(i)}})},e.cleanupAutoTextTracks=function(){for(var e=this.autoRemoteTextTracks_||[],t=e.length;t--;){var n=e[t];this.removeRemoteTextTrack(n)}},e.reset=function(){},e.error=function(e){return void 0!==e&&(this.error_=new Tt(e),this.trigger("error")),this.error_},e.played=function(){return this.hasStarted_?dt(0,0):dt()},e.setCurrentTime=function(){this.manualTimeUpdates&&this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},e.initTrackListeners=function(){var r=this;Cn.names.forEach(function(e){var t=Cn[e],n=function(){r.trigger(e+"trackchange")},i=r[t.getterName]();i.addEventListener("removetrack",n),i.addEventListener("addtrack",n),r.on("dispose",function(){i.removeEventListener("removetrack",n),i.removeEventListener("addtrack",n)})})},e.addWebVttScript_=function(){var e=this;if(!h.WebVTT)if(d.body.contains(this.el())){if(!this.options_["vtt.js"]&&c(wn)&&0<Object.keys(wn).length)return void this.trigger("vttjsloaded");var t=d.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}),h.WebVTT=!0,this.el().parentNode.appendChild(t)}else this.ready(this.addWebVttScript_)},e.emulateTextTracks=function(){var e=this,n=this.textTracks(),t=this.remoteTextTracks(),i=function(e){return n.addTrack(e.track)},r=function(e){return n.removeTrack(e.track)};t.on("addtrack",i),t.on("removetrack",r),this.addWebVttScript_();var s=function(){return e.trigger("texttrackchange")},o=function(){s();for(var e=0;e<n.length;e++){var t=n[e];t.removeEventListener("cuechange",s),"showing"===t.mode&&t.addEventListener("cuechange",s)}};o(),n.addEventListener("change",o),n.addEventListener("addtrack",o),n.addEventListener("removetrack",o),this.on("dispose",function(){t.off("addtrack",i),t.off("removetrack",r),n.removeEventListener("change",o),n.removeEventListener("addtrack",o),n.removeEventListener("removetrack",o);for(var e=0;e<n.length;e++){n[e].removeEventListener("cuechange",s)}})},e.addTextTrack=function(e,t,n){if(!e)throw new Error("TextTrack kind is required but was not provided");return function(e,t,n,i,r){void 0===r&&(r={});var s=e.textTracks();r.kind=t,n&&(r.label=n),i&&(r.language=i),r.tech=e;var o=new Sn.text.TrackClass(r);return s.addTrack(o),o}(this,e,t,n)},e.createRemoteTextTrack=function(e){var t=Fe(e,{tech:this});return new En.remoteTextEl.TrackClass(t)},e.addRemoteTextTrack=function(e,t){var n=this;void 0===e&&(e={});var i=this.createRemoteTextTrack(e);return!0!==t&&!1!==t&&(g.warn('Calling addRemoteTextTrack without explicitly setting the "manualCleanup" parameter to `true` is deprecated and default to `false` in future version of video.js'),t=!0),this.remoteTextTrackEls().addTrackElement_(i),this.remoteTextTracks().addTrack(i.track),!0!==t&&this.ready(function(){return n.autoRemoteTextTracks_.addTrack(i.track)}),i},e.removeRemoteTextTrack=function(e){var t=this.remoteTextTrackEls().getTrackElementByTrack_(e);this.remoteTextTrackEls().removeTrackElement_(t),this.remoteTextTracks().removeTrack(e),this.autoRemoteTextTracks_.removeTrack(e)},e.getVideoPlaybackQuality=function(){return{}},e.setPoster=function(){},e.playsinline=function(){},e.setPlaysinline=function(){},e.overrideNativeAudioTracks=function(){},e.overrideNativeVideoTracks=function(){},e.canPlayType=function(){return""},n.canPlayType=function(){return""},n.canPlaySource=function(e,t){return n.canPlayType(e.type)},n.isTech=function(e){return e.prototype instanceof n||e instanceof n||e===n},n.registerTech=function(e,t){if(n.techs_||(n.techs_={}),!n.isTech(t))throw new Error("Tech "+e+" must be a Tech");if(!n.canPlayType)throw new Error("Techs must have a static canPlayType method on them");if(!n.canPlaySource)throw new Error("Techs must have a static canPlaySource method on them");return e=Re(e),n.techs_[e]=t,"Tech"!==e&&n.defaultTechOrder_.push(e),t},n.getTech=function(e){if(e)return e=Re(e),n.techs_&&n.techs_[e]?n.techs_[e]:h&&h.videojs&&h.videojs[e]?(g.warn("The "+e+" tech was added to the videojs object when it should be registered using videojs.registerTech(name, tech)"),h.videojs[e]):void 0},n}(Be);Sn.names.forEach(function(e){var t=Sn[e];xn.prototype[t.getterName]=function(){return this[t.privateName]=this[t.privateName]||new t.ListClass,this[t.privateName]}}),xn.prototype.featuresVolumeControl=!0,xn.prototype.featuresMuteControl=!0,xn.prototype.featuresFullscreenResize=!1,xn.prototype.featuresPlaybackRate=!1,xn.prototype.featuresProgressEvents=!1,xn.prototype.featuresSourceset=!1,xn.prototype.featuresTimeupdateEvents=!1,xn.prototype.featuresNativeTextTracks=!1,xn.withSourceHandlers=function(r){r.registerSourceHandler=function(e,t){var n=r.sourceHandlers;n||(n=r.sourceHandlers=[]),void 0===t&&(t=n.length),n.splice(t,0,e)},r.canPlayType=function(e){for(var t,n=r.sourceHandlers||[],i=0;i<n.length;i++)if(t=n[i].canPlayType(e))return t;return""},r.selectSourceHandler=function(e,t){for(var n=r.sourceHandlers||[],i=0;i<n.length;i++)if(n[i].canHandleSource(e,t))return n[i];return null},r.canPlaySource=function(e,t){var n=r.selectSourceHandler(e,t);return n?n.canHandleSource(e,t):""};["seekable","seeking","duration"].forEach(function(e){var t=this[e];"function"==typeof t&&(this[e]=function(){return this.sourceHandler_&&this.sourceHandler_[e]?this.sourceHandler_[e].apply(this.sourceHandler_,arguments):t.apply(this,arguments)})},r.prototype),r.prototype.setSource=function(e){var t=r.selectSourceHandler(e,this.options_);t||(r.nativeSourceHandler?t=r.nativeSourceHandler:g.error("No source handler found for the current source.")),this.disposeSourceHandler(),this.off("dispose",this.disposeSourceHandler),t!==r.nativeSourceHandler&&(this.currentSource_=e),this.sourceHandler_=t.handleSource(e,this,this.options_),this.one("dispose",this.disposeSourceHandler)},r.prototype.disposeSourceHandler=function(){this.currentSource_&&(this.clearTracks(["audio","video"]),this.currentSource_=null),this.cleanupAutoTextTracks(),this.sourceHandler_&&(this.sourceHandler_.dispose&&this.sourceHandler_.dispose(),this.sourceHandler_=null)}},Be.registerComponent("Tech",xn),xn.registerTech("Tech",xn),xn.defaultTechOrder_=[];var jn={},Pn={},An={};function Mn(e,t,n){e.setTimeout(function(){return function n(i,e,r,s,o,a){void 0===i&&(i={});void 0===e&&(e=[]);void 0===o&&(o=[]);void 0===a&&(a=!1);var t=e,l=t[0],c=t.slice(1);if("string"==typeof l)n(i,jn[l],r,s,o,a);else if(l){var u=Rn(s,l);if(!u.setSource)return o.push(u),n(i,c,r,s,o,a);u.setSource(m({},i),function(e,t){if(e)return n(i,c,r,s,o,a);o.push(u),n(t,i.type===t.type?c:jn[t.type],r,s,o,a)})}else c.length?n(i,c,r,s,o,a):a?r(i,o):n(i,jn["*"],r,s,o,!0)}(t,jn[t.type],n,e)},1)}function Dn(e,t,n,i){void 0===i&&(i=null);var r="call"+Re(n),s=e.reduce(In(r),i),o=s===An,a=o?null:t[n](s);return function(e,t,n,i){for(var r=e.length-1;0<=r;r--){var s=e[r];s[t]&&s[t](i,n)}}(e,n,a,o),a}var Ln={buffered:1,currentTime:1,duration:1,seekable:1,played:1,paused:1},Nn={setCurrentTime:1},On={play:1,pause:1};function In(n){return function(e,t){return e===An?An:t[n]?t[n](e):e}}function Rn(e,t){var n=Pn[e.id()],i=null;if(null==n)return i=t(e),Pn[e.id()]=[[t,i]],i;for(var r=0;r<n.length;r++){var s=n[r],o=s[0],a=s[1];o===t&&(i=a)}return null===i&&(i=t(e),n.push([t,i])),i}var Fn={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",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",png:"image/png",svg:"image/svg+xml",webp:"image/webp"},Bn=function(e){void 0===e&&(e="");var t=Gt(e);return Fn[t.toLowerCase()]||""};function Hn(e){var t=Bn(e.src);return!e.type&&t&&(e.type=t),e}var Vn=function(c){function e(e,t,n){var i,r=Fe({createEl:!1},t);if(i=c.call(this,e,r,n)||this,t.playerOptions.sources&&0!==t.playerOptions.sources.length)e.src(t.playerOptions.sources);else for(var s=0,o=t.playerOptions.techOrder;s<o.length;s++){var a=Re(o[s]),l=xn.getTech(a);if(a||(l=Be.getComponent(a)),l&&l.isSupported()){e.loadTech_(a);break}}return i}return f(e,c),e}(Be);Be.registerComponent("MediaLoader",Vn);var zn=function(r){function e(e,t){var n;return(n=r.call(this,e,t)||this).emitTapEvents(),n.enable(),n}f(e,r);var t=e.prototype;return t.createEl=function(e,t,n){void 0===e&&(e="div"),void 0===t&&(t={}),void 0===n&&(n={}),t=m({innerHTML:'<span aria-hidden="true" class="vjs-icon-placeholder"></span>',className:this.buildCSSClass(),tabIndex:0},t),"button"===e&&g.error("Creating a ClickableComponent with an HTML element of "+e+" is not supported; use a Button instead."),n=m({role:"button"},n),this.tabIndex_=t.tabIndex;var i=r.prototype.createEl.call(this,e,t,n);return this.createControlTextEl(i),i},t.dispose=function(){this.controlTextEl_=null,r.prototype.dispose.call(this)},t.createControlTextEl=function(e){return this.controlTextEl_=x("span",{className:"vjs-control-text"},{"aria-live":"polite"}),e&&e.appendChild(this.controlTextEl_),this.controlText(this.controlText_,e),this.controlTextEl_},t.controlText=function(e,t){if(void 0===t&&(t=this.el()),void 0===e)return this.controlText_||"Need Text";var n=this.localize(e);this.controlText_=e,j(this.controlTextEl_,n),this.nonIconControl||t.setAttribute("title",n)},t.buildCSSClass=function(){return"vjs-control vjs-button "+r.prototype.buildCSSClass.call(this)},t.enable=function(){this.enabled_||(this.enabled_=!0,this.removeClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","false"),"undefined"!=typeof this.tabIndex_&&this.el_.setAttribute("tabIndex",this.tabIndex_),this.on(["tap","click"],this.handleClick),this.on("keydown",this.handleKeyDown))},t.disable=function(){this.enabled_=!1,this.addClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","true"),"undefined"!=typeof this.tabIndex_&&this.el_.removeAttribute("tabIndex"),this.off(["tap","click"],this.handleClick),this.off("keydown",this.handleKeyDown)},t.handleClick=function(e){},t.handleKeyDown=function(e){At.isEventKey(e,"Space")||At.isEventKey(e,"Enter")?(e.preventDefault(),e.stopPropagation(),this.trigger("click")):r.prototype.handleKeyDown.call(this,e)},e}(Be);Be.registerComponent("ClickableComponent",zn);var Wn=function(i){function e(e,t){var n;return(n=i.call(this,e,t)||this).update(),e.on("posterchange",Ce(v(v(n)),n.update)),n}f(e,i);var t=e.prototype;return t.dispose=function(){this.player().off("posterchange",this.update),i.prototype.dispose.call(this)},t.createEl=function(){return x("div",{className:"vjs-poster",tabIndex:-1})},t.update=function(e){var t=this.player().poster();this.setSrc(t),t?this.show():this.hide()},t.setSrc=function(e){var t="";e&&(t='url("'+e+'")'),this.el_.style.backgroundImage=t},t.handleClick=function(e){this.player_.controls()&&(this.player_.tech(!0).focus(),this.player_.paused()?St(this.player_.play()):this.player_.pause())},e}(zn);Be.registerComponent("PosterImage",Wn);var Kn="#222",Un={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 qn(e,t){var n;if(4===e.length)n=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.");n=e.slice(1)}return"rgba("+parseInt(n.slice(0,2),16)+","+parseInt(n.slice(2,4),16)+","+parseInt(n.slice(4,6),16)+","+t+")"}function Xn(e,t,n){try{e.style[t]=n}catch(e){return}}var $n=function(s){function e(n,e,t){var i;i=s.call(this,n,e,t)||this;var r=Ce(v(v(i)),i.updateDisplay);return n.on("loadstart",Ce(v(v(i)),i.toggleDisplay)),n.on("texttrackchange",r),n.on("loadedmetadata",Ce(v(v(i)),i.preselectTrack)),n.ready(Ce(v(v(i)),function(){if(n.tech_&&n.tech_.featuresNativeTextTracks)this.hide();else{n.on("fullscreenchange",r),n.on("playerresize",r),h.addEventListener("orientationchange",r),n.on("dispose",function(){return h.removeEventListener("orientationchange",r)});for(var e=this.options_.playerOptions.tracks||[],t=0;t<e.length;t++)this.player_.addRemoteTextTrack(e[t],!0);this.preselectTrack()}})),i}f(e,s);var t=e.prototype;return t.preselectTrack=function(){for(var e,t,n,i={captions:1,subtitles:1},r=this.player_.textTracks(),s=this.player_.cache_.selectedLanguage,o=0;o<r.length;o++){var a=r[o];s&&s.enabled&&s.language&&s.language===a.language&&a.kind in i?a.kind===s.kind?n=a:n||(n=a):s&&!s.enabled?t=e=n=null:a.default&&("descriptions"!==a.kind||e?a.kind in i&&!t&&(t=a):e=a)}n?n.mode="showing":t?t.mode="showing":e&&(e.mode="showing")},t.toggleDisplay=function(){this.player_.tech_&&this.player_.tech_.featuresNativeTextTracks?this.hide():this.show()},t.createEl=function(){return s.prototype.createEl.call(this,"div",{className:"vjs-text-track-display"},{"aria-live":"off","aria-atomic":"true"})},t.clearDisplay=function(){"function"==typeof h.WebVTT&&h.WebVTT.processCues(h,[],this.el_)},t.updateDisplay=function(){var e=this.player_.textTracks();this.clearDisplay();for(var t=null,n=null,i=e.length;i--;){var r=e[i];"showing"===r.mode&&("descriptions"===r.kind?t=r:n=r)}n?("off"!==this.getAttribute("aria-live")&&this.setAttribute("aria-live","off"),this.updateForTrack(n)):t&&("assertive"!==this.getAttribute("aria-live")&&this.setAttribute("aria-live","assertive"),this.updateForTrack(t))},t.updateForTrack=function(e){if("function"==typeof h.WebVTT&&e.activeCues){for(var t=[],n=0;n<e.activeCues.length;n++)t.push(e.activeCues[n]);if(h.WebVTT.processCues(h,t,this.el_),this.player_.textTrackSettings)for(var i=this.player_.textTrackSettings.getValues(),r=t.length;r--;){var s=t[r];if(s){var o=s.displayState;if(i.color&&(o.firstChild.style.color=i.color),i.textOpacity&&Xn(o.firstChild,"color",qn(i.color||"#fff",i.textOpacity)),i.backgroundColor&&(o.firstChild.style.backgroundColor=i.backgroundColor),i.backgroundOpacity&&Xn(o.firstChild,"backgroundColor",qn(i.backgroundColor||"#000",i.backgroundOpacity)),i.windowColor&&(i.windowOpacity?Xn(o,"backgroundColor",qn(i.windowColor,i.windowOpacity)):o.style.backgroundColor=i.windowColor),i.edgeStyle&&("dropshadow"===i.edgeStyle?o.firstChild.style.textShadow="2px 2px 3px #222, 2px 2px 4px #222, 2px 2px 5px "+Kn:"raised"===i.edgeStyle?o.firstChild.style.textShadow="1px 1px #222, 2px 2px #222, 3px 3px "+Kn:"depressed"===i.edgeStyle?o.firstChild.style.textShadow="1px 1px #ccc, 0 1px #ccc, -1px -1px #222, 0 -1px "+Kn:"uniform"===i.edgeStyle&&(o.firstChild.style.textShadow="0 0 4px #222, 0 0 4px #222, 0 0 4px #222, 0 0 4px "+Kn)),i.fontPercent&&1!==i.fontPercent){var a=h.parseFloat(o.style.fontSize);o.style.fontSize=a*i.fontPercent+"px",o.style.height="auto",o.style.top="auto",o.style.bottom="2px"}i.fontFamily&&"default"!==i.fontFamily&&("small-caps"===i.fontFamily?o.firstChild.style.fontVariant="small-caps":o.firstChild.style.fontFamily=Un[i.fontFamily])}}}},e}(Be);Be.registerComponent("TextTrackDisplay",$n);var Gn=function(r){function e(){return r.apply(this,arguments)||this}return f(e,r),e.prototype.createEl=function(){var e=this.player_.isAudio(),t=this.localize(e?"Audio Player":"Video Player"),n=x("span",{className:"vjs-control-text",innerHTML:this.localize("{1} is loading.",[t])}),i=r.prototype.createEl.call(this,"div",{className:"vjs-loading-spinner",dir:"ltr"});return i.appendChild(n),i},e}(Be);Be.registerComponent("LoadingSpinner",Gn);var Yn=function(t){function e(){return t.apply(this,arguments)||this}f(e,t);var n=e.prototype;return n.createEl=function(e,t,n){void 0===t&&(t={}),void 0===n&&(n={}),t=m({innerHTML:'<span aria-hidden="true" class="vjs-icon-placeholder"></span>',className:this.buildCSSClass()},t),n=m({type:"button"},n);var i=Be.prototype.createEl.call(this,"button",t,n);return this.createControlTextEl(i),i},n.addChild=function(e,t){void 0===t&&(t={});var n=this.constructor.name;return g.warn("Adding an actionable (user controllable) child to a Button ("+n+") is not supported; use a ClickableComponent instead."),Be.prototype.addChild.call(this,e,t)},n.enable=function(){t.prototype.enable.call(this),this.el_.removeAttribute("disabled")},n.disable=function(){t.prototype.disable.call(this),this.el_.setAttribute("disabled","disabled")},n.handleKeyDown=function(e){At.isEventKey(e,"Space")||At.isEventKey(e,"Enter")?e.stopPropagation():t.prototype.handleKeyDown.call(this,e)},e}(zn);Be.registerComponent("Button",Yn);var Qn=function(i){function e(e,t){var n;return(n=i.call(this,e,t)||this).mouseused_=!1,n.on("mousedown",n.handleMouseDown),n}f(e,i);var t=e.prototype;return t.buildCSSClass=function(){return"vjs-big-play-button"},t.handleClick=function(e){var t=this.player_.play();if(this.mouseused_&&e.clientX&&e.clientY)return St(t),void this.player_.tech(!0).focus();var n=this.player_.getChild("controlBar"),i=n&&n.getChild("playToggle");if(i){var r=function(){return i.focus()};Et(t)?t.then(r,function(){}):this.setTimeout(r,1)}else this.player_.tech(!0).focus()},t.handleKeyDown=function(e){this.mouseused_=!1,i.prototype.handleKeyDown.call(this,e)},t.handleMouseDown=function(e){this.mouseused_=!0},e}(Yn);Qn.prototype.controlText_="Play Video",Be.registerComponent("BigPlayButton",Qn);var Jn=function(i){function e(e,t){var n;return(n=i.call(this,e,t)||this).controlText(t&&t.controlText||n.localize("Close")),n}f(e,i);var t=e.prototype;return t.buildCSSClass=function(){return"vjs-close-button "+i.prototype.buildCSSClass.call(this)},t.handleClick=function(e){this.trigger({type:"close",bubbles:!1})},e}(Yn);Be.registerComponent("CloseButton",Jn);var Zn=function(i){function e(e,t){var n;return void 0===t&&(t={}),n=i.call(this,e,t)||this,t.replay=void 0===t.replay||t.replay,n.on(e,"play",n.handlePlay),n.on(e,"pause",n.handlePause),t.replay&&n.on(e,"ended",n.handleEnded),n}f(e,i);var t=e.prototype;return t.buildCSSClass=function(){return"vjs-play-control "+i.prototype.buildCSSClass.call(this)},t.handleClick=function(e){this.player_.paused()?this.player_.play():this.player_.pause()},t.handleSeeked=function(e){this.removeClass("vjs-ended"),this.player_.paused()?this.handlePause(e):this.handlePlay(e)},t.handlePlay=function(e){this.removeClass("vjs-ended"),this.removeClass("vjs-paused"),this.addClass("vjs-playing"),this.controlText("Pause")},t.handlePause=function(e){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.controlText("Play")},t.handleEnded=function(e){this.removeClass("vjs-playing"),this.addClass("vjs-ended"),this.controlText("Replay"),this.one(this.player_,"seeked",this.handleSeeked)},e}(Yn);Zn.prototype.controlText_="Play",Be.registerComponent("PlayToggle",Zn);var ei=function(e,t){e=e<0?0:e;var n=Math.floor(e%60),i=Math.floor(e/60%60),r=Math.floor(e/3600),s=Math.floor(t/60%60),o=Math.floor(t/3600);return(isNaN(e)||e===1/0)&&(r=i=n="-"),(r=0<r||0<o?r+":":"")+(i=((r||10<=s)&&i<10?"0"+i:i)+":")+(n=n<10?"0"+n:n)},ti=ei;function ni(e,t){return void 0===t&&(t=e),ti(e,t)}var ii=function(i){function e(e,t){var n;return(n=i.call(this,e,t)||this).throttledUpdateContent=Ee(Ce(v(v(n)),n.updateContent),25),n.on(e,"timeupdate",n.throttledUpdateContent),n}f(e,i);var t=e.prototype;return t.createEl=function(){var e=this.buildCSSClass(),t=i.prototype.createEl.call(this,"div",{className:e+" vjs-time-control vjs-control",innerHTML:'<span class="vjs-control-text" role="presentation">'+this.localize(this.labelText_)+" </span>"});return this.contentEl_=x("span",{className:e+"-display"},{"aria-live":"off",role:"presentation"}),this.updateTextNode_(),t.appendChild(this.contentEl_),t},t.dispose=function(){this.contentEl_=null,this.textNode_=null,i.prototype.dispose.call(this)},t.updateTextNode_=function(){if(this.contentEl_){for(;this.contentEl_.firstChild;)this.contentEl_.removeChild(this.contentEl_.firstChild);this.textNode_=d.createTextNode(this.formattedTime_||this.formatTime_(0)),this.contentEl_.appendChild(this.textNode_)}},t.formatTime_=function(e){return ni(e)},t.updateFormattedTime_=function(e){var t=this.formatTime_(e);t!==this.formattedTime_&&(this.formattedTime_=t,this.requestAnimationFrame(this.updateTextNode_))},t.updateContent=function(e){},e}(Be);ii.prototype.labelText_="Time",ii.prototype.controlText_="Time",Be.registerComponent("TimeDisplay",ii);var ri=function(i){function e(e,t){var n;return(n=i.call(this,e,t)||this).on(e,"ended",n.handleEnded),n}f(e,i);var t=e.prototype;return t.buildCSSClass=function(){return"vjs-current-time"},t.updateContent=function(e){var t=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();this.updateFormattedTime_(t)},t.handleEnded=function(e){this.player_.duration()&&this.updateFormattedTime_(this.player_.duration())},e}(ii);ri.prototype.labelText_="Current Time",ri.prototype.controlText_="Current Time",Be.registerComponent("CurrentTimeDisplay",ri);var si=function(i){function e(e,t){var n;return(n=i.call(this,e,t)||this).on(e,"durationchange",n.updateContent),n.on(e,"loadstart",n.updateContent),n.on(e,"loadedmetadata",n.throttledUpdateContent),n}f(e,i);var t=e.prototype;return t.buildCSSClass=function(){return"vjs-duration"},t.updateContent=function(e){var t=this.player_.duration();this.duration_!==t&&(this.duration_=t,this.updateFormattedTime_(t))},e}(ii);si.prototype.labelText_="Duration",si.prototype.controlText_="Duration",Be.registerComponent("DurationDisplay",si);var oi=function(e){function t(){return e.apply(this,arguments)||this}return f(t,e),t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-time-control vjs-time-divider",innerHTML:"<div><span>/</span></div>"},{"aria-hidden":!0})},t}(Be);Be.registerComponent("TimeDivider",oi);var ai=function(i){function e(e,t){var n;return(n=i.call(this,e,t)||this).on(e,"durationchange",n.throttledUpdateContent),n.on(e,"ended",n.handleEnded),n}f(e,i);var t=e.prototype;return t.buildCSSClass=function(){return"vjs-remaining-time"},t.createEl=function(){var e=i.prototype.createEl.call(this);return e.insertBefore(x("span",{},{"aria-hidden":!0},"-"),this.contentEl_),e},t.updateContent=function(e){"number"==typeof this.player_.duration()&&(this.player_.remainingTimeDisplay?this.updateFormattedTime_(this.player_.remainingTimeDisplay()):this.updateFormattedTime_(this.player_.remainingTime()))},t.handleEnded=function(e){this.player_.duration()&&this.updateFormattedTime_(0)},e}(ii);ai.prototype.labelText_="Remaining Time",ai.prototype.controlText_="Remaining Time",Be.registerComponent("RemainingTimeDisplay",ai);var li=function(i){function e(e,t){var n;return(n=i.call(this,e,t)||this).updateShowing(),n.on(n.player(),"durationchange",n.updateShowing),n}f(e,i);var t=e.prototype;return t.createEl=function(){var e=i.prototype.createEl.call(this,"div",{className:"vjs-live-control vjs-control"});return this.contentEl_=x("div",{className:"vjs-live-display",innerHTML:'<span class="vjs-control-text">'+this.localize("Stream Type")+" </span>"+this.localize("LIVE")},{"aria-live":"off"}),e.appendChild(this.contentEl_),e},t.dispose=function(){this.contentEl_=null,i.prototype.dispose.call(this)},t.updateShowing=function(e){this.player().duration()===1/0?this.show():this.hide()},e}(Be);Be.registerComponent("LiveDisplay",li);var ci=function(i){function e(e,t){var n;return(n=i.call(this,e,t)||this).updateLiveEdgeStatus(),n.player_.liveTracker&&n.on(n.player_.liveTracker,"liveedgechange",n.updateLiveEdgeStatus),n}f(e,i);var t=e.prototype;return t.createEl=function(){var e=i.prototype.createEl.call(this,"button",{className:"vjs-seek-to-live-control vjs-control"});return this.textEl_=x("span",{className:"vjs-seek-to-live-text",innerHTML:this.localize("LIVE")},{"aria-hidden":"true"}),e.appendChild(this.textEl_),e},t.updateLiveEdgeStatus=function(e){!this.player_.liveTracker||this.player_.liveTracker.atLiveEdge()?(this.setAttribute("aria-disabled",!0),this.addClass("vjs-at-live-edge"),this.controlText("Seek to live, currently playing live")):(this.setAttribute("aria-disabled",!1),this.removeClass("vjs-at-live-edge"),this.controlText("Seek to live, currently behind live"))},t.handleClick=function(){this.player_.liveTracker.seekToLiveEdge()},t.dispose=function(){this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatus),this.textEl_=null,i.prototype.dispose.call(this)},e}(Yn);ci.prototype.controlText_="Seek to live, currently playing live",Be.registerComponent("SeekToLive",ci);var ui=function(i){function e(e,t){var n;return(n=i.call(this,e,t)||this).bar=n.getChild(n.options_.barName),n.vertical(!!n.options_.vertical),n.enable(),n}f(e,i);var t=e.prototype;return t.enabled=function(){return this.enabled_},t.enable=function(){this.enabled()||(this.on("mousedown",this.handleMouseDown),this.on("touchstart",this.handleMouseDown),this.on("keydown",this.handleKeyDown),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.disable=function(){if(this.enabled()){var e=this.bar.el_.ownerDocument;this.off("mousedown",this.handleMouseDown),this.off("touchstart",this.handleMouseDown),this.off("keydown",this.handleKeyDown),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.createEl=function(e,t,n){return void 0===t&&(t={}),void 0===n&&(n={}),t.className=t.className+" vjs-slider",t=m({tabIndex:0},t),n=m({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100,tabIndex:0},n),i.prototype.createEl.call(this,e,t,n)},t.handleMouseDown=function(e){var t=this.bar.el_.ownerDocument;"mousedown"===e.type&&e.preventDefault(),"touchstart"!==e.type||it||e.preventDefault(),B(),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.handleMouseMove=function(e){},t.handleMouseUp=function(){var e=this.bar.el_.ownerDocument;H(),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.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 n=(100*e).toFixed(2)+"%",i=t.el().style;return this.vertical()?i.height=n:i.width=n,e}}},t.calculateDistance=function(e){var t=W(this.el_,e);return this.vertical()?t.y:t.x},t.handleKeyDown=function(e){At.isEventKey(e,"Left")||At.isEventKey(e,"Down")?(e.preventDefault(),e.stopPropagation(),this.stepBack()):At.isEventKey(e,"Right")||At.isEventKey(e,"Up")?(e.preventDefault(),e.stopPropagation(),this.stepForward()):i.prototype.handleKeyDown.call(this,e)},t.handleClick=function(e){e.stopPropagation(),e.preventDefault()},t.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")},e}(Be);Be.registerComponent("Slider",ui);var hi=function(i){function e(e,t){var n;return(n=i.call(this,e,t)||this).partEls_=[],n.on(e,"progress",n.update),n}f(e,i);var t=e.prototype;return t.createEl=function(){return i.prototype.createEl.call(this,"div",{className:"vjs-load-progress",innerHTML:'<span class="vjs-control-text"><span>'+this.localize("Loaded")+'</span>: <span class="vjs-control-text-loaded-percentage">0%</span></span>'})},t.dispose=function(){this.partEls_=null,i.prototype.dispose.call(this)},t.update=function(e){var t=this.player_.liveTracker,n=this.player_.buffered(),i=t&&t.isLive()?t.seekableEnd():this.player_.duration(),r=this.player_.bufferedEnd(),s=this.partEls_,o=this.$(".vjs-control-text-loaded-percentage"),a=function(e,t,n){var i=e/t||0;return i=100*(1<=i?1:i),n&&(i=i.toFixed(2)),i+"%"};this.el_.style.width=a(r,i),j(o,a(r,i,!0));for(var l=0;l<n.length;l++){var c=n.start(l),u=n.end(l),h=s[l];h||(h=this.el_.appendChild(x()),s[l]=h),h.style.left=a(c,r),h.style.width=a(u-c,r)}for(var d=s.length;d>n.length;d--)this.el_.removeChild(s[d-1]);s.length=n.length},e}(Be);Be.registerComponent("LoadProgressBar",hi);var di=function(e){function t(){return e.apply(this,arguments)||this}f(t,e);var n=t.prototype;return n.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-time-tooltip"},{"aria-hidden":"true"})},n.update=function(e,t,n){var i=V(this.el_),r=V(this.player_.el()),s=e.width*t;if(r&&i){var o=e.left-r.left+s,a=e.width-s+(r.right-e.right),l=i.width/2;o<l?l+=l-o:a<l&&(l=a),l<0?l=0:l>i.width&&(l=i.width),this.el_.style.right="-"+l+"px",j(this.el_,n)}},n.updateTime=function(r,s,o,a){var l=this;this.rafId_&&this.cancelAnimationFrame(this.rafId_),this.rafId_=this.requestAnimationFrame(function(){var e,t=l.player_.duration();if(l.player_.liveTracker&&l.player_.liveTracker.isLive()){var n=l.player_.liveTracker.liveWindow(),i=n-s*n;e=(i<1?"":"-")+ni(i,n)}else e=ni(o,t);l.update(r,s,e),a&&a()})},t}(Be);Be.registerComponent("TimeTooltip",di);var pi=function(e){function t(){return e.apply(this,arguments)||this}f(t,e);var n=t.prototype;return n.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-play-progress vjs-slider-bar"},{"aria-hidden":"true"})},n.update=function(e,t){var n=this.getChild("timeTooltip");if(n){var i=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();n.updateTime(e,t,i)}},t}(Be);pi.prototype.options_={children:[]},Ye||Je||pi.prototype.options_.children.push("timeTooltip"),Be.registerComponent("PlayProgressBar",pi);var fi=function(i){function e(e,t){var n;return(n=i.call(this,e,t)||this).update=Ee(Ce(v(v(n)),n.update),25),n}f(e,i);var t=e.prototype;return t.createEl=function(){return i.prototype.createEl.call(this,"div",{className:"vjs-mouse-display"})},t.update=function(e,t){var n=this,i=t*this.player_.duration();this.getChild("timeTooltip").updateTime(e,t,i,function(){n.el_.style.left=e.width*t+"px"})},e}(Be);fi.prototype.options_={children:["timeTooltip"]},Be.registerComponent("MouseTimeDisplay",fi);var vi=function(i){function e(e,t){var n;return(n=i.call(this,e,t)||this).setEventHandlers_(),n}f(e,i);var t=e.prototype;return t.setEventHandlers_=function(){this.update=Ee(Ce(this,this.update),30),this.on(this.player_,"timeupdate",this.update),this.on(this.player_,"ended",this.handleEnded),this.on(this.player_,"durationchange",this.update),this.player_.liveTracker&&this.on(this.player_.liveTracker,"liveedgechange",this.update),this.updateInterval=null,this.on(this.player_,["playing"],this.enableInterval_),this.on(this.player_,["ended","pause","waiting"],this.disableInterval_),"hidden"in d&&"visibilityState"in d&&this.on(d,"visibilitychange",this.toggleVisibility_)},t.toggleVisibility_=function(e){d.hidden?this.disableInterval_(e):(this.enableInterval_(),this.requestAnimationFrame(this.update))},t.enableInterval_=function(){var e=this;this.clearInterval(this.updateInterval),this.updateInterval=this.setInterval(function(){e.requestAnimationFrame(e.update)},30)},t.disableInterval_=function(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&"ended"!==e.type||this.clearInterval(this.updateInterval)},t.createEl=function(){return i.prototype.createEl.call(this,"div",{className:"vjs-progress-holder"},{"aria-label":this.localize("Progress Bar")})},t.update_=function(e,t){var n=this.player_.liveTracker,i=this.player_.duration();n&&n.isLive()&&(i=this.player_.liveTracker.liveCurrentTime()),this.el_.setAttribute("aria-valuenow",(100*t).toFixed(2)),this.el_.setAttribute("aria-valuetext",this.localize("progress bar timing: currentTime={1} duration={2}",[ni(e,i),ni(i,i)],"{1} of {2}")),this.bar&&this.bar.update(V(this.el_),t)},t.update=function(e){if(null!==this.el().offsetParent){var t=i.prototype.update.call(this);return this.update_(this.getCurrentTime_(),t),t}},t.getCurrentTime_=function(){return this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime()},t.handleEnded=function(e){this.update_(this.player_.duration(),1)},t.getPercent=function(){var e,t=this.getCurrentTime_(),n=this.player_.liveTracker;return n&&n.isLive()?(e=(t-n.seekableStart())/n.liveWindow(),n.atLiveEdge()&&(e=1)):e=t/this.player_.duration(),1<=e?1:e||0},t.handleMouseDown=function(e){G(e)&&(e.stopPropagation(),this.player_.scrubbing(!0),this.videoWasPlaying=!this.player_.paused(),this.player_.pause(),i.prototype.handleMouseDown.call(this,e))},t.handleMouseMove=function(e){if(G(e)){var t,n=this.calculateDistance(e),i=this.player_.liveTracker;if(i&&i.isLive()){var r=i.seekableStart(),s=i.liveCurrentTime();if(s<=(t=r+n*i.liveWindow())&&(t=s),t<=r&&(t=r+.1),t===1/0)return}else(t=n*this.player_.duration())===this.player_.duration()&&(t-=.1);this.player_.currentTime(t)}},t.enable=function(){i.prototype.enable.call(this);var e=this.getChild("mouseTimeDisplay");e&&e.show()},t.disable=function(){i.prototype.disable.call(this);var e=this.getChild("mouseTimeDisplay");e&&e.hide()},t.handleMouseUp=function(e){i.prototype.handleMouseUp.call(this,e),e&&e.stopPropagation(),this.player_.scrubbing(!1),this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:!0}),this.videoWasPlaying&&St(this.player_.play())},t.stepForward=function(){this.player_.currentTime(this.player_.currentTime()+5)},t.stepBack=function(){this.player_.currentTime(this.player_.currentTime()-5)},t.handleAction=function(e){this.player_.paused()?this.player_.play():this.player_.pause()},t.handleKeyDown=function(e){if(At.isEventKey(e,"Space")||At.isEventKey(e,"Enter"))e.preventDefault(),e.stopPropagation(),this.handleAction(e);else if(At.isEventKey(e,"Home"))e.preventDefault(),e.stopPropagation(),this.player_.currentTime(0);else if(At.isEventKey(e,"End"))e.preventDefault(),e.stopPropagation(),this.player_.currentTime(this.player_.duration());else if(/^[0-9]$/.test(At(e))){e.preventDefault(),e.stopPropagation();var t=10*(At.codes[At(e)]-At.codes[0])/100;this.player_.currentTime(this.player_.duration()*t)}else At.isEventKey(e,"PgDn")?(e.preventDefault(),e.stopPropagation(),this.player_.currentTime(this.player_.currentTime()-60)):At.isEventKey(e,"PgUp")?(e.preventDefault(),e.stopPropagation(),this.player_.currentTime(this.player_.currentTime()+60)):i.prototype.handleKeyDown.call(this,e)},e}(ui);vi.prototype.options_={children:["loadProgressBar","playProgressBar"],barName:"playProgressBar"},Ye||Je||vi.prototype.options_.children.splice(1,0,"mouseTimeDisplay"),Be.registerComponent("SeekBar",vi);var gi=function(i){function e(e,t){var n;return(n=i.call(this,e,t)||this).handleMouseMove=Ee(Ce(v(v(n)),n.handleMouseMove),25),n.throttledHandleMouseSeek=Ee(Ce(v(v(n)),n.handleMouseSeek),25),n.enable(),n}f(e,i);var t=e.prototype;return t.createEl=function(){return i.prototype.createEl.call(this,"div",{className:"vjs-progress-control vjs-control"})},t.handleMouseMove=function(e){var t=this.getChild("seekBar");if(t){var n=t.getChild("mouseTimeDisplay"),i=t.el(),r=V(i),s=W(i,e).x;1<s?s=1:s<0&&(s=0),n&&n.update(r,s)}},t.handleMouseSeek=function(e){var t=this.getChild("seekBar");t&&t.handleMouseMove(e)},t.enabled=function(){return this.enabled_},t.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.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.handleMouseDown=function(e){var t=this.el_.ownerDocument,n=this.getChild("seekBar");n&&n.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.handleMouseUp=function(e){var t=this.el_.ownerDocument,n=this.getChild("seekBar");n&&n.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)},e}(Be);gi.prototype.options_={children:["seekBar"]},Be.registerComponent("ProgressControl",gi);var yi=function(i){function e(e,t){var n;return(n=i.call(this,e,t)||this).on(e,"fullscreenchange",n.handleFullscreenChange),!1===d[vt.fullscreenEnabled]&&n.disable(),n}f(e,i);var t=e.prototype;return t.buildCSSClass=function(){return"vjs-fullscreen-control "+i.prototype.buildCSSClass.call(this)},t.handleFullscreenChange=function(e){this.player_.isFullscreen()?this.controlText("Non-Fullscreen"):this.controlText("Fullscreen")},t.handleClick=function(e){this.player_.isFullscreen()?this.player_.exitFullscreen():this.player_.requestFullscreen()},e}(Yn);yi.prototype.controlText_="Fullscreen",Be.registerComponent("FullscreenToggle",yi);var _i=function(e){function t(){return e.apply(this,arguments)||this}return f(t,e),t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-volume-level",innerHTML:'<span class="vjs-control-text"></span>'})},t}(Be);Be.registerComponent("VolumeLevel",_i);var mi=function(i){function e(e,t){var n;return(n=i.call(this,e,t)||this).on("slideractive",n.updateLastVolume_),n.on(e,"volumechange",n.updateARIAAttributes),e.ready(function(){return n.updateARIAAttributes()}),n}f(e,i);var t=e.prototype;return t.createEl=function(){return i.prototype.createEl.call(this,"div",{className:"vjs-volume-bar vjs-slider-bar"},{"aria-label":this.localize("Volume Level"),"aria-live":"polite"})},t.handleMouseDown=function(e){G(e)&&i.prototype.handleMouseDown.call(this,e)},t.handleMouseMove=function(e){G(e)&&(this.checkMuted(),this.player_.volume(this.calculateDistance(e)))},t.checkMuted=function(){this.player_.muted()&&this.player_.muted(!1)},t.getPercent=function(){return this.player_.muted()?0:this.player_.volume()},t.stepForward=function(){this.checkMuted(),this.player_.volume(this.player_.volume()+.1)},t.stepBack=function(){this.checkMuted(),this.player_.volume(this.player_.volume()-.1)},t.updateARIAAttributes=function(e){var t=this.player_.muted()?0:this.volumeAsPercentage_();this.el_.setAttribute("aria-valuenow",t),this.el_.setAttribute("aria-valuetext",t+"%")},t.volumeAsPercentage_=function(){return Math.round(100*this.player_.volume())},t.updateLastVolume_=function(){var e=this,t=this.player_.volume();this.one("sliderinactive",function(){0===e.player_.volume()&&e.player_.lastVolume_(t)})},e}(ui);mi.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"},mi.prototype.playerEvent="volumechange",Be.registerComponent("VolumeBar",mi);var bi=function(s){function e(e,t){var n,i,r;return void 0===t&&(t={}),t.vertical=t.vertical||!1,("undefined"==typeof t.volumeBar||c(t.volumeBar))&&(t.volumeBar=t.volumeBar||{},t.volumeBar.vertical=t.vertical),n=s.call(this,e,t)||this,i=v(v(n)),(r=e).tech_&&!r.tech_.featuresVolumeControl&&i.addClass("vjs-hidden"),i.on(r,"loadstart",function(){r.tech_.featuresVolumeControl?i.removeClass("vjs-hidden"):i.addClass("vjs-hidden")}),n.throttledHandleMouseMove=Ee(Ce(v(v(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}f(e,s);var t=e.prototype;return t.createEl=function(){var e="vjs-volume-horizontal";return this.options_.vertical&&(e="vjs-volume-vertical"),s.prototype.createEl.call(this,"div",{className:"vjs-volume-control vjs-control "+e})},t.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.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.handleMouseMove=function(e){this.volumeBar.handleMouseMove(e)},e}(Be);bi.prototype.options_={children:["volumeBar"]},Be.registerComponent("VolumeControl",bi);var Ti=function(s){function e(e,t){var n,i,r;return n=s.call(this,e,t)||this,i=v(v(n)),(r=e).tech_&&!r.tech_.featuresMuteControl&&i.addClass("vjs-hidden"),i.on(r,"loadstart",function(){r.tech_.featuresMuteControl?i.removeClass("vjs-hidden"):i.addClass("vjs-hidden")}),n.on(e,["loadstart","volumechange"],n.update),n}f(e,s);var t=e.prototype;return t.buildCSSClass=function(){return"vjs-mute-control "+s.prototype.buildCSSClass.call(this)},t.handleClick=function(e){var t=this.player_.volume(),n=this.player_.lastVolume_();if(0===t){var i=n<.1?.1:n;this.player_.volume(i),this.player_.muted(!1)}else this.player_.muted(!this.player_.muted())},t.update=function(e){this.updateIcon_(),this.updateControlText_()},t.updateIcon_=function(){var e=this.player_.volume(),t=3;Ye&&this.player_.tech_&&this.player_.tech_.el_&&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 n=0;n<4;n++)D(this.el_,"vjs-vol-"+n);M(this.el_,"vjs-vol-"+t)},t.updateControlText_=function(){var e=this.player_.muted()||0===this.player_.volume()?"Unmute":"Mute";this.controlText()!==e&&this.controlText(e)},e}(Yn);Ti.prototype.controlText_="Mute",Be.registerComponent("MuteToggle",Ti);var ki=function(i){function e(e,t){var n;return void 0===t&&(t={}),"undefined"!=typeof t.inline?t.inline=t.inline:t.inline=!0,("undefined"==typeof t.volumeControl||c(t.volumeControl))&&(t.volumeControl=t.volumeControl||{},t.volumeControl.vertical=!t.inline),(n=i.call(this,e,t)||this).on(e,["loadstart"],n.volumePanelState_),n.on(n.volumeControl,["slideractive"],n.sliderActive_),n.on(n.volumeControl,["sliderinactive"],n.sliderInactive_),n}f(e,i);var t=e.prototype;return t.sliderActive_=function(){this.addClass("vjs-slider-active")},t.sliderInactive_=function(){this.removeClass("vjs-slider-active")},t.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.createEl=function(){var e="vjs-volume-panel-horizontal";return this.options_.inline||(e="vjs-volume-panel-vertical"),i.prototype.createEl.call(this,"div",{className:"vjs-volume-panel vjs-control "+e})},e}(Be);ki.prototype.options_={children:["muteToggle","volumeControl"]},Be.registerComponent("VolumePanel",ki);var Ci=function(i){function e(e,t){var n;return n=i.call(this,e,t)||this,t&&(n.menuButton_=t.menuButton),n.focusedChild_=-1,n.on("keydown",n.handleKeyDown),n.boundHandleBlur_=Ce(v(v(n)),n.handleBlur),n.boundHandleTapClick_=Ce(v(v(n)),n.handleTapClick),n}f(e,i);var t=e.prototype;return t.addEventListenerForItem=function(e){e instanceof Be&&(this.on(e,"blur",this.boundHandleBlur_),this.on(e,["tap","click"],this.boundHandleTapClick_))},t.removeEventListenerForItem=function(e){e instanceof Be&&(this.off(e,"blur",this.boundHandleBlur_),this.off(e,["tap","click"],this.boundHandleTapClick_))},t.removeChild=function(e){"string"==typeof e&&(e=this.getChild(e)),this.removeEventListenerForItem(e),i.prototype.removeChild.call(this,e)},t.addItem=function(e){var t=this.addChild(e);t&&this.addEventListenerForItem(t)},t.createEl=function(){var e=this.options_.contentElType||"ul";this.contentEl_=x(e,{className:"vjs-menu-content"}),this.contentEl_.setAttribute("role","menu");var t=i.prototype.createEl.call(this,"div",{append:this.contentEl_,className:"vjs-menu"});return t.appendChild(this.contentEl_),he(t,"click",function(e){e.preventDefault(),e.stopImmediatePropagation()}),t},t.dispose=function(){this.contentEl_=null,this.boundHandleBlur_=null,this.boundHandleTapClick_=null,i.prototype.dispose.call(this)},t.handleBlur=function(e){var t=e.relatedTarget||d.activeElement;if(!this.children().some(function(e){return e.el()===t})){var n=this.menuButton_;n&&n.buttonPressed_&&t!==n.el().firstChild&&n.unpressButton()}},t.handleTapClick=function(t){if(this.menuButton_){this.menuButton_.unpressButton();var e=this.children();if(!Array.isArray(e))return;var n=e.filter(function(e){return e.el()===t.target})[0];if(!n)return;"CaptionSettingsMenuItem"!==n.name()&&this.menuButton_.focus()}},t.handleKeyDown=function(e){At.isEventKey(e,"Left")||At.isEventKey(e,"Down")?(e.preventDefault(),e.stopPropagation(),this.stepForward()):(At.isEventKey(e,"Right")||At.isEventKey(e,"Up"))&&(e.preventDefault(),e.stopPropagation(),this.stepBack())},t.stepForward=function(){var e=0;void 0!==this.focusedChild_&&(e=this.focusedChild_+1),this.focus(e)},t.stepBack=function(){var e=0;void 0!==this.focusedChild_&&(e=this.focusedChild_-1),this.focus(e)},t.focus=function(e){void 0===e&&(e=0);var t=this.children().slice();t.length&&t[0].className&&/vjs-menu-title/.test(t[0].className)&&t.shift(),0<t.length&&(e<0?e=0:e>=t.length&&(e=t.length-1),t[this.focusedChild_=e].el_.focus())},e}(Be);Be.registerComponent("Menu",Ci);var Ei=function(r){function e(e,t){var n;void 0===t&&(t={}),(n=r.call(this,e,t)||this).menuButton_=new Yn(e,t),n.menuButton_.controlText(n.controlText_),n.menuButton_.el_.setAttribute("aria-haspopup","true");var i=Yn.prototype.buildCSSClass();return n.menuButton_.el_.className=n.buildCSSClass()+" "+i,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_,"keydown",n.handleKeyDown),n.on(n.menuButton_,"mouseenter",function(){n.menu.show()}),n.on("keydown",n.handleSubmenuKeyDown),n}f(e,r);var t=e.prototype;return t.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.createMenu=function(){var e=new Ci(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title){var t=x("li",{className:"vjs-menu-title",innerHTML:Re(this.options_.title),tabIndex:-1});this.hideThreshold_+=1;var n=new Be(this.player_,{el:t});e.addItem(n)}if(this.items=this.createItems(),this.items)for(var i=0;i<this.items.length;i++)e.addItem(this.items[i]);return e},t.createItems=function(){},t.createEl=function(){return r.prototype.createEl.call(this,"div",{className:this.buildWrapperCSSClass()},{})},t.buildWrapperCSSClass=function(){var e="vjs-menu-button";return!0===this.options_.inline?e+="-inline":e+="-popup","vjs-menu-button "+e+" "+Yn.prototype.buildCSSClass()+" "+r.prototype.buildCSSClass.call(this)},t.buildCSSClass=function(){var e="vjs-menu-button";return!0===this.options_.inline?e+="-inline":e+="-popup","vjs-menu-button "+e+" "+r.prototype.buildCSSClass.call(this)},t.controlText=function(e,t){return void 0===t&&(t=this.menuButton_.el()),this.menuButton_.controlText(e,t)},t.handleClick=function(e){this.buttonPressed_?this.unpressButton():this.pressButton()},t.focus=function(){this.menuButton_.focus()},t.blur=function(){this.menuButton_.blur()},t.handleKeyDown=function(e){At.isEventKey(e,"Esc")||At.isEventKey(e,"Tab")?(this.buttonPressed_&&this.unpressButton(),At.isEventKey(e,"Tab")||(e.preventDefault(),this.menuButton_.focus())):(At.isEventKey(e,"Up")||At.isEventKey(e,"Down"))&&(this.buttonPressed_||(e.preventDefault(),this.pressButton()))},t.handleSubmenuKeyPress=function(e){this.handleSubmenuKeyDown(e)},t.handleSubmenuKeyDown=function(e){(At.isEventKey(e,"Esc")||At.isEventKey(e,"Tab"))&&(this.buttonPressed_&&this.unpressButton(),At.isEventKey(e,"Tab")||(e.preventDefault(),this.menuButton_.focus()))},t.pressButton=function(){if(this.enabled_){if(this.buttonPressed_=!0,this.menu.show(),this.menu.lockShowing(),this.menuButton_.el_.setAttribute("aria-expanded","true"),Ye&&S())return;this.menu.focus()}},t.unpressButton=function(){this.enabled_&&(this.buttonPressed_=!1,this.menu.unlockShowing(),this.menu.hide(),this.menuButton_.el_.setAttribute("aria-expanded","false"))},t.disable=function(){this.unpressButton(),this.enabled_=!1,this.addClass("vjs-disabled"),this.menuButton_.disable()},t.enable=function(){this.enabled_=!0,this.removeClass("vjs-disabled"),this.menuButton_.enable()},e}(Be);Be.registerComponent("MenuButton",Ei);var Si=function(s){function e(e,t){var n,i=t.tracks;if((n=s.call(this,e,t)||this).items.length<=1&&n.hide(),!i)return v(n);var r=Ce(v(v(n)),n.update);return i.addEventListener("removetrack",r),i.addEventListener("addtrack",r),n.player_.on("ready",r),n.player_.on("dispose",function(){i.removeEventListener("removetrack",r),i.removeEventListener("addtrack",r)}),n}return f(e,s),e}(Ei);Be.registerComponent("TrackButton",Si);var wi=["Tab","Esc","Up","Down","Right","Left"],xi=function(i){function e(e,t){var n;return(n=i.call(this,e,t)||this).selectable=t.selectable,n.isSelected_=t.selected||!1,n.multiSelectable=t.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}f(e,i);var t=e.prototype;return t.createEl=function(e,t,n){return this.nonIconControl=!0,i.prototype.createEl.call(this,"li",m({className:"vjs-menu-item",innerHTML:'<span class="vjs-menu-item-text">'+this.localize(this.options_.label)+"</span>",tabIndex:-1},t),n)},t.handleKeyDown=function(t){wi.some(function(e){return At.isEventKey(t,e)})||i.prototype.handleKeyDown.call(this,t)},t.handleClick=function(e){this.selected(!0)},t.selected=function(e){this.selectable&&(this.isSelected_=e?(this.addClass("vjs-selected"),this.el_.setAttribute("aria-checked","true"),this.controlText(", selected"),!0):(this.removeClass("vjs-selected"),this.el_.setAttribute("aria-checked","false"),this.controlText(""),!1))},e}(zn);Be.registerComponent("MenuItem",xi);var ji=function(l){function e(e,t){var i,n=t.track,r=e.textTracks();t.label=n.label||n.language||"Unknown",t.selected="showing"===n.mode,(i=l.call(this,e,t)||this).track=n,i.kinds=(t.kinds||[t.kind||i.track.kind]).filter(Boolean);var s,o=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];i.handleTracksChange.apply(v(v(i)),t)},a=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];i.handleSelectedLanguageChange.apply(v(v(i)),t)};(e.on(["loadstart","texttrackchange"],o),r.addEventListener("change",o),r.addEventListener("selectedlanguagechange",a),i.on("dispose",function(){e.off(["loadstart","texttrackchange"],o),r.removeEventListener("change",o),r.removeEventListener("selectedlanguagechange",a)}),void 0===r.onchange)&&i.on(["tap","click"],function(){if("object"!=typeof h.Event)try{s=new h.Event("change")}catch(e){}s||(s=d.createEvent("Event")).initEvent("change",!0,!0),r.dispatchEvent(s)});return i.handleTracksChange(),i}f(e,l);var t=e.prototype;return t.handleClick=function(e){var t=this.track,n=this.player_.textTracks();if(l.prototype.handleClick.call(this,e),n)for(var i=0;i<n.length;i++){var r=n[i];-1!==this.kinds.indexOf(r.kind)&&(r===t?"showing"!==r.mode&&(r.mode="showing"):"disabled"!==r.mode&&(r.mode="disabled"))}},t.handleTracksChange=function(e){var t="showing"===this.track.mode;t!==this.isSelected_&&this.selected(t)},t.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.dispose=function(){this.track=null,l.prototype.dispose.call(this)},e}(xi);Be.registerComponent("TextTrackMenuItem",ji);var Pi=function(n){function e(e,t){return t.track={player:e,kind:t.kind,kinds:t.kinds,default:!1,mode:"disabled"},t.kinds||(t.kinds=[t.kind]),t.label?t.track.label=t.label:t.track.label=t.kinds.join(" and ")+" off",t.selectable=!0,t.multiSelectable=!1,n.call(this,e,t)||this}f(e,n);var t=e.prototype;return t.handleTracksChange=function(e){for(var t=this.player().textTracks(),n=!0,i=0,r=t.length;i<r;i++){var s=t[i];if(-1<this.options_.kinds.indexOf(s.kind)&&"showing"===s.mode){n=!1;break}}n!==this.isSelected_&&this.selected(n)},t.handleSelectedLanguageChange=function(e){for(var t=this.player().textTracks(),n=!0,i=0,r=t.length;i<r;i++){var s=t[i];if(-1<["captions","descriptions","subtitles"].indexOf(s.kind)&&"showing"===s.mode){n=!1;break}}n&&(this.player_.cache_.selectedLanguage={enabled:!1})},e}(ji);Be.registerComponent("OffTextTrackMenuItem",Pi);var Ai=function(n){function e(e,t){return void 0===t&&(t={}),t.tracks=e.textTracks(),n.call(this,e,t)||this}return f(e,n),e.prototype.createItems=function(e,t){var n;void 0===e&&(e=[]),void 0===t&&(t=ji),this.label_&&(n=this.label_+" off"),e.push(new Pi(this.player_,{kinds:this.kinds_,kind:this.kind_,label:n})),this.hideThreshold_+=1;var i=this.player_.textTracks();Array.isArray(this.kinds_)||(this.kinds_=[this.kind_]);for(var r=0;r<i.length;r++){var s=i[r];if(-1<this.kinds_.indexOf(s.kind)){var o=new t(this.player_,{track:s,kinds:this.kinds_,kind:this.kind_,selectable:!0,multiSelectable:!1});o.addClass("vjs-"+s.kind+"-menu-item"),e.push(o)}}return e},e}(Si);Be.registerComponent("TextTrackButton",Ai);var Mi=function(o){function e(e,t){var n,i=t.track,r=t.cue,s=e.currentTime();return t.selectable=!0,t.multiSelectable=!1,t.label=r.text,t.selected=r.startTime<=s&&s<r.endTime,(n=o.call(this,e,t)||this).track=i,n.cue=r,i.addEventListener("cuechange",Ce(v(v(n)),n.update)),n}f(e,o);var t=e.prototype;return t.handleClick=function(e){o.prototype.handleClick.call(this),this.player_.currentTime(this.cue.startTime),this.update(this.cue.startTime)},t.update=function(e){var t=this.cue,n=this.player_.currentTime();this.selected(t.startTime<=n&&n<t.endTime)},e}(xi);Be.registerComponent("ChaptersTrackMenuItem",Mi);var Di=function(i){function e(e,t,n){return i.call(this,e,t,n)||this}f(e,i);var t=e.prototype;return t.buildCSSClass=function(){return"vjs-chapters-button "+i.prototype.buildCSSClass.call(this)},t.buildWrapperCSSClass=function(){return"vjs-chapters-button "+i.prototype.buildWrapperCSSClass.call(this)},t.update=function(e){this.track_&&(!e||"addtrack"!==e.type&&"removetrack"!==e.type)||this.setTrack(this.findChaptersTrack()),i.prototype.update.call(this)},t.setTrack=function(e){if(this.track_!==e){if(this.updateHandler_||(this.updateHandler_=this.update.bind(this)),this.track_){var t=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);t&&t.removeEventListener("load",this.updateHandler_),this.track_=null}if(this.track_=e,this.track_){this.track_.mode="hidden";var n=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);n&&n.addEventListener("load",this.updateHandler_)}}},t.findChaptersTrack=function(){for(var e=this.player_.textTracks()||[],t=e.length-1;0<=t;t--){var n=e[t];if(n.kind===this.kind_)return n}},t.getMenuCaption=function(){return this.track_&&this.track_.label?this.track_.label:this.localize(Re(this.kind_))},t.createMenu=function(){return this.options_.title=this.getMenuCaption(),i.prototype.createMenu.call(this)},t.createItems=function(){var e=[];if(!this.track_)return e;var t=this.track_.cues;if(!t)return e;for(var n=0,i=t.length;n<i;n++){var r=t[n],s=new Mi(this.player_,{track:this.track_,cue:r});e.push(s)}return e},e}(Ai);Di.prototype.kind_="chapters",Di.prototype.controlText_="Chapters",Be.registerComponent("ChaptersButton",Di);var Li=function(o){function e(e,t,n){var i;i=o.call(this,e,t,n)||this;var r=e.textTracks(),s=Ce(v(v(i)),i.handleTracksChange);return r.addEventListener("change",s),i.on("dispose",function(){r.removeEventListener("change",s)}),i}f(e,o);var t=e.prototype;return t.handleTracksChange=function(e){for(var t=this.player().textTracks(),n=!1,i=0,r=t.length;i<r;i++){var s=t[i];if(s.kind!==this.kind_&&"showing"===s.mode){n=!0;break}}n?this.disable():this.enable()},t.buildCSSClass=function(){return"vjs-descriptions-button "+o.prototype.buildCSSClass.call(this)},t.buildWrapperCSSClass=function(){return"vjs-descriptions-button "+o.prototype.buildWrapperCSSClass.call(this)},e}(Ai);Li.prototype.kind_="descriptions",Li.prototype.controlText_="Descriptions",Be.registerComponent("DescriptionsButton",Li);var Ni=function(i){function e(e,t,n){return i.call(this,e,t,n)||this}f(e,i);var t=e.prototype;return t.buildCSSClass=function(){return"vjs-subtitles-button "+i.prototype.buildCSSClass.call(this)},t.buildWrapperCSSClass=function(){return"vjs-subtitles-button "+i.prototype.buildWrapperCSSClass.call(this)},e}(Ai);Ni.prototype.kind_="subtitles",Ni.prototype.controlText_="Subtitles",Be.registerComponent("SubtitlesButton",Ni);var Oi=function(i){function e(e,t){var n;return t.track={player:e,kind:t.kind,label:t.kind+" settings",selectable:!1,default:!1,mode:"disabled"},t.selectable=!1,t.name="CaptionSettingsMenuItem",(n=i.call(this,e,t)||this).addClass("vjs-texttrack-settings"),n.controlText(", opens "+t.kind+" settings dialog"),n}return f(e,i),e.prototype.handleClick=function(e){this.player().getChild("textTrackSettings").open()},e}(ji);Be.registerComponent("CaptionSettingsMenuItem",Oi);var Ii=function(i){function e(e,t,n){return i.call(this,e,t,n)||this}f(e,i);var t=e.prototype;return t.buildCSSClass=function(){return"vjs-captions-button "+i.prototype.buildCSSClass.call(this)},t.buildWrapperCSSClass=function(){return"vjs-captions-button "+i.prototype.buildWrapperCSSClass.call(this)},t.createItems=function(){var e=[];return this.player().tech_&&this.player().tech_.featuresNativeTextTracks||!this.player().getChild("textTrackSettings")||(e.push(new Oi(this.player_,{kind:this.kind_})),this.hideThreshold_+=1),i.prototype.createItems.call(this,e)},e}(Ai);Ii.prototype.kind_="captions",Ii.prototype.controlText_="Captions",Be.registerComponent("CaptionsButton",Ii);var Ri=function(r){function e(){return r.apply(this,arguments)||this}return f(e,r),e.prototype.createEl=function(e,t,n){var i='<span class="vjs-menu-item-text">'+this.localize(this.options_.label);return"captions"===this.options_.track.kind&&(i+='\n <span aria-hidden="true" class="vjs-icon-placeholder"></span>\n <span class="vjs-control-text"> '+this.localize("Captions")+"</span>\n "),i+="</span>",r.prototype.createEl.call(this,e,m({innerHTML:i},t),n)},e}(ji);Be.registerComponent("SubsCapsMenuItem",Ri);var Fi=function(i){function e(e,t){var n;return void 0===t&&(t={}),(n=i.call(this,e,t)||this).label_="subtitles",-1<["en","en-us","en-ca","fr-ca"].indexOf(n.player_.language_)&&(n.label_="captions"),n.menuButton_.controlText(Re(n.label_)),n}f(e,i);var t=e.prototype;return t.buildCSSClass=function(){return"vjs-subs-caps-button "+i.prototype.buildCSSClass.call(this)},t.buildWrapperCSSClass=function(){return"vjs-subs-caps-button "+i.prototype.buildWrapperCSSClass.call(this)},t.createItems=function(){var e=[];return this.player().tech_&&this.player().tech_.featuresNativeTextTracks||!this.player().getChild("textTrackSettings")||(e.push(new Oi(this.player_,{kind:this.label_})),this.hideThreshold_+=1),e=i.prototype.createItems.call(this,e,Ri)},e}(Ai);Fi.prototype.kinds_=["captions","subtitles"],Fi.prototype.controlText_="Subtitles",Be.registerComponent("SubsCapsButton",Fi);var Bi=function(o){function e(e,t){var i,n=t.track,r=e.audioTracks();t.label=n.label||n.language||"Unknown",t.selected=n.enabled,(i=o.call(this,e,t)||this).track=n,i.addClass("vjs-"+n.kind+"-menu-item");var s=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];i.handleTracksChange.apply(v(v(i)),t)};return r.addEventListener("change",s),i.on("dispose",function(){r.removeEventListener("change",s)}),i}f(e,o);var t=e.prototype;return t.createEl=function(e,t,n){var i='<span class="vjs-menu-item-text">'+this.localize(this.options_.label);return"main-desc"===this.options_.track.kind&&(i+='\n <span aria-hidden="true" class="vjs-icon-placeholder"></span>\n <span class="vjs-control-text"> '+this.localize("Descriptions")+"</span>\n "),i+="</span>",o.prototype.createEl.call(this,e,m({innerHTML:i},t),n)},t.handleClick=function(e){var t=this.player_.audioTracks();o.prototype.handleClick.call(this,e);for(var n=0;n<t.length;n++){var i=t[n];i.enabled=i===this.track}},t.handleTracksChange=function(e){this.selected(this.track.enabled)},e}(xi);Be.registerComponent("AudioTrackMenuItem",Bi);var Hi=function(n){function e(e,t){return void 0===t&&(t={}),t.tracks=e.audioTracks(),n.call(this,e,t)||this}f(e,n);var t=e.prototype;return t.buildCSSClass=function(){return"vjs-audio-button "+n.prototype.buildCSSClass.call(this)},t.buildWrapperCSSClass=function(){return"vjs-audio-button "+n.prototype.buildWrapperCSSClass.call(this)},t.createItems=function(e){void 0===e&&(e=[]),this.hideThreshold_=1;for(var t=this.player_.audioTracks(),n=0;n<t.length;n++){var i=t[n];e.push(new Bi(this.player_,{track:i,selectable:!0,multiSelectable:!1}))}return e},e}(Si);Hi.prototype.controlText_="Audio Track",Be.registerComponent("AudioTrackButton",Hi);var Vi=function(s){function e(e,t){var n,i=t.rate,r=parseFloat(i,10);return t.label=i,t.selected=1===r,t.selectable=!0,t.multiSelectable=!1,(n=s.call(this,e,t)||this).label=i,n.rate=r,n.on(e,"ratechange",n.update),n}f(e,s);var t=e.prototype;return t.handleClick=function(e){s.prototype.handleClick.call(this),this.player().playbackRate(this.rate)},t.update=function(e){this.selected(this.player().playbackRate()===this.rate)},e}(xi);Vi.prototype.contentElType="button",Be.registerComponent("PlaybackRateMenuItem",Vi);var zi=function(i){function e(e,t){var n;return(n=i.call(this,e,t)||this).updateVisibility(),n.updateLabel(),n.on(e,"loadstart",n.updateVisibility),n.on(e,"ratechange",n.updateLabel),n}f(e,i);var t=e.prototype;return t.createEl=function(){var e=i.prototype.createEl.call(this);return this.labelEl_=x("div",{className:"vjs-playback-rate-value",innerHTML:"1x"}),e.appendChild(this.labelEl_),e},t.dispose=function(){this.labelEl_=null,i.prototype.dispose.call(this)},t.buildCSSClass=function(){return"vjs-playback-rate "+i.prototype.buildCSSClass.call(this)},t.buildWrapperCSSClass=function(){return"vjs-playback-rate "+i.prototype.buildWrapperCSSClass.call(this)},t.createMenu=function(){var e=new Ci(this.player()),t=this.playbackRates();if(t)for(var n=t.length-1;0<=n;n--)e.addChild(new Vi(this.player(),{rate:t[n]+"x"}));return e},t.updateARIAAttributes=function(){this.el().setAttribute("aria-valuenow",this.player().playbackRate())},t.handleClick=function(e){for(var t=this.player().playbackRate(),n=this.playbackRates(),i=n[0],r=0;r<n.length;r++)if(n[r]>t){i=n[r];break}this.player().playbackRate(i)},t.playbackRates=function(){return this.options_.playbackRates||this.options_.playerOptions&&this.options_.playerOptions.playbackRates},t.playbackRateSupported=function(){return this.player().tech_&&this.player().tech_.featuresPlaybackRate&&this.playbackRates()&&0<this.playbackRates().length},t.updateVisibility=function(e){this.playbackRateSupported()?this.removeClass("vjs-hidden"):this.addClass("vjs-hidden")},t.updateLabel=function(e){this.playbackRateSupported()&&(this.labelEl_.innerHTML=this.player().playbackRate()+"x")},e}(Ei);zi.prototype.controlText_="Playback Rate",Be.registerComponent("PlaybackRateMenuButton",zi);var Wi=function(e){function t(){return e.apply(this,arguments)||this}f(t,e);var n=t.prototype;return n.buildCSSClass=function(){return"vjs-spacer "+e.prototype.buildCSSClass.call(this)},n.createEl=function(){return e.prototype.createEl.call(this,"div",{className:this.buildCSSClass()})},t}(Be);Be.registerComponent("Spacer",Wi);var Ki=function(t){function e(){return t.apply(this,arguments)||this}f(e,t);var n=e.prototype;return n.buildCSSClass=function(){return"vjs-custom-control-spacer "+t.prototype.buildCSSClass.call(this)},n.createEl=function(){var e=t.prototype.createEl.call(this,{className:this.buildCSSClass()});return e.innerHTML=" ",e},e}(Wi);Be.registerComponent("CustomControlSpacer",Ki);var Ui=function(e){function t(){return e.apply(this,arguments)||this}return f(t,e),t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-control-bar",dir:"ltr"})},t}(Be);Ui.prototype.options_={children:["playToggle","volumePanel","currentTimeDisplay","timeDivider","durationDisplay","progressControl","liveDisplay","seekToLive","remainingTimeDisplay","customControlSpacer","playbackRateMenuButton","chaptersButton","descriptionsButton","subsCapsButton","audioTrackButton","fullscreenToggle"]},Be.registerComponent("ControlBar",Ui);var qi=function(i){function e(e,t){var n;return(n=i.call(this,e,t)||this).on(e,"error",n.open),n}f(e,i);var t=e.prototype;return t.buildCSSClass=function(){return"vjs-error-display "+i.prototype.buildCSSClass.call(this)},t.content=function(){var e=this.player().error();return e?this.localize(e.message):""},e}(Dt);qi.prototype.options_=Fe(Dt.prototype.options_,{pauseOnOpen:!1,fillAlways:!0,temporary:!1,uncloseable:!0}),Be.registerComponent("ErrorDisplay",qi);var Xi="vjs-text-track-settings",$i=["#000","Black"],Gi=["#00F","Blue"],Yi=["#0FF","Cyan"],Qi=["#0F0","Green"],Ji=["#F0F","Magenta"],Zi=["#F00","Red"],er=["#FFF","White"],tr=["#FF0","Yellow"],nr=["1","Opaque"],ir=["0.5","Semi-Transparent"],rr=["0","Transparent"],sr={backgroundColor:{selector:".vjs-bg-color > select",id:"captions-background-color-%s",label:"Color",options:[$i,er,Zi,Qi,Gi,tr,Ji,Yi]},backgroundOpacity:{selector:".vjs-bg-opacity > select",id:"captions-background-opacity-%s",label:"Transparency",options:[nr,ir,rr]},color:{selector:".vjs-fg-color > select",id:"captions-foreground-color-%s",label:"Color",options:[er,$i,Zi,Qi,Gi,tr,Ji,Yi]},edgeStyle:{selector:".vjs-edge-style > select",id:"%s",label:"Text Edge Style",options:[["none","None"],["raised","Raised"],["depressed","Depressed"],["uniform","Uniform"],["dropshadow","Dropshadow"]]},fontFamily:{selector:".vjs-font-family > select",id:"captions-font-family-%s",label:"Font Family",options:[["proportionalSansSerif","Proportional Sans-Serif"],["monospaceSansSerif","Monospace Sans-Serif"],["proportionalSerif","Proportional Serif"],["monospaceSerif","Monospace Serif"],["casual","Casual"],["script","Script"],["small-caps","Small Caps"]]},fontPercent:{selector:".vjs-font-percent > select",id:"captions-font-size-%s",label:"Font Size",options:[["0.50","50%"],["0.75","75%"],["1.00","100%"],["1.25","125%"],["1.50","150%"],["1.75","175%"],["2.00","200%"],["3.00","300%"],["4.00","400%"]],default:2,parser:function(e){return"1.00"===e?null:Number(e)}},textOpacity:{selector:".vjs-text-opacity > select",id:"captions-foreground-opacity-%s",label:"Transparency",options:[nr,ir]},windowColor:{selector:".vjs-window-color > select",id:"captions-window-color-%s",label:"Color"},windowOpacity:{selector:".vjs-window-opacity > select",id:"captions-window-opacity-%s",label:"Transparency",options:[rr,ir,nr]}};function or(e,t){if(t&&(e=t(e)),e&&"none"!==e)return e}sr.windowColor.options=sr.backgroundColor.options;var ar=function(i){function e(e,t){var n;return t.temporary=!1,(n=i.call(this,e,t)||this).updateDisplay=Ce(v(v(n)),n.updateDisplay),n.fill(),n.hasBeenOpened_=n.hasBeenFilled_=!0,n.endDialog=x("p",{className:"vjs-control-text",textContent:n.localize("End of dialog window.")}),n.el().appendChild(n.endDialog),n.setDefaults(),void 0===t.persistTextTrackSettings&&(n.options_.persistTextTrackSettings=n.options_.playerOptions.persistTextTrackSettings),n.on(n.$(".vjs-done-button"),"click",function(){n.saveSettings(),n.close()}),n.on(n.$(".vjs-default-button"),"click",function(){n.setDefaults(),n.updateDisplay()}),a(sr,function(e){n.on(n.$(e.selector),"change",n.updateDisplay)}),n.options_.persistTextTrackSettings&&n.restoreSettings(),n}f(e,i);var t=e.prototype;return t.dispose=function(){this.endDialog=null,i.prototype.dispose.call(this)},t.createElSelect_=function(e,t,n){var i=this;void 0===t&&(t=""),void 0===n&&(n="label");var r=sr[e],s=r.id.replace("%s",this.id_),o=[t,s].join(" ").trim();return["<"+n+' id="'+s+'" class="'+("label"===n?"vjs-label":"")+'">',this.localize(r.label),"</"+n+">",'<select aria-labelledby="'+o+'">'].concat(r.options.map(function(e){var t=s+"-"+e[1].replace(/\W+/g,"");return['<option id="'+t+'" value="'+e[0]+'" ','aria-labelledby="'+o+" "+t+'">',i.localize(e[1]),"</option>"].join("")})).concat("</select>").join("")},t.createElFgColor_=function(){var e="captions-text-legend-"+this.id_;return['<fieldset class="vjs-fg-color vjs-track-setting">','<legend id="'+e+'">',this.localize("Text"),"</legend>",this.createElSelect_("color",e),'<span class="vjs-text-opacity vjs-opacity">',this.createElSelect_("textOpacity",e),"</span>","</fieldset>"].join("")},t.createElBgColor_=function(){var e="captions-background-"+this.id_;return['<fieldset class="vjs-bg-color vjs-track-setting">','<legend id="'+e+'">',this.localize("Background"),"</legend>",this.createElSelect_("backgroundColor",e),'<span class="vjs-bg-opacity vjs-opacity">',this.createElSelect_("backgroundOpacity",e),"</span>","</fieldset>"].join("")},t.createElWinColor_=function(){var e="captions-window-"+this.id_;return['<fieldset class="vjs-window-color vjs-track-setting">','<legend id="'+e+'">',this.localize("Window"),"</legend>",this.createElSelect_("windowColor",e),'<span class="vjs-window-opacity vjs-opacity">',this.createElSelect_("windowOpacity",e),"</span>","</fieldset>"].join("")},t.createElColors_=function(){return x("div",{className:"vjs-track-settings-colors",innerHTML:[this.createElFgColor_(),this.createElBgColor_(),this.createElWinColor_()].join("")})},t.createElFont_=function(){return x("div",{className:"vjs-track-settings-font",innerHTML:['<fieldset class="vjs-font-percent vjs-track-setting">',this.createElSelect_("fontPercent","","legend"),"</fieldset>",'<fieldset class="vjs-edge-style vjs-track-setting">',this.createElSelect_("edgeStyle","","legend"),"</fieldset>",'<fieldset class="vjs-font-family vjs-track-setting">',this.createElSelect_("fontFamily","","legend"),"</fieldset>"].join("")})},t.createElControls_=function(){var e=this.localize("restore all settings to the default values");return x("div",{className:"vjs-track-settings-controls",innerHTML:['<button type="button" class="vjs-default-button" title="'+e+'">',this.localize("Reset"),'<span class="vjs-control-text"> '+e+"</span>","</button>",'<button type="button" class="vjs-done-button">'+this.localize("Done")+"</button>"].join("")})},t.content=function(){return[this.createElColors_(),this.createElFont_(),this.createElControls_()]},t.label=function(){return this.localize("Caption Settings Dialog")},t.description=function(){return this.localize("Beginning of dialog window. Escape will cancel and close the window.")},t.buildCSSClass=function(){return i.prototype.buildCSSClass.call(this)+" vjs-text-track-settings"},t.getValues=function(){var n,i,e,o=this;return i=function(e,t,n){var i,r,s=(i=o.$(t.selector),r=t.parser,or(i.options[i.options.selectedIndex].value,r));return void 0!==s&&(e[n]=s),e},void 0===(e={})&&(e=0),r(n=sr).reduce(function(e,t){return i(e,n[t],t)},e)},t.setValues=function(n){var i=this;a(sr,function(e,t){!function(e,t,n){if(t)for(var i=0;i<e.options.length;i++)if(or(e.options[i].value,n)===t){e.selectedIndex=i;break}}(i.$(e.selector),n[t],e.parser)})},t.setDefaults=function(){var n=this;a(sr,function(e){var t=e.hasOwnProperty("default")?e.default:0;n.$(e.selector).selectedIndex=t})},t.restoreSettings=function(){var e;try{e=JSON.parse(h.localStorage.getItem(Xi))}catch(e){g.warn(e)}e&&this.setValues(e)},t.saveSettings=function(){if(this.options_.persistTextTrackSettings){var e=this.getValues();try{Object.keys(e).length?h.localStorage.setItem(Xi,JSON.stringify(e)):h.localStorage.removeItem(Xi)}catch(e){g.warn(e)}}},t.updateDisplay=function(){var e=this.player_.getChild("textTrackDisplay");e&&e.updateDisplay()},t.conditionalBlur_=function(){this.previouslyActiveEl_=null;var e=this.player_.controlBar,t=e&&e.subsCapsButton,n=e&&e.captionsButton;t?t.focus():n&&n.focus()},e}(Dt);Be.registerComponent("TextTrackSettings",ar);var lr=function(s){function e(e,t){var n,i=t.ResizeObserver||h.ResizeObserver;null===t.ResizeObserver&&(i=!1);var r=Fe({createEl:!i,reportTouchActivity:!1},t);return(n=s.call(this,e,r)||this).ResizeObserver=t.ResizeObserver||h.ResizeObserver,n.loadListener_=null,n.resizeObserver_=null,n.debouncedHandler_=function(i,r,s,o){var a;void 0===o&&(o=h);var e=function(){var e=this,t=arguments,n=function(){n=a=null,s||i.apply(e,t)};!a&&s&&i.apply(e,t),o.clearTimeout(a),a=o.setTimeout(n,r)};return e.cancel=function(){o.clearTimeout(a),a=null},e}(function(){n.resizeHandler()},100,!1,v(v(n))),i?(n.resizeObserver_=new n.ResizeObserver(n.debouncedHandler_),n.resizeObserver_.observe(e.el())):(n.loadListener_=function(){if(n.el_&&n.el_.contentWindow){var e=n.debouncedHandler_,t=n.unloadListener_=function(){de(this,"resize",e),de(this,"unload",t),t=null};he(n.el_.contentWindow,"unload",t),he(n.el_.contentWindow,"resize",e)}},n.one("load",n.loadListener_)),n}f(e,s);var t=e.prototype;return t.createEl=function(){return s.prototype.createEl.call(this,"iframe",{className:"vjs-resize-manager",tabIndex:-1},{"aria-hidden":"true"})},t.resizeHandler=function(){this.player_&&this.player_.trigger&&this.player_.trigger("playerresize")},t.dispose=function(){this.debouncedHandler_&&this.debouncedHandler_.cancel(),this.resizeObserver_&&(this.player_.el()&&this.resizeObserver_.unobserve(this.player_.el()),this.resizeObserver_.disconnect()),this.loadListener_&&this.off("load",this.loadListener_),this.el_&&this.el_.contentWindow&&this.unloadListener_&&this.unloadListener_.call(this.el_.contentWindow),this.ResizeObserver=null,this.resizeObserver=null,this.debouncedHandler_=null,this.loadListener_=null,s.prototype.dispose.call(this)},e}(Be);Be.registerComponent("ResizeManager",lr);var cr=function(r){function e(e,t){var n,i=Fe({createEl:!1},t);return(n=r.call(this,e,i)||this).reset_(),n.on(n.player_,"durationchange",n.handleDurationchange),st&&"hidden"in d&&"visibilityState"in d&&n.on(d,"visibilitychange",n.handleVisibilityChange),n}f(e,r);var t=e.prototype;return t.handleVisibilityChange=function(){this.player_.duration()===1/0&&(d.hidden?this.stopTracking():this.startTracking())},t.isBehind_=function(){if(!this.timeupdateSeen_)return!1;var e=this.liveCurrentTime(),t=this.player_.currentTime(),n=this.seekableIncrement_;return e!==1/0&&t<=e-(2*n+.07)},t.trackLive_=function(){this.pastSeekEnd_=this.pastSeekEnd_;var e=this.player_.seekable();if(e&&e.length){var t=this.seekableEnd();t!==this.lastSeekEnd_&&(this.lastSeekEnd_&&(this.seekableIncrement_=Math.abs(t-this.lastSeekEnd_)),this.pastSeekEnd_=0,this.lastSeekEnd_=t,this.trigger("seekableendchange")),this.pastSeekEnd_=this.pastSeekEnd()+.03,this.isBehind_()!==this.behindLiveEdge()&&(this.behindLiveEdge_=this.isBehind_(),this.trigger("liveedgechange"))}},t.handleDurationchange=function(){this.player_.duration()===1/0?this.startTracking():this.stopTracking()},t.startTracking=function(){var e=this;this.isTracking()||(this.trackingInterval_=this.setInterval(this.trackLive_,30),this.trackLive_(),this.on(this.player_,"play",this.trackLive_),this.on(this.player_,"pause",this.trackLive_),this.one(this.player_,"play",this.handlePlay),this.timeupdateSeen_||(this.handleTimeupdate=function(){e.timeupdateSeen_=!0,e.handleTimeupdate=null},this.one(this.player_,"timeupdate",this.handleTimeupdate)))},t.handlePlay=function(){this.one(this.player_,"timeupdate",this.seekToLiveEdge)},t.reset_=function(){this.pastSeekEnd_=0,this.lastSeekEnd_=null,this.behindLiveEdge_=null,this.timeupdateSeen_=!1,this.clearInterval(this.trackingInterval_),this.trackingInterval_=null,this.seekableIncrement_=12,this.off(this.player_,"play",this.trackLive_),this.off(this.player_,"pause",this.trackLive_),this.off(this.player_,"play",this.handlePlay),this.off(this.player_,"timeupdate",this.seekToLiveEdge),this.handleTimeupdate&&(this.off(this.player_,"timeupdate",this.handleTimeupdate),this.handleTimeupdate=null)},t.stopTracking=function(){this.isTracking()&&this.reset_()},t.seekableEnd=function(){for(var e=this.player_.seekable(),t=[],n=e?e.length:0;n--;)t.push(e.end(n));return t.length?t.sort()[t.length-1]:1/0},t.seekableStart=function(){for(var e=this.player_.seekable(),t=[],n=e?e.length:0;n--;)t.push(e.start(n));return t.length?t.sort()[0]:0},t.liveWindow=function(){var e=this.liveCurrentTime();return e===1/0?1/0:e-this.seekableStart()},t.isLive=function(){return this.isTracking()},t.atLiveEdge=function(){return!this.behindLiveEdge()},t.liveCurrentTime=function(){return this.pastSeekEnd()+this.seekableEnd()},t.pastSeekEnd=function(){return this.pastSeekEnd_},t.behindLiveEdge=function(){return this.behindLiveEdge_},t.isTracking=function(){return"number"==typeof this.trackingInterval_},t.seekToLiveEdge=function(){this.atLiveEdge()||(this.player_.currentTime(this.liveCurrentTime()),this.player_.paused()&&this.player_.play())},t.dispose=function(){this.stopTracking(),r.prototype.dispose.call(this)},e}(Be);Be.registerComponent("LiveTracker",cr);var ur=function(e){var t=e.el();if(t.hasAttribute("src"))return e.triggerSourceset(t.src),!0;var n=e.$$("source"),i=[],r="";if(!n.length)return!1;for(var s=0;s<n.length;s++){var o=n[s].src;o&&-1===i.indexOf(o)&&i.push(o)}return!!i.length&&(1===i.length&&(r=i[0]),e.triggerSourceset(r),!0)},hr=Object.defineProperty({},"innerHTML",{get:function(){return this.cloneNode(!0).innerHTML},set:function(e){var t=d.createElement(this.nodeName.toLowerCase());t.innerHTML=e;for(var n=d.createDocumentFragment();t.childNodes.length;)n.appendChild(t.childNodes[0]);return this.innerText="",h.Element.prototype.appendChild.call(this,n),this.innerHTML}}),dr=function(e,t){for(var n={},i=0;i<e.length&&!((n=Object.getOwnPropertyDescriptor(e[i],t))&&n.set&&n.get);i++);return n.enumerable=!0,n.configurable=!0,n},pr=function(s){var o=s.el();if(!o.resetSourceWatch_){var t={},e=dr([s.el(),h.HTMLMediaElement.prototype,h.Element.prototype,hr],"innerHTML"),n=function(r){return function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var i=r.apply(o,t);return ur(s),i}};["append","appendChild","insertAdjacentHTML"].forEach(function(e){o[e]&&(t[e]=o[e],o[e]=n(t[e]))}),Object.defineProperty(o,"innerHTML",Fe(e,{set:n(e.set)})),o.resetSourceWatch_=function(){o.resetSourceWatch_=null,Object.keys(t).forEach(function(e){o[e]=t[e]}),Object.defineProperty(o,"innerHTML",e)},s.one("sourceset",o.resetSourceWatch_)}},fr=Object.defineProperty({},"src",{get:function(){return this.hasAttribute("src")?$t(h.Element.prototype.getAttribute.call(this,"src")):""},set:function(e){return h.Element.prototype.setAttribute.call(this,"src",e),e}}),vr=function(i){if(i.featuresSourceset){var r=i.el();if(!r.resetSourceset_){var n=dr([i.el(),h.HTMLMediaElement.prototype,fr],"src"),s=r.setAttribute,t=r.load;Object.defineProperty(r,"src",Fe(n,{set:function(e){var t=n.set.call(r,e);return i.triggerSourceset(r.src),t}})),r.setAttribute=function(e,t){var n=s.call(r,e,t);return/src/i.test(e)&&i.triggerSourceset(r.src),n},r.load=function(){var e=t.call(r);return ur(i)||(i.triggerSourceset(""),pr(i)),e},r.currentSrc?i.triggerSourceset(r.currentSrc):ur(i)||pr(i),r.resetSourceset_=function(){r.resetSourceset_=null,r.load=t,r.setAttribute=s,Object.defineProperty(r,"src",n),r.resetSourceWatch_&&r.resetSourceWatch_()}}}};function gr(){var e=t(["Text Tracks are being loaded from another origin but the crossorigin attribute isn't used.\n This may prevent text tracks from loading."]);return gr=function(){return e},e}var yr=function(u){function a(e,t){var n;n=u.call(this,e,t)||this;var i=e.source,r=!1;if(i&&(n.el_.currentSrc!==i.src||e.tag&&3===e.tag.initNetworkState_)?n.setSource(i):n.handleLateInit_(n.el_),e.enableSourceset&&n.setupSourcesetHandling_(),n.el_.hasChildNodes()){for(var s=n.el_.childNodes,o=s.length,a=[];o--;){var l=s[o];"track"===l.nodeName.toLowerCase()&&(n.featuresNativeTextTracks?(n.remoteTextTrackEls().addTrackElement_(l),n.remoteTextTracks().addTrack(l.track),n.textTracks().addTrack(l.track),r||n.el_.hasAttribute("crossorigin")||!Yt(l.src)||(r=!0)):a.push(l))}for(var c=0;c<a.length;c++)n.el_.removeChild(a[c])}return n.proxyNativeTracks_(),n.featuresNativeTextTracks&&r&&g.warn(_(gr())),n.restoreMetadataTracksInIOSNativePlayer_(),(lt||$e||et)&&!0===e.nativeControlsForTouch&&n.setControls(!0),n.proxyWebkitFullscreen_(),n.triggerReady(),n}f(a,u);var e=a.prototype;return e.dispose=function(){this.el_&&this.el_.resetSourceset_&&this.el_.resetSourceset_(),a.disposeMediaElement(this.el_),this.options_=null,u.prototype.dispose.call(this)},e.setupSourcesetHandling_=function(){vr(this)},e.restoreMetadataTracksInIOSNativePlayer_=function(){var i,r=this.textTracks(),e=function(){i=[];for(var e=0;e<r.length;e++){var t=r[e];"metadata"===t.kind&&i.push({track:t,storedMode:t.mode})}};e(),r.addEventListener("change",e),this.on("dispose",function(){return r.removeEventListener("change",e)});var t=function e(){for(var t=0;t<i.length;t++){var n=i[t];"disabled"===n.track.mode&&n.track.mode!==n.storedMode&&(n.track.mode=n.storedMode)}r.removeEventListener("change",e)};this.on("webkitbeginfullscreen",function(){r.removeEventListener("change",e),r.removeEventListener("change",t),r.addEventListener("change",t)}),this.on("webkitendfullscreen",function(){r.removeEventListener("change",e),r.addEventListener("change",e),r.removeEventListener("change",t)})},e.overrideNative_=function(e,t){var n=this;if(t===this["featuresNative"+e+"Tracks"]){var i=e.toLowerCase();this[i+"TracksListeners_"]&&Object.keys(this[i+"TracksListeners_"]).forEach(function(e){n.el()[i+"Tracks"].removeEventListener(e,n[i+"TracksListeners_"][e])}),this["featuresNative"+e+"Tracks"]=!t,this[i+"TracksListeners_"]=null,this.proxyNativeTracksForType_(i)}},e.overrideNativeAudioTracks=function(e){this.overrideNative_("Audio",e)},e.overrideNativeVideoTracks=function(e){this.overrideNative_("Video",e)},e.proxyNativeTracksForType_=function(e){var i=this,t=Cn[e],r=this.el()[t.getterName],s=this[t.getterName]();if(this["featuresNative"+t.capitalName+"Tracks"]&&r&&r.addEventListener){var o={change:function(e){s.trigger({type:"change",target:s,currentTarget:s,srcElement:s})},addtrack:function(e){s.addTrack(e.track)},removetrack:function(e){s.removeTrack(e.track)}},n=function(){for(var e=[],t=0;t<s.length;t++){for(var n=!1,i=0;i<r.length;i++)if(r[i]===s[t]){n=!0;break}n||e.push(s[t])}for(;e.length;)s.removeTrack(e.shift())};this[t.getterName+"Listeners_"]=o,Object.keys(o).forEach(function(t){var n=o[t];r.addEventListener(t,n),i.on("dispose",function(e){return r.removeEventListener(t,n)})}),this.on("loadstart",n),this.on("dispose",function(e){return i.off("loadstart",n)})}},e.proxyNativeTracks_=function(){var t=this;Cn.names.forEach(function(e){t.proxyNativeTracksForType_(e)})},e.createEl=function(){var e=this.options_.tag;if(!e||!this.options_.playerElIngest&&!this.movingMediaElementInDOM){if(e){var t=e.cloneNode(!0);e.parentNode&&e.parentNode.insertBefore(t,e),a.disposeMediaElement(e),e=t}else{e=d.createElement("video");var n=Fe({},this.options_.tag&&O(this.options_.tag));lt&&!0===this.options_.nativeControlsForTouch||delete n.controls,N(e,m(n,{id:this.options_.techId,class:"vjs-tech"}))}e.playerId=this.options_.playerId}"undefined"!=typeof this.options_.preload&&R(e,"preload",this.options_.preload);for(var i=["loop","muted","playsinline","autoplay"],r=0;r<i.length;r++){var s=i[r],o=this.options_[s];"undefined"!=typeof o&&(o?R(e,s,s):F(e,s),e[s]=o)}return e},e.handleLateInit_=function(e){if(0!==e.networkState&&3!==e.networkState){if(0===e.readyState){var t=!1,n=function(){t=!0};this.on("loadstart",n);var i=function(){t||this.trigger("loadstart")};return this.on("loadedmetadata",i),void this.ready(function(){this.off("loadstart",n),this.off("loadedmetadata",i),t||this.trigger("loadstart")})}var r=["loadstart"];r.push("loadedmetadata"),2<=e.readyState&&r.push("loadeddata"),3<=e.readyState&&r.push("canplay"),4<=e.readyState&&r.push("canplaythrough"),this.ready(function(){r.forEach(function(e){this.trigger(e)},this)})}},e.setCurrentTime=function(e){try{this.el_.currentTime=e}catch(e){g(e,"Video is not ready. (Video.js)")}},e.duration=function(){var t=this;if(this.el_.duration===1/0&&Je&&it&&0===this.el_.currentTime){return this.on("timeupdate",function e(){0<t.el_.currentTime&&(t.el_.duration===1/0&&t.trigger("durationchange"),t.off("timeupdate",e))}),NaN}return this.el_.duration||NaN},e.width=function(){return this.el_.offsetWidth},e.height=function(){return this.el_.offsetHeight},e.proxyWebkitFullscreen_=function(){var e=this;if("webkitDisplayingFullscreen"in this.el_){var t=function(){this.trigger("fullscreenchange",{isFullscreen:!1})},n=function(){"webkitPresentationMode"in this.el_&&"picture-in-picture"!==this.el_.webkitPresentationMode&&(this.one("webkitendfullscreen",t),this.trigger("fullscreenchange",{isFullscreen:!0}))};this.on("webkitbeginfullscreen",n),this.on("dispose",function(){e.off("webkitbeginfullscreen",n),e.off("webkitendfullscreen",t)})}},e.supportsFullScreen=function(){if("function"==typeof this.el_.webkitEnterFullScreen){var e=h.navigator&&h.navigator.userAgent||"";if(/Android/.test(e)||!/Chrome|Mac OS X 10.5/.test(e))return!0}return!1},e.enterFullScreen=function(){var e=this.el_;e.paused&&e.networkState<=e.HAVE_METADATA?(this.el_.play(),this.setTimeout(function(){e.pause(),e.webkitEnterFullScreen()},0)):e.webkitEnterFullScreen()},e.exitFullScreen=function(){this.el_.webkitExitFullScreen()},e.src=function(e){if(void 0===e)return this.el_.src;this.setSrc(e)},e.reset=function(){a.resetMediaElement(this.el_)},e.currentSrc=function(){return this.currentSource_?this.currentSource_.src:this.el_.currentSrc},e.setControls=function(e){this.el_.controls=!!e},e.addTextTrack=function(e,t,n){return this.featuresNativeTextTracks?this.el_.addTextTrack(e,t,n):u.prototype.addTextTrack.call(this,e,t,n)},e.createRemoteTextTrack=function(e){if(!this.featuresNativeTextTracks)return u.prototype.createRemoteTextTrack.call(this,e);var t=d.createElement("track");return e.kind&&(t.kind=e.kind),e.label&&(t.label=e.label),(e.language||e.srclang)&&(t.srclang=e.language||e.srclang),e.default&&(t.default=e.default),e.id&&(t.id=e.id),e.src&&(t.src=e.src),t},e.addRemoteTextTrack=function(e,t){var n=u.prototype.addRemoteTextTrack.call(this,e,t);return this.featuresNativeTextTracks&&this.el().appendChild(n),n},e.removeRemoteTextTrack=function(e){if(u.prototype.removeRemoteTextTrack.call(this,e),this.featuresNativeTextTracks)for(var t=this.$$("track"),n=t.length;n--;)e!==t[n]&&e!==t[n].track||this.el().removeChild(t[n])},e.getVideoPlaybackQuality=function(){if("function"==typeof this.el().getVideoPlaybackQuality)return this.el().getVideoPlaybackQuality();var e={};return"undefined"!=typeof this.el().webkitDroppedFrameCount&&"undefined"!=typeof this.el().webkitDecodedFrameCount&&(e.droppedVideoFrames=this.el().webkitDroppedFrameCount,e.totalVideoFrames=this.el().webkitDecodedFrameCount),h.performance&&"function"==typeof h.performance.now?e.creationTime=h.performance.now():h.performance&&h.performance.timing&&"number"==typeof h.performance.timing.navigationStart&&(e.creationTime=h.Date.now()-h.performance.timing.navigationStart),e},a}(xn);if(C()){yr.TEST_VID=d.createElement("video");var _r=d.createElement("track");_r.kind="captions",_r.srclang="en",_r.label="English",yr.TEST_VID.appendChild(_r)}yr.isSupported=function(){try{yr.TEST_VID.volume=.5}catch(e){return!1}return!(!yr.TEST_VID||!yr.TEST_VID.canPlayType)},yr.canPlayType=function(e){return yr.TEST_VID.canPlayType(e)},yr.canPlaySource=function(e,t){return yr.canPlayType(e.type)},yr.canControlVolume=function(){try{var e=yr.TEST_VID.volume;return yr.TEST_VID.volume=e/2+.1,e!==yr.TEST_VID.volume}catch(e){return!1}},yr.canMuteVolume=function(){try{var e=yr.TEST_VID.muted;return yr.TEST_VID.muted=!e,yr.TEST_VID.muted?R(yr.TEST_VID,"muted","muted"):F(yr.TEST_VID,"muted"),e!==yr.TEST_VID.muted}catch(e){return!1}},yr.canControlPlaybackRate=function(){if(Je&&it&&rt<58)return!1;try{var e=yr.TEST_VID.playbackRate;return yr.TEST_VID.playbackRate=e/2+.1,e!==yr.TEST_VID.playbackRate}catch(e){return!1}},yr.canOverrideAttributes=function(){try{var e=function(){};Object.defineProperty(d.createElement("video"),"src",{get:e,set:e}),Object.defineProperty(d.createElement("audio"),"src",{get:e,set:e}),Object.defineProperty(d.createElement("video"),"innerHTML",{get:e,set:e}),Object.defineProperty(d.createElement("audio"),"innerHTML",{get:e,set:e})}catch(e){return!1}return!0},yr.supportsNativeTextTracks=function(){return at||Ye&&it},yr.supportsNativeVideoTracks=function(){return!(!yr.TEST_VID||!yr.TEST_VID.videoTracks)},yr.supportsNativeAudioTracks=function(){return!(!yr.TEST_VID||!yr.TEST_VID.audioTracks)},yr.Events=["loadstart","suspend","abort","error","emptied","stalled","loadedmetadata","loadeddata","canplay","canplaythrough","playing","waiting","seeking","seeked","ended","durationchange","timeupdate","progress","play","pause","ratechange","resize","volumechange"],yr.prototype.featuresVolumeControl=yr.canControlVolume(),yr.prototype.featuresMuteControl=yr.canMuteVolume(),yr.prototype.featuresPlaybackRate=yr.canControlPlaybackRate(),yr.prototype.featuresSourceset=yr.canOverrideAttributes(),yr.prototype.movingMediaElementInDOM=!Ye,yr.prototype.featuresFullscreenResize=!0,yr.prototype.featuresProgressEvents=!0,yr.prototype.featuresTimeupdateEvents=!0,yr.prototype.featuresNativeTextTracks=yr.supportsNativeTextTracks(),yr.prototype.featuresNativeVideoTracks=yr.supportsNativeVideoTracks(),yr.prototype.featuresNativeAudioTracks=yr.supportsNativeAudioTracks();var mr=yr.TEST_VID&&yr.TEST_VID.constructor.prototype.canPlayType,br=/^application\/(?:x-|vnd\.apple\.)mpegurl/i;function Tr(){var e=t(["\n Using the tech directly can be dangerous. I hope you know what you're doing.\n See https://github.com/videojs/video.js/issues/2617 for more info.\n "]);return Tr=function(){return e},e}yr.patchCanPlayType=function(){4<=Ze&&!tt&&!it&&(yr.TEST_VID.constructor.prototype.canPlayType=function(e){return e&&br.test(e)?"maybe":mr.call(this,e)})},yr.unpatchCanPlayType=function(){var e=yr.TEST_VID.constructor.prototype.canPlayType;return yr.TEST_VID.constructor.prototype.canPlayType=mr,e},yr.patchCanPlayType(),yr.disposeMediaElement=function(e){if(e){for(e.parentNode&&e.parentNode.removeChild(e);e.hasChildNodes();)e.removeChild(e.firstChild);e.removeAttribute("src"),"function"==typeof e.load&&function(){try{e.load()}catch(e){}}()}},yr.resetMediaElement=function(e){if(e){for(var t=e.querySelectorAll("source"),n=t.length;n--;)e.removeChild(t[n]);e.removeAttribute("src"),"function"==typeof e.load&&function(){try{e.load()}catch(e){}}()}},["muted","defaultMuted","autoplay","controls","loop","playsinline"].forEach(function(e){yr.prototype[e]=function(){return this.el_[e]||this.el_.hasAttribute(e)}}),["muted","defaultMuted","autoplay","loop","playsinline"].forEach(function(t){yr.prototype["set"+Re(t)]=function(e){(this.el_[t]=e)?this.el_.setAttribute(t,t):this.el_.removeAttribute(t)}}),["paused","currentTime","buffered","volume","poster","preload","error","seeking","seekable","ended","playbackRate","defaultPlaybackRate","played","networkState","readyState","videoWidth","videoHeight"].forEach(function(e){yr.prototype[e]=function(){return this.el_[e]}}),["volume","src","poster","preload","playbackRate","defaultPlaybackRate"].forEach(function(t){yr.prototype["set"+Re(t)]=function(e){this.el_[t]=e}}),["pause","load","play"].forEach(function(e){yr.prototype[e]=function(){return this.el_[e]()}}),xn.withSourceHandlers(yr),yr.nativeSourceHandler={},yr.nativeSourceHandler.canPlayType=function(e){try{return yr.TEST_VID.canPlayType(e)}catch(e){return""}},yr.nativeSourceHandler.canHandleSource=function(e,t){if(e.type)return yr.nativeSourceHandler.canPlayType(e.type);if(e.src){var n=Gt(e.src);return yr.nativeSourceHandler.canPlayType("video/"+n)}return""},yr.nativeSourceHandler.handleSource=function(e,t,n){t.setSrc(e.src)},yr.nativeSourceHandler.dispose=function(){},yr.registerSourceHandler(yr.nativeSourceHandler),xn.registerTech("Html5",yr);var kr=["progress","abort","suspend","emptied","stalled","loadedmetadata","loadeddata","timeupdate","resize","volumechange","texttrackchange"],Cr={canplay:"CanPlay",canplaythrough:"CanPlayThrough",playing:"Playing",seeked:"Seeked"},Er=["tiny","xsmall","small","medium","large","xlarge","huge"],Sr={};Er.forEach(function(e){var t="x"===e.charAt(0)?"x-"+e.substring(1):e;Sr[e]="vjs-layout-"+t});var wr={tiny:210,xsmall:320,small:425,medium:768,large:1440,xlarge:2560,huge:1/0},xr=function(u){function c(e,t,n){var i;if(e.id=e.id||t.id||"vjs_video_"+ee(),(t=m(c.getTagSettings(e),t)).initChildren=!1,t.createEl=!1,t.evented=!1,t.reportTouchActivity=!1,!t.language)if("function"==typeof e.closest){var r=e.closest("[lang]");r&&r.getAttribute&&(t.language=r.getAttribute("lang"))}else for(var s=e;s&&1===s.nodeType;){if(O(s).hasOwnProperty("lang")){t.language=s.getAttribute("lang");break}s=s.parentNode}if((i=u.call(this,null,t,n)||this).boundDocumentFullscreenChange_=Ce(v(v(i)),i.documentFullscreenChange_),i.boundFullWindowOnEscKey_=Ce(v(v(i)),i.fullWindowOnEscKey),i.log=y(i.id_),i.isPosterFromTech_=!1,i.queuedCallbacks_=[],i.isReady_=!1,i.hasStarted_=!1,i.userActive_=!1,!i.options_||!i.options_.techOrder||!i.options_.techOrder.length)throw new Error("No techOrder specified. Did you overwrite videojs.options instead of just changing the properties you want to override?");if(i.tag=e,i.tagAttributes=e&&O(e),i.language(i.options_.language),t.languages){var o={};Object.getOwnPropertyNames(t.languages).forEach(function(e){o[e.toLowerCase()]=t.languages[e]}),i.languages_=o}else i.languages_=c.prototype.options_.languages;i.resetCache_(),i.poster_=t.poster||"",i.controls_=!!t.controls,e.controls=!1,e.removeAttribute("controls"),i.changingSrc_=!1,i.playCallbacks_=[],i.playTerminatedQueue_=[],e.hasAttribute("autoplay")?i.autoplay(!0):i.autoplay(i.options_.autoplay),t.plugins&&Object.keys(t.plugins).forEach(function(e){if("function"!=typeof i[e])throw new Error('plugin "'+e+'" does not exist')}),i.scrubbing_=!1,i.el_=i.createEl(),Ne(v(v(i)),{eventBusKey:"el_"}),i.fluid_&&i.on("playerreset",i.updateStyleEl_);var a=Fe(i.options_);t.plugins&&Object.keys(t.plugins).forEach(function(e){i[e](t.plugins[e])}),i.options_.playerOptions=a,i.middleware_=[],i.initChildren(),i.isAudio("audio"===e.nodeName.toLowerCase()),i.controls()?i.addClass("vjs-controls-enabled"):i.addClass("vjs-controls-disabled"),i.el_.setAttribute("role","region"),i.isAudio()?i.el_.setAttribute("aria-label",i.localize("Audio Player")):i.el_.setAttribute("aria-label",i.localize("Video Player")),i.isAudio()&&i.addClass("vjs-audio"),i.flexNotSupported_()&&i.addClass("vjs-no-flex"),lt&&i.addClass("vjs-touch-enabled"),Ye||i.addClass("vjs-workinghover"),c.players[i.id_]=v(v(i));var l=p.split(".")[0];return i.addClass("vjs-v"+l),i.userActive(!0),i.reportUserActivity(),i.one("play",i.listenForUserActivity_),i.on("stageclick",i.handleStageClick_),i.on("keydown",i.handleKeyDown),i.breakpoints(i.options_.breakpoints),i.responsive(i.options_.responsive),i}f(c,u);var e=c.prototype;return e.dispose=function(){var i=this;this.trigger("dispose"),this.off("dispose"),de(d,vt.fullscreenchange,this.boundDocumentFullscreenChange_),de(d,"keydown",this.boundFullWindowOnEscKey_),this.styleEl_&&this.styleEl_.parentNode&&(this.styleEl_.parentNode.removeChild(this.styleEl_),this.styleEl_=null),c.players[this.id_]=null,this.tag&&this.tag.player&&(this.tag.player=null),this.el_&&this.el_.player&&(this.el_.player=null),this.tech_&&(this.tech_.dispose(),this.isPosterFromTech_=!1,this.poster_=""),this.playerElIngest_&&(this.playerElIngest_=null),this.tag&&(this.tag=null),Pn[this.id()]=null,Sn.names.forEach(function(e){var t=Sn[e],n=i[t.getterName]();n&&n.off&&n.off()}),u.prototype.dispose.call(this)},e.createEl=function(){var t,n=this.tag,e=this.playerElIngest_=n.parentNode&&n.parentNode.hasAttribute&&n.parentNode.hasAttribute("data-vjs-player"),i="video-js"===this.tag.tagName.toLowerCase();e?t=this.el_=n.parentNode:i||(t=this.el_=u.prototype.createEl.call(this,"div"));var r=O(n);if(i){for(t=this.el_=n,n=this.tag=d.createElement("video");t.children.length;)n.appendChild(t.firstChild);A(t,"video-js")||M(t,"video-js"),t.appendChild(n),e=this.playerElIngest_=t,Object.keys(t).forEach(function(e){n[e]=t[e]})}if(n.setAttribute("tabindex","-1"),r.tabindex="-1",st&&(n.setAttribute("role","application"),r.role="application"),n.removeAttribute("width"),n.removeAttribute("height"),"width"in r&&delete r.width,"height"in r&&delete r.height,Object.getOwnPropertyNames(r).forEach(function(e){i&&"class"===e||t.setAttribute(e,r[e]),i&&n.setAttribute(e,r[e])}),n.playerId=n.id,n.id+="_html5_api",n.className="vjs-tech",n.player=t.player=this,this.addClass("vjs-paused"),!0!==h.VIDEOJS_NO_DYNAMIC_STYLE){this.styleEl_=Te("vjs-styles-dimensions");var s=Y(".vjs-styles-defaults"),o=Y("head");o.insertBefore(this.styleEl_,s?s.nextSibling:o.firstChild)}this.fill_=!1,this.fluid_=!1,this.width(this.options_.width),this.height(this.options_.height),this.fill(this.options_.fill),this.fluid(this.options_.fluid),this.aspectRatio(this.options_.aspectRatio);for(var a=n.getElementsByTagName("a"),l=0;l<a.length;l++){var c=a.item(l);M(c,"vjs-hidden"),c.setAttribute("hidden","hidden")}return n.initNetworkState_=n.networkState,n.parentNode&&!e&&n.parentNode.insertBefore(t,n),P(n,t),this.children_.unshift(n),this.el_.setAttribute("lang",this.language_),this.el_=t},e.width=function(e){return this.dimension("width",e)},e.height=function(e){return this.dimension("height",e)},e.dimension=function(e,t){var n=e+"_";if(void 0===t)return this[n]||0;if(""===t)return this[n]=void 0,void this.updateStyleEl_();var i=parseFloat(t);isNaN(i)?g.error('Improper value "'+t+'" supplied for for '+e):(this[n]=i,this.updateStyleEl_())},e.fluid=function(e){if(void 0===e)return!!this.fluid_;var t,n;this.fluid_=!!e,we(this)&&this.off("playerreset",this.updateStyleEl_),e?(this.addClass("vjs-fluid"),this.fill(!1),we(t=function(){this.on("playerreset",this.updateStyleEl_)})?n():(t.eventedCallbacks||(t.eventedCallbacks=[]),t.eventedCallbacks.push(n))):this.removeClass("vjs-fluid"),this.updateStyleEl_()},e.fill=function(e){if(void 0===e)return!!this.fill_;this.fill_=!!e,e?(this.addClass("vjs-fill"),this.fluid(!1)):this.removeClass("vjs-fill")},e.aspectRatio=function(e){if(void 0===e)return this.aspectRatio_;if(!/^\d+\:\d+$/.test(e))throw new Error("Improper value supplied for aspect ratio. The format should be width:height, for example 16:9.");this.aspectRatio_=e,this.fluid(!0),this.updateStyleEl_()},e.updateStyleEl_=function(){if(!0!==h.VIDEOJS_NO_DYNAMIC_STYLE){var e,t,n,i=(void 0!==this.aspectRatio_&&"auto"!==this.aspectRatio_?this.aspectRatio_:0<this.videoWidth()?this.videoWidth()+":"+this.videoHeight():"16:9").split(":"),r=i[1]/i[0];e=void 0!==this.width_?this.width_:void 0!==this.height_?this.height_/r:this.videoWidth()||300,t=void 0!==this.height_?this.height_:e*r,n=/^[^a-zA-Z]/.test(this.id())?"dimensions-"+this.id():this.id()+"-dimensions",this.addClass(n),ke(this.styleEl_,"\n ."+n+" {\n width: "+e+"px;\n height: "+t+"px;\n }\n\n ."+n+".vjs-fluid {\n padding-top: "+100*r+"%;\n }\n ")}else{var s="number"==typeof this.width_?this.width_:this.options_.width,o="number"==typeof this.height_?this.height_:this.options_.height,a=this.tech_&&this.tech_.el();a&&(0<=s&&(a.width=s),0<=o&&(a.height=o))}},e.loadTech_=function(e,t){var n=this;this.tech_&&this.unloadTech_();var i=Re(e),r=e.charAt(0).toLowerCase()+e.slice(1);"Html5"!==i&&this.tag&&(xn.getTech("Html5").disposeMediaElement(this.tag),this.tag.player=null,this.tag=null),this.techName_=i,this.isReady_=!1;var s={source:t,autoplay:"string"!=typeof this.autoplay()&&this.autoplay(),nativeControlsForTouch:this.options_.nativeControlsForTouch,playerId:this.id(),techId:this.id()+"_"+r+"_api",playsinline:this.options_.playsinline,preload:this.options_.preload,loop:this.options_.loop,muted:this.options_.muted,poster:this.poster(),language:this.language(),playerElIngest:this.playerElIngest_||!1,"vtt.js":this.options_["vtt.js"],canOverridePoster:!!this.options_.techCanOverridePoster,enableSourceset:this.options_.enableSourceset};Sn.names.forEach(function(e){var t=Sn[e];s[t.getterName]=n[t.privateName]}),m(s,this.options_[i]),m(s,this.options_[r]),m(s,this.options_[e.toLowerCase()]),this.tag&&(s.tag=this.tag),t&&t.src===this.cache_.src&&0<this.cache_.currentTime&&(s.startTime=this.cache_.currentTime);var o=xn.getTech(e);if(!o)throw new Error("No Tech named '"+i+"' exists! '"+i+"' should be registered using videojs.registerTech()'");this.tech_=new o(s),this.tech_.ready(Ce(this,this.handleTechReady_),!0),jt(this.textTracksJson_||[],this.tech_),kr.forEach(function(e){n.on(n.tech_,e,n["handleTech"+Re(e)+"_"])}),Object.keys(Cr).forEach(function(t){n.on(n.tech_,t,function(e){0===n.tech_.playbackRate()&&n.tech_.seeking()?n.queuedCallbacks_.push({callback:n["handleTech"+Cr[t]+"_"].bind(n),event:e}):n["handleTech"+Cr[t]+"_"](e)})}),this.on(this.tech_,"loadstart",this.handleTechLoadStart_),this.on(this.tech_,"sourceset",this.handleTechSourceset_),this.on(this.tech_,"waiting",this.handleTechWaiting_),this.on(this.tech_,"ended",this.handleTechEnded_),this.on(this.tech_,"seeking",this.handleTechSeeking_),this.on(this.tech_,"play",this.handleTechPlay_),this.on(this.tech_,"firstplay",this.handleTechFirstPlay_),this.on(this.tech_,"pause",this.handleTechPause_),this.on(this.tech_,"durationchange",this.handleTechDurationChange_),this.on(this.tech_,"fullscreenchange",this.handleTechFullscreenChange_),this.on(this.tech_,"error",this.handleTechError_),this.on(this.tech_,"loadedmetadata",this.updateStyleEl_),this.on(this.tech_,"posterchange",this.handleTechPosterChange_),this.on(this.tech_,"textdata",this.handleTechTextData_),this.on(this.tech_,"ratechange",this.handleTechRateChange_),this.usingNativeControls(this.techGet_("controls")),this.controls()&&!this.usingNativeControls()&&this.addTechControlsListeners_(),this.tech_.el().parentNode===this.el()||"Html5"===i&&this.tag||P(this.tech_.el(),this.el()),this.tag&&(this.tag.player=null,this.tag=null)},e.unloadTech_=function(){var n=this;Sn.names.forEach(function(e){var t=Sn[e];n[t.privateName]=n[t.getterName]()}),this.textTracksJson_=xt(this.tech_),this.isReady_=!1,this.tech_.dispose(),this.tech_=!1,this.isPosterFromTech_&&(this.poster_="",this.trigger("posterchange")),this.isPosterFromTech_=!1},e.tech=function(e){return void 0===e&&g.warn(_(Tr())),this.tech_},e.addTechControlsListeners_=function(){this.removeTechControlsListeners_(),this.on(this.tech_,"mousedown",this.handleTechClick_),this.on(this.tech_,"dblclick",this.handleTechDoubleClick_),this.on(this.tech_,"touchstart",this.handleTechTouchStart_),this.on(this.tech_,"touchmove",this.handleTechTouchMove_),this.on(this.tech_,"touchend",this.handleTechTouchEnd_),this.on(this.tech_,"tap",this.handleTechTap_)},e.removeTechControlsListeners_=function(){this.off(this.tech_,"tap",this.handleTechTap_),this.off(this.tech_,"touchstart",this.handleTechTouchStart_),this.off(this.tech_,"touchmove",this.handleTechTouchMove_),this.off(this.tech_,"touchend",this.handleTechTouchEnd_),this.off(this.tech_,"mousedown",this.handleTechClick_),this.off(this.tech_,"dblclick",this.handleTechDoubleClick_)},e.handleTechReady_=function(){this.triggerReady(),this.cache_.volume&&this.techCall_("setVolume",this.cache_.volume),this.handleTechPosterChange_(),this.handleTechDurationChange_()},e.handleTechLoadStart_=function(){this.removeClass("vjs-ended"),this.removeClass("vjs-seeking"),this.error(null),this.handleTechDurationChange_(),this.paused()?(this.hasStarted(!1),this.trigger("loadstart")):(this.trigger("loadstart"),this.trigger("firstplay")),this.manualAutoplay_(this.autoplay())},e.manualAutoplay_=function(t){var i=this;if(this.tech_&&"string"==typeof t){var e,n=function(){var e=i.muted();i.muted(!0);var t=function(){i.muted(e)};i.playTerminatedQueue_.push(t);var n=i.play();if(Et(n))return n.catch(t)};if("any"===t&&!0!==this.muted()?Et(e=this.play())&&(e=e.catch(n)):e="muted"===t&&!0!==this.muted()?n():this.play(),Et(e))return e.then(function(){i.trigger({type:"autoplay-success",autoplay:t})}).catch(function(e){i.trigger({type:"autoplay-failure",autoplay:t})})}},e.updateSourceCaches_=function(e){void 0===e&&(e="");var t=e,n="";"string"!=typeof t&&(t=e.src,n=e.type),this.cache_.source=this.cache_.source||{},this.cache_.sources=this.cache_.sources||[],t&&!n&&(n=function(e,t){if(!t)return"";if(e.cache_.source.src===t&&e.cache_.source.type)return e.cache_.source.type;var n=e.cache_.sources.filter(function(e){return e.src===t});if(n.length)return n[0].type;for(var i=e.$$("source"),r=0;r<i.length;r++){var s=i[r];if(s.type&&s.src&&s.src===t)return s.type}return Bn(t)}(this,t)),this.cache_.source=Fe({},e,{src:t,type:n});for(var i=this.cache_.sources.filter(function(e){return e.src&&e.src===t}),r=[],s=this.$$("source"),o=[],a=0;a<s.length;a++){var l=O(s[a]);r.push(l),l.src&&l.src===t&&o.push(l.src)}o.length&&!i.length?this.cache_.sources=r:i.length||(this.cache_.sources=[this.cache_.source]),this.cache_.src=t},e.handleTechSourceset_=function(e){var i=this;if(!this.changingSrc_){var t=function(e){return i.updateSourceCaches_(e)},n=this.currentSource().src,r=e.src;if(n&&!/^blob:/.test(n)&&/^blob:/.test(r)&&(!this.lastSource_||this.lastSource_.tech!==r&&this.lastSource_.player!==n)&&(t=function(){}),t(r),!e.src){this.tech_.one(["sourceset","loadstart"],function e(t){if("sourceset"!==t.type){var n=i.techGet("currentSrc");i.lastSource_.tech=n,i.updateSourceCaches_(n)}i.tech_.off(["sourceset","loadstart"],e)})}}this.lastSource_={player:this.currentSource().src,tech:e.src},this.trigger({src:e.src,type:"sourceset"})},e.hasStarted=function(e){if(void 0===e)return this.hasStarted_;e!==this.hasStarted_&&(this.hasStarted_=e,this.hasStarted_?(this.addClass("vjs-has-started"),this.trigger("firstplay")):this.removeClass("vjs-has-started"))},e.handleTechPlay_=function(){this.removeClass("vjs-ended"),this.removeClass("vjs-paused"),this.addClass("vjs-playing"),this.hasStarted(!0),this.trigger("play")},e.handleTechRateChange_=function(){0<this.tech_.playbackRate()&&0===this.cache_.lastPlaybackRate&&(this.queuedCallbacks_.forEach(function(e){return e.callback(e.event)}),this.queuedCallbacks_=[]),this.cache_.lastPlaybackRate=this.tech_.playbackRate(),this.trigger("ratechange")},e.handleTechWaiting_=function(){var t=this;this.addClass("vjs-waiting"),this.trigger("waiting");var n=this.currentTime();this.on("timeupdate",function e(){n!==t.currentTime()&&(t.removeClass("vjs-waiting"),t.off("timeupdate",e))})},e.handleTechCanPlay_=function(){this.removeClass("vjs-waiting"),this.trigger("canplay")},e.handleTechCanPlayThrough_=function(){this.removeClass("vjs-waiting"),this.trigger("canplaythrough")},e.handleTechPlaying_=function(){this.removeClass("vjs-waiting"),this.trigger("playing")},e.handleTechSeeking_=function(){this.addClass("vjs-seeking"),this.trigger("seeking")},e.handleTechSeeked_=function(){this.removeClass("vjs-seeking"),this.removeClass("vjs-ended"),this.trigger("seeked")},e.handleTechFirstPlay_=function(){this.options_.starttime&&(g.warn("Passing the `starttime` option to the player will be deprecated in 6.0"),this.currentTime(this.options_.starttime)),this.addClass("vjs-has-started"),this.trigger("firstplay")},e.handleTechPause_=function(){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.trigger("pause")},e.handleTechEnded_=function(){this.addClass("vjs-ended"),this.options_.loop?(this.currentTime(0),this.play()):this.paused()||this.pause(),this.trigger("ended")},e.handleTechDurationChange_=function(){this.duration(this.techGet_("duration"))},e.handleTechClick_=function(e){G(e)&&this.controls_&&(this.paused()?St(this.play()):this.pause())},e.handleTechDoubleClick_=function(t){this.controls_&&(Array.prototype.some.call(this.$$(".vjs-control-bar, .vjs-modal-dialog"),function(e){return e.contains(t.target)})||void 0!==this.options_&&void 0!==this.options_.userActions&&void 0!==this.options_.userActions.doubleClick&&!1===this.options_.userActions.doubleClick||(void 0!==this.options_&&void 0!==this.options_.userActions&&"function"==typeof this.options_.userActions.doubleClick?this.options_.userActions.doubleClick.call(this,t):this.isFullscreen()?this.exitFullscreen():this.requestFullscreen()))},e.handleTechTap_=function(){this.userActive(!this.userActive())},e.handleTechTouchStart_=function(){this.userWasActive=this.userActive()},e.handleTechTouchMove_=function(){this.userWasActive&&this.reportUserActivity()},e.handleTechTouchEnd_=function(e){e.preventDefault()},e.handleStageClick_=function(){this.reportUserActivity()},e.toggleFullscreenClass_=function(){this.isFullscreen()?this.addClass("vjs-fullscreen"):this.removeClass("vjs-fullscreen")},e.documentFullscreenChange_=function(e){var t=vt,n=this.el(),i=d[t.fullscreenElement]===n;!i&&n.matches?i=n.matches(":"+t.fullscreen):!i&&n.msMatchesSelector&&(i=n.msMatchesSelector(":"+t.fullscreen)),this.isFullscreen(i),!1===this.isFullscreen()&&de(d,t.fullscreenchange,this.boundDocumentFullscreenChange_),_t||this.trigger("fullscreenchange")},e.handleTechFullscreenChange_=function(e,t){t&&this.isFullscreen(t.isFullscreen),this.trigger("fullscreenchange")},e.handleTechError_=function(){var e=this.tech_.error();this.error(e)},e.handleTechTextData_=function(){var e=null;1<arguments.length&&(e=arguments[1]),this.trigger("textdata",e)},e.getCache=function(){return this.cache_},e.resetCache_=function(){this.cache_={currentTime:0,inactivityTimeout:this.options_.inactivityTimeout,duration:NaN,lastVolume:1,lastPlaybackRate:this.defaultPlaybackRate(),media:null,src:"",source:{},sources:[],volume:1}},e.techCall_=function(r,s){this.ready(function(){if(r in Nn)return e=this.middleware_,t=this.tech_,i=s,t[n=r](e.reduce(In(n),i));if(r in On)return Dn(this.middleware_,this.tech_,r,s);var e,t,n,i;try{this.tech_&&this.tech_[r](s)}catch(e){throw g(e),e}},!0)},e.techGet_=function(t){if(this.tech_&&this.tech_.isReady_){if(t in Ln)return e=this.middleware_,n=this.tech_,i=t,e.reduceRight(In(i),n[i]());if(t in On)return Dn(this.middleware_,this.tech_,t);var e,n,i;try{return this.tech_[t]()}catch(e){if(void 0===this.tech_[t])throw g("Video.js: "+t+" method not defined for "+this.techName_+" playback technology.",e),e;if("TypeError"===e.name)throw g("Video.js: "+t+" unavailable on "+this.techName_+" playback technology element.",e),this.tech_.isReady_=!1,e;throw g(e),e}}},e.play=function(){var t=this,e=this.options_.Promise||h.Promise;return e?new e(function(e){t.play_(e)}):this.play_()},e.play_=function(e){var t=this;void 0===e&&(e=St),this.playCallbacks_.push(e);var n=Boolean(!this.changingSrc_&&(this.src()||this.currentSrc()));if(this.waitToPlay_&&(this.off(["ready","loadstart"],this.waitToPlay_),this.waitToPlay_=null),!this.isReady_||!n)return this.waitToPlay_=function(e){t.play_()},this.one(["ready","loadstart"],this.waitToPlay_),void(n||!at&&!Ye||this.load());var i=this.techGet_("play");null===i?this.runPlayTerminatedQueue_():this.runPlayCallbacks_(i)},e.runPlayTerminatedQueue_=function(){var e=this.playTerminatedQueue_.slice(0);this.playTerminatedQueue_=[],e.forEach(function(e){e()})},e.runPlayCallbacks_=function(t){var e=this.playCallbacks_.slice(0);this.playCallbacks_=[],this.playTerminatedQueue_=[],e.forEach(function(e){e(t)})},e.pause=function(){this.techCall_("pause")},e.paused=function(){return!1!==this.techGet_("paused")},e.played=function(){return this.techGet_("played")||dt(0,0)},e.scrubbing=function(e){if("undefined"==typeof e)return this.scrubbing_;this.scrubbing_=!!e,e?this.addClass("vjs-scrubbing"):this.removeClass("vjs-scrubbing")},e.currentTime=function(e){return"undefined"!=typeof e?(e<0&&(e=0),void this.techCall_("setCurrentTime",e)):(this.cache_.currentTime=this.techGet_("currentTime")||0,this.cache_.currentTime)},e.duration=function(e){if(void 0===e)return void 0!==this.cache_.duration?this.cache_.duration:NaN;(e=parseFloat(e))<0&&(e=1/0),e!==this.cache_.duration&&((this.cache_.duration=e)===1/0?(this.addClass("vjs-live"),this.options_.liveui&&this.player_.liveTracker&&this.addClass("vjs-liveui")):(this.removeClass("vjs-live"),this.removeClass("vjs-liveui")),isNaN(e)||this.trigger("durationchange"))},e.remainingTime=function(){return this.duration()-this.currentTime()},e.remainingTimeDisplay=function(){return Math.floor(this.duration())-Math.floor(this.currentTime())},e.buffered=function(){var e=this.techGet_("buffered");return e&&e.length||(e=dt(0,0)),e},e.bufferedPercent=function(){return pt(this.buffered(),this.duration())},e.bufferedEnd=function(){var e=this.buffered(),t=this.duration(),n=e.end(e.length-1);return t<n&&(n=t),n},e.volume=function(e){var t;return void 0!==e?(t=Math.max(0,Math.min(1,parseFloat(e))),this.cache_.volume=t,this.techCall_("setVolume",t),void(0<t&&this.lastVolume_(t))):(t=parseFloat(this.techGet_("volume")),isNaN(t)?1:t)},e.muted=function(e){if(void 0===e)return this.techGet_("muted")||!1;this.techCall_("setMuted",e)},e.defaultMuted=function(e){return void 0!==e?this.techCall_("setDefaultMuted",e):this.techGet_("defaultMuted")||!1},e.lastVolume_=function(e){if(void 0===e||0===e)return this.cache_.lastVolume;this.cache_.lastVolume=e},e.supportsFullScreen=function(){return this.techGet_("supportsFullScreen")||!1},e.isFullscreen=function(e){if(void 0!==e)return this.isFullscreen_=!!e,void this.toggleFullscreenClass_();if(_t){var t=vt,n=this.el(),i=d[t.fullscreenElement]===n;return!i&&n.matches?i=n.matches(":"+t.fullscreen):!i&&n.msMatchesSelector&&(i=n.msMatchesSelector(":"+t.fullscreen)),i}return!!this.isFullscreen_},e.requestFullscreen=function(){var e=vt;this.isFullscreen(!0),e.requestFullscreen?(he(d,e.fullscreenchange,this.boundDocumentFullscreenChange_),this.el_[e.requestFullscreen]()):this.tech_.supportsFullScreen()?this.techCall_("enterFullScreen"):(this.enterFullWindow(),this.trigger("fullscreenchange"))},e.exitFullscreen=function(){var e=vt;this.isFullscreen(!1),e.requestFullscreen?d[e.exitFullscreen]():this.tech_.supportsFullScreen()?this.techCall_("exitFullScreen"):(this.exitFullWindow(),this.trigger("fullscreenchange"))},e.enterFullWindow=function(){this.isFullWindow=!0,this.docOrigOverflow=d.documentElement.style.overflow,he(d,"keydown",this.boundFullWindowOnEscKey_),d.documentElement.style.overflow="hidden",M(d.body,"vjs-full-window"),this.trigger("enterFullWindow")},e.fullWindowOnEscKey=function(e){At.isEventKey(e,"Esc")&&(!0===this.isFullscreen()?this.exitFullscreen():this.exitFullWindow())},e.exitFullWindow=function(){this.isFullWindow=!1,de(d,"keydown",this.boundFullWindowOnEscKey_),d.documentElement.style.overflow=this.docOrigOverflow,D(d.body,"vjs-full-window"),this.trigger("exitFullWindow")},e.handleKeyDown=function(e){var t=this.options_.userActions;if(t&&t.hotkeys){var n,i;if(n=this.el_.ownerDocument.activeElement,"input"===(i=n.tagName.toLowerCase())?-1!==["button","checkbox","hidden","radio","reset","submit"].indexOf(n.type):-1===["textarea"].indexOf(i))"function"==typeof t.hotkeys?t.hotkeys.call(this,e):this.handleHotkeys(e)}},e.handleHotkeys=function(e){var t=this.options_.userActions?this.options_.userActions.hotkeys:{},n=t.fullscreenKey,i=void 0===n?function(e){return At.isEventKey(e,"f")}:n,r=t.muteKey,s=void 0===r?function(e){return At.isEventKey(e,"m")}:r,o=t.playPauseKey,a=void 0===o?function(e){return At.isEventKey(e,"k")||At.isEventKey(e,"Space")}:o;if(i.call(this,e)){e.preventDefault(),e.stopPropagation();var l=Be.getComponent("FullscreenToggle");!1!==d[vt.fullscreenEnabled]&&l.prototype.handleClick.call(this)}else if(s.call(this,e)){e.preventDefault(),e.stopPropagation(),Be.getComponent("MuteToggle").prototype.handleClick.call(this)}else if(a.call(this,e)){e.preventDefault(),e.stopPropagation(),Be.getComponent("PlayToggle").prototype.handleClick.call(this)}},e.canPlayType=function(e){for(var t,n=0,i=this.options_.techOrder;n<i.length;n++){var r=i[n],s=xn.getTech(r);if(s||(s=Be.getComponent(r)),s){if(s.isSupported()&&(t=s.canPlayType(e)))return t}else g.error('The "'+r+'" tech is undefined. Skipped browser support check for that tech.')}return""},e.selectSource=function(e){var n,i=this,t=this.options_.techOrder.map(function(e){return[e,xn.getTech(e)]}).filter(function(e){var t=e[0],n=e[1];return n?n.isSupported():(g.error('The "'+t+'" tech is undefined. Skipped browser support check for that tech.'),!1)}),r=function(e,n,i){var r;return e.some(function(t){return n.some(function(e){if(r=i(t,e))return!0})}),r},s=function(e,t){var n=e[0];if(e[1].canPlaySource(t,i.options_[n.toLowerCase()]))return{source:t,tech:n}};return(this.options_.sourceOrder?r(e,t,(n=s,function(e,t){return n(t,e)})):r(t,e,s))||!1},e.src=function(e){var r=this;if("undefined"==typeof e)return this.cache_.src||"";var s=function t(e){if(Array.isArray(e)){var n=[];e.forEach(function(e){e=t(e),Array.isArray(e)?n=n.concat(e):b(e)&&n.push(e)}),e=n}else e="string"==typeof e&&e.trim()?[Hn({src:e})]:b(e)&&"string"==typeof e.src&&e.src&&e.src.trim()?[Hn(e)]:[];return e}(e);s.length?(this.changingSrc_=!0,this.cache_.sources=s,this.updateSourceCaches_(s[0]),Mn(this,s[0],function(e,t){var n,i;if(r.middleware_=t,r.cache_.sources=s,r.updateSourceCaches_(e),r.src_(e))return 1<s.length?r.src(s.slice(1)):(r.changingSrc_=!1,r.setTimeout(function(){this.error({code:4,message:this.localize(this.options_.notSupportedMessage)})},0),void r.triggerReady());n=t,i=r.tech_,n.forEach(function(e){return e.setTech&&e.setTech(i)})})):this.setTimeout(function(){this.error({code:4,message:this.localize(this.options_.notSupportedMessage)})},0)},e.src_=function(e){var t,n,i=this,r=this.selectSource([e]);return!r||(t=r.tech,n=this.techName_,Re(t)!==Re(n)?(this.changingSrc_=!0,this.loadTech_(r.tech,r.source),this.tech_.ready(function(){i.changingSrc_=!1})):this.ready(function(){this.tech_.constructor.prototype.hasOwnProperty("setSource")?this.techCall_("setSource",e):this.techCall_("src",e.src),this.changingSrc_=!1},!0),!1)},e.load=function(){this.techCall_("load")},e.reset=function(){var e=this,t=this.options_.Promise||h.Promise;this.paused()||!t?this.doReset_():St(this.play().then(function(){return e.doReset_()}))},e.doReset_=function(){this.tech_&&this.tech_.clearTracks("text"),this.resetCache_(),this.poster(""),this.loadTech_(this.options_.techOrder[0],null),this.techCall_("reset"),this.resetControlBarUI_(),we(this)&&this.trigger("playerreset")},e.resetControlBarUI_=function(){this.resetProgressBar_(),this.resetPlaybackRate_(),this.resetVolumeBar_()},e.resetProgressBar_=function(){this.currentTime(0);var e=this.controlBar,t=e.durationDisplay,n=e.remainingTimeDisplay;t&&t.updateContent(),n&&n.updateContent()},e.resetPlaybackRate_=function(){this.playbackRate(this.defaultPlaybackRate()),this.handleTechRateChange_()},e.resetVolumeBar_=function(){this.volume(1),this.trigger("volumechange")},e.currentSources=function(){var e=this.currentSource(),t=[];return 0!==Object.keys(e).length&&t.push(e),this.cache_.sources||t},e.currentSource=function(){return this.cache_.source||{}},e.currentSrc=function(){return this.currentSource()&&this.currentSource().src||""},e.currentType=function(){return this.currentSource()&&this.currentSource().type||""},e.preload=function(e){return void 0!==e?(this.techCall_("setPreload",e),void(this.options_.preload=e)):this.techGet_("preload")},e.autoplay=function(e){if(void 0===e)return this.options_.autoplay||!1;var t;"string"==typeof e&&/(any|play|muted)/.test(e)?(this.options_.autoplay=e,this.manualAutoplay_(e),t=!1):this.options_.autoplay=!!e,t="undefined"==typeof t?this.options_.autoplay:t,this.tech_&&this.techCall_("setAutoplay",t)},e.playsinline=function(e){return void 0!==e?(this.techCall_("setPlaysinline",e),this.options_.playsinline=e,this):this.techGet_("playsinline")},e.loop=function(e){return void 0!==e?(this.techCall_("setLoop",e),void(this.options_.loop=e)):this.techGet_("loop")},e.poster=function(e){if(void 0===e)return this.poster_;e||(e=""),e!==this.poster_&&(this.poster_=e,this.techCall_("setPoster",e),this.isPosterFromTech_=!1,this.trigger("posterchange"))},e.handleTechPosterChange_=function(){if((!this.poster_||this.options_.techCanOverridePoster)&&this.tech_&&this.tech_.poster){var e=this.tech_.poster()||"";e!==this.poster_&&(this.poster_=e,this.isPosterFromTech_=!0,this.trigger("posterchange"))}},e.controls=function(e){if(void 0===e)return!!this.controls_;e=!!e,this.controls_!==e&&(this.controls_=e,this.usingNativeControls()&&this.techCall_("setControls",e),this.controls_?(this.removeClass("vjs-controls-disabled"),this.addClass("vjs-controls-enabled"),this.trigger("controlsenabled"),this.usingNativeControls()||this.addTechControlsListeners_()):(this.removeClass("vjs-controls-enabled"),this.addClass("vjs-controls-disabled"),this.trigger("controlsdisabled"),this.usingNativeControls()||this.removeTechControlsListeners_()))},e.usingNativeControls=function(e){if(void 0===e)return!!this.usingNativeControls_;e=!!e,this.usingNativeControls_!==e&&(this.usingNativeControls_=e,this.usingNativeControls_?(this.addClass("vjs-using-native-controls"),this.trigger("usingnativecontrols")):(this.removeClass("vjs-using-native-controls"),this.trigger("usingcustomcontrols")))},e.error=function(e){return void 0===e?this.error_||null:null===e?(this.error_=e,this.removeClass("vjs-error"),void(this.errorDisplay&&this.errorDisplay.close())):(this.error_=new Tt(e),this.addClass("vjs-error"),g.error("(CODE:"+this.error_.code+" "+Tt.errorTypes[this.error_.code]+")",this.error_.message,this.error_),void this.trigger("error"))},e.reportUserActivity=function(e){this.userActivity_=!0},e.userActive=function(e){if(void 0===e)return this.userActive_;if((e=!!e)!==this.userActive_){if(this.userActive_=e,this.userActive_)return this.userActivity_=!0,this.removeClass("vjs-user-inactive"),this.addClass("vjs-user-active"),void this.trigger("useractive");this.tech_&&this.tech_.one("mousemove",function(e){e.stopPropagation(),e.preventDefault()}),this.userActivity_=!1,this.removeClass("vjs-user-active"),this.addClass("vjs-user-inactive"),this.trigger("userinactive")}},e.listenForUserActivity_=function(){var t,n,i,r=Ce(this,this.reportUserActivity);this.on("mousedown",function(){r(),this.clearInterval(t),t=this.setInterval(r,250)}),this.on("mousemove",function(e){e.screenX===n&&e.screenY===i||(n=e.screenX,i=e.screenY,r())}),this.on("mouseup",function(e){r(),this.clearInterval(t)});var s,e=this.getChild("controlBar");!e||Ye||Je||(e.on("mouseenter",function(e){this.player().cache_.inactivityTimeout=this.player().options_.inactivityTimeout,this.player().options_.inactivityTimeout=0}),e.on("mouseleave",function(e){this.player().options_.inactivityTimeout=this.player().cache_.inactivityTimeout})),this.on("keydown",r),this.on("keyup",r),this.setInterval(function(){if(this.userActivity_){this.userActivity_=!1,this.userActive(!0),this.clearTimeout(s);var e=this.options_.inactivityTimeout;e<=0||(s=this.setTimeout(function(){this.userActivity_||this.userActive(!1)},e))}},250)},e.playbackRate=function(e){if(void 0===e)return this.tech_&&this.tech_.featuresPlaybackRate?this.cache_.lastPlaybackRate||this.techGet_("playbackRate"):1;this.techCall_("setPlaybackRate",e)},e.defaultPlaybackRate=function(e){return void 0!==e?this.techCall_("setDefaultPlaybackRate",e):this.tech_&&this.tech_.featuresPlaybackRate?this.techGet_("defaultPlaybackRate"):1},e.isAudio=function(e){if(void 0===e)return!!this.isAudio_;this.isAudio_=!!e},e.addTextTrack=function(e,t,n){if(this.tech_)return this.tech_.addTextTrack(e,t,n)},e.addRemoteTextTrack=function(e,t){if(this.tech_)return this.tech_.addRemoteTextTrack(e,t)},e.removeRemoteTextTrack=function(e){void 0===e&&(e={});var t=e.track;if(t||(t=e),this.tech_)return this.tech_.removeRemoteTextTrack(t)},e.getVideoPlaybackQuality=function(){return this.techGet_("getVideoPlaybackQuality")},e.videoWidth=function(){return this.tech_&&this.tech_.videoWidth&&this.tech_.videoWidth()||0},e.videoHeight=function(){return this.tech_&&this.tech_.videoHeight&&this.tech_.videoHeight()||0},e.language=function(e){if(void 0===e)return this.language_;this.language_=String(e).toLowerCase()},e.languages=function(){return Fe(c.prototype.options_.languages,this.languages_)},e.toJSON=function(){var e=Fe(this.options_),t=e.tracks;e.tracks=[];for(var n=0;n<t.length;n++){var i=t[n];(i=Fe(i)).player=void 0,e.tracks[n]=i}return e},e.createModal=function(e,t){var n=this;(t=t||{}).content=e||"";var i=new Dt(this,t);return this.addChild(i),i.on("dispose",function(){n.removeChild(i)}),i.open(),i},e.updateCurrentBreakpoint_=function(){if(this.responsive())for(var e=this.currentBreakpoint(),t=this.currentWidth(),n=0;n<Er.length;n++){var i=Er[n];if(t<=this.breakpoints_[i]){if(e===i)return;e&&this.removeClass(Sr[e]),this.addClass(Sr[i]),this.breakpoint_=i;break}}},e.removeCurrentBreakpoint_=function(){var e=this.currentBreakpointClass();this.breakpoint_="",e&&this.removeClass(e)},e.breakpoints=function(e){return void 0===e||(this.breakpoint_="",this.breakpoints_=m({},wr,e),this.updateCurrentBreakpoint_()),m(this.breakpoints_)},e.responsive=function(e){return void 0===e?this.responsive_:(e=Boolean(e))!==this.responsive_?((this.responsive_=e)?(this.on("playerresize",this.updateCurrentBreakpoint_),this.updateCurrentBreakpoint_()):(this.off("playerresize",this.updateCurrentBreakpoint_),this.removeCurrentBreakpoint_()),e):void 0},e.currentBreakpoint=function(){return this.breakpoint_},e.currentBreakpointClass=function(){return Sr[this.breakpoint_]||""},e.loadMedia=function(e,t){var n=this;if(e&&"object"==typeof e){this.reset(),this.cache_.media=Fe(e);var i=this.cache_.media,r=i.artwork,s=i.poster,o=i.src,a=i.textTracks;!r&&s&&(this.cache_.media.artwork=[{src:s,type:Bn(s)}]),o&&this.src(o),s&&this.poster(s),Array.isArray(a)&&a.forEach(function(e){return n.addRemoteTextTrack(e,!1)}),this.ready(t)}},e.getMedia=function(){if(this.cache_.media)return Fe(this.cache_.media);var e=this.poster(),t={src:this.currentSources(),textTracks:Array.prototype.map.call(this.remoteTextTracks(),function(e){return{kind:e.kind,label:e.label,language:e.language,src:e.src}})};return e&&(t.poster=e,t.artwork=[{src:t.poster,type:Bn(t.poster)}]),t},c.getTagSettings=function(e){var t={sources:[],tracks:[]},n=O(e),i=n["data-setup"];if(A(e,"vjs-fill")&&(n.fill=!0),A(e,"vjs-fluid")&&(n.fluid=!0),null!==i){var r=Ct(i||"{}"),s=r[0],o=r[1];s&&g.error(s),m(n,o)}if(m(t,n),e.hasChildNodes())for(var a=e.childNodes,l=0,c=a.length;l<c;l++){var u=a[l],h=u.nodeName.toLowerCase();"source"===h?t.sources.push(O(u)):"track"===h&&t.tracks.push(O(u))}return t},e.flexNotSupported_=function(){var e=d.createElement("i");return!("flexBasis"in e.style||"webkitFlexBasis"in e.style||"mozFlexBasis"in e.style||"msFlexBasis"in e.style||"msFlexOrder"in e.style)},c}(Be);Sn.names.forEach(function(e){var t=Sn[e];xr.prototype[t.getterName]=function(){return this.tech_?this.tech_[t.getterName]():(this[t.privateName]=this[t.privateName]||new t.ListClass,this[t.privateName])}}),xr.players={};var jr=h.navigator;xr.prototype.options_={techOrder:xn.defaultTechOrder_,html5:{},flash:{},inactivityTimeout:2e3,playbackRates:[],liveui:!1,children:["mediaLoader","posterImage","textTrackDisplay","loadingSpinner","bigPlayButton","liveTracker","controlBar","errorDisplay","textTrackSettings","resizeManager"],language:jr&&(jr.languages&&jr.languages[0]||jr.userLanguage||jr.language)||"en",languages:{},notSupportedMessage:"No compatible source was found for this media.",breakpoints:{},responsive:!1},["ended","seeking","seekable","networkState","readyState"].forEach(function(e){xr.prototype[e]=function(){return this.techGet_(e)}}),kr.forEach(function(e){xr.prototype["handleTech"+Re(e)+"_"]=function(){return this.trigger(e)}}),Be.registerComponent("Player",xr);var Pr="plugin",Ar="activePlugins_",Mr={},Dr=function(e){return Mr.hasOwnProperty(e)},Lr=function(e){return Dr(e)?Mr[e]:void 0},Nr=function(e,t){e[Ar]=e[Ar]||{},e[Ar][t]=!0},Or=function(e,t,n){var i=(n?"before":"")+"pluginsetup";e.trigger(i,t),e.trigger(i+":"+t.name,t)},Ir=function(r,s){return s.prototype.name=r,function(){Or(this,{name:r,plugin:s,instance:null},!0);for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var i=o(s,[this].concat(t));return this[r]=function(){return i},Or(this,i.getEventHash()),i}},Rr=function(){function s(e){if(this.constructor===s)throw new Error("Plugin must be sub-classed; not directly instantiated.");this.player=e,Ne(this),delete this.trigger,Ie(this,this.constructor.defaultState),Nr(e,this.name),this.dispose=Ce(this,this.dispose),e.on("dispose",this.dispose)}var e=s.prototype;return e.version=function(){return this.constructor.VERSION},e.getEventHash=function(e){return void 0===e&&(e={}),e.name=this.name,e.plugin=this.constructor,e.instance=this,e},e.trigger=function(e,t){return void 0===t&&(t={}),pe(this.eventBusEl_,e,this.getEventHash(t))},e.handleStateChanged=function(e){},e.dispose=function(){var e=this.name,t=this.player;this.trigger("dispose"),this.off(),t.off("dispose",this.dispose),t[Ar][e]=!1,this.player=this.state=null,t[e]=Ir(e,Mr[e])},s.isBasic=function(e){var t="string"==typeof e?Lr(e):e;return"function"==typeof t&&!s.prototype.isPrototypeOf(t.prototype)},s.registerPlugin=function(e,t){if("string"!=typeof e)throw new Error('Illegal plugin name, "'+e+'", must be a string, was '+typeof e+".");if(Dr(e))g.warn('A plugin named "'+e+'" already exists. You may want to avoid re-registering plugins!');else if(xr.prototype.hasOwnProperty(e))throw new Error('Illegal plugin name, "'+e+'", cannot share a name with an existing player method!');if("function"!=typeof t)throw new Error('Illegal plugin for "'+e+'", must be a function, was '+typeof t+".");var n,i,r;return Mr[e]=t,e!==Pr&&(s.isBasic(t)?xr.prototype[e]=(n=e,i=t,r=function(){Or(this,{name:n,plugin:i,instance:null},!0);var e=i.apply(this,arguments);return Nr(this,n),Or(this,{name:n,plugin:i,instance:e}),e},Object.keys(i).forEach(function(e){r[e]=i[e]}),r):xr.prototype[e]=Ir(e,t)),t},s.deregisterPlugin=function(e){if(e===Pr)throw new Error("Cannot de-register base plugin.");Dr(e)&&(delete Mr[e],delete xr.prototype[e])},s.getPlugins=function(e){var n;return void 0===e&&(e=Object.keys(Mr)),e.forEach(function(e){var t=Lr(e);t&&((n=n||{})[e]=t)}),n},s.getPluginVersion=function(e){var t=Lr(e);return t&&t.VERSION||""},s}();Rr.getPlugin=Lr,Rr.BASE_PLUGIN_NAME=Pr,Rr.registerPlugin(Pr,Rr),xr.prototype.usingPlugin=function(e){return!!this[Ar]&&!0===this[Ar][e]},xr.prototype.hasPlugin=function(e){return!!Dr(e)};var Fr=function(e){return 0===e.indexOf("#")?e.slice(1):e};function Br(e,n,t){var i=Br.getPlayer(e);if(i)return n&&g.warn('Player "'+e+'" is already initialised. Options will not be applied.'),t&&i.ready(t),i;var r="string"==typeof e?Y("#"+Fr(e)):e;if(!E(r))throw new TypeError("The element or ID supplied is not valid. (videojs)");r.ownerDocument.defaultView&&r.ownerDocument.body.contains(r)||g.warn("The element supplied is not included in the DOM"),n=n||{},Br.hooks("beforesetup").forEach(function(e){var t=e(r,Fe(n));b(t)&&!Array.isArray(t)?n=Fe(n,t):g.error("please return an object in beforesetup hooks")});var s=Be.getComponent("Player");return i=new s(r,n,t),Br.hooks("setup").forEach(function(e){return e(i)}),i}if(Br.hooks_={},Br.hooks=function(e,t){return Br.hooks_[e]=Br.hooks_[e]||[],t&&(Br.hooks_[e]=Br.hooks_[e].concat(t)),Br.hooks_[e]},Br.hook=function(e,t){Br.hooks(e,t)},Br.hookOnce=function(n,e){Br.hooks(n,[].concat(e).map(function(t){return function e(){return Br.removeHook(n,e),t.apply(void 0,arguments)}}))},Br.removeHook=function(e,t){var n=Br.hooks(e).indexOf(t);return!(n<=-1)&&(Br.hooks_[e]=Br.hooks_[e].slice(),Br.hooks_[e].splice(n,1),!0)},!0!==h.VIDEOJS_NO_DYNAMIC_STYLE&&C()){var Hr=Y(".vjs-styles-defaults");if(!Hr){Hr=Te("vjs-styles-defaults");var Vr=Y("head");Vr&&Vr.insertBefore(Hr,Vr.firstChild),ke(Hr,"\n .video-js {\n width: 300px;\n height: 150px;\n }\n\n .vjs-fluid {\n padding-top: 56.25%\n }\n ")}}return me(1,Br),Br.VERSION=p,Br.options=xr.prototype.options_,Br.getPlayers=function(){return xr.players},Br.getPlayer=function(e){var t,n=xr.players;if("string"==typeof e){var i=Fr(e),r=n[i];if(r)return r;t=Y("#"+i)}else t=e;if(E(t)){var s=t,o=s.player,a=s.playerId;if(o||n[a])return o||n[a]}},Br.getAllPlayers=function(){return Object.keys(xr.players).map(function(e){return xr.players[e]}).filter(Boolean)},Br.players=xr.players,Br.getComponent=Be.getComponent,Br.registerComponent=function(e,t){xn.isTech(t)&&g.warn("The "+e+" tech was registered as a component. It should instead be registered using videojs.registerTech(name, tech)"),Be.registerComponent.call(Be,e,t)},Br.getTech=xn.getTech,Br.registerTech=xn.registerTech,Br.use=function(e,t){jn[e]=jn[e]||[],jn[e].push(t)},Object.defineProperty(Br,"middleware",{value:{},writeable:!1,enumerable:!0}),Object.defineProperty(Br.middleware,"TERMINATOR",{value:An,writeable:!1,enumerable:!0}),Br.browser=ct,Br.TOUCH_ENABLED=lt,Br.extend=function(e,t){void 0===t&&(t={});var n=function(){e.apply(this,arguments)},i={};for(var r in"object"==typeof t?(t.constructor!==Object.prototype.constructor&&(n=t.constructor),i=t):"function"==typeof t&&(n=t),function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(e.super_=t)}(n,e),i)i.hasOwnProperty(r)&&(n.prototype[r]=i[r]);return n},Br.mergeOptions=Fe,Br.bind=Ce,Br.registerPlugin=Rr.registerPlugin,Br.deregisterPlugin=Rr.deregisterPlugin,Br.plugin=function(e,t){return g.warn("videojs.plugin() is deprecated; use videojs.registerPlugin() instead"),Rr.registerPlugin(e,t)},Br.getPlugins=Rr.getPlugins,Br.getPlugin=Rr.getPlugin,Br.getPluginVersion=Rr.getPluginVersion,Br.addLanguage=function(e,t){var n;return e=(""+e).toLowerCase(),Br.options.languages=Fe(Br.options.languages,((n={})[e]=t,n)),Br.options.languages[e]},Br.log=g,Br.createLogger=y,Br.createTimeRange=Br.createTimeRanges=dt,Br.formatTime=ni,Br.setFormatTime=function(e){ti=e},Br.resetFormatTime=function(){ti=ei},Br.parseUrl=Xt,Br.isCrossOrigin=Yt,Br.EventTarget=Se,Br.on=he,Br.one=fe,Br.off=de,Br.trigger=pe,Br.xhr=fn,Br.TextTrack=mn,Br.AudioTrack=bn,Br.VideoTrack=Tn,["isEl","isTextNode","createEl","hasClass","addClass","removeClass","toggleClass","setAttributes","getAttributes","emptyEl","appendContent","insertContent"].forEach(function(e){Br[e]=function(){return g.warn("videojs."+e+"() is deprecated; use videojs.dom."+e+"() instead"),J[e].apply(null,arguments)}}),Br.computedStyle=i,Br.dom=J,Br.url=Qt,Br});