!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.videojs=e()}(this,function(){function t(t,e){return e={exports:{}},t(e,e.exports),e.exports}function e(t,e){ue(t).foreach(function(n){return e(t[n],n)})}function n(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return ue(t).reduce(function(n,r){return e(n,t[r],r)},n)}function r(t){for(var n=arguments.length,r=array(n>1?n-1:0),i=1;i0&&void 0!==arguments[0]?arguments[0]:"div",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments[3],i=de.createelement(t);return object.getownpropertynames(e).foreach(function(t){var n=e[t];-1!==t.indexof("aria-")||"role"===t||"type"===t?(ye.warn(ge($e,t,n)),i.setattribute(t,n)):"textcontent"===t?y(i,n):i[t]=n}),object.getownpropertynames(n).foreach(function(t){i.setattribute(t,n[t])}),r&&d(i,r),i}function y(t,e){return void 0===t.textcontent?t.innertext=e:t.textcontent=e,t}function g(t,e){e.firstchild?e.insertbefore(t,e.firstchild):e.appendchild(t)}function m(t,e){return c(e),t.classlist?t.classlist.contains(e):u(e).test(t.classname)}function _(t,e){return t.classlist?t.classlist.add(e):m(t,e)||(t.classname=(t.classname+" "+e).trim()),t}function b(t,e){return t.classlist?t.classlist.remove(e):(c(e),t.classname=t.classname.split(/\s+/).filter(function(t){return t!==e}).join(" ")),t}function t(t,e,n){var r=m(t,e);if("function"==typeof n&&(n=n(t,e)),"boolean"!=typeof n&&(n=!r),n!==r)return n?_(t,e):b(t,e),t}function c(t,e){object.getownpropertynames(e).foreach(function(n){var r=e[n];null===r||void 0===r||!1===r?t.removeattribute(n):t.setattribute(n,!0===r?"":r)})}function k(t){var e={};if(t&&t.attributes&&t.attributes.length>0)for(var n=t.attributes,r=n.length-1;r>=0;r--){var i=n[r].name,o=n[r].value;"boolean"!=typeof t[i]&&-1===",autoplay,controls,playsinline,loop,muted,default,defaultmuted,".indexof(","+i+",")||(o=null!==o),e[i]=o}return e}function e(t,e){return t.getattribute(e)}function w(t,e,n){t.setattribute(e,n)}function s(t,e){t.removeattribute(e)}function x(){de.body.focus(),de.onselectstart=function(){return!1}}function j(){de.onselectstart=function(){return!0}}function a(t){if(t&&t.getboundingclientrect&&t.parentnode){var e=t.getboundingclientrect(),n={};return["bottom","height","left","right","top","width"].foreach(function(t){void 0!==e[t]&&(n[t]=e[t])}),n.height||(n.height=parsefloat(a(t,"height"))),n.width||(n.width=parsefloat(a(t,"width"))),n}}function p(t){var e=void 0;if(t.getboundingclientrect&&t.parentnode&&(e=t.getboundingclientrect()),!e)return{left:0,top:0};var n=de.documentelement,r=de.body,i=n.clientleft||r.clientleft||0,o=le.pagexoffset||r.scrollleft,s=e.left+o-i,a=n.clienttop||r.clienttop||0,l=le.pageyoffset||r.scrolltop,c=e.top+l-a;return{left:math.round(s),top:math.round(c)}}function o(t,e){var n={},r=p(t),i=t.offsetwidth,o=t.offsetheight,s=r.top,a=r.left,l=e.pagey,c=e.pagex;return e.changedtouches&&(c=e.changedtouches[0].pagex,l=e.changedtouches[0].pagey),n.y=math.max(0,math.min(1,(s-l+o)/o)),n.x=math.max(0,math.min(1,(c-a)/i)),n}function n(t){return i(t)&&3===t.nodetype}function m(t){for(;t.firstchild;)t.removechild(t.firstchild);return t}function i(t){return"function"==typeof t&&(t=t()),(array.isarray(t)?t:[t]).map(function(t){return"function"==typeof t&&(t=t()),p(t)||n(t)?t:"string"==typeof t&&/\s/.test(t)?de.createtextnode(t):void 0}).filter(function(t){return t})}function d(t,e){return i(e).foreach(function(e){return t.appendchild(e)}),t}function l(t,e){return d(m(t),e)}function r(t){return void 0===t.button&&void 0===t.buttons||(0===t.button&&void 0===t.buttons||(9===oe||0===t.button&&1===t.buttons))}function b(){return tn++}function f(t){var e=t[nn];return e||(e=t[nn]=b()),en[e]||(en[e]={}),en[e]}function v(t){var e=t[nn];return!!e&&!!object.getownpropertynames(en[e]).length}function h(t){var e=t[nn];if(e){delete en[e];try{delete t[nn]}catch(e){t.removeattribute?t.removeattribute(nn):t[nn]=null}}}function w(t,e){var n=f(t);0===n.handlers[e].length&&(delete n.handlers[e],t.removeeventlistener?t.removeeventlistener(e,n.dispatcher,!1):t.detachevent&&t.detachevent("on"+e,n.dispatcher)),object.getownpropertynames(n.handlers).length<=0&&(delete n.handlers,delete n.dispatcher,delete n.disabled),0===object.getownpropertynames(n).length&&h(t)}function u(t,e,n,r){n.foreach(function(n){t(e,n,r)})}function z(t){function e(){return!0}function n(){return!1}if(!t||!t.ispropagationstopped){var r=t||le.event;t={};for(var i in r)"layerx"!==i&&"layery"!==i&&"keylocation"!==i&&"webkitmovementx"!==i&&"webkitmovementy"!==i&&("returnvalue"===i&&r.preventdefault||(t[i]=r[i]));if(t.target||(t.target=t.srcelement||de),t.relatedtarget||(t.relatedtarget=t.fromelement===t.target?t.toelement:t.fromelement),t.preventdefault=function(){r.preventdefault&&r.preventdefault(),t.returnvalue=!1,r.returnvalue=!1,t.defaultprevented=!0},t.defaultprevented=!1,t.stoppropagation=function(){r.stoppropagation&&r.stoppropagation(),t.cancelbubble=!0,r.cancelbubble=!0,t.ispropagationstopped=e},t.ispropagationstopped=n,t.stopimmediatepropagation=function(){r.stopimmediatepropagation&&r.stopimmediatepropagation(),t.isimmediatepropagationstopped=e,t.stoppropagation()},t.isimmediatepropagationstopped=n,null!==t.clientx&&void 0!==t.clientx){var o=de.documentelement,s=de.body;t.pagex=t.clientx+(o&&o.scrollleft||s&&s.scrollleft||0)-(o&&o.clientleft||s&&s.clientleft||0),t.pagey=t.clienty+(o&&o.scrolltop||s&&s.scrolltop||0)-(o&&o.clienttop||s&&s.clienttop||0)}t.which=t.charcode||t.keycode,null!==t.button&&void 0!==t.button&&(t.button=1&t.button?0:4&t.button?1:2&t.button?2:0)}return t}function x(t,e,n){if(array.isarray(e))return u(x,t,e,n);var r=f(t);if(r.handlers||(r.handlers={}),r.handlers[e]||(r.handlers[e]=[]),n.guid||(n.guid=b()),r.handlers[e].push(n),r.dispatcher||(r.disabled=!1,r.dispatcher=function(e,n){if(!r.disabled){e=z(e);var i=r.handlers[e.type];if(i)for(var o=i.slice(0),s=0,a=o.length;s-1&&(i={passive:!0}),t.addeventlistener(e,r.dispatcher,i)}else t.attachevent&&t.attachevent("on"+e,r.dispatcher)}function q(t,e,n){if(v(t)){var r=f(t);if(r.handlers){if(array.isarray(e))return u(q,t,e,n);var i=function(t,e){r.handlers[e]=[],w(t,e)};if(void 0!==e){var o=r.handlers[e];if(o){if(!n)return void i(t,e);if(n.guid)for(var s=0;s1&&void 0!==arguments[1]?arguments[1]:{},n=e.eventbuskey;if(n){if(!t[n].nodename)throw new error('the eventbuskey "'+n+'" does not refer to an element.');t.eventbusel_=t[n]}else t.eventbusel_=v("span",{classname:"vjs-event-bus"});return r(t,cn),t.on("dispose",function(){t.off(),le.settimeout(function(){t.eventbusel_=null},0)}),t}function j(t,e){return r(t,kn),t.state=r({},t.state,e),"function"==typeof t.handlestatechanged&&vn(t)&&t.on("statechanged",t.handlestatechanged),t}function q(t){return"string"!=typeof t?t:t.charat(0).touppercase()+t.slice(1)}function z(t,e){return q(t)===q(e)}function tt(){for(var t={},n=arguments.length,r=array(n),i=0;in)throw new error("failed to execute '"+t+"' on 'timeranges': the index provided ("+e+") is non-numeric or out of bounds (0-"+n+").")}function nt(t,e,n,r){return et(t,r,n.length-1),n[r][e]}function rt(t){return void 0===t||0===t.length?{length:0,start:function(){throw new error("this timeranges object is empty")},end:function(){throw new error("this timeranges object is empty")}}:{length:t.length,start:nt.bind(null,"start",0,t),end:nt.bind(null,"end",1,t)}}function it(t,e){return array.isarray(t)?rt(t):void 0===t||void 0===e?rt():rt([[t,e]])}function ot(t,e){var n=0,r=void 0,i=void 0;if(!e)return 0;t&&t.length||(t=it(0,0));for(var o=0;oe&&(i=e),n+=i-r;return n/e}function st(t){if(t instanceof st)return t;"number"==typeof t?this.code=t:"string"==typeof t?this.message=t:i(t)&&("number"==typeof t.code&&(this.code=t.code),r(this,t)),this.message||(this.message=st.defaultmessages[this.code]||"")}function at(t,e){var n,r=null;try{n=json.parse(t,e)}catch(t){r=t}return[r,n]}function lt(t){return void 0!==t&&"function"==typeof t.then}function ct(t){lt(t)&&t.then(null,function(t){})}function ut(t){var e=or.call(t);return"[object function]"===e||"function"==typeof t&&"[object regexp]"!==e||"undefined"!=typeof window&&(t===window.settimeout||t===window.alert||t===window.confirm||t===window.prompt)}function ht(t,e,n){if(!ir(e))throw new typeerror("iterator must be a function");arguments.length<3&&(n=this),"[object array]"===lr.call(t)?pt(t,e,n):"string"==typeof t?dt(t,e,n):ft(t,e,n)}function pt(t,e,n){for(var r=0,i=t.length;r0&&(u=settimeout(function(){if(!c){c=!0,a.abort("timeout");var t=new error("xmlhttprequest timeout");t.code="etimedout",r(t)}},t.timeout)),a.setrequestheader)for(l in f)f.hasownproperty(l)&&a.setrequestheader(l,f[l]);else if(t.headers&&!yt(t.headers))throw new error("headers cannot be set on an xdomainrequest object");return"responsetype"in t&&(a.responsetype=t.responsetype),"beforesend"in t&&"function"==typeof t.beforesend&&t.beforesend(a),a.send(d||null),a}function bt(t){if("document"===t.responsetype)return t.responsexml;var e=t.responsexml&&"parsererror"===t.responsexml.documentelement.nodename;return""!==t.responsetype||e?null:t.responsexml}function tt(){}function ct(t,e){this.name="parsingerror",this.code=t.code,this.message=e||t.message}function kt(t){function e(t,e,n,r){return 3600*(0|t)+60*(0|e)+(0|n)+(0|r)/1e3}var n=t.match(/^(\d+):(\d{2})(:\d{2})?\.(\d{3})/);return n?n[3]?e(n[1],n[2],n[3].replace(":",""),n[4]):n[1]>59?e(n[1],n[2],0,n[4]):e(0,n[1],n[2],n[4]):null}function et(){this.values=sr(null)}function wt(t,e,n,r){var i=r?t.split(r):[t];for(var o in i)if("string"==typeof i[o]){var s=i[o].split(n);if(2===s.length){var a=s[0],l=s[1];e(a,l)}}}function st(t,e,n){function r(){var e=kt(t);if(null===e)throw new ct(ct.errors.badtimestamp,"malformed timestamp: "+o);return t=t.replace(/^[^\sa-za-z-]+/,""),e}function i(){t=t.replace(/^\s+/,"")}var o=t;if(i(),e.starttime=r(),i(),"--\x3e"!==t.substr(0,3))throw new ct(ct.errors.badtimestamp,"malformed time stamp (time stamps must be separated by '--\x3e'): "+o);t=t.substr(3),i(),e.endtime=r(),i(),function(t,e){var r=new et;wt(t,function(t,e){switch(t){case"region":for(var i=n.length-1;i>=0;i--)if(n[i].id===e){r.set(t,n[i].region);break}break;case"vertical":r.alt(t,e,["rl","lr"]);break;case"line":var o=e.split(","),s=o[0];r.integer(t,s),r.percent(t,s)&&r.set("snaptolines",!1),r.alt(t,s,["auto"]),2===o.length&&r.alt("linealign",o[1],["start","middle","end"]);break;case"position":o=e.split(","),r.percent(t,o[0]),2===o.length&&r.alt("positionalign",o[1],["start","middle","end"]);break;case"size":r.percent(t,e);break;case"align":r.alt(t,e,["start","middle","end","left","right"])}},/:/,/\s/),e.region=r.get("region",null),e.vertical=r.get("vertical",""),e.line=r.get("line","auto"),e.linealign=r.get("linealign","start"),e.snaptolines=r.get("snaptolines",!0),e.size=r.get("size",100),e.align=r.get("align","middle"),e.position=r.get("position",{start:0,left:0,middle:50,end:100,right:100},e.align),e.positionalign=r.get("positionalign",{start:"start",left:"start",middle:"middle",end:"end",right:"end"},e.align)}(t,e)}function xt(t,e){function n(t){return xr[t]}for(var r,i=t.document.createelement("div"),o=i,s=[];null!==(r=function(){if(!e)return null;var t=e.match(/^([^<]*)(<[^>]+>?)?/);return function(t){return e=e.substr(t.length),t}(t[1]?t[1]:t[2])}());)if("<"!==r[0])o.appendchild(t.document.createtextnode(function(t){for(;c=t.match(/&(amp|lt|gt|lrm|rlm|nbsp);/);)t=t.replace(c[0],n);return t}(r)));else{if("/"===r[1]){s.length&&s[s.length-1]===r.substr(2).replace(">","")&&(s.pop(),o=o.parentnode);continue}var a,l=kt(r.substr(1,r.length-2));if(l){a=t.document.createprocessinginstruction("timestamp",l),o.appendchild(a);continue}var c=r.match(/^<([^.\s\/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!c)continue;if(!(a=function(e,n){var r=jr[e];if(!r)return null;var i=t.document.createelement(r);i.localname=r;var o=ar[e];return o&&n&&(i[o]=n.trim()),i}(c[1],c[3])))continue;if(!function(t,e){return!pr[e.localname]||pr[e.localname]===t.localname}(o,a))continue;c[2]&&(a.classname=c[2].substr(1).replace("."," ")),s.push(c[1]),o.appendchild(a),o=a}return i}function jt(t){for(var e=0;e=n[0]&&t<=n[1])return!0}return!1}function at(t){function e(t,e){for(var n=e.childnodes.length-1;n>=0;n--)t.push(e.childnodes[n])}function n(t){if(!t||!t.length)return null;var r=t.pop(),i=r.textcontent||r.innertext;if(i){var o=i.match(/^.*(\n|\r)/);return o?(t.length=0,o[0]):i}return"ruby"===r.tagname?n(t):r.childnodes?(e(t,r),n(t)):void 0}var r,i=[],o="";if(!t||!t.childnodes)return"ltr";for(e(i,t);o=n(i);)for(var s=0;s=0&&t.line<=100))return t.line;if(!t.track||!t.track.texttracklist||!t.track.texttracklist.mediaelement)return-1;for(var e=t.track,n=e.texttracklist,r=0,i=0;ih&&(u=u<0?-1:1,u*=math.ceil(h/c)*c),s<0&&(u+=""===o.vertical?n.height:n.width,a=a.reverse()),i.move(p,u)}else{var d=i.lineheight/n.height*100;switch(o.linealign){case"middle":s-=d/2;break;case"end":s-=d}switch(o.vertical){case"":e.applystyles({top:e.formatstyle(s,"%")});break;case"rl":e.applystyles({left:e.formatstyle(s,"%")});break;case"lr":e.applystyles({right:e.formatstyle(s,"%")})}a=["+y","-x","+x","-y"],i=new mt(e)}var f=function(t,e){for(var i,o=new mt(t),s=1,a=0;al&&(i=new mt(t),s=l),t=new mt(o)}return i||o}(i,a);e.move(f.tocsscompatvalues(n))}function dt(){}function lt(t){return"string"==typeof t&&(!!ir[t.tolowercase()]&&t.tolowercase())}function rt(t){return"string"==typeof t&&(!!dr[t.tolowercase()]&&t.tolowercase())}function bt(t){for(var e=1;e100)throw new error("position must be between 0 and 100.");y=t,this.hasbeenreset=!0}})),object.defineproperty(r,"positionalign",bt({},o,{get:function(){return g},set:function(t){var e=rt(t);if(!e)throw new syntaxerror("an invalid or illegal string was specified.");g=e,this.hasbeenreset=!0}})),object.defineproperty(r,"size",bt({},o,{get:function(){return m},set:function(t){if(t<0||t>100)throw new error("size must be between 0 and 100.");m=t,this.hasbeenreset=!0}})),object.defineproperty(r,"align",bt({},o,{get:function(){return _},set:function(t){var e=rt(t);if(!e)throw new syntaxerror("an invalid or illegal string was specified.");_=e,this.hasbeenreset=!0}})),r.displaystate=void 0,i)return r}function vt(t){return"string"==typeof t&&(!!rr[t.tolowercase()]&&t.tolowercase())}function ht(t){return"number"==typeof t&&t>=0&&t<=100}function wt(){var t=100,e=3,n=0,r=100,i=0,o=100,s="";object.defineproperties(this,{width:{enumerable:!0,get:function(){return t},set:function(e){if(!ht(e))throw new error("width must be between 0 and 100.");t=e}},lines:{enumerable:!0,get:function(){return e},set:function(t){if("number"!=typeof t)throw new typeerror("lines must be set to a number.");e=t}},regionanchory:{enumerable:!0,get:function(){return r},set:function(t){if(!ht(t))throw new error("regionanchorx must be between 0 and 100.");r=t}},regionanchorx:{enumerable:!0,get:function(){return n},set:function(t){if(!ht(t))throw new error("regionanchory must be between 0 and 100.");n=t}},viewportanchory:{enumerable:!0,get:function(){return o},set:function(t){if(!ht(t))throw new error("viewportanchory must be between 0 and 100.");o=t}},viewportanchorx:{enumerable:!0,get:function(){return i},set:function(t){if(!ht(t))throw new error("viewportanchorx must be between 0 and 100.");i=t}},scroll:{enumerable:!0,get:function(){return s},set:function(t){var e=vt(t);if(!1===e)throw new syntaxerror("an invalid or illegal string was specified.");s=e}}})}function ut(t,e,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},o=t.texttracks();i.kind=e,n&&(i.label=n),r&&(i.language=r),i.tech=t;var s=new wr.text.trackclass(i);return o.addtrack(s),s}function zt(t,e){hr[t]=hr[t]||[],hr[t].push(e)}function xt(t,e,n){t.settimeout(function(){return $t(e,hr[e.type],n,t)},1)}function qt(t,e){t.foreach(function(t){return t.settech&&t.settech(e)})}function kt(t,e,n){return t.reduceright(gt(n),e[n]())}function yt(t,e,n,r){return e[n](t.reduce(gt(n),r))}function gt(t){return function(e,n){return n[t]?n[t](e):e}}function $t(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments[2],i=arguments[3],o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[],s=arguments.length>5&&void 0!==arguments[5]&&arguments[5],a=e[0],l=e.slice(1);if("string"==typeof a)$t(t,hr[a],n,i,o,s);else if(a){var c=a(i);c.setsource(r({},t),function(e,r){if(e)return $t(t,l,n,i,o,s);o.push(c),$t(r,t.type===r.type?l:hr[r.type],n,i,o,s)})}else l.length?$t(t,l,n,i,o,s):s?n(t,o):$t(t,hr["*"],n,i,o,!0)}function jt(t,e){return"rgba("+parseint(t[1]+t[1],16)+","+parseint(t[2]+t[2],16)+","+parseint(t[3]+t[3],16)+","+e+")"}function qt(t,e,n){try{t.style[e]=n}catch(t){return}}function zt(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t;t=t<0?0:t;var n=math.floor(t%60),r=math.floor(t/60%60),i=math.floor(t/3600),o=math.floor(e/60%60),s=math.floor(e/3600);return(isnan(t)||t===1/0)&&(i=r=n="-"),i=i>0||s>0?i+":":"",r=((i||o>=10)&&r<10?"0"+r:r)+":",n=n<10?"0"+n:n,i+r+n}function te(t,e){if(e&&(t=e(t)),t&&"none"!==t)return t}function ee(t,e){return te(t.options[t.options.selectedindex].value,e)}function ne(t,e,n){if(e)for(var r=0;r2&&void 0!==arguments[2]?arguments[2]:!!oe&&oe<11,r=ze.levels[xe],o=new regexp("^("+r+")$");if("log"!==t&&e.unshift(t.touppercase()+":"),qe&&qe.push([].concat(e)),e.unshift("videojs:"),le.console){var s=le.console[t];s||"debug"!==t||(s=le.console.info||le.console.log),s&&r&&o.test(t)&&(n&&(e=e.map(function(t){if(i(t)||array.isarray(t))try{return json.stringify(t)}catch(e){return string(t)}return string(t)}).join(" ")),s.apply?s[array.isarray(e)?"apply":"call"](le.console,e):s(e))}};ze=function(){for(var t=arguments.length,e=array(t),n=0;n0)for(var i=0,o=t.length;i0)for(var s=0,a=e.length;s0)for(var l=0,c=n.length;l0)for(var u=0,p=r.length;u=e&&(t.apply(void 0,arguments),n=r)}},fn=function(){};fn.prototype.allowedevents_={},fn.prototype.on=function(t,e){var n=this.addeventlistener;this.addeventlistener=function(){},x(this,t,e),this.addeventlistener=n},fn.prototype.addeventlistener=fn.prototype.on,fn.prototype.off=function(t,e){q(this,t,e)},fn.prototype.removeeventlistener=fn.prototype.off,fn.prototype.one=function(t,e){var n=this.addeventlistener;this.addeventlistener=function(){},y(this,t,e),this.addeventlistener=n},fn.prototype.trigger=function(t){var e=t.type||t;"string"==typeof t&&(t={type:e}),t=z(t),this.allowedevents_[e]&&this["on"+e]&&this["on"+e](t),k(this,t)},fn.prototype.dispatchevent=fn.prototype.trigger;var vn=function(t){return t instanceof fn||!!t.eventbusel_&&["on","one","off","trigger"].every(function(e){return"function"==typeof t[e]})},yn=function(t){return"string"==typeof t&&/\s/.test(t)||array.isarray(t)&&!!t.length},gn=function(t){if(!t.nodename&&!vn(t))throw new error("invalid target; must be a dom node or evented object.")},mn=function(t){if(!yn(t))throw new error("invalid event type; must be a non-empty string or array.")},_n=function(t){if("function"!=typeof t)throw new error("invalid listener; must be a function.")},bn=function(t,e){var n=e.length<3||e[0]===t||e[0]===t.eventbusel_,r=void 0,i=void 0,o=void 0;return n?(r=t.eventbusel_,e.length>=3&&e.shift(),i=e[0],o=e[1]):(r=e[0],i=e[1],o=e[2]),gn(r),mn(i),_n(o),o=pn(t,o),{istargetingself:n,target:r,type:i,listener:o}},tn=function(t,e,n,r){gn(t),t.nodename?sn[e](t,n,r):t[e](n,r)},cn={on:function(){for(var t=this,e=arguments.length,n=array(e),r=0;r=0;t--)this.children_[t].dispose&&this.children_[t].dispose();this.children_=null,this.childindex_=null,this.childnameindex_=null,this.el_&&(this.el_.parentnode&&this.el_.parentnode.removechild(this.el_),h(this.el_),this.el_=null),this.player_=null},t.prototype.player=function(){return this.player_},t.prototype.options=function(t){return ye.warn("this.options() has been deprecated and will be moved to the constructor in 6.0"),t?(this.options_=tt(this.options_,t),this.options_):this.options_},t.prototype.el=function(){return this.el_},t.prototype.createel=function(t,e,n){return v(t,e,n)},t.prototype.localize=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t,r=this.player_.language&&this.player_.language(),i=this.player_.languages&&this.player_.languages(),o=i&&i[r],s=r&&r.split("-")[0],a=i&&i[s],l=n;return o&&o[t]?l=o[t]:a&&a[t]&&(l=a[t]),e&&(l=l.replace(/\{(\d+)\}/g,function(t,n){var r=e[n-1],i=r;return void 0===r&&(i=t),i})),l},t.prototype.contentel=function(){return this.contentel_||this.el_},t.prototype.id=function(){return this.id_},t.prototype.name=function(){return this.name_},t.prototype.children=function(){return this.children_},t.prototype.getchildbyid=function(t){return this.childindex_[t]},t.prototype.getchild=function(t){if(t)return t=q(t),this.childnameindex_[t]},t.prototype.addchild=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.children_.length,i=void 0,o=void 0;if("string"==typeof e){o=q(e);var s=n.componentclass||o;n.name=o;var a=t.getcomponent(s);if(!a)throw new error("component "+s+" does not exist");if("function"!=typeof a)return null;i=new a(this.player_||this,n)}else i=e;if(this.children_.splice(r,0,i),"function"==typeof i.id&&(this.childindex_[i.id()]=i),o=o||i.name&&q(i.name()),o&&(this.childnameindex_[o]=i),"function"==typeof i.el&&i.el()){var l=this.contentel().children,c=l[r]||null;this.contentel().insertbefore(i.el(),c)}return i},t.prototype.removechild=function(t){if("string"==typeof t&&(t=this.getchild(t)),t&&this.children_){for(var e=!1,n=this.children_.length-1;n>=0;n--)if(this.children_[n]===t){e=!0,this.children_.splice(n,1);break}if(e){this.childindex_[t.id()]=null,this.childnameindex_[t.name()]=null;var r=t.el();r&&r.parentnode===this.contentel()&&this.contentel().removechild(t.el())}}},t.prototype.initchildren=function(){var e=this,n=this.options_.children;if(n){var r=this.options_,i=function(t){var n=t.name,i=t.opts;if(void 0!==r[n]&&(i=r[n]),!1!==i){!0===i&&(i={}),i.playeroptions=e.options_.playeroptions;var o=e.addchild(n,i);o&&(e[n]=o)}},o=void 0,s=t.getcomponent("tech");o=array.isarray(n)?n:object.keys(n),o.concat(object.keys(this.options_).filter(function(t){return!o.some(function(e){return"string"==typeof e?t===e:t===e.name})})).map(function(t){var r=void 0,i=void 0;return"string"==typeof t?(r=t,i=n[r]||e.options_[r]||{}):(r=t.name,i=t),{name:r,opts:i}}).filter(function(e){var n=t.getcomponent(e.opts.componentclass||q(e.name));return n&&!s.istech(n)}).foreach(i)}},t.prototype.buildcssclass=function(){return""},t.prototype.ready=function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(t)return this.isready_?void(e?t.call(this):this.settimeout(t,1)):(this.readyqueue_=this.readyqueue_||[],void this.readyqueue_.push(t))},t.prototype.triggerready=function(){this.isready_=!0,this.settimeout(function(){var t=this.readyqueue_;this.readyqueue_=[],t&&t.length>0&&t.foreach(function(t){t.call(this)},this),this.trigger("ready")},1)},t.prototype.$=function(t,e){return je(t,e||this.contentel())},t.prototype.$$=function(t,e){return qe(t,e||this.contentel())},t.prototype.hasclass=function(t){return m(this.el_,t)},t.prototype.addclass=function(t){_(this.el_,t)},t.prototype.removeclass=function(t){b(this.el_,t)},t.prototype.toggleclass=function(t,e){t(this.el_,t,e)},t.prototype.show=function(){this.removeclass("vjs-hidden")},t.prototype.hide=function(){this.addclass("vjs-hidden")},t.prototype.lockshowing=function(){this.addclass("vjs-lock-showing")},t.prototype.unlockshowing=function(){this.removeclass("vjs-lock-showing")},t.prototype.getattribute=function(t){return e(this.el_,t)},t.prototype.setattribute=function(t,e){w(this.el_,t,e)},t.prototype.removeattribute=function(t){s(this.el_,t)},t.prototype.width=function(t,e){return this.dimension("width",t,e)},t.prototype.height=function(t,e){return this.dimension("height",t,e)},t.prototype.dimensions=function(t,e){this.width(t,!0),this.height(e)},t.prototype.dimension=function(t,e,n){if(void 0!==e)return null!==e&&e===e||(e=0),-1!==(""+e).indexof("%")||-1!==(""+e).indexof("px")?this.el_.style[t]=e:this.el_.style[t]="auto"===e?"":e+"px",void(n||this.trigger("componentresize"));if(!this.el_)return 0;var r=this.el_.style[t],i=r.indexof("px");return-1!==i?parseint(r.slice(0,i),10):parseint(this.el_["offset"+q(t)],10)},t.prototype.currentdimension=function(t){var e=0;if("width"!==t&&"height"!==t)throw new error("currentdimension only accepts width or height value");if("function"==typeof le.getcomputedstyle){var n=le.getcomputedstyle(this.el_);e=n.getpropertyvalue(t)||n[t]}if(0===(e=parsefloat(e))){var r="offset"+q(t);e=this.el_[r]}return e},t.prototype.currentdimensions=function(){return{width:this.currentdimension("width"),height:this.currentdimension("height")}},t.prototype.currentwidth=function(){return this.currentdimension("width")},t.prototype.currentheight=function(){return this.currentdimension("height")},t.prototype.focus=function(){this.el_.focus()},t.prototype.blur=function(){this.el_.blur()},t.prototype.emittapevents=function(){var t=0,e=null,n=void 0;this.on("touchstart",function(r){1===r.touches.length&&(e={pagex:r.touches[0].pagex,pagey:r.touches[0].pagey},t=(new date).gettime(),n=!0)}),this.on("touchmove",function(t){if(t.touches.length>1)n=!1;else if(e){var r=t.touches[0].pagex-e.pagex,i=t.touches[0].pagey-e.pagey,o=math.sqrt(r*r+i*i);o>10&&(n=!1)}});var r=function(){n=!1};this.on("touchleave",r),this.on("touchcancel",r),this.on("touchend",function(r){if(e=null,!0===n){(new date).gettime()-t<200&&(r.preventdefault(),this.trigger("tap"))}})},t.prototype.enabletouchactivity=function(){if(this.player()&&this.player().reportuseractivity){var t=pn(this.player(),this.player().reportuseractivity),e=void 0;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)}},t.prototype.settimeout=function(t,e){var n=this;t=pn(this,t);var r=le.settimeout(t,e),i=function(){return n.cleartimeout(r)};return i.guid="vjs-timeout-"+r,this.on("dispose",i),r},t.prototype.cleartimeout=function(t){le.cleartimeout(t);var e=function(){};return e.guid="vjs-timeout-"+t,this.off("dispose",e),t},t.prototype.setinterval=function(t,e){var n=this;t=pn(this,t);var r=le.setinterval(t,e),i=function(){return n.clearinterval(r)};return i.guid="vjs-interval-"+r,this.on("dispose",i),r},t.prototype.clearinterval=function(t){le.clearinterval(t);var e=function(){};return e.guid="vjs-interval-"+t,this.off("dispose",e),t},t.prototype.requestanimationframe=function(t){var e=this;if(this.supportsraf_){t=pn(this,t);var n=le.requestanimationframe(t),r=function(){return e.cancelanimationframe(n)};return r.guid="vjs-raf-"+n,this.on("dispose",r),n}return this.settimeout(t,1e3/60)},t.prototype.cancelanimationframe=function(t){if(this.supportsraf_){le.cancelanimationframe(t);var e=function(){};return e.guid="vjs-raf-"+t,this.off("dispose",e),t}return this.cleartimeout(t)},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),o=t===n||t.prototype.isprototypeof(n.prototype);if(i||!o){var s=void 0;throw s=i?"techs must be registered using tech.registertech()":"must be a component subclass",new error('illegal component, "'+e+'"; '+s+".")}e=q(e),t.components_||(t.components_={});var a=t.getcomponent("player");if("player"===e&&a&&a.players){var l=a.players,c=object.keys(l);if(l&&c.length>0&&c.map(function(t){return l[t]}).every(boolean))throw new error("can not register player component after player has been created.")}return t.components_[e]=n,n},t.getcomponent=function(e){if(e)return e=q(e),t.components_&&t.components_[e]?t.components_[e]:void 0},t}();en.prototype.supportsraf_="function"==typeof le.requestanimationframe&&"function"==typeof le.cancelanimationframe,en.registercomponent("component",en);for(var wn={},sn=[["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"]],xn=sn[0],jn=void 0,an=0;an0&&void 0!==arguments[0]?arguments[0]:[],i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;be(this,e);var o=ve(this,t.call(this));if(!i&&(i=o,pe)){i=de.createelement("custom");for(var s in e.prototype)"constructor"!==s&&(i[s]=e.prototype[s])}i.tracks_=[],object.defineproperty(i,"length",{get:function(){return this.tracks_.length}});for(var a=0;a0&&void 0!==arguments[0]?arguments[0]:[];be(this,e);for(var o=void 0,s=i.length-1;s>=0;s--)if(i[s].enabled){hn(i,i[s]);break}if(pe){o=de.createelement("custom");for(var a in fn.prototype)"constructor"!==a&&(o[a]=fn.prototype[a]);for(var l in e.prototype)"constructor"!==l&&(o[l]=e.prototype[l])}return o=n=ve(this,t.call(this,i,o)),o.changing_=!1,r=o,ve(n,r)}return fe(e,t),e.prototype.addtrack=function(e){var n=this;e.enabled&&hn(this,e),t.prototype.addtrack.call(this,e),e.addeventlistener&&e.addeventlistener("enabledchange",function(){n.changing_||(n.changing_=!0,hn(n,e),n.changing_=!1,n.trigger("change"))})},e}(fn),un=function(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:[];be(this,e);for(var o=void 0,s=i.length-1;s>=0;s--)if(i[s].selected){un(i,i[s]);break}if(pe){o=de.createelement("custom");for(var a in fn.prototype)"constructor"!==a&&(o[a]=fn.prototype[a]);for(var l in e.prototype)"constructor"!==l&&(o[l]=e.prototype[l])}return o=n=ve(this,t.call(this,i,o)),o.changing_=!1,object.defineproperty(o,"selectedindex",{get:function(){for(var t=0;t0&&void 0!==arguments[0]?arguments[0]:[];be(this,e);var o=void 0;if(pe){o=de.createelement("custom");for(var s in fn.prototype)"constructor"!==s&&(o[s]=fn.prototype[s]);for(var a in e.prototype)"constructor"!==a&&(o[a]=e.prototype[a])}return o=n=ve(this,t.call(this,i,o)),r=o,ve(n,r)}return fe(e,t),e.prototype.addtrack=function(e){t.prototype.addtrack.call(this,e),e.addeventlistener("modechange",pn(this,function(){this.trigger("change")})),-1===["metadata","chapters"].indexof(e.kind)&&e.addeventlistener("modechange",pn(this,function(){this.trigger("selectedlanguagechange")}))},e}(fn),qn=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];be(this,t);var n=this;if(pe){n=de.createelement("custom");for(var r in t.prototype)"constructor"!==r&&(n[r]=t.prototype[r])}n.trackelements_=[],object.defineproperty(n,"length",{get:function(){return this.trackelements_.length}});for(var i=0,o=e.length;i0&&void 0!==arguments[0]?arguments[0]:{};be(this,e);var i=ve(this,t.call(this)),o=i;if(pe){o=de.createelement("custom");for(var s in e.prototype)"constructor"!==s&&(o[s]=e.prototype[s])}var a={id:r.id||"vjs_track_"+b(),kind:r.kind||"",label:r.label||"",language:r.language||""};for(var l in a)!function(t){object.defineproperty(o,t,{get:function(){return a[t]},set:function(){}})}(l);return n=o,ve(i,n)}return fe(e,t),e}(fn),zn=function(t){var e=["protocol","hostname","port","pathname","search","hash","host"],n=de.createelement("a");n.href=t;var r=""===n.host&&"file:"!==n.protocol,i=void 0;r&&(i=de.createelement("div"),i.innerhtml='',n=i.firstchild,i.setattribute("style","display:none; position:absolute;"),de.body.appendchild(i));for(var o={},s=0;sx',t=e.firstchild.href}return t},er=function(t){if("string"==typeof t){var e=/^(\/?)([\s\s]*?)((?:\.{1,2}|[^\/]+?)(\.([^\.\/\?]+)))(?:[\/]*|[\?].*)$/i,n=e.exec(t);if(n)return n.pop().tolowercase()}return""},nr=function(t){var e=le.location,n=zn(t);return(":"===n.protocol?e.protocol:n.protocol)+n.host!==e.protocol+e.host},rr=(object.freeze||object)({parseurl:zn,getabsoluteurl:tr,getfileextension:er,iscrossorigin:nr}),ir=ut,or=object.prototype.tostring,sr=t(function(t,e){function n(t){return t.replace(/^\s*|\s*$/g,"")}e=t.exports=n,e.left=function(t){return t.replace(/^\s*/,"")},e.right=function(t){return t.replace(/\s*$/,"")}}),ar=ht,lr=object.prototype.tostring,cr=object.prototype.hasownproperty,ur=function(t){return"[object array]"===object.prototype.tostring.call(t)},hr=function(t){if(!t)return{};var e={};return ar(sr(t).split("\n"),function(t){var n=t.indexof(":"),r=sr(t.slice(0,n)).tolowercase(),i=sr(t.slice(n+1));void 0===e[r]?e[r]=i:ur(e[r])?e[r].push(i):e[r]=[e[r],i]}),e},pr=vt,dr=object.prototype.hasownproperty,fr=mt;mt.xmlhttprequest=le.xmlhttprequest||tt,mt.xdomainrequest="withcredentials"in new mt.xmlhttprequest?mt.xmlhttprequest:le.xdomainrequest,function(t,e){for(var n=0;n0&&(le.console&&le.console.groupcollapsed&&le.console.groupcollapsed("text track parsing errors for "+e.src),r.foreach(function(t){return ye.error(t)}),le.console&&le.console.groupend&&le.console.groupend()),n.flush()},yr=function(t,e){var n={uri:t},r=nr(t);r&&(n.cors=r),fr(n,pn(this,function(t,n,r){if(t)return ye.error(t,n);if(e.loaded_=!0,"function"!=typeof le.webvtt){if(e.tech_){var i=function(){return vr(r,e)};e.tech_.on("vttjsloaded",i),e.tech_.on("vttjserror",function(){ye.error("vttjs failed to load, stopping trying to process "+e.src),e.tech_.off("vttjsloaded",i)})}}else vr(r,e)}))},gr=function(t){function e(){var n,r,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(be(this,e),!i.tech)throw new error("a tech was not provided.");var o=tt(i,{kind:$n[i.kind]||"subtitles",language:i.language||i.srclang||""}),s=jn[o.mode]||"disabled",a=o.default;"metadata"!==o.kind&&"chapters"!==o.kind||(s="hidden");var l=n=ve(this,t.call(this,o));if(l.tech_=o.tech,pe)for(var c in e.prototype)"constructor"!==c&&(l[c]=e.prototype[c]);l.cues_=[],l.activecues_=[];var u=new kn(l.cues_),h=new kn(l.activecues_),p=!1,d=pn(l,function(){this.activecues,p&&(this.trigger("cuechange"),p=!1)});return"disabled"!==s&&l.tech_.ready(function(){l.tech_.on("timeupdate",d)},!0),object.defineproperty(l,"default",{get:function(){return a},set:function(){}}),object.defineproperty(l,"mode",{get:function(){return s},set:function(t){var e=this;jn[t]&&(s=t,"showing"===s&&this.tech_.ready(function(){e.tech_.on("timeupdate",d)},!0),this.trigger("modechange"))}}),object.defineproperty(l,"cues",{get:function(){return this.loaded_?u:null},set:function(){}}),object.defineproperty(l,"activecues",{get:function(){if(!this.loaded_)return null;if(0===this.cues.length)return h;for(var t=this.tech_.currenttime(),e=[],n=0,r=this.cues.length;n=t?e.push(i):i.starttime===i.endtime&&i.starttime<=t&&i.starttime+.5>=t&&e.push(i)}if(p=!1,e.length!==this.activecues_.length)p=!0;else for(var o=0;o0&&void 0!==arguments[0]?arguments[0]:{};be(this,e);var o=tt(i,{kind:gn[i.kind]||""}),s=n=ve(this,t.call(this,o)),a=!1;if(pe)for(var l in e.prototype)"constructor"!==l&&(s[l]=e.prototype[l]);return object.defineproperty(s,"enabled",{get:function(){return a},set:function(t){"boolean"==typeof t&&t!==a&&(a=t,this.trigger("enabledchange"))}}),o.enabled&&(s.enabled=o.enabled),s.loaded_=!0,r=s,ve(n,r)}return fe(e,t),e}(qn),_r=function(t){function e(){var n,r,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};be(this,e);var o=tt(i,{kind:yn[i.kind]||""}),s=n=ve(this,t.call(this,o)),a=!1;if(pe)for(var l in e.prototype)"constructor"!==l&&(s[l]=e.prototype[l]);return object.defineproperty(s,"selected",{get:function(){return a},set:function(t){"boolean"==typeof t&&t!==a&&(a=t,this.trigger("selectedchange"))}}),o.selected&&(s.selected=o.selected),r=s,ve(n,r)}return fe(e,t),e}(qn),br=0,tr=2,cr=function(t){function e(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};be(this,e);var r=ve(this,t.call(this)),i=void 0,o=r;if(pe){o=de.createelement("custom");for(var s in e.prototype)"constructor"!==s&&(o[s]=e.prototype[s])}var a=new gr(n);if(o.kind=a.kind,o.src=a.src,o.srclang=a.language,o.label=a.label,o.default=a.default,object.defineproperty(o,"readystate",{get:function(){return i}}),object.defineproperty(o,"track",{get:function(){return a}}),i=br,a.addeventlistener("loadeddata",function(){i=tr,o.trigger({type:"load",target:o})}),pe){var l;return l=o,ve(r,l)}return r}return fe(e,t),e}(fn);cr.prototype.allowedevents_={load:"load"},cr.none=br,cr.loading=1,cr.loaded=tr,cr.error=3;var kr={audio:{listclass:wn,trackclass:mr,capitalname:"audio"},video:{listclass:zn,trackclass:_r,capitalname:"video"},text:{listclass:xn,trackclass:gr,capitalname:"text"}};object.keys(kr).foreach(function(t){kr[t].gettername=t+"tracks",kr[t].privatename=t+"tracks_"});var er={remotetext:{listclass:xn,trackclass:gr,capitalname:"remotetext",gettername:"remotetexttracks",privatename:"remotetexttracks_"},remotetextel:{listclass:qn,trackclass:cr,capitalname:"remotetexttrackels",gettername:"remotetexttrackels",privatename:"remotetexttrackels_"}},wr=tt(kr,er);er.names=object.keys(er),kr.names=object.keys(kr),wr.names=[].concat(er.names).concat(kr.names);var sr=object.create||function(){function t(){}return function(e){if(1!==arguments.length)throw new error("object.create shim only accepts one parameter.");return t.prototype=e,new t}}();ct.prototype=sr(error.prototype),ct.prototype.constructor=ct,ct.errors={badsignature:{code:0,message:"malformed webvtt signature."},badtimestamp:{code:1,message:"malformed time stamp."}},et.prototype={set:function(t,e){this.get(t)||""===e||(this.values[t]=e)},get:function(t,e,n){return n?this.has(t)?this.values[t]:e[n]:this.has(t)?this.values[t]:e},has:function(t){return t in this.values},alt:function(t,e,n){for(var r=0;r=0&&e<=100)&&(this.set(t,e),!0)}};var xr={"&":"&","<":"<",">":">","‎":"‎","‏":"‏"," ":" "},jr={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"},ar={v:"title",lang:"lang"},pr={rt:"ruby"},or=[[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]];ot.prototype.applystyles=function(t,e){e=e||this.div;for(var n in t)t.hasownproperty(n)&&(e.style[n]=t[n])},ot.prototype.formatstyle=function(t,e){return 0===t?0:t+e},nt.prototype=sr(ot.prototype),nt.prototype.constructor=nt,mt.prototype.move=function(t,e){switch(e=void 0!==e?e:this.lineheight,t){case"+x":this.left+=e,this.right+=e;break;case"-x":this.left-=e,this.right-=e;break;case"+y":this.top+=e,this.bottom+=e;break;case"-y":this.top-=e,this.bottom-=e}},mt.prototype.overlaps=function(t){return this.leftt.left&&this.topt.top},mt.prototype.overlapsany=function(t){for(var e=0;e=t.top&&this.bottom<=t.bottom&&this.left>=t.left&&this.right<=t.right},mt.prototype.overlapsoppositeaxis=function(t,e){switch(e){case"+x":return this.leftt.right;case"+y":return this.topt.bottom}},mt.prototype.intersectpercentage=function(t){return math.max(0,math.min(this.right,t.right)-math.max(this.left,t.left))*math.max(0,math.min(this.bottom,t.bottom)-math.max(this.top,t.top))/(this.height*this.width)},mt.prototype.tocsscompatvalues=function(t){return{top:this.top-t.top,bottom:t.bottom-this.bottom,left:this.left-t.left,right:t.right-this.right,height:this.height,width:this.width}},mt.getsimpleboxposition=function(t){var e=t.div?t.div.offsetheight:t.tagname?t.offsetheight:0,n=t.div?t.div.offsetwidth:t.tagname?t.offsetwidth:0,r=t.div?t.div.offsettop:t.tagname?t.offsettop:0;return t=t.div?t.div.getboundingclientrect():t.tagname?t.getboundingclientrect():t,{left:t.left,right:t.right,top:t.top||r,height:t.height||e,bottom:t.bottom||r+(t.height||e),width:t.width||n}},dt.stringdecoder=function(){return{decode:function(t){if(!t)return"";if("string"!=typeof t)throw new error("error - expected string data.");return decodeuricomponent(encodeuricomponent(t))}}},dt.convertcuetodomtree=function(t,e){return t&&e?xt(t,e):null};dt.processcues=function(t,e,n){if(!t||!e||!n)return null;for(;n.firstchild;)n.removechild(n.firstchild);var r=t.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(t){for(var e=0;e0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){};be(this,e),n.reporttouchactivity=!1;var i=ve(this,t.call(this,null,n,r));return i.hasstarted_=!1,i.on("playing",function(){this.hasstarted_=!0}),i.on("loadstart",function(){this.hasstarted_=!1}),wr.names.foreach(function(t){var e=wr[t];n&&n[e.gettername]&&(i[e.privatename]=n[e.gettername])}),i.featuresprogressevents||i.manualprogresson(),i.featurestimeupdateevents||i.manualtimeupdateson(),["text","audio","video"].foreach(function(t){!1===n["native"+t+"tracks"]&&(i["featuresnative"+t+"tracks"]=!1)}),!1===n.nativecaptions||!1===n.nativetexttracks?i.featuresnativetexttracks=!1:!0!==n.nativecaptions&&!0!==n.nativetexttracks||(i.featuresnativetexttracks=!0),i.featuresnativetexttracks||i.emulatetexttracks(),i.autoremotetexttracks_=new wr.text.listclass,i.inittracklisteners(),n.nativecontrolsfortouch||i.emittapevents(),i.constructor&&(i.name_=i.constructor.name||"unknown tech"),i}return fe(e,t),e.prototype.manualprogresson=function(){this.on("durationchange",this.ondurationchange),this.manualprogress=!0,this.one("ready",this.trackprogress)},e.prototype.manualprogressoff=function(){this.manualprogress=!1,this.stoptrackingprogress(),this.off("durationchange",this.ondurationchange)},e.prototype.trackprogress=function(t){this.stoptrackingprogress(),this.progressinterval=this.setinterval(pn(this,function(){var t=this.bufferedpercent();this.bufferedpercent_!==t&&this.trigger("progress"),this.bufferedpercent_=t,1===t&&this.stoptrackingprogress()}),500)},e.prototype.ondurationchange=function(t){this.duration_=this.duration()},e.prototype.buffered=function(){return it(0,0)},e.prototype.bufferedpercent=function(){return ot(this.buffered(),this.duration_)},e.prototype.stoptrackingprogress=function(){this.clearinterval(this.progressinterval)},e.prototype.manualtimeupdateson=function(){this.manualtimeupdates=!0,this.on("play",this.trackcurrenttime),this.on("pause",this.stoptrackingcurrenttime)},e.prototype.manualtimeupdatesoff=function(){this.manualtimeupdates=!1,this.stoptrackingcurrenttime(),this.off("play",this.trackcurrenttime),this.off("pause",this.stoptrackingcurrenttime)},e.prototype.trackcurrenttime=function(){this.currenttimeinterval&&this.stoptrackingcurrenttime(),this.currenttimeinterval=this.setinterval(function(){this.trigger({type:"timeupdate",target:this,manuallytriggered:!0})},250)},e.prototype.stoptrackingcurrenttime=function(){this.clearinterval(this.currenttimeinterval),this.trigger({type:"timeupdate",target:this,manuallytriggered:!0})},e.prototype.dispose=function(){this.cleartracks(kr.names),this.manualprogress&&this.manualprogressoff(),this.manualtimeupdates&&this.manualtimeupdatesoff(),t.prototype.dispose.call(this)},e.prototype.cleartracks=function(t){var e=this;t=[].concat(t),t.foreach(function(t){for(var n=e[t+"tracks"]()||[],r=n.length;r--;){var i=n[r];"text"===t&&e.removeremotetexttrack(i),n.removetrack(i)}})},e.prototype.cleanupautotexttracks=function(){for(var t=this.autoremotetexttracks_||[],e=t.length;e--;){var n=t[e];this.removeremotetexttrack(n)}},e.prototype.reset=function(){},e.prototype.error=function(t){return void 0!==t&&(this.error_=new st(t),this.trigger("error")),this.error_},e.prototype.played=function(){return this.hasstarted_?it(0,0):it()},e.prototype.setcurrenttime=function(){this.manualtimeupdates&&this.trigger({type:"timeupdate",target:this,manuallytriggered:!0})},e.prototype.inittracklisteners=function(){var t=this;kr.names.foreach(function(e){var n=kr[e],r=function(){t.trigger(e+"trackchange")},i=t[n.gettername]();i.addeventlistener("removetrack",r),i.addeventlistener("addtrack",r),t.on("dispose",function(){i.removeeventlistener("removetrack",r),i.removeeventlistener("addtrack",r)})})},e.prototype.addwebvttscript_=function(){var t=this;if(!le.webvtt)if(de.body.contains(this.el())){if(!this.options_["vtt.js"]&&o(fr)&&object.keys(fr).length>0)return void this.trigger("vttjsloaded");var e=de.createelement("script");e.src=this.options_["vtt.js"]||"https://vjs.zencdn.net/vttjs/0.12.4/vtt.min.js",e.onload=function(){t.trigger("vttjsloaded")},e.onerror=function(){t.trigger("vttjserror")},this.on("dispose",function(){e.onload=null,e.onerror=null}),le.webvtt=!0,this.el().parentnode.appendchild(e)}else this.ready(this.addwebvttscript_)},e.prototype.emulatetexttracks=function(){var t=this,e=this.texttracks(),n=this.remotetexttracks(),r=function(t){return e.addtrack(t.track)},i=function(t){return e.removetrack(t.track)};n.on("addtrack",r),n.on("removetrack",i),this.addwebvttscript_();var o=function(){return t.trigger("texttrackchange")},s=function(){o();for(var t=0;t0&&void 0!==arguments[0]?arguments[0]:{},n=arguments[1],r=this.createremotetexttrack(e);return!0!==n&&!1!==n&&(ye.warn('calling addremotetexttrack without explicitly setting the "manualcleanup" parameter to `true` is deprecated and default to `false` in future version of video.js'),n=!0),this.remotetexttrackels().addtrackelement_(r),this.remotetexttracks().addtrack(r.track),!0!==n&&this.ready(function(){return t.autoremotetexttracks_.addtrack(r.track)}),r},e.prototype.removeremotetexttrack=function(t){var e=this.remotetexttrackels().gettrackelementbytrack_(t);this.remotetexttrackels().removetrackelement_(e),this.remotetexttracks().removetrack(t),this.autoremotetexttracks_.removetrack(t)},e.prototype.getvideoplaybackquality=function(){return{}},e.prototype.setposter=function(){},e.prototype.playsinline=function(){},e.prototype.setplaysinline=function(){},e.prototype.canplaytype=function(){return""},e.canplaytype=function(){return""},e.canplaysource=function(t,n){return e.canplaytype(t.type)},e.istech=function(t){return t.prototype instanceof e||t instanceof e||t===e},e.registertech=function(t,n){if(e.techs_||(e.techs_={}),!e.istech(n))throw new error("tech "+t+" must be a tech");if(!e.canplaytype)throw new error("techs must have a static canplaytype method on them");if(!e.canplaysource)throw new error("techs must have a static canplaysource method on them");return t=q(t),e.techs_[t]=n,"tech"!==t&&e.defaulttechorder_.push(t),n},e.gettech=function(t){if(t)return t=q(t),e.techs_&&e.techs_[t]?e.techs_[t]:le&&le.videojs&&le.videojs[t]?(ye.warn("the "+t+" tech was added to the videojs object when it should be registered using videojs.registertech(name, tech)"),le.videojs[t]):void 0},e}(en);wr.names.foreach(function(t){var e=wr[t];vr.prototype[e.gettername]=function(){return this[e.privatename]=this[e.privatename]||new e.listclass,this[e.privatename]}}),vr.prototype.featuresvolumecontrol=!0,vr.prototype.featuresfullscreenresize=!1,vr.prototype.featuresplaybackrate=!1,vr.prototype.featuresprogressevents=!1,vr.prototype.featurestimeupdateevents=!1,vr.prototype.featuresnativetexttracks=!1,vr.withsourcehandlers=function(t){t.registersourcehandler=function(e,n){var r=t.sourcehandlers;r||(r=t.sourcehandlers=[]),void 0===n&&(n=r.length),r.splice(n,0,e)},t.canplaytype=function(e){for(var n=t.sourcehandlers||[],r=void 0,i=0;i0&&void 0!==arguments[0]?arguments[0]:"div",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};n=r({innerhtml:'',classname:this.buildcssclass(),tabindex:0},n),"button"===e&&ye.error("creating a clickablecomponent with an html element of "+e+" is not supported; use a button instead."),i=r({role:"button","aria-live":"polite"},i),this.tabindex_=n.tabindex;var o=t.prototype.createel.call(this,e,n,i);return this.createcontroltextel(o),o},e.prototype.dispose=function(){this.controltextel_=null,t.prototype.dispose.call(this)},e.prototype.createcontroltextel=function(t){return this.controltextel_=v("span",{classname:"vjs-control-text"}),t&&t.appendchild(this.controltextel_),this.controltext(this.controltext_,t),this.controltextel_},e.prototype.controltext=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.el();if(void 0===t)return this.controltext_||"need text";var n=this.localize(t);this.controltext_=t,y(this.controltextel_,n),this.noniconcontrol||e.setattribute("title",n)},e.prototype.buildcssclass=function(){return"vjs-control vjs-button "+t.prototype.buildcssclass.call(this)},e.prototype.enable=function(){this.enabled_||(this.enabled_=!0,this.removeclass("vjs-disabled"),this.el_.setattribute("aria-disabled","false"),void 0!==this.tabindex_&&this.el_.setattribute("tabindex",this.tabindex_),this.on(["tap","click"],this.handleclick),this.on("focus",this.handlefocus),this.on("blur",this.handleblur))},e.prototype.disable=function(){this.enabled_=!1,this.addclass("vjs-disabled"),this.el_.setattribute("aria-disabled","true"),void 0!==this.tabindex_&&this.el_.removeattribute("tabindex"),this.off(["tap","click"],this.handleclick),this.off("focus",this.handlefocus),this.off("blur",this.handleblur)},e.prototype.handleclick=function(t){},e.prototype.handlefocus=function(t){x(de,"keydown",pn(this,this.handlekeypress))},e.prototype.handlekeypress=function(e){32===e.which||13===e.which?(e.preventdefault(),this.trigger("click")):t.prototype.handlekeypress&&t.prototype.handlekeypress.call(this,e)},e.prototype.handleblur=function(t){q(de,"keydown",pn(this,this.handlekeypress))},e}(en);en.registercomponent("clickablecomponent",qr);var kr=function(t){function e(n,r){be(this,e);var i=ve(this,t.call(this,n,r));return i.update(),n.on("posterchange",pn(i,i.update)),i}return fe(e,t),e.prototype.dispose=function(){this.player().off("posterchange",this.update),t.prototype.dispose.call(this)},e.prototype.createel=function(){var t=v("div",{classname:"vjs-poster",tabindex:-1});return de||(this.fallbackimg_=v("img"),t.appendchild(this.fallbackimg_)),t},e.prototype.update=function(t){var e=this.player().poster();this.setsrc(e),e?this.show():this.hide()},e.prototype.setsrc=function(t){if(this.fallbackimg_)this.fallbackimg_.src=t;else{var e="";t&&(e='url("'+t+'")'),this.el_.style.backgroundimage=e}},e.prototype.handleclick=function(t){this.player_.controls()&&(this.player_.paused()?this.player_.play():this.player_.pause())},e}(qr);en.registercomponent("posterimage",kr);var yr={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'},gr=function(t){function e(n,r,i){be(this,e);var o=ve(this,t.call(this,n,r,i));return n.on("loadstart",pn(o,o.toggledisplay)),n.on("texttrackchange",pn(o,o.updatedisplay)),n.on("loadstart",pn(o,o.preselecttrack)),n.ready(pn(o,function(){if(n.tech_&&n.tech_.featuresnativetexttracks)return void this.hide();n.on("fullscreenchange",pn(this,this.updatedisplay));for(var t=this.options_.playeroptions.tracks||[],e=0;e1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};t="button",e=r({innerhtml:'',classname:this.buildcssclass()},e),n=r({type:"button","aria-live":"polite"},n);var i=en.prototype.createel.call(this,t,e,n);return this.createcontroltextel(i),i},e.prototype.addchild=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.constructor.name;return ye.warn("adding an actionable (user controllable) child to a button ("+n+") is not supported; use a clickablecomponent instead."),en.prototype.addchild.call(this,t,e)},e.prototype.enable=function(){t.prototype.enable.call(this),this.el_.removeattribute("disabled")},e.prototype.disable=function(){t.prototype.disable.call(this),this.el_.setattribute("disabled","disabled")},e.prototype.handlekeypress=function(e){32!==e.which&&13!==e.which&&t.prototype.handlekeypress.call(this,e)},e}(qr);en.registercomponent("button",jr);var qr=function(t){function e(n,r){be(this,e);var i=ve(this,t.call(this,n,r));return i.mouseused_=!1,i.on("mousedown",i.handlemousedown),i}return fe(e,t),e.prototype.buildcssclass=function(){return"vjs-big-play-button"},e.prototype.handleclick=function(t){var e=this.player_.play();if(!(this.mouseused_&&t.clientx&&t.clienty)){var n=this.player_.getchild("controlbar"),r=n&&n.getchild("playtoggle");if(!r)return void this.player_.focus();var i=function(){return r.focus()};lt(e)?e.then(i,function(){}):this.settimeout(i,1)}},e.prototype.handlekeypress=function(e){this.mouseused_=!1,t.prototype.handlekeypress.call(this,e)},e.prototype.handlemousedown=function(t){this.mouseused_=!0},e}(jr);qr.prototype.controltext_="play video",en.registercomponent("bigplaybutton",qr);var zr=function(t){function e(n,r){be(this,e);var i=ve(this,t.call(this,n,r));return i.controltext(r&&r.controltext||i.localize("close")),i}return fe(e,t),e.prototype.buildcssclass=function(){return"vjs-close-button "+t.prototype.buildcssclass.call(this)},e.prototype.handleclick=function(t){this.trigger({type:"close",bubbles:!1})},e}(jr);en.registercomponent("closebutton",zr);var ti=function(t){function e(n,r){be(this,e);var i=ve(this,t.call(this,n,r));return i.on(n,"play",i.handleplay),i.on(n,"pause",i.handlepause),i.on(n,"ended",i.handleended),i}return fe(e,t),e.prototype.buildcssclass=function(){return"vjs-play-control "+t.prototype.buildcssclass.call(this)},e.prototype.handleclick=function(t){this.player_.paused()?this.player_.play():this.player_.pause()},e.prototype.handleseeked=function(t){this.removeclass("vjs-ended"),this.player_.paused()?this.handlepause(t):this.handleplay(t)},e.prototype.handleplay=function(t){this.removeclass("vjs-ended"),this.removeclass("vjs-paused"),this.addclass("vjs-playing"),this.controltext("pause")},e.prototype.handlepause=function(t){this.removeclass("vjs-playing"),this.addclass("vjs-paused"),this.controltext("play")},e.prototype.handleended=function(t){this.removeclass("vjs-playing"),this.addclass("vjs-ended"),this.controltext("replay"),this.one(this.player_,"seeked",this.handleseeked)},e}(jr);ti.prototype.controltext_="play",en.registercomponent("playtoggle",ti);var ei=function(t){function e(n,r){be(this,e);var i=ve(this,t.call(this,n,r));return i.throttledupdatecontent=dn(pn(i,i.updatecontent),25),i.on(n,"timeupdate",i.throttledupdatecontent),i}return fe(e,t),e.prototype.createel=function(e){ var n=this.buildcssclass(),r=t.prototype.createel.call(this,"div",{classname:n+" vjs-time-control vjs-control"});return this.contentel_=v("div",{classname:n+"-display"},{"aria-live":"off"},v("span",{classname:"vjs-control-text",textcontent:this.localize(this.controltext_)})),this.updatetextnode_(),r.appendchild(this.contentel_),r},e.prototype.dispose=function(){this.contentel_=null,this.textnode_=null,t.prototype.dispose.call(this)},e.prototype.updatetextnode_=function(){if(this.contentel_){for(;this.contentel_.firstchild;)this.contentel_.removechild(this.contentel_.firstchild);this.textnode_=de.createtextnode(this.formattedtime_||"0:00"),this.contentel_.appendchild(this.textnode_)}},e.prototype.formattime_=function(t){return zt(t)},e.prototype.updateformattedtime_=function(t){var e=this.formattime_(t);e!==this.formattedtime_&&(this.formattedtime_=e,this.requestanimationframe(this.updatetextnode_))},e.prototype.updatecontent=function(t){},e}(en);ei.prototype.controltext_="time",en.registercomponent("timedisplay",ei);var ni=function(t){function e(n,r){be(this,e);var i=ve(this,t.call(this,n,r));return i.on(n,"ended",i.handleended),i}return fe(e,t),e.prototype.buildcssclass=function(){return"vjs-current-time"},e.prototype.updatecontent=function(t){var e=this.player_.scrubbing()?this.player_.getcache().currenttime:this.player_.currenttime();this.updateformattedtime_(e)},e.prototype.handleended=function(t){this.player_.duration()&&this.updateformattedtime_(this.player_.duration())},e}(ei);ni.prototype.controltext_="current time",en.registercomponent("currenttimedisplay",ni);var ri=function(t){function e(n,r){be(this,e);var i=ve(this,t.call(this,n,r));return i.on(n,"durationchange",i.updatecontent),i.on(n,"loadedmetadata",i.throttledupdatecontent),i}return fe(e,t),e.prototype.buildcssclass=function(){return"vjs-duration"},e.prototype.updatecontent=function(t){var e=this.player_.duration();e&&this.duration_!==e&&(this.duration_=e,this.updateformattedtime_(e))},e}(ei);ri.prototype.controltext_="duration time",en.registercomponent("durationdisplay",ri);var ii=function(t){function e(){return be(this,e),ve(this,t.apply(this,arguments))}return fe(e,t),e.prototype.createel=function(){return t.prototype.createel.call(this,"div",{classname:"vjs-time-control vjs-time-divider",innerhtml:"
/
"})},e}(en);en.registercomponent("timedivider",ii);var oi=function(t){function e(n,r){be(this,e);var i=ve(this,t.call(this,n,r));return i.on(n,"durationchange",i.throttledupdatecontent),i.on(n,"ended",i.handleended),i}return fe(e,t),e.prototype.buildcssclass=function(){return"vjs-remaining-time"},e.prototype.formattime_=function(e){return"-"+t.prototype.formattime_.call(this,e)},e.prototype.updatecontent=function(t){this.player_.duration()&&(this.player_.remainingtimedisplay?this.updateformattedtime_(this.player_.remainingtimedisplay()):this.updateformattedtime_(this.player_.remainingtime()))},e.prototype.handleended=function(t){this.player_.duration()&&this.updateformattedtime_(0)},e}(ei);oi.prototype.controltext_="remaining time",en.registercomponent("remainingtimedisplay",oi);var si=function(t){function e(n,r){be(this,e);var i=ve(this,t.call(this,n,r));return i.updateshowing(),i.on(i.player(),"durationchange",i.updateshowing),i}return fe(e,t),e.prototype.createel=function(){var e=t.prototype.createel.call(this,"div",{classname:"vjs-live-control vjs-control"});return this.contentel_=v("div",{classname:"vjs-live-display",innerhtml:''+this.localize("stream type")+""+this.localize("live")},{"aria-live":"off"}),e.appendchild(this.contentel_),e},e.prototype.dispose=function(){this.contentel_=null,t.prototype.dispose.call(this)},e.prototype.updateshowing=function(t){this.player().duration()===1/0?this.show():this.hide()},e}(en);en.registercomponent("livedisplay",si);var ai=function(t){function e(n,r){be(this,e);var i=ve(this,t.call(this,n,r));return i.bar=i.getchild(i.options_.barname),i.vertical(!!i.options_.vertical),i.enable(),i}return fe(e,t),e.prototype.enabled=function(){return this.enabled_},e.prototype.enable=function(){this.enabled()||(this.on("mousedown",this.handlemousedown),this.on("touchstart",this.handlemousedown),this.on("focus",this.handlefocus),this.on("blur",this.handleblur),this.on("click",this.handleclick),this.on(this.player_,"controlsvisible",this.update),this.playerevent&&this.on(this.player_,this.playerevent,this.update),this.removeclass("disabled"),this.setattribute("tabindex",0),this.enabled_=!0)},e.prototype.disable=function(){if(this.enabled()){var t=this.bar.el_.ownerdocument;this.off("mousedown",this.handlemousedown),this.off("touchstart",this.handlemousedown),this.off("focus",this.handlefocus),this.off("blur",this.handleblur),this.off("click",this.handleclick),this.off(this.player_,"controlsvisible",this.update),this.off(t,"mousemove",this.handlemousemove),this.off(t,"mouseup",this.handlemouseup),this.off(t,"touchmove",this.handlemousemove),this.off(t,"touchend",this.handlemouseup),this.removeattribute("tabindex"),this.addclass("disabled"),this.playerevent&&this.off(this.player_,this.playerevent,this.update),this.enabled_=!1}},e.prototype.createel=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return n.classname=n.classname+" vjs-slider",n=r({tabindex:0},n),i=r({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100,tabindex:0},i),t.prototype.createel.call(this,e,n,i)},e.prototype.handlemousedown=function(t){var e=this.bar.el_.ownerdocument;t.preventdefault(),x(),this.addclass("vjs-sliding"),this.trigger("slideractive"),this.on(e,"mousemove",this.handlemousemove),this.on(e,"mouseup",this.handlemouseup),this.on(e,"touchmove",this.handlemousemove),this.on(e,"touchend",this.handlemouseup),this.handlemousemove(t)},e.prototype.handlemousemove=function(t){},e.prototype.handlemouseup=function(){var t=this.bar.el_.ownerdocument;j(),this.removeclass("vjs-sliding"),this.trigger("sliderinactive"),this.off(t,"mousemove",this.handlemousemove),this.off(t,"mouseup",this.handlemouseup),this.off(t,"touchmove",this.handlemousemove),this.off(t,"touchend",this.handlemouseup),this.update()},e.prototype.update=function(){if(this.el_){var t=this.getpercent(),e=this.bar;if(e){("number"!=typeof t||t!==t||t<0||t===1/0)&&(t=0);var n=(100*t).tofixed(2)+"%",r=e.el().style;return this.vertical()?r.height=n:r.width=n,t}}},e.prototype.calculatedistance=function(t){var e=o(this.el_,t);return this.vertical()?e.y:e.x},e.prototype.handlefocus=function(){this.on(this.bar.el_.ownerdocument,"keydown",this.handlekeypress)},e.prototype.handlekeypress=function(t){37===t.which||40===t.which?(t.preventdefault(),this.stepback()):38!==t.which&&39!==t.which||(t.preventdefault(),this.stepforward())},e.prototype.handleblur=function(){this.off(this.bar.el_.ownerdocument,"keydown",this.handlekeypress)},e.prototype.handleclick=function(t){t.stopimmediatepropagation(),t.preventdefault()},e.prototype.vertical=function(t){if(void 0===t)return this.vertical_||!1;this.vertical_=!!t,this.vertical_?this.addclass("vjs-slider-vertical"):this.addclass("vjs-slider-horizontal")},e}(en);en.registercomponent("slider",ai);var li=function(t){function e(n,r){be(this,e);var i=ve(this,t.call(this,n,r));return i.partels_=[],i.on(n,"progress",i.update),i}return fe(e,t),e.prototype.createel=function(){return t.prototype.createel.call(this,"div",{classname:"vjs-load-progress",innerhtml:''+this.localize("loaded")+": 0%"})},e.prototype.dispose=function(){this.partels_=null,t.prototype.dispose.call(this)},e.prototype.update=function(t){var e=this.player_.buffered(),n=this.player_.duration(),r=this.player_.bufferedend(),i=this.partels_,o=function(t,e){var n=t/e||0;return 100*(n>=1?1:n)+"%"};this.el_.style.width=o(r,n);for(var s=0;se.length;u--)this.el_.removechild(i[u-1]);i.length=e.length},e}(en);en.registercomponent("loadprogressbar",li);var ci=function(t){function e(){return be(this,e),ve(this,t.apply(this,arguments))}return fe(e,t),e.prototype.createel=function(){return t.prototype.createel.call(this,"div",{classname:"vjs-time-tooltip"})},e.prototype.update=function(t,e,n){var r=a(this.el_),i=a(this.player_.el()),o=t.width*e;if(i&&r){var s=t.left-i.left+o,a=t.width-o+(i.right-t.right),l=r.width/2;sr.width&&(l=r.width),this.el_.style.right="-"+l+"px",y(this.el_,n)}},e}(en);en.registercomponent("timetooltip",ci);var ui=function(t){function e(){return be(this,e),ve(this,t.apply(this,arguments))}return fe(e,t),e.prototype.createel=function(){return t.prototype.createel.call(this,"div",{classname:"vjs-play-progress vjs-slider-bar",innerhtml:''+this.localize("progress")+": 0%"})},e.prototype.update=function(t,e){var n=this;this.rafid_&&this.cancelanimationframe(this.rafid_),this.rafid_=this.requestanimationframe(function(){var r=n.player_.scrubbing()?n.player_.getcache().currenttime:n.player_.currenttime(),i=zt(r,n.player_.duration()),o=n.getchild("timetooltip");o&&o.update(t,e,i)})},e}(en);ui.prototype.options_={children:[]},oe&&!(oe>8)||be||ce||ui.prototype.options_.children.push("timetooltip"),en.registercomponent("playprogressbar",ui);var hi=function(t){function e(n,r){be(this,e);var i=ve(this,t.call(this,n,r));return i.update=dn(pn(i,i.update),25),i}return fe(e,t),e.prototype.createel=function(){return t.prototype.createel.call(this,"div",{classname:"vjs-mouse-display"})},e.prototype.update=function(t,e){var n=this;this.rafid_&&this.cancelanimationframe(this.rafid_),this.rafid_=this.requestanimationframe(function(){var r=n.player_.duration(),i=zt(e*r,r);n.el_.style.left=t.width*e+"px",n.getchild("timetooltip").update(t,e,i)})},e}(en);hi.prototype.options_={children:["timetooltip"]},en.registercomponent("mousetimedisplay",hi);var pi=30,di=function(t){function e(n,r){be(this,e);var i=ve(this,t.call(this,n,r));return i.update=dn(pn(i,i.update),pi),i.on(n,"timeupdate",i.update),i.on(n,"ended",i.handleended),i.updateinterval=null,i.on(n,["playing"],function(){i.clearinterval(i.updateinterval),i.updateinterval=i.setinterval(function(){i.requestanimationframe(function(){i.update()})},pi)}),i.on(n,["ended","pause","waiting"],function(){i.clearinterval(i.updateinterval)}),i.on(n,["timeupdate","ended"],i.update),i}return fe(e,t),e.prototype.createel=function(){return t.prototype.createel.call(this,"div",{classname:"vjs-progress-holder"},{"aria-label":this.localize("progress bar")})},e.prototype.update_=function(t,e){var n=this.player_.duration();this.el_.setattribute("aria-valuenow",(100*e).tofixed(2)),this.el_.setattribute("aria-valuetext",this.localize("progress bar timing: currenttime={1} duration={2}",[zt(t,n),zt(n,n)],"{1} of {2}")),this.bar.update(a(this.el_),e)},e.prototype.update=function(e){var n=t.prototype.update.call(this);return this.update_(this.getcurrenttime_(),n),n},e.prototype.getcurrenttime_=function(){return this.player_.scrubbing()?this.player_.getcache().currenttime:this.player_.currenttime()},e.prototype.handleended=function(t){this.update_(this.player_.duration(),1)},e.prototype.getpercent=function(){var t=this.getcurrenttime_()/this.player_.duration();return t>=1?1:t},e.prototype.handlemousedown=function(e){r(e)&&(this.player_.scrubbing(!0),this.videowasplaying=!this.player_.paused(),this.player_.pause(),t.prototype.handlemousedown.call(this,e))},e.prototype.handlemousemove=function(t){if(r(t)){var e=this.calculatedistance(t)*this.player_.duration();e===this.player_.duration()&&(e-=.1),this.player_.currenttime(e)}},e.prototype.enable=function(){t.prototype.enable.call(this);var e=this.getchild("mousetimedisplay");e&&e.show()},e.prototype.disable=function(){t.prototype.disable.call(this);var e=this.getchild("mousetimedisplay");e&&e.hide()},e.prototype.handlemouseup=function(e){t.prototype.handlemouseup.call(this,e),this.player_.scrubbing(!1),this.player_.trigger({type:"timeupdate",target:this,manuallytriggered:!0}),this.videowasplaying&&ct(this.player_.play())},e.prototype.stepforward=function(){this.player_.currenttime(this.player_.currenttime()+5)},e.prototype.stepback=function(){this.player_.currenttime(this.player_.currenttime()-5)},e.prototype.handleaction=function(t){this.player_.paused()?this.player_.play():this.player_.pause()},e.prototype.handlekeypress=function(e){32===e.which||13===e.which?(e.preventdefault(),this.handleaction(e)):t.prototype.handlekeypress&&t.prototype.handlekeypress.call(this,e)},e}(ai);di.prototype.options_={children:["loadprogressbar","playprogressbar"],barname:"playprogressbar"},oe&&!(oe>8)||be||ce||di.prototype.options_.children.splice(1,0,"mousetimedisplay"),di.prototype.playerevent="timeupdate",en.registercomponent("seekbar",di);var fi=function(t){function e(n,r){be(this,e);var i=ve(this,t.call(this,n,r));return i.handlemousemove=dn(pn(i,i.handlemousemove),25),i.throttledhandlemouseseek=dn(pn(i,i.handlemouseseek),25),i.enable(),i}return fe(e,t),e.prototype.createel=function(){return t.prototype.createel.call(this,"div",{classname:"vjs-progress-control vjs-control"})},e.prototype.handlemousemove=function(t){var e=this.getchild("seekbar"),n=e.getchild("mousetimedisplay"),r=e.el(),i=a(r),o=o(r,t).x;o>1?o=1:o<0&&(o=0),n&&n.update(i,o)},e.prototype.handlemouseseek=function(t){this.getchild("seekbar").handlemousemove(t)},e.prototype.enabled=function(){return this.enabled_},e.prototype.disable=function(){this.children().foreach(function(t){return t.disable&&t.disable()}),this.enabled()&&(this.off(["mousedown","touchstart"],this.handlemousedown),this.off(this.el_,"mousemove",this.handlemousemove),this.handlemouseup(),this.addclass("disabled"),this.enabled_=!1)},e.prototype.enable=function(){this.children().foreach(function(t){return t.enable&&t.enable()}),this.enabled()||(this.on(["mousedown","touchstart"],this.handlemousedown),this.on(this.el_,"mousemove",this.handlemousemove),this.removeclass("disabled"),this.enabled_=!0)},e.prototype.handlemousedown=function(t){var e=this.el_.ownerdocument;this.on(e,"mousemove",this.throttledhandlemouseseek),this.on(e,"touchmove",this.throttledhandlemouseseek),this.on(e,"mouseup",this.handlemouseup),this.on(e,"touchend",this.handlemouseup)},e.prototype.handlemouseup=function(t){var e=this.el_.ownerdocument;this.off(e,"mousemove",this.throttledhandlemouseseek),this.off(e,"touchmove",this.throttledhandlemouseseek),this.off(e,"mouseup",this.handlemouseup),this.off(e,"touchend",this.handlemouseup)},e}(en);fi.prototype.options_={children:["seekbar"]},en.registercomponent("progresscontrol",fi);var vi=function(t){function e(n,r){be(this,e);var i=ve(this,t.call(this,n,r));return i.on(n,"fullscreenchange",i.handlefullscreenchange),i}return fe(e,t),e.prototype.buildcssclass=function(){return"vjs-fullscreen-control "+t.prototype.buildcssclass.call(this)},e.prototype.handlefullscreenchange=function(t){this.player_.isfullscreen()?this.controltext("non-fullscreen"):this.controltext("fullscreen")},e.prototype.handleclick=function(t){this.player_.isfullscreen()?this.player_.exitfullscreen():this.player_.requestfullscreen()},e}(jr);vi.prototype.controltext_="fullscreen",en.registercomponent("fullscreentoggle",vi);var yi=function(t,e){e.tech_&&!e.tech_.featuresvolumecontrol&&t.addclass("vjs-hidden"),t.on(e,"loadstart",function(){e.tech_.featuresvolumecontrol?t.removeclass("vjs-hidden"):t.addclass("vjs-hidden")})},gi=function(t){function e(){return be(this,e),ve(this,t.apply(this,arguments))}return fe(e,t),e.prototype.createel=function(){return t.prototype.createel.call(this,"div",{classname:"vjs-volume-level",innerhtml:''})},e}(en);en.registercomponent("volumelevel",gi);var mi=function(t){function e(n,r){be(this,e);var i=ve(this,t.call(this,n,r));return i.on("slideractive",i.updatelastvolume_),i.on(n,"volumechange",i.updateariaattributes),n.ready(function(){return i.updateariaattributes()}),i}return fe(e,t),e.prototype.createel=function(){return t.prototype.createel.call(this,"div",{classname:"vjs-volume-bar vjs-slider-bar"},{"aria-label":this.localize("volume level"),"aria-live":"polite"})},e.prototype.handlemousedown=function(e){r(e)&&t.prototype.handlemousedown.call(this,e)},e.prototype.handlemousemove=function(t){r(t)&&(this.checkmuted(),this.player_.volume(this.calculatedistance(t)))},e.prototype.checkmuted=function(){this.player_.muted()&&this.player_.muted(!1)},e.prototype.getpercent=function(){return this.player_.muted()?0:this.player_.volume()},e.prototype.stepforward=function(){this.checkmuted(),this.player_.volume(this.player_.volume()+.1)},e.prototype.stepback=function(){this.checkmuted(),this.player_.volume(this.player_.volume()-.1)},e.prototype.updateariaattributes=function(t){var e=this.player_.muted()?0:this.volumeaspercentage_();this.el_.setattribute("aria-valuenow",e),this.el_.setattribute("aria-valuetext",e+"%")},e.prototype.volumeaspercentage_=function(){return math.round(100*this.player_.volume())},e.prototype.updatelastvolume_=function(){var t=this,e=this.player_.volume();this.one("sliderinactive",function(){0===t.player_.volume()&&t.player_.lastvolume_(e)})},e}(ai);mi.prototype.options_={children:["volumelevel"],barname:"volumelevel"},mi.prototype.playerevent="volumechange",en.registercomponent("volumebar",mi);var _i=function(t){function e(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};be(this,e),r.vertical=r.vertical||!1,(void 0===r.volumebar||o(r.volumebar))&&(r.volumebar=r.volumebar||{},r.volumebar.vertical=r.vertical);var i=ve(this,t.call(this,n,r));return yi(i,n),i.throttledhandlemousemove=dn(pn(i,i.handlemousemove),25),i.on("mousedown",i.handlemousedown),i.on("touchstart",i.handlemousedown),i.on(i.volumebar,["focus","slideractive"],function(){i.volumebar.addclass("vjs-slider-active"),i.addclass("vjs-slider-active"),i.trigger("slideractive")}),i.on(i.volumebar,["blur","sliderinactive"],function(){i.volumebar.removeclass("vjs-slider-active"),i.removeclass("vjs-slider-active"),i.trigger("sliderinactive")}),i}return fe(e,t),e.prototype.createel=function(){var e="vjs-volume-horizontal";return this.options_.vertical&&(e="vjs-volume-vertical"),t.prototype.createel.call(this,"div",{classname:"vjs-volume-control vjs-control "+e})},e.prototype.handlemousedown=function(t){var e=this.el_.ownerdocument;this.on(e,"mousemove",this.throttledhandlemousemove),this.on(e,"touchmove",this.throttledhandlemousemove),this.on(e,"mouseup",this.handlemouseup),this.on(e,"touchend",this.handlemouseup)},e.prototype.handlemouseup=function(t){var e=this.el_.ownerdocument;this.off(e,"mousemove",this.throttledhandlemousemove),this.off(e,"touchmove",this.throttledhandlemousemove),this.off(e,"mouseup",this.handlemouseup),this.off(e,"touchend",this.handlemouseup)},e.prototype.handlemousemove=function(t){this.volumebar.handlemousemove(t)},e}(en);_i.prototype.options_={children:["volumebar"]},en.registercomponent("volumecontrol",_i);var bi=function(t){function e(n,r){be(this,e);var i=ve(this,t.call(this,n,r));return yi(i,n),i.on(n,["loadstart","volumechange"],i.update),i}return fe(e,t),e.prototype.buildcssclass=function(){return"vjs-mute-control "+t.prototype.buildcssclass.call(this)},e.prototype.handleclick=function(t){var e=this.player_.volume(),n=this.player_.lastvolume_();if(0===e){var r=n<.1?.1:n;this.player_.volume(r),this.player_.muted(!1)}else this.player_.muted(!this.player_.muted())},e.prototype.update=function(t){this.updateicon_(),this.updatecontroltext_()},e.prototype.updateicon_=function(){var t=this.player_.volume(),e=3;0===t||this.player_.muted()?e=0:t<.33?e=1:t<.67&&(e=2);for(var n=0;n<4;n++)b(this.el_,"vjs-vol-"+n);_(this.el_,"vjs-vol-"+e)},e.prototype.updatecontroltext_=function(){var t=this.player_.muted()||0===this.player_.volume(),e=t?"unmute":"mute";this.controltext()!==e&&this.controltext(e)},e}(jr);bi.prototype.controltext_="mute",en.registercomponent("mutetoggle",bi);var ti=function(t){function e(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};be(this,e),void 0!==r.inline?r.inline=r.inline:r.inline=!0,(void 0===r.volumecontrol||o(r.volumecontrol))&&(r.volumecontrol=r.volumecontrol||{},r.volumecontrol.vertical=!r.inline);var i=ve(this,t.call(this,n,r));return yi(i,n),i.on(i.volumecontrol,["slideractive"],i.slideractive_),i.on(i.mutetoggle,"focus",i.slideractive_),i.on(i.volumecontrol,["sliderinactive"],i.sliderinactive_),i.on(i.mutetoggle,"blur",i.sliderinactive_),i}return fe(e,t),e.prototype.slideractive_=function(){this.addclass("vjs-slider-active")},e.prototype.sliderinactive_=function(){this.removeclass("vjs-slider-active")},e.prototype.createel=function(){var e="vjs-volume-panel-horizontal";return this.options_.inline||(e="vjs-volume-panel-vertical"),t.prototype.createel.call(this,"div",{classname:"vjs-volume-panel vjs-control "+e})},e}(en);ti.prototype.options_={children:["mutetoggle","volumecontrol"]},en.registercomponent("volumepanel",ti);var ci=function(t){function e(n,r){be(this,e);var i=ve(this,t.call(this,n,r));return r&&(i.menubutton_=r.menubutton),i.focusedchild_=-1,i.on("keydown",i.handlekeypress),i}return fe(e,t),e.prototype.additem=function(t){this.addchild(t),t.on("click",pn(this,function(e){this.menubutton_&&(this.menubutton_.unpressbutton(),"captionsettingsmenuitem"!==t.name()&&this.menubutton_.focus())}))},e.prototype.createel=function(){var e=this.options_.contenteltype||"ul";this.contentel_=v(e,{classname:"vjs-menu-content"}),this.contentel_.setattribute("role","menu");var n=t.prototype.createel.call(this,"div",{append:this.contentel_,classname:"vjs-menu"});return n.appendchild(this.contentel_),x(n,"click",function(t){t.preventdefault(),t.stopimmediatepropagation()}),n},e.prototype.dispose=function(){this.contentel_=null,t.prototype.dispose.call(this)},e.prototype.handlekeypress=function(t){37===t.which||40===t.which?(t.preventdefault(),this.stepforward()):38!==t.which&&39!==t.which||(t.preventdefault(),this.stepback())},e.prototype.stepforward=function(){var t=0;void 0!==this.focusedchild_&&(t=this.focusedchild_+1),this.focus(t)},e.prototype.stepback=function(){var t=0;void 0!==this.focusedchild_&&(t=this.focusedchild_-1),this.focus(t)},e.prototype.focus=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=this.children().slice();e.length&&e[0].classname&&/vjs-menu-title/.test(e[0].classname)&&e.shift(),e.length>0&&(t<0?t=0:t>=e.length&&(t=e.length-1),this.focusedchild_=t,e[t].el_.focus())},e}(en);en.registercomponent("menu",ci);var ki=function(t){function e(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};be(this,e);var i=ve(this,t.call(this,n,r));i.menubutton_=new jr(n,r),i.menubutton_.controltext(i.controltext_),i.menubutton_.el_.setattribute("aria-haspopup","true");var o=jr.prototype.buildcssclass();return i.menubutton_.el_.classname=i.buildcssclass()+" "+o,i.menubutton_.removeclass("vjs-control"),i.addchild(i.menubutton_),i.update(),i.enabled_=!0,i.on(i.menubutton_,"tap",i.handleclick),i.on(i.menubutton_,"click",i.handleclick),i.on(i.menubutton_,"focus",i.handlefocus),i.on(i.menubutton_,"blur",i.handleblur),i.on("keydown",i.handlesubmenukeypress),i}return fe(e,t),e.prototype.update=function(){var t=this.createmenu();this.menu&&(this.menu.dispose(),this.removechild(this.menu)),this.menu=t,this.addchild(t),this.buttonpressed_=!1,this.menubutton_.el_.setattribute("aria-expanded","false"),this.items&&this.items.length<=this.hidethreshold_?this.hide():this.show()},e.prototype.createmenu=function(){var t=new ci(this.player_,{menubutton:this});if(this.hidethreshold_=0,this.options_.title){var e=v("li",{classname:"vjs-menu-title",innerhtml:q(this.options_.title),tabindex:-1});this.hidethreshold_+=1,t.children_.unshift(e),g(e,t.contentel())}if(this.items=this.createitems(),this.items)for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:this.menubutton_.el();return this.menubutton_.controltext(t,e)},e.prototype.handleclick=function(t){this.one(this.menu.contentel(),"mouseleave",pn(this,function(t){this.unpressbutton(),this.el_.blur()})),this.buttonpressed_?this.unpressbutton():this.pressbutton()},e.prototype.focus=function(){this.menubutton_.focus()},e.prototype.blur=function(){this.menubutton_.blur()},e.prototype.handlefocus=function(){x(de,"keydown",pn(this,this.handlekeypress))},e.prototype.handleblur=function(){q(de,"keydown",pn(this,this.handlekeypress))},e.prototype.handlekeypress=function(t){27===t.which||9===t.which?(this.buttonpressed_&&this.unpressbutton(),9!==t.which&&(t.preventdefault(),this.menubutton_.el_.focus())):38!==t.which&&40!==t.which||this.buttonpressed_||(this.pressbutton(),t.preventdefault())},e.prototype.handlesubmenukeypress=function(t){27!==t.which&&9!==t.which||(this.buttonpressed_&&this.unpressbutton(),9!==t.which&&(t.preventdefault(),this.menubutton_.el_.focus()))},e.prototype.pressbutton=function(){if(this.enabled_){if(this.buttonpressed_=!0,this.menu.lockshowing(),this.menubutton_.el_.setattribute("aria-expanded","true"),be&&d())return;this.menu.focus()}},e.prototype.unpressbutton=function(){this.enabled_&&(this.buttonpressed_=!1,this.menu.unlockshowing(),this.menubutton_.el_.setattribute("aria-expanded","false"))},e.prototype.disable=function(){this.unpressbutton(),this.enabled_=!1,this.addclass("vjs-disabled"),this.menubutton_.disable()},e.prototype.enable=function(){this.enabled_=!0,this.removeclass("vjs-disabled"),this.menubutton_.enable()},e}(en);en.registercomponent("menubutton",ki);var ei=function(t){function e(n,r){be(this,e);var i=r.tracks,o=ve(this,t.call(this,n,r));if(o.items.length<=1&&o.hide(),!i)return ve(o);var s=pn(o,o.update);return i.addeventlistener("removetrack",s),i.addeventlistener("addtrack",s),o.player_.on("ready",s),o.player_.on("dispose",function(){i.removeeventlistener("removetrack",s),i.removeeventlistener("addtrack",s)}),o}return fe(e,t),e}(ki);en.registercomponent("trackbutton",ei);var wi=function(t){function e(n,r){be(this,e);var i=ve(this,t.call(this,n,r));return i.selectable=r.selectable,i.selected(r.selected),i.selectable?i.el_.setattribute("role","menuitemcheckbox"):i.el_.setattribute("role","menuitem"),i}return fe(e,t),e.prototype.createel=function(e,n,i){return this.noniconcontrol=!0,t.prototype.createel.call(this,"li",r({classname:"vjs-menu-item",innerhtml:''+this.localize(this.options_.label)+"",tabindex:-1},n),i)},e.prototype.handleclick=function(t){this.selected(!0)},e.prototype.selected=function(t){this.selectable&&(t?(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("")))},e}(qr);en.registercomponent("menuitem",wi);var si=function(t){function e(n,r){be(this,e);var i=r.track,o=n.texttracks();r.label=i.label||i.language||"unknown",r.selected="showing"===i.mode;var s=ve(this,t.call(this,n,r));s.track=i;var a=function(){for(var t=arguments.length,e=array(t),n=0;n-1?"showing"!==s.mode&&(s.mode="showing"):"disabled"!==s.mode&&(s.mode="disabled")}},e.prototype.handletrackschange=function(t){this.selected("showing"===this.track.mode)},e.prototype.handleselectedlanguagechange=function(t){if("showing"===this.track.mode){var e=this.player_.cache_.selectedlanguage;if(e&&e.enabled&&e.language===this.track.language&&e.kind!==this.track.kind)return;this.player_.cache_.selectedlanguage={enabled:!0,language:this.track.language,kind:this.track.kind}}},e.prototype.dispose=function(){this.track=null,t.prototype.dispose.call(this)},e}(wi);en.registercomponent("texttrackmenuitem",si);var xi=function(t){function e(n,r){return be(this,e),r.track={player:n,kind:r.kind,kinds:r.kinds,default:!1,mode:"disabled"},r.kinds||(r.kinds=[r.kind]),r.label?r.track.label=r.label:r.track.label=r.kinds.join(" and ")+" off",r.selectable=!0,ve(this,t.call(this,n,r))}return fe(e,t),e.prototype.handletrackschange=function(t){for(var e=this.player().texttracks(),n=!0,r=0,i=e.length;r-1&&"showing"===o.mode){n=!1;break}}this.selected(n)},e.prototype.handleselectedlanguagechange=function(t){for(var e=this.player().texttracks(),n=!0,r=0,i=e.length;r-1&&"showing"===o.mode){n=!1;break}}n&&(this.player_.cache_.selectedlanguage={enabled:!1})},e}(si);en.registercomponent("offtexttrackmenuitem",xi);var ji=function(t){function e(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return be(this,e),r.tracks=n.texttracks(),ve(this,t.call(this,n,r))}return fe(e,t),e.prototype.createitems=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:si,n=void 0;this.label_&&(n=this.label_+" off"),t.push(new xi(this.player_,{kinds:this.kinds_,kind:this.kind_,label:n})),this.hidethreshold_+=1;var r=this.player_.texttracks();array.isarray(this.kinds_)||(this.kinds_=[this.kind_]);for(var i=0;i-1){var s=new e(this.player_,{track:o,selectable:!0});s.addclass("vjs-"+o.kind+"-menu-item"),t.push(s)}}return t},e}(ei);en.registercomponent("texttrackbutton",ji);var ai=function(t){function e(n,r){be(this,e);var i=r.track,o=r.cue,s=n.currenttime();r.selectable=!0,r.label=o.text,r.selected=o.starttime<=s&&s=0;e--){var n=t[e];if(n.kind===this.kind_)return n}},e.prototype.getmenucaption=function(){return this.track_&&this.track_.label?this.track_.label:this.localize(q(this.kind_))},e.prototype.createmenu=function(){return this.options_.title=this.getmenucaption(),t.prototype.createmenu.call(this)},e.prototype.createitems=function(){var t=[];if(!this.track_)return t;var e=this.track_.cues;if(!e)return t;for(var n=0,r=e.length;n