define(["./common/_commonjsHelpers","./common/__node-resolve_empty"],(function(e,t){"use strict";var i,n="undefined"!=typeof window?window:void 0!==e.commonjsGlobal?e.commonjsGlobal:"undefined"!=typeof self?self:{},r=void 0!==e.commonjsGlobal?e.commonjsGlobal:"undefined"!=typeof window?window:{},a=t.require$$0;"undefined"!=typeof document?i=document:(i=r["__GLOBAL_DOCUMENT_CACHE@4"])||(i=r["__GLOBAL_DOCUMENT_CACHE@4"]=a);var s=i;function o(){return u=o=Object.assign||function(e){for(var t=1;t0&&(l=setTimeout((function(){if(!o){o=!0,u.abort("timeout");var e=new Error("XMLHttpRequest timeout");e.code="ETIMEDOUT",r(e)}}),e.timeout)),u.setRequestHeader)for(s in p)p.hasOwnProperty(s)&&u.setRequestHeader(s,p[s]);else if(e.headers&&!function(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0}(e.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in e&&(u.responseType=e.responseType),"beforeSend"in e&&"function"==typeof e.beforeSend&&e.beforeSend(u),u.send(h||null),u}m.exports=k,m.exports.default=k,k.XMLHttpRequest=_.XMLHttpRequest||function(){},k.XDomainRequest="withCredentials"in new k.XMLHttpRequest?k.XMLHttpRequest:_.XDomainRequest,function(e,t){for(var i=0;i59?t(i[1],i[2],0,i[4]):t(0,i[1],i[2],i[4]):null}function L(){this.values=A(null)}function D(e,t,i,n){var r=n?e.split(n):[e];for(var a in r)if("string"==typeof r[a]){var s=r[a].split(i);if(2===s.length)t(s[0],s[1])}}function O(e,t,i){var n=e;function r(){var t=P(e);if(null===t)throw new x(x.Errors.BadTimeStamp,"Malformed timestamp: "+n);return e=e.replace(/^[^\sa-zA-Z-]+/,""),t}function a(){e=e.replace(/^\s+/,"")}if(a(),t.startTime=r(),a(),"--\x3e"!==e.substr(0,3))throw new x(x.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '--\x3e'): "+n);e=e.substr(3),a(),t.endTime=r(),a(),function(e,t){var n=new L;D(e,(function(e,t){switch(e){case"region":for(var r=i.length-1;r>=0;r--)if(i[r].id===t){n.set(e,i[r].region);break}break;case"vertical":n.alt(e,t,["rl","lr"]);break;case"line":var a=t.split(","),s=a[0];n.integer(e,s),n.percent(e,s)&&n.set("snapToLines",!1),n.alt(e,s,["auto"]),2===a.length&&n.alt("lineAlign",a[1],["start","center","end"]);break;case"position":a=t.split(","),n.percent(e,a[0]),2===a.length&&n.alt("positionAlign",a[1],["start","center","end"]);break;case"size":n.percent(e,t);break;case"align":n.alt(e,t,["start","center","end","left","right"])}}),/:/,/\s/),t.region=n.get("region",null),t.vertical=n.get("vertical","");try{t.line=n.get("line","auto")}catch(e){}t.lineAlign=n.get("lineAlign","start"),t.snapToLines=n.get("snapToLines",!0),t.size=n.get("size",100);try{t.align=n.get("align","center")}catch(e){t.align=n.get("align","middle")}try{t.position=n.get("position","auto")}catch(e){t.position=n.get("position",{start:0,left:0,center:50,middle:50,end:100,right:100},t.align)}t.positionAlign=n.get("positionAlign",{start:"start",left:"start",center:"center",middle:"center",end:"end",right:"end"},t.align)}(e,t)}x.prototype=A(Error.prototype),x.prototype.constructor=x,x.Errors={BadSignature:{code:0,message:"Malformed WebVTT signature."},BadTimeStamp:{code:1,message:"Malformed time stamp."}},L.prototype={set:function(e,t){this.get(e)||""===t||(this.values[e]=t)},get:function(e,t,i){return i?this.has(e)?this.values[e]:t[i]:this.has(e)?this.values[e]:t},has:function(e){return e in this.values},alt:function(e,t,i){for(var n=0;n=0&&t<=100)&&(this.set(e,t),!0)}};var M=I.createElement("textarea"),R={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"},N={white:"rgba(255,255,255,1)",lime:"rgba(0,255,0,1)",cyan:"rgba(0,255,255,1)",red:"rgba(255,0,0,1)",yellow:"rgba(255,255,0,1)",magenta:"rgba(255,0,255,1)",blue:"rgba(0,0,255,1)",black:"rgba(0,0,0,1)"},U={v:"title",lang:"lang"},F={rt:"ruby"};function B(e,t){function i(){if(!t)return null;var e,i=t.match(/^([^<]*)(<[^>]*>?)?/);return e=i[1]?i[1]:i[2],t=t.substr(e.length),e}function n(e,t){return!F[t.localName]||F[t.localName]===e.localName}function r(t,i){var n=R[t];if(!n)return null;var r=e.document.createElement(n),a=U[t];return a&&i&&(r[a]=i.trim()),r}for(var a,s,o=e.document.createElement("div"),u=o,l=[];null!==(a=i());)if("<"!==a[0])u.appendChild(e.document.createTextNode((s=a,M.innerHTML=s,s=M.textContent,M.textContent="",s)));else{if("/"===a[1]){l.length&&l[l.length-1]===a.substr(2).replace(">","")&&(l.pop(),u=u.parentNode);continue}var c,d=P(a.substr(1,a.length-2));if(d){c=e.document.createProcessingInstruction("timestamp",d),u.appendChild(c);continue}var h=a.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!h)continue;if(!(c=r(h[1],h[3])))continue;if(!n(u,c))continue;if(h[2]){var p=h[2].split(".");p.forEach((function(e){var t=/^bg_/.test(e),i=t?e.slice(3):e;if(N.hasOwnProperty(i)){var n=t?"background-color":"color",r=N[i];c.style[n]=r}})),c.className=p.join(" ")}l.push(h[1]),u.appendChild(c),u=c}return o}var j=[[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 V(e){for(var t=0;t=i[0]&&e<=i[1])return!0}return!1}function H(e){var t=[],i="";if(!e||!e.childNodes)return"ltr";function n(e,t){for(var i=t.childNodes.length-1;i>=0;i--)e.push(t.childNodes[i])}function r(e){if(!e||!e.length)return null;var t=e.pop(),i=t.textContent||t.innerText;if(i){var a=i.match(/^.*(\n|\r)/);return a?(e.length=0,a[0]):i}return"ruby"===t.tagName?r(e):t.childNodes?(n(e,t),r(e)):void 0}for(n(t,e);i=r(t);)for(var a=0;a=0&&e.line<=100))return e.line;if(!e.track||!e.track.textTrackList||!e.track.textTrackList.mediaElement)return-1;for(var t=e.track,i=t.textTrackList,n=0,r=0;rd&&(c=c<0?-1:1,c*=Math.ceil(d/l)*l),s<0&&(c+=""===a.vertical?i.height:i.width,o=o.reverse()),r.move(h,c)}else{var p=r.lineHeight/i.height*100;switch(a.lineAlign){case"center":s-=p/2;break;case"end":s-=p}switch(a.vertical){case"":t.applyStyles({top:t.formatStyle(s,"%")});break;case"rl":t.applyStyles({left:t.formatStyle(s,"%")});break;case"lr":t.applyStyles({right:t.formatStyle(s,"%")})}o=["+y","-x","+x","-y"],r=new z(t)}var f=function(e,t){for(var r,a=new z(e),s=1,o=0;ou&&(r=new z(e),s=u),e=new z(a)}return r||a}(r,o);t.move(f.toCSSCompatValues(i))}function K(){}q.prototype.applyStyles=function(e,t){for(var i in t=t||this.div,e)e.hasOwnProperty(i)&&(t.style[i]=e[i])},q.prototype.formatStyle=function(e,t){return 0===e?0:e+t},W.prototype=A(q.prototype),W.prototype.constructor=W,z.prototype.move=function(e,t){switch(t=void 0!==t?t:this.lineHeight,e){case"+x":this.left+=t,this.right+=t;break;case"-x":this.left-=t,this.right-=t;break;case"+y":this.top+=t,this.bottom+=t;break;case"-y":this.top-=t,this.bottom-=t}},z.prototype.overlaps=function(e){return this.lefte.left&&this.tope.top},z.prototype.overlapsAny=function(e){for(var t=0;t=e.top&&this.bottom<=e.bottom&&this.left>=e.left&&this.right<=e.right},z.prototype.overlapsOppositeAxis=function(e,t){switch(t){case"+x":return this.lefte.right;case"+y":return this.tope.bottom}},z.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)},z.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}},z.getSimpleBoxPosition=function(e){var t=e.div?e.div.offsetHeight:e.tagName?e.offsetHeight:0,i=e.div?e.div.offsetWidth:e.tagName?e.offsetWidth:0,n=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||n,height:e.height||t,bottom:e.bottom||n+(e.height||t),width:e.width||i}},K.StringDecoder=function(){return{decode:function(e){if(!e)return"";if("string"!=typeof e)throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(e))}}},K.convertCueToDOMTree=function(e,t){return e&&t?B(e,t):null};K.processCues=function(e,t,i){if(!e||!t||!i)return null;for(;i.firstChild;)i.removeChild(i.firstChild);var n=e.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%",i.appendChild(n),function(e){for(var t=0;t100)throw new Error("Position must be between 0 and 100.");p=e,this.hasBeenReset=!0}},positionAlign:{enumerable:!0,get:function(){return f},set:function(e){var t=Q(e);t?(f=t,this.hasBeenReset=!0):console.warn("positionAlign: an invalid or illegal string was specified.")}},size:{enumerable:!0,get:function(){return m},set:function(e){if(e<0||e>100)throw new Error("Size must be between 0 and 100.");m=e,this.hasBeenReset=!0}},align:{enumerable:!0,get:function(){return g},set:function(e){var t=Q(e);if(!t)throw new SyntaxError("align: an invalid or illegal alignment string was specified.");g=t,this.hasBeenReset=!0}}}),this.displayState=void 0}J.prototype.getCueAsHTML=function(){return WebVTT.convertCueToDOMTree(window,this.text)};var Z=J,ee={"":!0,up:!0};function te(e){return"number"==typeof e&&e>=0&&e<=100}var ie=function(){var e=100,t=3,i=0,n=100,r=0,a=100,s="";Object.defineProperties(this,{width:{enumerable:!0,get:function(){return e},set:function(t){if(!te(t))throw new Error("Width must be between 0 and 100.");e=t}},lines:{enumerable:!0,get:function(){return t},set:function(e){if("number"!=typeof e)throw new TypeError("Lines must be set to a number.");t=e}},regionAnchorY:{enumerable:!0,get:function(){return n},set:function(e){if(!te(e))throw new Error("RegionAnchorX must be between 0 and 100.");n=e}},regionAnchorX:{enumerable:!0,get:function(){return i},set:function(e){if(!te(e))throw new Error("RegionAnchorY must be between 0 and 100.");i=e}},viewportAnchorY:{enumerable:!0,get:function(){return a},set:function(e){if(!te(e))throw new Error("ViewportAnchorY must be between 0 and 100.");a=e}},viewportAnchorX:{enumerable:!0,get:function(){return r},set:function(e){if(!te(e))throw new Error("ViewportAnchorX must be between 0 and 100.");r=e}},scroll:{enumerable:!0,get:function(){return s},set:function(e){var t=function(e){return"string"==typeof e&&!!ee[e.toLowerCase()]&&e.toLowerCase()}(e);!1===t?console.warn("Scroll: an invalid or illegal string was specified."):s=t}}})},ne=n,re=w.exports={WebVTT:X,VTTCue:Z,VTTRegion:ie};ne.vttjs=re,ne.WebVTT=re.WebVTT;var ae=re.VTTCue,se=re.VTTRegion,oe=ne.VTTCue,ue=ne.VTTRegion;re.shim=function(){ne.VTTCue=ae,ne.VTTRegion=se},re.restore=function(){ne.VTTCue=oe,ne.VTTRegion=ue},ne.VTTCue||re.shim();var le=w.exports;function ce(e,t){return de=ce=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},ce(e,t)}var de=ce;var he=de,pe=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}};function fe(e,t,i){return me=fe=pe()?Reflect.construct:function(e,t,i){var n=[null];n.push.apply(n,t);var r=new(Function.bind.apply(e,n));return i&&he(r,i.prototype),r},fe.apply(null,arguments)}var me=fe,ge=me,ve=de;var ye,_e=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&ve(e,t)},be={exports:{}}; /*! @name @videojs/vhs-utils @version 2.3.0 @license MIT */ function Te(e){return e&&"object"==typeof e&&"default"in e?e.default:e}ye=be,function(e){var t=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#.*)?$/,i=/^([^\/?#]*)(.*)$/,n=/(?:\/|^)\.(?=\/)/g,r=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,a={buildAbsoluteURL:function(e,t,n){if(n=n||{},e=e.trim(),!(t=t.trim())){if(!n.alwaysNormalize)return e;var r=a.parseURL(e);if(!r)throw new Error("Error trying to parse base URL.");return r.path=a.normalizePath(r.path),a.buildURLFromParts(r)}var s=a.parseURL(t);if(!s)throw new Error("Error trying to parse relative URL.");if(s.scheme)return n.alwaysNormalize?(s.path=a.normalizePath(s.path),a.buildURLFromParts(s)):t;var o=a.parseURL(e);if(!o)throw new Error("Error trying to parse base URL.");if(!o.netLoc&&o.path&&"/"!==o.path[0]){var u=i.exec(o.path);o.netLoc=u[1],o.path=u[2]}o.netLoc&&!o.path&&(o.path="/");var l={scheme:o.scheme,netLoc:s.netLoc,path:null,params:s.params,query:s.query,fragment:s.fragment};if(!s.netLoc&&(l.netLoc=o.netLoc,"/"!==s.path[0]))if(s.path){var c=o.path,d=c.substring(0,c.lastIndexOf("/")+1)+s.path;l.path=a.normalizePath(d)}else l.path=o.path,s.params||(l.params=o.params,s.query||(l.query=o.query));return null===l.path&&(l.path=n.alwaysNormalize?a.normalizePath(s.path):s.path),a.buildURLFromParts(l)},parseURL:function(e){var i=t.exec(e);return i?{scheme:i[1]||"",netLoc:i[2]||"",path:i[3]||"",params:i[4]||"",query:i[5]||"",fragment:i[6]||""}:null},normalizePath:function(e){for(e=e.split("").reverse().join("").replace(n,"");e.length!==(e=e.replace(r,"")).length;);return e.split("").reverse().join("")},buildURLFromParts:function(e){return e.scheme+e.netLoc+e.path+e.params+e.query+e.fragment}};ye.exports=a}();var Se=Te(be.exports),ke=Te(n),Ce=function(e,t){return/^[a-z]+:/i.test(t)?t:(/\/\//i.test(e)||(e=Se.buildAbsoluteURL(ke.location&&ke.location.href||"",e)),Se.buildAbsoluteURL(e,t))},Ee=function(){function e(){this.listeners={}}var t=e.prototype;return t.on=function(e,t){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t)},t.off=function(e,t){if(!this.listeners[e])return!1;var i=this.listeners[e].indexOf(t);return this.listeners[e]=this.listeners[e].slice(0),this.listeners[e].splice(i,1),i>-1},t.trigger=function(e){var t=this.listeners[e];if(t)if(2===arguments.length)for(var i=t.length,n=0;n-1;t=this.buffer.indexOf("\n"))this.trigger("data",this.buffer.substring(0,t)),this.buffer=this.buffer.substring(t+1)},t}(we),Le=function(e){for(var t,i=e.split(new RegExp('(?:^|,)((?:[^=]*)=(?:"[^"]*"|[^,]*))')),n={},r=i.length;r--;)""!==i[r]&&((t=/([^=]*)=(.*)/.exec(i[r]).slice(1))[0]=t[0].replace(/^\s+|\s+$/g,""),t[1]=t[1].replace(/^\s+|\s+$/g,""),t[1]=t[1].replace(/^['"](.*)['"]$/g,"$1"),n[t[0]]=t[1]);return n},De=function(e){function t(){var t;return(t=e.call(this)||this).customParsers=[],t.tagMappers=[],t}d(t,e);var i=t.prototype;return i.push=function(e){var t,i,n=this;0!==(e=e.trim()).length&&("#"===e[0]?this.tagMappers.reduce((function(t,i){var n=i(e);return n===e?t:t.concat([n])}),[e]).forEach((function(e){for(var r=0;r0&&(s.duration=e.duration),0===e.duration&&(s.duration=.01,this.trigger("info",{message:"updating zero segment duration to a small value"})),this.manifest.segments=a},key:function(){if(e.attributes)if("NONE"!==e.attributes.METHOD)if(e.attributes.URI){if("urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"===e.attributes.KEYFORMAT){return-1===["SAMPLE-AES","SAMPLE-AES-CTR","SAMPLE-AES-CENC"].indexOf(e.attributes.METHOD)?void this.trigger("warn",{message:"invalid key method provided for Widevine"}):("SAMPLE-AES-CENC"===e.attributes.METHOD&&this.trigger("warn",{message:"SAMPLE-AES-CENC is deprecated, please use SAMPLE-AES-CTR instead"}),"data:text/plain;base64,"!==e.attributes.URI.substring(0,23)?void this.trigger("warn",{message:"invalid key URI provided for Widevine"}):e.attributes.KEYID&&"0x"===e.attributes.KEYID.substring(0,2)?void(this.manifest.contentProtection={"com.widevine.alpha":{attributes:{schemeIdUri:e.attributes.KEYFORMAT,keyId:e.attributes.KEYID.substring(2)},pssh:xe(e.attributes.URI.split(",")[1])}}):void this.trigger("warn",{message:"invalid key ID provided for Widevine"}))}e.attributes.METHOD||this.trigger("warn",{message:"defaulting key method to AES-128"}),n={method:e.attributes.METHOD||"AES-128",uri:e.attributes.URI},void 0!==e.attributes.IV&&(n.iv=e.attributes.IV)}else this.trigger("warn",{message:"ignoring key declaration without URI"});else n=null;else this.trigger("warn",{message:"ignoring key declaration without attribute list"})},"media-sequence":function(){isFinite(e.number)?this.manifest.mediaSequence=e.number:this.trigger("warn",{message:"ignoring invalid media sequence: "+e.number})},"discontinuity-sequence":function(){isFinite(e.number)?(this.manifest.discontinuitySequence=e.number,d=e.number):this.trigger("warn",{message:"ignoring invalid discontinuity sequence: "+e.number})},"playlist-type":function(){/VOD|EVENT/.test(e.playlistType)?this.manifest.playlistType=e.playlistType:this.trigger("warn",{message:"ignoring unknown playlist type: "+e.playlist})},map:function(){i={},e.uri&&(i.uri=e.uri),e.byterange&&(i.byterange=e.byterange)},"stream-inf":function(){this.manifest.playlists=a,this.manifest.mediaGroups=this.manifest.mediaGroups||u,e.attributes?(s.attributes||(s.attributes={}),l(s.attributes,e.attributes)):this.trigger("warn",{message:"ignoring empty stream-inf attributes"})},media:function(){if(this.manifest.mediaGroups=this.manifest.mediaGroups||u,e.attributes&&e.attributes.TYPE&&e.attributes["GROUP-ID"]&&e.attributes.NAME){var i=this.manifest.mediaGroups[e.attributes.TYPE];i[e.attributes["GROUP-ID"]]=i[e.attributes["GROUP-ID"]]||{},t=i[e.attributes["GROUP-ID"]],(c={default:/yes/i.test(e.attributes.DEFAULT)}).default?c.autoselect=!0:c.autoselect=/yes/i.test(e.attributes.AUTOSELECT),e.attributes.LANGUAGE&&(c.language=e.attributes.LANGUAGE),e.attributes.URI&&(c.uri=e.attributes.URI),e.attributes["INSTREAM-ID"]&&(c.instreamId=e.attributes["INSTREAM-ID"]),e.attributes.CHARACTERISTICS&&(c.characteristics=e.attributes.CHARACTERISTICS),e.attributes.FORCED&&(c.forced=/yes/i.test(e.attributes.FORCED)),t[e.attributes.NAME]=c}else this.trigger("warn",{message:"ignoring incomplete or missing media group"})},discontinuity:function(){d+=1,s.discontinuity=!0,this.manifest.discontinuityStarts.push(a.length)},"program-date-time":function(){void 0===this.manifest.dateTimeString&&(this.manifest.dateTimeString=e.dateTimeString,this.manifest.dateTimeObject=e.dateTimeObject),s.dateTimeString=e.dateTimeString,s.dateTimeObject=e.dateTimeObject},targetduration:function(){!isFinite(e.duration)||e.duration<0?this.trigger("warn",{message:"ignoring invalid target duration: "+e.duration}):this.manifest.targetDuration=e.duration},totalduration:function(){!isFinite(e.duration)||e.duration<0?this.trigger("warn",{message:"ignoring invalid total duration: "+e.duration}):this.manifest.totalDuration=e.duration},start:function(){e.attributes&&!isNaN(e.attributes["TIME-OFFSET"])?this.manifest.start={timeOffset:e.attributes["TIME-OFFSET"],precise:e.attributes.PRECISE}:this.trigger("warn",{message:"ignoring start declaration without appropriate attribute list"})},"cue-out":function(){s.cueOut=e.data},"cue-out-cont":function(){s.cueOutCont=e.data},"cue-in":function(){s.cueIn=e.data}}[e.tagType]||o).call(r)},uri:function(){s.uri=e.uri,a.push(s),this.manifest.targetDuration&&!("duration"in s)&&(this.trigger("warn",{message:"defaulting segment duration to the target duration"}),s.duration=this.manifest.targetDuration),n&&(s.key=n),s.timeline=d,i&&(s.map=i),s={}},comment:function(){},custom:function(){e.segment?(s.custom=s.custom||{},s.custom[e.customType]=e.data):(this.manifest.custom=this.manifest.custom||{},this.manifest.custom[e.customType]=e.data)}})[e.type].call(r)})),t}d(t,e);var i=t.prototype;return i.push=function(e){this.lineStream.push(e)},i.end=function(){this.lineStream.push("\n")},i.addParser=function(e){this.parseStream.addParser(e)},i.addTagMapper=function(e){this.parseStream.addTagMapper(e)},t}(we),Me={}; /*! @name m3u8-parser @version 4.5.0 @license Apache-2.0 */ /*! @name @videojs/vhs-utils @version 2.3.0 @license MIT */ Object.defineProperty(Me,"__esModule",{value:!0});var Re=/^(audio|video|application)\/(x-|vnd\.apple\.)?mpegurl/i,Ne=/^application\/dash\+xml/i,Ue=Me.simpleTypeFromSourceType=function(e){return Re.test(e)?"hls":Ne.test(e)?"dash":"application/vnd.videojs.vhs+json"===e?"vhs-json":null},Fe={},Be=/[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,je=new RegExp("[\\-\\.0-9"+Be.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),Ve=new RegExp("^"+Be.source+je.source+"*(?::"+Be.source+je.source+"*)?$");function He(){}function qe(e,t){return t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber,t}function We(e,t,i,n,r,a){for(var s,o=++t,u=0;;){var l=e.charAt(o);switch(l){case"=":if(1===u)s=e.slice(t,o),u=3;else{if(2!==u)throw new Error("attribute equal must after attrName");u=3}break;case"'":case'"':if(3===u||1===u){if(1===u&&(a.warning('attribute value must after "="'),s=e.slice(t,o)),t=o+1,!((o=e.indexOf(l,t))>0))throw new Error("attribute value no end '"+l+"' match");c=e.slice(t,o).replace(/&#?\w+;/g,r),i.add(s,c,t-1),u=5}else{if(4!=u)throw new Error('attribute value must after "="');c=e.slice(t,o).replace(/&#?\w+;/g,r),i.add(s,c,t),a.warning('attribute "'+s+'" missed start quot('+l+")!!"),t=o+1,u=5}break;case"/":switch(u){case 0:i.setTagName(e.slice(t,o));case 5:case 6:case 7:u=7,i.closed=!0;case 4:case 1:case 2:break;default:throw new Error("attribute invalid close char('/')")}break;case"":return a.error("unexpected end of input"),0==u&&i.setTagName(e.slice(t,o)),o;case">":switch(u){case 0:i.setTagName(e.slice(t,o));case 5:case 6:case 7:break;case 4:case 1:"/"===(c=e.slice(t,o)).slice(-1)&&(i.closed=!0,c=c.slice(0,-1));case 2:2===u&&(c=s),4==u?(a.warning('attribute "'+c+'" missed quot(")!!'),i.add(s,c.replace(/&#?\w+;/g,r),t)):("http://www.w3.org/1999/xhtml"===n[""]&&c.match(/^(?:disabled|checked|selected)$/i)||a.warning('attribute "'+c+'" missed value!! "'+c+'" instead!!'),i.add(c,c,t));break;case 3:throw new Error("attribute value missed!!")}return o;case"€":l=" ";default:if(l<=" ")switch(u){case 0:i.setTagName(e.slice(t,o)),u=6;break;case 1:s=e.slice(t,o),u=2;break;case 4:var c=e.slice(t,o).replace(/&#?\w+;/g,r);a.warning('attribute "'+c+'" missed quot(")!!'),i.add(s,c,t);case 5:u=6}else switch(u){case 2:i.tagName,"http://www.w3.org/1999/xhtml"===n[""]&&s.match(/^(?:disabled|checked|selected)$/i)||a.warning('attribute "'+s+'" missed value!! "'+s+'" instead2!!'),i.add(s,s,t),t=o,u=1;break;case 5:a.warning('attribute space is required"'+s+'"!!');case 6:u=1,t=o;break;case 3:u=4,t=o;break;case 7:throw new Error("elements closed character '/' and '>' must be connected to")}}o++}}function ze(e,t,i){for(var n=e.tagName,r=null,a=e.length;a--;){var s=e[a],o=s.qName,u=s.value;if((h=o.indexOf(":"))>0)var l=s.prefix=o.slice(0,h),c=o.slice(h+1),d="xmlns"===l&&c;else c=o,l=null,d="xmlns"===o&&"";s.localName=c,!1!==d&&(null==r&&(r={},Xe(i,i={})),i[d]=r[d]=u,s.uri="http://www.w3.org/2000/xmlns/",t.startPrefixMapping(d,u))}for(a=e.length;a--;){(l=(s=e[a]).prefix)&&("xml"===l&&(s.uri="http://www.w3.org/XML/1998/namespace"),"xmlns"!==l&&(s.uri=i[l||""]))}var h;(h=n.indexOf(":"))>0?(l=e.prefix=n.slice(0,h),c=e.localName=n.slice(h+1)):(l=null,c=e.localName=n);var p=e.uri=i[l||""];if(t.startElement(p,c,n,e),!e.closed)return e.currentNSMap=i,e.localNSMap=r,!0;if(t.endElement(p,c,n),r)for(l in r)t.endPrefixMapping(l)}function Ge(e,t,i,n,r){if(/^(?:script|textarea)$/i.test(i)){var a=e.indexOf("",t),s=e.substring(t+1,a);if(/[&<]/.test(s))return/^script$/i.test(i)?(r.characters(s,0,s.length),a):(s=s.replace(/&#?\w+;/g,n),r.characters(s,0,s.length),a)}return t+1}function Ke(e,t,i,n){var r=n[i];return null==r&&((r=e.lastIndexOf(""))t?(i.comment(e,t+4,r-t-4),r+3):(n.error("Unclosed comment"),-1):-1;if("CDATA["==e.substr(t+3,6)){var r=e.indexOf("]]>",t+9);return i.startCDATA(),i.characters(e,t+9,r-t-9),i.endCDATA(),r+3}var a=function(e,t){var i,n=[],r=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;r.lastIndex=t,r.exec(e);for(;i=r.exec(e);)if(n.push(i),i[1])return n}(e,t),s=a.length;if(s>1&&/!doctype/i.test(a[0][0])){var o=a[1][0],u=s>3&&/^public$/i.test(a[2][0])&&a[3][0],l=s>4&&a[4][0],c=a[s-1];return i.startDTD(o,u&&u.replace(/^(['"])(.*?)\1$/,"$2"),l&&l.replace(/^(['"])(.*?)\1$/,"$2")),i.endDTD(),c.index+c[0].length}return-1}function $e(e,t,i){var n=e.indexOf("?>",t);if(n){var r=e.substring(t,n).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);return r?(r[0].length,i.processingInstruction(r[1],r[2]),n+2):-1}return-1}function Qe(e){}function Je(e,t){return e.__proto__=t,e}He.prototype={parse:function(e,t,i){var n=this.domBuilder;n.startDocument(),Xe(t,t={}),function(e,t,i,n,r){function a(e){if(e>65535){var t=55296+((e-=65536)>>10),i=56320+(1023&e);return String.fromCharCode(t,i)}return String.fromCharCode(e)}function s(e){var t=e.slice(1,-1);return t in i?i[t]:"#"===t.charAt(0)?a(parseInt(t.substr(1).replace("x","0x"))):(r.error("entity not found:"+e),e)}function o(t){if(t>m){var i=e.substring(m,t).replace(/&#?\w+;/g,s);h&&u(m),n.characters(i,0,t-m),m=t}}function u(t,i){for(;t>=c&&(i=d.exec(e));)l=i.index,c=l+i[0].length,h.lineNumber++;h.columnNumber=t-l+1}var l=0,c=0,d=/.*(?:\r\n?|\n)|.*$/g,h=n.locator,p=[{currentNSMap:t}],f={},m=0;for(;;){try{var g=e.indexOf("<",m);if(g<0){if(!e.substr(m).match(/^\s*$/)){var v=n.doc,y=v.createTextNode(e.substr(m));v.appendChild(y),n.currentElement=y}return}switch(g>m&&o(g),e.charAt(g+1)){case"/":var _=e.indexOf(">",g+3),b=e.substring(g+2,_),T=p.pop();_<0?(b=e.substring(g+2).replace(/[\s<].*/,""),r.error("end tag name: "+b+" is not complete:"+T.tagName),_=g+1+b.length):b.match(/\sm?m=_:o(Math.max(g,m)+1)}}(e,t,i,n,this.errorHandler),n.endDocument()}},Qe.prototype={setTagName:function(e){if(!Ve.test(e))throw new Error("invalid tagName:"+e);this.tagName=e},add:function(e,t,i){if(!Ve.test(e))throw new Error("invalid attribute:"+e);this[this.length++]={qName:e,value:t,offset:i}},length:0,getLocalName:function(e){return this[e].localName},getLocator:function(e){return this[e].locator},getQName:function(e){return this[e].qName},getURI:function(e){return this[e].uri},getValue:function(e){return this[e].value}},Je({},Je.prototype)instanceof Je||(Je=function(e,t){function i(){}for(t in i.prototype=t,i=new i,e)i[t]=e[t];return i}),Fe.XMLReader=He;var Ze={};function et(e,t){for(var i in e)t[i]=e[i]}function tt(e,t){var i=e.prototype;if(Object.create){var n=Object.create(t.prototype);i.__proto__=n}if(!(i instanceof t)){function n(){}n.prototype=t.prototype,et(i,n=new n),e.prototype=i=n}i.constructor!=e&&("function"!=typeof e&&console.error("unknow Class:"+e),i.constructor=e)}var it={},nt=it.ELEMENT_NODE=1,rt=it.ATTRIBUTE_NODE=2,at=it.TEXT_NODE=3,st=it.CDATA_SECTION_NODE=4,ot=it.ENTITY_REFERENCE_NODE=5,ut=it.ENTITY_NODE=6,lt=it.PROCESSING_INSTRUCTION_NODE=7,ct=it.COMMENT_NODE=8,dt=it.DOCUMENT_NODE=9,ht=it.DOCUMENT_TYPE_NODE=10,pt=it.DOCUMENT_FRAGMENT_NODE=11,ft=it.NOTATION_NODE=12,mt={},gt={};mt.INDEX_SIZE_ERR=(gt[1]="Index size error",1),mt.DOMSTRING_SIZE_ERR=(gt[2]="DOMString size error",2);var vt=mt.HIERARCHY_REQUEST_ERR=(gt[3]="Hierarchy request error",3);mt.WRONG_DOCUMENT_ERR=(gt[4]="Wrong document",4),mt.INVALID_CHARACTER_ERR=(gt[5]="Invalid character",5),mt.NO_DATA_ALLOWED_ERR=(gt[6]="No data allowed",6),mt.NO_MODIFICATION_ALLOWED_ERR=(gt[7]="No modification allowed",7);var yt=mt.NOT_FOUND_ERR=(gt[8]="Not found",8);mt.NOT_SUPPORTED_ERR=(gt[9]="Not supported",9);var _t=mt.INUSE_ATTRIBUTE_ERR=(gt[10]="Attribute in use",10);function bt(e,t){if(t instanceof Error)var i=t;else i=this,Error.call(this,gt[e]),this.message=gt[e],Error.captureStackTrace&&Error.captureStackTrace(this,bt);return i.code=e,t&&(this.message=this.message+": "+t),i}function Tt(){}function St(e,t){this._node=e,this._refresh=t,kt(this)}function kt(e){var t=e._node._inc||e._node.ownerDocument._inc;if(e._inc!=t){var i=e._refresh(e._node);ti(e,"length",i.length),et(i,e),e._inc=t}}function Ct(){}function Et(e,t){for(var i=e.length;i--;)if(e[i]===t)return i}function wt(e,t,i,n){if(n?t[Et(t,n)]=i:t[t.length++]=i,e){i.ownerElement=e;var r=e.ownerDocument;r&&(n&&Ot(r,e,n),function(e,t,i){e&&e._inc++,"http://www.w3.org/2000/xmlns/"==i.namespaceURI&&(t._nsMap[i.prefix?i.localName:""]=i.value)}(r,e,i))}}function It(e,t,i){var n=Et(t,i);if(!(n>=0))throw bt(yt,new Error(e.tagName+"@"+i));for(var r=t.length-1;n"==e&&">")||"&"==e&&"&"||'"'==e&&"""||"&#"+e.charCodeAt()+";"}function Lt(e,t){if(t(e))return!0;if(e=e.firstChild)do{if(Lt(e,t))return!0}while(e=e.nextSibling)}function Dt(){}function Ot(e,t,i,n){e&&e._inc++,"http://www.w3.org/2000/xmlns/"==i.namespaceURI&&delete t._nsMap[i.prefix?i.localName:""]}function Mt(e,t,i){if(e&&e._inc){e._inc++;var n=t.childNodes;if(i)n[n.length++]=i;else{for(var r=t.firstChild,a=0;r;)n[a++]=r,r=r.nextSibling;n.length=a}}}function Rt(e,t){var i=t.previousSibling,n=t.nextSibling;return i?i.nextSibling=n:e.firstChild=n,n?n.previousSibling=i:e.lastChild=i,Mt(e.ownerDocument,e),t}function Nt(e,t,i){var n=t.parentNode;if(n&&n.removeChild(t),t.nodeType===pt){var r=t.firstChild;if(null==r)return t;var a=t.lastChild}else r=a=t;var s=i?i.previousSibling:e.lastChild;r.previousSibling=s,a.nextSibling=i,s?s.nextSibling=r:e.firstChild=r,null==i?e.lastChild=a:i.previousSibling=a;do{r.parentNode=e}while(r!==a&&(r=r.nextSibling));return Mt(e.ownerDocument||e,e),t.nodeType==pt&&(t.firstChild=t.lastChild=null),t}function Ut(){this._nsMap={}}function Ft(){}function Bt(){}function jt(){}function Vt(){}function Ht(){}function qt(){}function Wt(){}function zt(){}function Gt(){}function Kt(){}function Xt(){}function Yt(){}function $t(e,t){var i=[],n=9==this.nodeType?this.documentElement:this,r=n.prefix,a=n.namespaceURI;if(a&&null==r&&null==(r=n.lookupPrefix(a)))var s=[{namespace:a,prefix:null}];return Jt(this,i,e,t,s),i.join("")}function Qt(e,t,i){var n=e.prefix||"",r=e.namespaceURI;if(!n&&!r)return!1;if("xml"===n&&"http://www.w3.org/XML/1998/namespace"===r||"http://www.w3.org/2000/xmlns/"==r)return!1;for(var a=i.length;a--;){var s=i[a];if(s.prefix==n)return s.namespace!=r}return!0}function Jt(e,t,i,n,r){if(n){if(!(e=n(e)))return;if("string"==typeof e)return void t.push(e)}switch(e.nodeType){case nt:r||(r=[]),r.length;var a=e.attributes,s=a.length,o=e.firstChild,u=e.tagName;i="http://www.w3.org/1999/xhtml"===e.namespaceURI||i,t.push("<",u);for(var l=0;l"),i&&/^script$/i.test(u))for(;o;)o.data?t.push(o.data):Jt(o,t,i,n,r),o=o.nextSibling;else for(;o;)Jt(o,t,i,n,r),o=o.nextSibling;t.push("")}else t.push("/>");return;case dt:case pt:for(o=e.firstChild;o;)Jt(o,t,i,n,r),o=o.nextSibling;return;case rt:return t.push(" ",e.name,'="',e.value.replace(/[<&"]/g,Pt),'"');case at:return t.push(e.data.replace(/[<&]/g,Pt));case st:return t.push("");case ct:return t.push("\x3c!--",e.data,"--\x3e");case ht:var f=e.publicId,m=e.systemId;if(t.push("');else if(m&&"."!=m)t.push(' SYSTEM "',m,'">');else{var g=e.internalSubset;g&&t.push(" [",g,"]"),t.push(">")}return;case lt:return t.push("");case ot:return t.push("&",e.nodeName,";");default:t.push("??",e.nodeName)}}function Zt(e,t,i){var n;switch(t.nodeType){case nt:(n=t.cloneNode(!1)).ownerDocument=e;case pt:break;case rt:i=!0}if(n||(n=t.cloneNode(!1)),n.ownerDocument=e,n.parentNode=null,i)for(var r=t.firstChild;r;)n.appendChild(Zt(e,r,i)),r=r.nextSibling;return n}function ei(e,t,i){var n=new t.constructor;for(var r in t){var a=t[r];"object"!=typeof a&&a!=n[r]&&(n[r]=a)}switch(t.childNodes&&(n.childNodes=new Tt),n.ownerDocument=e,n.nodeType){case nt:var s=t.attributes,o=n.attributes=new Ct,u=s.length;o._ownerElement=n;for(var l=0;l0},lookupPrefix:function(e){for(var t=this;t;){var i=t._nsMap;if(i)for(var n in i)if(i[n]==e)return n;t=t.nodeType==rt?t.ownerDocument:t.parentNode}return null},lookupNamespaceURI:function(e){for(var t=this;t;){var i=t._nsMap;if(i&&e in i)return i[e];t=t.nodeType==rt?t.ownerDocument:t.parentNode}return null},isDefaultNamespace:function(e){return null==this.lookupPrefix(e)}},et(it,xt),et(it,xt.prototype),Dt.prototype={nodeName:"#document",nodeType:dt,doctype:null,documentElement:null,_inc:1,insertBefore:function(e,t){if(e.nodeType==pt){for(var i=e.firstChild;i;){var n=i.nextSibling;this.insertBefore(i,t),i=n}return e}return null==this.documentElement&&e.nodeType==nt&&(this.documentElement=e),Nt(this,e,t),e.ownerDocument=this,e},removeChild:function(e){return this.documentElement==e&&(this.documentElement=null),Rt(this,e)},importNode:function(e,t){return Zt(this,e,t)},getElementById:function(e){var t=null;return Lt(this.documentElement,(function(i){if(i.nodeType==nt&&i.getAttribute("id")==e)return t=i,!0})),t},createElement:function(e){var t=new Ut;return t.ownerDocument=this,t.nodeName=e,t.tagName=e,t.childNodes=new Tt,(t.attributes=new Ct)._ownerElement=t,t},createDocumentFragment:function(){var e=new Kt;return e.ownerDocument=this,e.childNodes=new Tt,e},createTextNode:function(e){var t=new jt;return t.ownerDocument=this,t.appendData(e),t},createComment:function(e){var t=new Vt;return t.ownerDocument=this,t.appendData(e),t},createCDATASection:function(e){var t=new Ht;return t.ownerDocument=this,t.appendData(e),t},createProcessingInstruction:function(e,t){var i=new Xt;return i.ownerDocument=this,i.tagName=i.target=e,i.nodeValue=i.data=t,i},createAttribute:function(e){var t=new Ft;return t.ownerDocument=this,t.name=e,t.nodeName=e,t.localName=e,t.specified=!0,t},createEntityReference:function(e){var t=new Gt;return t.ownerDocument=this,t.nodeName=e,t},createElementNS:function(e,t){var i=new Ut,n=t.split(":"),r=i.attributes=new Ct;return i.childNodes=new Tt,i.ownerDocument=this,i.nodeName=t,i.tagName=t,i.namespaceURI=e,2==n.length?(i.prefix=n[0],i.localName=n[1]):i.localName=t,r._ownerElement=i,i},createAttributeNS:function(e,t){var i=new Ft,n=t.split(":");return i.ownerDocument=this,i.nodeName=t,i.name=t,i.namespaceURI=e,i.specified=!0,2==n.length?(i.prefix=n[0],i.localName=n[1]):i.localName=t,i}},tt(Dt,xt),Ut.prototype={nodeType:nt,hasAttribute:function(e){return null!=this.getAttributeNode(e)},getAttribute:function(e){var t=this.getAttributeNode(e);return t&&t.value||""},getAttributeNode:function(e){return this.attributes.getNamedItem(e)},setAttribute:function(e,t){var i=this.ownerDocument.createAttribute(e);i.value=i.nodeValue=""+t,this.setAttributeNode(i)},removeAttribute:function(e){var t=this.getAttributeNode(e);t&&this.removeAttributeNode(t)},appendChild:function(e){return e.nodeType===pt?this.insertBefore(e,null):function(e,t){var i=t.parentNode;if(i){var n=e.lastChild;i.removeChild(t),n=e.lastChild}return n=e.lastChild,t.parentNode=e,t.previousSibling=n,t.nextSibling=null,n?n.nextSibling=t:e.firstChild=t,e.lastChild=t,Mt(e.ownerDocument,e,t),t}(this,e)},setAttributeNode:function(e){return this.attributes.setNamedItem(e)},setAttributeNodeNS:function(e){return this.attributes.setNamedItemNS(e)},removeAttributeNode:function(e){return this.attributes.removeNamedItem(e.nodeName)},removeAttributeNS:function(e,t){var i=this.getAttributeNodeNS(e,t);i&&this.removeAttributeNode(i)},hasAttributeNS:function(e,t){return null!=this.getAttributeNodeNS(e,t)},getAttributeNS:function(e,t){var i=this.getAttributeNodeNS(e,t);return i&&i.value||""},setAttributeNS:function(e,t,i){var n=this.ownerDocument.createAttributeNS(e,t);n.value=n.nodeValue=""+i,this.setAttributeNode(n)},getAttributeNodeNS:function(e,t){return this.attributes.getNamedItemNS(e,t)},getElementsByTagName:function(e){return new St(this,(function(t){var i=[];return Lt(t,(function(n){n===t||n.nodeType!=nt||"*"!==e&&n.tagName!=e||i.push(n)})),i}))},getElementsByTagNameNS:function(e,t){return new St(this,(function(i){var n=[];return Lt(i,(function(r){r===i||r.nodeType!==nt||"*"!==e&&r.namespaceURI!==e||"*"!==t&&r.localName!=t||n.push(r)})),n}))}},Dt.prototype.getElementsByTagName=Ut.prototype.getElementsByTagName,Dt.prototype.getElementsByTagNameNS=Ut.prototype.getElementsByTagNameNS,tt(Ut,xt),Ft.prototype.nodeType=rt,tt(Ft,xt),Bt.prototype={data:"",substringData:function(e,t){return this.data.substring(e,e+t)},appendData:function(e){e=this.data+e,this.nodeValue=this.data=e,this.length=e.length},insertData:function(e,t){this.replaceData(e,0,t)},appendChild:function(e){throw new Error(gt[vt])},deleteData:function(e,t){this.replaceData(e,t,"")},replaceData:function(e,t,i){i=this.data.substring(0,e)+i+this.data.substring(e+t),this.nodeValue=this.data=i,this.length=i.length}},tt(Bt,xt),jt.prototype={nodeName:"#text",nodeType:at,splitText:function(e){var t=this.data,i=t.substring(e);t=t.substring(0,e),this.data=this.nodeValue=t,this.length=t.length;var n=this.ownerDocument.createTextNode(i);return this.parentNode&&this.parentNode.insertBefore(n,this.nextSibling),n}},tt(jt,Bt),Vt.prototype={nodeName:"#comment",nodeType:ct},tt(Vt,Bt),Ht.prototype={nodeName:"#cdata-section",nodeType:st},tt(Ht,Bt),qt.prototype.nodeType=ht,tt(qt,xt),Wt.prototype.nodeType=ft,tt(Wt,xt),zt.prototype.nodeType=ut,tt(zt,xt),Gt.prototype.nodeType=ot,tt(Gt,xt),Kt.prototype.nodeName="#document-fragment",Kt.prototype.nodeType=pt,tt(Kt,xt),Xt.prototype.nodeType=lt,tt(Xt,xt),Yt.prototype.serializeToString=function(e,t,i){return $t.call(e,t,i)},xt.prototype.toString=$t;try{if(Object.defineProperty){function e(t){switch(t.nodeType){case nt:case pt:var i=[];for(t=t.firstChild;t;)7!==t.nodeType&&8!==t.nodeType&&i.push(e(t)),t=t.nextSibling;return i.join("");default:return t.nodeValue}}Object.defineProperty(St.prototype,"length",{get:function(){return kt(this),this.$$length}}),Object.defineProperty(xt.prototype,"textContent",{get:function(){return e(this)},set:function(e){switch(this.nodeType){case nt:case pt:for(;this.firstChild;)this.removeChild(this.firstChild);(e||String(e))&&this.appendChild(this.ownerDocument.createTextNode(e));break;default:this.data=e,this.value=e,this.nodeValue=e}}}),ti=function(e,t,i){e["$$"+t]=i}}}catch(e){}function ii(e){this.options=e||{locator:{}}}function ni(){this.cdata=!1}function ri(e,t){t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber}function ai(e){if(e)return"\n@"+(e.systemId||"")+"#[line:"+e.lineNumber+",col:"+e.columnNumber+"]"}function si(e,t,i){return"string"==typeof e?e.substr(t,i):e.length>=t+i||t?new java.lang.String(e,t,i)+"":e}function oi(e,t){e.currentElement?e.currentElement.appendChild(t):e.doc.appendChild(t)}Ze.DOMImplementation=At,Ze.XMLSerializer=Yt,ii.prototype.parseFromString=function(e,t){var i=this.options,n=new ui,r=i.domBuilder||new ni,a=i.errorHandler,s=i.locator,o=i.xmlns||{},u={lt:"<",gt:">",amp:"&",quot:'"',apos:"'"};return s&&r.setDocumentLocator(s),n.errorHandler=function(e,t,i){if(!e){if(t instanceof ni)return t;e=t}var n={},r=e instanceof Function;function a(t){var a=e[t];!a&&r&&(a=2==e.length?function(i){e(t,i)}:e),n[t]=a&&function(e){a("[xmldom "+t+"]\t"+e+ai(i))}||function(){}}return i=i||{},a("warning"),a("error"),a("fatalError"),n}(a,r,s),n.domBuilder=i.domBuilder||r,/\/x?html?$/.test(t)&&(u.nbsp=" ",u.copy="©",o[""]="http://www.w3.org/1999/xhtml"),o.xml=o.xml||"http://www.w3.org/XML/1998/namespace",e?n.parse(e,o,u):n.errorHandler.error("invalid doc source"),r.doc},ni.prototype={startDocument:function(){this.doc=(new li).createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(e,t,i,n){var r=this.doc,a=r.createElementNS(e,i||t),s=n.length;oi(this,a),this.currentElement=a,this.locator&&ri(this.locator,a);for(var o=0;o=0&&(p.minimumUpdatePeriod=1e3*l),t&&(p.locations=t),"dynamic"===o&&(p.suggestedPresentationDelay=u),d.length&&(p.mediaGroups.AUDIO.audio=function(e,t){var i;void 0===t&&(t={});var n=e.reduce((function(e,n){var r=n.attributes.role&&n.attributes.role.value||"",a=n.attributes.lang||"",s="main";if(a){var o=r?" ("+r+")":"";s=""+n.attributes.lang+o}return e[s]&&e[s].playlists[0].attributes.BANDWIDTH>n.attributes.bandwidth||(e[s]={language:a,autoselect:!0,default:"main"===r,playlists:Ii([Ai(n)],t),uri:""},void 0===i&&"main"===r&&((i=n).default=!0)),e}),{});return i||(n[Object.keys(n)[0]].default=!0),n}(d,i)),h.length&&(p.mediaGroups.SUBTITLES.subs=function(e,t){return void 0===t&&(t={}),e.reduce((function(e,i){var n=i.attributes.lang||"text";return e[n]||(e[n]={language:n,default:!1,autoselect:!1,playlists:Ii([xi(i)],t),uri:""}),e}),{})}(h,i)),p},Di=function(e,t,i){var n=e.NOW,r=e.clientOffset,a=e.availabilityStartTime,s=e.timescale,o=void 0===s?1:s,u=e.start,l=void 0===u?0:u,c=e.minimumUpdatePeriod,d=(n+r)/1e3+(void 0===c?0:c)-(a+l);return Math.ceil((d*o-t)/i)},Oi=function(e,t){for(var i=e.type,n=void 0===i?"static":i,r=e.minimumUpdatePeriod,a=void 0===r?0:r,s=e.media,o=void 0===s?"":s,u=e.sourceDuration,l=e.timescale,c=void 0===l?1:l,d=e.startNumber,h=void 0===d?1:d,p=e.periodIndex,f=[],m=-1,g=0;gm&&(m=b);var T=void 0;if(_<0){var S=g+1;T=S===t.length?"dynamic"===n&&a>0&&o.indexOf("$Number$")>0?Di(e,m,y):(u*c-m)/y:(t[S].t-m)/y}else T=_+1;for(var k=h+f.length+T,C=h+f.length;C=r?a:""+new Array(r-a.length+1).join("0")+a)}}(t))},Ni=function(e,t){var i={RepresentationID:e.id,Bandwidth:e.bandwidth||0},n=e.initialization,r=void 0===n?{sourceURL:"",range:""}:n,a=Ti({baseUrl:e.baseUrl,source:Ri(r.sourceURL,i),range:r.range}),s=function(e,t){return e.duration||t?e.duration?ki(e):Oi(e,t):[{number:e.startNumber||1,duration:e.sourceDuration,time:0,timeline:e.periodIndex}]}(e,t);return s.map((function(t){i.Number=t.number,i.Time=t.time;var n=Ri(e.media||"",i);return{uri:n,timeline:t.timeline,duration:t.duration,resolvedUri:Ce(e.baseUrl||"",n),map:a,number:t.number}}))},Ui=function(e,t){var i=e.duration,n=e.segmentUrls,r=void 0===n?[]:n;if(!i&&!t||i&&t)throw new Error(_i);var a,s=r.map((function(t){return function(e,t){var i=e.baseUrl,n=e.initialization,r=void 0===n?{}:n,a=Ti({baseUrl:i,source:r.sourceURL,range:r.range}),s=Ti({baseUrl:i,source:t.media,range:t.mediaRange});return s.map=a,s}(e,t)}));return i&&(a=ki(e)),t&&(a=Oi(e,t)),a.map((function(e,t){if(s[t]){var i=s[t];return i.timeline=e.timeline,i.duration=e.duration,i.number=e.number,i}})).filter((function(e){return e}))},Fi=function(e){var t,i,n=e.attributes,r=e.segmentInfo;r.template?(i=Ni,t=hi(n,r.template)):r.base?(i=Ci,t=hi(n,r.base)):r.list&&(i=Ui,t=hi(n,r.list));var a={attributes:n};if(!i)return a;var s=i(t,r.timeline);if(t.duration){var o=t,u=o.duration,l=o.timescale,c=void 0===l?1:l;t.duration=u/c}else s.length?t.duration=s.reduce((function(e,t){return Math.max(e,Math.ceil(t.duration))}),0):t.duration=0;return a.attributes=t,a.segments=s,r.base&&t.indexRange&&(a.sidx=s[0],a.segments=[]),a},Bi=function(e,t){return fi(e.childNodes).filter((function(e){return e.tagName===t}))},ji=function(e){return e.textContent.trim()},Vi=function(e){var t=/P(?:(\d*)Y)?(?:(\d*)M)?(?:(\d*)D)?(?:T(?:(\d*)H)?(?:(\d*)M)?(?:([\d.]*)S)?)?/.exec(e);if(!t)return 0;var i=t.slice(1),n=i[0],r=i[1],a=i[2],s=i[3],o=i[4],u=i[5];return 31536e3*parseFloat(n||0)+2592e3*parseFloat(r||0)+86400*parseFloat(a||0)+3600*parseFloat(s||0)+60*parseFloat(o||0)+parseFloat(u||0)},Hi={mediaPresentationDuration:function(e){return Vi(e)},availabilityStartTime:function(e){return/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/.test(t=e)&&(t+="Z"),Date.parse(t)/1e3;var t},minimumUpdatePeriod:function(e){return Vi(e)},suggestedPresentationDelay:function(e){return Vi(e)},type:function(e){return e},timeShiftBufferDepth:function(e){return Vi(e)},start:function(e){return Vi(e)},width:function(e){return parseInt(e,10)},height:function(e){return parseInt(e,10)},bandwidth:function(e){return parseInt(e,10)},startNumber:function(e){return parseInt(e,10)},timescale:function(e){return parseInt(e,10)},duration:function(e){var t=parseInt(e,10);return isNaN(t)?Vi(e):t},d:function(e){return parseInt(e,10)},t:function(e){return parseInt(e,10)},r:function(e){return parseInt(e,10)},DEFAULT:function(e){return e}},qi=function(e){return e&&e.attributes?fi(e.attributes).reduce((function(e,t){var i=Hi[t.name]||Hi.DEFAULT;return e[t.name]=i(t.value),e}),{}):{}},Wi={"urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b":"org.w3.clearkey","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed":"com.widevine.alpha","urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95":"com.microsoft.playready","urn:uuid:f239e769-efa3-4850-9c16-a903c6932efb":"com.adobe.primetime"},zi=function(e,t){return t.length?pi(e.map((function(e){return t.map((function(t){return Ce(e,ji(t))}))}))):e},Gi=function(e){var t=Bi(e,"SegmentTemplate")[0],i=Bi(e,"SegmentList")[0],n=i&&Bi(i,"SegmentURL").map((function(e){return hi({tag:"SegmentURL"},qi(e))})),r=Bi(e,"SegmentBase")[0],a=i||t,s=a&&Bi(a,"SegmentTimeline")[0],o=i||r||t,u=o&&Bi(o,"Initialization")[0],l=t&&qi(t);l&&u?l.initialization=u&&qi(u):l&&l.initialization&&(l.initialization={sourceURL:l.initialization});var c={template:l,timeline:s&&Bi(s,"S").map((function(e){return qi(e)})),list:i&&hi(qi(i),{segmentUrls:n,initialization:qi(u)}),base:r&&hi(qi(r),{initialization:qi(u)})};return Object.keys(c).forEach((function(e){c[e]||delete c[e]})),c},Ki=function(e,t,i){return function(n){var r=qi(n),a=zi(t,Bi(n,"BaseURL")),s=Bi(n,"Role")[0],o={role:qi(s)},u=hi(e,r,o),l=Bi(n,"ContentProtection").reduce((function(e,t){var i=qi(t),n=Wi[i.schemeIdUri];if(n){e[n]={attributes:i};var r=Bi(t,"cenc:pssh")[0];if(r){var a=ji(r),s=a&&xe(a);e[n].pssh=s}}return e}),{});Object.keys(l).length&&(u=hi(u,{contentProtection:l}));var c=Gi(n),d=Bi(n,"Representation"),h=hi(i,c);return pi(d.map(function(e,t,i){return function(n){var r=Bi(n,"BaseURL"),a=zi(t,r),s=hi(e,qi(n)),o=Gi(n);return a.map((function(e){return{segmentInfo:hi(i,o),attributes:hi(s,{baseUrl:e})}}))}}(u,a,h)))}},Xi=function(e,t){return function(i,r){var a=zi(t,Bi(i,"BaseURL")),s=qi(i),o=parseInt(s.id,10),u=n.isNaN(o)?r:o,l=hi(e,{periodIndex:u}),c=Bi(i,"AdaptationSet"),d=Gi(i);return pi(c.map(Ki(l,a,d)))}},Yi=function(e){if(""===e)throw new Error(gi);var t=(new ci).parseFromString(e,"application/xml"),i=t&&"MPD"===t.documentElement.tagName?t.documentElement:null;if(!i||i&&i.getElementsByTagName("parsererror").length>0)throw new Error(vi);return i},$i=function(e,t){void 0===t&&(t={});var i=function(e,t){void 0===t&&(t={});var i=t,n=i.manifestUri,r=void 0===n?"":n,a=i.NOW,s=void 0===a?Date.now():a,o=i.clientOffset,u=void 0===o?0:o,l=Bi(e,"Period");if(!l.length)throw new Error(mi);var c=Bi(e,"Location"),d=qi(e),h=zi([r],Bi(e,"BaseURL"));return d.sourceDuration=d.mediaPresentationDuration||0,d.NOW=s,d.clientOffset=u,c.length&&(d.locations=c.map(ji)),{locations:d.locations,representationInfo:pi(l.map(Xi(d,h)))}}(Yi(e),t),n=i.representationInfo.map(Fi);return Li(n,i.locations,t.sidxMapping)},Qi=function(e){return function(e){var t=Bi(e,"UTCTiming")[0];if(!t)return null;var i=qi(t);switch(i.schemeIdUri){case"urn:mpeg:dash:utc:http-head:2014":case"urn:mpeg:dash:utc:http-head:2012":i.method="HEAD";break;case"urn:mpeg:dash:utc:http-xsdate:2014":case"urn:mpeg:dash:utc:http-iso:2014":case"urn:mpeg:dash:utc:http-xsdate:2012":case"urn:mpeg:dash:utc:http-iso:2012":i.method="GET";break;case"urn:mpeg:dash:utc:direct:2014":case"urn:mpeg:dash:utc:direct:2012":i.method="DIRECT",i.value=Date.parse(i.value);break;default:throw new Error(bi)}return i}(Yi(e))},Ji=function(e){var t,i=new DataView(e.buffer,e.byteOffset,e.byteLength),n={version:e[0],flags:new Uint8Array(e.subarray(1,4)),references:[],referenceId:i.getUint32(4),timescale:i.getUint32(8),earliestPresentationTime:i.getUint32(12),firstOffset:i.getUint32(16)},r=i.getUint16(22);for(t=24;r;t+=12,r--)n.references.push({referenceType:(128&e[t])>>>7,referencedSize:2147483647&i.getUint32(t),subsegmentDuration:i.getUint32(t+4),startsWithSap:!!(128&e[t+8]),sapType:(112&e[t+8])>>>4,sapDeltaTime:268435455&i.getUint32(t+8)});return n},Zi={}; /*! @name @videojs/vhs-utils @version 2.3.0 @license MIT */ Object.defineProperty(Zi,"__esModule",{value:!0});var en=function(e){return e instanceof Uint8Array?e:new Uint8Array(e&&e.buffer||e,e&&e.byteOffset||0,e&&e.byteLength||0)},tn=function(e){if(!e)return"";e=Array.prototype.slice.call(e);var t=String.fromCharCode.apply(null,en(e));try{return decodeURIComponent(escape(t))}catch(e){}return t},nn=function(e,t){void 0===t&&(t=0);var i=(e=en(e))[t+6]<<21|e[t+7]<<14|e[t+8]<<7|e[t+9];return(16&e[t+5])>>4?i+20:i+10},rn=function e(t,i){return void 0===i&&(i=0),(t=en(t)).length-i<10||"ID3"!==tn(t.subarray(i,i+3))?i:e(t,i+=nn(t,i))},an={aac:function(e){var t=rn(e);return e.length>=t+2&&255==(255&e[t])&&224==(224&e[t+1])&&16==(22&e[t+1])},mp3:function(e){var t=rn(e);return e.length>=t+2&&255==(255&e[t])&&224==(224&e[t+1])&&2==(6&e[t+1])},webm:function(e){return e.length>=4&&26==(255&e[0])&&69==(255&e[1])&&223==(255&e[2])&&163==(255&e[3])},mp4:function(e){return e.length>=8&&/^(f|s)typ$/.test(tn(e.subarray(4,8)))&&!/^ftyp3g$/.test(tn(e.subarray(4,10)))},"3gp":function(e){return e.length>=10&&/^ftyp3g$/.test(tn(e.subarray(4,10)))},ts:function(e){if(e.length<189&&e.length>=1)return 71===e[0];for(var t=0;t+188=4&&/^fLaC$/.test(tn(e.subarray(0,4)))},ogg:function(e){return e.length>=4&&/^OggS$/.test(tn(e.subarray(0,4)))}},sn=Object.keys(an).filter((function(e){return"ts"!==e})).concat("ts");sn.forEach((function(e){var t=an[e];an[e]=function(e){return t(en(e))}}));var on=Zi.detectContainerForBytes=function(e){e=en(e);for(var t=0;t>>0;if("moof"===tn(e.subarray(t+4,t+8)))return!0;0===i||i+t>e.length?t=e.length:t+=i}return!1},cn={}; /*! @name @videojs/vhs-utils @version 2.3.0 @license MIT */ Object.defineProperty(cn,"__esModule",{value:!0});var dn=function(e){return e instanceof Uint8Array?e:new Uint8Array(e&&e.buffer||e,e&&e.byteOffset||0,e&&e.byteLength||0)};cn.bytesToString=function(e){if(!e)return"";e=Array.prototype.slice.call(e);var t=String.fromCharCode.apply(null,dn(e));try{return decodeURIComponent(escape(t))}catch(e){}return t};var hn=cn.concatTypedArrays=function(){for(var e=arguments.length,t=new Array(e),i=0;i-1)},this.trigger=function(t){var i,n,r,a;if(i=e[t])if(2===arguments.length)for(r=i.length,n=0;nt&&(i=-1);Math.abs(t-e)>4294967296;)e+=8589934592*i;return e},bn=function(e){var t,i;bn.prototype.init.call(this),this.type_=e||yn,this.push=function(e){this.type_!==yn&&e.type!==this.type_||(void 0===i&&(i=e.dts),e.dts=_n(e.dts,i),e.pts=_n(e.pts,i),t=e.dts,this.trigger("data",e))},this.flush=function(){i=t,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.discontinuity=function(){i=void 0,t=void 0},this.reset=function(){this.discontinuity(),this.trigger("reset")}};bn.prototype=new vn;var Tn,Sn,kn,Cn,En=mn,wn=function(e){var t=31&e[1];return t<<=8,t|=e[2]},In=function(e){return!!(64&e[1])},An=function(e){var t=0;return(48&e[3])>>>4>1&&(t+=e[4]+1),t},xn=function(e){switch(e){case 5:return"slice_layer_without_partitioning_rbsp_idr";case 6:return"sei_rbsp";case 7:return"seq_parameter_set_rbsp";case 8:return"pic_parameter_set_rbsp";case 9:return"access_unit_delimiter_rbsp";default:return null}},Pn={parseType:function(e,t){var i=wn(e);return 0===i?"pat":i===t?"pmt":t?"pes":null},parsePat:function(e){var t=In(e),i=4+An(e);return t&&(i+=e[i]+1),(31&e[i+10])<<8|e[i+11]},parsePmt:function(e){var t={},i=In(e),n=4+An(e);if(i&&(n+=e[n]+1),1&e[n+5]){var r;r=3+((15&e[n+1])<<8|e[n+2])-4;for(var a=12+((15&e[n+10])<<8|e[n+11]);a=e.byteLength)return null;var i,n=null;return 192&(i=e[t+7])&&((n={}).pts=(14&e[t+9])<<27|(255&e[t+10])<<20|(254&e[t+11])<<12|(255&e[t+12])<<5|(254&e[t+13])>>>3,n.pts*=4,n.pts+=(6&e[t+13])>>>1,n.dts=n.pts,64&i&&(n.dts=(14&e[t+14])<<27|(255&e[t+15])<<20|(254&e[t+16])<<12|(255&e[t+17])<<5|(254&e[t+18])>>>3,n.dts*=4,n.dts+=(6&e[t+18])>>>1)),n},videoPacketContainsKeyFrame:function(e){for(var t=4+An(e),i=e.subarray(t),n=0,r=0,a=!1;r3&&"slice_layer_without_partitioning_rbsp_idr"===xn(31&i[r+3])&&(a=!0),a}},Ln=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],Dn=function(e,t){var i=e[t+6]<<21|e[t+7]<<14|e[t+8]<<7|e[t+9];return i=i>=0?i:0,(16&e[t+5])>>4?i+20:i+10},On=function(e,t){return e.length-t<10||e[t]!=="I".charCodeAt(0)||e[t+1]!=="D".charCodeAt(0)||e[t+2]!=="3".charCodeAt(0)?t:(t+=Dn(e,t),On(e,t))},Mn=function(e){return e[0]<<21|e[1]<<14|e[2]<<7|e[3]},Rn={isLikelyAacData:function(e){var t=On(e,0);return e.length>=t+2&&255==(255&e[t])&&240==(240&e[t+1])&&16==(22&e[t+1])},parseId3TagSize:Dn,parseAdtsSize:function(e,t){var i=(224&e[t+5])>>5,n=e[t+4]<<3;return 6144&e[t+3]|n|i},parseType:function(e,t){return e[t]==="I".charCodeAt(0)&&e[t+1]==="D".charCodeAt(0)&&e[t+2]==="3".charCodeAt(0)?"timed-metadata":!0&e[t]&&240==(240&e[t+1])?"audio":null},parseSampleRate:function(e){for(var t=0;t+5>>2];t++}return null},parseAacTimestamp:function(e){var t,i,n;t=10,64&e[5]&&(t+=4,t+=Mn(e.subarray(10,14)));do{if((i=Mn(e.subarray(t+4,t+8)))<1)return null;if("PRIV"===String.fromCharCode(e[t],e[t+1],e[t+2],e[t+3])){n=e.subarray(t+10,t+i+10);for(var r=0;r>>2;return o*=4,o+=3&s[7]}break}}t+=10,t+=i}while(t=0;)if(e[o]!==Gn||e[u]!==Gn&&u!==e.byteLength)o--,u--;else{if(n=e.subarray(o,u),"pes"===jn.ts.parseType(n,t.pid))r=jn.ts.parsePesType(n,t.table),a=jn.ts.parsePayloadUnitStartIndicator(n),"audio"===r&&a&&(s=jn.ts.parsePesTime(n))&&(s.type="audio",i.audio.push(s),l=!0);if(l)break;o-=zn,u-=zn}},Xn=function(e,t,i){for(var n,r,a,s,o,u,l,c=0,d=zn,h=!1,p={data:[],size:0};d=0;)if(e[c]!==Gn||e[d]!==Gn)c--,d--;else{if(n=e.subarray(c,d),"pes"===jn.ts.parseType(n,t.pid))r=jn.ts.parsePesType(n,t.table),a=jn.ts.parsePayloadUnitStartIndicator(n),"video"===r&&a&&(s=jn.ts.parsePesTime(n))&&(s.type="video",i.video.push(s),h=!0);if(h)break;c-=zn,d-=zn}},Yn=function(e){var t={pid:null,table:null},i={};for(var n in function(e,t){for(var i,n=0,r=zn;r=3;){switch(jn.aac.parseType(e,o)){case"timed-metadata":if(e.length-o<10){i=!0;break}if((s=jn.aac.parseId3TagSize(e,o))>e.length){i=!0;break}null===a&&(t=e.subarray(o,o+s),a=jn.aac.parseAacTimestamp(t)),o+=s;break;case"audio":if(e.length-o<7){i=!0;break}if((s=jn.aac.parseAdtsSize(e,o))>e.length){i=!0;break}null===r&&(t=e.subarray(o,o+s),r=jn.aac.parseSampleRate(t)),n++,o+=s;break;default:o++}if(i)return null}if(null===r||null===a)return null;var u=Wn/r;return{audio:[{type:"audio",dts:a,pts:a},{type:"audio",dts:a+1024*n*u,pts:a+1024*n*u}]}}(e):Yn(e),i&&(i.audio||i.video)?(function(e,t){if(e.audio&&e.audio.length){var i=t;void 0===i&&(i=e.audio[0].dts),e.audio.forEach((function(e){e.dts=Bn(e.dts,i),e.pts=Bn(e.pts,i),e.dtsTime=e.dts/Wn,e.ptsTime=e.pts/Wn}))}if(e.video&&e.video.length){var n=t;if(void 0===n&&(n=e.video[0].dts),e.video.forEach((function(e){e.dts=Bn(e.dts,n),e.pts=Bn(e.pts,n),e.dtsTime=e.dts/Wn,e.ptsTime=e.pts/Wn})),e.firstKeyFrame){var r=e.firstKeyFrame;r.dts=Bn(r.dts,n),r.pts=Bn(r.pts,n),r.dtsTime=r.dts/Wn,r.ptsTime=r.dts/Wn}}}(i,t),i):null},Qn=function(e){return e>>>0},Jn=function(e){var t="";return t+=String.fromCharCode(e[0]),t+=String.fromCharCode(e[1]),t+=String.fromCharCode(e[2]),t+=String.fromCharCode(e[3])},Zn=Qn,er=Jn,tr=function(e,t){var i,n,r,a,s,o=[];if(!t.length)return null;for(i=0;i1?i+n:e.byteLength,r===t[0]&&(1===t.length?o.push(e.subarray(i+8,a)):(s=tr(e.subarray(i+8,a),t.slice(1))).length&&(o=o.concat(s))),i=a;return o},ir=function(e){var t,i=new DataView(e.buffer,e.byteOffset,e.byteLength),n={version:e[0],flags:new Uint8Array(e.subarray(1,4)),trackId:i.getUint32(4)},r=1&n.flags[2],a=2&n.flags[2],s=8&n.flags[2],o=16&n.flags[2],u=32&n.flags[2],l=65536&n.flags[0],c=131072&n.flags[0];return t=8,r&&(t+=4,n.baseDataOffset=i.getUint32(12),t+=4),a&&(n.sampleDescriptionIndex=i.getUint32(t),t+=4),s&&(n.defaultSampleDuration=i.getUint32(t),t+=4),o&&(n.defaultSampleSize=i.getUint32(t),t+=4),u&&(n.defaultSampleFlags=i.getUint32(t)),l&&(n.durationIsEmpty=!0),!r&&c&&(n.baseDataOffsetIsMoof=!0),n},nr=function(e){return{isLeading:(12&e[0])>>>2,dependsOn:3&e[0],isDependedOn:(192&e[1])>>>6,hasRedundancy:(48&e[1])>>>4,paddingValue:(14&e[1])>>>1,isNonSyncSample:1&e[1],degradationPriority:e[2]<<8|e[3]}},rr=Qn,ar=Qn,sr=function(e){return("00"+e.toString(16)).slice(-2)},or=tr,ur=Jn,lr=ir,cr=function(e){var t,i={version:e[0],flags:new Uint8Array(e.subarray(1,4)),samples:[]},n=new DataView(e.buffer,e.byteOffset,e.byteLength),r=1&i.flags[2],a=4&i.flags[2],s=1&i.flags[1],o=2&i.flags[1],u=4&i.flags[1],l=8&i.flags[1],c=n.getUint32(4),d=8;for(r&&(i.dataOffset=n.getInt32(d),d+=4),a&&c&&(t={flags:nr(e.subarray(d,d+4))},d+=4,s&&(t.duration=n.getUint32(d),d+=4),o&&(t.size=n.getUint32(d),d+=4),l&&(1===i.version?t.compositionTimeOffset=n.getInt32(d):t.compositionTimeOffset=n.getUint32(d),d+=4),i.samples.push(t),c--);c--;)t={},s&&(t.duration=n.getUint32(d),d+=4),o&&(t.size=n.getUint32(d),d+=4),u&&(t.flags=nr(e.subarray(d,d+4)),d+=4),l&&(1===i.version?t.compositionTimeOffset=n.getInt32(d):t.compositionTimeOffset=n.getUint32(d),d+=4),i.samples.push(t);return i},dr=function(e){var t={version:e[0],flags:new Uint8Array(e.subarray(1,4)),baseMediaDecodeTime:rr(e[4]<<24|e[5]<<16|e[6]<<8|e[7])};return 1===t.version&&(t.baseMediaDecodeTime*=Math.pow(2,32),t.baseMediaDecodeTime+=rr(e[8]<<24|e[9]<<16|e[10]<<8|e[11])),t};Vn=function(e,t){var i,n,r;return i=or(t,["moof","traf"]),n=[].concat.apply([],i.map((function(t){return or(t,["tfhd"]).map((function(i){var n,r,a;return n=ar(i[4]<<24|i[5]<<16|i[6]<<8|i[7]),r=e[n]||9e4,a=or(t,["tfdt"]).map((function(e){var t,i;return t=e[0],i=ar(e[4]<<24|e[5]<<16|e[6]<<8|e[7]),1===t&&(i*=Math.pow(2,32),i+=ar(e[8]<<24|e[9]<<16|e[10]<<8|e[11])),i}))[0],(a=a||1/0)/r}))}))),r=Math.min.apply(null,n),isFinite(r)?r:0},Hn=function(e){var t=or(e,["moov","trak"]),i=[];return t.forEach((function(e){var t,n,r={},a=or(e,["tkhd"])[0];a&&(n=(t=new DataView(a.buffer,a.byteOffset,a.byteLength)).getUint8(0),r.id=0===n?t.getUint32(12):t.getUint32(20));var s=or(e,["mdia","hdlr"])[0];if(s){var o=ur(s.subarray(8,12));r.type="vide"===o?"video":"soun"===o?"audio":o}var u=or(e,["mdia","minf","stbl","stsd"])[0];if(u){var l=u.subarray(8);r.codec=ur(l.subarray(4,8));var c,d=or(l,[r.codec])[0];d&&(/^[a-z]vc[1-9]$/i.test(r.codec)?(c=d.subarray(78),"avcC"===ur(c.subarray(4,8))&&c.length>11?(r.codec+=".",r.codec+=sr(c[9]),r.codec+=sr(c[10]),r.codec+=sr(c[11])):r.codec="avc1.4d400d"):/^mp4[a,v]$/i.test(r.codec)&&(c=d.subarray(28),"esds"===ur(c.subarray(4,8))&&c.length>20&&0!==c[19]?(r.codec+="."+sr(c[19]),r.codec+="."+sr(c[20]>>>2&63).replace(/^0/,"")):r.codec="mp4a.40.2"))}var h=or(e,["mdia","mdhd"])[0];h&&(r.timescale=qn(h)),i.push(r)})),i};var hr=Vn,pr=Hn,fr=(qn=function(e){var t=0===e[0]?12:20;return ar(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])},{}); /*! @name @videojs/vhs-utils @version 2.3.0 @license MIT */ Object.defineProperty(fr,"__esModule",{value:!0});var mr=function(e){return e&&"object"==typeof e&&"default"in e?e.default:e}(n),gr={mp4:/^(av0?1|avc0?[1234]|vp0?9|flac|opus|mp3|mp4a|mp4v|stpp.ttml.im1t)/,webm:/^(vp0?[89]|av0?1|opus|vorbis)/,ogg:/^(vp0?[89]|theora|flac|opus|vorbis)/,video:/^(av0?1|avc0?[1234]|vp0?[89]|hvc1|hev1|theora|mp4v)/,audio:/^(mp4a|flac|vorbis|opus|ac-[34]|ec-3|alac|mp3)/,text:/^(stpp.ttml.im1t)/,muxerVideo:/^(avc0?1)/,muxerAudio:/^(mp4a)/,muxerText:/a^/},vr=["video","audio","text"],yr=["Video","Audio","Text"],_r=function(e){return e?e.replace(/avc1\.(\d+)\.(\d+)/i,(function(e,t,i){return"avc1."+("00"+Number(t).toString(16)).slice(-2)+"00"+("00"+Number(i).toString(16)).slice(-2)})):e},br=function(e){return e.map(_r)},Tr=function(e){void 0===e&&(e="");var t=e.split(","),i={},n=[];return t.forEach((function(e){var t;e=e.trim(),vr.forEach((function(n){var r=gr[n].exec(e.toLowerCase());if(r&&!(r.length<=1)){t=n;var a=e.substring(0,r[1].length),s=e.replace(a,"");i[n]={type:a,details:s}}})),t||n.push(e)})),n.length&&(i.unknown=n),i},Sr=function(e){return void 0===e&&(e=""),gr.audio.test(e.trim().toLowerCase())},kr=function(e){return void 0===e&&(e=""),gr.text.test(e.trim().toLowerCase())},Cr=function(e){if(e&&"string"==typeof e){var t=e.toLowerCase().split(",").map((function(e){return _r(e.trim())})),i="video";1===t.length&&Sr(t[0])?i="audio":1===t.length&&kr(t[0])&&(i="application");var n="mp4";return t.every((function(e){return gr.mp4.test(e)}))?n="mp4":t.every((function(e){return gr.webm.test(e)}))?n="webm":t.every((function(e){return gr.ogg.test(e)}))&&(n="ogg"),i+"/"+n+';codecs="'+e+'"'}},Er=fr.DEFAULT_AUDIO_CODEC="mp4a.40.2",wr=fr.DEFAULT_VIDEO_CODEC="avc1.4d400d",Ir=fr.browserSupportsCodec=function(e){return void 0===e&&(e=""),mr.MediaSource&&mr.MediaSource.isTypeSupported&&mr.MediaSource.isTypeSupported(Cr(e))||!1},Ar=fr.codecsFromDefault=function(e,t){if(!e.mediaGroups.AUDIO||!t)return null;var i=e.mediaGroups.AUDIO[t];if(!i)return null;for(var n in i){var r=i[n];if(r.default&&r.playlists)return Tr(r.playlists[0].attributes.CODECS)}return null},xr=fr.getMimeForCodec=Cr,Pr=fr.isAudioCodec=Sr;fr.isTextCodec=kr;var Lr=fr.isVideoCodec=function(e){return void 0===e&&(e=""),gr.video.test(e.trim().toLowerCase())};fr.mapLegacyAvcCodecs=function(e){return e.replace(/avc1\.(\d+)\.(\d+)/i,(function(e){return br([e])[0]}))};var Dr=fr.muxerSupportsCodec=function(e){return void 0===e&&(e=""),e.toLowerCase().split(",").every((function(e){e=e.trim();for(var t=0;t * Copyright Brightcove, Inc. * Available under Apache License Version 2.0 * * * Includes vtt.js * Available under Apache License Version 2.0 * */ var Rr="7.10.2",Nr=[];var Ur=function e(t){var i,r="info",a=function(){for(var e=arguments.length,t=new Array(e),n=0;n0?u:0)}if(n.console){var l=n.console[i];l||"debug"!==i||(l=n.console.info||n.console.log),l&&s&&o.test(i)&&l[Array.isArray(a)?"apply":"call"](n.console,a)}}}(t,a),a.createLogger=function(i){return e(t+": "+i)},a.levels={all:"debug|log|warn|error",off:"",debug:"debug|log|warn|error",info:"log|warn|error",warn:"warn|error",error:"error",DEFAULT:r},a.level=function(e){if("string"==typeof e){if(!a.levels.hasOwnProperty(e))throw new Error('"'+e+'" in not a valid log level');r=e}return r},(a.history=function(){return Nr?[].concat(Nr):[]}).filter=function(e){return(Nr||[]).filter((function(t){return new RegExp(".*"+e+".*").test(t[0])}))},a.history.clear=function(){Nr&&(Nr.length=0)},a.history.disable=function(){null!==Nr&&(Nr.length=0,Nr=null)},a.history.enable=function(){null===Nr&&(Nr=[])},a.error=function(){for(var e=arguments.length,t=new Array(e),n=0;n1?t-1:0),n=1;n=0)throw new Error("class has illegal whitespace characters")}function Xr(){return s===n.document}function Yr(e){return qr(e)&&1===e.nodeType}function $r(){try{return n.parent!==n.self}catch(e){return!0}}function Qr(e){return function(t,i){if(!Gr(t))return s[e](null);Gr(i)&&(i=s.querySelector(i));var n=Yr(i)?i:s;return n[e]&&n[e](t)}}function Jr(e,t,i,n){void 0===e&&(e="div"),void 0===t&&(t={}),void 0===i&&(i={});var r=s.createElement(e);return Object.getOwnPropertyNames(t).forEach((function(e){var i=t[e];-1!==e.indexOf("aria-")||"role"===e||"type"===e?(Ur.warn("Setting attributes in the second argument of createEl()\nhas been deprecated. Use the third argument instead.\ncreateEl(type, properties, attributes). Attempting to set "+e+" to "+i+"."),r.setAttribute(e,i)):"textContent"===e?Zr(r,i):r[e]!==i&&(r[e]=i)})),Object.getOwnPropertyNames(i).forEach((function(e){r.setAttribute(e,i[e])})),n&&ya(r,n),r}function Zr(e,t){return void 0===e.textContent?e.innerText=t:e.textContent=t,e}function ea(e,t){t.firstChild?t.insertBefore(e,t.firstChild):t.appendChild(e)}function ta(e,t){return Kr(t),e.classList?e.classList.contains(t):(i=t,new RegExp("(^|\\s)"+i+"($|\\s)")).test(e.className);var i}function ia(e,t){return e.classList?e.classList.add(t):ta(e,t)||(e.className=(e.className+" "+t).trim()),e}function na(e,t){return e.classList?e.classList.remove(t):(Kr(t),e.className=e.className.split(/\s+/).filter((function(e){return e!==t})).join(" ")),e}function ra(e,t,i){var n=ta(e,t);if("function"==typeof i&&(i=i(e,t)),"boolean"!=typeof i&&(i=!n),i!==n)return i?ia(e,t):na(e,t),e}function aa(e,t){Object.getOwnPropertyNames(t).forEach((function(i){var n=t[i];null==n||!1===n?e.removeAttribute(i):e.setAttribute(i,!0===n?"":n)}))}function sa(e){var t={},i=",autoplay,controls,playsinline,loop,muted,default,defaultMuted,";if(e&&e.attributes&&e.attributes.length>0)for(var n=e.attributes,r=n.length-1;r>=0;r--){var a=n[r].name,s=n[r].value;"boolean"!=typeof e[a]&&-1===i.indexOf(","+a+",")||(s=null!==s),t[a]=s}return t}function oa(e,t){return e.getAttribute(t)}function ua(e,t,i){e.setAttribute(t,i)}function la(e,t){e.removeAttribute(t)}function ca(){s.body.focus(),s.onselectstart=function(){return!1}}function da(){s.onselectstart=function(){return!0}}function ha(e){if(e&&e.getBoundingClientRect&&e.parentNode){var t=e.getBoundingClientRect(),i={};return["bottom","height","left","right","top","width"].forEach((function(e){void 0!==t[e]&&(i[e]=t[e])})),i.height||(i.height=parseFloat(zr(e,"height"))),i.width||(i.width=parseFloat(zr(e,"width"))),i}}function pa(e){if(!e||e&&!e.offsetParent)return{left:0,top:0,width:0,height:0};var t=e.offsetWidth,i=e.offsetHeight,n=0,r=0;do{n+=e.offsetLeft,r+=e.offsetTop,e=e.offsetParent}while(e);return{left:n,top:r,width:t,height:i}}function fa(e,t){var i={},n=pa(t.target),r=pa(e),a=r.width,s=r.height,o=t.offsetY-(r.top-n.top),u=t.offsetX-(r.left-n.left);return t.changedTouches&&(u=t.changedTouches[0].pageX-r.left,o=t.changedTouches[0].pageY+r.top),i.y=1-Math.max(0,Math.min(1,o/s)),i.x=Math.max(0,Math.min(1,u/a)),i}function ma(e){return qr(e)&&3===e.nodeType}function ga(e){for(;e.firstChild;)e.removeChild(e.firstChild);return e}function va(e){return"function"==typeof e&&(e=e()),(Array.isArray(e)?e:[e]).map((function(e){return"function"==typeof e&&(e=e()),Yr(e)||ma(e)?e:"string"==typeof e&&/\S/.test(e)?s.createTextNode(e):void 0})).filter((function(e){return e}))}function ya(e,t){return va(t).forEach((function(t){return e.appendChild(t)})),e}function _a(e,t){return ya(ga(e),t)}function ba(e){return void 0===e.button&&void 0===e.buttons||(0===e.button&&void 0===e.buttons||("mouseup"===e.type&&0===e.button&&0===e.buttons||0===e.button&&1===e.buttons))}var Ta,Sa=Qr("querySelector"),ka=Qr("querySelectorAll"),Ca=Object.freeze({__proto__:null,isReal:Xr,isEl:Yr,isInFrame:$r,createEl:Jr,textContent:Zr,prependTo:ea,hasClass:ta,addClass:ia,removeClass:na,toggleClass:ra,setAttributes:aa,getAttributes:sa,getAttribute:oa,setAttribute:ua,removeAttribute:la,blockTextSelection:ca,unblockTextSelection:da,getBoundingClientRect:ha,findPosition:pa,getPointerPosition:fa,isTextNode:ma,emptyEl:ga,normalizeContent:va,appendContent:ya,insertContent:_a,isSingleLeftClick:ba,$:Sa,$$:ka}),Ea=!1,wa=function(){if(Xr()&&!1!==Ta.options.autoSetup){var e=Array.prototype.slice.call(s.getElementsByTagName("video")),t=Array.prototype.slice.call(s.getElementsByTagName("audio")),i=Array.prototype.slice.call(s.getElementsByTagName("video-js")),n=e.concat(t,i);if(n&&n.length>0)for(var r=0,a=n.length;r-1&&(a={passive:!0}),e.addEventListener(t,r.dispatcher,a)}else e.attachEvent&&e.attachEvent("on"+t,r.dispatcher)}function Va(e,t,i){if(Ra.has(e)){var n=Ra.get(e);if(n.handlers){if(Array.isArray(t))return Ua(Va,e,t,i);var r=function(e,t){n.handlers[t]=[],Na(e,t)};if(void 0!==t){var a=n.handlers[t];if(a)if(i){if(i.guid)for(var s=0;s=t&&(e.apply(void 0,arguments),i=r)}},$a=function(){};$a.prototype.allowedEvents_={},$a.prototype.on=function(e,t){var i=this.addEventListener;this.addEventListener=function(){},ja(this,e,t),this.addEventListener=i},$a.prototype.addEventListener=$a.prototype.on,$a.prototype.off=function(e,t){Va(this,e,t)},$a.prototype.removeEventListener=$a.prototype.off,$a.prototype.one=function(e,t){var i=this.addEventListener;this.addEventListener=function(){},qa(this,e,t),this.addEventListener=i},$a.prototype.any=function(e,t){var i=this.addEventListener;this.addEventListener=function(){},Wa(this,e,t),this.addEventListener=i},$a.prototype.trigger=function(e){var t=e.type||e;"string"==typeof e&&(e={type:t}),e=Fa(e),this.allowedEvents_[t]&&this["on"+t]&&this["on"+t](e),Ha(this,e)},$a.prototype.dispatchEvent=$a.prototype.trigger,$a.prototype.queueTrigger=function(e){var t=this;za||(za=new Map);var i=e.type||e,r=za.get(this);r||(r=new Map,za.set(this,r));var a=r.get(i);r.delete(i),n.clearTimeout(a);var s=n.setTimeout((function(){0===r.size&&(r=null,za.delete(t)),t.trigger(e)}),0);r.set(i,s)};var Qa=function(e){return e instanceof $a||!!e.eventBusEl_&&["on","one","off","trigger"].every((function(t){return"function"==typeof e[t]}))},Ja=function(e){return"string"==typeof e&&/\S/.test(e)||Array.isArray(e)&&!!e.length},Za=function(e){if(!e.nodeName&&!Qa(e))throw new Error("Invalid target; must be a DOM node or evented object.")},es=function(e){if(!Ja(e))throw new Error("Invalid event type; must be a non-empty string or array.")},ts=function(e){if("function"!=typeof e)throw new Error("Invalid listener; must be a function.")},is=function(e,t){var i,n,r,a=t.length<3||t[0]===e||t[0]===e.eventBusEl_;return a?(i=e.eventBusEl_,t.length>=3&&t.shift(),n=t[0],r=t[1]):(i=t[0],n=t[1],r=t[2]),Za(i),es(n),ts(r),{isTargetingSelf:a,target:i,type:n,listener:r=Xa(e,r)}},ns=function(e,t,i,n){Za(e),e.nodeName?Ga[t](e,i,n):e[t](i,n)},rs={on:function(){for(var e=this,t=arguments.length,i=new Array(t),n=0;n=0;e--)this.children_[e].dispose&&this.children_[e].dispose();this.children_=null,this.childIndex_=null,this.childNameIndex_=null,this.parentComponent_=null,this.el_&&(this.el_.parentNode&&this.el_.parentNode.removeChild(this.el_),Ra.has(this.el_)&&Ra.delete(this.el_),this.el_=null),this.player_=null}},t.isDisposed=function(){return Boolean(this.isDisposed_)},t.player=function(){return this.player_},t.options=function(e){return e?(this.options_=cs(this.options_,e),this.options_):this.options_},t.el=function(){return this.el_},t.createEl=function(e,t,i){return Jr(e,t,i)},t.localize=function(e,t,i){void 0===i&&(i=e);var n=this.player_.language&&this.player_.language(),r=this.player_.languages&&this.player_.languages(),a=r&&r[n],s=n&&n.split("-")[0],o=r&&r[s],u=i;return a&&a[e]?u=a[e]:o&&o[e]&&(u=o[e]),t&&(u=u.replace(/\{(\d+)\}/g,(function(e,i){var n=t[i-1],r=n;return void 0===n&&(r=e),r}))),u},t.contentEl=function(){return this.contentEl_||this.el_},t.id=function(){return this.id_},t.name=function(){return this.name_},t.children=function(){return this.children_},t.getChildById=function(e){return this.childIndex_[e]},t.getChild=function(e){if(e)return this.childNameIndex_[e]},t.getDescendant=function(){for(var e=arguments.length,t=new Array(e),i=0;i=0;i--)if(this.children_[i]===e){t=!0,this.children_.splice(i,1);break}if(t){e.parentComponent_=null,this.childIndex_[e.id()]=null,this.childNameIndex_[ls(e.name())]=null,this.childNameIndex_[us(e.name())]=null;var n=e.el();n&&n.parentNode===this.contentEl()&&this.contentEl().removeChild(e.el())}}},t.initChildren=function(){var t=this,i=this.options_.children;if(i){var n,r=this.options_,a=e.getComponent("Tech");(n=Array.isArray(i)?i:Object.keys(i)).concat(Object.keys(this.options_).filter((function(e){return!n.some((function(t){return"string"==typeof t?e===t:e===t.name}))}))).map((function(e){var n,r;return"string"==typeof e?r=i[n=e]||t.options_[n]||{}:(n=e.name,r=e),{name:n,opts:r}})).filter((function(t){var i=e.getComponent(t.opts.componentClass||ls(t.name));return i&&!a.isTech(i)})).forEach((function(e){var i=e.name,n=e.opts;if(void 0!==r[i]&&(n=r[i]),!1!==n){!0===n&&(n={}),n.playerOptions=t.options_.playerOptions;var a=t.addChild(i,n);a&&(t[i]=a)}}))}},t.buildCSSClass=function(){return""},t.ready=function(e,t){if(void 0===t&&(t=!1),e)return this.isReady_?void(t?e.call(this):this.setTimeout(e,1)):(this.readyQueue_=this.readyQueue_||[],void this.readyQueue_.push(e))},t.triggerReady=function(){this.isReady_=!0,this.setTimeout((function(){var e=this.readyQueue_;this.readyQueue_=[],e&&e.length>0&&e.forEach((function(e){e.call(this)}),this),this.trigger("ready")}),1)},t.$=function(e,t){return Sa(e,t||this.contentEl())},t.$$=function(e,t){return ka(e,t||this.contentEl())},t.hasClass=function(e){return ta(this.el_,e)},t.addClass=function(e){ia(this.el_,e)},t.removeClass=function(e){na(this.el_,e)},t.toggleClass=function(e,t){ra(this.el_,e,t)},t.show=function(){this.removeClass("vjs-hidden")},t.hide=function(){this.addClass("vjs-hidden")},t.lockShowing=function(){this.addClass("vjs-lock-showing")},t.unlockShowing=function(){this.removeClass("vjs-lock-showing")},t.getAttribute=function(e){return oa(this.el_,e)},t.setAttribute=function(e,t){ua(this.el_,e,t)},t.removeAttribute=function(e){la(this.el_,e)},t.width=function(e,t){return this.dimension("width",e,t)},t.height=function(e,t){return this.dimension("height",e,t)},t.dimensions=function(e,t){this.width(e,!0),this.height(t)},t.dimension=function(e,t,i){if(void 0!==t)return null!==t&&t==t||(t=0),-1!==(""+t).indexOf("%")||-1!==(""+t).indexOf("px")?this.el_.style[e]=t:this.el_.style[e]="auto"===t?"":t+"px",void(i||this.trigger("componentresize"));if(!this.el_)return 0;var n=this.el_.style[e],r=n.indexOf("px");return-1!==r?parseInt(n.slice(0,r),10):parseInt(this.el_["offset"+ls(e)],10)},t.currentDimension=function(e){var t=0;if("width"!==e&&"height"!==e)throw new Error("currentDimension only accepts width or height value");if(t=zr(this.el_,e),0===(t=parseFloat(t))||isNaN(t)){var i="offset"+ls(e);t=this.el_[i]}return t},t.currentDimensions=function(){return{width:this.currentDimension("width"),height:this.currentDimension("height")}},t.currentWidth=function(){return this.currentDimension("width")},t.currentHeight=function(){return this.currentDimension("height")},t.focus=function(){this.el_.focus()},t.blur=function(){this.el_.blur()},t.handleKeyDown=function(e){this.player_&&(e.stopPropagation(),this.player_.handleKeyDown(e))},t.handleKeyPress=function(e){this.handleKeyDown(e)},t.emitTapEvents=function(){var e,t=0,i=null;this.on("touchstart",(function(r){1===r.touches.length&&(i={pageX:r.touches[0].pageX,pageY:r.touches[0].pageY},t=n.performance.now(),e=!0)})),this.on("touchmove",(function(t){if(t.touches.length>1)e=!1;else if(i){var n=t.touches[0].pageX-i.pageX,r=t.touches[0].pageY-i.pageY;Math.sqrt(n*n+r*r)>10&&(e=!1)}}));var r=function(){e=!1};this.on("touchleave",r),this.on("touchcancel",r),this.on("touchend",(function(r){(i=null,!0===e)&&(n.performance.now()-t<200&&(r.preventDefault(),this.trigger("tap")))}))},t.enableTouchActivity=function(){if(this.player()&&this.player().reportUserActivity){var e,t=Xa(this.player(),this.player().reportUserActivity);this.on("touchstart",(function(){t(),this.clearInterval(e),e=this.setInterval(t,250)}));var i=function(i){t(),this.clearInterval(e)};this.on("touchmove",t),this.on("touchend",i),this.on("touchcancel",i)}},t.setTimeout=function(e,t){var i,r=this;return e=Xa(this,e),this.clearTimersOnDispose_(),i=n.setTimeout((function(){r.setTimeoutIds_.has(i)&&r.setTimeoutIds_.delete(i),e()}),t),this.setTimeoutIds_.add(i),i},t.clearTimeout=function(e){return this.setTimeoutIds_.has(e)&&(this.setTimeoutIds_.delete(e),n.clearTimeout(e)),e},t.setInterval=function(e,t){e=Xa(this,e),this.clearTimersOnDispose_();var i=n.setInterval(e,t);return this.setIntervalIds_.add(i),i},t.clearInterval=function(e){return this.setIntervalIds_.has(e)&&(this.setIntervalIds_.delete(e),n.clearInterval(e)),e},t.requestAnimationFrame=function(e){var t,i=this;return this.supportsRaf_?(this.clearTimersOnDispose_(),e=Xa(this,e),t=n.requestAnimationFrame((function(){i.rafIds_.has(t)&&i.rafIds_.delete(t),e()})),this.rafIds_.add(t),t):this.setTimeout(e,1e3/60)},t.requestNamedAnimationFrame=function(e,t){var i=this;if(!this.namedRafs_.has(e)){this.clearTimersOnDispose_(),t=Xa(this,t);var n=this.requestAnimationFrame((function(){t(),i.namedRafs_.has(e)&&i.namedRafs_.delete(e)}));return this.namedRafs_.set(e,n),e}},t.cancelNamedAnimationFrame=function(e){this.namedRafs_.has(e)&&(this.cancelAnimationFrame(this.namedRafs_.get(e)),this.namedRafs_.delete(e))},t.cancelAnimationFrame=function(e){return this.supportsRaf_?(this.rafIds_.has(e)&&(this.rafIds_.delete(e),n.cancelAnimationFrame(e)),e):this.clearTimeout(e)},t.clearTimersOnDispose_=function(){var e=this;this.clearingTimersOnDispose_||(this.clearingTimersOnDispose_=!0,this.one("dispose",(function(){[["namedRafs_","cancelNamedAnimationFrame"],["rafIds_","cancelAnimationFrame"],["setTimeoutIds_","clearTimeout"],["setIntervalIds_","clearInterval"]].forEach((function(t){var i=t[0],n=t[1];e[i].forEach((function(t,i){return e[n](i)}))})),e.clearingTimersOnDispose_=!1})))},e.registerComponent=function(t,i){if("string"!=typeof t||!t)throw new Error('Illegal component name, "'+t+'"; must be a non-empty string.');var n,r=e.getComponent("Tech"),a=r&&r.isTech(i),s=e===i||e.prototype.isPrototypeOf(i.prototype);if(a||!s)throw n=a?"techs must be registered using Tech.registerTech()":"must be a Component subclass",new Error('Illegal component, "'+t+'"; '+n+".");t=ls(t),e.components_||(e.components_={});var o=e.getComponent("Player");if("Player"===t&&o&&o.players){var u=o.players,l=Object.keys(u);if(u&&l.length>0&&l.map((function(e){return u[e]})).every(Boolean))throw new Error("Can not register Player component after player has been created.")}return e.components_[t]=i,e.components_[us(t)]=i,i},e.getComponent=function(t){if(t&&e.components_)return e.components_[t]},e}();ms.prototype.supportsRaf_="function"==typeof n.requestAnimationFrame&&"function"==typeof n.cancelAnimationFrame,ms.registerComponent("Component",ms);var gs,vs=n.navigator&&n.navigator.userAgent||"",ys=/AppleWebKit\/([\d.]+)/i.exec(vs),_s=ys?parseFloat(ys.pop()):null,bs=/iPod/i.test(vs),Ts=(gs=vs.match(/OS (\d+)_/i))&&gs[1]?gs[1]:null,Ss=/Android/i.test(vs),ks=function(){var e=vs.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);if(!e)return null;var t=e[1]&&parseFloat(e[1]),i=e[2]&&parseFloat(e[2]);return t&&i?parseFloat(e[1]+"."+e[2]):t||null}(),Cs=Ss&&ks<5&&_s<537,Es=/Firefox/i.test(vs),ws=/Edg/i.test(vs),Is=!ws&&(/Chrome/i.test(vs)||/CriOS/i.test(vs)),As=function(){var e=vs.match(/(Chrome|CriOS)\/(\d+)/);return e&&e[2]?parseFloat(e[2]):null}(),xs=function(){var e=/MSIE\s(\d+)\.\d/.exec(vs),t=e&&parseFloat(e[1]);return!t&&/Trident\/7.0/i.test(vs)&&/rv:11.0/.test(vs)&&(t=11),t}(),Ps=/Safari/i.test(vs)&&!Is&&!Ss&&!ws,Ls=/Windows/i.test(vs),Ds=Xr()&&("ontouchstart"in n||n.navigator.maxTouchPoints||n.DocumentTouch&&n.document instanceof n.DocumentTouch),Os=/iPad/i.test(vs)||Ps&&Ds&&!/iPhone/i.test(vs),Ms=/iPhone/i.test(vs)&&!Os,Rs=Ms||Os||bs,Ns=(Ps||Rs)&&!Is,Us=Object.freeze({__proto__:null,IS_IPOD:bs,IOS_VERSION:Ts,IS_ANDROID:Ss,ANDROID_VERSION:ks,IS_NATIVE_ANDROID:Cs,IS_FIREFOX:Es,IS_EDGE:ws,IS_CHROME:Is,CHROME_VERSION:As,IE_VERSION:xs,IS_SAFARI:Ps,IS_WINDOWS:Ls,TOUCH_ENABLED:Ds,IS_IPAD:Os,IS_IPHONE:Ms,IS_IOS:Rs,IS_ANY_SAFARI:Ns});function Fs(e,t,i,n){return function(e,t,i){if("number"!=typeof t||t<0||t>i)throw new Error("Failed to execute '"+e+"' on 'TimeRanges': The index provided ("+t+") is non-numeric or out of bounds (0-"+i+").")}(e,n,i.length-1),i[n][t]}function Bs(e){return void 0===e||0===e.length?{length:0,start:function(){throw new Error("This TimeRanges object is empty")},end:function(){throw new Error("This TimeRanges object is empty")}}:{length:e.length,start:Fs.bind(null,"start",0,e),end:Fs.bind(null,"end",1,e)}}function js(e,t){return Array.isArray(e)?Bs(e):void 0===e||void 0===t?Bs():Bs([[e,t]])}function Vs(e,t){var i,n,r=0;if(!t)return 0;e&&e.length||(e=js(0,0));for(var a=0;at&&(n=t),r+=n-i;return r/t}for(var Hs,qs={prefixed:!0},Ws=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror","fullscreen"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror","-webkit-full-screen"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror","-moz-full-screen"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError","-ms-fullscreen"]],zs=Ws[0],Gs=0;Gs=0;n--)if(t[n].enabled){ro(t,t[n]);break}return(i=e.call(this,t)||this).changing_=!1,i}d(t,e);var i=t.prototype;return i.addTrack=function(t){var i=this;t.enabled&&ro(this,t),e.prototype.addTrack.call(this,t),t.addEventListener&&(t.enabledChange_=function(){i.changing_||(i.changing_=!0,ro(i,t),i.changing_=!1,i.trigger("change"))},t.addEventListener("enabledchange",t.enabledChange_))},i.removeTrack=function(t){e.prototype.removeTrack.call(this,t),t.removeEventListener&&t.enabledChange_&&(t.removeEventListener("enabledchange",t.enabledChange_),t.enabledChange_=null)},t}(io),so=function(e,t){for(var i=0;i=0;n--)if(t[n].selected){so(t,t[n]);break}return(i=e.call(this,t)||this).changing_=!1,Object.defineProperty(c(i),"selectedIndex",{get:function(){for(var e=0;e',i=r.firstChild,r.setAttribute("style","display:none; position:absolute;"),s.body.appendChild(r));for(var o={},u=0;ux',e=t.firstChild.href}return e},_o=function(e){if("string"==typeof e){var t=/^(\/?)([\s\S]*?)((?:\.{1,2}|[^\/]+?)(\.([^\.\/\?]+)))(?:[\/]*|[\?].*)$/.exec(e);if(t)return t.pop().toLowerCase()}return""},bo=function(e,t){void 0===t&&(t=n.location);var i=vo(e);return(":"===i.protocol?t.protocol:i.protocol)+i.host!==t.protocol+t.host},To=Object.freeze({__proto__:null,parseUrl:vo,getAbsoluteURL:yo,getFileExtension:_o,isCrossOrigin:bo}),So=function(e,t){var i=new n.WebVTT.Parser(n,n.vttjs,n.WebVTT.StringDecoder()),r=[];i.oncue=function(e){t.addCue(e)},i.onparsingerror=function(e){r.push(e)},i.onflush=function(){t.trigger({type:"loadeddata",target:t})},i.parse(e),r.length>0&&(n.console&&n.console.groupCollapsed&&n.console.groupCollapsed("Text Track parsing errors for "+t.src),r.forEach((function(e){return Ur.error(e)})),n.console&&n.console.groupEnd&&n.console.groupEnd()),i.flush()},ko=function(e,t){var i={uri:e},r=bo(e);r&&(i.cors=r);var a="use-credentials"===t.tech_.crossOrigin();a&&(i.withCredentials=a),E(i,Xa(this,(function(e,i,r){if(e)return Ur.error(e,i);t.loaded_=!0,"function"!=typeof n.WebVTT?t.tech_&&t.tech_.any(["vttjsloaded","vttjserror"],(function(e){if("vttjserror"!==e.type)return So(r,t);Ur.error("vttjs failed to load, stopping trying to process "+t.src)})):So(r,t)})))},Co=function(e){function t(t){var i;if(void 0===t&&(t={}),!t.tech)throw new Error("A tech was not provided.");var n=cs(t,{kind:fo[t.kind]||"subtitles",language:t.language||t.srclang||""}),r=mo[n.mode]||"disabled",a=n.default;"metadata"!==n.kind&&"chapters"!==n.kind||(r="hidden"),(i=e.call(this,n)||this).tech_=n.tech,i.cues_=[],i.activeCues_=[],i.preload_=!1!==i.tech_.preloadTextTracks;var s=new co(i.cues_),o=new co(i.activeCues_),u=!1,l=Xa(c(i),(function(){this.activeCues=this.activeCues,u&&(this.trigger("cuechange"),u=!1)}));return"disabled"!==r&&i.tech_.ready((function(){i.tech_.on("timeupdate",l)}),!0),Object.defineProperties(c(i),{default:{get:function(){return a},set:function(){}},mode:{get:function(){return r},set:function(e){var t=this;mo[e]&&(r=e,this.preload_||"disabled"===r||0!==this.cues.length||ko(this.src,this),"disabled"!==r?this.tech_.ready((function(){t.tech_.on("timeupdate",l)}),!0):this.tech_.off("timeupdate",l),this.trigger("modechange"))}},cues:{get:function(){return this.loaded_?s:null},set:function(){}},activeCues:{get:function(){if(!this.loaded_)return null;if(0===this.cues.length)return o;for(var e=this.tech_.currentTime(),t=[],i=0,n=this.cues.length;i=e||r.startTime===r.endTime&&r.startTime<=e&&r.startTime+.5>=e)&&t.push(r)}if(u=!1,t.length!==this.activeCues_.length)u=!0;else for(var a=0;a0)return void this.trigger("vttjsloaded");var t=s.createElement("script");t.src=this.options_["vtt.js"]||"https://vjs.zencdn.net/vttjs/0.14.1/vtt.min.js",t.onload=function(){e.trigger("vttjsloaded")},t.onerror=function(){e.trigger("vttjserror")},this.on("dispose",(function(){t.onload=null,t.onerror=null})),n.WebVTT=!0,this.el().parentNode.appendChild(t)}else this.ready(this.addWebVttScript_)},i.emulateTextTracks=function(){var e=this,t=this.textTracks(),i=this.remoteTextTracks(),n=function(e){return t.addTrack(e.track)},r=function(e){return t.removeTrack(e.track)};i.on("addtrack",n),i.on("removetrack",r),this.addWebVttScript_();var a=function(){return e.trigger("texttrackchange")},s=function(){a();for(var e=0;e=0;r--){var a=e[r];a[t]&&a[t](n,i)}}(e,i,o,s),o}var Uo={buffered:1,currentTime:1,duration:1,muted:1,played:1,paused:1,seekable:1,volume:1},Fo={setCurrentTime:1,setMuted:1,setVolume:1},Bo={play:1,pause:1};function jo(e){return function(t,i){return t===Mo?Mo:i[e]?i[e](t):t}}function Vo(e,t,i,n,r,a){void 0===e&&(e={}),void 0===t&&(t=[]),void 0===r&&(r=[]),void 0===a&&(a=!1);var s=t,o=s[0],u=s.slice(1);if("string"==typeof o)Vo(e,Do[o],i,n,r,a);else if(o){var l=function(e,t){var i=Oo[e.id()],n=null;if(null==i)return n=t(e),Oo[e.id()]=[[t,n]],n;for(var r=0;r