/** * @license * Video.js 7.6.0 * Copyright Brightcove, Inc. * Available under Apache License Version 2.0 * * * Includes vtt.js * Available under Apache License Version 2.0 * */ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("global/window"),require("global/document")):"function"==typeof define&&define.amd?define(["global/window","global/document"],t):(e=e||self).videojs=t(e.window,e.document)}(this,function(h,d){h=h&&h.hasOwnProperty("default")?h.default:h,d=d&&d.hasOwnProperty("default")?d.default:d;var p="7.6.0";function f(e,t){e.prototype=Object.create(t.prototype),(e.prototype.constructor=e).__proto__=t}function o(e,t){return(o=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function s(e,t,n){return(s=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(e){return!1}}()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var i=new(Function.bind.apply(e,r));return n&&o(i,n.prototype),i}).apply(null,arguments)}function v(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function t(e,t){return t=t||e.slice(0),e.raw=t,e}var l=[],e=function(s,a){return function(e,t,n){var r=a.levels[t],i=new RegExp("^("+r+")$");if("log"!==e&&n.unshift(e.toUpperCase()+":"),n.unshift(s+":"),l&&l.push([].concat(n)),h.console){var o=h.console[e];o||"debug"!==e||(o=h.console.info||h.console.log),o&&r&&i.test(e)&&o[Array.isArray(n)?"apply":"call"](h.console,n)}}};var y=function t(n){function r(){for(var e=arguments.length,t=new Array(e),n=0;n',n=r.firstChild,r.setAttribute("style","display:none; position:absolute;"),d.body.appendChild(r));for(var o={},s=0;sx',e=t.firstChild.href}return e}function Vt(e){if("string"==typeof e){var t=/^(\/?)([\s\S]*?)((?:\.{1,2}|[^\/]+?)(\.([^\.\/\?]+)))(?:[\/]*|[\?].*)$/i.exec(e);if(t)return t.pop().toLowerCase()}return""}function $t(e){var t=h.location,n=Ft(e);return(":"===n.protocol?t.protocol:n.protocol)+n.host!==t.protocol+t.host}var Ht=function(r){function e(e){var t;void 0===e&&(e=[]);for(var n=e.length-1;0<=n;n--)if(e[n].enabled){Lt(e,e[n]);break}return(t=r.call(this,e)||this).changing_=!1,t}f(e,r);var t=e.prototype;return t.addTrack=function(e){var t=this;e.enabled&&Lt(this,e),r.prototype.addTrack.call(this,e),e.addEventListener&&(e.enabledChange_=function(){t.changing_||(t.changing_=!0,Lt(t,e),t.changing_=!1,t.trigger("change"))},e.addEventListener("enabledchange",e.enabledChange_))},t.removeTrack=function(e){r.prototype.removeTrack.call(this,e),e.removeEventListener&&e.enabledChange_&&(e.removeEventListener("enabledchange",e.enabledChange_),e.enabledChange_=null)},e}(Mt),Ut=function(r){function e(e){var t;void 0===e&&(e=[]);for(var n=e.length-1;0<=n;n--)if(e[n].selected){Rt(e,e[n]);break}return(t=r.call(this,e)||this).changing_=!1,Object.defineProperty(v(t),"selectedIndex",{get:function(){for(var e=0;e>0},ToUint32:function(e){return this.ToNumber(e)>>>0},ToUint16:function(e){var t=this.ToNumber(e);return Yn(t)||0===t||!Jn(t)?0:function(e,t){var n=e%t;return Math.floor(0<=n?n:n+t)}(Dn(t)*Math.floor(Math.abs(t)),65536)},ToString:function(e){return ar(e)},ToObject:function(e){return this.CheckObjectCoercible(e),or(e)},CheckObjectCoercible:function(e,t){if(null==e)throw new sr(t||"Cannot call method on "+e);return e},IsCallable:Nn,SameValue:function(e,t){return e===t?0!==e||1/e==1/t:Yn(e)&&Yn(t)},Type:function(e){return null===e?"Null":"undefined"==typeof e?"Undefined":"function"==typeof e||"object"==typeof e?"Object":"number"==typeof e?"Number":"boolean"==typeof e?"Boolean":"string"==typeof e?"String":void 0},IsPropertyDescriptor:function(e){if("Object"!==this.Type(e))return!1;var t={"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0};for(var n in e)if(Kn(e,n)&&!t[n])return!1;var r=Kn(e,"[[Value]]"),i=Kn(e,"[[Get]]")||Kn(e,"[[Set]]");if(r&&i)throw new sr("Property Descriptors may not be both accessor and data descriptors");return!0},IsAccessorDescriptor:function(e){return"undefined"!=typeof e&&(On(this,"Property Descriptor","Desc",e),!(!Kn(e,"[[Get]]")&&!Kn(e,"[[Set]]")))},IsDataDescriptor:function(e){return"undefined"!=typeof e&&(On(this,"Property Descriptor","Desc",e),!(!Kn(e,"[[Value]]")&&!Kn(e,"[[Writable]]")))},IsGenericDescriptor:function(e){return"undefined"!=typeof e&&(On(this,"Property Descriptor","Desc",e),!this.IsAccessorDescriptor(e)&&!this.IsDataDescriptor(e))},FromPropertyDescriptor:function(e){if("undefined"==typeof e)return e;if(On(this,"Property Descriptor","Desc",e),this.IsDataDescriptor(e))return{value:e["[[Value]]"],writable:!!e["[[Writable]]"],enumerable:!!e["[[Enumerable]]"],configurable:!!e["[[Configurable]]"]};if(this.IsAccessorDescriptor(e))return{get:e["[[Get]]"],set:e["[[Set]]"],enumerable:!!e["[[Enumerable]]"],configurable:!!e["[[Configurable]]"]};throw new sr("FromPropertyDescriptor must be called with a fully populated Property Descriptor")},ToPropertyDescriptor:function(e){if("Object"!==this.Type(e))throw new sr("ToPropertyDescriptor requires an object");var t={};if(Kn(e,"enumerable")&&(t["[[Enumerable]]"]=this.ToBoolean(e.enumerable)),Kn(e,"configurable")&&(t["[[Configurable]]"]=this.ToBoolean(e.configurable)),Kn(e,"value")&&(t["[[Value]]"]=e.value),Kn(e,"writable")&&(t["[[Writable]]"]=this.ToBoolean(e.writable)),Kn(e,"get")){var n=e.get;if("undefined"!=typeof n&&!this.IsCallable(n))throw new TypeError("getter must be a function");t["[[Get]]"]=n}if(Kn(e,"set")){var r=e.set;if("undefined"!=typeof r&&!this.IsCallable(r))throw new sr("setter must be a function");t["[[Set]]"]=r}if((Kn(t,"[[Get]]")||Kn(t,"[[Set]]"))&&(Kn(t,"[[Value]]")||Kn(t,"[[Writable]]")))throw new sr("Invalid property descriptor. Cannot both specify accessors and a value or writable attribute");return t}},cr=sn.call(Function.call,String.prototype.replace),ur=/^[\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]+/,hr=/[\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]+$/,dr=sn.call(Function.call,Fn());Vn(dr,{getPolyfill:Fn,implementation:Rn,shim:function(){var e=Fn();return Vn(String.prototype,{trim:e},{trim:function(){return String.prototype.trim!==e}}),e}});var pr=dr,fr=Object.prototype.toString,vr=Object.prototype.hasOwnProperty,yr=function(e,t,n){if(!Nn(t))throw new TypeError("iterator must be a function");var r;3<=arguments.length&&(r=n),"[object Array]"===fr.call(e)?function(e,t,n){for(var r=0,i=e.length;r=e?t.push(i):i.startTime===i.endTime&&i.startTime<=e&&i.startTime+.5>=e&&t.push(i)}if(a=!1,t.length!==this.activeCues_.length)a=!0;else for(var o=0;o","‎":"‎","‏":"‏"," ":" "},Vr={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"},$r={v:"title",lang:"lang"},Hr={rt:"ruby"};function Ur(o,n){function e(){if(!n)return null;var e,t=n.match(/^([^<]*)(<[^>]*>?)?/);return e=t[1]?t[1]:t[2],n=n.substr(e.length),e}function t(e){return Br[e]}function r(e){for(;f=e.match(/&(amp|lt|gt|lrm|rlm|nbsp);/);)e=e.replace(f[0],t);return e}function i(e,t){var n=Vr[e];if(!n)return null;var r=o.document.createElement(n);r.localName=n;var i=$r[e];return i&&t&&(r[i]=t.trim()),r}for(var s,a,l,c=o.document.createElement("div"),u=c,h=[];null!==(s=e());)if("<"!==s[0])u.appendChild(o.document.createTextNode(r(s)));else{if("/"===s[1]){h.length&&h[h.length-1]===s.substr(2).replace(">","")&&(h.pop(),u=u.parentNode);continue}var d,p=Nr(s.substr(1,s.length-2));if(p){d=o.document.createProcessingInstruction("timestamp",p),u.appendChild(d);continue}var f=s.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!f)continue;if(!(d=i(f[1],f[3])))continue;if(a=u,Hr[(l=d).localName]&&Hr[l.localName]!==a.localName)continue;f[2]&&(d.className=f[2].substr(1).replace("."," ")),h.push(f[1]),u.appendChild(d),u=d}return c}var Wr=[[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 zr(e){for(var t=0;t=n[0]&&e<=n[1])return!0}return!1}function Kr(){}function qr(e,t,n){Kr.call(this),this.cue=t,this.cueDiv=Ur(e,t.text);var r={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:""===t.vertical?"horizontal-tb":"lr"===t.vertical?"vertical-lr":"vertical-rl",unicodeBidi:"plaintext"};this.applyStyles(r,this.cueDiv),this.div=e.document.createElement("div"),r={direction:function(e){var t=[],n="";if(!e||!e.childNodes)return"ltr";function i(e,t){for(var n=t.childNodes.length-1;0<=n;n--)e.push(t.childNodes[n])}function o(e){if(!e||!e.length)return null;var t=e.pop(),n=t.textContent||t.innerText;if(n){var r=n.match(/^.*(\n|\r)/);return r?r[e.length=0]:n}return"ruby"===t.tagName?o(e):t.childNodes?(i(e,t),o(e)):void 0}for(i(t,e);n=o(t);)for(var r=0;rh&&(u=u<0?-1:1,u*=Math.ceil(h/c)*c),i<0&&(u+=""===r.vertical?a.height:a.width,o=o.reverse()),n.move(d,u)}else{var p=n.lineHeight/a.height*100;switch(r.lineAlign){case"middle":i-=p/2;break;case"end":i-=p}switch(r.vertical){case"":t.applyStyles({top:t.formatStyle(i,"%")});break;case"rl":t.applyStyles({left:t.formatStyle(i,"%")});break;case"lr":t.applyStyles({right:t.formatStyle(i,"%")})}o=["+y","-x","+x","-y"],n=new Xr(t)}var f=function(e,t){for(var n,r=new Xr(e),i=1,o=0;oe.left&&this.tope.top},Xr.prototype.overlapsAny=function(e){for(var t=0;t=e.top&&this.bottom<=e.bottom&&this.left>=e.left&&this.right<=e.right},Xr.prototype.overlapsOppositeAxis=function(e,t){switch(t){case"+x":return this.lefte.right;case"+y":return this.tope.bottom}},Xr.prototype.intersectPercentage=function(e){return Math.max(0,Math.min(this.right,e.right)-Math.max(this.left,e.left))*Math.max(0,Math.min(this.bottom,e.bottom)-Math.max(this.top,e.top))/(this.height*this.width)},Xr.prototype.toCSSCompatValues=function(e){return{top:this.top-e.top,bottom:e.bottom-this.bottom,left:this.left-e.left,right:e.right-this.right,height:this.height,width:this.width}},Xr.getSimpleBoxPosition=function(e){var t=e.div?e.div.offsetHeight:e.tagName?e.offsetHeight:0,n=e.div?e.div.offsetWidth:e.tagName?e.offsetWidth:0,r=e.div?e.div.offsetTop:e.tagName?e.offsetTop:0;return{left:(e=e.div?e.div.getBoundingClientRect():e.tagName?e.getBoundingClientRect():e).left,right:e.right,top:e.top||r,height:e.height||t,bottom:e.bottom||r+(e.height||t),width:e.width||n}},Yr.StringDecoder=function(){return{decode:function(e){if(!e)return"";if("string"!=typeof e)throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(e))}}},Yr.convertCueToDOMTree=function(e,t){return e&&t?Ur(e,t):null};Yr.processCues=function(r,i,e){if(!r||!i||!e)return null;for(;e.firstChild;)e.removeChild(e.firstChild);var o=r.document.createElement("div");if(o.style.position="absolute",o.style.left="0",o.style.right="0",o.style.top="0",o.style.bottom="0",o.style.margin="1.5%",e.appendChild(o),function(e){for(var t=0;t