!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(e,t){function n(e,t){Ye(e).forEach((function(n){return t(e[n],n)}))}function r(e){for(var t=arguments.length,r=new Array(t>1?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 S(e,t){return e.getAttribute(t)}function E(e,t,n){e.setAttribute(t,n)}function k(e,t){e.removeAttribute(t)}function w(){t.body.focus(),t.onselectstart=function(){return!1}}function C(){t.onselectstart=function(){return!0}}function A(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(s(e,"height"))),n.width||(n.width=parseFloat(s(e,"width"))),n}}function L(n){var r;if(n.getBoundingClientRect&&n.parentNode&&(r=n.getBoundingClientRect()),!r)return{left:0,top:0};var i=t.documentElement,a=t.body,s=i.clientLeft||a.clientLeft||0,o=e.pageXOffset||a.scrollLeft,u=r.left+o-s,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 R(e,t){var n={},r=L(e),i=e.offsetWidth,a=e.offsetHeight,s=r.top,o=r.left,u=t.pageY,l=t.pageX;return t.changedTouches&&(l=t.changedTouches[0].pageX,u=t.changedTouches[0].pageY),n.y=Math.max(0,Math.min(1,(s-u+a)/a)),n.x=Math.max(0,Math.min(1,(l-o)/i)),n}function x(e){return i(e)&&3===e.nodeType}function I(e){for(;e.firstChild;)e.removeChild(e.firstChild);return e}function O(e){return"function"==typeof e&&(e=e()),(Array.isArray(e)?e:[e]).map((function(e){return"function"==typeof e&&(e=e()),c(e)||x(e)?e:"string"==typeof e&&/\S/.test(e)?t.createTextNode(e):void 0})).filter((function(e){return e}))}function D(e,t){return O(t).forEach((function(t){return e.appendChild(t)})),e}function P(e,t){return D(I(e),t)}function M(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 j(){return et++}function U(e,t){if(Ze.has(e)){var n=Ze.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&&Ze.delete(e)}}function B(e,t,n,r){n.forEach((function(n){e(t,n,r)}))}function F(n){function r(){return!0}function i(){return!1}if(!n||!n.isPropagationStopped){var a=n||e.event;n={};var s=["layerX","layerY","keyLocation","path","webkitMovementX","webkitMovementY","mozPressure","mozInputSource"];for(var o in a)s.includes(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 u=t.documentElement,l=t.body;n.pageX=n.clientX+(u&&u.scrollLeft||l&&l.scrollLeft||0)-(u&&u.clientLeft||l&&l.clientLeft||0),n.pageY=n.clientY+(u&&u.scrollTop||l&&l.scrollTop||0)-(u&&u.clientTop||l&&l.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 N(e,t,n){if(Array.isArray(t))return B(N,e,t,n);Ze.has(e)||Ze.set(e,{});var r=Ze.get(e);if(r.handlers||(r.handlers={}),r.handlers[t]||(r.handlers[t]=[]),n.guid||(n.guid=j()),r.handlers[t].push(n),r.dispatcher||(r.disabled=!1,r.dispatcher=function(t,n){if(!r.disabled){t=F(t);var i=r.handlers[t.type];if(i)for(var a=i.slice(0),s=0,o=a.length;s-1&&(i={passive:!0}),e.addEventListener(t,r.dispatcher,i)}else e.attachEvent&&e.attachEvent("on"+t,r.dispatcher)}function G(e,t,n){if(Ze.has(e)){var r=Ze.get(e);if(r.handlers){if(Array.isArray(t))return B(G,e,t,n);var i=function(e,t){r.handlers[t]=[],U(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 s=0;sn)throw new Error("Failed to execute '"+e+"' on 'TimeRanges': The index provided ("+t+") is non-numeric or out of bounds (0-"+n+").")}(e,r,n.length-1),n[r][t]}function te(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:ee.bind(null,"start",0,e),end:ee.bind(null,"end",1,e)}}function ne(e,t){return Array.isArray(e)?te(e):void 0===e||void 0===t?te():te([[e,t]])}function re(e,t){var n,r,i=0;if(!t)return 0;e&&e.length||(e=ne(0,0));for(var a=0;at&&(r=t),i+=r-n;return i/t}function ie(e){if(e instanceof ie)return e;"number"==typeof e?this.code=e:"string"==typeof e?this.message=e:i(e)&&("number"==typeof e.code&&(this.code=e.code),r(this,e)),this.message||(this.message=ie.defaultMessages[this.code]||"")}function ae(e){return null!=e&&"function"==typeof e.then}function se(e){ae(e)&&e.then(null,(function(e){}))}function oe(e,t){return e(t={exports:{}},t.exports),t.exports}function ue(e,t,n){var r=e;return Ln(t)?(n=t,"string"==typeof e&&(r={uri:e})):r=qr(t,{uri:e}),r.callback=n,r}function le(e,t,n){return ce(t=ue(e,t,n))}function ce(e){function t(){var e=void 0;if(e=s.response?s.response:s.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}(s),v)try{e=JSON.parse(e)}catch(e){}return e}function n(e){return clearTimeout(l),e instanceof Error||(e=new Error(""+(e||"Unknown XMLHttpRequest Error"))),e.statusCode=0,a(e,m)}function r(){if(!u){var n;clearTimeout(l),n=e.useXDR&&void 0===s.status?200:1223===s.status?204:s.status;var r=m,i=null;return 0!==n?(r={body:t(),statusCode:n,method:d,headers:{},url:c,rawRequest:s},s.getAllResponseHeaders&&(r.headers=Kr(s.getAllResponseHeaders()))):i=new Error("Internal XMLHttpRequest Error"),a(i,r,r.body)}}if(void 0===e.callback)throw new Error("callback argument missing");var i=!1,a=function(t,n,r){i||(i=!0,e.callback(t,n,r))},s=e.xhr||null;s||(s=e.cors||e.useXDR?new le.XDomainRequest:new le.XMLHttpRequest);var o,u,l,c=s.url=e.uri||e.url,d=s.method=e.method||"GET",h=e.body||e.data,f=s.headers=e.headers||{},p=!!e.sync,v=!1,m={body:void 0,headers:{},statusCode:0,method:d,url:c,rawRequest:s};if("json"in e&&!1!==e.json&&(v=!0,f.accept||f.Accept||(f.Accept="application/json"),"GET"!==d&&"HEAD"!==d&&(f["content-type"]||f["Content-Type"]||(f["Content-Type"]="application/json"),h=JSON.stringify(!0===e.json?h:e.json))),s.onreadystatechange=function(){4===s.readyState&&setTimeout(r,0)},s.onload=r,s.onerror=n,s.onprogress=function(){},s.onabort=function(){u=!0},s.ontimeout=n,s.open(d,c,!p,e.username,e.password),p||(s.withCredentials=!!e.withCredentials),!p&&e.timeout>0&&(l=setTimeout((function(){if(!u){u=!0,s.abort("timeout");var e=new Error("XMLHttpRequest timeout");e.code="ETIMEDOUT",n(e)}}),e.timeout)),s.setRequestHeader)for(o in f)f.hasOwnProperty(o)&&s.setRequestHeader(o,f[o]);else if(e.headers&&!function(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0}(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 de(e,t){this.name="ParsingError",this.code=e.code,this.message=t||e.message}function he(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 fe(){this.values=ai(null)}function pe(e,t,n,r){var i=r?e.split(r):[e];for(var a in i)if("string"==typeof i[a]){var s=i[a].split(n);if(2===s.length)t(s[0],s[1])}}function ve(e,t,n){function r(){var t=he(e);if(null===t)throw new de(de.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 de(de.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 fe;pe(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(","),s=a[0];r.integer(e,s),r.percent(e,s)&&r.set("snapToLines",!1),r.alt(e,s,["auto"]),2===a.length&&r.alt("lineAlign",a[1],["start","middle","end"]);break;case"position":a=t.split(","),r.percent(e,a[0]),2===a.length&&r.alt("positionAlign",a[1],["start","middle","end"]);break;case"size":r.percent(e,t);break;case"align":r.alt(e,t,["start","middle","end","left","right"])}}),/:/,/\s/),t.region=r.get("region",null),t.vertical=r.get("vertical",""),t.line=r.get("line","auto"),t.lineAlign=r.get("lineAlign","start"),t.snapToLines=r.get("snapToLines",!0),t.size=r.get("size",100),t.align=r.get("align","middle"),t.position=r.get("position",{start:0,left:0,middle:50,end:100,right:100},t.align),t.positionAlign=r.get("positionAlign",{start:"start",left:"start",middle:"middle",end:"end",right:"end"},t.align)}(e,t)}function me(e,t){function n(e){return si[e]}for(var r,i=e.document.createElement("div"),a=i,s=[];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]){s.length&&s[s.length-1]===r.substr(2).replace(">","")&&(s.pop(),a=a.parentNode);continue}var o,u=he(r.substr(1,r.length-2));if(u){o=e.document.createProcessingInstruction("timestamp",u),a.appendChild(o);continue}var l=r.match(/^<([^.\s\/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!l)continue;if(!(o=function(t,n){var r=oi[t];if(!r)return null;var i=e.document.createElement(r);i.localName=r;var a=ui[t];return a&&n&&(i[a]=n.trim()),i}(l[1],l[3])))continue;if(!function(e,t){return!li[t.localName]||li[t.localName]===e.localName}(a,o))continue;l[2]&&(o.className=l[2].substr(1).replace("."," ")),s.push(l[1]),a.appendChild(o),a=o}return i}function ge(e){for(var t=0;t=n[0]&&e<=n[1])return!0}return!1}function ye(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="";if(!e||!e.childNodes)return"ltr";for(t(r,e);i=n(r);)for(var a=0;a=0&&e.line<=100))return e.line;if(!e.track||!e.track.textTrackList||!e.track.textTrackList.mediaElement)return-1;for(var t=e.track,n=t.textTrackList,r=0,i=0;id&&(c=c<0?-1:1,c*=Math.ceil(d/l)*l),s<0&&(c+=""===a.vertical?n.height:n.width,o=o.reverse()),i.move(h,c)}else{var f=i.lineHeight/n.height*100;switch(a.lineAlign){case"middle":s-=f/2;break;case"end":s-=f}switch(a.vertical){case"":t.applyStyles({top:t.formatStyle(s,"%")});break;case"rl":t.applyStyles({left:t.formatStyle(s,"%")});break;case"lr":t.applyStyles({right:t.formatStyle(s,"%")})}o=["+y","-x","+x","-y"],i=new Te(t)}var p=function(e,t){for(var i,a=new Te(e),s=1,o=0;ou&&(i=new Te(e),s=u),e=new Te(a)}return i||a}(i,o);t.move(p.toCSSCompatValues(n))}function Ee(){}function ke(e){return"string"==typeof e&&!!pi[e.toLowerCase()]&&e.toLowerCase()}function we(e,t,n){this.hasBeenReset=!1;var r="",i=!1,a=e,s=t,o=n,u=null,l="",c=!0,d="auto",h="start",f=50,p="middle",v=50,m="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 s},set:function(e){if("number"!=typeof e)throw new TypeError("End time must be set to a number.");s=e,this.hasBeenReset=!0}},text:{enumerable:!0,get:function(){return o},set:function(e){o=""+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=function(e){return"string"==typeof e&&!!fi[e.toLowerCase()]&&e.toLowerCase()}(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!==hi)throw new SyntaxError("An invalid number or illegal string was specified.");d=e,this.hasBeenReset=!0}},lineAlign:{enumerable:!0,get:function(){return h},set:function(e){var t=ke(e);if(!t)throw new SyntaxError("An invalid or illegal string was specified.");h=t,this.hasBeenReset=!0}},position:{enumerable:!0,get:function(){return f},set:function(e){if(e<0||e>100)throw new Error("Position must be between 0 and 100.");f=e,this.hasBeenReset=!0}},positionAlign:{enumerable:!0,get:function(){return p},set:function(e){var t=ke(e);if(!t)throw new SyntaxError("An invalid or illegal string was specified.");p=t,this.hasBeenReset=!0}},size:{enumerable:!0,get:function(){return v},set:function(e){if(e<0||e>100)throw new Error("Size must be between 0 and 100.");v=e,this.hasBeenReset=!0}},align:{enumerable:!0,get:function(){return m},set:function(e){var t=ke(e);if(!t)throw new SyntaxError("An invalid or illegal string was specified.");m=t,this.hasBeenReset=!0}}}),this.displayState=void 0}function Ce(e){return"number"==typeof e&&e>=0&&e<=100}function Ae(e,t,n){e.setTimeout((function(){return function e(t,n,i,a,s,o){void 0===t&&(t={}),void 0===n&&(n=[]),void 0===s&&(s=[]),void 0===o&&(o=!1);var u=n,l=u[0],c=u.slice(1);if("string"==typeof l)e(t,bi[l],i,a,s,o);else if(l){var d=function(e,t){var n=Ti[e.id()],r=null;if(null==n)return r=t(e),Ti[e.id()]=[[t,r]],r;for(var i=0;i=0;i--){var a=e[i];a[t]&&a[t](r,n)}}(e,n,o,s),o}function Re(e){return function(t,n){return t===Si?Si:n[e]?n[e](t):t}}function xe(e){if(!e.type){var t=Ai(e.src);t&&(e.type=t)}return e}function Ie(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 Oe(e,t,n){try{e.style[t]=n}catch(e){return}}function De(e,t){return void 0===t&&(t=e),Fi(e,t)}function Pe(e,t){if(t&&(e=t(e)),e&&"none"!==e)return e}function Me(e,t,n){var r=Me.getPlayer(e);if(r)return t&&Ke.warn('Player "'+e+'" is already initialised. Options will not be applied.'),n&&r.ready(n),r;var a="string"==typeof e?Xe("#"+gs(e)):e;if(!c(a))throw new TypeError("The element or ID supplied is not valid. (videojs)");a.ownerDocument.defaultView&&a.ownerDocument.body.contains(a)||Ke.warn("The element supplied is not included in the DOM"),t=t||{},Me.hooks("beforesetup").forEach((function(e){var n=e(a,$(t));i(n)&&!Array.isArray(n)?t=$(t,n):Ke.error("please return an object in beforesetup hooks")}));var s=wt.getComponent("Player");return r=new s(a,t,n),Me.hooks("setup").forEach((function(e){return e(r)})),r}function je(){return(je=Object.assign||function(e){for(var t=1;t0)for(var a=0,s=i.length;a=n&&(t.apply(void 0,arguments),r=i)}},ft=function(){};ft.prototype.allowedEvents_={},ft.prototype.on=function(e,t){var n=this.addEventListener;this.addEventListener=function(){},N(this,e,t),this.addEventListener=n},ft.prototype.addEventListener=ft.prototype.on,ft.prototype.off=function(e,t){G(this,e,t)},ft.prototype.removeEventListener=ft.prototype.off,ft.prototype.one=function(e,t){var n=this.addEventListener;this.addEventListener=function(){},H(this,e,t),this.addEventListener=n},ft.prototype.any=function(e,t){var n=this.addEventListener;this.addEventListener=function(){},z(this,e,t),this.addEventListener=n},ft.prototype.trigger=function(e){var t=e.type||e;"string"==typeof e&&(e={type:t}),e=F(e),this.allowedEvents_[t]&&this["on"+t]&&this["on"+t](e),V(this,e)},ft.prototype.dispatchEvent=ft.prototype.trigger,ft.prototype.queueTrigger=function(t){var n=this;ot||(ot=new Map);var r=t.type||t,i=ot.get(this);i||(i=new Map,ot.set(this,i));var a=i.get(r);i.delete(r),e.clearTimeout(a);var s=e.setTimeout((function(){0===i.size&&(i=null,ot.delete(n)),n.trigger(t)}),0);i.set(r,s)};var pt=function(e){return e instanceof ft||!!e.eventBusEl_&&["on","one","off","trigger"].every((function(t){return"function"==typeof e[t]}))},vt=function(e){return"string"==typeof e&&/\S/.test(e)||Array.isArray(e)&&!!e.length},mt=function(e){if(!e.nodeName&&!pt(e))throw new Error("Invalid target; must be a DOM node or evented object.")},gt=function(e){if(!vt(e))throw new Error("Invalid event type; must be a non-empty string or array.")},yt=function(e){if("function"!=typeof e)throw new Error("Invalid listener; must be a function.")},_t=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]),mt(n),gt(r),yt(i),{isTargetingSelf:a,target:n,type:r,listener:i=dt(e,i)}},bt=function(e,t,n,r){mt(e),e.nodeName?it[t](e,n,r):e[t](n,r)},Tt={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_),Ze.has(this.el_)&&Ze.delete(this.el_),this.el_=null),this.player_=null},n.player=function(){return this.player_},n.options=function(e){return e?(this.options_=$(this.options_,e),this.options_):this.options_},n.el=function(){return this.el_},n.createEl=function(e,t,n){return f(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],s=r&&r.split("-")[0],o=i&&i[s],u=n;return a&&a[e]?u=a[e]:o&&o[e]&&(u=o[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){var i,a;if(void 0===n&&(n={}),void 0===r&&(r=this.children_.length),"string"==typeof e){a=kt(e);var s=n.componentClass||a;n.name=a;var o=t.getComponent(s);if(!o)throw new Error("Component "+s+" does not exist");if("function"!=typeof o)return null;i=new o(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&&kt(i.name()))&&(this.childNameIndex_[a]=i,this.childNameIndex_[Et(a)]=i),"function"==typeof i.el&&i.el()){var u=this.contentEl().children[r]||null;this.contentEl().insertBefore(i.el(),u)}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_[kt(e.name())]=null,this.childNameIndex_[Et(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=t.getComponent("Tech");(r=Array.isArray(n)?n:Object.keys(n)).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?i=n[r=t]||e.options_[r]||{}:(r=t.name,i=t),{name:r,opts:i}})).filter((function(e){var n=t.getComponent(e.opts.componentClass||kt(e.name));return n&&!a.isTech(n)})).forEach((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)}}))}},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 Xe(e,t||this.contentEl())},n.$$=function(e,t){return Je(e,t||this.contentEl())},n.hasClass=function(e){return m(this.el_,e)},n.addClass=function(e){g(this.el_,e)},n.removeClass=function(e){y(this.el_,e)},n.toggleClass=function(e,t){_(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 S(this.el_,e)},n.setAttribute=function(e,t){E(this.el_,e,t)},n.removeAttribute=function(e){k(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"+kt(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=s(this.el_,e),0===(t=parseFloat(t))||isNaN(t)){var n="offset"+kt(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;Math.sqrt(n*n+i*i)>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=dt(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=dt(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=dt(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,r=this;return this.supportsRaf_?(this.clearTimersOnDispose_(),t=dt(this,t),n=e.requestAnimationFrame((function(){r.rafIds_.has(n)&&r.rafIds_.delete(n),t()})),this.rafIds_.add(n),n):this.setTimeout(t,1e3/60)},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)throw new Error('Illegal component, "'+e+'"; '+(i?"techs must be registered using Tech.registerTech()":"must be a Component subclass")+".");e=kt(e),t.components_||(t.components_={});var s=t.getComponent("Player");if("Player"===e&&s&&s.players){var o=s.players,u=Object.keys(o);if(o&&u.length>0&&u.map((function(e){return o[e]})).every(Boolean))throw new Error("Can not register Player component after player has been created.")}return t.components_[e]=n,t.components_[Et(e)]=n,n},t.getComponent=function(e){if(e&&t.components_)return t.components_[e]},t}();wt.prototype.supportsRaf_="function"==typeof e.requestAnimationFrame&&"function"==typeof e.cancelAnimationFrame,wt.registerComponent("Component",wt);for(var Ct,At=e.navigator&&e.navigator.userAgent||"",Lt=/AppleWebKit\/([\d.]+)/i.exec(At),Rt=Lt?parseFloat(Lt.pop()):null,xt=/iPad/i.test(At),It=/iPhone/i.test(At)&&!xt,Ot=/iPod/i.test(At),Dt=It||xt||Ot,Pt=function(){var e=At.match(/OS (\d+)_/i);return e&&e[1]?e[1]:null}(),Mt=/Android/i.test(At),jt=function(){var e=At.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}(),Ut=Mt&&jt<5&&Rt<537,Bt=/Firefox/i.test(At),Ft=/Edge/i.test(At),Nt=!Ft&&(/Chrome/i.test(At)||/CriOS/i.test(At)),Gt=function(){var e=At.match(/(Chrome|CriOS)\/(\d+)/);return e&&e[2]?parseFloat(e[2]):null}(),Vt=function(){var e=/MSIE\s(\d+)\.\d/.exec(At),t=e&&parseFloat(e[1]);return!t&&/Trident\/7.0/i.test(At)&&/rv:11.0/.test(At)&&(t=11),t}(),Ht=/Safari/i.test(At)&&!Nt&&!Mt&&!Ft,zt=(Ht||Dt)&&!Nt,Wt=/Windows/i.test(At),Kt=(l()&&("ontouchstart"in e||e.navigator.maxTouchPoints||e.DocumentTouch&&e.document instanceof e.DocumentTouch)),qt=Object.freeze({IS_IPAD:xt,IS_IPHONE:It,IS_IPOD:Ot,IS_IOS:Dt,IOS_VERSION:Pt,IS_ANDROID:Mt,ANDROID_VERSION:jt,IS_NATIVE_ANDROID:Ut,IS_FIREFOX:Bt,IS_EDGE:Ft,IS_CHROME:Nt,CHROME_VERSION:Gt,IE_VERSION:Vt,IS_SAFARI:Ht,IS_ANY_SAFARI:zt,IS_WINDOWS:Wt,TOUCH_ENABLED:Kt}),$t={prefixed:!0},Yt=[["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"]],Xt=Yt[0],Jt=0;Jt=0;r--)if(t[r].enabled){dn(t,t[r]);break}return(n=e.call(this,t)||this).changing_=!1,n}Y(t,e);var n=t.prototype;return n.addTrack=function(t){var n=this;t.enabled&&dn(this,t),e.prototype.addTrack.call(this,t),t.addEventListener&&(t.enabledChange_=function(){n.changing_||(n.changing_=!0,dn(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}(un),fn=function(e,t){for(var n=0;n=0;r--)if(t[r].selected){fn(t,t[r]);break}return(n=e.call(this,t)||this).changing_=!1,Object.defineProperty(Z(n),"selectedIndex",{get:function(){for(var e=0;e=0&&"[object Function]"===Dn.call(e.callee)),n};if(!Object.keys){var Mn=Object.prototype.hasOwnProperty,jn=Object.prototype.toString,Un=Pn,Bn=Object.prototype.propertyIsEnumerable,Fn=!Bn.call({toString:null},"toString"),Nn=Bn.call((function(){}),"prototype"),Gn=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],Vn=function(e){var t=e.constructor;return t&&t.prototype===e},Hn={$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},zn=function(){if("undefined"==typeof window)return!1;for(var e in window)try{if(!Hn["$"+e]&&Mn.call(window,e)&&null!==window[e]&&"object"==typeof window[e])try{Vn(window[e])}catch(e){return!0}}catch(e){return!0}return!1}();cn=function(e){var t=null!==e&&"object"==typeof e,n="[object Function]"===jn.call(e),r=Un(e),i=t&&"[object String]"===jn.call(e),a=[];if(!t&&!n&&!r)throw new TypeError("Object.keys called on a non-object");var s=Nn&&n;if(i&&e.length>0&&!Mn.call(e,0))for(var o=0;o0)for(var u=0;u2?arguments[2]:{},r=Xn(t);Jn&&(r=Zn.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 lr))throw new SyntaxError("intrinsic "+e+" does not exist!");if(void 0===lr[n]&&!t)throw new TypeError("intrinsic "+e+" exists, but is not available. Please file an issue!");return lr[n]},dr=On.call(Function.call,Object.prototype.hasOwnProperty),hr=cr("%TypeError%"),fr=cr("%SyntaxError%"),pr={"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(dr(t,r)&&!n[r])return!1;var i=dr(t,"[[Value]]"),a=dr(t,"[[Get]]")||dr(t,"[[Set]]");if(i&&a)throw new hr("Property Descriptors may not be both accessor and data descriptors");return!0}},vr=function(e,t,n,r){var i=pr[t];if("function"!=typeof i)throw new fr("unknown record type: "+t);if(!i(e,r))throw new hr(n+" must be a "+t);console.log(i(e,r),r)},mr=Number.isNaN||function(e){return e!=e},gr=Number.isNaN||function(e){return e!=e},yr=Number.isFinite||function(e){return"number"==typeof e&&!gr(e)&&e!==1/0&&e!==-1/0},_r=function(e){return e>=0?1:-1},br=Function.prototype.toString,Tr=/^\s*class\b/,Sr=function(e){try{var t=br.call(e);return Tr.test(t)}catch(e){return!1}},Er=Object.prototype.toString,kr="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag,wr=function(e){if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;if("function"==typeof e&&!e.prototype)return!0;if(kr)return function(e){try{return!Sr(e)&&(br.call(e),!0)}catch(e){return!1}}(e);if(Sr(e))return!1;var t=Er.call(e);return"[object Function]"===t||"[object GeneratorFunction]"===t},Cr=function(e){return null===e||"function"!=typeof e&&"object"!=typeof e},Ar=Object.prototype.toString,Lr=function(e){var t;if((t=arguments.length>1?arguments[1]:"[object Date]"===Ar.call(e)?String:Number)===String||t===Number){var n,r,i=t===String?["toString","valueOf"]:["valueOf","toString"];for(r=0;r1?Lr(e,arguments[1]):Lr(e)},ToBoolean:function(e){return!!e},ToNumber:function(e){return+e},ToInteger:function(e){var t=this.ToNumber(e);return mr(t)?0:0!==t&&yr(t)?_r(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);return mr(t)||0===t||!yr(t)?0:function(e,t){var n=e%t;return Math.floor(n>=0?n:n+t)}(_r(t)*Math.floor(Math.abs(t)),65536)},ToString:function(e){return Ir(e)},ToObject:function(e){return this.CheckObjectCoercible(e),Rr(e)},CheckObjectCoercible:function(e,t){if(null==e)throw new xr(t||"Cannot call method on "+e);return e},IsCallable:wr,SameValue:function(e,t){return e===t?0!==e||1/e==1/t:mr(e)&&mr(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(dr(e,n)&&!t[n])return!1;var r=dr(e,"[[Value]]"),i=dr(e,"[[Get]]")||dr(e,"[[Set]]");if(r&&i)throw new xr("Property Descriptors may not be both accessor and data descriptors");return!0},IsAccessorDescriptor:function(e){return void 0!==e&&(vr(this,"Property Descriptor","Desc",e),!(!dr(e,"[[Get]]")&&!dr(e,"[[Set]]")))},IsDataDescriptor:function(e){return void 0!==e&&(vr(this,"Property Descriptor","Desc",e),!(!dr(e,"[[Value]]")&&!dr(e,"[[Writable]]")))},IsGenericDescriptor:function(e){return void 0!==e&&(vr(this,"Property Descriptor","Desc",e),!this.IsAccessorDescriptor(e)&&!this.IsDataDescriptor(e))},FromPropertyDescriptor:function(e){if(void 0===e)return e;if(vr(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 xr("FromPropertyDescriptor must be called with a fully populated Property Descriptor")},ToPropertyDescriptor:function(e){if("Object"!==this.Type(e))throw new xr("ToPropertyDescriptor requires an object");var t={};if(dr(e,"enumerable")&&(t["[[Enumerable]]"]=this.ToBoolean(e.enumerable)),dr(e,"configurable")&&(t["[[Configurable]]"]=this.ToBoolean(e.configurable)),dr(e,"value")&&(t["[[Value]]"]=e.value),dr(e,"writable")&&(t["[[Writable]]"]=this.ToBoolean(e.writable)),dr(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(dr(e,"set")){var r=e.set;if(void 0!==r&&!this.IsCallable(r))throw new xr("setter must be a function");t["[[Set]]"]=r}if((dr(t,"[[Get]]")||dr(t,"[[Set]]"))&&(dr(t,"[[Value]]")||dr(t,"[[Writable]]")))throw new xr("Invalid property descriptor. Cannot both specify accessors and a value or writable attribute");return t}},Dr=On.call(Function.call,String.prototype.replace),Pr=/^[\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]+/,Mr=/[\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]+$/,jr=function(){var e=Or.ToString(Or.CheckObjectCoercible(this));return Dr(Dr(e,Pr,""),Mr,"")},Ur=function(){return String.prototype.trim&&"​"==="​".trim()?String.prototype.trim:jr},Br=On.call(Function.call,Ur());ir(Br,{getPolyfill:Ur,implementation:jr,shim:function(){var e=Ur();return ir(String.prototype,{trim:e},{trim:function(){return String.prototype.trim!==e}}),e}});var Fr=Br,Nr=Object.prototype.toString,Gr=Object.prototype.hasOwnProperty,Vr=function(e,t,n){for(var r=0,i=e.length;r=3&&(r=n),"[object Array]"===Nr.call(e)?Vr(e,t,r):"string"==typeof e?Hr(e,t,r):zr(e,t,r)},Kr=function(e){if(!e)return{};var t={};return Wr(Fr(e).split("\n"),(function(e){var n=e.indexOf(":"),r=Fr(e.slice(0,n)).toLowerCase(),i=Fr(e.slice(n+1));void 0===t[r]?t[r]=i:function(e){return"[object Array]"===Object.prototype.toString.call(e)}(t[r])?t[r].push(i):t[r]=[t[r],i]})),t},qr=function(){for(var e={},t=0;t0&&(e.console&&e.console.groupCollapsed&&e.console.groupCollapsed("Text Track parsing errors for "+n.src),i.forEach((function(e){return Ke.error(e)})),e.console&&e.console.groupEnd&&e.console.groupEnd()),r.flush()},Jr=function(t,n){var r={uri:t},i=Cn(t);i&&(r.cors=i),Yr(r,dt(this,(function(t,r,i){if(t)return Ke.error(t,r);n.loaded_=!0,"function"!=typeof e.WebVTT?n.tech_&&n.tech_.any(["vttjsloaded","vttjserror"],(function(e){return"vttjserror"===e.type?void Ke.error("vttjs failed to load, stopping trying to process "+n.src):Xr(i,n)})):Xr(i,n)})))},Qr=function(t){function n(e){var n;if(void 0===e&&(e={}),!e.tech)throw new Error("A tech was not provided.");var r=$(e,{kind:bn[e.kind]||"subtitles",language:e.language||e.srclang||""}),i=Tn[r.mode]||"disabled",a=r.default;"metadata"!==r.kind&&"chapters"!==r.kind||(i="hidden"),(n=t.call(this,r)||this).tech_=r.tech,n.cues_=[],n.activeCues_=[];var s=new gn(n.cues_),o=new gn(n.activeCues_),u=!1,l=dt(Z(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(Z(n),{default:{get:function(){return a},set:function(){}},mode:{get:function(){return i},set:function(e){var t=this;Tn[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,r=this.cues.length;n=e||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 si={"&":"&","<":"<",">":">","‎":"‎","‏":"‏"," ":" "},oi={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"},ui={v:"title",lang:"lang"},li={rt:"ruby"},ci=[[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]];_e.prototype.applyStyles=function(e,t){for(var n in t=t||this.div,e)e.hasOwnProperty(n)&&(t.style[n]=e[n])},_e.prototype.formatStyle=function(e,t){return 0===e?0:e+t},be.prototype=ai(_e.prototype),be.prototype.constructor=be,Te.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}},Te.prototype.overlaps=function(e){return this.lefte.left&&this.tope.top},Te.prototype.overlapsAny=function(e){for(var t=0;t=e.top&&this.bottom<=e.bottom&&this.left>=e.left&&this.right<=e.right},Te.prototype.overlapsOppositeAxis=function(e,t){switch(t){case"+x":return this.lefte.right;case"+y":return this.tope.bottom}},Te.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)},Te.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}},Te.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{left:(e=e.div?e.div.getBoundingClientRect():e.tagName?e.getBoundingClientRect():e).left,right:e.right,top:e.top||r,height:e.height||t,bottom:e.bottom||r+(e.height||t),width:e.width||n}},Ee.StringDecoder=function(){return{decode:function(e){if(!e)return"";if("string"!=typeof e)throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(e))}}},Ee.convertCueToDOMTree=function(e,t){return e&&t?me(e,t):null},Ee.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")},s=function(){a();for(var e=0;e