/** * @license * Video.js 7.4.1 * Copyright Brightcove, Inc. * Available under Apache License Version 2.0 * * * Includes vtt.js * Available under Apache License Version 2.0 * */(function(B,A){typeof exports=="object"&&typeof module!="undefined"?module.exports=A(require("global/document"),require("global/window")):typeof define=="function"&&define.amd?define(["global/document","global/window"],A):B.videojs=A(B.document,B.window)})(this,function(B,A){B=B&&B.hasOwnProperty("default")?B.default:B,A=A&&A.hasOwnProperty("default")?A.default:A;var ms="7.4.1";function F(i,r){i.prototype=Object.create(r.prototype),(i.prototype.constructor=i).__proto__=r}function gs(i,r){return(gs=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(i,r)}function ys(i,r,e){return(ys=function(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(t){return!1}}()?Reflect.construct:function(t,n,a){var s=[null];s.push.apply(s,n);var o=new(Function.bind.apply(t,s));return a&&gs(o,a.prototype),o}).apply(null,arguments)}function V(i){if(i===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return i}function Jn(i,r){return r||(r=i.slice(0)),i.raw=r,i}var Vt=[],ih=function(i,r){return function(e,t,n){var a=r.levels[t],s=new RegExp("^("+a+")$");if(e!=="log"&&n.unshift(e.toUpperCase()+":"),n.unshift(i+":"),Vt&&Vt.push([].concat(n)),A.console){var o=A.console[e];o||e!=="debug"||(o=A.console.info||A.console.log),o&&a&&s.test(e)&&o[Array.isArray(n)?"apply":"call"](A.console,n)}}},Z=function i(r){var e,t="info",n=function(){for(var a=arguments.length,s=new Array(a),o=0;o',e=t.firstChild,t.setAttribute("style","display:none; position:absolute;"),B.body.appendChild(t));for(var a={},s=0;sx',i=r.firstChild.href}return i},wr=function(i){if(typeof i=="string"){var r=/^(\/?)([\s\S]*?)((?:\.{1,2}|[^\/]+?)(\.([^\.\/\?]+)))(?:[\/]*|[\?].*)$/i.exec(i);if(r)return r.pop().toLowerCase()}return""},un=function(i){var r=A.location,e=kr(i);return(e.protocol===":"?r.protocol:e.protocol)+e.host!==r.protocol+r.host},wh=Object.freeze({parseUrl:kr,getAbsoluteURL:uo,getFileExtension:wr,isCrossOrigin:un}),Ch=function(i){var r=Eh.call(i);return r==="[object Function]"||typeof i=="function"&&r!=="[object RegExp]"||typeof window!="undefined"&&(i===window.setTimeout||i===window.alert||i===window.confirm||i===window.prompt)},Eh=Object.prototype.toString;typeof window!="undefined"||typeof global!="undefined"&&global;function Cr(i,r){return i(r={exports:{}},r.exports),r.exports}var ki=Cr(function(i,r){(r=i.exports=function(e){return e.replace(/^\s*|\s*$/g,"")}).left=function(e){return e.replace(/^\s*/,"")},r.right=function(e){return e.replace(/\s*$/,"")}}),lo=(ki.left,ki.right,Function.prototype.toString),Ah=/^\s*class\b/,co=function(i){try{var r=lo.call(i);return Ah.test(r)}catch(e){return!1}},Lh=Object.prototype.toString,Oh=typeof Symbol=="function"&&typeof Symbol.toStringTag=="symbol",Ph=function(i){if(!i||typeof i!="function"&&typeof i!="object")return!1;if(typeof i=="function"&&!i.prototype)return!0;if(Oh)return function(e){try{return!co(e)&&(lo.call(e),!0)}catch(t){return!1}}(i);if(co(i))return!1;var r=Lh.call(i);return r==="[object Function]"||r==="[object GeneratorFunction]"},Uh=Object.prototype.toString,ho=Object.prototype.hasOwnProperty,Ih=function(i,r,e){if(!Ph(r))throw new TypeError("iterator must be a function");var t;3<=arguments.length&&(t=e),Uh.call(i)==="[object Array]"?function(n,a,s){for(var o=0,u=n.length;o=g||S.startTime===S.endTime&&S.startTime<=g&&S.startTime+.5>=g)&&y.push(S)}if(d=!1,y.length!==this.activeCues_.length)d=!0;else for(var C=0;C")throw new $t($t.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '-->'): "+s);i=i.substr(3),u(),r.endTime=o(),u(),t=i,n=r,a=new Ei,Ai(t,function(c,d){switch(c){case"region":for(var p=e.length-1;0<=p;p--)if(e[p].id===d){a.set(c,e[p].region);break}break;case"vertical":a.alt(c,d,["rl","lr"]);break;case"line":var g=d.split(","),y=g[0];a.integer(c,y),a.percent(c,y)&&a.set("snapToLines",!1),a.alt(c,y,["auto"]),g.length===2&&a.alt("lineAlign",g[1],["start","middle","end"]);break;case"position":g=d.split(","),a.percent(c,g[0]),g.length===2&&a.alt("positionAlign",g[1],["start","middle","end"]);break;case"size":a.percent(c,d);break;case"align":a.alt(c,d,["start","middle","end","left","right"])}},/:/,/\s/),n.region=a.get("region",null),n.vertical=a.get("vertical",""),n.line=a.get("line","auto"),n.lineAlign=a.get("lineAlign","start"),n.snapToLines=a.get("snapToLines",!0),n.size=a.get("size",100),n.align=a.get("align","middle"),n.position=a.get("position",{start:0,left:0,middle:50,end:100,right:100},n.align),n.positionAlign=a.get("positionAlign",{start:"start",left:"start",middle:"middle",end:"end",right:"end"},n.align)}(($t.prototype=Er(Error.prototype)).constructor=$t).Errors={BadSignature:{code:0,message:"Malformed WebVTT signature."},BadTimeStamp:{code:1,message:"Malformed time stamp."}},Ei.prototype={set:function(i,r){this.get(i)||r===""||(this.values[i]=r)},get:function(i,r,e){return e?this.has(i)?this.values[i]:r[e]:this.has(i)?this.values[i]:r},has:function(i){return i in this.values},alt:function(i,r,e){for(var t=0;t","‎":"\u200E","‏":"\u200F"," ":"\xA0"},Nh={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"},jh={v:"title",lang:"lang"},_o={rt:"ruby"};function bo(i,r){function e(){if(!r)return null;var T,S=r.match(/^([^<]*)(<[^>]*>?)?/);return T=S[1]?S[1]:S[2],r=r.substr(T.length),T}function t(T){return Bh[T]}function n(T){for(;b=T.match(/&(amp|lt|gt|lrm|rlm|nbsp);/);)T=T.replace(b[0],t);return T}function a(T,S){var C=Nh[T];if(!C)return null;var E=i.document.createElement(C);E.localName=C;var U=jh[T];return U&&S&&(E[U]=S.trim()),E}for(var s,o,u,c=i.document.createElement("div"),d=c,p=[];(s=e())!==null;)if(s[0]!=="<")d.appendChild(i.document.createTextNode(n(s)));else{if(s[1]==="/"){p.length&&p[p.length-1]===s.substr(2).replace(">","")&&(p.pop(),d=d.parentNode);continue}var g,y=Ar(s.substr(1,s.length-2));if(y){g=i.document.createProcessingInstruction("timestamp",y),d.appendChild(g);continue}var b=s.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!b||!(g=a(b[1],b[3]))||(o=d,_o[(u=g).localName]&&_o[u.localName]!==o.localName))continue;b[2]&&(g.className=b[2].substr(1).replace("."," ")),p.push(b[1]),d.appendChild(g),d=g}return c}var To=[[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 Fh(i){for(var r=0;r=e[0]&&i<=e[1])return!0}return!1}function ln(){}function Lr(i,r,e){ln.call(this),this.cue=r,this.cueDiv=bo(i,r.text);var t={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:r.vertical===""?"horizontal-tb":r.vertical==="lr"?"vertical-lr":"vertical-rl",unicodeBidi:"plaintext"};this.applyStyles(t,this.cueDiv),this.div=i.document.createElement("div"),t={direction:function(a){var s=[],o="";if(!a||!a.childNodes)return"ltr";function u(p,g){for(var y=g.childNodes.length-1;0<=y;y--)p.push(g.childNodes[y])}function c(p){if(!p||!p.length)return null;var g=p.pop(),y=g.textContent||g.innerText;if(y){var b=y.match(/^.*(\n|\r)/);return b?b[p.length=0]:y}return g.tagName==="ruby"?c(p):g.childNodes?(u(p,g),c(p)):void 0}for(u(s,a);o=c(s);)for(var d=0;dp&&(d=d<0?-1:1,d*=Math.ceil(p/c)*c),s<0&&(d+=a.vertical===""?e.height:e.width,o=o.reverse()),n.move(g,d)}else{var y=n.lineHeight/e.height*100;switch(a.lineAlign){case"middle":s-=y/2;break;case"end":s-=y}switch(a.vertical){case"":r.applyStyles({top:r.formatStyle(s,"%")});break;case"rl":r.applyStyles({left:r.formatStyle(s,"%")});break;case"lr":r.applyStyles({right:r.formatStyle(s,"%")})}o=["+y","-x","+x","-y"],n=new Ct(r)}var b=function(T,S){for(var C,E=new Ct(T),U=1,I=0;Ii.left&&this.topi.top},Ct.prototype.overlapsAny=function(i){for(var r=0;r=i.top&&this.bottom<=i.bottom&&this.left>=i.left&&this.right<=i.right},Ct.prototype.overlapsOppositeAxis=function(i,r){switch(r){case"+x":return this.lefti.right;case"+y":return this.topi.bottom}},Ct.prototype.intersectPercentage=function(i){return Math.max(0,Math.min(this.right,i.right)-Math.max(this.left,i.left))*Math.max(0,Math.min(this.bottom,i.bottom)-Math.max(this.top,i.top))/(this.height*this.width)},Ct.prototype.toCSSCompatValues=function(i){return{top:this.top-i.top,bottom:i.bottom-this.bottom,left:this.left-i.left,right:i.right-this.right,height:this.height,width:this.width}},Ct.getSimpleBoxPosition=function(i){var r=i.div?i.div.offsetHeight:i.tagName?i.offsetHeight:0,e=i.div?i.div.offsetWidth:i.tagName?i.offsetWidth:0,t=i.div?i.div.offsetTop:i.tagName?i.offsetTop:0;return{left:(i=i.div?i.div.getBoundingClientRect():i.tagName?i.getBoundingClientRect():i).left,right:i.right,top:i.top||t,height:i.height||r,bottom:i.bottom||t+(i.height||r),width:i.width||e}},Li.StringDecoder=function(){return{decode:function(i){if(!i)return"";if(typeof i!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(i))}}},Li.convertCueToDOMTree=function(i,r){return i&&r?bo(i,r):null},Li.processCues=function(i,r,e){if(!i||!r||!e)return null;for(;e.firstChild;)e.removeChild(e.firstChild);var t=i.document.createElement("div");if(t.style.position="absolute",t.style.left="0",t.style.right="0",t.style.top="0",t.style.bottom="0",t.style.margin="1.5%",e.appendChild(t),function(u){for(var c=0;c")===-1){r.cue.id=n;continue}case"CUE":try{Mh(n,r.cue,r.regionList)}catch(u){r.reportOrThrowError(u),r.cue=null,r.state="BADCUE";continue}r.state="CUETEXT";continue;case"CUETEXT":var o=n.indexOf("-->")!==-1;if(!n||o&&(s=!0)){r.oncue&&r.oncue(r.cue),r.cue=null,r.state="ID";continue}r.cue.text&&(r.cue.text+=` `),r.cue.text+=n;continue;case"BADCUE":n||(r.state="ID");continue}}}catch(u){r.reportOrThrowError(u),r.state==="CUETEXT"&&r.cue&&r.oncue&&r.oncue(r.cue),r.cue=null,r.state=r.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},flush:function(){var i=this;try{if(i.buffer+=i.decoder.decode(),(i.cue||i.state==="HEADER")&&(i.buffer+=` `,i.parse()),i.state==="INITIAL")throw new $t($t.Errors.BadSignature)}catch(r){i.reportOrThrowError(r)}return i.onflush&&i.onflush(),this}};var Hh=Li,qh={"":1,lr:1,rl:1},zh={start:1,middle:1,end:1,left:1,right:1};function Or(i){return typeof i=="string"&&!!zh[i.toLowerCase()]&&i.toLowerCase()}function So(i,r,e){this.hasBeenReset=!1;var t="",n=!1,a=i,s=r,o=e,u=null,c="",d=!0,p="auto",g="start",y=50,b="middle",T=50,S="middle";Object.defineProperties(this,{id:{enumerable:!0,get:function(){return t},set:function(C){t=""+C}},pauseOnExit:{enumerable:!0,get:function(){return n},set:function(C){n=!!C}},startTime:{enumerable:!0,get:function(){return a},set:function(C){if(typeof C!="number")throw new TypeError("Start time must be set to a number.");a=C,this.hasBeenReset=!0}},endTime:{enumerable:!0,get:function(){return s},set:function(C){if(typeof C!="number")throw new TypeError("End time must be set to a number.");s=C,this.hasBeenReset=!0}},text:{enumerable:!0,get:function(){return o},set:function(C){o=""+C,this.hasBeenReset=!0}},region:{enumerable:!0,get:function(){return u},set:function(C){u=C,this.hasBeenReset=!0}},vertical:{enumerable:!0,get:function(){return c},set:function(C){var E,U=typeof(E=C)=="string"&&!!qh[E.toLowerCase()]&&E.toLowerCase();if(U===!1)throw new SyntaxError("An invalid or illegal string was specified.");c=U,this.hasBeenReset=!0}},snapToLines:{enumerable:!0,get:function(){return d},set:function(C){d=!!C,this.hasBeenReset=!0}},line:{enumerable:!0,get:function(){return p},set:function(C){if(typeof C!="number"&&C!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");p=C,this.hasBeenReset=!0}},lineAlign:{enumerable:!0,get:function(){return g},set:function(C){var E=Or(C);if(!E)throw new SyntaxError("An invalid or illegal string was specified.");g=E,this.hasBeenReset=!0}},position:{enumerable:!0,get:function(){return y},set:function(C){if(C<0||100