!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){ye(t).foreach(function(r){return e(t[r],r)})}function r(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return ye(t).reduce(function(r,n){return e(r,t[n],n)},r)}function n(t){for(var r=arguments.length,n=array(r>1?r-1:0),i=1;i0&&void 0!==arguments[0]?arguments[0]:"div",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments[3],i=_e.createelement(t);return object.getownpropertynames(e).foreach(function(t){var r=e[t];-1!==t.indexof("aria-")||"role"===t||"type"===t?(tr.warn(er(rr,t,r)),i.setattribute(t,r)):"textcontent"===t?y(i,r):i[t]=r}),object.getownpropertynames(r).foreach(function(t){i.setattribute(t,r[t])}),n&&l(i,n),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,r){var n=m(t,e);if("function"==typeof r&&(r=r(t,e)),"boolean"!=typeof r&&(r=!n),r!==n)return r?_(t,e):b(t,e),t}function c(t,e){object.getownpropertynames(e).foreach(function(r){var n=e[r];null===n||void 0===n||!1===n?t.removeattribute(r):t.setattribute(r,!0===n?"":n)})}function k(t){var e={};if(t&&t.attributes&&t.attributes.length>0)for(var r=t.attributes,n=r.length-1;n>=0;n--){var i=r[n].name,o=r[n].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,r){t.setattribute(e,r)}function s(t,e){t.removeattribute(e)}function x(){_e.body.focus(),_e.onselectstart=function(){return!1}}function j(){_e.onselectstart=function(){return!0}}function a(t){if(t&&t.getboundingclientrect&&t.parentnode){var e=t.getboundingclientrect(),r={};return["bottom","height","left","right","top","width"].foreach(function(t){void 0!==e[t]&&(r[t]=e[t])}),r.height||(r.height=parsefloat(a(t,"height"))),r.width||(r.width=parsefloat(a(t,"width"))),r}}function p(t){var e=void 0;if(t.getboundingclientrect&&t.parentnode&&(e=t.getboundingclientrect()),!e)return{left:0,top:0};var r=_e.documentelement,n=_e.body,i=r.clientleft||n.clientleft||0,o=fe.pagexoffset||n.scrollleft,s=e.left+o-i,a=r.clienttop||n.clienttop||0,l=fe.pageyoffset||n.scrolltop,c=e.top+l-a;return{left:math.round(s),top:math.round(c)}}function o(t,e){var r={},n=p(t),i=t.offsetwidth,o=t.offsetheight,s=n.top,a=n.left,l=e.pagey,c=e.pagex;return e.changedtouches&&(c=e.changedtouches[0].pagex,l=e.changedtouches[0].pagey),r.y=math.max(0,math.min(1,(s-l+o)/o)),r.x=math.max(0,math.min(1,(c-a)/i)),r}function m(t){return i(t)&&3===t.nodetype}function n(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)||m(t)?t:"string"==typeof t&&/\s/.test(t)?_e.createtextnode(t):void 0}).filter(function(t){return t})}function l(t,e){return i(e).foreach(function(e){return t.appendchild(e)}),t}function d(t,e){return l(n(t),e)}function r(t){return void 0===t.button&&void 0===t.buttons||(0===t.button&&void 0===t.buttons||(9===re||0===t.button&&1===t.buttons))}function b(){return sr++}function f(t){var e=t[lr];return e||(e=t[lr]=b()),ar[e]||(ar[e]={}),ar[e]}function h(t){var e=t[lr];return!!e&&!!object.getownpropertynames(ar[e]).length}function v(t){var e=t[lr];if(e){delete ar[e];try{delete t[lr]}catch(e){t.removeattribute?t.removeattribute(lr):t[lr]=null}}}function z(t,e){var r=f(t);0===r.handlers[e].length&&(delete r.handlers[e],t.removeeventlistener?t.removeeventlistener(e,r.dispatcher,!1):t.detachevent&&t.detachevent("on"+e,r.dispatcher)),object.getownpropertynames(r.handlers).length<=0&&(delete r.handlers,delete r.dispatcher,delete r.disabled),0===object.getownpropertynames(r).length&&v(t)}function w(t,e,r,n){r.foreach(function(r){t(e,r,n)})}function u(t){function e(){return!0}function r(){return!1}if(!t||!t.ispropagationstopped){var n=t||fe.event;t={};for(var i in n)"layerx"!==i&&"layery"!==i&&"keylocation"!==i&&"webkitmovementx"!==i&&"webkitmovementy"!==i&&("returnvalue"===i&&n.preventdefault||(t[i]=n[i]));if(t.target||(t.target=t.srcelement||_e),t.relatedtarget||(t.relatedtarget=t.fromelement===t.target?t.toelement:t.fromelement),t.preventdefault=function(){n.preventdefault&&n.preventdefault(),t.returnvalue=!1,n.returnvalue=!1,t.defaultprevented=!0},t.defaultprevented=!1,t.stoppropagation=function(){n.stoppropagation&&n.stoppropagation(),t.cancelbubble=!0,n.cancelbubble=!0,t.ispropagationstopped=e},t.ispropagationstopped=r,t.stopimmediatepropagation=function(){n.stopimmediatepropagation&&n.stopimmediatepropagation(),t.isimmediatepropagationstopped=e,t.stoppropagation()},t.isimmediatepropagationstopped=r,null!==t.clientx&&void 0!==t.clientx){var o=_e.documentelement,s=_e.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,r){if(array.isarray(e))return w(x,t,e,r);var n=f(t);if(n.handlers||(n.handlers={}),n.handlers[e]||(n.handlers[e]=[]),r.guid||(r.guid=b()),n.handlers[e].push(r),n.dispatcher||(n.disabled=!1,n.dispatcher=function(e,r){if(!n.disabled){e=u(e);var i=n.handlers[e.type];if(i)for(var o=i.slice(0),s=0,a=o.length;s-1&&(i={passive:!0}),t.addeventlistener(e,n.dispatcher,i)}else t.attachevent&&t.attachevent("on"+e,n.dispatcher)}function q(t,e,r){if(h(t)){var n=f(t);if(n.handlers){if(array.isarray(e))return w(q,t,e,r);var i=function(t,e){n.handlers[e]=[],z(t,e)};if(void 0!==e){var o=n.handlers[e];if(o){if(!r)return void i(t,e);if(r.guid)for(var s=0;s1&&void 0!==arguments[1]?arguments[1]:{},r=e.eventbuskey;if(r){if(!t[r].nodename)throw new error('the eventbuskey "'+r+'" does not refer to an element.');t.eventbusel_=t[r]}else t.eventbusel_=v("span",{classname:"vjs-event-bus"});return n(t,jr),t.on("dispose",function(){t.off(),fe.settimeout(function(){t.eventbusel_=null},0)}),t}function j(t,e){return n(t,ar),t.state=n({},t.state,e),"function"==typeof t.handlestatechanged&&tr(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={},r=arguments.length,n=array(r),i=0;ir)throw new error("failed to execute '"+t+"' on 'timeranges': the index provided ("+e+") is non-numeric or out of bounds (0-"+r+").")}function rt(t,e,r,n){return et(t,n,r.length-1),r[n][e]}function nt(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:rt.bind(null,"start",0,t),end:rt.bind(null,"end",1,t)}}function it(t,e){return array.isarray(t)?nt(t):void 0===t||void 0===e?nt():nt([[t,e]])}function ot(t,e){var r=0,n=void 0,i=void 0;if(!e)return 0;t&&t.length||(t=it(0,0));for(var o=0;oe&&(i=e),r+=i-n;return r/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),n(this,t)),this.message||(this.message=st.defaultmessages[this.code]||"")}function at(t,e){var r,n=null;try{r=json.parse(t,e)}catch(t){n=t}return[n,r]}function lt(t){return void 0!==t&&null!==t&&"function"==typeof t.then}function ct(t){lt(t)&&t.then(null,function(t){})}function ut(t){var e=pn.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,r){if(!hn(e))throw new typeerror("iterator must be a function");arguments.length<3&&(r=this),"[object array]"===vn.call(t)?pt(t,e,r):"string"==typeof t?dt(t,e,r):ft(t,e,r)}function pt(t,e,r){for(var n=0,i=t.length;n0&&(u=settimeout(function(){if(!c){c=!0,a.abort("timeout");var t=new error("xmlhttprequest timeout");t.code="etimedout",n(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,r,n){return 3600*(0|t)+60*(0|e)+(0|r)+(0|n)/1e3}var r=t.match(/^(\d+):(\d{2})(:\d{2})?\.(\d{3})/);return r?r[3]?e(r[1],r[2],r[3].replace(":",""),r[4]):r[1]>59?e(r[1],r[2],0,r[4]):e(0,r[1],r[2],r[4]):null}function et(){this.values=nn(null)}function wt(t,e,r,n){var i=n?t.split(n):[t];for(var o in i)if("string"==typeof i[o]){var s=i[o].split(r);if(2===s.length){var a=s[0],l=s[1];e(a,l)}}}function st(t,e,r){function n(){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=n(),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=n(),i(),function(t,e){var n=new et;wt(t,function(t,e){switch(t){case"region":for(var i=r.length-1;i>=0;i--)if(r[i].id===e){n.set(t,r[i].region);break}break;case"vertical":n.alt(t,e,["rl","lr"]);break;case"line":var o=e.split(","),s=o[0];n.integer(t,s),n.percent(t,s)&&n.set("snaptolines",!1),n.alt(t,s,["auto"]),2===o.length&&n.alt("linealign",o[1],["start","middle","end"]);break;case"position":o=e.split(","),n.percent(t,o[0]),2===o.length&&n.alt("positionalign",o[1],["start","middle","end"]);break;case"size":n.percent(t,e);break;case"align":n.alt(t,e,["start","middle","end","left","right"])}},/:/,/\s/),e.region=n.get("region",null),e.vertical=n.get("vertical",""),e.line=n.get("line","auto"),e.linealign=n.get("linealign","start"),e.snaptolines=n.get("snaptolines",!0),e.size=n.get("size",100),e.align=n.get("align","middle"),e.position=n.get("position",{start:0,left:0,middle:50,end:100,right:100},e.align),e.positionalign=n.get("positionalign",{start:"start",left:"start",middle:"middle",end:"end",right:"end"},e.align)}(t,e)}function xt(t,e){function r(t){return in[t]}for(var n,i=t.document.createelement("div"),o=i,s=[];null!==(n=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("<"!==n[0])o.appendchild(t.document.createtextnode(function(t){for(;c=t.match(/&(amp|lt|gt|lrm|rlm|nbsp);/);)t=t.replace(c[0],r);return t}(n)));else{if("/"===n[1]){s.length&&s[s.length-1]===n.substr(2).replace(">","")&&(s.pop(),o=o.parentnode);continue}var a,l=kt(n.substr(1,n.length-2));if(l){a=t.document.createprocessinginstruction("timestamp",l),o.appendchild(a);continue}var c=n.match(/^<([^.\s\/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!c)continue;if(!(a=function(e,r){var n=ln[e];if(!n)return null;var i=t.document.createelement(n);i.localname=n;var o=dn[e];return o&&r&&(i[o]=r.trim()),i}(c[1],c[3])))continue;if(!function(t,e){return!rn[e.localname]||rn[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=r[0]&&t<=r[1])return!0}return!1}function at(t){function e(t,e){for(var r=e.childnodes.length-1;r>=0;r--)t.push(e.childnodes[r])}function r(t){if(!t||!t.length)return null;var n=t.pop(),i=n.textcontent||n.innertext;if(i){var o=i.match(/^.*(\n|\r)/);return o?(t.length=0,o[0]):i}return"ruby"===n.tagname?r(t):n.childnodes?(e(t,n),r(t)):void 0}var n,i=[],o="";if(!t||!t.childnodes)return"ltr";for(e(i,t);o=r(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,r=e.texttracklist,n=0,i=0;ih&&(u=u<0?-1:1,u*=math.ceil(h/c)*c),s<0&&(u+=""===o.vertical?r.height:r.width,a=a.reverse()),i.move(p,u)}else{var d=i.lineheight/r.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 nt(e)}var f=function(t,e){for(var i,o=new nt(t),s=1,a=0;al&&(i=new nt(t),s=l),t=new nt(o)}return i||o}(i,a);e.move(f.tocsscompatvalues(r))}function lt(){}function dt(t){return"string"==typeof t&&(!!vn[t.tolowercase()]&&t.tolowercase())}function rt(t){return"string"==typeof t&&(!!zn[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(n,"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(n,"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(n,"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}})),n.displaystate=void 0,i)return n}function ht(t){return"string"==typeof t&&(!!un[t.tolowercase()]&&t.tolowercase())}function vt(t){return"number"==typeof t&&t>=0&&t<=100}function zt(){var t=100,e=3,r=0,n=100,i=0,o=100,s="";object.defineproperties(this,{width:{enumerable:!0,get:function(){return t},set:function(e){if(!vt(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 n},set:function(t){if(!vt(t))throw new error("regionanchorx must be between 0 and 100.");n=t}},regionanchorx:{enumerable:!0,get:function(){return r},set:function(t){if(!vt(t))throw new error("regionanchory must be between 0 and 100.");r=t}},viewportanchory:{enumerable:!0,get:function(){return o},set:function(t){if(!vt(t))throw new error("viewportanchory must be between 0 and 100.");o=t}},viewportanchorx:{enumerable:!0,get:function(){return i},set:function(t){if(!vt(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=ht(t);if(!1===e)throw new syntaxerror("an invalid or illegal string was specified.");s=e}}})}function wt(t,e,r,n){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},o=t.texttracks();i.kind=e,r&&(i.label=r),n&&(i.language=n),i.tech=t;var s=new mn.text.trackclass(i);return o.addtrack(s),s}function ut(t,e){$n[t]=$n[t]||[],$n[t].push(e)}function xt(t,e,r){t.settimeout(function(){return te(e,$n[e.type],r,t)},1)}function qt(t,e){t.foreach(function(t){return t.settech&&t.settech(e)})}function kt(t,e,r){return t.reduceright(gt(r),e[r]())}function $t(t,e,r,n){return e[r](t.reduce(gt(r),n))}function yt(t,e,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,i="call"+q(r),o=t.reduce(gt(i),n),s=o===gn,a=s?null:e[r](o);return jt(t,r,a,s),a}function gt(t){return function(e,r){return e===gn?gn:r[t]?r[t](e):e}}function jt(t,e,r,n){for(var i=t.length-1;i>=0;i--){var o=t[i];o[e]&&o[e](n,r)}}function qt(t){yn[t.id()]=null}function zt(t,e){var r=yn[t.id()],n=null;if(void 0===r||null===r)return n=e(t),yn[t.id()]=[[e,n]],n;for(var i=0;i0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=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)te(t,$n[a],r,i,o,s);else if(a){var c=zt(i,a);c.setsource(n({},t),function(e,n){if(e)return te(t,l,r,i,o,s);o.push(c),te(n,t.type===n.type?l:$n[n.type],r,i,o,s)})}else l.length?te(t,l,r,i,o,s):s?r(t,o):te(t,$n["*"],r,i,o,!0)}function ee(t){var e=ei(t.src);return!t.type&&e&&(t.type=e),t}function re(t,e){return"rgba("+parseint(t[1]+t[1],16)+","+parseint(t[2]+t[2],16)+","+parseint(t[3]+t[3],16)+","+e+")"}function ne(t,e,r){try{t.style[e]=r}catch(t){return}}function ie(t){vi=t}function oe(){vi=fi}function se(t,e){if(e&&(t=e(t)),t&&"none"!==t)return t}function ae(t,e){return se(t.options[t.options.selectedindex].value,e)}function le(t,e,r){if(e)for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:!!re&&re<11,n=ge.levels[je],o=new regexp("^("+n+")$");if("log"!==t&&e.unshift(t.touppercase()+":"),qe&&qe.push([].concat(e)),e.unshift("videojs:"),fe.console){var s=fe.console[t];s||"debug"!==t||(s=fe.console.info||fe.console.log),s&&n&&o.test(t)&&(r&&(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"](fe.console,e):s(e))}};ge=function(){for(var t=arguments.length,e=array(t),r=0;r0)for(var i=0,o=t.length;i0)for(var s=0,a=e.length;s0)for(var l=0,c=r.length;l0)for(var u=0,p=n.length;u=e&&(t.apply(void 0,arguments),r=n)}},_r=function(t,e,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:fe,i=void 0;return function(){var o=this,s=arguments,a=function(){i=null,a=null,r||t.apply(o,s)};!i&&r&&t.apply(o,s),n.cleartimeout(i),i=n.settimeout(a,e)}},br=function(){};br.prototype.allowedevents_={},br.prototype.on=function(t,e){var r=this.addeventlistener;this.addeventlistener=function(){},x(this,t,e),this.addeventlistener=r},br.prototype.addeventlistener=br.prototype.on,br.prototype.off=function(t,e){q(this,t,e)},br.prototype.removeeventlistener=br.prototype.off,br.prototype.one=function(t,e){var r=this.addeventlistener;this.addeventlistener=function(){},$(this,t,e),this.addeventlistener=r},br.prototype.trigger=function(t){var e=t.type||t;"string"==typeof t&&(t={type:e}),t=u(t),this.allowedevents_[e]&&this["on"+e]&&this["on"+e](t),k(this,t)},br.prototype.dispatchevent=br.prototype.trigger;var tr=function(t){return t instanceof br||!!t.eventbusel_&&["on","one","off","trigger"].every(function(e){return"function"==typeof t[e]})},cr=function(t){return"string"==typeof t&&/\s/.test(t)||array.isarray(t)&&!!t.length},kr=function(t){if(!t.nodename&&!tr(t))throw new error("invalid target; must be a dom node or evented object.")},er=function(t){if(!cr(t))throw new error("invalid event type; must be a non-empty string or array.")},wr=function(t){if("function"!=typeof t)throw new error("invalid listener; must be a function.")},sr=function(t,e){var r=e.length<3||e[0]===t||e[0]===t.eventbusel_,n=void 0,i=void 0,o=void 0;return r?(n=t.eventbusel_,e.length>=3&&e.shift(),i=e[0],o=e[1]):(n=e[0],i=e[1],o=e[2]),kr(n),er(i),wr(o),o=gr(t,o),{istargetingself:r,target:n,type:i,listener:o}},xr=function(t,e,r,n){kr(t),t.nodename?hr[e](t,r,n):t[e](r,n)},jr={on:function(){for(var t=this,e=arguments.length,r=array(e),n=0;n=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_),v(this.el_),this.el_=null),this.player_=null},t.prototype.player=function(){return this.player_},t.prototype.options=function(t){return tr.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,r){return v(t,e,r)},t.prototype.localize=function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t,n=this.player_.language&&this.player_.language(),i=this.player_.languages&&this.player_.languages(),o=i&&i[n],s=n&&n.split("-")[0],a=i&&i[s],l=r;return o&&o[t]?l=o[t]:a&&a[t]&&(l=a[t]),e&&(l=l.replace(/\{(\d+)\}/g,function(t,r){var n=e[r-1],i=n;return void 0===n&&(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 r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=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=r.componentclass||o;r.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,r)}else i=e;if(this.children_.splice(n,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[n]||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,r=this.children_.length-1;r>=0;r--)if(this.children_[r]===t){e=!0,this.children_.splice(r,1);break}if(e){this.childindex_[t.id()]=null,this.childnameindex_[t.name()]=null;var n=t.el();n&&n.parentnode===this.contentel()&&this.contentel().removechild(t.el())}}},t.prototype.initchildren=function(){var e=this,r=this.options_.children;if(r){var n=this.options_,i=function(t){var r=t.name,i=t.opts;if(void 0!==n[r]&&(i=n[r]),!1!==i){!0===i&&(i={}),i.playeroptions=e.options_.playeroptions;var o=e.addchild(r,i);o&&(e[r]=o)}},o=void 0,s=t.getcomponent("tech");o=array.isarray(r)?r:object.keys(r),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 n=void 0,i=void 0;return"string"==typeof t?(n=t,i=r[n]||e.options_[n]||{}):(n=t.name,i=t),{name:n,opts:i}}).filter(function(e){var r=t.getcomponent(e.opts.componentclass||q(e.name));return r&&!s.istech(r)}).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 nr(t,e||this.contentel())},t.prototype.$$=function(t,e){return ir(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,r){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(r||this.trigger("componentresize"));if(!this.el_)return 0;var n=this.el_.style[t],i=n.indexof("px");return-1!==i?parseint(n.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 fe.getcomputedstyle){var r=fe.getcomputedstyle(this.el_);e=r.getpropertyvalue(t)||r[t]}if(0===(e=parsefloat(e))){var n="offset"+q(t);e=this.el_[n]}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,r=void 0;this.on("touchstart",function(n){1===n.touches.length&&(e={pagex:n.touches[0].pagex,pagey:n.touches[0].pagey},t=(new date).gettime(),r=!0)}),this.on("touchmove",function(t){if(t.touches.length>1)r=!1;else if(e){var n=t.touches[0].pagex-e.pagex,i=t.touches[0].pagey-e.pagey,o=math.sqrt(n*n+i*i);o>10&&(r=!1)}});var n=function(){r=!1};this.on("touchleave",n),this.on("touchcancel",n),this.on("touchend",function(n){if(e=null,!0===r){(new date).gettime()-t<200&&(n.preventdefault(),this.trigger("tap"))}})},t.prototype.enabletouchactivity=function(){if(this.player()&&this.player().reportuseractivity){var t=gr(this.player(),this.player().reportuseractivity),e=void 0;this.on("touchstart",function(){t(),this.clearinterval(e),e=this.setinterval(t,250)});var r=function(r){t(),this.clearinterval(e)};this.on("touchmove",t),this.on("touchend",r),this.on("touchcancel",r)}},t.prototype.settimeout=function(t,e){var r=this;t=gr(this,t);var n=fe.settimeout(t,e),i=function(){return r.cleartimeout(n)};return i.guid="vjs-timeout-"+n,this.on("dispose",i),n},t.prototype.cleartimeout=function(t){fe.cleartimeout(t);var e=function(){};return e.guid="vjs-timeout-"+t,this.off("dispose",e),t},t.prototype.setinterval=function(t,e){var r=this;t=gr(this,t);var n=fe.setinterval(t,e),i=function(){return r.clearinterval(n)};return i.guid="vjs-interval-"+n,this.on("dispose",i),n},t.prototype.clearinterval=function(t){fe.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=gr(this,t);var r=fe.requestanimationframe(t),n=function(){return e.cancelanimationframe(r)};return n.guid="vjs-raf-"+r,this.on("dispose",n),r}return this.settimeout(t,1e3/60)},t.prototype.cancelanimationframe=function(t){if(this.supportsraf_){fe.cancelanimationframe(t);var e=function(){};return e.guid="vjs-raf-"+t,this.off("dispose",e),t}return this.cleartimeout(t)},t.registercomponent=function(e,r){if("string"!=typeof e||!e)throw new error('illegal component name, "'+e+'"; must be a non-empty string.');var n=t.getcomponent("tech"),i=n&&n.istech(r),o=t===r||t.prototype.isprototypeof(r.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]=r,r},t.getcomponent=function(e){if(e)return e=q(e),t.components_&&t.components_[e]?t.components_[e]:void 0},t}();pr.prototype.supportsraf_="function"==typeof fe.requestanimationframe&&"function"==typeof fe.cancelanimationframe,pr.registercomponent("component",pr);for(var or={},mr=[["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"]],nr=mr[0],ir=void 0,lr=0;lr0&&void 0!==arguments[0]?arguments[0]:[],i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;ue(this,e);var o=qe(this,t.call(this));if(!i&&(i=o,de)){i=_e.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]:[];ue(this,e);for(var o=void 0,s=i.length-1;s>=0;s--)if(i[s].enabled){kr(i,i[s]);break}if(de){o=_e.createelement("custom");for(var a in xr.prototype)"constructor"!==a&&(o[a]=xr.prototype[a]);for(var l in e.prototype)"constructor"!==l&&(o[l]=e.prototype[l])}return o=r=qe(this,t.call(this,i,o)),o.changing_=!1,n=o,qe(r,n)}return xe(e,t),e.prototype.addtrack=function(e){var r=this;e.enabled&&kr(this,e),t.prototype.addtrack.call(this,e),e.addeventlistener&&e.addeventlistener("enabledchange",function(){r.changing_||(r.changing_=!0,kr(r,e),r.changing_=!1,r.trigger("change"))})},e}(xr),yr=function(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:[];ue(this,e);for(var o=void 0,s=i.length-1;s>=0;s--)if(i[s].selected){yr(i,i[s]);break}if(de){o=_e.createelement("custom");for(var a in xr.prototype)"constructor"!==a&&(o[a]=xr.prototype[a]);for(var l in e.prototype)"constructor"!==l&&(o[l]=e.prototype[l])}return o=r=qe(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]:[];ue(this,e);var o=void 0;if(de){o=_e.createelement("custom");for(var s in xr.prototype)"constructor"!==s&&(o[s]=xr.prototype[s]);for(var a in e.prototype)"constructor"!==a&&(o[a]=e.prototype[a])}return o=r=qe(this,t.call(this,i,o)),n=o,qe(r,n)}return xe(e,t),e.prototype.addtrack=function(e){t.prototype.addtrack.call(this,e),e.addeventlistener("modechange",gr(this,function(){this.trigger("change")})),-1===["metadata","chapters"].indexof(e.kind)&&e.addeventlistener("modechange",gr(this,function(){this.trigger("selectedlanguagechange")}))},e}(xr),qr=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];ue(this,t);var r=this;if(de){r=_e.createelement("custom");for(var n in t.prototype)"constructor"!==n&&(r[n]=t.prototype[n])}r.trackelements_=[],object.defineproperty(r,"length",{get:function(){return this.trackelements_.length}});for(var i=0,o=e.length;i0&&void 0!==arguments[0]?arguments[0]:{};ue(this,e);var i=qe(this,t.call(this)),o=i;if(de){o=_e.createelement("custom");for(var s in e.prototype)"constructor"!==s&&(o[s]=e.prototype[s])}var a={id:n.id||"vjs_track_"+b(),kind:n.kind||"",label:n.label||"",language:n.language||""};for(var l in a)!function(t){object.defineproperty(o,t,{get:function(){return a[t]},set:function(){}})}(l);return r=o,qe(i,r)}return xe(e,t),e}(br),sn=function(t){var e=["protocol","hostname","port","pathname","search","hash","host"],r=_e.createelement("a");r.href=t;var n=""===r.host&&"file:"!==r.protocol,i=void 0;n&&(i=_e.createelement("div"),i.innerhtml='',r=i.firstchild,i.setattribute("style","display:none; position:absolute;"),_e.body.appendchild(i));for(var o={},s=0;sx',t=e.firstchild.href}return t},ln=function(t){if("string"==typeof t){var e=/^(\/?)([\s\s]*?)((?:\.{1,2}|[^\/]+?)(\.([^\.\/\?]+)))(?:[\/]*|[\?].*)$/i,r=e.exec(t);if(r)return r.pop().tolowercase()}return""},cn=function(t){var e=fe.location,r=sn(t);return(":"===r.protocol?e.protocol:r.protocol)+r.host!==e.protocol+e.host},un=(object.freeze||object)({parseurl:sn,getabsoluteurl:an,getfileextension:ln,iscrossorigin:cn}),hn=ut,pn=object.prototype.tostring,dn=t(function(t,e){function r(t){return t.replace(/^\s*|\s*$/g,"")}e=t.exports=r,e.left=function(t){return t.replace(/^\s*/,"")},e.right=function(t){return t.replace(/\s*$/,"")}}),fn=ht,vn=object.prototype.tostring,yn=object.prototype.hasownproperty,gn=function(t){return"[object array]"===object.prototype.tostring.call(t)},mn=function(t){if(!t)return{};var e={};return fn(dn(t).split("\n"),function(t){var r=t.indexof(":"),n=dn(t.slice(0,r)).tolowercase(),i=dn(t.slice(r+1));void 0===e[n]?e[n]=i:gn(e[n])?e[n].push(i):e[n]=[e[n],i]}),e},_n=vt,bn=object.prototype.hasownproperty,tn=mt;mt.xmlhttprequest=fe.xmlhttprequest||tt,mt.xdomainrequest="withcredentials"in new mt.xmlhttprequest?mt.xmlhttprequest:fe.xdomainrequest,function(t,e){for(var r=0;r0&&(fe.console&&fe.console.groupcollapsed&&fe.console.groupcollapsed("text track parsing errors for "+e.src),n.foreach(function(t){return tr.error(t)}),fe.console&&fe.console.groupend&&fe.console.groupend()),r.flush()},kn=function(t,e){var r={uri:t},n=cn(t);n&&(r.cors=n),tn(r,gr(this,function(t,r,n){if(t)return tr.error(t,r);if(e.loaded_=!0,"function"!=typeof fe.webvtt){if(e.tech_){var i=function(){return cn(n,e)};e.tech_.on("vttjsloaded",i),e.tech_.on("vttjserror",function(){tr.error("vttjs failed to load, stopping trying to process "+e.src),e.tech_.off("vttjsloaded",i)})}}else cn(n,e)}))},en=function(t){function e(){var r,n,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(ue(this,e),!i.tech)throw new error("a tech was not provided.");var o=tt(i,{kind:rn[i.kind]||"subtitles",language:i.language||i.srclang||""}),s=nn[o.mode]||"disabled",a=o.default;"metadata"!==o.kind&&"chapters"!==o.kind||(s="hidden");var l=r=qe(this,t.call(this,o));if(l.tech_=o.tech,de)for(var c in e.prototype)"constructor"!==c&&(l[c]=e.prototype[c]);l.cues_=[],l.activecues_=[];var u=new zr(l.cues_),h=new zr(l.activecues_),p=!1,d=gr(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;nn[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=[],r=0,n=this.cues.length;r=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]:{};ue(this,e);var o=tt(i,{kind:en[i.kind]||""}),s=r=qe(this,t.call(this,o)),a=!1;if(de)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,n=s,qe(r,n)}return xe(e,t),e}(on),sn=function(t){function e(){var r,n,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};ue(this,e);var o=tt(i,{kind:tn[i.kind]||""}),s=r=qe(this,t.call(this,o)),a=!1;if(de)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),n=s,qe(r,n)}return xe(e,t),e}(on),xn=0,jn=2,an=function(t){function e(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};ue(this,e);var n=qe(this,t.call(this)),i=void 0,o=n;if(de){o=_e.createelement("custom");for(var s in e.prototype)"constructor"!==s&&(o[s]=e.prototype[s])}var a=new en(r);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=xn,a.addeventlistener("loadeddata",function(){i=jn,o.trigger({type:"load",target:o})}),de){var l;return l=o,qe(n,l)}return n}return xe(e,t),e}(br);an.prototype.allowedevents_={load:"load"},an.none=xn,an.loading=1,an.loaded=jn,an.error=3;var pn={audio:{listclass:$r,trackclass:wn,capitalname:"audio"},video:{listclass:gr,trackclass:sn,capitalname:"video"},text:{listclass:jr,trackclass:en,capitalname:"text"}};object.keys(pn).foreach(function(t){pn[t].gettername=t+"tracks",pn[t].privatename=t+"tracks_"});var on={remotetext:{listclass:jr,trackclass:en,capitalname:"remotetext",gettername:"remotetexttracks",privatename:"remotetexttracks_"},remotetextel:{listclass:qr,trackclass:an,capitalname:"remotetexttrackels",gettername:"remotetexttrackels",privatename:"remotetexttrackels_"}},mn=tt(pn,on);on.names=object.keys(on),pn.names=object.keys(pn),mn.names=[].concat(on.names).concat(pn.names);var nn=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=nn(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,r){return r?this.has(t)?this.values[t]:e[r]:this.has(t)?this.values[t]:e},has:function(t){return t in this.values},alt:function(t,e,r){for(var n=0;n=0&&e<=100)&&(this.set(t,e),!0)}};var in={"&":"&","<":"<",">":">","‎":"‎","‏":"‏"," ":" "},ln={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"},dn={v:"title",lang:"lang"},rn={rt:"ruby"},bn=[[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 r in t)t.hasownproperty(r)&&(e.style[r]=t[r])},ot.prototype.formatstyle=function(t,e){return 0===t?0:t+e},mt.prototype=nn(ot.prototype),mt.prototype.constructor=mt,nt.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}},nt.prototype.overlaps=function(t){return this.leftt.left&&this.topt.top},nt.prototype.overlapsany=function(t){for(var e=0;e=t.top&&this.bottom<=t.bottom&&this.left>=t.left&&this.right<=t.right},nt.prototype.overlapsoppositeaxis=function(t,e){switch(e){case"+x":return this.leftt.right;case"+y":return this.topt.bottom}},nt.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)},nt.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}},nt.getsimpleboxposition=function(t){var e=t.div?t.div.offsetheight:t.tagname?t.offsetheight:0,r=t.div?t.div.offsetwidth:t.tagname?t.offsetwidth:0,n=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||n,height:t.height||e,bottom:t.bottom||n+(t.height||e),width:t.width||r}},lt.stringdecoder=function(){return{decode:function(t){if(!t)return"";if("string"!=typeof t)throw new error("error - expected string data.");return decodeuricomponent(encodeuricomponent(t))}}},lt.convertcuetodomtree=function(t,e){return t&&e?xt(t,e):null};lt.processcues=function(t,e,r){if(!t||!e||!r)return null;for(;r.firstchild;)r.removechild(r.firstchild);var n=t.document.createelement("div");if(n.style.position="absolute",n.style.left="0",n.style.right="0",n.style.top="0",n.style.bottom="0",n.style.margin="1.5%",r.appendchild(n),function(t){for(var e=0;e0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){};ue(this,e),r.reporttouchactivity=!1;var i=qe(this,t.call(this,null,r,n));return i.hasstarted_=!1,i.on("playing",function(){this.hasstarted_=!0}),i.on("loadstart",function(){this.hasstarted_=!1}),mn.names.foreach(function(t){var e=mn[t];r&&r[e.gettername]&&(i[e.privatename]=r[e.gettername])}),i.featuresprogressevents||i.manualprogresson(),i.featurestimeupdateevents||i.manualtimeupdateson(),["text","audio","video"].foreach(function(t){!1===r["native"+t+"tracks"]&&(i["featuresnative"+t+"tracks"]=!1)}),!1===r.nativecaptions||!1===r.nativetexttracks?i.featuresnativetexttracks=!1:!0!==r.nativecaptions&&!0!==r.nativetexttracks||(i.featuresnativetexttracks=!0),i.featuresnativetexttracks||i.emulatetexttracks(),i.autoremotetexttracks_=new mn.text.listclass,i.inittracklisteners(),r.nativecontrolsfortouch||i.emittapevents(),i.constructor&&(i.name_=i.constructor.name||"unknown tech"),i}return xe(e,t),e.prototype.triggersourceset=function(t){var e=this;this.isready_||this.one("ready",function(){return e.settimeout(function(){return e.triggersourceset(t)},1)}),this.trigger({src:t,type:"sourceset"})},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(gr(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(pn.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 r=e[t+"tracks"]()||[],n=r.length;n--;){var i=r[n];"text"===t&&e.removeremotetexttrack(i),r.removetrack(i)}})},e.prototype.cleanupautotexttracks=function(){for(var t=this.autoremotetexttracks_||[],e=t.length;e--;){var r=t[e];this.removeremotetexttrack(r)}},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;pn.names.foreach(function(e){var r=pn[e],n=function(){t.trigger(e+"trackchange")},i=t[r.gettername]();i.addeventlistener("removetrack",n),i.addeventlistener("addtrack",n),t.on("dispose",function(){i.removeeventlistener("removetrack",n),i.removeeventlistener("addtrack",n)})})},e.prototype.addwebvttscript_=function(){var t=this;if(!fe.webvtt)if(_e.body.contains(this.el())){if(!this.options_["vtt.js"]&&o(qn)&&object.keys(qn).length>0)return void this.trigger("vttjsloaded");var e=_e.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}),fe.webvtt=!0,this.el().parentnode.appendchild(e)}else this.ready(this.addwebvttscript_)},e.prototype.emulatetexttracks=function(){var t=this,e=this.texttracks(),r=this.remotetexttracks(),n=function(t){return e.addtrack(t.track)},i=function(t){return e.removetrack(t.track)};r.on("addtrack",n),r.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]:{},r=arguments[1],n=this.createremotetexttrack(e);return!0!==r&&!1!==r&&(tr.warn('calling addremotetexttrack without explicitly setting the "manualcleanup" parameter to `true` is deprecated and default to `false` in future version of video.js'),r=!0),this.remotetexttrackels().addtrackelement_(n),this.remotetexttracks().addtrack(n.track),!0!==r&&this.ready(function(){return t.autoremotetexttracks_.addtrack(n.track)}),n},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,r){return e.canplaytype(t.type)},e.istech=function(t){return t.prototype instanceof e||t instanceof e||t===e},e.registertech=function(t,r){if(e.techs_||(e.techs_={}),!e.istech(r))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]=r,"tech"!==t&&e.defaulttechorder_.push(t),r},e.gettech=function(t){if(t)return t=q(t),e.techs_&&e.techs_[t]?e.techs_[t]:fe&&fe.videojs&&fe.videojs[t]?(tr.warn("the "+t+" tech was added to the videojs object when it should be registered using videojs.registertech(name, tech)"),fe.videojs[t]):void 0},e}(pr);mn.names.foreach(function(t){var e=mn[t];kn.prototype[e.gettername]=function(){return this[e.privatename]=this[e.privatename]||new e.listclass,this[e.privatename]}}),kn.prototype.featuresvolumecontrol=!0,kn.prototype.featuresfullscreenresize=!1,kn.prototype.featuresplaybackrate=!1,kn.prototype.featuresprogressevents=!1,kn.prototype.featuressourceset=!1,kn.prototype.featurestimeupdateevents=!1,kn.prototype.featuresnativetexttracks=!1,kn.withsourcehandlers=function(t){t.registersourcehandler=function(e,r){var n=t.sourcehandlers;n||(n=t.sourcehandlers=[]),void 0===r&&(r=n.length),n.splice(r,0,e)},t.canplaytype=function(e){for(var r=t.sourcehandlers||[],n=void 0,i=0;i0&&void 0!==arguments[0]?arguments[0]:"",e=ln(t);return ti[e.tolowercase()]||""},ri=function(t,e){if(!e)return"";if(t.cache_.source.src===e&&t.cache_.source.type)return t.cache_.source.type;var r=t.cache_.sources.filter(function(t){return t.src===e});if(r.length)return r[0].type;for(var n=t.$$("source"),i=0;i0&&void 0!==arguments[0]?arguments[0]:"div",r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};r=n({innerhtml:'',classname:this.buildcssclass(),tabindex:0},r),"button"===e&&tr.error("creating a clickablecomponent with an html element of "+e+" is not supported; use a button instead."),i=n({role:"button"},i),this.tabindex_=r.tabindex;var o=t.prototype.createel.call(this,e,r,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"},{"aria-live":"polite"}),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 r=this.localize(t);this.controltext_=t,y(this.controltextel_,r),this.noniconcontrol||e.setattribute("title",r)},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(_e,"keydown",gr(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(_e,"keydown",gr(this,this.handlekeypress))},e}(pr);pr.registercomponent("clickablecomponent",oi);var si=function(t){function e(r,n){ue(this,e);var i=qe(this,t.call(this,r,n));return i.update(),r.on("posterchange",gr(i,i.update)),i}return xe(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 ve||(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()?ct(this.player_.play()):this.player_.pause())},e}(oi);pr.registercomponent("posterimage",si);var ai={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'},li=function(t){function e(r,n,i){ue(this,e);var o=qe(this,t.call(this,r,n,i));return r.on("loadstart",gr(o,o.toggledisplay)),r.on("texttrackchange",gr(o,o.updatedisplay)),r.on("loadstart",gr(o,o.preselecttrack)),r.ready(gr(o,function(){if(r.tech_&&r.tech_.featuresnativetexttracks)return void this.hide();r.on("fullscreenchange",gr(this,this.updatedisplay));for(var t=this.options_.playeroptions.tracks||[],e=0;e1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};t="button",e=n({innerhtml:'',classname:this.buildcssclass()},e),r=n({type:"button"},r);var i=pr.prototype.createel.call(this,t,e,r);return this.createcontroltextel(i),i},e.prototype.addchild=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.constructor.name;return tr.warn("adding an actionable (user controllable) child to a button ("+r+") is not supported; use a clickablecomponent instead."),pr.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}(oi);pr.registercomponent("button",ui);var hi=function(t){function e(r,n){ue(this,e);var i=qe(this,t.call(this,r,n));return i.mouseused_=!1,i.on("mousedown",i.handlemousedown),i}return xe(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)return void ct(e);var r=this.player_.getchild("controlbar"),n=r&&r.getchild("playtoggle");if(!n)return void this.player_.focus();var i=function(){return n.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}(ui);hi.prototype.controltext_="play video",pr.registercomponent("bigplaybutton",hi);var pi=function(t){function e(r,n){ue(this,e);var i=qe(this,t.call(this,r,n)) ;return i.controltext(n&&n.controltext||i.localize("close")),i}return xe(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}(ui);pr.registercomponent("closebutton",pi);var di=function(t){function e(r,n){ue(this,e);var i=qe(this,t.call(this,r,n));return i.on(r,"play",i.handleplay),i.on(r,"pause",i.handlepause),i.on(r,"ended",i.handleended),i}return xe(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}(ui);di.prototype.controltext_="play",pr.registercomponent("playtoggle",di);var fi=function(t,e){t=t<0?0:t;var r=math.floor(t%60),n=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=n=r="-"),i=i>0||s>0?i+":":"",n=((i||o>=10)&&n<10?"0"+n:n)+":",r=r<10?"0"+r:r,i+n+r},vi=fi,yi=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t;return vi(t,e)},gi=function(t){function e(r,n){ue(this,e);var i=qe(this,t.call(this,r,n));return i.throttledupdatecontent=mr(gr(i,i.updatecontent),25),i.on(r,"timeupdate",i.throttledupdatecontent),i}return xe(e,t),e.prototype.createel=function(e){var r=this.buildcssclass(),n=t.prototype.createel.call(this,"div",{classname:r+" vjs-time-control vjs-control",innerhtml:''+this.localize(this.labeltext_)+" "});return this.contentel_=v("span",{classname:r+"-display"},{"aria-live":"off"}),this.updatetextnode_(),n.appendchild(this.contentel_),n},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_=_e.createtextnode(this.formattedtime_||this.formattime_(0)),this.contentel_.appendchild(this.textnode_)}},e.prototype.formattime_=function(t){return yi(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}(pr);gi.prototype.labeltext_="time",gi.prototype.controltext_="time",pr.registercomponent("timedisplay",gi);var mi=function(t){function e(r,n){ue(this,e);var i=qe(this,t.call(this,r,n));return i.on(r,"ended",i.handleended),i}return xe(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}(gi);mi.prototype.labeltext_="current time",mi.prototype.controltext_="current time",pr.registercomponent("currenttimedisplay",mi);var _i=function(t){function e(r,n){ue(this,e);var i=qe(this,t.call(this,r,n));return i.on(r,"durationchange",i.updatecontent),i.on(r,"loadedmetadata",i.throttledupdatecontent),i}return xe(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}(gi);_i.prototype.labeltext_="duration",_i.prototype.controltext_="duration",pr.registercomponent("durationdisplay",_i);var bi=function(t){function e(){return ue(this,e),qe(this,t.apply(this,arguments))}return xe(e,t),e.prototype.createel=function(){return t.prototype.createel.call(this,"div",{classname:"vjs-time-control vjs-time-divider",innerhtml:"
/
"})},e}(pr);pr.registercomponent("timedivider",bi);var ti=function(t){function e(r,n){ue(this,e);var i=qe(this,t.call(this,r,n));return i.on(r,"durationchange",i.throttledupdatecontent),i.on(r,"ended",i.handleended),i}return xe(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}(gi);ti.prototype.labeltext_="remaining time",ti.prototype.controltext_="remaining time",pr.registercomponent("remainingtimedisplay",ti);var ci=function(t){function e(r,n){ue(this,e);var i=qe(this,t.call(this,r,n));return i.updateshowing(),i.on(i.player(),"durationchange",i.updateshowing),i}return xe(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}(pr);pr.registercomponent("livedisplay",ci);var ki=function(t){function e(r,n){ue(this,e);var i=qe(this,t.call(this,r,n));return i.bar=i.getchild(i.options_.barname),i.vertical(!!i.options_.vertical),i.enable(),i}return xe(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 r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return r.classname=r.classname+" vjs-slider",r=n({tabindex:0},r),i=n({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100,tabindex:0},i),t.prototype.createel.call(this,e,r,i)},e.prototype.handlemousedown=function(t){var e=this.bar.el_.ownerdocument;"mousedown"===t.type&&t.preventdefault(),"touchstart"!==t.type||ie||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 r=(100*t).tofixed(2)+"%",n=e.el().style;return this.vertical()?n.height=r:n.width=r,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}(pr);pr.registercomponent("slider",ki);var ei=function(t){function e(r,n){ue(this,e);var i=qe(this,t.call(this,r,n));return i.partels_=[],i.on(r,"progress",i.update),i}return xe(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(),r=this.player_.duration(),n=this.player_.bufferedend(),i=this.partels_,o=function(t,e){var r=t/e||0;return 100*(r>=1?1:r)+"%"};this.el_.style.width=o(n,r);for(var s=0;se.length;u--)this.el_.removechild(i[u-1]);i.length=e.length},e}(pr);pr.registercomponent("loadprogressbar",ei);var wi=function(t){function e(){return ue(this,e),qe(this,t.apply(this,arguments))}return xe(e,t),e.prototype.createel=function(){return t.prototype.createel.call(this,"div",{classname:"vjs-time-tooltip"})},e.prototype.update=function(t,e,r){var n=a(this.el_),i=a(this.player_.el()),o=t.width*e;if(i&&n){var s=t.left-i.left+o,a=t.width-o+(i.right-t.right),l=n.width/2;sn.width&&(l=n.width),this.el_.style.right="-"+l+"px",y(this.el_,r)}},e}(pr);pr.registercomponent("timetooltip",wi);var si=function(t){function e(){return ue(this,e),qe(this,t.apply(this,arguments))}return xe(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 r=this;this.rafid_&&this.cancelanimationframe(this.rafid_),this.rafid_=this.requestanimationframe(function(){var n=r.player_.scrubbing()?r.player_.getcache().currenttime:r.player_.currenttime(),i=yi(n,r.player_.duration()),o=r.getchild("timetooltip");o&&o.update(t,e,i)})},e}(pr);si.prototype.options_={children:[]},re&&!(re>8)||se||je||si.prototype.options_.children.push("timetooltip"),pr.registercomponent("playprogressbar",si);var xi=function(t){function e(r,n){ue(this,e);var i=qe(this,t.call(this,r,n));return i.update=mr(gr(i,i.update),25),i}return xe(e,t),e.prototype.createel=function(){return t.prototype.createel.call(this,"div",{classname:"vjs-mouse-display"})},e.prototype.update=function(t,e){var r=this;this.rafid_&&this.cancelanimationframe(this.rafid_),this.rafid_=this.requestanimationframe(function(){var n=r.player_.duration(),i=yi(e*n,n);r.el_.style.left=t.width*e+"px",r.getchild("timetooltip").update(t,e,i)})},e}(pr);xi.prototype.options_={children:["timetooltip"]},pr.registercomponent("mousetimedisplay",xi);var ji=function(t){function e(r,n){ue(this,e);var i=qe(this,t.call(this,r,n));return i.seteventhandlers_(),i}return xe(e,t),e.prototype.seteventhandlers_=function(){var t=this;this.update=mr(gr(this,this.update),30),this.on(this.player_,"timeupdate",this.update),this.on(this.player_,"ended",this.handleended),this.updateinterval=null,this.on(this.player_,["playing"],function(){t.clearinterval(t.updateinterval),t.updateinterval=t.setinterval(function(){t.requestanimationframe(function(){t.update()})},30)}),this.on(this.player_,["ended","pause","waiting"],function(){t.clearinterval(t.updateinterval)}),this.on(this.player_,["timeupdate","ended"],this.update)},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 r=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}",[yi(t,r),yi(r,r)],"{1} of {2}")),this.bar.update(a(this.el_),e)},e.prototype.update=function(e){var r=t.prototype.update.call(this);return this.update_(this.getcurrenttime_(),r),r},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)&&(e.stoppropagation(),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),e&&e.stoppropagation(),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}(ki);ji.prototype.options_={children:["loadprogressbar","playprogressbar"],barname:"playprogressbar"},re&&!(re>8)||se||je||ji.prototype.options_.children.splice(1,0,"mousetimedisplay"),ji.prototype.playerevent="timeupdate",pr.registercomponent("seekbar",ji);var ai=function(t){function e(r,n){ue(this,e);var i=qe(this,t.call(this,r,n));return i.handlemousemove=mr(gr(i,i.handlemousemove),25),i.throttledhandlemouseseek=mr(gr(i,i.handlemouseseek),25),i.enable(),i}return xe(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");if(e){var r=e.getchild("mousetimedisplay"),n=e.el(),i=a(n),o=o(n,t).x;o>1?o=1:o<0&&(o=0),r&&r.update(i,o)}},e.prototype.handlemouseseek=function(t){var e=this.getchild("seekbar");e&&e.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,r=this.getchild("seekbar");r&&r.handlemousedown(t),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,r=this.getchild("seekbar");r&&r.handlemouseup(t),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}(pr);ai.prototype.options_={children:["seekbar"]},pr.registercomponent("progresscontrol",ai);var pi=function(t){function e(r,n){ue(this,e);var i=qe(this,t.call(this,r,n));return i.on(r,"fullscreenchange",i.handlefullscreenchange),i}return xe(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}(ui);pi.prototype.controltext_="fullscreen",pr.registercomponent("fullscreentoggle",pi);var oi=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")})},mi=function(t){function e(){return ue(this,e),qe(this,t.apply(this,arguments))}return xe(e,t),e.prototype.createel=function(){return t.prototype.createel.call(this,"div",{classname:"vjs-volume-level",innerhtml:''})},e}(pr);pr.registercomponent("volumelevel",mi);var ni=function(t){function e(r,n){ue(this,e);var i=qe(this,t.call(this,r,n));return i.on("slideractive",i.updatelastvolume_),i.on(r,"volumechange",i.updateariaattributes),r.ready(function(){return i.updateariaattributes()}),i}return xe(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}(ki);ni.prototype.options_={children:["volumelevel"],barname:"volumelevel"},ni.prototype.playerevent="volumechange",pr.registercomponent("volumebar",ni);var ii=function(t){function e(r){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};ue(this,e),n.vertical=n.vertical||!1,(void 0===n.volumebar||o(n.volumebar))&&(n.volumebar=n.volumebar||{},n.volumebar.vertical=n.vertical);var i=qe(this,t.call(this,r,n));return oi(i,r),i.throttledhandlemousemove=mr(gr(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 xe(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}(pr);ii.prototype.options_={children:["volumebar"]},pr.registercomponent("volumecontrol",ii);var li=function(t){function e(r,n){ue(this,e);var i=qe(this,t.call(this,r,n));return oi(i,r),i.on(r,["loadstart","volumechange"],i.update),i}return xe(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(),r=this.player_.lastvolume_();if(0===e){var n=r<.1?.1:r;this.player_.volume(n),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 r=0;r<4;r++)b(this.el_,"vjs-vol-"+r);_(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}(ui);li.prototype.controltext_="mute",pr.registercomponent("mutetoggle",li);var di=function(t){function e(r){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};ue(this,e),void 0!==n.inline?n.inline=n.inline:n.inline=!0,(void 0===n.volumecontrol||o(n.volumecontrol))&&(n.volumecontrol=n.volumecontrol||{},n.volumecontrol.vertical=!n.inline);var i=qe(this,t.call(this,r,n));return oi(i,r),i.on(i.volumecontrol,["slideractive"],i.slideractive_),i.on(i.volumecontrol,["sliderinactive"],i.sliderinactive_),i}return xe(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}(pr);di.prototype.options_={children:["mutetoggle","volumecontrol"]},pr.registercomponent("volumepanel",di);var ri=function(t){function e(r,n){ue(this,e);var i=qe(this,t.call(this,r,n));return n&&(i.menubutton_=n.menubutton),i.focusedchild_=-1,i.on("keydown",i.handlekeypress),i}return xe(e,t),e.prototype.additem=function(t){this.addchild(t),t.on("click",gr(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 r=t.prototype.createel.call(this,"div",{append:this.contentel_,classname:"vjs-menu"});return r.appendchild(this.contentel_),x(r,"click",function(t){t.preventdefault(),t.stopimmediatepropagation()}),r},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}(pr);pr.registercomponent("menu",ri);var bi=function(t){function e(r){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};ue(this,e);var i=qe(this,t.call(this,r,n));i.menubutton_=new ui(r,n),i.menubutton_.controltext(i.controltext_),i.menubutton_.el_.setattribute("aria-haspopup","true");var o=ui.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 xe(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 ri(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 r=0;r1&&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",gr(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(_e,"keydown",gr(this,this.handlekeypress))},e.prototype.handleblur=function(){q(_e,"keydown",gr(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"),se&&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}(pr);pr.registercomponent("menubutton",bi);var fi=function(t){function e(r,n){ue(this,e);var i=n.tracks,o=qe(this,t.call(this,r,n));if(o.items.length<=1&&o.hide(),!i)return qe(o);var s=gr(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 xe(e,t),e}(bi);pr.registercomponent("trackbutton",fi);var hi=function(t){function e(r,n){ue(this,e);var i=qe(this,t.call(this,r,n));return i.selectable=n.selectable,i.isselected_=n.selected||!1,i.multiselectable=n.multiselectable,i.selected(i.isselected_),i.selectable?i.multiselectable?i.el_.setattribute("role","menuitemcheckbox"):i.el_.setattribute("role","menuitemradio"):i.el_.setattribute("role","menuitem"),i}return xe(e,t),e.prototype.createel=function(e,r,i){return this.noniconcontrol=!0,t.prototype.createel.call(this,"li",n({classname:"vjs-menu-item",innerhtml:''+this.localize(this.options_.label)+"",tabindex:-1},r),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.isselected_=!0):(this.removeclass("vjs-selected"),this.el_.setattribute("aria-checked","false"),this.controltext(""),this.isselected_=!1))},e}(oi);pr.registercomponent("menuitem",hi);var vi=function(t){function e(r,n){ue(this,e);var i=n.track,o=r.texttracks();n.label=i.label||i.language||"unknown",n.selected="showing"===i.mode;var s=qe(this,t.call(this,r,n));s.track=i;var a=function(){for(var t=arguments.length,e=array(t),r=0;r-1?"showing"!==s.mode&&(s.mode="showing"):"disabled"!==s.mode&&(s.mode="disabled")}},e.prototype.handletrackschange=function(t){var e="showing"===this.track.mode;e!==this.isselected_&&this.selected(e)},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}(hi);pr.registercomponent("texttrackmenuitem",vi);var zi=function(t){function e(r,n){return ue(this,e),n.track={player:r,kind:n.kind,kinds:n.kinds,default:!1,mode:"disabled"},n.kinds||(n.kinds=[n.kind]),n.label?n.track.label=n.label:n.track.label=n.kinds.join(" and ")+" off",n.selectable=!0,n.multiselectable=!1,qe(this,t.call(this,r,n))}return xe(e,t),e.prototype.handletrackschange=function(t){for(var e=this.player().texttracks(),r=!0,n=0,i=e.length;n-1&&"showing"===o.mode){r=!1;break}}r!==this.isselected_&&this.selected(r)},e.prototype.handleselectedlanguagechange=function(t){for(var e=this.player().texttracks(),r=!0,n=0,i=e.length;n-1&&"showing"===o.mode){r=!1;break}}r&&(this.player_.cache_.selectedlanguage={enabled:!1})},e}(vi);pr.registercomponent("offtexttrackmenuitem",zi);var wi=function(t){function e(r){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return ue(this,e),n.tracks=r.texttracks(),qe(this,t.call(this,r,n))}return xe(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]:vi,r=void 0;this.label_&&(r=this.label_+" off"),t.push(new zi(this.player_,{kinds:this.kinds_,kind:this.kind_,label:r})),this.hidethreshold_+=1;var n=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,multiselectable:!1});s.addclass("vjs-"+o.kind+"-menu-item"),t.push(s)}}return t},e}(fi);pr.registercomponent("texttrackbutton",wi);var ui=function(t){function e(r,n){ue(this,e);var i=n.track,o=n.cue,s=r.currenttime();n.selectable=!0,n.multiselectable=!1,n.label=o.text,n.selected=o.starttime<=s&&s=0;e--){var r=t[e];if(r.kind===this.kind_)return r}},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 r=0,n=e.length;r