!function(a,b){"object"==typeof exports&&"undefined"!=typeof module?module.exports=b():"function"==typeof define&&define.amd?define(b):a.videojs=b()}(this,function(){function a(a,b){return b={exports:{}},a(b,b.exports),b.exports}function b(a,b){Pb(a).forEach(function(c){return b(a[c],c)})}function c(a,b){var c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return Pb(a).reduce(function(c,d){return b(c,a[d],d)},c)}function d(a){for(var c=arguments.length,d=Array(c>1?c-1:0),e=1;e0&&void 0!==arguments[0]?arguments[0]:"div",b=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},d=arguments[3],e=lb.createElement(a);return Object.getOwnPropertyNames(b).forEach(function(a){var c=b[a];a.indexOf("aria-")!==-1||"role"===a||"type"===a?(Ub.warn(Vb(Wb,a,c)),e.setAttribute(a,c)):"textContent"===a?q(e,c):e[a]=c}),Object.getOwnPropertyNames(c).forEach(function(a){e.setAttribute(a,c[a])}),d&&J(e,d),e}function q(a,b){return"undefined"==typeof a.textContent?a.innerText=b:a.textContent=b,a}function r(a,b){b.firstChild?b.insertBefore(a,b.firstChild):b.appendChild(a)}function s(a,b){return j(b),a.classList?a.classList.contains(b):k(b).test(a.className)}function t(a,b){return a.classList?a.classList.add(b):s(a,b)||(a.className=(a.className+" "+b).trim()),a}function u(a,b){return a.classList?a.classList.remove(b):(j(b),a.className=a.className.split(/\s+/).filter(function(a){return a!==b}).join(" ")),a}function v(a,b,c){var d=s(a,b);if("function"==typeof c&&(c=c(a,b)),"boolean"!=typeof c&&(c=!d),c!==d)return c?t(a,b):u(a,b),a}function w(a,b){Object.getOwnPropertyNames(b).forEach(function(c){var d=b[c];null===d||"undefined"==typeof d||d===!1?a.removeAttribute(c):a.setAttribute(c,d===!0?"":d)})}function x(a){var b={},c=",autoplay,controls,playsinline,loop,muted,default,defaultMuted,";if(a&&a.attributes&&a.attributes.length>0)for(var d=a.attributes,e=d.length-1;e>=0;e--){var f=d[e].name,g=d[e].value;"boolean"!=typeof a[f]&&c.indexOf(","+f+",")===-1||(g=null!==g),b[f]=g}return b}function y(a,b){return a.getAttribute(b)}function z(a,b,c){a.setAttribute(b,c)}function A(a,b){a.removeAttribute(b)}function B(){lb.body.focus(),lb.onselectstart=function(){return!1}}function C(){lb.onselectstart=function(){return!0}}function D(a){if(a&&a.getBoundingClientRect&&a.parentNode){var b=a.getBoundingClientRect(),c={};return["bottom","height","left","right","top","width"].forEach(function(a){void 0!==b[a]&&(c[a]=b[a])}),c.height||(c.height=parseFloat(h(a,"height"))),c.width||(c.width=parseFloat(h(a,"width"))),c}}function E(a){var b=void 0;if(a.getBoundingClientRect&&a.parentNode&&(b=a.getBoundingClientRect()),!b)return{left:0,top:0};var c=lb.documentElement,d=lb.body,e=c.clientLeft||d.clientLeft||0,f=gb.pageXOffset||d.scrollLeft,g=b.left+f-e,h=c.clientTop||d.clientTop||0,i=gb.pageYOffset||d.scrollTop,j=b.top+i-h;return{left:Math.round(g),top:Math.round(j)}}function F(a,b){var c={},d=E(a),e=a.offsetWidth,f=a.offsetHeight,g=d.top,h=d.left,i=b.pageY,j=b.pageX;return b.changedTouches&&(j=b.changedTouches[0].pageX,i=b.changedTouches[0].pageY),c.y=Math.max(0,Math.min(1,(g-i+f)/f)),c.x=Math.max(0,Math.min(1,(j-h)/e)),c}function G(a){return e(a)&&3===a.nodeType}function H(a){for(;a.firstChild;)a.removeChild(a.firstChild);return a}function I(a){return"function"==typeof a&&(a=a()),(Array.isArray(a)?a:[a]).map(function(a){return"function"==typeof a&&(a=a()),m(a)||G(a)?a:"string"==typeof a&&/\S/.test(a)?lb.createTextNode(a):void 0}).filter(function(a){return a})}function J(a,b){return I(b).forEach(function(b){return a.appendChild(b)}),a}function K(a,b){return J(H(a),b)}function L(){return $b++}function M(a){var b=a[ac];return b||(b=a[ac]=L()),_b[b]||(_b[b]={}),_b[b]}function N(a){var b=a[ac];return!!b&&!!Object.getOwnPropertyNames(_b[b]).length}function O(a){var b=a[ac];if(b){delete _b[b];try{delete a[ac]}catch(c){a.removeAttribute?a.removeAttribute(ac):a[ac]=null}}}function P(a,b){var c=M(a);0===c.handlers[b].length&&(delete c.handlers[b],a.removeEventListener?a.removeEventListener(b,c.dispatcher,!1):a.detachEvent&&a.detachEvent("on"+b,c.dispatcher)),Object.getOwnPropertyNames(c.handlers).length<=0&&(delete c.handlers,delete c.dispatcher,delete c.disabled),0===Object.getOwnPropertyNames(c).length&&O(a)}function Q(a,b,c,d){c.forEach(function(c){a(b,c,d)})}function R(a){function b(){return!0}function c(){return!1}if(!a||!a.isPropagationStopped){var d=a||gb.event;a={};for(var e in d)"layerX"!==e&&"layerY"!==e&&"keyLocation"!==e&&"webkitMovementX"!==e&&"webkitMovementY"!==e&&("returnValue"===e&&d.preventDefault||(a[e]=d[e]));if(a.target||(a.target=a.srcElement||lb),a.relatedTarget||(a.relatedTarget=a.fromElement===a.target?a.toElement:a.fromElement),a.preventDefault=function(){d.preventDefault&&d.preventDefault(),a.returnValue=!1,d.returnValue=!1,a.defaultPrevented=!0},a.defaultPrevented=!1,a.stopPropagation=function(){d.stopPropagation&&d.stopPropagation(),a.cancelBubble=!0,d.cancelBubble=!0,a.isPropagationStopped=b},a.isPropagationStopped=c,a.stopImmediatePropagation=function(){d.stopImmediatePropagation&&d.stopImmediatePropagation(),a.isImmediatePropagationStopped=b,a.stopPropagation()},a.isImmediatePropagationStopped=c,null!==a.clientX&&void 0!==a.clientX){var f=lb.documentElement,g=lb.body;a.pageX=a.clientX+(f&&f.scrollLeft||g&&g.scrollLeft||0)-(f&&f.clientLeft||g&&g.clientLeft||0),a.pageY=a.clientY+(f&&f.scrollTop||g&&g.scrollTop||0)-(f&&f.clientTop||g&&g.clientTop||0)}a.which=a.charCode||a.keyCode,null!==a.button&&void 0!==a.button&&(a.button=1&a.button?0:4&a.button?1:2&a.button?2:0)}return a}function S(a,b,c){if(Array.isArray(b))return Q(S,a,b,c);var d=M(a);if(d.handlers||(d.handlers={}),d.handlers[b]||(d.handlers[b]=[]),c.guid||(c.guid=L()),d.handlers[b].push(c),d.dispatcher||(d.disabled=!1,d.dispatcher=function(b,c){if(!d.disabled){b=R(b);var e=d.handlers[b.type];if(e)for(var f=e.slice(0),g=0,h=f.length;g-1&&(e={passive:!0}),a.addEventListener(b,d.dispatcher,e)}else a.attachEvent&&a.attachEvent("on"+b,d.dispatcher)}function T(a,b,c){if(N(a)){var d=M(a);if(d.handlers){if(Array.isArray(b))return Q(T,a,b,c);var e=function(b){d.handlers[b]=[],P(a,b)};if(b){var f=d.handlers[b];if(f){if(!c)return void e(b);if(c.guid)for(var g=0;g1&&void 0!==arguments[1]?arguments[1]:{},c=b.eventBusKey;if(c){if(!a[c].nodeName)throw new Error('The eventBusKey "'+c+'" does not refer to an element.');a.eventBusEl_=a[c]}else a.eventBusEl_=p("span",{className:"vjs-event-bus"});return d(a,tc),a.on("dispose",function(){return a.off()}),a}function Y(a,b){return d(a,uc),a.state=d({},a.state,b),"function"==typeof a.handleStateChanged&&mc(a)&&a.on("statechanged",a.handleStateChanged),a}function Z(a){return"string"!=typeof a?a:a.charAt(0).toUpperCase()+a.slice(1)}function $(a,b){return Z(a)===Z(b)}function _(){for(var a={},c=arguments.length,d=Array(c),e=0;ec)throw new Error("Failed to execute '"+a+"' on 'TimeRanges': The index provided ("+b+") is non-numeric or out of bounds (0-"+c+").")}function ba(a,b,c,d){return aa(a,d,c.length-1),c[d][b]}function ca(a){return void 0===a||0===a.length?{length:0,start:function(){throw new Error("This TimeRanges object is empty")},end:function(){throw new Error("This TimeRanges object is empty")}}:{length:a.length,start:ba.bind(null,"start",0,a),end:ba.bind(null,"end",1,a)}}function da(a,b){return Array.isArray(a)?ca(a):void 0===a||void 0===b?ca():ca([[a,b]])}function ea(a,b){var c=0,d=void 0,e=void 0;if(!b)return 0;a&&a.length||(a=da(0,0));for(var f=0;fb&&(e=b),c+=e-d;return c/b}function fa(a){return a instanceof fa?a:("number"==typeof a?this.code=a:"string"==typeof a?this.message=a:e(a)&&("number"==typeof a.code&&(this.code=a.code),d(this,a)),void(this.message||(this.message=fa.defaultMessages[this.code]||"")))}function ga(a,b){var c,d=null;try{c=JSON.parse(a,b)}catch(e){d=e}return[d,c]}function ha(a){var b=dd.call(a);return"[object Function]"===b||"function"==typeof a&&"[object RegExp]"!==b||"undefined"!=typeof window&&(a===window.setTimeout||a===window.alert||a===window.confirm||a===window.prompt)}function ia(a,b,c){if(!cd(b))throw new TypeError("iterator must be a function");arguments.length<3&&(c=this),"[object Array]"===gd.call(a)?ja(a,b,c):"string"==typeof a?ka(a,b,c):la(a,b,c)}function ja(a,b,c){for(var d=0,e=a.length;d0&&(k=setTimeout(function(){if(!j){j=!0,h.abort("timeout");var a=new Error("XMLHttpRequest timeout");a.code="ETIMEDOUT",d(a)}},a.timeout)),h.setRequestHeader)for(i in o)o.hasOwnProperty(i)&&h.setRequestHeader(i,o[i]);else if(a.headers&&!oa(a.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in a&&(h.responseType=a.responseType),"beforeSend"in a&&"function"==typeof a.beforeSend&&a.beforeSend(h),h.send(n||null),h}function sa(a){if("document"===a.responseType)return a.responseXML;var b=a.responseXML&&"parsererror"===a.responseXML.documentElement.nodeName;return""!==a.responseType||b?null:a.responseXML}function ta(){}function ua(a,b){this.name="ParsingError",this.code=a.code,this.message=b||a.message}function va(a){function b(a,b,c,d){return 3600*(0|a)+60*(0|b)+(0|c)+(0|d)/1e3}var c=a.match(/^(\d+):(\d{2})(:\d{2})?\.(\d{3})/);return c?c[3]?b(c[1],c[2],c[3].replace(":",""),c[4]):c[1]>59?b(c[1],c[2],0,c[4]):b(0,c[1],c[2],c[4]):null}function wa(){this.values=Ad(null)}function xa(a,b,c,d){var e=d?a.split(d):[a];for(var f in e)if("string"==typeof e[f]){var g=e[f].split(c);if(2===g.length){var h=g[0],i=g[1];b(h,i)}}}function ya(a,b,c){function d(){var b=va(a);if(null===b)throw new ua(ua.Errors.BadTimeStamp,"Malformed timestamp: "+g);return a=a.replace(/^[^\sa-zA-Z-]+/,""),b}function e(a,b){var d=new wa;xa(a,function(a,b){switch(a){case"region":for(var e=c.length-1;e>=0;e--)if(c[e].id===b){d.set(a,c[e].region);break}break;case"vertical":d.alt(a,b,["rl","lr"]);break;case"line":var f=b.split(","),g=f[0];d.integer(a,g),d.percent(a,g)?d.set("snapToLines",!1):null,d.alt(a,g,["auto"]),2===f.length&&d.alt("lineAlign",f[1],["start","middle","end"]);break;case"position":f=b.split(","),d.percent(a,f[0]),2===f.length&&d.alt("positionAlign",f[1],["start","middle","end"]);break;case"size":d.percent(a,b);break;case"align":d.alt(a,b,["start","middle","end","left","right"])}},/:/,/\s/),b.region=d.get("region",null),b.vertical=d.get("vertical",""),b.line=d.get("line","auto"),b.lineAlign=d.get("lineAlign","start"),b.snapToLines=d.get("snapToLines",!0),b.size=d.get("size",100),b.align=d.get("align","middle"),b.position=d.get("position",{start:0,left:0,middle:50,end:100,right:100},b.align),b.positionAlign=d.get("positionAlign",{start:"start",left:"start",middle:"middle",end:"end",right:"end"},b.align)}function f(){a=a.replace(/^\s+/,"")}var g=a;if(f(),b.startTime=d(),f(),"-->"!==a.substr(0,3))throw new ua(ua.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '-->'): "+g);a=a.substr(3),f(),b.endTime=d(),f(),e(a,b)}function za(a,b){function c(){function a(a){return b=b.substr(a.length),a}if(!b)return null;var c=b.match(/^([^<]*)(<[^>]+>?)?/);return a(c[1]?c[1]:c[2])}function d(a){return Bd[a]}function e(a){for(;n=a.match(/&(amp|lt|gt|lrm|rlm|nbsp);/);)a=a.replace(n[0],d);return a}function f(a,b){return!Ed[b.localName]||Ed[b.localName]===a.localName}function g(b,c){var d=Cd[b];if(!d)return null;var e=a.document.createElement(d);e.localName=d;var f=Dd[b];return f&&c&&(e[f]=c.trim()),e}for(var h,i=a.document.createElement("div"),j=i,k=[];null!==(h=c());)if("<"!==h[0])j.appendChild(a.document.createTextNode(e(h)));else{if("/"===h[1]){k.length&&k[k.length-1]===h.substr(2).replace(">","")&&(k.pop(),j=j.parentNode);continue}var l,m=va(h.substr(1,h.length-2));if(m){l=a.document.createProcessingInstruction("timestamp",m),j.appendChild(l);continue}var n=h.match(/^<([^.\s\/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!n)continue;if(l=g(n[1],n[3]),!l)continue;if(!f(j,l))continue;n[2]&&(l.className=n[2].substr(1).replace("."," ")),k.push(n[1]),j.appendChild(l),j=l}return i}function Aa(a){for(var b=0;b=c[0]&&a<=c[1])return!0}return!1}function Ba(a){function b(a,b){for(var c=b.childNodes.length-1;c>=0;c--)a.push(b.childNodes[c])}function c(a){if(!a||!a.length)return null;var d=a.pop(),e=d.textContent||d.innerText;if(e){var f=e.match(/^.*(\n|\r)/);return f?(a.length=0,f[0]):e}return"ruby"===d.tagName?c(a):d.childNodes?(b(a,d),c(a)):void 0}var d,e=[],f="";if(!a||!a.childNodes)return"ltr";for(b(e,a);f=c(e);)for(var g=0;g=0&&a.line<=100))return a.line;if(!a.track||!a.track.textTrackList||!a.track.textTrackList.mediaElement)return-1;for(var b=a.track,c=b.textTrackList,d=0,e=0;ei&&(e=new Fa(a),g=i),a=new Fa(f)}return e||f}var f=new Fa(b),g=b.cue,h=Ca(g),i=[];if(g.snapToLines){var j;switch(g.vertical){case"":i=["+y","-y"],j="height";break;case"rl":i=["+x","-x"],j="width";break;case"lr":i=["-x","+x"],j="width"}var k=f.lineHeight,l=k*Math.round(h),m=c[j]+k,n=i[0];Math.abs(l)>m&&(l=l<0?-1:1,l*=Math.ceil(m/k)*k),h<0&&(l+=""===g.vertical?c.height:c.width,i=i.reverse()),f.move(n,l)}else{var o=f.lineHeight/c.height*100;switch(g.lineAlign){case"middle":h-=o/2;break;case"end":h-=o}switch(g.vertical){case"":b.applyStyles({top:b.formatStyle(h,"%")});break;case"rl":b.applyStyles({left:b.formatStyle(h,"%")});break;case"lr":b.applyStyles({right:b.formatStyle(h,"%")})}i=["+y","-x","+x","-y"],f=new Fa(b)}var p=e(f,i);b.move(p.toCSSCompatValues(c))}function Ha(){}function Ia(a){if("string"!=typeof a)return!1;var b=Ld[a.toLowerCase()];return!!b&&a.toLowerCase()}function Ja(a){if("string"!=typeof a)return!1;var b=Md[a.toLowerCase()];return!!b&&a.toLowerCase()}function Ka(a){for(var b=1;b100)throw new Error("Position must be between 0 and 100.");q=a,this.hasBeenReset=!0}})),Object.defineProperty(d,"positionAlign",Ka({},f,{get:function(){return r},set:function(a){var b=Ja(a);if(!b)throw new SyntaxError("An invalid or illegal string was specified.");r=b,this.hasBeenReset=!0}})),Object.defineProperty(d,"size",Ka({},f,{get:function(){return s},set:function(a){if(a<0||a>100)throw new Error("Size must be between 0 and 100.");s=a,this.hasBeenReset=!0}})),Object.defineProperty(d,"align",Ka({},f,{get:function(){return t},set:function(a){var b=Ja(a);if(!b)throw new SyntaxError("An invalid or illegal string was specified.");t=b,this.hasBeenReset=!0}})),d.displayState=void 0,e)return d}function Ma(a){if("string"!=typeof a)return!1;var b=Od[a.toLowerCase()];return!!b&&a.toLowerCase()}function Na(a){return"number"==typeof a&&a>=0&&a<=100}function Oa(){var a=100,b=3,c=0,d=100,e=0,f=100,g="";Object.defineProperties(this,{width:{enumerable:!0,get:function(){return a},set:function(b){if(!Na(b))throw new Error("Width must be between 0 and 100.");a=b}},lines:{enumerable:!0,get:function(){return b},set:function(a){if("number"!=typeof a)throw new TypeError("Lines must be set to a number.");b=a}},regionAnchorY:{enumerable:!0,get:function(){return d},set:function(a){if(!Na(a))throw new Error("RegionAnchorX must be between 0 and 100.");d=a}},regionAnchorX:{enumerable:!0,get:function(){return c},set:function(a){if(!Na(a))throw new Error("RegionAnchorY must be between 0 and 100.");c=a}},viewportAnchorY:{enumerable:!0,get:function(){return f},set:function(a){if(!Na(a))throw new Error("ViewportAnchorY must be between 0 and 100.");f=a}},viewportAnchorX:{enumerable:!0,get:function(){return e},set:function(a){if(!Na(a))throw new Error("ViewportAnchorX must be between 0 and 100.");e=a}},scroll:{enumerable:!0,get:function(){return g},set:function(a){var b=Ma(a);if(b===!1)throw new SyntaxError("An invalid or illegal string was specified.");g=b}}})}function Pa(a,b,c,d){var e=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},f=a.textTracks();e.kind=b,c&&(e.label=c),d&&(e.language=d),e.tech=a;var g=new zd.text.TrackClass(e);return f.addTrack(g),g}function Qa(a,b){Sd[a]=Sd[a]||[],Sd[a].push(b)}function Ra(a,b,c){a.setTimeout(function(){return Wa(b,Sd[b.type],c,a)},1)}function Sa(a,b){a.forEach(function(a){return a.setTech&&a.setTech(b)})}function Ta(a,b,c){return a.reduceRight(Va(c),b[c]())}function Ua(a,b,c,d){return b[c](a.reduce(Va(c),d))}function Va(a){return function(b,c){return c[a]?c[a](b):b}}function Wa(){var a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},b=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],c=arguments[2],e=arguments[3],f=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[],g=arguments.length>5&&void 0!==arguments[5]&&arguments[5],h=b[0],i=b.slice(1);if("string"==typeof h)Wa(a,Sd[h],c,e,f,g);else if(h){var j=h(e);j.setSource(d({},a),function(b,d){return b?Wa(a,i,c,e,f,g):(f.push(j),void Wa(d,a.type===d.type?i:Sd[d.type],c,e,f,g))})}else i.length?Wa(a,i,c,e,f,g):g?c(a,f):Wa(a,Sd["*"],c,e,f,!0)}function Xa(a,b){return"rgba("+parseInt(a[1]+a[1],16)+","+parseInt(a[2]+a[2],16)+","+parseInt(a[3]+a[3],16)+","+b+")"}function Ya(a,b,c){try{a.style[b]=c}catch(d){return}}function Za(a){var b=arguments.length>1&&void 0!==arguments[1]?arguments[1]:a;a=a<0?0:a;var c=Math.floor(a%60),d=Math.floor(a/60%60),e=Math.floor(a/3600),f=Math.floor(b/60%60),g=Math.floor(b/3600);return(isNaN(a)||a===1/0)&&(e=d=c="-"),e=e>0||g>0?e+":":"",d=((e||f>=10)&&d<10?"0"+d:d)+":",c=c<10?"0"+c:c,e+d+c}function $a(a,b){if(b&&(a=b(a)),a&&"none"!==a)return a}function _a(a,b){var c=a.options[a.options.selectedIndex].value;return $a(c,b)}function ab(a,b,c){if(b)for(var d=0;d2&&void 0!==arguments[2]?arguments[2]:!!Db&&Db<11,d=Qb.levels[Rb],f=new RegExp("^("+d+")$");"log"!==a&&b.unshift(a.toUpperCase()+":"),Sb&&Sb.push([].concat(b)),b.unshift("VIDEOJS:");var g=gb.console&&gb.console[a];g&&d&&f.test(a)&&(c&&(b=b.map(function(a){if(e(a)||Array.isArray(a))try{return JSON.stringify(a)}catch(b){return String(a)}return String(a)}).join(" ")),g.apply?g[Array.isArray(b)?"apply":"call"](gb.console,b):g(b))};Qb=function(){for(var a=arguments.length,b=Array(a),c=0;c0)for(var d=0,e=a.length;d0)for(var f=0,g=b.length;f0)for(var h=0,i=c.length;h=b&&(a.apply(void 0,arguments),c=d)};return d},lc=function(){};lc.prototype.allowedEvents_={},lc.prototype.on=function(a,b){var c=this.addEventListener;this.addEventListener=function(){},S(this,a,b),this.addEventListener=c},lc.prototype.addEventListener=lc.prototype.on,lc.prototype.off=function(a,b){T(this,a,b)},lc.prototype.removeEventListener=lc.prototype.off,lc.prototype.one=function(a,b){var c=this.addEventListener;this.addEventListener=function(){},V(this,a,b),this.addEventListener=c},lc.prototype.trigger=function(a){var b=a.type||a;"string"==typeof a&&(a={type:b}),a=R(a),this.allowedEvents_[b]&&this["on"+b]&&this["on"+b](a),U(this,a)},lc.prototype.dispatchEvent=lc.prototype.trigger;var mc=function(a){return a instanceof lc||!!a.eventBusEl_&&["on","one","off","trigger"].every(function(b){return"function"==typeof a[b]})},nc=function(a){return"string"==typeof a&&/\S/.test(a)||Array.isArray(a)&&!!a.length},oc=function(a){if(!a.nodeName&&!mc(a))throw new Error("Invalid target; must be a DOM node or evented object.")},pc=function(a){if(!nc(a))throw new Error("Invalid event type; must be a non-empty string or array.")},qc=function(a){if("function"!=typeof a)throw new Error("Invalid listener; must be a function.")},rc=function(a,b){var c=b.length<3||b[0]===a||b[0]===a.eventBusEl_,d=void 0,e=void 0,f=void 0;return c?(d=a.eventBusEl_,b.length>=3&&b.shift(),e=b[0],f=b[1]):(d=b[0],e=b[1],f=b[2]),oc(d),pc(e),qc(f),f=jc(a,f),{isTargetingSelf:c,target:d,type:e,listener:f}},sc=function(a,b,c,d){oc(a),a.nodeName?dc[b](a,c,d):a[b](c,d)},tc={on:function(){for(var a=this,b=arguments.length,c=Array(b),d=0;d=0;a--)this.children_[a].dispose&&this.children_[a].dispose();this.children_=null,this.childIndex_=null,this.childNameIndex_=null,this.el_&&(this.el_.parentNode&&this.el_.parentNode.removeChild(this.el_),O(this.el_),this.el_=null)},a.prototype.player=function(){return this.player_},a.prototype.options=function(a){return Ub.warn("this.options() has been deprecated and will be moved to the constructor in 6.0"),a?(this.options_=_(this.options_,a),this.options_):this.options_},a.prototype.el=function(){return this.el_},a.prototype.createEl=function(a,b,c){return p(a,b,c)},a.prototype.localize=function(a,b){var c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:a,d=this.player_.language&&this.player_.language(),e=this.player_.languages&&this.player_.languages(),f=e&&e[d],g=d&&d.split("-")[0],h=e&&e[g],i=c;return f&&f[a]?i=f[a]:h&&h[a]&&(i=h[a]),b&&(i=i.replace(/\{(\d+)\}/g,function(a,c){var d=b[c-1],e=d;return"undefined"==typeof d&&(e=a),e})),i},a.prototype.contentEl=function(){return this.contentEl_||this.el_},a.prototype.id=function(){return this.id_},a.prototype.name=function(){return this.name_},a.prototype.children=function(){return this.children_},a.prototype.getChildById=function(a){return this.childIndex_[a]},a.prototype.getChild=function(a){if(a)return a=Z(a),this.childNameIndex_[a]},a.prototype.addChild=function(b){var c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},d=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.children_.length,e=void 0,f=void 0;if("string"==typeof b){f=Z(b);var g=c.componentClass||f;c.name=f;var h=a.getComponent(g);if(!h)throw new Error("Component "+g+" does not exist");if("function"!=typeof h)return null;e=new h(this.player_||this,c)}else e=b;if(this.children_.splice(d,0,e),"function"==typeof e.id&&(this.childIndex_[e.id()]=e),f=f||e.name&&Z(e.name()),f&&(this.childNameIndex_[f]=e),"function"==typeof e.el&&e.el()){var i=this.contentEl().children,j=i[d]||null;this.contentEl().insertBefore(e.el(),j)}return e},a.prototype.removeChild=function(a){if("string"==typeof a&&(a=this.getChild(a)),a&&this.children_){for(var b=!1,c=this.children_.length-1;c>=0;c--)if(this.children_[c]===a){b=!0,this.children_.splice(c,1);break}if(b){this.childIndex_[a.id()]=null,this.childNameIndex_[a.name()]=null;var d=a.el();d&&d.parentNode===this.contentEl()&&this.contentEl().removeChild(a.el())}}},a.prototype.initChildren=function(){var b=this,c=this.options_.children;if(c){var d=this.options_,e=function(a){var c=a.name,e=a.opts;if(void 0!==d[c]&&(e=d[c]),e!==!1){e===!0&&(e={}),e.playerOptions=b.options_.playerOptions;var f=b.addChild(c,e);f&&(b[c]=f)}},f=void 0,g=a.getComponent("Tech");f=Array.isArray(c)?c:Object.keys(c),f.concat(Object.keys(this.options_).filter(function(a){return!f.some(function(b){return"string"==typeof b?a===b:a===b.name})})).map(function(a){var d=void 0,e=void 0;return"string"==typeof a?(d=a,e=c[d]||b.options_[d]||{}):(d=a.name,e=a),{name:d,opts:e}}).filter(function(b){var c=a.getComponent(b.opts.componentClass||Z(b.name));return c&&!g.isTech(c)}).forEach(e)}},a.prototype.buildCSSClass=function(){return""},a.prototype.ready=function(a){var b=arguments.length>1&&void 0!==arguments[1]&&arguments[1];a&&(this.isReady_?b?a.call(this):this.setTimeout(a,1):(this.readyQueue_=this.readyQueue_||[],this.readyQueue_.push(a)))},a.prototype.triggerReady=function(){this.isReady_=!0,this.setTimeout(function(){var a=this.readyQueue_;this.readyQueue_=[],a&&a.length>0&&a.forEach(function(a){a.call(this)},this),this.trigger("ready")},1)},a.prototype.$=function(a,b){return Xb(a,b||this.contentEl())},a.prototype.$$=function(a,b){return Yb(a,b||this.contentEl())},a.prototype.hasClass=function(a){return s(this.el_,a)},a.prototype.addClass=function(a){t(this.el_,a)},a.prototype.removeClass=function(a){u(this.el_,a)},a.prototype.toggleClass=function(a,b){v(this.el_,a,b)},a.prototype.show=function(){this.removeClass("vjs-hidden")},a.prototype.hide=function(){this.addClass("vjs-hidden")},a.prototype.lockShowing=function(){this.addClass("vjs-lock-showing")},a.prototype.unlockShowing=function(){this.removeClass("vjs-lock-showing")},a.prototype.getAttribute=function(a){return y(this.el_,a)},a.prototype.setAttribute=function(a,b){z(this.el_,a,b)},a.prototype.removeAttribute=function(a){A(this.el_,a)},a.prototype.width=function(a,b){return this.dimension("width",a,b)},a.prototype.height=function(a,b){return this.dimension("height",a,b)},a.prototype.dimensions=function(a,b){this.width(a,!0),this.height(b)},a.prototype.dimension=function(a,b,c){if(void 0!==b)return null!==b&&b===b||(b=0),(""+b).indexOf("%")!==-1||(""+b).indexOf("px")!==-1?this.el_.style[a]=b:"auto"===b?this.el_.style[a]="":this.el_.style[a]=b+"px",void(c||this.trigger("componentresize"));if(!this.el_)return 0;var d=this.el_.style[a],e=d.indexOf("px");return e!==-1?parseInt(d.slice(0,e),10):parseInt(this.el_["offset"+Z(a)],10)},a.prototype.currentDimension=function(a){var b=0;if("width"!==a&&"height"!==a)throw new Error("currentDimension only accepts width or height value");if("function"==typeof gb.getComputedStyle){var c=gb.getComputedStyle(this.el_);b=c.getPropertyValue(a)||c[a]}if(b=parseFloat(b),0===b){var d="offset"+Z(a);b=this.el_[d]}return b},a.prototype.currentDimensions=function(){return{width:this.currentDimension("width"),height:this.currentDimension("height")}},a.prototype.currentWidth=function(){return this.currentDimension("width")},a.prototype.currentHeight=function(){return this.currentDimension("height")},a.prototype.focus=function(){this.el_.focus()},a.prototype.blur=function(){this.el_.blur()},a.prototype.emitTapEvents=function(){var a=0,b=null,c=10,d=200,e=void 0;this.on("touchstart",function(c){1===c.touches.length&&(b={pageX:c.touches[0].pageX,pageY:c.touches[0].pageY},a=(new Date).getTime(),e=!0)}),this.on("touchmove",function(a){if(a.touches.length>1)e=!1;else if(b){var d=a.touches[0].pageX-b.pageX,f=a.touches[0].pageY-b.pageY,g=Math.sqrt(d*d+f*f);g>c&&(e=!1)}});var f=function(){e=!1};this.on("touchleave",f),this.on("touchcancel",f),this.on("touchend",function(c){if(b=null,e===!0){var f=(new Date).getTime()-a;f0&&j.map(function(a){return i[a]}).every(Boolean))throw new Error("Can not register Player component after player has been created.")}return a.components_[b]=c,c},a.getComponent=function(b){if(b)return b=Z(b),a.components_&&a.components_[b]?a.components_[b]:void 0},a}();vc.prototype.supportsRaf_="function"==typeof gb.requestAnimationFrame&&"function"==typeof gb.cancelAnimationFrame,vc.registerComponent("Component",vc);for(var wc={},xc=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror"],["webkitRequestFullScreen","webkitCancelFullScreen","webkitCurrentFullScreenElement","webkitCancelFullScreen","webkitfullscreenchange","webkitfullscreenerror"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError"]],yc=xc[0],zc=void 0,Ac=0;Ac0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;Kb(this,b);var f=Mb(this,a.call(this));if(!e&&(e=f,Cb)){e=lb.createElement("custom");for(var g in b.prototype)"constructor"!==g&&(e[g]=b.prototype[g])}e.tracks_=[],Object.defineProperty(e,"length",{get:function(){return this.tracks_.length}});for(var h=0;h0&&void 0!==arguments[0]?arguments[0]:[];Kb(this,b);for(var f=void 0,g=e.length-1;g>=0;g--)if(e[g].enabled){Nc(e,e[g]);break}if(Cb){f=lb.createElement("custom");for(var h in Lc.prototype)"constructor"!==h&&(f[h]=Lc.prototype[h]);for(var i in b.prototype)"constructor"!==i&&(f[i]=b.prototype[i])}return f=c=Mb(this,a.call(this,e,f)),f.changing_=!1,d=f,Mb(c,d)}return Lb(b,a),b.prototype.addTrack=function(b){var c=this;b.enabled&&Nc(this,b),a.prototype.addTrack.call(this,b),b.addEventListener&&b.addEventListener("enabledchange",function(){c.changing_||(c.changing_=!0,Nc(c,b),c.changing_=!1,c.trigger("change"))})},b}(Lc),Pc=function(a,b){for(var c=0;c0&&void 0!==arguments[0]?arguments[0]:[];Kb(this,b);for(var f=void 0,g=e.length-1;g>=0;g--)if(e[g].selected){Pc(e,e[g]);break}if(Cb){f=lb.createElement("custom");for(var h in Lc.prototype)"constructor"!==h&&(f[h]=Lc.prototype[h]);for(var i in b.prototype)"constructor"!==i&&(f[i]=b.prototype[i])}return f=c=Mb(this,a.call(this,e,f)),f.changing_=!1,Object.defineProperty(f,"selectedIndex",{get:function(){for(var a=0;a0&&void 0!==arguments[0]?arguments[0]:[];Kb(this,b);var f=void 0;if(Cb){f=lb.createElement("custom");for(var g in Lc.prototype)"constructor"!==g&&(f[g]=Lc.prototype[g]);for(var h in b.prototype)"constructor"!==h&&(f[h]=b.prototype[h])}return f=c=Mb(this,a.call(this,e,f)),d=f,Mb(c,d)}return Lb(b,a),b.prototype.addTrack=function(b){a.prototype.addTrack.call(this,b),b.addEventListener("modechange",jc(this,function(){this.trigger("change")}));var c=["metadata","chapters"];c.indexOf(b.kind)===-1&&b.addEventListener("modechange",jc(this,function(){this.trigger("selectedlanguagechange")}))},b}(Lc),Sc=function(){function a(){var b=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];Kb(this,a);var c=this;if(Cb){c=lb.createElement("custom");for(var d in a.prototype)"constructor"!==d&&(c[d]=a.prototype[d])}c.trackElements_=[],Object.defineProperty(c,"length",{get:function(){return this.trackElements_.length}});for(var e=0,f=b.length;e0&&void 0!==arguments[0]?arguments[0]:{};Kb(this,b);var e=Mb(this,a.call(this)),f=e;if(Cb){f=lb.createElement("custom");for(var g in b.prototype)"constructor"!==g&&(f[g]=b.prototype[g])}var h={id:d.id||"vjs_track_"+L(),kind:d.kind||"",label:d.label||"",language:d.language||""},i=function(a){Object.defineProperty(f,a,{get:function(){return h[a]},set:function(){}})};for(var j in h)i(j);return c=f,Mb(e,c)}return Lb(b,a),b}(lc),Zc=function(a){var b=["protocol","hostname","port","pathname","search","hash","host"],c=lb.createElement("a");c.href=a;var d=""===c.host&&"file:"!==c.protocol,e=void 0;d&&(e=lb.createElement("div"),e.innerHTML='',c=e.firstChild,e.setAttribute("style","display:none; position:absolute;"),lb.body.appendChild(e));for(var f={},g=0;gx',a=b.firstChild.href}return a},_c=function(a){if("string"==typeof a){var b=/^(\/?)([\s\S]*?)((?:\.{1,2}|[^\/]+?)(\.([^\.\/\?]+)))(?:[\/]*|[\?].*)$/i,c=b.exec(a);if(c)return c.pop().toLowerCase()}return""},ad=function(a){var b=gb.location,c=Zc(a),d=":"===c.protocol?b.protocol:c.protocol,e=d+c.host!==b.protocol+b.host;return e},bd=(Object.freeze||Object)({parseUrl:Zc,getAbsoluteURL:$c,getFileExtension:_c,isCrossOrigin:ad}),cd=ha,dd=Object.prototype.toString,ed=a(function(a,b){function c(a){return a.replace(/^\s*|\s*$/g,"")}b=a.exports=c,b.left=function(a){return a.replace(/^\s*/,"")},b.right=function(a){return a.replace(/\s*$/,"")}}),fd=ia,gd=Object.prototype.toString,hd=Object.prototype.hasOwnProperty,id=function(a){return"[object Array]"===Object.prototype.toString.call(a)},jd=function(a){if(!a)return{};var b={};return fd(ed(a).split("\n"),function(a){var c=a.indexOf(":"),d=ed(a.slice(0,c)).toLowerCase(),e=ed(a.slice(c+1));"undefined"==typeof b[d]?b[d]=e:id(b[d])?b[d].push(e):b[d]=[b[d],e]}),b},kd=ma,ld=Object.prototype.hasOwnProperty,md=qa;qa.XMLHttpRequest=gb.XMLHttpRequest||ta,qa.XDomainRequest="withCredentials"in new qa.XMLHttpRequest?qa.XMLHttpRequest:gb.XDomainRequest,na(["get","put","post","patch","head","delete"],function(a){qa["delete"===a?"del":a]=function(b,c,d){return c=pa(b,c,d),c.method=a.toUpperCase(),ra(c)}});var nd=function(a,b){var c=new gb.WebVTT.Parser(gb,gb.vttjs,gb.WebVTT.StringDecoder()),d=[];c.oncue=function(a){b.addCue(a)},c.onparsingerror=function(a){d.push(a)},c.onflush=function(){b.trigger({type:"loadeddata",target:b})},c.parse(a),d.length>0&&(gb.console&&gb.console.groupCollapsed&&gb.console.groupCollapsed("Text Track parsing errors for "+b.src),d.forEach(function(a){return Ub.error(a)}),gb.console&&gb.console.groupEnd&&gb.console.groupEnd()),c.flush()},od=function(a,b){var c={uri:a},d=ad(a);d&&(c.cors=d),md(c,jc(this,function(a,c,d){if(a)return Ub.error(a,c);if(b.loaded_=!0,"function"!=typeof gb.WebVTT){if(b.tech_){var e=function(){return nd(d,b)};b.tech_.on("vttjsloaded",e),b.tech_.on("vttjserror",function(){Ub.error("vttjs failed to load, stopping trying to process "+b.src),b.tech_.off("vttjsloaded",e)})}}else nd(d,b)}))},pd=function(a){function b(){var c,d,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(Kb(this,b),!e.tech)throw new Error("A tech was not provided.");var f=_(e,{kind:Wc[e.kind]||"subtitles",language:e.language||e.srclang||""}),g=Xc[f.mode]||"disabled",h=f["default"];"metadata"!==f.kind&&"chapters"!==f.kind||(g="hidden");var i=c=Mb(this,a.call(this,f));if(i.tech_=f.tech,Cb)for(var j in b.prototype)"constructor"!==j&&(i[j]=b.prototype[j]);i.cues_=[],i.activeCues_=[];var k=new Tc(i.cues_),l=new Tc(i.activeCues_),m=!1,n=jc(i,function(){this.activeCues,m&&(this.trigger("cuechange"),m=!1)});return"disabled"!==g&&i.tech_.ready(function(){i.tech_.on("timeupdate",n)},!0),Object.defineProperty(i,"default",{get:function(){return h},set:function(){}}),Object.defineProperty(i,"mode",{get:function(){return g},set:function(a){var b=this;Xc[a]&&(g=a,"showing"===g&&this.tech_.ready(function(){b.tech_.on("timeupdate",n)},!0),this.trigger("modechange"))}}),Object.defineProperty(i,"cues",{get:function(){return this.loaded_?k:null},set:function(){}}),Object.defineProperty(i,"activeCues",{get:function(){if(!this.loaded_)return null;if(0===this.cues.length)return l;for(var a=this.tech_.currentTime(),b=[],c=0,d=this.cues.length;c=a?b.push(e):e.startTime===e.endTime&&e.startTime<=a&&e.startTime+.5>=a&&b.push(e)}if(m=!1,b.length!==this.activeCues_.length)m=!0;else for(var f=0;f0&&void 0!==arguments[0]?arguments[0]:{};Kb(this,b);var f=_(e,{kind:Vc[e.kind]||""}),g=c=Mb(this,a.call(this,f)),h=!1;if(Cb)for(var i in b.prototype)"constructor"!==i&&(g[i]=b.prototype[i]);return Object.defineProperty(g,"enabled",{get:function(){return h},set:function(a){"boolean"==typeof a&&a!==h&&(h=a,this.trigger("enabledchange"))}}),f.enabled&&(g.enabled=f.enabled),g.loaded_=!0,d=g,Mb(c,d)}return Lb(b,a),b}(Yc),rd=function(a){function b(){var c,d,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Kb(this,b);var f=_(e,{kind:Uc[e.kind]||""}),g=c=Mb(this,a.call(this,f)),h=!1;if(Cb)for(var i in b.prototype)"constructor"!==i&&(g[i]=b.prototype[i]);return Object.defineProperty(g,"selected",{get:function(){return h},set:function(a){"boolean"==typeof a&&a!==h&&(h=a,this.trigger("selectedchange")); }}),f.selected&&(g.selected=f.selected),d=g,Mb(c,d)}return Lb(b,a),b}(Yc),sd=0,td=1,ud=2,vd=3,wd=function(a){function b(){var c=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Kb(this,b);var d=Mb(this,a.call(this)),e=void 0,f=d;if(Cb){f=lb.createElement("custom");for(var g in b.prototype)"constructor"!==g&&(f[g]=b.prototype[g])}var h=new pd(c);if(f.kind=h.kind,f.src=h.src,f.srclang=h.language,f.label=h.label,f["default"]=h["default"],Object.defineProperty(f,"readyState",{get:function(){return e}}),Object.defineProperty(f,"track",{get:function(){return h}}),e=sd,h.addEventListener("loadeddata",function(){e=ud,f.trigger({type:"load",target:f})}),Cb){var i;return i=f,Mb(d,i)}return d}return Lb(b,a),b}(lc);wd.prototype.allowedEvents_={load:"load"},wd.NONE=sd,wd.LOADING=td,wd.LOADED=ud,wd.ERROR=vd;var xd={audio:{ListClass:Oc,TrackClass:qd,capitalName:"Audio"},video:{ListClass:Qc,TrackClass:rd,capitalName:"Video"},text:{ListClass:Rc,TrackClass:pd,capitalName:"Text"}};Object.keys(xd).forEach(function(a){xd[a].getterName=a+"Tracks",xd[a].privateName=a+"Tracks_"});var yd={remoteText:{ListClass:Rc,TrackClass:pd,capitalName:"RemoteText",getterName:"remoteTextTracks",privateName:"remoteTextTracks_"},remoteTextEl:{ListClass:Sc,TrackClass:wd,capitalName:"RemoteTextTrackEls",getterName:"remoteTextTrackEls",privateName:"remoteTextTrackEls_"}},zd=_(xd,yd);yd.names=Object.keys(yd),xd.names=Object.keys(xd),zd.names=[].concat(yd.names).concat(xd.names);var Ad=Object.create||function(){function a(){}return function(b){if(1!==arguments.length)throw new Error("Object.create shim only accepts one parameter.");return a.prototype=b,new a}}();ua.prototype=Ad(Error.prototype),ua.prototype.constructor=ua,ua.Errors={BadSignature:{code:0,message:"Malformed WebVTT signature."},BadTimeStamp:{code:1,message:"Malformed time stamp."}},wa.prototype={set:function(a,b){this.get(a)||""===b||(this.values[a]=b)},get:function(a,b,c){return c?this.has(a)?this.values[a]:b[c]:this.has(a)?this.values[a]:b},has:function(a){return a in this.values},alt:function(a,b,c){for(var d=0;d=0&&b<=100))&&(this.set(a,b),!0)}};var Bd={"&":"&","<":"<",">":">","‎":"‎","‏":"‏"," ":" "},Cd={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"},Dd={v:"title",lang:"lang"},Ed={rt:"ruby"},Fd=[[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]];Da.prototype.applyStyles=function(a,b){b=b||this.div;for(var c in a)a.hasOwnProperty(c)&&(b.style[c]=a[c])},Da.prototype.formatStyle=function(a,b){return 0===a?0:a+b},Ea.prototype=Ad(Da.prototype),Ea.prototype.constructor=Ea,Fa.prototype.move=function(a,b){switch(b=void 0!==b?b:this.lineHeight,a){case"+x":this.left+=b,this.right+=b;break;case"-x":this.left-=b,this.right-=b;break;case"+y":this.top+=b,this.bottom+=b;break;case"-y":this.top-=b,this.bottom-=b}},Fa.prototype.overlaps=function(a){return this.lefta.left&&this.topa.top},Fa.prototype.overlapsAny=function(a){for(var b=0;b=a.top&&this.bottom<=a.bottom&&this.left>=a.left&&this.right<=a.right},Fa.prototype.overlapsOppositeAxis=function(a,b){switch(b){case"+x":return this.lefta.right;case"+y":return this.topa.bottom}},Fa.prototype.intersectPercentage=function(a){var b=Math.max(0,Math.min(this.right,a.right)-Math.max(this.left,a.left)),c=Math.max(0,Math.min(this.bottom,a.bottom)-Math.max(this.top,a.top)),d=b*c;return d/(this.height*this.width)},Fa.prototype.toCSSCompatValues=function(a){return{top:this.top-a.top,bottom:a.bottom-this.bottom,left:this.left-a.left,right:a.right-this.right,height:this.height,width:this.width}},Fa.getSimpleBoxPosition=function(a){var b=a.div?a.div.offsetHeight:a.tagName?a.offsetHeight:0,c=a.div?a.div.offsetWidth:a.tagName?a.offsetWidth:0,d=a.div?a.div.offsetTop:a.tagName?a.offsetTop:0;a=a.div?a.div.getBoundingClientRect():a.tagName?a.getBoundingClientRect():a;var e={left:a.left,right:a.right,top:a.top||d,height:a.height||b,bottom:a.bottom||d+(a.height||b),width:a.width||c};return e},Ha.StringDecoder=function(){return{decode:function(a){if(!a)return"";if("string"!=typeof a)throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(a))}}},Ha.convertCueToDOMTree=function(a,b){return a&&b?za(a,b):null};var Gd=.05,Hd="sans-serif",Id="1.5%";Ha.processCues=function(a,b,c){function d(a){for(var b=0;b")===-1){f.cue.id=g;continue}case"CUE":try{ya(g,f.cue,f.regionList)}catch(j){f.reportOrThrowError(j),f.cue=null,f.state="BADCUE";continue}f.state="CUETEXT";continue;case"CUETEXT":var k=g.indexOf("-->")!==-1;if(!g||k&&(i=!0)){f.oncue&&f.oncue(f.cue),f.cue=null,f.state="ID";continue}f.cue.text&&(f.cue.text+="\n"),f.cue.text+=g;continue;case"BADCUE":g||(f.state="ID");continue}}}catch(j){f.reportOrThrowError(j),"CUETEXT"===f.state&&f.cue&&f.oncue&&f.oncue(f.cue),f.cue=null,f.state="INITIAL"===f.state?"BADWEBVTT":"BADCUE"}return this},flush:function(){var a=this;try{if(a.buffer+=a.decoder.decode(),(a.cue||"HEADER"===a.state)&&(a.buffer+="\n\n",a.parse()),"INITIAL"===a.state)throw new ua(ua.Errors.BadSignature)}catch(b){a.reportOrThrowError(b)}return a.onflush&&a.onflush(),this}};var Jd=Ha,Kd="auto",Ld={"":!0,lr:!0,rl:!0},Md={start:!0,middle:!0,end:!0,left:!0,right:!0};La.prototype.getCueAsHTML=function(){return WebVTT.convertCueToDOMTree(window,this.text)};var Nd=La,Od={"":!0,up:!0},Pd=Oa,Qd=a(function(a){var b=a.exports={WebVTT:Jd,VTTCue:Nd,VTTRegion:Pd};gb.vttjs=b,gb.WebVTT=b.WebVTT;var c=b.VTTCue,d=b.VTTRegion,e=gb.VTTCue,f=gb.VTTRegion;b.shim=function(){gb.VTTCue=c,gb.VTTRegion=d},b.restore=function(){gb.VTTCue=e,gb.VTTRegion=f},gb.VTTCue||b.shim()}),Rd=function(a){function b(){var c=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},d=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){};Kb(this,b),c.reportTouchActivity=!1;var e=Mb(this,a.call(this,null,c,d));return e.hasStarted_=!1,e.on("playing",function(){this.hasStarted_=!0}),e.on("loadstart",function(){this.hasStarted_=!1}),zd.names.forEach(function(a){var b=zd[a];c&&c[b.getterName]&&(e[b.privateName]=c[b.getterName])}),e.featuresProgressEvents||e.manualProgressOn(),e.featuresTimeupdateEvents||e.manualTimeUpdatesOn(),["Text","Audio","Video"].forEach(function(a){c["native"+a+"Tracks"]===!1&&(e["featuresNative"+a+"Tracks"]=!1)}),c.nativeCaptions===!1||c.nativeTextTracks===!1?e.featuresNativeTextTracks=!1:c.nativeCaptions!==!0&&c.nativeTextTracks!==!0||(e.featuresNativeTextTracks=!0),e.featuresNativeTextTracks||e.emulateTextTracks(),e.autoRemoteTextTracks_=new zd.text.ListClass,e.initTrackListeners(),c.nativeControlsForTouch||e.emitTapEvents(),e.constructor&&(e.name_=e.constructor.name||"Unknown Tech"),e}return Lb(b,a),b.prototype.manualProgressOn=function(){this.on("durationchange",this.onDurationChange),this.manualProgress=!0,this.one("ready",this.trackProgress)},b.prototype.manualProgressOff=function(){this.manualProgress=!1,this.stopTrackingProgress(),this.off("durationchange",this.onDurationChange)},b.prototype.trackProgress=function(a){this.stopTrackingProgress(),this.progressInterval=this.setInterval(jc(this,function(){var a=this.bufferedPercent();this.bufferedPercent_!==a&&this.trigger("progress"),this.bufferedPercent_=a,1===a&&this.stopTrackingProgress()}),500)},b.prototype.onDurationChange=function(a){this.duration_=this.duration()},b.prototype.buffered=function(){return da(0,0)},b.prototype.bufferedPercent=function(){return ea(this.buffered(),this.duration_)},b.prototype.stopTrackingProgress=function(){this.clearInterval(this.progressInterval)},b.prototype.manualTimeUpdatesOn=function(){this.manualTimeUpdates=!0,this.on("play",this.trackCurrentTime),this.on("pause",this.stopTrackingCurrentTime)},b.prototype.manualTimeUpdatesOff=function(){this.manualTimeUpdates=!1,this.stopTrackingCurrentTime(),this.off("play",this.trackCurrentTime),this.off("pause",this.stopTrackingCurrentTime)},b.prototype.trackCurrentTime=function(){this.currentTimeInterval&&this.stopTrackingCurrentTime(),this.currentTimeInterval=this.setInterval(function(){this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},250)},b.prototype.stopTrackingCurrentTime=function(){this.clearInterval(this.currentTimeInterval),this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},b.prototype.dispose=function(){this.clearTracks(xd.names),this.manualProgress&&this.manualProgressOff(),this.manualTimeUpdates&&this.manualTimeUpdatesOff(),a.prototype.dispose.call(this)},b.prototype.clearTracks=function(a){var b=this;a=[].concat(a),a.forEach(function(a){for(var c=b[a+"Tracks"]()||[],d=c.length;d--;){var e=c[d];"text"===a&&b.removeRemoteTextTrack(e),c.removeTrack(e)}})},b.prototype.cleanupAutoTextTracks=function(){for(var a=this.autoRemoteTextTracks_||[],b=a.length;b--;){var c=a[b];this.removeRemoteTextTrack(c)}},b.prototype.reset=function(){},b.prototype.error=function(a){return void 0!==a&&(this.error_=new fa(a),this.trigger("error")),this.error_},b.prototype.played=function(){return this.hasStarted_?da(0,0):da()},b.prototype.setCurrentTime=function(){this.manualTimeUpdates&&this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},b.prototype.initTrackListeners=function(){var a=this;xd.names.forEach(function(b){var c=xd[b],d=function(){a.trigger(b+"trackchange")},e=a[c.getterName]();e.addEventListener("removetrack",d),e.addEventListener("addtrack",d),a.on("dispose",function(){e.removeEventListener("removetrack",d),e.removeEventListener("addtrack",d)})})},b.prototype.addWebVttScript_=function(){var a=this;if(!gb.WebVTT)if(lb.body.contains(this.el())){if(!this.options_["vtt.js"]&&f(Qd)&&Object.keys(Qd).length>0)return void this.trigger("vttjsloaded");var b=lb.createElement("script");b.src=this.options_["vtt.js"]||"https://vjs.zencdn.net/vttjs/0.12.4/vtt.min.js",b.onload=function(){a.trigger("vttjsloaded")},b.onerror=function(){a.trigger("vttjserror")},this.on("dispose",function(){b.onload=null,b.onerror=null}),gb.WebVTT=!0,this.el().parentNode.appendChild(b)}else this.ready(this.addWebVttScript_)},b.prototype.emulateTextTracks=function(){var a=this,b=this.textTracks(),c=this.remoteTextTracks(),d=function(a){return b.addTrack(a.track)},e=function(a){return b.removeTrack(a.track)};c.on("addtrack",d),c.on("removetrack",e),this.addWebVttScript_();var f=function(){return a.trigger("texttrackchange")},g=function(){f();for(var a=0;a0&&void 0!==arguments[0]?arguments[0]:{},c=arguments[1],d=this.createRemoteTextTrack(b);return c!==!0&&c!==!1&&(Ub.warn('Calling addRemoteTextTrack without explicitly setting the "manualCleanup" parameter to `true` is deprecated and default to `false` in future version of video.js'),c=!0),this.remoteTextTrackEls().addTrackElement_(d),this.remoteTextTracks().addTrack(d.track),c!==!0&&this.ready(function(){return a.autoRemoteTextTracks_.addTrack(d.track)}),d},b.prototype.removeRemoteTextTrack=function(a){var b=this.remoteTextTrackEls().getTrackElementByTrack_(a);this.remoteTextTrackEls().removeTrackElement_(b),this.remoteTextTracks().removeTrack(a),this.autoRemoteTextTracks_.removeTrack(a)},b.prototype.getVideoPlaybackQuality=function(){return{}},b.prototype.setPoster=function(){},b.prototype.playsinline=function(){},b.prototype.setPlaysinline=function(){},b.prototype.canPlayType=function(){return""},b.canPlayType=function(){return""},b.canPlaySource=function(a,c){return b.canPlayType(a.type)},b.isTech=function(a){return a.prototype instanceof b||a instanceof b||a===b},b.registerTech=function(a,c){if(b.techs_||(b.techs_={}),!b.isTech(c))throw new Error("Tech "+a+" must be a Tech");if(!b.canPlayType)throw new Error("Techs must have a static canPlayType method on them");if(!b.canPlaySource)throw new Error("Techs must have a static canPlaySource method on them");return a=Z(a),b.techs_[a]=c,"Tech"!==a&&b.defaultTechOrder_.push(a),c},b.getTech=function(a){if(a)return a=Z(a),b.techs_&&b.techs_[a]?b.techs_[a]:gb&&gb.videojs&&gb.videojs[a]?(Ub.warn("The "+a+" tech was added to the videojs object when it should be registered using videojs.registerTech(name, tech)"),gb.videojs[a]):void 0},b}(vc);zd.names.forEach(function(a){var b=zd[a];Rd.prototype[b.getterName]=function(){return this[b.privateName]=this[b.privateName]||new b.ListClass,this[b.privateName]}}),Rd.prototype.featuresVolumeControl=!0,Rd.prototype.featuresFullscreenResize=!1,Rd.prototype.featuresPlaybackRate=!1,Rd.prototype.featuresProgressEvents=!1,Rd.prototype.featuresTimeupdateEvents=!1,Rd.prototype.featuresNativeTextTracks=!1,Rd.withSourceHandlers=function(a){a.registerSourceHandler=function(b,c){var d=a.sourceHandlers;d||(d=a.sourceHandlers=[]),void 0===c&&(c=d.length),d.splice(c,0,b)},a.canPlayType=function(b){for(var c=a.sourceHandlers||[],d=void 0,e=0;e0&&void 0!==arguments[0]?arguments[0]:"div",c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};c=d({innerHTML:'',className:this.buildCSSClass(),tabIndex:0},c),"button"===b&&Ub.error("Creating a ClickableComponent with an HTML element of "+b+" is not supported; use a Button instead."),e=d({role:"button","aria-live":"polite"},e),this.tabIndex_=c.tabIndex;var f=a.prototype.createEl.call(this,b,c,e);return this.createControlTextEl(f),f},b.prototype.createControlTextEl=function(a){return this.controlTextEl_=p("span",{className:"vjs-control-text"}),a&&a.appendChild(this.controlTextEl_),this.controlText(this.controlText_,a),this.controlTextEl_},b.prototype.controlText=function(a){var b=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.el();if(!a)return this.controlText_||"Need Text";var c=this.localize(a);this.controlText_=a,q(this.controlTextEl_,c),this.nonIconControl||b.setAttribute("title",c)},b.prototype.buildCSSClass=function(){return"vjs-control vjs-button "+a.prototype.buildCSSClass.call(this)},b.prototype.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("focus",this.handleFocus),this.on("blur",this.handleBlur))},b.prototype.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("focus",this.handleFocus),this.off("blur",this.handleBlur)},b.prototype.handleClick=function(a){},b.prototype.handleFocus=function(a){S(lb,"keydown",jc(this,this.handleKeyPress))},b.prototype.handleKeyPress=function(b){32===b.which||13===b.which?(b.preventDefault(),this.trigger("click")):a.prototype.handleKeyPress&&a.prototype.handleKeyPress.call(this,b)},b.prototype.handleBlur=function(a){T(lb,"keydown",jc(this,this.handleKeyPress))},b}(vc);vc.registerComponent("ClickableComponent",Xd);var Yd=function(a){function b(c,d){Kb(this,b);var e=Mb(this,a.call(this,c,d));return e.update(),c.on("posterchange",jc(e,e.update)),e}return Lb(b,a),b.prototype.dispose=function(){this.player().off("posterchange",this.update),a.prototype.dispose.call(this)},b.prototype.createEl=function(){var a=p("div",{className:"vjs-poster",tabIndex:-1});return Hb||(this.fallbackImg_=p("img"),a.appendChild(this.fallbackImg_)),a},b.prototype.update=function(a){var b=this.player().poster();this.setSrc(b),b?this.show():this.hide()},b.prototype.setSrc=function(a){if(this.fallbackImg_)this.fallbackImg_.src=a;else{var b="";a&&(b='url("'+a+'")'),this.el_.style.backgroundImage=b}},b.prototype.handleClick=function(a){this.player_.controls()&&(this.player_.paused()?this.player_.play():this.player_.pause())},b}(Xd);vc.registerComponent("PosterImage",Yd);var Zd="#222",$d="#ccc",_d={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'},ae=function(a){function b(c,d,e){Kb(this,b);var f=Mb(this,a.call(this,c,d,e));return c.on("loadstart",jc(f,f.toggleDisplay)),c.on("texttrackchange",jc(f,f.updateDisplay)),c.on("loadstart",jc(f,f.preselectTrack)),c.ready(jc(f,function(){if(c.tech_&&c.tech_.featuresNativeTextTracks)return void this.hide();c.on("fullscreenchange",jc(this,this.updateDisplay));for(var a=this.options_.playerOptions.tracks||[],b=0;b1&&void 0!==arguments[1]?arguments[1]:{},c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};a="button",b=d({innerHTML:'',className:this.buildCSSClass()},b),c=d({type:"button","aria-live":"polite"},c);var e=vc.prototype.createEl.call(this,a,b,c);return this.createControlTextEl(e),e},b.prototype.addChild=function(a){var b=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},c=this.constructor.name;return Ub.warn("Adding an actionable (user controllable) child to a Button ("+c+") is not supported; use a ClickableComponent instead."),vc.prototype.addChild.call(this,a,b)},b.prototype.enable=function(){a.prototype.enable.call(this),this.el_.removeAttribute("disabled")},b.prototype.disable=function(){a.prototype.disable.call(this),this.el_.setAttribute("disabled","disabled")},b.prototype.handleKeyPress=function(b){32!==b.which&&13!==b.which&&a.prototype.handleKeyPress.call(this,b)},b}(Xd);vc.registerComponent("Button",ce);var de=function(a){function b(c,d){Kb(this,b);var e=Mb(this,a.call(this,c,d));return e.mouseused_=!1,e.on("mousedown",e.handleMouseDown),e}return Lb(b,a),b.prototype.buildCSSClass=function(){return"vjs-big-play-button"},b.prototype.handleClick=function(a){var b=this.player_.play();if(!(this.mouseused_&&a.clientX&&a.clientY)){var c=this.player_.getChild("controlBar"),d=c&&c.getChild("playToggle");if(!d)return void this.player_.focus();var e=function(){return d.focus()};if(b&&b.then){var f=function(){};b.then(e,f)}else this.setTimeout(e,1)}},b.prototype.handleKeyPress=function(b){this.mouseused_=!1,a.prototype.handleKeyPress.call(this,b)},b.prototype.handleMouseDown=function(a){this.mouseused_=!0},b}(ce);de.prototype.controlText_="Play Video",vc.registerComponent("BigPlayButton",de);var ee=function(a){function b(c,d){Kb(this,b);var e=Mb(this,a.call(this,c,d));return e.controlText(d&&d.controlText||e.localize("Close")),e}return Lb(b,a),b.prototype.buildCSSClass=function(){return"vjs-close-button "+a.prototype.buildCSSClass.call(this)},b.prototype.handleClick=function(a){this.trigger({type:"close",bubbles:!1})},b}(ce);vc.registerComponent("CloseButton",ee);var fe=function(a){function b(c,d){Kb(this,b);var e=Mb(this,a.call(this,c,d));return e.on(c,"play",e.handlePlay),e.on(c,"pause",e.handlePause),e.on(c,"ended",e.handleEnded),e}return Lb(b,a),b.prototype.buildCSSClass=function(){return"vjs-play-control "+a.prototype.buildCSSClass.call(this)},b.prototype.handleClick=function(a){this.player_.paused()?this.player_.play():this.player_.pause()},b.prototype.handleSeeked=function(a){this.removeClass("vjs-ended"),this.player_.paused()?this.handlePause(a):this.handlePlay(a)},b.prototype.handlePlay=function(a){this.removeClass("vjs-paused"),this.addClass("vjs-playing"),this.controlText("Pause")},b.prototype.handlePause=function(a){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.controlText("Play")},b.prototype.handleEnded=function(a){this.removeClass("vjs-playing"),this.addClass("vjs-ended"),this.controlText("Replay"),this.one(this.player_,"seeked",this.handleSeeked)},b}(ce);fe.prototype.controlText_="Play",vc.registerComponent("PlayToggle",fe);var ge=function(a){function b(c,d){Kb(this,b);var e=Mb(this,a.call(this,c,d));return e.throttledUpdateContent=kc(jc(e,e.updateContent),25),e.on(c,"timeupdate",e.throttledUpdateContent),e}return Lb(b,a),b.prototype.createEl=function(b){var c=this.buildCSSClass(),d=a.prototype.createEl.call(this,"div",{className:c+" vjs-time-control vjs-control"});return this.contentEl_=p("div",{className:c+"-display"},{"aria-live":"off"},p("span",{className:"vjs-control-text",textContent:this.localize(this.contentText_)})),this.updateTextNode_(),d.appendChild(this.contentEl_),d},b.prototype.updateTextNode_=function(){this.textNode_&&this.contentEl_.removeChild(this.textNode_),this.textNode_=lb.createTextNode(this.formattedTime_||"0:00"),this.contentEl_.appendChild(this.textNode_)},b.prototype.formatTime_=function(a){return Za(a)},b.prototype.updateFormattedTime_=function(a){var b=this.formatTime_(a);b!==this.formattedTime_&&(this.formattedTime_=b,this.requestAnimationFrame(this.updateTextNode_))},b.prototype.updateContent=function(a){},b}(vc);ge.prototype.controlText_="Time",vc.registerComponent("TimeDisplay",ge); var he=function(a){function b(c,d){Kb(this,b);var e=Mb(this,a.call(this,c,d));return e.on(c,"ended",e.handleEnded),e}return Lb(b,a),b.prototype.buildCSSClass=function(){return"vjs-current-time"},b.prototype.updateContent=function(a){var b=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();this.updateFormattedTime_(b)},b.prototype.handleEnded=function(a){this.player_.duration()&&this.updateFormattedTime_(this.player_.duration())},b}(ge);he.prototype.controlText_="Current Time",vc.registerComponent("CurrentTimeDisplay",he);var ie=function(a){function b(c,d){Kb(this,b);var e=Mb(this,a.call(this,c,d));return e.on(c,["durationchange","loadedmetadata"],e.throttledUpdateContent),e}return Lb(b,a),b.prototype.buildCSSClass=function(){return"vjs-duration"},b.prototype.updateContent=function(a){var b=this.player_.duration();b&&this.duration_!==b&&(this.duration_=b,this.updateFormattedTime_(b))},b}(ge);ie.prototype.controlText_="Duration Time",vc.registerComponent("DurationDisplay",ie);var je=function(a){function b(){return Kb(this,b),Mb(this,a.apply(this,arguments))}return Lb(b,a),b.prototype.createEl=function(){return a.prototype.createEl.call(this,"div",{className:"vjs-time-control vjs-time-divider",innerHTML:"
/
"})},b}(vc);vc.registerComponent("TimeDivider",je);var ke=function(a){function b(c,d){Kb(this,b);var e=Mb(this,a.call(this,c,d));return e.on(c,"durationchange",e.throttledUpdateContent),e.on(c,"ended",e.handleEnded),e}return Lb(b,a),b.prototype.buildCSSClass=function(){return"vjs-remaining-time"},b.prototype.formatTime_=function(b){return"-"+a.prototype.formatTime_.call(this,b)},b.prototype.updateContent=function(a){this.player_.duration()&&this.updateFormattedTime_(this.player_.remainingTimeDisplay())},b.prototype.handleEnded=function(a){this.player_.duration()&&this.updateFormattedTime_(0)},b}(ge);ke.prototype.controlText_="Remaining Time",vc.registerComponent("RemainingTimeDisplay",ke);var le=function(a){function b(c,d){Kb(this,b);var e=Mb(this,a.call(this,c,d));return e.updateShowing(),e.on(e.player(),"durationchange",e.updateShowing),e}return Lb(b,a),b.prototype.createEl=function(){var b=a.prototype.createEl.call(this,"div",{className:"vjs-live-control vjs-control"});return this.contentEl_=p("div",{className:"vjs-live-display",innerHTML:''+this.localize("Stream Type")+""+this.localize("LIVE")},{"aria-live":"off"}),b.appendChild(this.contentEl_),b},b.prototype.updateShowing=function(a){this.player().duration()===1/0?this.show():this.hide()},b}(vc);vc.registerComponent("LiveDisplay",le);var me=function(a){function b(c,d){Kb(this,b);var e=Mb(this,a.call(this,c,d));return e.bar=e.getChild(e.options_.barName),e.vertical(!!e.options_.vertical),e.on("mousedown",e.handleMouseDown),e.on("touchstart",e.handleMouseDown),e.on("focus",e.handleFocus),e.on("blur",e.handleBlur),e.on("click",e.handleClick),e.on(c,"controlsvisible",e.update),e.playerEvent&&e.on(c,e.playerEvent,e.update),e}return Lb(b,a),b.prototype.createEl=function(b){var c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return c.className=c.className+" vjs-slider",c=d({tabIndex:0},c),e=d({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100,tabIndex:0},e),a.prototype.createEl.call(this,b,c,e)},b.prototype.handleMouseDown=function(a){var b=this.bar.el_.ownerDocument;a.preventDefault(),B(),this.addClass("vjs-sliding"),this.trigger("slideractive"),this.on(b,"mousemove",this.handleMouseMove),this.on(b,"mouseup",this.handleMouseUp),this.on(b,"touchmove",this.handleMouseMove),this.on(b,"touchend",this.handleMouseUp),this.handleMouseMove(a)},b.prototype.handleMouseMove=function(a){},b.prototype.handleMouseUp=function(){var a=this.bar.el_.ownerDocument;C(),this.removeClass("vjs-sliding"),this.trigger("sliderinactive"),this.off(a,"mousemove",this.handleMouseMove),this.off(a,"mouseup",this.handleMouseUp),this.off(a,"touchmove",this.handleMouseMove),this.off(a,"touchend",this.handleMouseUp),this.update()},b.prototype.update=function(){if(this.el_){var a=this.getPercent(),b=this.bar;if(b){("number"!=typeof a||a!==a||a<0||a===1/0)&&(a=0);var c=(100*a).toFixed(2)+"%",d=b.el().style;return this.vertical()?d.height=c:d.width=c,a}}},b.prototype.calculateDistance=function(a){var b=F(this.el_,a);return this.vertical()?b.y:b.x},b.prototype.handleFocus=function(){this.on(this.bar.el_.ownerDocument,"keydown",this.handleKeyPress)},b.prototype.handleKeyPress=function(a){37===a.which||40===a.which?(a.preventDefault(),this.stepBack()):38!==a.which&&39!==a.which||(a.preventDefault(),this.stepForward())},b.prototype.handleBlur=function(){this.off(this.bar.el_.ownerDocument,"keydown",this.handleKeyPress)},b.prototype.handleClick=function(a){a.stopImmediatePropagation(),a.preventDefault()},b.prototype.vertical=function(a){return void 0===a?this.vertical_||!1:(this.vertical_=!!a,void(this.vertical_?this.addClass("vjs-slider-vertical"):this.addClass("vjs-slider-horizontal")))},b}(vc);vc.registerComponent("Slider",me);var ne=function(a){function b(c,d){Kb(this,b);var e=Mb(this,a.call(this,c,d));return e.partEls_=[],e.on(c,"progress",e.update),e}return Lb(b,a),b.prototype.createEl=function(){return a.prototype.createEl.call(this,"div",{className:"vjs-load-progress",innerHTML:''+this.localize("Loaded")+": 0%"})},b.prototype.update=function(a){var b=this.player_.buffered(),c=this.player_.duration(),d=this.player_.bufferedEnd(),e=this.partEls_,f=function(a,b){var c=a/b||0;return 100*(c>=1?1:c)+"%"};this.el_.style.width=f(d,c);for(var g=0;gb.length;k--)this.el_.removeChild(e[k-1]);e.length=b.length},b}(vc);vc.registerComponent("LoadProgressBar",ne);var oe=function(a){function b(){return Kb(this,b),Mb(this,a.apply(this,arguments))}return Lb(b,a),b.prototype.createEl=function(){return a.prototype.createEl.call(this,"div",{className:"vjs-time-tooltip"})},b.prototype.update=function(a,b,c){var d=D(this.el_),e=D(this.player_.el()),f=a.width*b;if(e&&d){var g=a.left-e.left+f,h=a.width-f+(e.right-a.right),i=d.width/2;gd.width&&(i=d.width),this.el_.style.right="-"+i+"px",q(this.el_,c)}},b}(vc);vc.registerComponent("TimeTooltip",oe);var pe=function(a){function b(){return Kb(this,b),Mb(this,a.apply(this,arguments))}return Lb(b,a),b.prototype.createEl=function(){return a.prototype.createEl.call(this,"div",{className:"vjs-play-progress vjs-slider-bar",innerHTML:''+this.localize("Progress")+": 0%"})},b.prototype.update=function(a,b){var c=this;this.rafId_&&this.cancelAnimationFrame(this.rafId_),this.rafId_=this.requestAnimationFrame(function(){var d=c.player_.scrubbing()?c.player_.getCache().currentTime:c.player_.currentTime(),e=Za(d,c.player_.duration()),f=c.getChild("timeTooltip");f&&f.update(a,b,e)})},b}(vc);pe.prototype.options_={children:[]},Db&&!(Db>8)||sb||ub||pe.prototype.options_.children.push("timeTooltip"),vc.registerComponent("PlayProgressBar",pe);var qe=function(a){function b(c,d){Kb(this,b);var e=Mb(this,a.call(this,c,d));return e.update=kc(jc(e,e.update),25),e}return Lb(b,a),b.prototype.createEl=function(){return a.prototype.createEl.call(this,"div",{className:"vjs-mouse-display"})},b.prototype.update=function(a,b){var c=this;this.rafId_&&this.cancelAnimationFrame(this.rafId_),this.rafId_=this.requestAnimationFrame(function(){var d=c.player_.duration(),e=Za(b*d,d);c.el_.style.left=a.width*b+"px",c.getChild("timeTooltip").update(a,b,e)})},b}(vc);qe.prototype.options_={children:["timeTooltip"]},vc.registerComponent("MouseTimeDisplay",qe);var re=5,se=function(a){function b(c,d){Kb(this,b);var e=Mb(this,a.call(this,c,d));return e.update=kc(jc(e,e.update),50),e.on(c,["timeupdate","ended"],e.update),e}return Lb(b,a),b.prototype.createEl=function(){return a.prototype.createEl.call(this,"div",{className:"vjs-progress-holder"},{"aria-label":this.localize("Progress Bar")})},b.prototype.update=function(){var b=a.prototype.update.call(this),c=this.player_.duration(),d=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();return this.el_.setAttribute("aria-valuenow",(100*b).toFixed(2)),this.el_.setAttribute("aria-valuetext",this.localize("progress bar timing: currentTime={1} duration={2}",[Za(d,c),Za(c,c)],"{1} of {2}")),this.bar.update(D(this.el_),b),b},b.prototype.getPercent=function(){var a=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime(),b=a/this.player_.duration();return b>=1?1:b},b.prototype.handleMouseDown=function(b){this.player_.scrubbing(!0),this.videoWasPlaying=!this.player_.paused(),this.player_.pause(),a.prototype.handleMouseDown.call(this,b)},b.prototype.handleMouseMove=function(a){var b=this.calculateDistance(a)*this.player_.duration();b===this.player_.duration()&&(b-=.1),this.player_.currentTime(b)},b.prototype.handleMouseUp=function(b){a.prototype.handleMouseUp.call(this,b),this.player_.scrubbing(!1),this.videoWasPlaying&&this.player_.play()},b.prototype.stepForward=function(){this.player_.currentTime(this.player_.currentTime()+re)},b.prototype.stepBack=function(){this.player_.currentTime(this.player_.currentTime()-re)},b.prototype.handleAction=function(a){this.player_.paused()?this.player_.play():this.player_.pause()},b.prototype.handleKeyPress=function(b){32===b.which||13===b.which?(b.preventDefault(),this.handleAction(b)):a.prototype.handleKeyPress&&a.prototype.handleKeyPress.call(this,b)},b}(me);se.prototype.options_={children:["loadProgressBar","playProgressBar"],barName:"playProgressBar"},Db&&!(Db>8)||sb||ub||se.prototype.options_.children.splice(1,0,"mouseTimeDisplay"),se.prototype.playerEvent="timeupdate",vc.registerComponent("SeekBar",se);var te=function(a){function b(c,d){Kb(this,b);var e=Mb(this,a.call(this,c,d));return e.handleMouseMove=kc(jc(e,e.handleMouseMove),25),e.on(e.el_,"mousemove",e.handleMouseMove),e.throttledHandleMouseSeek=kc(jc(e,e.handleMouseSeek),25),e.on(["mousedown","touchstart"],e.handleMouseDown),e}return Lb(b,a),b.prototype.createEl=function(){return a.prototype.createEl.call(this,"div",{className:"vjs-progress-control vjs-control"})},b.prototype.handleMouseMove=function(a){var b=this.getChild("seekBar"),c=b.getChild("mouseTimeDisplay"),d=b.el(),e=D(d),f=F(d,a).x;f>1?f=1:f<0&&(f=0),c&&c.update(e,f)},b.prototype.handleMouseSeek=function(a){var b=this.getChild("seekBar");b.handleMouseMove(a)},b.prototype.handleMouseDown=function(a){var b=this.el_.ownerDocument;this.on(b,"mousemove",this.throttledHandleMouseSeek),this.on(b,"touchmove",this.throttledHandleMouseSeek),this.on(b,"mouseup",this.handleMouseUp),this.on(b,"touchend",this.handleMouseUp)},b.prototype.handleMouseUp=function(a){var b=this.el_.ownerDocument;this.off(b,"mousemove",this.throttledHandleMouseSeek),this.off(b,"touchmove",this.throttledHandleMouseSeek),this.off(b,"mouseup",this.handleMouseUp),this.off(b,"touchend",this.handleMouseUp)},b}(vc);te.prototype.options_={children:["seekBar"]},vc.registerComponent("ProgressControl",te);var ue=function(a){function b(c,d){Kb(this,b);var e=Mb(this,a.call(this,c,d));return e.on(c,"fullscreenchange",e.handleFullscreenChange),e}return Lb(b,a),b.prototype.buildCSSClass=function(){return"vjs-fullscreen-control "+a.prototype.buildCSSClass.call(this)},b.prototype.handleFullscreenChange=function(a){this.player_.isFullscreen()?this.controlText("Non-Fullscreen"):this.controlText("Fullscreen")},b.prototype.handleClick=function(a){this.player_.isFullscreen()?this.player_.exitFullscreen():this.player_.requestFullscreen()},b}(ce);ue.prototype.controlText_="Fullscreen",vc.registerComponent("FullscreenToggle",ue);var ve=function(a,b){b.tech_&&!b.tech_.featuresVolumeControl&&a.addClass("vjs-hidden"),a.on(b,"loadstart",function(){b.tech_.featuresVolumeControl?a.removeClass("vjs-hidden"):a.addClass("vjs-hidden")})},we=function(a){function b(){return Kb(this,b),Mb(this,a.apply(this,arguments))}return Lb(b,a),b.prototype.createEl=function(){return a.prototype.createEl.call(this,"div",{className:"vjs-volume-level",innerHTML:''})},b}(vc);vc.registerComponent("VolumeLevel",we);var xe=function(a){function b(c,d){Kb(this,b);var e=Mb(this,a.call(this,c,d));return e.on("slideractive",e.updateLastVolume_),e.on(c,"volumechange",e.updateARIAAttributes),c.ready(function(){return e.updateARIAAttributes()}),e}return Lb(b,a),b.prototype.createEl=function(){return a.prototype.createEl.call(this,"div",{className:"vjs-volume-bar vjs-slider-bar"},{"aria-label":this.localize("Volume Level"),"aria-live":"polite"})},b.prototype.handleMouseMove=function(a){this.checkMuted(),this.player_.volume(this.calculateDistance(a))},b.prototype.checkMuted=function(){this.player_.muted()&&this.player_.muted(!1)},b.prototype.getPercent=function(){return this.player_.muted()?0:this.player_.volume()},b.prototype.stepForward=function(){this.checkMuted(),this.player_.volume(this.player_.volume()+.1)},b.prototype.stepBack=function(){this.checkMuted(),this.player_.volume(this.player_.volume()-.1)},b.prototype.updateARIAAttributes=function(a){var b=this.player_.muted()?0:this.volumeAsPercentage_();this.el_.setAttribute("aria-valuenow",b),this.el_.setAttribute("aria-valuetext",b+"%")},b.prototype.volumeAsPercentage_=function(){return Math.round(100*this.player_.volume())},b.prototype.updateLastVolume_=function(){var a=this,b=this.player_.volume();this.one("sliderinactive",function(){0===a.player_.volume()&&a.player_.lastVolume_(b)})},b}(me);xe.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"},xe.prototype.playerEvent="volumechange",vc.registerComponent("VolumeBar",xe);var ye=function(a){function b(c){var d=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Kb(this,b),d.vertical=d.vertical||!1,("undefined"==typeof d.volumeBar||f(d.volumeBar))&&(d.volumeBar=d.volumeBar||{},d.volumeBar.vertical=d.vertical);var e=Mb(this,a.call(this,c,d));return ve(e,c),e.throttledHandleMouseMove=kc(jc(e,e.handleMouseMove),25),e.on("mousedown",e.handleMouseDown),e.on("touchstart",e.handleMouseDown),e.on(e.volumeBar,["focus","slideractive"],function(){e.volumeBar.addClass("vjs-slider-active"),e.addClass("vjs-slider-active"),e.trigger("slideractive")}),e.on(e.volumeBar,["blur","sliderinactive"],function(){e.volumeBar.removeClass("vjs-slider-active"),e.removeClass("vjs-slider-active"),e.trigger("sliderinactive")}),e}return Lb(b,a),b.prototype.createEl=function(){var b="vjs-volume-horizontal";return this.options_.vertical&&(b="vjs-volume-vertical"),a.prototype.createEl.call(this,"div",{className:"vjs-volume-control vjs-control "+b})},b.prototype.handleMouseDown=function(a){var b=this.el_.ownerDocument;this.on(b,"mousemove",this.throttledHandleMouseMove),this.on(b,"touchmove",this.throttledHandleMouseMove),this.on(b,"mouseup",this.handleMouseUp),this.on(b,"touchend",this.handleMouseUp)},b.prototype.handleMouseUp=function(a){var b=this.el_.ownerDocument;this.off(b,"mousemove",this.throttledHandleMouseMove),this.off(b,"touchmove",this.throttledHandleMouseMove),this.off(b,"mouseup",this.handleMouseUp),this.off(b,"touchend",this.handleMouseUp)},b.prototype.handleMouseMove=function(a){this.volumeBar.handleMouseMove(a)},b}(vc);ye.prototype.options_={children:["volumeBar"]},vc.registerComponent("VolumeControl",ye);var ze=function(a){function b(c,d){Kb(this,b);var e=Mb(this,a.call(this,c,d));return ve(e,c),e.on(c,["loadstart","volumechange"],e.update),e}return Lb(b,a),b.prototype.buildCSSClass=function(){return"vjs-mute-control "+a.prototype.buildCSSClass.call(this)},b.prototype.handleClick=function(a){var b=this.player_.volume(),c=this.player_.lastVolume_();if(0===b){var d=c<.1?.1:c;this.player_.volume(d),this.player_.muted(!1)}else this.player_.muted(!this.player_.muted())},b.prototype.update=function(a){this.updateIcon_(),this.updateControlText_()},b.prototype.updateIcon_=function(){var a=this.player_.volume(),b=3;0===a||this.player_.muted()?b=0:a<.33?b=1:a<.67&&(b=2);for(var c=0;c<4;c++)u(this.el_,"vjs-vol-"+c);t(this.el_,"vjs-vol-"+b)},b.prototype.updateControlText_=function(){var a=this.player_.muted()||0===this.player_.volume(),b=a?"Unmute":"Mute";this.controlText()!==b&&this.controlText(b)},b}(ce);ze.prototype.controlText_="Mute",vc.registerComponent("MuteToggle",ze);var Ae=function(a){function b(c){var d=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Kb(this,b),"undefined"!=typeof d.inline?d.inline=d.inline:d.inline=!0,("undefined"==typeof d.volumeControl||f(d.volumeControl))&&(d.volumeControl=d.volumeControl||{},d.volumeControl.vertical=!d.inline);var e=Mb(this,a.call(this,c,d));return ve(e,c),e.on(e.volumeControl,["slideractive"],e.sliderActive_),e.on(e.muteToggle,"focus",e.sliderActive_),e.on(e.volumeControl,["sliderinactive"],e.sliderInactive_),e.on(e.muteToggle,"blur",e.sliderInactive_),e}return Lb(b,a),b.prototype.sliderActive_=function(){this.addClass("vjs-slider-active")},b.prototype.sliderInactive_=function(){this.removeClass("vjs-slider-active")},b.prototype.createEl=function(){var b="vjs-volume-panel-horizontal";return this.options_.inline||(b="vjs-volume-panel-vertical"),a.prototype.createEl.call(this,"div",{className:"vjs-volume-panel vjs-control "+b})},b}(vc);Ae.prototype.options_={children:["muteToggle","volumeControl"]},vc.registerComponent("VolumePanel",Ae);var Be=function(a){function b(c,d){Kb(this,b);var e=Mb(this,a.call(this,c,d));return d&&(e.menuButton_=d.menuButton),e.focusedChild_=-1,e.on("keydown",e.handleKeyPress),e}return Lb(b,a),b.prototype.addItem=function(a){this.addChild(a),a.on("click",jc(this,function(b){this.menuButton_&&(this.menuButton_.unpressButton(),"CaptionSettingsMenuItem"!==a.name()&&this.menuButton_.focus())}))},b.prototype.createEl=function(){var b=this.options_.contentElType||"ul";this.contentEl_=p(b,{className:"vjs-menu-content"}),this.contentEl_.setAttribute("role","menu");var c=a.prototype.createEl.call(this,"div",{append:this.contentEl_,className:"vjs-menu"});return c.appendChild(this.contentEl_),S(c,"click",function(a){a.preventDefault(),a.stopImmediatePropagation()}),c},b.prototype.handleKeyPress=function(a){37===a.which||40===a.which?(a.preventDefault(),this.stepForward()):38!==a.which&&39!==a.which||(a.preventDefault(),this.stepBack())},b.prototype.stepForward=function(){var a=0;void 0!==this.focusedChild_&&(a=this.focusedChild_+1),this.focus(a)},b.prototype.stepBack=function(){var a=0;void 0!==this.focusedChild_&&(a=this.focusedChild_-1),this.focus(a)},b.prototype.focus=function(){var a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,b=this.children().slice(),c=b.length&&b[0].className&&/vjs-menu-title/.test(b[0].className);c&&b.shift(),b.length>0&&(a<0?a=0:a>=b.length&&(a=b.length-1),this.focusedChild_=a,b[a].el_.focus())},b}(vc);vc.registerComponent("Menu",Be);var Ce=function(a){function b(c){var d=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Kb(this,b);var e=Mb(this,a.call(this,c,d));e.menuButton_=new ce(c,d),e.menuButton_.controlText(e.controlText_),e.menuButton_.el_.setAttribute("aria-haspopup","true");var f=ce.prototype.buildCSSClass();return e.menuButton_.el_.className=e.buildCSSClass()+" "+f,e.menuButton_.removeClass("vjs-control"),e.addChild(e.menuButton_),e.update(),e.enabled_=!0,e.on(e.menuButton_,"tap",e.handleClick),e.on(e.menuButton_,"click",e.handleClick),e.on(e.menuButton_,"focus",e.handleFocus),e.on(e.menuButton_,"blur",e.handleBlur),e.on("keydown",e.handleSubmenuKeyPress),e}return Lb(b,a),b.prototype.update=function(){var a=this.createMenu();this.menu&&this.removeChild(this.menu),this.menu=a,this.addChild(a),this.buttonPressed_=!1,this.menuButton_.el_.setAttribute("aria-expanded","false"),this.items&&this.items.length<=this.hideThreshold_?this.hide():this.show()},b.prototype.createMenu=function(){var a=new Be(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title){var b=p("li",{className:"vjs-menu-title",innerHTML:Z(this.options_.title),tabIndex:-1});this.hideThreshold_+=1,a.children_.unshift(b),r(b,a.contentEl())}if(this.items=this.createItems(),this.items)for(var c=0;c1&&void 0!==arguments[1]?arguments[1]:this.menuButton_.el();return this.menuButton_.controlText(a,b)},b.prototype.handleClick=function(a){this.one(this.menu.contentEl(),"mouseleave",jc(this,function(a){this.unpressButton(),this.el_.blur()})),this.buttonPressed_?this.unpressButton():this.pressButton()},b.prototype.focus=function(){this.menuButton_.focus()},b.prototype.blur=function(){this.menuButton_.blur()},b.prototype.handleFocus=function(){S(lb,"keydown",jc(this,this.handleKeyPress))},b.prototype.handleBlur=function(){T(lb,"keydown",jc(this,this.handleKeyPress))},b.prototype.handleKeyPress=function(a){27===a.which||9===a.which?(this.buttonPressed_&&this.unpressButton(),9!==a.which&&(a.preventDefault(),this.menuButton_.el_.focus())):38!==a.which&&40!==a.which||this.buttonPressed_||(this.pressButton(),a.preventDefault())},b.prototype.handleSubmenuKeyPress=function(a){27!==a.which&&9!==a.which||(this.buttonPressed_&&this.unpressButton(),9!==a.which&&(a.preventDefault(),this.menuButton_.el_.focus()))},b.prototype.pressButton=function(){this.enabled_&&(this.buttonPressed_=!0,this.menu.lockShowing(),this.menuButton_.el_.setAttribute("aria-expanded","true"),sb||n()||this.menu.focus())},b.prototype.unpressButton=function(){this.enabled_&&(this.buttonPressed_=!1,this.menu.unlockShowing(),this.menuButton_.el_.setAttribute("aria-expanded","false"))},b.prototype.disable=function(){this.unpressButton(),this.enabled_=!1,this.addClass("vjs-disabled"),this.menuButton_.disable()},b.prototype.enable=function(){this.enabled_=!0,this.removeClass("vjs-disabled"),this.menuButton_.enable()},b}(vc);vc.registerComponent("MenuButton",Ce);var De=function(a){function b(c,d){Kb(this,b);var e=d.tracks,f=Mb(this,a.call(this,c,d));if(f.items.length<=1&&f.hide(),!e)return Mb(f);var g=jc(f,f.update);return e.addEventListener("removetrack",g),e.addEventListener("addtrack",g),f.player_.on("ready",g),f.player_.on("dispose",function(){e.removeEventListener("removetrack",g),e.removeEventListener("addtrack",g)}),f}return Lb(b,a),b}(Ce);vc.registerComponent("TrackButton",De);var Ee=function(a){function b(c,d){Kb(this,b);var e=Mb(this,a.call(this,c,d));return e.selectable=d.selectable,e.selected(d.selected),e.selectable?e.el_.setAttribute("role","menuitemcheckbox"):e.el_.setAttribute("role","menuitem"),e}return Lb(b,a),b.prototype.createEl=function(b,c,e){return this.nonIconControl=!0,a.prototype.createEl.call(this,"li",d({className:"vjs-menu-item",innerHTML:''+this.localize(this.options_.label)+"",tabIndex:-1},c),e)},b.prototype.handleClick=function(a){this.selected(!0)},b.prototype.selected=function(a){this.selectable&&(a?(this.addClass("vjs-selected"),this.el_.setAttribute("aria-checked","true"),this.controlText(", selected")):(this.removeClass("vjs-selected"),this.el_.setAttribute("aria-checked","false"),this.controlText(" ")))},b}(Xd);vc.registerComponent("MenuItem",Ee);var Fe=function(a){function b(c,d){Kb(this,b);var e=d.track,f=c.textTracks();d.label=e.label||e.language||"Unknown",d.selected="showing"===e.mode;var g=Mb(this,a.call(this,c,d));g.track=e;var h=jc(g,g.handleTracksChange),i=jc(g,g.handleSelectedLanguageChange);if(c.on(["loadstart","texttrackchange"],h),f.addEventListener("change",h),f.addEventListener("selectedlanguagechange",i),g.on("dispose",function(){f.removeEventListener("change",h),f.removeEventListener("selectedlanguagechange",i)}),void 0===f.onchange){var j=void 0;g.on(["tap","click"],function(){if("object"!==Jb(gb.Event))try{j=new gb.Event("change")}catch(a){}j||(j=lb.createEvent("Event"),j.initEvent("change",!0,!0)),f.dispatchEvent(j)})}return g}return Lb(b,a),b.prototype.handleClick=function(b){var c=this.track.kind,d=this.track.kinds,e=this.player_.textTracks();if(d||(d=[c]),a.prototype.handleClick.call(this,b),e)for(var f=0;f-1?"showing"!==g.mode&&(g.mode="showing"):"disabled"!==g.mode&&(g.mode="disabled")}},b.prototype.handleTracksChange=function(a){this.selected("showing"===this.track.mode)},b.prototype.handleSelectedLanguageChange=function(a){if("showing"===this.track.mode){var b=this.player_.cache_.selectedLanguage;if(b&&b.enabled&&b.language===this.track.language&&b.kind!==this.track.kind)return;this.player_.cache_.selectedLanguage={enabled:!0,language:this.track.language,kind:this.track.kind}}},b}(Ee);vc.registerComponent("TextTrackMenuItem",Fe);var Ge=function(a){function b(c,d){Kb(this,b),d.track={player:c,kind:d.kind,kinds:d.kinds,"default":!1,mode:"disabled"},d.kinds||(d.kinds=[d.kind]),d.label?d.track.label=d.label:d.track.label=d.kinds.join(" and ")+" off",d.selectable=!0;var e=Mb(this,a.call(this,c,d));return e.selected(!0),e}return Lb(b,a),b.prototype.handleTracksChange=function(a){for(var b=this.player().textTracks(),c=!0,d=0,e=b.length;d-1&&"showing"===f.mode){c=!1;break}}this.selected(c)},b.prototype.handleSelectedLanguageChange=function(a){for(var b=this.player().textTracks(),c=!0,d=0,e=b.length;d-1&&"showing"===f.mode){c=!1;break}}c&&(this.player_.cache_.selectedLanguage={enabled:!1})},b}(Fe);vc.registerComponent("OffTextTrackMenuItem",Ge);var He=function(a){function b(c){var d=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Kb(this,b),d.tracks=c.textTracks(),Mb(this,a.call(this,c,d))}return Lb(b,a),b.prototype.createItems=function(){var a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],b=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Fe,c=void 0;this.label_&&(c=this.label_+" off"),a.push(new Ge(this.player_,{kinds:this.kinds_,kind:this.kind_,label:c})),this.hideThreshold_+=1;var d=this.player_.textTracks();Array.isArray(this.kinds_)||(this.kinds_=[this.kind_]);for(var e=0;e-1){var g=new b(this.player_,{track:f,selectable:!0});g.addClass("vjs-"+f.kind+"-menu-item"),a.push(g)}}return a},b}(De);vc.registerComponent("TextTrackButton",He);var Ie=function(a){function b(c,d){Kb(this,b);var e=d.track,f=d.cue,g=c.currentTime();d.selectable=!0,d.label=f.text,d.selected=f.startTime<=g&&g=0;b--){var c=a[b];if(c.kind===this.kind_)return c}},b.prototype.getMenuCaption=function(){return this.track_&&this.track_.label?this.track_.label:this.localize(Z(this.kind_))},b.prototype.createMenu=function(){return this.options_.title=this.getMenuCaption(),a.prototype.createMenu.call(this)},b.prototype.createItems=function(){var a=[];if(!this.track_)return a;var b=this.track_.cues;if(!b)return a;for(var c=0,d=b.length;c