!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,e.videojs=t(e.window,e.document))}(this,function(e,t){function n(e){var t,r="info",i=function(){for(var e=arguments.length,n=new Array(e),i=0;i1?t-1:0),i=1;i0)for(var n=e.attributes,r=n.length-1;r>=0;r--){var i=n[r].name,a=n[r].value;"boolean"!=typeof e[i]&&-1===",autoplay,stretch,fluent,controls,playsinline,loop,muted,default,defaultMuted,".indexOf(","+i+",")||(a=null!==a),t[i]=a}return t}function E(e,t){return e.getAttribute(t)}function A(e,t,n){e.setAttribute(t,n)}function C(e,t){e.removeAttribute(t)}function L(){t.body.focus(),t.onselectstart=function(){return!1}}function x(){t.onselectstart=function(){return!0}}function j(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(u(e,"height"))),n.width||(n.width=parseFloat(u(e,"width"))),n}}function O(n){var r;if(n.getBoundingClientRect&&n.parentNode&&(r=n.getBoundingClientRect()),!r)return{left:0,top:0};var i=t.documentElement,a=t.body,o=i.clientLeft||a.clientLeft||0,s=e.pageXOffset||a.scrollLeft,u=r.left+s-o,l=i.clientTop||a.clientTop||0,c=e.pageYOffset||a.scrollTop,d=r.top+c-l;return{left:Math.round(u),top:Math.round(d)}}function I(e,t){var n={},r=O(e),i=e.offsetWidth,a=e.offsetHeight,o=r.top,s=r.left,u=t.pageY,l=t.pageX;return t.changedTouches&&(l=t.changedTouches[0].pageX,u=t.changedTouches[0].pageY),n.y=Math.max(0,Math.min(1,(o-u+a)/a)),n.x=Math.max(0,Math.min(1,(l-s)/i)),n}function P(e){return o(e)&&3===e.nodeType}function R(e){for(;e.firstChild;)e.removeChild(e.firstChild);return e}function D(e){return"function"==typeof e&&(e=e()),(Array.isArray(e)?e:[e]).map(function(e){return"function"==typeof e&&(e=e()),h(e)||P(e)?e:"string"==typeof e&&/\S/.test(e)?t.createTextNode(e):void 0}).filter(function(e){return e})}function M(e,t){return D(t).forEach(function(t){return e.appendChild(t)}),e}function U(e,t){return M(R(e),t)}function B(e){return void 0===e.button&&void 0===e.buttons||0===e.button&&void 0===e.buttons||"mouseup"===e.type&&0===e.button&&0===e.buttons||0===e.button&&1===e.buttons}function N(){return xt++}function F(e,t){if(Lt.has(e)){var n=Lt.get(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&&Lt.delete(e)}}function V(e,t,n,r){n.forEach(function(n){e(t,n,r)})}function q(n){function r(){return!0}function i(){return!1}if(!n||!n.isPropagationStopped){var a=n||e.event;n={};for(var o in a)"layerX"!==o&&"layerY"!==o&&"keyLocation"!==o&&"webkitMovementX"!==o&&"webkitMovementY"!==o&&("returnValue"===o&&a.preventDefault||(n[o]=a[o]));if(n.target||(n.target=n.srcElement||t),n.relatedTarget||(n.relatedTarget=n.fromElement===n.target?n.toElement:n.fromElement),n.preventDefault=function(){a.preventDefault&&a.preventDefault(),n.returnValue=!1,a.returnValue=!1,n.defaultPrevented=!0},n.defaultPrevented=!1,n.stopPropagation=function(){a.stopPropagation&&a.stopPropagation(),n.cancelBubble=!0,a.cancelBubble=!0,n.isPropagationStopped=r},n.isPropagationStopped=i,n.stopImmediatePropagation=function(){a.stopImmediatePropagation&&a.stopImmediatePropagation(),n.isImmediatePropagationStopped=r,n.stopPropagation()},n.isImmediatePropagationStopped=i,null!==n.clientX&&void 0!==n.clientX){var s=t.documentElement,u=t.body;n.pageX=n.clientX+(s&&s.scrollLeft||u&&u.scrollLeft||0)-(s&&s.clientLeft||u&&u.clientLeft||0),n.pageY=n.clientY+(s&&s.scrollTop||u&&u.scrollTop||0)-(s&&s.clientTop||u&&u.clientTop||0)}n.which=n.charCode||n.keyCode,null!==n.button&&void 0!==n.button&&(n.button=1&n.button?0:4&n.button?1:2&n.button?2:0)}return n}function G(e,t,n){if(Array.isArray(t))return V(G,e,t,n);Lt.has(e)||Lt.set(e,{});var r=Lt.get(e);if(r.handlers||(r.handlers={}),r.handlers[t]||(r.handlers[t]=[]),n.guid||(n.guid=N()),r.handlers[t].push(n),r.dispatcher||(r.disabled=!1,r.dispatcher=function(t,n){if(!r.disabled){t=q(t);var i=r.handlers[t.type];if(i)for(var a=i.slice(0),o=0,s=a.length;o-1&&(i={passive:!0}),e.addEventListener(t,r.dispatcher,i)}else e.attachEvent&&e.attachEvent("on"+t,r.dispatcher)}function H(e,t,n){if(Lt.has(e)){var r=Lt.get(e);if(r.handlers){if(Array.isArray(t))return V(H,e,t,n);var i=function(e,t){r.handlers[t]=[],F(e,t)};if(void 0!==t){var a=r.handlers[t];if(a){if(!n)return void i(e,t);if(n.guid)for(var o=0;on)throw new Error("Failed to execute '"+e+"' on 'TimeRanges': The index provided ("+t+") is non-numeric or out of bounds (0-"+n+").")}function ie(e,t,n,r){return re(e,r,n.length-1),n[r][t]}function ae(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:ie.bind(null,"start",0,e),end:ie.bind(null,"end",1,e)}}function oe(e,t){return Array.isArray(e)?ae(e):void 0===e||void 0===t?ae():ae([[e,t]])}function se(e,t){var n,r,i=0;if(!t)return 0;e&&e.length||(e=oe(0,0));for(var a=0;at&&(r=t),i+=r-n;return i/t}function ue(e){if(e instanceof ue)return e;"number"==typeof e?this.code=e:"string"==typeof e?this.message=e:o(e)&&("number"==typeof e.code&&(this.code=e.code),a(this,e)),this.message||(this.message=ue.defaultMessages[this.code]||"")}function le(e,t){var n,r=null;try{n=JSON.parse(e,t)}catch(e){r=e}return[r,n]}function ce(e){return void 0!==e&&null!==e&&"function"==typeof e.then}function de(e){ce(e)&&e.then(null,function(e){})}function fe(e,t){return t={exports:{}},e(t,t.exports),t.exports}function he(e){var t=ur.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)}function pe(){for(var e={},t=0;t0&&(c=setTimeout(function(){if(!l){l=!0,s.abort("timeout");var e=new Error("XMLHttpRequest timeout");e.code="ETIMEDOUT",r(e)}},e.timeout)),s.setRequestHeader)for(u in p)p.hasOwnProperty(u)&&s.setRequestHeader(u,p[u]);else if(e.headers&&!me(e.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in e&&(s.responseType=e.responseType),"beforeSend"in e&&"function"==typeof e.beforeSend&&e.beforeSend(s),s.send(h||null),s}function _e(e){if("document"===e.responseType)return e.responseXML;var t=e.responseXML&&"parsererror"===e.responseXML.documentElement.nodeName;return""!==e.responseType||t?null:e.responseXML}function be(){}function Te(e,t){this.name="ParsingError",this.code=e.code,this.message=t||e.message}function Se(e){function t(e,t,n,r){return 3600*(0|e)+60*(0|t)+(0|n)+(0|r)/1e3}var n=e.match(/^(\d+):(\d{2})(:\d{2})?\.(\d{3})/);return n?n[3]?t(n[1],n[2],n[3].replace(":",""),n[4]):n[1]>59?t(n[1],n[2],0,n[4]):t(0,n[1],n[2],n[4]):null}function we(){this.values=Ji(null)}function ke(e,t,n,r){var i=r?e.split(r):[e];for(var a in i)if("string"==typeof i[a]){var o=i[a].split(n);if(2===o.length){var s=o[0],u=o[1];t(s,u)}}}function Ee(e,t,n){function r(){var t=Se(e);if(null===t)throw new Te(Te.Errors.BadTimeStamp,"Malformed timestamp: "+a);return e=e.replace(/^[^\sa-zA-Z-]+/,""),t}function i(){e=e.replace(/^\s+/,"")}var a=e;if(i(),t.startTime=r(),i(),"--\x3e"!==e.substr(0,3))throw new Te(Te.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '--\x3e'): "+a);e=e.substr(3),i(),t.endTime=r(),i(),function(e,t){var r=new we;ke(e,function(e,t){switch(e){case"region":for(var i=n.length-1;i>=0;i--)if(n[i].id===t){r.set(e,n[i].region);break}break;case"vertical":r.alt(e,t,["rl","lr"]);break;case"line":var a=t.split(","),o=a[0];r.integer(e,o),r.percent(e,o)&&r.set("snapToLines",!1),r.alt(e,o,["auto"]),2===a.length&&r.alt("lineAlign",a[1],["start","middle","end"]);break;case"position":a=t.split(","),r.percent(e,a[0]),2===a.length&&r.alt("positionAlign",a[1],["start","middle","end"]);break;case"size":r.percent(e,t);break;case"align":r.alt(e,t,["start","middle","end","left","right"])}},/:/,/\s/),t.region=r.get("region",null),t.vertical=r.get("vertical",""),t.line=r.get("line","auto"),t.lineAlign=r.get("lineAlign","start"),t.snapToLines=r.get("snapToLines",!0),t.size=r.get("size",100),t.align=r.get("align","middle"),t.position=r.get("position",{start:0,left:0,middle:50,end:100,right:100},t.align),t.positionAlign=r.get("positionAlign",{start:"start",left:"start",middle:"middle",end:"end",right:"end"},t.align)}(e,t)}function Ae(e,t){function n(e){return Qi[e]}for(var r,i=e.document.createElement("div"),a=i,o=[];null!==(r=function(){if(!t)return null;var e=t.match(/^([^<]*)(<[^>]*>?)?/);return function(e){return t=t.substr(e.length),e}(e[1]?e[1]:e[2])}());)if("<"!==r[0])a.appendChild(e.document.createTextNode(function(e){for(;l=e.match(/&(amp|lt|gt|lrm|rlm|nbsp);/);)e=e.replace(l[0],n);return e}(r)));else{if("/"===r[1]){o.length&&o[o.length-1]===r.substr(2).replace(">","")&&(o.pop(),a=a.parentNode);continue}var s,u=Se(r.substr(1,r.length-2));if(u){s=e.document.createProcessingInstruction("timestamp",u),a.appendChild(s);continue}var l=r.match(/^<([^.\s\/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!l)continue;if(!(s=function(t,n){var r=Zi[t];if(!r)return null;var i=e.document.createElement(r);i.localName=r;var a=ea[t];return a&&n&&(i[a]=n.trim()),i}(l[1],l[3])))continue;if(!function(e,t){return!ta[t.localName]||ta[t.localName]===e.localName}(a,s))continue;l[2]&&(s.className=l[2].substr(1).replace("."," ")),o.push(l[1]),a.appendChild(s),a=s}return i}function Ce(e){for(var t=0;t=n[0]&&e<=n[1])return!0}return!1}function Le(e){function t(e,t){for(var n=t.childNodes.length-1;n>=0;n--)e.push(t.childNodes[n])}function n(e){if(!e||!e.length)return null;var r=e.pop(),i=r.textContent||r.innerText;if(i){var a=i.match(/^.*(\n|\r)/);return a?(e.length=0,a[0]):i}return"ruby"===r.tagName?n(e):r.childNodes?(t(e,r),n(e)):void 0}var r,i=[],a="";if(!e||!e.childNodes)return"ltr";for(t(i,e);a=n(i);)for(var o=0;o=0&&e.line<=100))return e.line;if(!e.track||!e.track.textTrackList||!e.track.textTrackList.mediaElement)return-1;for(var t=e.track,n=t.textTrackList,r=0,i=0;id&&(c=c<0?-1:1,c*=Math.ceil(d/l)*l),o<0&&(c+=""===a.vertical?n.height:n.width,s=s.reverse()),i.move(f,c)}else{var h=i.lineHeight/n.height*100;switch(a.lineAlign){case"middle":o-=h/2;break;case"end":o-=h}switch(a.vertical){case"":t.applyStyles({top:t.formatStyle(o,"%")});break;case"rl":t.applyStyles({left:t.formatStyle(o,"%")});break;case"lr":t.applyStyles({right:t.formatStyle(o,"%")})}s=["+y","-x","+x","-y"],i=new Ie(t)}var p=function(e,t){for(var i,a=new Ie(e),o=1,s=0;su&&(i=new Ie(e),o=u),e=new Ie(a)}return i||a}(i,s);t.move(p.toCSSCompatValues(n))}function Re(){}function De(e){return"string"==typeof e&&!!aa[e.toLowerCase()]&&e.toLowerCase()}function Me(e){return"string"==typeof e&&!!oa[e.toLowerCase()]&&e.toLowerCase()}function Ue(e,t,n){this.hasBeenReset=!1;var r="",i=!1,a=e,o=t,s=n,u=null,l="",c=!0,d="auto",f="start",h=50,p="middle",m=50,v="middle";Object.defineProperties(this,{id:{enumerable:!0,get:function(){return r},set:function(e){r=""+e}},pauseOnExit:{enumerable:!0,get:function(){return i},set:function(e){i=!!e}},startTime:{enumerable:!0,get:function(){return a},set:function(e){if("number"!=typeof e)throw new TypeError("Start time must be set to a number.");a=e,this.hasBeenReset=!0}},endTime:{enumerable:!0,get:function(){return o},set:function(e){if("number"!=typeof e)throw new TypeError("End time must be set to a number.");o=e,this.hasBeenReset=!0}},text:{enumerable:!0,get:function(){return s},set:function(e){s=""+e,this.hasBeenReset=!0}},region:{enumerable:!0,get:function(){return u},set:function(e){u=e,this.hasBeenReset=!0}},vertical:{enumerable:!0,get:function(){return l},set:function(e){var t=De(e);if(!1===t)throw new SyntaxError("An invalid or illegal string was specified.");l=t,this.hasBeenReset=!0}},snapToLines:{enumerable:!0,get:function(){return c},set:function(e){c=!!e,this.hasBeenReset=!0}},line:{enumerable:!0,get:function(){return d},set:function(e){if("number"!=typeof e&&e!==ia)throw new SyntaxError("An invalid number or illegal string was specified.");d=e,this.hasBeenReset=!0}},lineAlign:{enumerable:!0,get:function(){return f},set:function(e){var t=Me(e);if(!t)throw new SyntaxError("An invalid or illegal string was specified.");f=t,this.hasBeenReset=!0}},position:{enumerable:!0,get:function(){return h},set:function(e){if(e<0||e>100)throw new Error("Position must be between 0 and 100.");h=e,this.hasBeenReset=!0}},positionAlign:{enumerable:!0,get:function(){return p},set:function(e){var t=Me(e);if(!t)throw new SyntaxError("An invalid or illegal string was specified.");p=t,this.hasBeenReset=!0}},size:{enumerable:!0,get:function(){return m},set:function(e){if(e<0||e>100)throw new Error("Size must be between 0 and 100.");m=e,this.hasBeenReset=!0}},align:{enumerable:!0,get:function(){return v},set:function(e){var t=Me(e);if(!t)throw new SyntaxError("An invalid or illegal string was specified.");v=t,this.hasBeenReset=!0}}}),this.displayState=void 0}function Be(e){return"string"==typeof e&&!!ua[e.toLowerCase()]&&e.toLowerCase()}function Ne(e){return"number"==typeof e&&e>=0&&e<=100}function Fe(){var e=100,t=3,n=0,r=100,i=0,a=100,o="";Object.defineProperties(this,{width:{enumerable:!0,get:function(){return e},set:function(t){if(!Ne(t))throw new Error("Width must be between 0 and 100.");e=t}},lines:{enumerable:!0,get:function(){return t},set:function(e){if("number"!=typeof e)throw new TypeError("Lines must be set to a number.");t=e}},regionAnchorY:{enumerable:!0,get:function(){return r},set:function(e){if(!Ne(e))throw new Error("RegionAnchorX must be between 0 and 100.");r=e}},regionAnchorX:{enumerable:!0,get:function(){return n},set:function(e){if(!Ne(e))throw new Error("RegionAnchorY must be between 0 and 100.");n=e}},viewportAnchorY:{enumerable:!0,get:function(){return a},set:function(e){if(!Ne(e))throw new Error("ViewportAnchorY must be between 0 and 100.");a=e}},viewportAnchorX:{enumerable:!0,get:function(){return i},set:function(e){if(!Ne(e))throw new Error("ViewportAnchorX must be between 0 and 100.");i=e}},scroll:{enumerable:!0,get:function(){return o},set:function(e){var t=Be(e);if(!1===t)throw new SyntaxError("An invalid or illegal string was specified.");o=t}}})}function Ve(e,t,n,r,i){void 0===i&&(i={});var a=e.textTracks();i.kind=t,n&&(i.label=n),r&&(i.language=r),i.tech=e;var o=new Xi.text.TrackClass(i);return a.addTrack(o),o}function qe(e,t){fa[e]=fa[e]||[],fa[e].push(t)}function Ge(e,t,n){e.setTimeout(function(){return Qe(t,fa[t.type],n,e)},1)}function He(e,t){e.forEach(function(e){return e.setTech&&e.setTech(t)})}function ze(e,t,n){return e.reduceRight(Ye(n),t[n]())}function We(e,t,n,r){return t[n](e.reduce(Ye(n),r))}function $e(e,t,n,r){void 0===r&&(r=null);var i="call"+tn(n),a=e.reduce(Ye(i),r),o=a===pa,s=o?null:t[n](a);return Ke(e,n,s,o),s}function Ye(e){return function(t,n){return t===pa?pa:n[e]?n[e](t):t}}function Ke(e,t,n,r){for(var i=e.length-1;i>=0;i--){var a=e[i];a[t]&&a[t](r,n)}}function Xe(e){ha[e.id()]=null}function Je(e,t){var n=ha[e.id()],r=null;if(void 0===n||null===n)return r=t(e),ha[e.id()]=[[t,r]],r;for(var i=0;i0)for(var a=0,o=i.length;a=n&&(t.apply(void 0,arguments),r=i)}},Vt=function(t,n,r,i){void 0===i&&(i=e);var a,o=function(){i.clearTimeout(a),a=null},s=function(){var e=this,o=arguments,s=function(){a=null,s=null,r||t.apply(e,o)};!a&&r&&t.apply(e,o),i.clearTimeout(a),a=i.setTimeout(s,n)};return s.cancel=o,s},qt=function(){};qt.prototype.allowedEvents_={},qt.prototype.on=function(e,t){var n=this.addEventListener;this.addEventListener=function(){},G(this,e,t),this.addEventListener=n},qt.prototype.addEventListener=qt.prototype.on,qt.prototype.off=function(e,t){H(this,e,t)},qt.prototype.removeEventListener=qt.prototype.off,qt.prototype.one=function(e,t){var n=this.addEventListener;this.addEventListener=function(){},W(this,e,t),this.addEventListener=n},qt.prototype.any=function(e,t){var n=this.addEventListener;this.addEventListener=function(){},$(this,e,t),this.addEventListener=n},qt.prototype.trigger=function(e){var t=e.type||e;"string"==typeof e&&(e={type:t}),e=q(e),this.allowedEvents_[t]&&this["on"+t]&&this["on"+t](e),z(this,e)},qt.prototype.dispatchEvent=qt.prototype.trigger;var Gt;qt.prototype.queueTrigger=function(t){var n=this;Gt||(Gt=new Map);var r=t.type||t,i=Gt.get(this);i||(i=new Map,Gt.set(this,i));var a=i.get(r);i.delete(r),e.clearTimeout(a);var o=e.setTimeout(function(){0===i.size&&(i=null,Gt.delete(n)),n.trigger(t)},0);i.set(r,o)};var Ht=function(e){return e instanceof qt||!!e.eventBusEl_&&["on","one","off","trigger"].every(function(t){return"function"==typeof e[t]})},zt=function(e,t){Ht(e)?t():(e.eventedCallbacks||(e.eventedCallbacks=[]),e.eventedCallbacks.push(t))},Wt=function(e){return"string"==typeof e&&/\S/.test(e)||Array.isArray(e)&&!!e.length},$t=function(e){if(!e.nodeName&&!Ht(e))throw new Error("Invalid target; must be a DOM node or evented object.")},Yt=function(e){if(!Wt(e))throw new Error("Invalid event type; must be a non-empty string or array.")},Kt=function(e){if("function"!=typeof e)throw new Error("Invalid listener; must be a function.")},Xt=function(e,t){var n,r,i,a=t.length<3||t[0]===e||t[0]===e.eventBusEl_;return a?(n=e.eventBusEl_,t.length>=3&&t.shift(),r=t[0],i=t[1]):(n=t[0],r=t[1],i=t[2]),$t(n),Yt(r),Kt(i),i=Nt(e,i),{isTargetingSelf:a,target:n,type:r,listener:i}},Jt=function(e,t,n,r){$t(e),e.nodeName?Pt[t](e,n,r):e[t](n,r)},Qt={on:function(){for(var e=this,t=arguments.length,n=new Array(t),r=0;r=0;e--)this.children_[e].dispose&&this.children_[e].dispose();this.children_=null,this.childIndex_=null,this.childNameIndex_=null,this.parentComponent_=null,this.el_&&(this.el_.parentNode&&this.el_.parentNode.removeChild(this.el_),Lt.has(this.el_)&&Lt.delete(this.el_),this.el_=null),this.player_=null},n.player=function(){return this.player_},n.options=function(e){return e?(this.options_=J(this.options_,e),this.options_):this.options_},n.el=function(){return this.el_},n.createEl=function(e,t,n){return v(e,t,n)},n.localize=function(e,t,n){void 0===n&&(n=e);var r=this.player_.language&&this.player_.language(),i=this.player_.languages&&this.player_.languages(),a=i&&i[r],o=r&&r.split("-")[0],s=i&&i[o],u=n;return a&&a[e]?u=a[e]:s&&s[e]&&(u=s[e]),t&&(u=u.replace(/\{(\d+)\}/g,function(e,n){var r=t[n-1],i=r;return void 0===r&&(i=e),i})),u},n.contentEl=function(){return this.contentEl_||this.el_},n.id=function(){return this.id_},n.name=function(){return this.name_},n.children=function(){return this.children_},n.getChildById=function(e){return this.childIndex_[e]},n.getChild=function(e){if(e)return this.childNameIndex_[e]},n.addChild=function(e,n,r){void 0===n&&(n={}),void 0===r&&(r=this.children_.length);var i,a;if("string"==typeof e){a=tn(e);var o=n.componentClass||a;n.name=a;var s=t.getComponent(o);if(!s)throw new Error("Component "+o+" does not exist");if("function"!=typeof s)return null;i=new s(this.player_||this,n)}else i=e;if(i.parentComponent_&&i.parentComponent_.removeChild(i),this.children_.splice(r,0,i),i.parentComponent_=this,"function"==typeof i.id&&(this.childIndex_[i.id()]=i),a=a||i.name&&tn(i.name()),a&&(this.childNameIndex_[a]=i,this.childNameIndex_[en(a)]=i),"function"==typeof i.el&&i.el()){var u=this.contentEl().children,l=u[r]||null;this.contentEl().insertBefore(i.el(),l)}return i},n.removeChild=function(e){if("string"==typeof e&&(e=this.getChild(e)),e&&this.children_){for(var t=!1,n=this.children_.length-1;n>=0;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_[tn(e.name())]=null,this.childNameIndex_[en(e.name())]=null;var r=e.el();r&&r.parentNode===this.contentEl()&&this.contentEl().removeChild(e.el())}}},n.initChildren=function(){var e=this,n=this.options_.children;if(n){var r,i=this.options_,a=function(t){var n=t.name,r=t.opts;if(void 0!==i[n]&&(r=i[n]),!1!==r){!0===r&&(r={}),r.playerOptions=e.options_.playerOptions;var a=e.addChild(n,r);a&&(e[n]=a)}},o=t.getComponent("Tech");r=Array.isArray(n)?n:Object.keys(n),r.concat(Object.keys(this.options_).filter(function(e){return!r.some(function(t){return"string"==typeof t?e===t:e===t.name})})).map(function(t){var r,i;return"string"==typeof t?(r=t,i=n[r]||e.options_[r]||{}):(r=t.name,i=t),{name:r,opts:i}}).filter(function(e){var n=t.getComponent(e.opts.componentClass||tn(e.name));return n&&!o.isTech(n)}).forEach(a)}},n.buildCSSClass=function(){return""},n.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))},n.triggerReady=function(){this.isReady_=!0,this.setTimeout(function(){var e=this.readyQueue_;this.readyQueue_=[],e&&e.length>0&&e.forEach(function(e){e.call(this)},this),this.trigger("ready")},1)},n.$=function(e,t){return Et(e,t||this.contentEl())},n.$$=function(e,t){return At(e,t||this.contentEl())},n.hasClass=function(e){return _(this.el_,e)},n.addClass=function(e){b(this.el_,e)},n.removeClass=function(e){T(this.el_,e)},n.toggleClass=function(e,t){S(this.el_,e,t)},n.show=function(){this.removeClass("vjs-hidden")},n.hide=function(){this.addClass("vjs-hidden")},n.lockShowing=function(){this.addClass("vjs-lock-showing")},n.unlockShowing=function(){this.removeClass("vjs-lock-showing")},n.getAttribute=function(e){return E(this.el_,e)},n.setAttribute=function(e,t){A(this.el_,e,t)},n.removeAttribute=function(e){C(this.el_,e)},n.width=function(e,t){return this.dimension("width",e,t)},n.height=function(e,t){return this.dimension("height",e,t)},n.dimensions=function(e,t){this.width(e,!0),this.height(t)},n.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 r=this.el_.style[e],i=r.indexOf("px");return-1!==i?parseInt(r.slice(0,i),10):parseInt(this.el_["offset"+tn(e)],10)},n.currentDimension=function(e){var t=0;if("width"!==e&&"height"!==e)throw new Error("currentDimension only accepts width or height value");if(t=u(this.el_,e),0===(t=parseFloat(t))||isNaN(t)){var n="offset"+tn(e);t=this.el_[n]}return t},n.currentDimensions=function(){return{width:this.currentDimension("width"),height:this.currentDimension("height")}},n.currentWidth=function(){return this.currentDimension("width")},n.currentHeight=function(){return this.currentDimension("height")},n.focus=function(){this.el_.focus()},n.blur=function(){this.el_.blur()},n.handleKeyDown=function(e){this.player_&&(e.stopPropagation(),this.player_.handleKeyDown(e))},n.handleKeyPress=function(e){this.handleKeyDown(e)},n.emitTapEvents=function(){var t,n=0,r=null;this.on("touchstart",function(i){1===i.touches.length&&(r={pageX:i.touches[0].pageX,pageY:i.touches[0].pageY},n=e.performance.now(),t=!0)}),this.on("touchmove",function(e){if(e.touches.length>1)t=!1;else if(r){var n=e.touches[0].pageX-r.pageX,i=e.touches[0].pageY-r.pageY,a=Math.sqrt(n*n+i*i);a>10&&(t=!1)}});var i=function(){t=!1};this.on("touchleave",i),this.on("touchcancel",i),this.on("touchend",function(i){r=null,!0===t&&e.performance.now()-n<200&&(i.preventDefault(),this.trigger("tap"))})},n.enableTouchActivity=function(){if(this.player()&&this.player().reportUserActivity){var e,t=Nt(this.player(),this.player().reportUserActivity);this.on("touchstart",function(){t(),this.clearInterval(e),e=this.setInterval(t,250)});var n=function(n){t(),this.clearInterval(e)};this.on("touchmove",t),this.on("touchend",n),this.on("touchcancel",n)}},n.setTimeout=function(t,n){var r,i=this;return t=Nt(this,t),this.clearTimersOnDispose_(),r=e.setTimeout(function(){i.setTimeoutIds_.has(r)&&i.setTimeoutIds_.delete(r),t()},n),this.setTimeoutIds_.add(r),r},n.clearTimeout=function(t){return this.setTimeoutIds_.has(t)&&(this.setTimeoutIds_.delete(t),e.clearTimeout(t)),t},n.setInterval=function(t,n){t=Nt(this,t),this.clearTimersOnDispose_();var r=e.setInterval(t,n);return this.setIntervalIds_.add(r),r},n.clearInterval=function(t){return this.setIntervalIds_.has(t)&&(this.setIntervalIds_.delete(t),e.clearInterval(t)),t},n.requestAnimationFrame=function(t){var n=this;if(!this.supportsRaf_)return this.setTimeout(t,1e3/60);this.clearTimersOnDispose_();var r;return t=Nt(this,t),r=e.requestAnimationFrame(function(){n.rafIds_.has(r)&&n.rafIds_.delete(r),t()}),this.rafIds_.add(r),r},n.cancelAnimationFrame=function(t){return this.supportsRaf_?(this.rafIds_.has(t)&&(this.rafIds_.delete(t),e.cancelAnimationFrame(t)),t):this.clearTimeout(t)},n.clearTimersOnDispose_=function(){var e=this;this.clearingTimersOnDispose_||(this.clearingTimersOnDispose_=!0,this.one("dispose",function(){[["rafIds_","cancelAnimationFrame"],["setTimeoutIds_","clearTimeout"],["setIntervalIds_","clearInterval"]].forEach(function(t){var n=t[0],r=t[1];e[n].forEach(e[r],e)}),e.clearingTimersOnDispose_=!1}))},t.registerComponent=function(e,n){if("string"!=typeof e||!e)throw new Error('Illegal component name, "'+e+'"; must be a non-empty string.');var r=t.getComponent("Tech"),i=r&&r.isTech(n),a=t===n||t.prototype.isPrototypeOf(n.prototype);if(i||!a){var o;throw o=i?"techs must be registered using Tech.registerTech()":"must be a Component subclass",new Error('Illegal component, "'+e+'"; '+o+".")}e=tn(e),t.components_||(t.components_={});var s=t.getComponent("Player");if("Player"===e&&s&&s.players){var u=s.players,l=Object.keys(u);if(u&&l.length>0&&l.map(function(e){return u[e]}).every(Boolean))throw new Error("Can not register Player component after player has been created.")}return t.components_[e]=n,t.components_[en(e)]=n,n},t.getComponent=function(e){if(e&&t.components_)return t.components_[e]},t}();rn.prototype.supportsRaf_="function"==typeof e.requestAnimationFrame&&"function"==typeof e.cancelAnimationFrame,rn.registerComponent("Component",rn);for(var an,on=e.navigator&&e.navigator.userAgent||"",sn=/AppleWebKit\/([\d.]+)/i.exec(on),un=sn?parseFloat(sn.pop()):null,ln=/iPad/i.test(on),cn=/iPhone/i.test(on)&&!ln,dn=/iPod/i.test(on),fn=cn||ln||dn,hn=function(){var e=on.match(/OS (\d+)_/i);return e&&e[1]?e[1]:null}(),pn=/Android/i.test(on),mn=function(){var e=on.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}(),vn=pn&&mn<5&&un<537,gn=/Firefox/i.test(on),yn=/Edge/i.test(on),_n=!yn&&(/Chrome/i.test(on)||/CriOS/i.test(on)),bn=function(){var e=on.match(/(Chrome|CriOS)\/(\d+)/);return e&&e[2]?parseFloat(e[2]):null}(),Tn=function(){var e=/MSIE\s(\d+)\.\d/.exec(on),t=e&&parseFloat(e[1]);return!t&&/Trident\/7.0/i.test(on)&&/rv:11.0/.test(on)&&(t=11),t}(),Sn=/Safari/i.test(on)&&!_n&&!pn&&!yn,wn=(Sn||fn)&&!_n,kn=/Windows/i.test(on),En=(f()&&("ontouchstart"in e||e.navigator.maxTouchPoints||e.DocumentTouch&&e.document instanceof e.DocumentTouch)),An=Object.freeze({IS_IPAD:ln,IS_IPHONE:cn,IS_IPOD:dn,IS_IOS:fn,IOS_VERSION:hn,IS_ANDROID:pn,ANDROID_VERSION:mn,IS_NATIVE_ANDROID:vn,IS_FIREFOX:gn,IS_EDGE:yn,IS_CHROME:_n,CHROME_VERSION:bn,IE_VERSION:Tn,IS_SAFARI:Sn,IS_ANY_SAFARI:wn,IS_WINDOWS:kn,TOUCH_ENABLED:En}),Cn={prefixed:!0},Ln=[["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"]],xn=Ln[0],jn=0;jn=0;r--)if(t[r].enabled){Hn(t,t[r]);break}return n=e.call(this,t)||this,n.changing_=!1,n}Q(t,e);var n=t.prototype;return n.addTrack=function(t){var n=this;t.enabled&&Hn(this,t),e.prototype.addTrack.call(this,t),t.addEventListener&&(t.enabledChange_=function(){n.changing_||(n.changing_=!0,Hn(n,t),n.changing_=!1,n.trigger("change"))},t.addEventListener("enabledchange",t.enabledChange_))},n.removeTrack=function(t){e.prototype.removeTrack.call(this,t),t.removeEventListener&&t.enabledChange_&&(t.removeEventListener("enabledchange",t.enabledChange_),t.enabledChange_=null)},t}(Vn),Wn=function(e,t){for(var n=0;n=0;r--)if(t[r].selected){Wn(t,t[r]);break}return n=e.call(this,t)||this,n.changing_=!1,Object.defineProperty(ne(n),"selectedIndex",{get:function(){for(var e=0;e',i=a.firstChild,a.setAttribute("style","display:none; position:absolute;"),t.body.appendChild(a));for(var s={},u=0;ux',e=n.firstChild.href}return e},ir=function(e){if("string"==typeof e){var t=/^(\/?)([\s\S]*?)((?:\.{1,2}|[^\/]+?)(\.([^\.\/\?]+)))(?:[\/]*|[\?].*)$/,n=t.exec(e);if(n)return n.pop().toLowerCase()}return""},ar=function(t){var n=e.location,r=nr(t);return(":"===r.protocol?n.protocol:r.protocol)+r.host!==n.protocol+n.host},or=Object.freeze({parseUrl:nr,getAbsoluteURL:rr,getFileExtension:ir,isCrossOrigin:ar}),sr=he,ur=Object.prototype.toString,lr=Array.prototype.slice,cr=Object.prototype.toString,dr=function(e){var t=this;if("function"!=typeof t||"[object Function]"!==cr.call(t))throw new TypeError("Function.prototype.bind called on incompatible "+t);for(var n,r=lr.call(arguments,1),i=function(){if(this instanceof n){var i=t.apply(this,r.concat(lr.call(arguments)));return Object(i)===i?i:this}return t.apply(e,r.concat(lr.call(arguments)))},a=Math.max(0,t.length-r.length),o=[],s=0;s=0&&"[object Function]"===hr.call(e.callee)),n};if(!Object.keys){var mr=Object.prototype.hasOwnProperty,vr=Object.prototype.toString,gr=pr,yr=Object.prototype.propertyIsEnumerable,_r=!yr.call({toString:null},"toString"),br=yr.call(function(){},"prototype"),Tr=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],Sr=function(e){var t=e.constructor;return t&&t.prototype===e},wr={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},kr=function(){if("undefined"==typeof window)return!1;for(var e in window)try{if(!wr["$"+e]&&mr.call(window,e)&&null!==window[e]&&"object"==typeof window[e])try{Sr(window[e])}catch(e){return!0}}catch(e){return!0}return!1}(),Er=function(e){if("undefined"==typeof window||!kr)return Sr(e);try{return Sr(e)}catch(e){return!1}};Gn=function(e){var t=null!==e&&"object"==typeof e,n="[object Function]"===vr.call(e),r=gr(e),i=t&&"[object String]"===vr.call(e),a=[];if(!t&&!n&&!r)throw new TypeError("Object.keys called on a non-object");var o=br&&n;if(i&&e.length>0&&!mr.call(e,0))for(var s=0;s0)for(var u=0;u2?arguments[2]:{},r=Or(t);Ir&&(r=Rr.call(r,Object.getOwnPropertySymbols(t)));for(var i=0;i1&&"boolean"!=typeof t)throw new TypeError('"allowMissing" argument must be a boolean');var n="$ "+e;if(!(n in zr))throw new SyntaxError("intrinsic "+e+" does not exist!");if(void 0===zr[n]&&!t)throw new TypeError("intrinsic "+e+" exists, but is not available. Please file an issue!");return zr[n]},$r=fr.call(Function.call,Object.prototype.hasOwnProperty),Yr=Wr("%TypeError%"),Kr=Wr("%SyntaxError%"),Xr={"Property Descriptor":function(e,t){if("Object"!==e.Type(t))return!1;var n={"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0};for(var r in t)if($r(t,r)&&!n[r])return!1;var i=$r(t,"[[Value]]"),a=$r(t,"[[Get]]")||$r(t,"[[Set]]");if(i&&a)throw new Yr("Property Descriptors may not be both accessor and data descriptors");return!0}},Jr=function(e,t,n,r){var i=Xr[t];if("function"!=typeof i)throw new Kr("unknown record type: "+t);if(!i(e,r))throw new Yr(n+" must be a "+t);console.log(i(e,r),r)},Qr=Number.isNaN||function(e){return e!==e},Zr=Number.isNaN||function(e){return e!==e},ei=Number.isFinite||function(e){return"number"==typeof e&&!Zr(e)&&e!==1/0&&e!==-1/0},ti=function(e){return e>=0?1:-1},ni=function(e,t){var n=e%t;return Math.floor(n>=0?n:n+t)},ri=Function.prototype.toString,ii=/^\s*class\b/,ai=function(e){try{var t=ri.call(e);return ii.test(t)}catch(e){return!1}},oi=function(e){try{return!ai(e)&&(ri.call(e),!0)}catch(e){return!1}},si=Object.prototype.toString,ui="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag,li=function(e){if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;if("function"==typeof e&&!e.prototype)return!0;if(ui)return oi(e);if(ai(e))return!1;var t=si.call(e);return"[object Function]"===t||"[object GeneratorFunction]"===t},ci=function(e){return null===e||"function"!=typeof e&&"object"!=typeof e},di=Object.prototype.toString,fi={"[[DefaultValue]]":function(e){var t;if((t=arguments.length>1?arguments[1]:"[object Date]"===di.call(e)?String:Number)===String||t===Number){var n,r,i=t===String?["toString","valueOf"]:["valueOf","toString"];for(r=0;r1?fi["[[DefaultValue]]"](e,arguments[1]):fi["[[DefaultValue]]"](e)},pi=Wr("%Object%"),mi=Wr("%TypeError%"),vi=Wr("%String%"),gi={ToPrimitive:hi,ToBoolean:function(e){return!!e},ToNumber:function(e){return+e},ToInteger:function(e){var t=this.ToNumber(e);return Qr(t)?0:0!==t&&ei(t)?ti(t)*Math.floor(Math.abs(t)):t},ToInt32:function(e){return this.ToNumber(e)>>0},ToUint32:function(e){return this.ToNumber(e)>>>0},ToUint16:function(e){var t=this.ToNumber(e);if(Qr(t)||0===t||!ei(t))return 0;var n=ti(t)*Math.floor(Math.abs(t));return ni(n,65536)},ToString:function(e){return vi(e)},ToObject:function(e){return this.CheckObjectCoercible(e),pi(e)},CheckObjectCoercible:function(e,t){if(null==e)throw new mi(t||"Cannot call method on "+e);return e},IsCallable:li,SameValue:function(e,t){return e===t?0!==e||1/e==1/t:Qr(e)&&Qr(t)},Type:function(e){return null===e?"Null":void 0===e?"Undefined":"function"==typeof e||"object"==typeof e?"Object":"number"==typeof e?"Number":"boolean"==typeof e?"Boolean":"string"==typeof e?"String":void 0},IsPropertyDescriptor:function(e){if("Object"!==this.Type(e))return!1;var t={"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0};for(var n in e)if($r(e,n)&&!t[n])return!1;var r=$r(e,"[[Value]]"),i=$r(e,"[[Get]]")||$r(e,"[[Set]]");if(r&&i)throw new mi("Property Descriptors may not be both accessor and data descriptors");return!0},IsAccessorDescriptor:function(e){return void 0!==e&&(Jr(this,"Property Descriptor","Desc",e),!(!$r(e,"[[Get]]")&&!$r(e,"[[Set]]")))},IsDataDescriptor:function(e){return void 0!==e&&(Jr(this,"Property Descriptor","Desc",e),!(!$r(e,"[[Value]]")&&!$r(e,"[[Writable]]")))},IsGenericDescriptor:function(e){return void 0!==e&&(Jr(this,"Property Descriptor","Desc",e),!this.IsAccessorDescriptor(e)&&!this.IsDataDescriptor(e))},FromPropertyDescriptor:function(e){if(void 0===e)return e;if(Jr(this,"Property Descriptor","Desc",e),this.IsDataDescriptor(e))return{value:e["[[Value]]"],writable:!!e["[[Writable]]"],enumerable:!!e["[[Enumerable]]"],configurable:!!e["[[Configurable]]"]};if(this.IsAccessorDescriptor(e))return{get:e["[[Get]]"],set:e["[[Set]]"],enumerable:!!e["[[Enumerable]]"],configurable:!!e["[[Configurable]]"]};throw new mi("FromPropertyDescriptor must be called with a fully populated Property Descriptor")},ToPropertyDescriptor:function(e){if("Object"!==this.Type(e))throw new mi("ToPropertyDescriptor requires an object");var t={};if($r(e,"enumerable")&&(t["[[Enumerable]]"]=this.ToBoolean(e.enumerable)),$r(e,"configurable")&&(t["[[Configurable]]"]=this.ToBoolean(e.configurable)),$r(e,"value")&&(t["[[Value]]"]=e.value),$r(e,"writable")&&(t["[[Writable]]"]=this.ToBoolean(e.writable)),$r(e,"get")){var n=e.get;if(void 0!==n&&!this.IsCallable(n))throw new TypeError("getter must be a function");t["[[Get]]"]=n}if($r(e,"set")){var r=e.set;if(void 0!==r&&!this.IsCallable(r))throw new mi("setter must be a function");t["[[Set]]"]=r}if(($r(t,"[[Get]]")||$r(t,"[[Set]]"))&&($r(t,"[[Value]]")||$r(t,"[[Writable]]")))throw new mi("Invalid property descriptor. Cannot both specify accessors and a value or writable attribute");return t}},yi=gi,_i=fr.call(Function.call,String.prototype.replace),bi=/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/,Ti=/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/,Si=function(){var e=yi.ToString(yi.CheckObjectCoercible(this));return _i(_i(e,bi,""),Ti,"")},wi="​",ki=function(){return String.prototype.trim&&wi.trim()===wi?String.prototype.trim:Si},Ei=function(){var e=ki();return Fr(String.prototype,{trim:e},{trim:function(){return String.prototype.trim!==e}}),e},Ai=fr.call(Function.call,ki());Fr(Ai,{getPolyfill:ki,implementation:Si,shim:Ei});var Ci=Ai,Li=Object.prototype.toString,xi=Object.prototype.hasOwnProperty,ji=function(e,t,n){for(var r=0,i=e.length;r=3&&(r=n),"[object Array]"===Li.call(e)?ji(e,t,r):"string"==typeof e?Oi(e,t,r):Ii(e,t,r)},Ri=Pi,Di=function(e){return"[object Array]"===Object.prototype.toString.call(e)},Mi=function(e){if(!e)return{};var t={};return Ri(Ci(e).split("\n"),function(e){var n=e.indexOf(":"),r=Ci(e.slice(0,n)).toLowerCase(),i=Ci(e.slice(n+1));void 0===t[r]?t[r]=i:Di(t[r])?t[r].push(i):t[r]=[t[r],i]}),t},Ui=pe,Bi=Object.prototype.hasOwnProperty,Ni=ge;ge.XMLHttpRequest=e.XMLHttpRequest||be,ge.XDomainRequest="withCredentials"in new ge.XMLHttpRequest?ge.XMLHttpRequest:e.XDomainRequest,function(e,t){for(var n=0;n0&&(e.console&&e.console.groupCollapsed&&e.console.groupCollapsed("Text Track parsing errors for "+n.src),i.forEach(function(e){return Tt.error(e)}),e.console&&e.console.groupEnd&&e.console.groupEnd()),r.flush()},Vi=function(t,n){var r={uri:t},i=ar(t);i&&(r.cors=i),Ni(r,Nt(this,function(t,r,i){if(t)return Tt.error(t,r);n.loaded_=!0,"function"!=typeof e.WebVTT?n.tech_&&n.tech_.any(["vttjsloaded","vttjserror"],function(e){return"vttjserror"===e.type?void Tt.error("vttjs failed to load, stopping trying to process "+n.src):Fi(i,n)}):Fi(i,n)}))},qi=function(t){function n(e){var n;if(void 0===e&&(e={}),!e.tech)throw new Error("A tech was not provided.");var r=J(e,{kind:Zn[e.kind]||"subtitles",language:e.language||e.srclang||""}),i=er[r.mode]||"disabled",a=r.default;"metadata"!==r.kind&&"chapters"!==r.kind||(i="hidden"),n=t.call(this,r)||this,n.tech_=r.tech,n.cues_=[],n.activeCues_=[];var o=new Xn(n.cues_),s=new Xn(n.activeCues_),u=!1,l=Nt(ne(n),function(){this.activeCues=this.activeCues,u&&(this.trigger("cuechange"),u=!1)});return"disabled"!==i&&n.tech_.ready(function(){n.tech_.on("timeupdate",l)},!0),Object.defineProperties(ne(n),{default:{get:function(){return a},set:function(){}},mode:{get:function(){return i},set:function(e){var t=this;er[e]&&(i=e,"disabled"!==i?this.tech_.ready(function(){t.tech_.on("timeupdate",l)},!0):this.tech_.off("timeupdate",l),this.trigger("modechange"))}},cues:{get:function(){return this.loaded_?o:null},set:function(){}},activeCues:{get:function(){if(!this.loaded_)return null;if(0===this.cues.length)return s;for(var e=this.tech_.currentTime(),t=[],n=0,r=this.cues.length;n=e?t.push(i):i.startTime===i.endTime&&i.startTime<=e&&i.startTime+.5>=e&&t.push(i)}if(u=!1,t.length!==this.activeCues_.length)u=!0;else for(var a=0;a=0&&t<=100)&&(this.set(e,t),!0)}};var Qi={"&":"&","<":"<",">":">","‎":"‎","‏":"‏"," ":" "},Zi={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"},ea={v:"title",lang:"lang"},ta={rt:"ruby"},na=[[1470,1470],[1472,1472],[1475,1475],[1478,1478],[1488,1514],[1520,1524],[1544,1544],[1547,1547],[1549,1549],[1563,1563],[1566,1610],[1645,1647],[1649,1749],[1765,1766],[1774,1775],[1786,1805],[1807,1808],[1810,1839],[1869,1957],[1969,1969],[1984,2026],[2036,2037],[2042,2042],[2048,2069],[2074,2074],[2084,2084],[2088,2088],[2096,2110],[2112,2136],[2142,2142],[2208,2208],[2210,2220],[8207,8207],[64285,64285],[64287,64296],[64298,64310],[64312,64316],[64318,64318],[64320,64321],[64323,64324],[64326,64449],[64467,64829],[64848,64911],[64914,64967],[65008,65020],[65136,65140],[65142,65276],[67584,67589],[67592,67592],[67594,67637],[67639,67640],[67644,67644],[67647,67669],[67671,67679],[67840,67867],[67872,67897],[67903,67903],[67968,68023],[68030,68031],[68096,68096],[68112,68115],[68117,68119],[68121,68147],[68160,68167],[68176,68184],[68192,68223],[68352,68405],[68416,68437],[68440,68466],[68472,68479],[68608,68680],[126464,126467],[126469,126495],[126497,126498],[126500,126500],[126503,126503],[126505,126514],[126516,126519],[126521,126521],[126523,126523],[126530,126530],[126535,126535],[126537,126537],[126539,126539],[126541,126543],[126545,126546],[126548,126548],[126551,126551],[126553,126553],[126555,126555],[126557,126557],[126559,126559],[126561,126562],[126564,126564],[126567,126570],[126572,126578],[126580,126583],[126585,126588],[126590,126590],[126592,126601],[126603,126619],[126625,126627],[126629,126633],[126635,126651],[1114109,1114109]];je.prototype.applyStyles=function(e,t){t=t||this.div;for(var n in e)e.hasOwnProperty(n)&&(t.style[n]=e[n])},je.prototype.formatStyle=function(e,t){return 0===e?0:e+t},Oe.prototype=Ji(je.prototype),Oe.prototype.constructor=Oe,Ie.prototype.move=function(e,t){switch(t=void 0!==t?t:this.lineHeight,e){case"+x":this.left+=t,this.right+=t;break;case"-x":this.left-=t,this.right-=t;break;case"+y":this.top+=t,this.bottom+=t;break;case"-y":this.top-=t,this.bottom-=t}},Ie.prototype.overlaps=function(e){return this.lefte.left&&this.tope.top},Ie.prototype.overlapsAny=function(e){for(var t=0;t=e.top&&this.bottom<=e.bottom&&this.left>=e.left&&this.right<=e.right},Ie.prototype.overlapsOppositeAxis=function(e,t){switch(t){case"+x":return this.lefte.right;case"+y":return this.tope.bottom}},Ie.prototype.intersectPercentage=function(e){return Math.max(0,Math.min(this.right,e.right)-Math.max(this.left,e.left))*Math.max(0,Math.min(this.bottom,e.bottom)-Math.max(this.top,e.top))/(this.height*this.width)},Ie.prototype.toCSSCompatValues=function(e){return{top:this.top-e.top,bottom:e.bottom-this.bottom,left:this.left-e.left,right:e.right-this.right,height:this.height,width:this.width}},Ie.getSimpleBoxPosition=function(e){var t=e.div?e.div.offsetHeight:e.tagName?e.offsetHeight:0,n=e.div?e.div.offsetWidth:e.tagName?e.offsetWidth:0,r=e.div?e.div.offsetTop:e.tagName?e.offsetTop:0;return e=e.div?e.div.getBoundingClientRect():e.tagName?e.getBoundingClientRect():e,{left:e.left,right:e.right,top:e.top||r,height:e.height||t,bottom:e.bottom||r+(e.height||t),width:e.width||n}},Re.StringDecoder=function(){return{decode:function(e){if(!e)return"";if("string"!=typeof e)throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(e))}}},Re.convertCueToDOMTree=function(e,t){return e&&t?Ae(e,t):null},Re.processCues=function(e,t,n){if(!e||!t||!n)return null;for(;n.firstChild;)n.removeChild(n.firstChild);var r=e.document.createElement("div");if(r.style.position="absolute",r.style.left="0",r.style.right="0",r.style.top="0",r.style.bottom="0",r.style.margin="1.5%",n.appendChild(r),function(e){for(var t=0;t0)return void this.trigger("vttjsloaded");var r=t.createElement("script");r.src=this.options_["vtt.js"]||"https://vjs.zencdn.net/vttjs/0.14.1/vtt.min.js",r.onload=function(){n.trigger("vttjsloaded")},r.onerror=function(){n.trigger("vttjserror")},this.on("dispose",function(){r.onload=null,r.onerror=null}),e.WebVTT=!0,this.el().parentNode.appendChild(r)}else this.ready(this.addWebVttScript_)},i.emulateTextTracks=function(){var e=this,t=this.textTracks(),n=this.remoteTextTracks(),r=function(e){return t.addTrack(e.track)},i=function(e){return t.removeTrack(e.track)};n.on("addtrack",r),n.on("removetrack",i),this.addWebVttScript_();var a=function(){return e.trigger("texttrackchange")},o=function(){a();for(var e=0;e