/** * @license * Video.js 7.6.5 * Copyright Brightcove, Inc. * Available under Apache License Version 2.0 * * * Includes vtt.js * Available under Apache License Version 2.0 * */(function(k,U){typeof exports=="object"&&typeof module!="undefined"?module.exports=U(require("global/window"),require("global/document")):typeof define=="function"&&define.amd?define(["global/window","global/document"],U):(k=k||self).videojs=U(k.window,k.document)})(this,function(k,U){k=k&&k.hasOwnProperty("default")?k.default:k,U=U&&U.hasOwnProperty("default")?U.default:U;var as="7.6.5",zt=[],vc=function(t,i){return function(n,e,r){var a=i.levels[e],s=new RegExp("^("+a+")$");if(n!=="log"&&r.unshift(n.toUpperCase()+":"),r.unshift(t+":"),zt&&zt.push([].concat(r)),k.console){var o=k.console[n];o||n!=="debug"||(o=k.console.info||k.console.log),o&&a&&s.test(n)&&o[Array.isArray(r)?"apply":"call"](k.console,r)}}},Z=function t(i){function n(){for(var a=arguments.length,s=new Array(a),o=0;o',n=e.firstChild,e.setAttribute("style","display:none; position:absolute;"),U.body.appendChild(e));for(var a={},s=0;sx',t=i.firstChild.href}return t}function kr(t){if(typeof t=="string"){var i=/^(\/?)([\s\S]*?)((?:\.{1,2}|[^\/]+?)(\.([^\.\/\?]+)))(?:[\/]*|[\?].*)$/.exec(t);if(i)return i.pop().toLowerCase()}return""}function un(t){var i=k.location,n=Sr(t);return(n.protocol===":"?i.protocol:n.protocol)+n.host!==i.protocol+i.host}var Dc=function(t){function i(e){var r;e===void 0&&(e=[]);for(var a=e.length-1;0<=a;a--)if(e[a].enabled){br(e,e[a]);break}return(r=t.call(this,e)||this).changing_=!1,r}j(i,t);var n=i.prototype;return n.addTrack=function(e){var r=this;e.enabled&&br(this,e),t.prototype.addTrack.call(this,e),e.addEventListener&&(e.enabledChange_=function(){r.changing_||(r.changing_=!0,br(r,e),r.changing_=!1,r.trigger("change"))},e.addEventListener("enabledchange",e.enabledChange_))},n.removeTrack=function(e){t.prototype.removeTrack.call(this,e),e.removeEventListener&&e.enabledChange_&&(e.removeEventListener("enabledchange",e.enabledChange_),e.enabledChange_=null)},i}(Qe),Uc=function(t){function i(e){var r;e===void 0&&(e=[]);for(var a=e.length-1;0<=a;a--)if(e[a].selected){Tr(e,e[a]);break}return(r=t.call(this,e)||this).changing_=!1,Object.defineProperty(K(r),"selectedIndex",{get:function(){for(var s=0;s>0},ToUint32:function(t){return this.ToNumber(t)>>>0},ToUint16:function(t){var i=this.ToNumber(t);return pn(i)||i===0||!ho(i)?0:function(n,e){var r=n%e;return Math.floor(0<=r?r:r+e)}(ao(i)*Math.floor(Math.abs(i)),65536)},ToString:function(t){return ch(t)},ToObject:function(t){return this.CheckObjectCoercible(t),lh(t)},CheckObjectCoercible:function(t,i){if(t==null)throw new Je(i||"Cannot call method on "+t);return t},IsCallable:Pr,SameValue:function(t,i){return t===i?t!==0||1/t==1/i:pn(t)&&pn(i)},Type:function(t){return t===null?"Null":typeof t=="undefined"?"Undefined":typeof t=="function"||typeof t=="object"?"Object":typeof t=="number"?"Number":typeof t=="boolean"?"Boolean":typeof t=="string"?"String":void 0},IsPropertyDescriptor:function(t){if(this.Type(t)!=="Object")return!1;var i={"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0};for(var n in t)if(dt(t,n)&&!i[n])return!1;var e=dt(t,"[[Value]]"),r=dt(t,"[[Get]]")||dt(t,"[[Set]]");if(e&&r)throw new Je("Property Descriptors may not be both accessor and data descriptors");return!0},IsAccessorDescriptor:function(t){return typeof t!="undefined"&&(dn(this,"Property Descriptor","Desc",t),!(!dt(t,"[[Get]]")&&!dt(t,"[[Set]]")))},IsDataDescriptor:function(t){return typeof t!="undefined"&&(dn(this,"Property Descriptor","Desc",t),!(!dt(t,"[[Value]]")&&!dt(t,"[[Writable]]")))},IsGenericDescriptor:function(t){return typeof t!="undefined"&&(dn(this,"Property Descriptor","Desc",t),!this.IsAccessorDescriptor(t)&&!this.IsDataDescriptor(t))},FromPropertyDescriptor:function(t){if(typeof t=="undefined")return t;if(dn(this,"Property Descriptor","Desc",t),this.IsDataDescriptor(t))return{value:t["[[Value]]"],writable:!!t["[[Writable]]"],enumerable:!!t["[[Enumerable]]"],configurable:!!t["[[Configurable]]"]};if(this.IsAccessorDescriptor(t))return{get:t["[[Get]]"],set:t["[[Set]]"],enumerable:!!t["[[Enumerable]]"],configurable:!!t["[[Configurable]]"]};throw new Je("FromPropertyDescriptor must be called with a fully populated Property Descriptor")},ToPropertyDescriptor:function(t){if(this.Type(t)!=="Object")throw new Je("ToPropertyDescriptor requires an object");var i={};if(dt(t,"enumerable")&&(i["[[Enumerable]]"]=this.ToBoolean(t.enumerable)),dt(t,"configurable")&&(i["[[Configurable]]"]=this.ToBoolean(t.configurable)),dt(t,"value")&&(i["[[Value]]"]=t.value),dt(t,"writable")&&(i["[[Writable]]"]=this.ToBoolean(t.writable)),dt(t,"get")){var n=t.get;if(typeof n!="undefined"&&!this.IsCallable(n))throw new TypeError("getter must be a function");i["[[Get]]"]=n}if(dt(t,"set")){var e=t.set;if(typeof e!="undefined"&&!this.IsCallable(e))throw new Je("setter must be a function");i["[[Set]]"]=e}if((dt(i,"[[Get]]")||dt(i,"[[Set]]"))&&(dt(i,"[[Value]]")||dt(i,"[[Writable]]")))throw new Je("Invalid property descriptor. Cannot both specify accessors and a value or writable attribute");return i}},go=wr.call(Function.call,String.prototype.replace),hh=/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/,dh=/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/,yo=wr.call(Function.call,Ir());lo(yo,{getPolyfill:Ir,implementation:uo,shim:function(){var t=Ir();return lo(String.prototype,{trim:t},{trim:function(){return String.prototype.trim!==t}}),t}});var xr=yo,ph=Object.prototype.toString,vo=Object.prototype.hasOwnProperty,fh=function(t,i,n){if(!Pr(i))throw new TypeError("iterator must be a function");var e;3<=arguments.length&&(e=n),ph.call(t)==="[object Array]"?function(r,a,s){for(var o=0,u=r.length;o=f||E.startTime===E.endTime&&E.startTime<=f&&E.startTime+.5>=f)&&y.push(E)}if(d=!1,y.length!==this.activeCues_.length)d=!0;else for(var S=0;S")throw new te(te.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '-->'): "+s);t=t.substr(3),u(),i.endTime=o(),u(),e=t,r=i,a=new xi,Di(e,function(c,d){switch(c){case"region":for(var h=n.length-1;0<=h;h--)if(n[h].id===d){a.set(c,n[h].region);break}break;case"vertical":a.alt(c,d,["rl","lr"]);break;case"line":var f=d.split(","),y=f[0];a.integer(c,y),a.percent(c,y)&&a.set("snapToLines",!1),a.alt(c,y,["auto"]),f.length===2&&a.alt("lineAlign",f[1],["start","middle","end"]);break;case"position":f=d.split(","),a.percent(c,f[0]),f.length===2&&a.alt("positionAlign",f[1],["start","middle","end"]);break;case"size":a.percent(c,d);break;case"align":a.alt(c,d,["start","middle","end","left","right"])}},/:/,/\s/),r.region=a.get("region",null),r.vertical=a.get("vertical",""),r.line=a.get("line","auto"),r.lineAlign=a.get("lineAlign","start"),r.snapToLines=a.get("snapToLines",!0),r.size=a.get("size",100),r.align=a.get("align","middle"),r.position=a.get("position",{start:0,left:0,middle:50,end:100,right:100},r.align),r.positionAlign=a.get("positionAlign",{start:"start",left:"start",middle:"middle",end:"end",right:"end"},r.align)}((te.prototype=Dr(Error.prototype)).constructor=te).Errors={BadSignature:{code:0,message:"Malformed WebVTT signature."},BadTimeStamp:{code:1,message:"Malformed time stamp."}},xi.prototype={set:function(t,i){this.get(t)||i===""||(this.values[t]=i)},get:function(t,i,n){return n?this.has(t)?this.values[t]:i[n]:this.has(t)?this.values[t]:i},has:function(t){return t in this.values},alt:function(t,i,n){for(var e=0;e","‎":"\u200E","‏":"\u200F"," ":"\xA0"},bh={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"},Th={v:"title",lang:"lang"},wo={rt:"ruby"};function Ao(t,i){function n(){if(!i)return null;var _,E=i.match(/^([^<]*)(<[^>]*>?)?/);return _=E[1]?E[1]:E[2],i=i.substr(_.length),_}function e(_){return _h[_]}function r(_){for(;b=_.match(/&(amp|lt|gt|lrm|rlm|nbsp);/);)_=_.replace(b[0],e);return _}function a(_,E){var S=bh[_];if(!S)return null;var C=t.document.createElement(S);C.localName=S;var L=Th[_];return L&&E&&(C[L]=E.trim()),C}for(var s,o,u,c=t.document.createElement("div"),d=c,h=[];(s=n())!==null;)if(s[0]!=="<")d.appendChild(t.document.createTextNode(r(s)));else{if(s[1]==="/"){h.length&&h[h.length-1]===s.substr(2).replace(">","")&&(h.pop(),d=d.parentNode);continue}var f,y=Ur(s.substr(1,s.length-2));if(y){f=t.document.createProcessingInstruction("timestamp",y),d.appendChild(f);continue}var b=s.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!b||!(f=a(b[1],b[3]))||(o=d,wo[(u=f).localName]&&wo[u.localName]!==o.localName))continue;b[2]&&(f.className=b[2].substr(1).replace("."," ")),h.push(b[1]),d.appendChild(f),d=f}return c}var Po=[[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]];function Sh(t){for(var i=0;i=n[0]&&t<=n[1])return!0}return!1}function fn(){}function Rr(t,i,n){fn.call(this),this.cue=i,this.cueDiv=Ao(t,i.text);var e={color:"rgba(255, 255, 255, 1)",backgroundColor:"rgba(0, 0, 0, 0.8)",position:"relative",left:0,right:0,top:0,bottom:0,display:"inline",writingMode:i.vertical===""?"horizontal-tb":i.vertical==="lr"?"vertical-lr":"vertical-rl",unicodeBidi:"plaintext"};this.applyStyles(e,this.cueDiv),this.div=t.document.createElement("div"),e={direction:function(a){var s=[],o="";if(!a||!a.childNodes)return"ltr";function u(h,f){for(var y=f.childNodes.length-1;0<=y;y--)h.push(f.childNodes[y])}function c(h){if(!h||!h.length)return null;var f=h.pop(),y=f.textContent||f.innerText;if(y){var b=y.match(/^.*(\n|\r)/);return b?b[h.length=0]:y}return f.tagName==="ruby"?c(h):f.childNodes?(u(h,f),c(h)):void 0}for(u(s,a);o=c(s);)for(var d=0;dh&&(d=d<0?-1:1,d*=Math.ceil(h/c)*c),s<0&&(d+=a.vertical===""?n.height:n.width,o=o.reverse()),r.move(f,d)}else{var y=r.lineHeight/n.height*100;switch(a.lineAlign){case"middle":s-=y/2;break;case"end":s-=y}switch(a.vertical){case"":i.applyStyles({top:i.formatStyle(s,"%")});break;case"rl":i.applyStyles({left:i.formatStyle(s,"%")});break;case"lr":i.applyStyles({right:i.formatStyle(s,"%")})}o=["+y","-x","+x","-y"],r=new Ot(i)}var b=function(_,E){for(var S,C=new Ot(_),L=1,D=0;Dt.left&&this.topt.top},Ot.prototype.overlapsAny=function(t){for(var i=0;i=t.top&&this.bottom<=t.bottom&&this.left>=t.left&&this.right<=t.right},Ot.prototype.overlapsOppositeAxis=function(t,i){switch(i){case"+x":return this.leftt.right;case"+y":return this.topt.bottom}},Ot.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)},Ot.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}},Ot.getSimpleBoxPosition=function(t){var i=t.div?t.div.offsetHeight:t.tagName?t.offsetHeight:0,n=t.div?t.div.offsetWidth:t.tagName?t.offsetWidth:0,e=t.div?t.div.offsetTop:t.tagName?t.offsetTop:0;return{left:(t=t.div?t.div.getBoundingClientRect():t.tagName?t.getBoundingClientRect():t).left,right:t.right,top:t.top||e,height:t.height||i,bottom:t.bottom||e+(t.height||i),width:t.width||n}},Ui.StringDecoder=function(){return{decode:function(t){if(!t)return"";if(typeof t!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(t))}}},Ui.convertCueToDOMTree=function(t,i){return t&&i?Ao(t,i):null},Ui.processCues=function(t,i,n){if(!t||!i||!n)return null;for(;n.firstChild;)n.removeChild(n.firstChild);var e=t.document.createElement("div");if(e.style.position="absolute",e.style.left="0",e.style.right="0",e.style.top="0",e.style.bottom="0",e.style.margin="1.5%",n.appendChild(e),function(u){for(var c=0;c")===-1){i.cue.id=r;continue}case"CUE":try{vh(r,i.cue,i.regionList)}catch(u){i.reportOrThrowError(u),i.cue=null,i.state="BADCUE";continue}i.state="CUETEXT";continue;case"CUETEXT":var o=r.indexOf("-->")!==-1;if(!r||o&&(s=!0)){i.oncue&&i.oncue(i.cue),i.cue=null,i.state="ID";continue}i.cue.text&&(i.cue.text+=` `),i.cue.text+=r;continue;case"BADCUE":r||(i.state="ID");continue}}}catch(u){i.reportOrThrowError(u),i.state==="CUETEXT"&&i.cue&&i.oncue&&i.oncue(i.cue),i.cue=null,i.state=i.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},flush:function(){var t=this;try{if(t.buffer+=t.decoder.decode(),!t.cue&&t.state!=="HEADER"||(t.buffer+=` `,t.parse()),t.state==="INITIAL")throw new te(te.Errors.BadSignature)}catch(i){t.reportOrThrowError(i)}return t.onflush&&t.onflush(),this}};var Ch=Ui,Eh={"":1,lr:1,rl:1},wh={start:1,middle:1,end:1,left:1,right:1};function Mr(t){return typeof t=="string"&&!!wh[t.toLowerCase()]&&t.toLowerCase()}function Io(t,i,n){this.hasBeenReset=!1;var e="",r=!1,a=t,s=i,o=n,u=null,c="",d=!0,h="auto",f="start",y=50,b="middle",_=50,E="middle";Object.defineProperties(this,{id:{enumerable:!0,get:function(){return e},set:function(S){e=""+S}},pauseOnExit:{enumerable:!0,get:function(){return r},set:function(S){r=!!S}},startTime:{enumerable:!0,get:function(){return a},set:function(S){if(typeof S!="number")throw new TypeError("Start time must be set to a number.");a=S,this.hasBeenReset=!0}},endTime:{enumerable:!0,get:function(){return s},set:function(S){if(typeof S!="number")throw new TypeError("End time must be set to a number.");s=S,this.hasBeenReset=!0}},text:{enumerable:!0,get:function(){return o},set:function(S){o=""+S,this.hasBeenReset=!0}},region:{enumerable:!0,get:function(){return u},set:function(S){u=S,this.hasBeenReset=!0}},vertical:{enumerable:!0,get:function(){return c},set:function(S){var C=function(L){return typeof L=="string"&&!!Eh[L.toLowerCase()]&&L.toLowerCase()}(S);if(C===!1)throw new SyntaxError("An invalid or illegal string was specified.");c=C,this.hasBeenReset=!0}},snapToLines:{enumerable:!0,get:function(){return d},set:function(S){d=!!S,this.hasBeenReset=!0}},line:{enumerable:!0,get:function(){return h},set:function(S){if(typeof S!="number"&&S!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");h=S,this.hasBeenReset=!0}},lineAlign:{enumerable:!0,get:function(){return f},set:function(S){var C=Mr(S);if(!C)throw new SyntaxError("An invalid or illegal string was specified.");f=C,this.hasBeenReset=!0}},position:{enumerable:!0,get:function(){return y},set:function(S){if(S<0||100