PageSourceSearch

https://ellisdon-production.netlify.app/_next/static/chunks/ddc9e94f-dfb7ee8b5ab382b9.js

js ellisdon-production.netlify.app collected 2026-10-03 10:42:00 UTC 243,878 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4027],{67631:function(a){"undefined"!=typeof window&&function(b,c){a.exports=c()}(this,function(){return function(a){var b={};function c(d){if(b[d])return b[d].exports;var e=b[d]={i:d,l:!1,exports:{}};return a[d].call(e.exports,e,e.exports,c),e.l=!0,e.exports}return c.m=a,c.c=b,c.d=function(a,b,d){c.o(a,b)||Object.defineProperty(a,b,{configurable:!1,enumerable:!0,get:d})},c.n=function(a){var b=a&&a.__esModule?function(){return a.default}:function(){return a};return c.d(b,"a",b),b},c.o=function(a,b){return Object.prototype.hasOwnProperty.call(a,b)},c.p="/dist/",c(c.s=11)}([function(a,b,c){"use strict";c.d(b,"a",function(){return j}),c.d(b,"b",function(){return k});var d=c(4),e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a};function f(){}var g={trace:f,debug:f,log:f,warn:f,info:f,error:f},h=g,i=Object(d.a)(),j=function(a){if(!0===a||(void 0===a?"undefined":e(a))==="object"){!function(a){for(var b=arguments.length,c=Array(b>1?b-1:0),d=1;d<b;d++)c[d-1]=arguments[d];c.forEach(function(b){var c,d;h[b]=a[b]?a[b].bind(a):(c=b,(d=i.console[c])?function(){for(var a,b,e=arguments.length,f=Array(e),g=0;g<e;g++)f[g]=arguments[g];f[0]&&(f[0]=(a=c,b="["+a+"] > "+(b=f[0]))),d.apply(i.console,f)}:f)})}(a,"debug","log","info","warn","error");try{h.log()}catch(b){h=g}}else h=g},k=h},function(a,b,c){"use strict";
1b.a={MEDIA_ATTACHING:"hlsMediaAttaching",MEDIA_ATTACHED:"hlsMediaAttached",MEDIA_DETACHING:"hlsMediaDetaching",MEDIA_DETACHED:"hlsMediaDetached",BUFFER_RESET:"hlsBufferReset",BUFFER_CODECS:"hlsBufferCodecs",BUFFER_CREATED:"hlsBufferCreated",BUFFER_APPENDING:"hlsBufferAppending",BUFFER_APPENDED:"hlsBufferAppended",BUFFER_EOS:"hlsBufferEos",BUFFER_FLUSHING:"hlsBufferFlushing",BUFFER_FLUSHED:"hlsBufferFlushed",MANIFEST_LOADING:"hlsManifestLoading",MANIFEST_LOADED:"hlsManifestLoaded",MANIFEST_PARSED:"hlsManifestParsed",LEVEL_SWITCHING:"hlsLevelSwitching",LEVEL_SWITCHED:"hlsLevelSwitched",LEVEL_LOADING:"hlsLevelLoading",LEVEL_LOADED:"hlsLevelLoaded",LEVEL_UPDATED:"hlsLevelUpdated",LEVEL_PTS_UPDATED:"hlsLevelPtsUpdated",AUDIO_TRACKS_UPDATED:"hlsAudioTracksUpdated",AUDIO_TRACK_SWITCHING:"hlsAudioTrackSwitching",AUDIO_TRACK_SWITCHED:"hlsAudioTrackSwitched",AUDIO_TRACK_LOADING:"hlsAudioTrackLoading",AUDIO_TRACK_LOADED:"hlsAudioTrackLoaded",SUBTITLE_TRACKS_UPDATED:"hlsSubtitleTracksUpdated",SUBTITLE_TRACK_SWITCH:"hlsSubtitleTrackSwitch",SUBTITLE_TRACK_LOADING:"hlsSubtitleTrackLoading",SUBTITLE_TRACK_LOADED:"hlsSubtitleTrackLoaded",SUBTITLE_FRAG_PROCESSED:"hlsSubtitleFragProcessed",INIT_PTS_FOUND:"hlsInitPtsFound",FRAG_LOADING:"hlsFragLoading",FRAG_LOAD_PROGRESS:"hlsFragLoadProgress",FRAG_LOAD_EMERGENCY_ABORTED:"hlsFragLoadEmergencyAborted",FRAG_LOADED:"hlsFragLoaded",FRAG_DECRYPTED:"hlsFragDecrypted",FRAG_PARSING_INIT_SEGMENT:"hlsFragParsingInitSegment",FRAG_PARSING_USERDATA:"hlsFragParsingUserdata",FRAG_PARSING_METADATA:"hlsFragParsingMetadata",FRAG_PARSING_DATA:"hlsFragParsingData",FRAG_PARSED:"hl
1sFragParsed",FRAG_BUFFERED:"hlsFragBuffered",FRAG_CHANGED:"hlsFragChanged",FPS_DROP:"hlsFpsDrop",FPS_DROP_LEVEL_CAPPING:"hlsFpsDropLevelCapping",ERROR:"hlsError",DESTROYING:"hlsDestroying",KEY_LOADING:"hlsKeyLoading",KEY_LOADED:"hlsKeyLoaded",STREAM_STATE_TRANSITION:"hlsStreamStateTransition"}},function(a,b,c){"use strict";c.d(b,"b",function(){return d}),c.d(b,"a",function(){return e});var d={NETWORK_ERROR:"networkError",MEDIA_ERROR:"mediaError",KEY_SYSTEM_ERROR:"keySystemError",MUX_ERROR:"muxError",OTHER_ERROR:"otherError"},e={KEY_SYSTEM_NO_KEYS:"keySystemNoKeys",KEY_SYSTEM_NO_ACCESS:"keySystemNoAccess",KEY_SYSTEM_NO_SESSION:"keySystemNoSession",KEY_SYSTEM_LICENSE_REQUEST_FAILED:"keySystemLicenseRequestFailed",MANIFEST_LOAD_ERROR:"manifestLoadError",MANIFEST_LOAD_TIMEOUT:"manifestLoadTimeOut",MANIFEST_PARSING_ERROR:"manifestParsingError",MANIFEST_INCOMPATIBLE_CODECS_ERROR:"manifestIncompatibleCodecsError",LEVEL_LOAD_ERROR:"levelLoadError",LEVEL_LOAD_TIMEOUT:"levelLoadTimeOut",LEVEL_SWITCH_ERROR:"levelSwitchError",AUDIO_TRACK_LOAD_ERROR:"audioTrackLoadError",AUDIO_TRACK_LOAD_TIMEOUT:"audioTrackLoadTimeOut",FRAG_LOAD_ERROR:"fragLoadError",FRAG_LOAD_TIMEOUT:"fragLoadTimeOut",FRAG_DECRYPT_ERROR:"fragDecryptError",FRAG_PARSING_ERROR:"fragParsingError",REMUX_ALLOC_ERROR:"remuxAllocError",KEY_LOAD_ERROR:"keyLoadError",KEY_LOAD_TIMEOUT:"keyLoadTimeOut",BUFFER_ADD_CODEC_ERROR:"bufferAddCodecError",BUFFER_APPEND_ERROR:"bufferAppendError",BUFFER_APPENDING_ERROR:"bufferAppendingError",BUFFER_STALLED_ERROR:"bufferStalledError",BUFFER_FULL_ERROR:"bufferFullError",BUFFER_SEEK_OVER_HOLE:"bufferSeekOverHole",BUFFER_NUDGE_ON_STALL:"bufferNudgeOnStall",INTERNAL_EXCEPTION:"internalException"}},function(a,b,c){"use strict";c.d(b,"a",function(){return d});var d=Number.isFinite||function(a){return"number"==typeof a&&isFinite(a)}},function(a,b,c){"use strict";b.a=function(){return"undefined"==typeof window?self:window}},function(a,b,c){var d,e,f,g,h,i;e=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/\;?#]*)?(.*?)??(;.*?)?(\?.*?)?(#.*?)?$/,f=/^([^\/;?#]*)(.*)$/,g=/(?:\/|^)\.(?=\/)/g,h=/(?:\/|^)\.\.\/(?!\.\.\/).*?(?=\/)/g,i={buildAbsoluteURL:function(a,b,c){if(c=c||{},a=a.trim(),!(b=b.trim())){if(!c.alwaysNormalize)return a;var d=this.parseURL(a);if(!g)throw Error("Error trying to parse base URL.");return d.path=i.normalizePath(d.path),i.buildURLFromParts(d)}var e=this.parseURL(b);if(!e)throw Error("Error trying to parse relative URL.");if(e.scheme)return c.alwaysNormalize?(e.path=i.normalizePath(e.path),i.buildURLFromParts(e)):b;var g=this.parseURL(a);if(!g)throw Error("Error trying to parse base URL.");if(!g.netLoc&&g.path&&"/"!==g.path[0]){var h=f.exec(g.path);g.netLoc=h[1],g.path=h[2]}g.netLoc&&!g.path&&(g.path="/");var j={scheme:g.scheme,netLoc:e.netLoc,path:null,params:e.params,query:e.query,fragment:e.fragment};if(!e.netLoc&&(j.netLoc=g.netLoc,"/"!==e.path[0])){if(e.path){var k=g.path,l=k.substring(0,k.lastIndexOf("/")+1)+e.path;j.path=i.normalizePath(l)}else j.path=g.path,e.params||(j.params=g.params,e.query||(j.query=g.query))}return null===j.path&&(j.path=c.alwaysNormalize?i.normalizePath(e.path):e.path),i.buildURLFromParts(j)},parseURL:function(a){var b=e.exec(a);return b?{scheme:b[1]||"",netLoc:b[2]||"",path:b[3]||"",params:b[4]||"",query:b[5]||"",fragment:b[6]||""}:null},normalizePath:function(a){for(a=a.split("").reverse().join("").replace(g,"");a.length!==(a=a.replace(h,"")).length;);return a.split("").reverse().join("")},buildURLFromParts:function(a){return a.scheme+a.netLoc+a.path+a.params+a.query+a.fragment}},a.exports=i},function(a,b,c){"use strict";c.d(b,"b",function(){return e});var d=function(){function a(){!function(a,b){if(!(a instanceof b))throw TypeError("Cannot call a class as a function")}(this,a)}return a.isHeader=function(a,b){return!!(b+10<=a.length)&&73===a[b]&&68===a[b+1]&&51===a[b+2]&& !!(a[b+3]<255)&&!!(a[b+4]<255)&& !!(a[b+6]<128)&&!!(a[b+7]<128)&&!!(a[b+8]<128)&&!!(a[b+9]<128)},a.isFooter=function(a,b){return!!(b+10<=a.length)&&51===a[b]&&68===a[b+1]&&73===a[b+2]&& !!(a[b+3]<255)&&!!(a[b+4]<255)&& !!(a[b+6]<128)&&!!(a[b+7]<128)&&!!(a[b+8]<128)&&!!(a[b+9]<128)},a.getID3Data=function(b,c){for(var d=c,e=0;a.isHeader(b,c);){e+=10;var f=a._readSize(b,c+6);e+=f,a.isFooter(b,c+10)&&(e+=10),c+=e}if(e>0)return b.subarray(d,d+e)},a._readSize=function(a,b){var c=0;return c=(127&a[b])<<21,c|=(127&a[b+1])<<14,c|=(127&a[b+2])<<7,c|=127&a[b+3]},a.getTimeStamp=function(b){for(var c=a.getID3Frames(b),d=0;d<c.length;d++){var e=c[d];if(a.isTimeStampFrame(e))return a._readTimeStamp(e)}},a.isTimeStampFrame=function(a){return a&&"PRIV"===a.key&&"com.apple.streaming.transportStreamTimestamp"===a.info},a._getFrameData=function(b){var c=String.fromCharCode(b[0],b[1],b[2],b[3]),d=a._readSize(b,4);return{type:c,size:d,data:b.subarray(10,10+d)}},a.getID3Frames=function(b){for(var c=0,d=[];a.isHeader(b,c);){for(var e=a._readSize(b,c+6),f=(c+=10)+e;c+8<f;){var g=a._getFrameData(b.subarray(c)),h=a._decodeFrame(g);h&&d.push(h),c+=g.size+10}a.isFooter(b,c)&&(c+=10)}return d},a._decodeFrame=function(b){return"PRIV"===b.type?a._decodePrivFrame(b):"T"===b.type[0]?a._decodeTextFrame(b):"W"===b.type[0]?a._decodeURLFrame(b):void 0}
vendor: 4,736 bytes, line 1
1,a._readTimeStamp=function(a){if(8===a.data.byteLength){var b=new Uint8Array(a.data),c=1&b[3],d=(b[4]<<23)+(b[5]<<15)+(b[6]<<7)+b[7];return d/=45,c&&(d+=47721858.84),Math.round(d)}},a._decodePrivFrame=function(b){if(!(b.size<2)){var c=a._utf8ArrayToStr(b.data,!0),d=new Uint8Array(b.data.subarray(c.length+1));return{key:b.type,info:c,data:d.buffer}}},a._decodeTextFrame=function(b){if(!(b.size<2)){if("TXXX"===b.type){var c=1,d=a._utf8ArrayToStr(b.data.subarray(c));c+=d.length+1;var e=a._utf8ArrayToStr(b.data.subarray(c));return{key:b.type,info:d,data:e}}var f=a._utf8ArrayToStr(b.data.subarray(1));return{key:b.type,data:f}}},a._decodeURLFrame=function(b){if("WXXX"===b.type){if(b.size<2)return;var c=1,d=a._utf8ArrayToStr(b.data.subarray(c));c+=d.length+1;var e=a._utf8ArrayToStr(b.data.subarray(c));return{key:b.type,info:d,data:e}}var f=a._utf8ArrayToStr(b.data);return{key:b.type,data:f}},a._utf8ArrayToStr=function(a){for(var b=arguments.length>1&& void 0!==arguments[1]&&arguments[1],c=a.length,d=void 0,e=void 0,f=void 0,g="",h=0;h<c&&(0!==(d=a[h++])||!b);)if(0!==d&&3!==d)switch(d>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:g+=String.fromCharCode(d);break;case 12:case 13:g+=String.fromCharCode((31&d)<<6|63&(e=a[h++]));break;case 14:e=a[h++],f=a[h++],g+=String.fromCharCode((15&d)<<12|(63&e)<<6|(63&f)<<0)}return g},a}(),e=d._utf8ArrayToStr;b.a=d},function(a,b){function c(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function d(a){return"function"==typeof a}function e(a){return"object"==typeof a&&null!==a}function f(a){return void 0===a}a.exports=c,c.EventEmitter=c,c.prototype._events=void 0,c.prototype._maxListeners=void 0,c.defaultMaxListeners=10,c.prototype.setMaxListeners=function(a){var b;if(b=a,"number"!=typeof b||a<0||isNaN(a))throw TypeError("n must be a positive number");return this._maxListeners=a,this},c.prototype.emit=function(a){var b,c,g,h,i,j;if(this._events||(this._events={}),"error"===a&&(!this._events.error||e(this._events.error)&&!this._events.error.length)){if(b=arguments[1],b instanceof Error)throw b;var k=Error('Uncaught, unspecified "error" event. ('+b+")");throw k.context=b,k}if(f(c=this._events[a]))return!1;if(d(c))switch(arguments.length){case 1:c.call(this);break;case 2:c.call(this,arguments[1]);break;case 3:c.call(this,arguments[1],arguments[2]);break;default:h=Array.prototype.slice.call(arguments,1),c.apply(this,h)}else if(e(c))for(i=0,h=Array.prototype.slice.call(arguments,1),g=(j=c.slice()).length;i<g;i++)j[i].apply(this,h);return!0},c.prototype.addListener=function(a,b){var g;if(!d(b))throw TypeError("listener must be a function");return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",a,d(b.listener)?b.listener:b),this._events[a]?e(this._events[a])?this._events[a].push(b):this._events[a]=[this._events[a],b]:this._events[a]=b,e(this._events[a])&&!this._events[a].warned&&(g=f(this._maxListeners)?c.defaultMaxListeners:this._maxListeners)&&g>0&&this._events[a].length>g&&(this._events[a].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[a].length),"function"==typeof console.trace&&console.trace()),this},c.prototype.on=c.prototype.addListener,c.prototype.once=function(a,b){if(!d(b))throw TypeError("listener must be a function");var c=!1;function e(){this.removeListener(a,e),c||(c=!0,b.apply(this,arguments))}return e.listener=b,this.on(a,e),this},c.prototype.removeListener=function(a,b){var c,f,g,h;if(!d(b))throw TypeError("listener must be a function");if(!this._events||!this._events[a])return this;if(g=(c=this._events[a]).length,f=-1,c===b||d(c.listener)&&c.listener===b)delete this._events[a],this._events.removeListener&&this.emit("removeListener",a,b);else if(e(c)){for(h=g;h-- >0;)if(c[h]===b||c[h].listener&&c[h].listener===b){f=h;break}if(f<0)return this;1===c.length?(c.length=0,delete this._events[a]):c.splice(f,1),this._events.removeListener&&this.emit("removeListener",a,b)}return this},c.prototype.removeAllListeners=function(a){var b,c;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[a]&&delete this._events[a],this;if(0===arguments.length){for(b in this._events)"removeListener"!==b&&this.removeAllListeners(b);return this.removeAllListeners("removeListener"),this._events={},this}if(d(c=this._events[a]))this.removeListener(a,c);else if(c)for(;c.length;)this.removeListener(a,c[c.length-1]);return delete this._events[a],this},c.prototype.listeners=function(a){var b;return this._events&&this._events[a]?d(this._events[a])?[this._events[a]]:this._events[a].slice():[]}
1,c.prototype.listenerCount=function(a){if(this._events){var b=this._events[a];if(d(b))return 1;if(b)return b.length}return 0},c.listenerCount=function(a,b){return a.listenerCount(b)}},function(a,b,c){"use strict";var d=function(){function a(b,c){!function(a,b){if(!(a instanceof b))throw TypeError("Cannot call a class as a function")}(this,a),this.subtle=b,this.aesIV=c}return a.prototype.decrypt=function(a,b){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},b,a)},a}(),e=function(){function a(b,c){!function(a,b){if(!(a instanceof b))throw TypeError("Cannot call a class as a function")}(this,a),this.subtle=b,this.key=c}return a.prototype.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},a}(),f=function(){function a(){!function(a,b){if(!(a instanceof b))throw TypeError("Cannot call a class as a function")}(this,a),this.rcon=[0,1,2,4,8,16,32,64,128,27,54],this.subMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.invSubMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.sBox=new Uint32Array(256),this.invSBox=new Uint32Array(256),this.key=new Uint32Array(0),this.initTable()}return a.prototype.uint8ArrayToUint32Array_=function(a){for(var b=new DataView(a),c=new Uint32Array(4),d=0;d<4;d++)c[d]=b.getUint32(4*d);return c},a.prototype.initTable=function(){var a=this.sBox,b=this.invSBox,c=this.subMix,d=c[0],e=c[1],f=c[2],g=c[3],h=this.invSubMix,i=h[0],j=h[1],k=h[2],l=h[3],m=new Uint32Array(256),n=0,o=0,p=0;for(p=0;p<256;p++)p<128?m[p]=p<<1:m[p]=p<<1^283;for(p=0;p<256;p++){var q=o^o<<1^o<<2^o<<3^o<<4;q=q>>>8^255&q^99,a[n]=q,b[q]=n;var r=m[n],s=m[r],t=m[s],u=257*m[q]^16843008*q;d[n]=u<<24|u>>>8,e[n]=u<<16|u>>>16,f[n]=u<<8|u>>>24,g[n]=u,u=16843009*t^65537*s^257*r^16843008*n,i[q]=u<<24|u>>>8,j[q]=u<<16|u>>>16,k[q]=u<<8|u>>>24,l[q]=u,n?(n=r^m[m[m[t^r]]],o^=m[m[o]]):n=o=1}},a.prototype.expandKey=function(a){for(var b=this.uint8ArrayToUint32Array_(a),c=!0,d=0;d<b.length&&c;)c=b[d]===this.key[d],d++;if(!c){this.key=b;var e=this.keySize=b.length;if(4!==e&&6!==e&&8!==e)throw Error("Invalid aes key size="+e);var f=this.ksRows=(e+6+1)*4,g=void 0,h=void 0,i=this.keySchedule=new Uint32Array(f),j=this.invKeySchedule=new Uint32Array(f),k=this.sBox,l=this.rcon,m=this.invSubMix,n=m[0],o=m[1],p=m[2],q=m[3],r=void 0,s=void 0;for(g=0;g<f;g++){if(g<e){r=i[g]=b[g];continue}s=r,g%e==0?(s=k[(s=s<<8|s>>>24)>>>24]<<24|k[s>>>16&255]<<16|k[s>>>8&255]<<8|k[255&s],s^=l[g/e|0]<<24):e>6&&g%e==4&&(s=k[s>>>24]<<24|k[s>>>16&255]<<16|k[s>>>8&255]<<8|k[255&s]),i[g]=r=(i[g-e]^s)>>>0}for(h=0;h<f;h++)g=f-h,s=3&h?i[g]:i[g-4],h<4||g<=4?j[h]=s:j[h]=n[k[s>>>24]]^o[k[s>>>16&255]]^p[k[s>>>8&255]]^q[k[255&s]],j[h]=j[h]>>>0}},a.prototype.networkToHostOrderSwap=function(a){return a<<24|(65280&a)<<8|(16711680&a)>>8|a>>>24},a.prototype.decrypt=function(a,b,c,d){for(var e,f,g,h=this.keySize+6,i=this.invKeySchedule,j=this.invSBox,k=this.invSubMix,l=k[0],m=k[1],n=k[2],o=k[3],p=this.uint8ArrayToUint32Array_(c),q=p[0],r=p[1],s=p[2],t=p[3],u=new Int32Array(a),v=new Int32Array(u.length),w=void 0,x=void 0,y=void 0,z=void 0,A=void 0,B=void 0,C=void 0,D=void 0,E=void 0,F=void 0,G=void 0,H=void 0,I=void 0,J=void 0,K=this.networkToHostOrderSwap;b<u.length;){for(J=1,E=K(u[b]),F=K(u[b+1]),G=K(u[b+2]),H=K(u[b+3]),A=E^i[0],B=H^i[1],C=G^i[2],D=F^i[3],I=4;J<h;J++)w=l[A>>>24]^m[B>>16&255]^n[C>>8&255]^o[255&D]^i[I],x=l[B>>>24]^m[C>>16&255]^n[D>>8&255]^o[255&A]^i[I+1],y=l[C>>>24]^m[D>>16&255]^n[A>>8&255]^o[255&B]^i[I+2],z=l[D>>>24]^m[A>>16&255]^n[B>>8&255]^o[255&C]^i[I+3],A=w,B=x,C=y,D=z,I+=4;w=j[A>>>24]<<24^j[B>>16&255]<<16^j[C>>8&255]<<8^j[255&D]^i[I],x=j[B>>>24]<<24^j[C>>16&255]<<16^j[D>>8&255]<<8^j[255&A]^i[I+1],y=j[C>>>24]<<24^j[D>>16&255]<<16^j[A>>8&255]<<8^j[255&B]^i[I+2],z=j[D>>>24]<<24^j[A>>16&255]<<16^j[B>>8&255]<<8^j[255&C]^i[I+3],I+=3,v[b]=K(w^q),v[b+1]=K(z^r),v[b+2]=K(y^s),v[b+3]=K(x^t),q=E,r=F,s=G,t=H,b+=4}return d?(g=(f=(e=v.buffer).byteLength)&&new DataView(e).getUint8(f-1))?e.slice(0,f-g):e:v.buffer},a.prototype.destroy=function(){this.key=void 0,this.keySize=void 0,this.ksRows=void 0,this.sBox=void 0,this.invSBox=void 0,this.subMix=void 0,this.invSubMix=void 0,this.keySchedule=void 0,this.invKeySchedule=void 0,this.rcon=void 0},a}(),g=c(2),h=c(0),i=c(1),j=c(4),k=Object(j.a)(),l=function(){function a(b,c){var d=arguments.length>2&& void 0!==arguments[2]?arguments[2]:{},e=d.removePKCS7Padding,f=void 0===e||e;if(!function(a,b){if(!(a instanceof b))throw TypeError("Cannot call a class as a function")}(this,a),this.logEnabled=!0,this.observer=b,this.config=c,this.removePKCS7Padding=f,f)try{var g=k.crypto;g&&(this.subtle=g.subtle||g.webkitSubtle)}catch(h){}this.disableWebCrypto=!this.subtle}return a.prototype.isSync=function(){return this.disableWebCrypto&&this.config.enableSoftw
1areAES},a.prototype.decrypt=function(a,b,c,g){var i=this;if(this.disableWebCrypto&&this.config.enableSoftwareAES){this.logEnabled&&(h.b.log("JS AES decrypt"),this.logEnabled=!1);var j=this.decryptor;j||(this.decryptor=j=new f),j.expandKey(b),g(j.decrypt(a,0,c,this.removePKCS7Padding))}else{this.logEnabled&&(h.b.log("WebCrypto AES decrypt"),this.logEnabled=!1);var k=this.subtle;this.key!==b&&(this.key=b,this.fastAesKey=new e(k,b)),this.fastAesKey.expandKey().then(function(e){new d(k,c).decrypt(a,e).catch(function(d){i.onWebCryptoError(d,a,b,c,g)}).then(function(a){g(a)})}).catch(function(d){i.onWebCryptoError(d,a,b,c,g)})}},a.prototype.onWebCryptoError=function(a,b,c,d,e){this.config.enableSoftwareAES?(h.b.log("WebCrypto Error, disable WebCrypto API"),this.disableWebCrypto=!0,this.logEnabled=!0,this.decrypt(b,c,d,e)):(h.b.error("decrypting error : "+a.message),this.observer.trigger(i.a.ERROR,{type:g.b.MEDIA_ERROR,details:g.a.FRAG_DECRYPT_ERROR,fatal:!0,reason:a.message}))},a.prototype.destroy=function(){var a=this.decryptor;a&&(a.destroy(),this.decryptor=void 0)},a}();b.a=l},function(a,b,c){"use strict";var d=c(0),e=c(1),f=function(){function a(b,c){!function(a,b){if(!(a instanceof b))throw TypeError("Cannot call a class as a function")}(this,a),this.observer=b,this.remuxer=c}return a.prototype.resetTimeStamp=function(a){this.initPTS=a},a.prototype.resetInitSegment=function(b,c,d,f){if(b&&b.byteLength){var g=this.initData=a.parseInitSegment(b);null==c&&(c="mp4a.40.5"),null==d&&(d="avc1.42e01e");var h={};g.audio&&g.video?h.audiovideo={container:"video/mp4",codec:c+","+d,initSegment:f?b:null}:(g.audio&&(h.audio={container:"audio/mp4",codec:c,initSegment:f?b:null}),g.video&&(h.video={container:"video/mp4",codec:d,initSegment:f?b:null})),this.observer.trigger(e.a.FRAG_PARSING_INIT_SEGMENT,{tracks:h})}else c&&(this.audioCodec=c),d&&(this.videoCodec=d)},a.probe=function(b){return a.findBox({data:b,start:0,end:Math.min(b.length,16384)},["moof"]).length>0},a.bin2str=function(a){return String.fromCharCode.apply(null,a)},a.readUint16=function(a,b){a.data&&(b+=a.start,a=a.data);var c=a[b]<<8|a[b+1];return c<0?65536+c:c},a.readUint32=function(a,b){a.data&&(b+=a.start,a=a.data);var c=a[b]<<24|a[b+1]<<16|a[b+2]<<8|a[b+3];return c<0?4294967296+c:c},a.writeUint32=function(a,b,c){a.data&&(b+=a.start,a=a.data),a[b]=c>>24,a[b+1]=c>>16&255,a[b+2]=c>>8&255,a[b+3]=255&c},a.findBox=function(b,c){var d=[],e=void 0,f=void 0,g=void 0,h=void 0,i=void 0,j=void 0,k=void 0;if(b.data?(j=b.start,h=b.end,b=b.data):(j=0,h=b.byteLength),!c.length)return null;for(e=j;e<h;)f=a.readUint32(b,e),g=a.bin2str(b.subarray(e+4,e+8)),k=f>1?e+f:h,g===c[0]&&(1===c.length?d.push({data:b,start:e+8,end:k}):(i=a.findBox({data:b,start:e+8,end:k},c.slice(1))).length&&(d=d.concat(i))),e=k;return d},a.parseSegmentIndex=function(b){var c=a.findBox(b,["moov"])[0],d=c?c.end:null,e=0,f=a.findBox(b,["sidx"]),g=void 0;if(!f||!f[0])return null;g=[];var h=(f=f[0]).data[0];e=0===h?8:16;var i=a.readUint32(f,e);e+=4;var j=0;0===h?e+=8:e+=16,e+=2;var k=f.end+j,l=a.readUint16(f,e);e+=2;for(var m=0;m<l;m++){var n=e,o=a.readUint32(f,n);n+=4;var p=2147483647&o;if(1==(2147483648&o)>>>31){console.warn("SIDX has hierarchical references (not supported)");return}var q=a.readUint32(f,n);n+=4,g.push({referenceSize:p,subsegmentDuration:q,info:{duration:q/i,start:k,end:k+p-1}}),k+=p,n+=4,e=n}return{earliestPresentationTime:0,timescale:i,version:h,referencesCount:l,references:g,moovEndOffset:d}},a.parseInitSegment=function(b){var c=[];return a.findBox(b,["moov","trak"]).forEach(function(b){var e=a.findBox(b,["tkhd"])[0];if(e){var f=e.data[e.start],g=0===f?12:20,h=a.readUint32(e,g),i=a.findBox(b,["mdia","mdhd"])[0];if(i){g=0===(f=i.data[i.start])?12:20;var j=a.readUint32(i,g),k=a.findBox(b,["mdia","hdlr"])[0];if(k){var l={soun:"audio",vide:"video"}[a.bin2str(k.data.subarray(k.start+8,k.start+12))];if(l){var m=a.findBox(b,["mdia","minf","stbl","stsd"]);if(m.length){m=m[0];var n=a.bin2str(m.data.subarray(m.start+12,m.start+16));d.b.log("MP4Demuxer:"+l+":"+n+" found")}c[h]={timescale:j,type:l},c[l]={timescale:j,id:h}}}}}}),c},a.getStartDTS=function(b,c){var d=void 0,e=void 0,f=void 0;return d=a.findBox(c,["moof","traf"]),e=[].concat.apply([],d.map(function(c){return a.findBox(c,["tfhd"]).map(function(d){var e=void 0,f=void 0,g=void 0;return f=b[a.readUint32(d,4)].timescale||9e4,g=a.findBox(c,["tfdt"]).map(function(b){var c=void 0,d=void 0;
1return c=b.data[b.start],d=a.readUint32(b,4),1===c&&(d*=4294967296,d+=a.readUint32(b,8)),d})[0],g/f})})),isFinite(f=Math.min.apply(null,e))?f:0},a.offsetStartDTS=function(b,c,d){a.findBox(c,["moof","traf"]).map(function(c){return a.findBox(c,["tfhd"]).map(function(e){var f=b[a.readUint32(e,4)].timescale||9e4;a.findBox(c,["tfdt"]).map(function(b){var c=b.data[b.start],e=a.readUint32(b,4);if(0===c)a.writeUint32(b,4,e-d*f);else{e*=4294967296,e+=a.readUint32(b,8),e-=d*f,e=Math.max(e,0);var g=Math.floor(e/4294967296),h=Math.floor(e%4294967296);a.writeUint32(b,4,g),a.writeUint32(b,8,h)}})})})},a.prototype.append=function(b,c,d,f){var g=this.initData;g||(this.resetInitSegment(b,this.audioCodec,this.videoCodec,!1),g=this.initData);var h=void 0,i=this.initPTS;if(void 0===i){var j=a.getStartDTS(g,b);this.initPTS=i=j-c,this.observer.trigger(e.a.INIT_PTS_FOUND,{initPTS:i})}a.offsetStartDTS(g,b,i),h=a.getStartDTS(g,b),this.remuxer.remux(g.audio,g.video,null,null,h,d,f,b)},a.prototype.destroy=function(){},a}();b.a=f},function(a,b,c){"use strict";var d=c(1),e=c(2),f=c(8),g=c(3),h=c(0),i=c(4);function j(a,b){return 255===a[b]&&(246&a[b+1])==240}function k(a,b){return 1&a[b+1]?7:9}function l(a,b){return(3&a[b+3])<<11|a[b+4]<<3|(224&a[b+5])>>>5}function m(a,b){return!!(b+1<a.length&&j(a,b))}function n(a,b){if(b+1<a.length&&j(a,b)){var c=k(a,b);b+5<a.length&&(c=l(a,b));var d=b+c;if(d===a.length||d+1<a.length&&j(a,d))return!0}return!1}function o(a,b,c,f,g){if(!a.samplerate){var i=function(a,b,c,f){var g=void 0,i=void 0,j=void 0,k=void 0,l=void 0,m=navigator.userAgent.toLowerCase(),n=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];if(g=((192&b[c+2])>>>6)+1,i=(60&b[c+2])>>>2,i>n.length-1){a.trigger(d.a.ERROR,{type:e.b.MEDIA_ERROR,details:e.a.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+i});return}return k=(1&b[c+2])<<2,k|=(192&b[c+3])>>>6,h.b.log("manifest codec:"+f+",ADTS data:type:"+g+",sampleingIndex:"+i+"["+n[i]+"Hz],channelConfig:"+k),/firefox/i.test(m)?i>=6?(g=5,l=[,,,,],j=i-3):(g=2,l=[,,],j=i):-1!==m.indexOf("android")?(g=2,l=[,,],j=i):(g=5,l=[,,,,],f&&(-1!==f.indexOf("mp4a.40.29")|| -1!==f.indexOf("mp4a.40.5"))|| !f&&i>=6?j=i-3:((f&& -1!==f.indexOf("mp4a.40.2")&&(i>=6&&1===k||/vivaldi/i.test(m))|| !f&&1===k)&&(g=2,l=[,,]),j=i)),l[0]=g<<3,l[0]|=(14&i)>>1,l[1]|=(1&i)<<7,l[1]|=k<<3,5===g&&(l[1]|=(14&j)>>1,l[2]=(1&j)<<7,l[2]|=8,l[3]=0),{config:l,samplerate:n[i],channelCount:k,codec:"mp4a.40."+g,manifestCodec:f}}(b,c,f,g);a.config=i.config,a.samplerate=i.samplerate,a.channelCount=i.channelCount,a.codec=i.codec,a.manifestCodec=i.manifestCodec,h.b.log("parsed codec:"+a.codec+",rate:"+i.samplerate+",nb channel:"+i.channelCount)}
1}function p(a,b,c,d,e){var f,g=function(a,b,c,d,e){var f=void 0,g=void 0,h=void 0,i=a.length;if(f=k(a,b),g=l(a,b),(g-=f)>0&&b+f+g<=i)return{headerLength:f,frameLength:g,stamp:c+d*e}}(b,c,d,e,9216e4/(f=a.samplerate));if(g){var h=g.stamp,i=g.headerLength,j=g.frameLength,m={unit:b.subarray(c+i,c+i+j),pts:h,dts:h};return a.samples.push(m),a.len+=j,{sample:m,length:j+i}}}var q=c(6),r=function(){function a(b,c,d){!function(a,b){if(!(a instanceof b))throw TypeError("Cannot call a class as a function")}(this,a),this.observer=b,this.config=d,this.remuxer=c}return a.prototype.resetInitSegment=function(a,b,c,d){this._audioTrack={container:"audio/adts",type:"audio",id:0,sequenceNumber:0,isAAC:!0,samples:[],len:0,manifestCodec:b,duration:d,inputTimeScale:9e4}},a.prototype.resetTimeStamp=function(){},a.probe=function(a){if(!a)return!1;for(var b=(q.a.getID3Data(a,0)||[]).length,c=a.length;b<c;b++)if(n(a,b))return h.b.log("ADTS sync word found !"),!0;return!1},a.prototype.append=function(a,b,c,d){for(var e=this._audioTrack,f=q.a.getID3Data(a,0)||[],i=q.a.getTimeStamp(f),j=Object(g.a)(i)?90*i:9e4*b,k=0,l=j,n=a.length,r=f.length,s=[{pts:l,dts:l,data:f}];r<n-1;)if(m(a,r)&&r+5<n){o(e,this.observer,a,r,e.manifestCodec);var t=p(e,a,r,j,k);if(t)r+=t.length,l=t.sample.pts,k++;else{h.b.log("Unable to parse AAC frame");break}}else q.a.isHeader(a,r)?(f=q.a.getID3Data(a,r),s.push({pts:l,dts:l,data:f}),r+=f.length):r++;this.remuxer.remux(e,{samples:[]},{samples:s,inputTimeScale:9e4},{samples:[]},b,c,d)},a.prototype.destroy=function(){},a}(),s=c(9),t={BitratesMap:[32,64,96,128,160,192,224,256,288,320,352,384,416,448,32,48,56,64,80,96,112,128,160,192,224,256,320,384,32,40,48,56,64,80,96,112,128,160,192,224,256,320,32,48,56,64,80,96,112,128,144,160,176,192,224,256,8,16,24,32,40,48,56,64,80,96,112,128,144,160],SamplingRateMap:[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],SamplesCoefficients:[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],BytesInSlot:[0,1,1,4],appendFrame:function(a,b,c,d,e){if(!(c+24>b.length)){var f=this.parseHeader(b,c);if(f&&c+f.frameLength<=b.length){var g=d+e*(9e4*f.samplesPerFrame/f.sampleRate),h={unit:b.subarray(c,c+f.frameLength),pts:g,dts:g};return a.config=[],a.channelCount=f.channelCount,a.samplerate=f.sampleRate,a.samples.push(h),a.len+=f.frameLength,{sample:h,length:f.frameLength}}}},parseHeader:function(a,b){var c=a[b+1]>>3&3,d=a[b+1]>>1&3,e=a[b+2]>>4&15,f=a[b+2]>>2&3,g=a[b+2]>>1&1;if(1!==c&&0!==e&&15!==e&&3!==f){var h=3===c?3-d:3===d?3:4,i=1e3*t.BitratesMap[14*h+e-1],j=3===c?0:2===c?1:2,k=t.SamplingRateMap[3*j+f],l=a[b+3]>>6==3?1:2,m=t.SamplesCoefficients[c][d],n=t.BytesInSlot[d],o=8*m*n,p=parseInt(m*i/k+g,10)*n;return{sampleRate:k,channelCount:l,frameLength:p,samplesPerFrame:o}}},isHeaderPattern:function(a,b){return 255===a[b]&&(224&a[b+1])==224&&(6&a[b+1])!=0},isHeader:function(a,b){return!!(b+1<a.length&&this.isHeaderPattern(a,b))},probe:function(a,b){if(b+1<a.length&&this.isHeaderPattern(a,b)){var c=4,d=this.parseHeader(a,b),e=c;d&&d.frameLength&&(e=d.frameLength);var f=b+e;if(f===a.length||f+1<a.length&&this.isHeaderPattern(a,f))return!0}return!1}},u=t,v=function(){function a(b){!function(a,b){if(!(a instanceof b))throw TypeError("Cannot call a class as a function")}(this,a),this.data=b,this.bytesAvailable=b.byteLength,this.word=0,this.bitsAvailable=0}return a.prototype.loadWord=function(){var a=this.data,b=this.bytesAvailable,c=a.byteLength-b,d=new Uint8Array(4),e=Math.min(4,b);if(0===e)throw Error("no bytes available");d.set(a.subarray(c,c+e)),this.word=new DataView(d.buffer).getUint32(0),this.bitsAvailable=8*e,this.bytesAvailable-=e},a.prototype.skipBits=function(a){var b=void 0;this.bitsAvailable>a?(this.word<<=a,this.bitsAvailable-=a):(a-=this.bitsAvailable,b=a>>3,a-=b>>3,this.bytesAvailable-=b,this.loadWord(),this.word<<=a,this.bitsAvailable-=a)},a.prototype.readBits=function(a){var b=Math.min(this.bitsAvailable,a),c=this.word>>>32-b;return(a>32&&h.b.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=b,this.bitsAvailable>0?this.word<<=b:this.bytesAvailable>0&&this.loadWord(),(b=a-b)>0&&this.bitsAvailable)?c<<b|this.readBits(b):c},a.prototype.skipLZ=function(){var a=void 0;for(a=0;a<this.bitsAvailable;++a)if((this.word&2147483648>>>a)!=0)return this.word<<=a,this.bitsAvailable-=a,a;return this.loadWord(),a+this.skipLZ()},a.prototype.skipUEG=function(){this.skipBits(1+this.skipLZ())},a.prototype.skipEG=function(){this.skipBits(1+this.skipLZ())},a.prototype.readUEG=function(){var a=this.skipLZ();return this.readBits(a+1)-1},a.prototype.readEG=function(){var a=this.readUEG();return 1&a?1+a>>>1:-1*(a>>>1)},a.prototype.readBoolean=function(){return 1===this.readBits(1)},a.prototype.readUByte=function(){return this.readBits(8)},a.prototype.readUShort=function(){return this.readBits(16)},a.prototype.readUInt=function(){return this.readBits(32)},a.prototype.skipScalingList=function(a){var b=8,c=8,d=void 0,e=void 0;for(d=0;d<a;d++)0!==c&&(c=(b+this.readEG()+256)%256),b=0===c?b:c},a.prototype.readSPS=function(){var a=0,b=0,c=0,d=0,e=void 0,f=void 0,g=void 0,h=void 0,i=void 0,j=void 0,k=void 0,l=this.readUByte.bind(this),m=this.readBits.bind(this),n=this.readUEG.bind(this),o=this.readBoolean.bind(this),p=this.skipBits.bind(this),q=this.skipEG.bind(this),r=this.skipUEG.bind(this),s=this.skipScalingList.bind(this);if(l(),e=l(),m(5),p(3),l(),r(),100===e||110===e||122===e||244===e||44===e||83===e||86===e||118===e||128===e){var t=n();if(3===t&&p(1),r(),r(),p(1),o())for(k=0,j=3!==t?8:12;k<j;k++)o()&&s(k<6?16:64)}r();var u=n();if(0===u)n();else if(1===u)for(p(1),q(),q(),f=n(),k=0;k<f;k++)q();r(),p(1),g=n(),h=n(),i=m(1),0===i&&p(1),p(1),o()&&(a=n(),b=n(),c=n(),d=n());var v=[1,1];if(o()&&o()){var w=l();switch(w){case 1:v=[1,1];break;case 2:v=[12,11];break;case 3:v=[10,11];break;case 4:v=[16,11];break;case 5:v=[40,33];break;case 6:v=[24,11];break;case 7:v=[20,11];break;case 8:v=[32,11];break;case 9:v=[80,33];break;case 10:v=[18,11];break;case 11:v=[15,11];break;case 12:v=[64,33];break;case 13:v=[160,99];break;case 14:v=[4,3];break;case 15:v=[3,2];break;case 16:v=[2,1];break;case 255:v=[l()<<8|l(),l()<<8|l()]}}return{width:Math.ceil((g+1)*16-2*a-2*b),height:(2-i)*(h+1)*16-(i?2:4)*(c+d),pixelRatio:v}},a.prototype.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},a}(),w=function(){function a(b,c,d,e){!function(a,b){if(!(a instanceof b))throw TypeError("Cannot call a class as a function")}(this,a),this.decryptdata=d,this.discardEPB=e,this.decrypter=new f.a(b,c,{removePKCS7Padding:!1})}return a.prototype.decryptBuffer=function(a,b){this.decrypter.decrypt(a,this.decryptdata.key.buffer,this.decryptdata.iv.buffer,b)},a.prototype.decryptAacSample=function(a,b,c,d){var e=a[b].unit,f=e.subarray(16,e.length-e.length%16),g=f.buffer.slice(f.byteOffset,f.byteOffset+f.length),h=this;this.decryptBuffer(g,function(f){f=new Uint8Array(f),e.set(f,16),d||h.decryptAacSamples(a,b+1,c)})},a.prototype.decryptAacSamples=function(a,b,c){for(;;b++){if(b>=a.length){c();return}if(!(a[b].unit.length<32)){var d=this.decrypter.isSync();if(this.decryptAacSample(a,b,c,d),!d)return}}}
vendor: 9,148 bytes, line 1
1,a.prototype.getAvcEncryptedData=function(a){for(var b=16*Math.floor((a.length-48)/160)+16,c=new Int8Array(b),d=0,e=32;e<=a.length-16;e+=160,d+=16)c.set(a.subarray(e,e+16),d);return c},a.prototype.getAvcDecryptedUnit=function(a,b){b=new Uint8Array(b);for(var c=0,d=32;d<=a.length-16;d+=160,c+=16)a.set(b.subarray(c,c+16),d);return a},a.prototype.decryptAvcSample=function(a,b,c,d,e,f){var g=this.discardEPB(e.data),h=this.getAvcEncryptedData(g),i=this;this.decryptBuffer(h.buffer,function(h){e.data=i.getAvcDecryptedUnit(g,h),f||i.decryptAvcSamples(a,b,c+1,d)})},a.prototype.decryptAvcSamples=function(a,b,c,d){for(;;b++,c=0){if(b>=a.length){d();return}for(var e=a[b].units;!(c>=e.length);c++){var f=e[c];if(!(f.length<=48)&&(1===f.type||5===f.type)){var g=this.decrypter.isSync();if(this.decryptAvcSample(a,b,c,d,f,g),!g)return}}}},a}(),x={video:1,audio:2,id3:3,text:4},y=function(){function a(b,c,d,e){!function(a,b){if(!(a instanceof b))throw TypeError("Cannot call a class as a function")}(this,a),this.observer=b,this.config=d,this.typeSupported=e,this.remuxer=c,this.sampleAes=null}return a.prototype.setDecryptData=function(a){null!=a&&null!=a.key&&"SAMPLE-AES"===a.method?this.sampleAes=new w(this.observer,this.config,a,this.discardEPB):this.sampleAes=null},a.probe=function(b){var c=a._syncOffset(b);return!(c<0)&&(c&&h.b.warn("MPEG2-TS detected but first sync word found @ offset "+c+", junk ahead ?"),!0)},a._syncOffset=function(a){for(var b=Math.min(1e3,a.length-564),c=0;c<b;){if(71===a[c]&&71===a[c+188]&&71===a[c+376])return c;c++}return -1},a.createTrack=function(a,b){return{container:"video"===a||"audio"===a?"video/mp2t":void 0,type:a,id:x[a],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],len:0,dropped:"video"===a?0:void 0,isAAC:"audio"===a||void 0,duration:"audio"===a?b:void 0}},a.prototype.resetInitSegment=function(b,c,d,e){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=a.createTrack("video",e),this._audioTrack=a.createTrack("audio",e),this._id3Track=a.createTrack("id3",e),this._txtTrack=a.createTrack("text",e),this.aacOverFlow=null,this.aacLastPTS=null,this.avcSample=null,this.audioCodec=c,this.videoCodec=d,this._duration=e},a.prototype.resetTimeStamp=function(){},a.prototype.append=function(b,c,f,g){var i=void 0,j=b.length,k=void 0,l=void 0,m=void 0,n=void 0,o=void 0,p=!1;this.contiguous=f;var q=this.pmtParsed,r=this._avcTrack,s=this._audioTrack,t=this._id3Track,u=r.pid,v=s.pid,w=t.pid,x=this._pmtId,y=r.pesData,z=s.pesData,A=t.pesData,B=this._parsePAT,C=this._parsePMT,D=this._parsePES,E=this._parseAVCPES.bind(this),F=this._parseAACPES.bind(this),G=this._parseMPEGPES.bind(this),H=this._parseID3PES.bind(this),I=a._syncOffset(b);for(j-=(j+I)%188,i=I;i<j;i+=188)if(71===b[i]){if(k=!!(64&b[i+1]),l=((31&b[i+1])<<8)+b[i+2],m=(48&b[i+3])>>4,m>1){if((n=i+5+b[i+4])===i+188)continue}else n=i+4;switch(l){case u:k&&(y&&(o=D(y))&& void 0!==o.pts&&E(o,!1),y={data:[],size:0}),y&&(y.data.push(b.subarray(n,i+188)),y.size+=i+188-n);break;case v:k&&(z&&(o=D(z))&& void 0!==o.pts&&(s.isAAC?F(o):G(o)),z={data:[],size:0}),z&&(z.data.push(b.subarray(n,i+188)),z.size+=i+188-n);break;case w:k&&(A&&(o=D(A))&& void 0!==o.pts&&H(o),A={data:[],size:0}),A&&(A.data.push(b.subarray(n,i+188)),A.size+=i+188-n);break;case 0:k&&(n+=b[n]+1),x=this._pmtId=B(b,n);break;case x:k&&(n+=b[n]+1);var J=C(b,n,!0===this.typeSupported.mpeg|| !0===this.typeSupported.mp3,null!=this.sampleAes);(u=J.avc)>0&&(r.pid=u),(v=J.audio)>0&&(s.pid=v,s.isAAC=J.isAAC),(w=J.id3)>0&&(t.pid=w),p&&!q&&(h.b.log("reparse from beginning"),p=!1,i=I-188),q=this.pmtParsed=!0;break;case 17:case 8191:break;default:p=!0}}else this.observer.trigger(d.a.ERROR,{type:e.b.MEDIA_ERROR,details:e.a.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});y&&(o=D(y))&& void 0!==o.pts?(E(o,!0),r.pesData=null):r.pesData=y,z&&(o=D(z))&& void 0!==o.pts?(s.isAAC?F(o):G(o),s.pesData=null):(z&&z.size&&h.b.log("last AAC PES packet truncated,might overlap between fragments"),s.pesData=z),A&&(o=D(A))&& void 0!==o.pts?(H(o),t.pesData=null):t.pesData=A,null==this.sampleAes?this.remuxer.remux(s,r,t,this._txtTrack,c,f,g):this.decryptAndRemux(s,r,t,this._txtTrack,c,f,g)},a.prototype.decryptAndRemux=function(a,b,c,d,e,f,g){if(a.samples&&a.isAAC){var h=this;this.sampleAes.decryptAacSamples(a.samples,0,function(){h.decryptAndRemuxAvc(a,b,c,d,e,f,g)})}else this.decryptAndRemuxAvc(a,b,c,d,e,f,g)},a.prototype.decryptAndRemuxAvc=function(a,b,c,d,e,f,g){if(b.samples){var h=this;this.sampleAes.decryptAvcSamples(b.samples,0,0,function(){h.remuxer.remux(a,b,c,d,e,f,g)})}else this.remuxer.remux(a,b,c,d,e,f,g)},a.prototype.destroy=function(){this._initPTS=this._initDTS=void 0,this._duration=0},a.prototype._parsePAT=function(a,b){return(31&a[b+10])<<8|a[b+11]},a.prototype._parsePMT=function(a,b,c,d){var e=void 0,f=void 0,g=void 0,i=void 0,j={audio:-1,avc:-1,id3:-1,isAAC:!0};for(e=(15&a[b+1])<<8|a[b+2],f=b+3+e-4,g=(15&a[b+10])<<8|a[b+11],b+=12+g;b<f;){switch(i=(31&a[b+1])<<8|a[b+2],a[b]){case 207:if(!d){h.b.log("unkown stream type:"+a[b]);break}case 15:-1===j.audio&&(j.audio=i);break;case 21:-1===j.id3&&(j.id3=i);break;case 219:if(!d){h.b.log("unkown stream type:"+a[b]);break}case 27:-1===j.avc&&(j.avc=i);break;case 3:case 4:c?-1===j.audio&&(j.audio=i,j.isAAC=!1):h.b.log("MPEG audio found, not supported in this browser for now");break;case 36:h.b.warn("HEVC stream type found, not supported for now");break;default:h.b.log("unkown stream type:"+a[b])}b+=((15&a[b+3])<<8|a[b+4])+5}return j},a.prototype._parsePES=function(a){var b=0,c=void 0,d=void 0,e=void 0,f=void 0,g=void 0,i=void 0,j=void 0,k=void 0,l=void 0,m=a.data;if(!a||0===a.size)return null;for(;m[0].length<19&&m.length>1;){var n=new Uint8Array(m[0].length+m[1].length);n.set(m[0]),n.set(m[1],m[0].length),m[0]=n,m.splice(1,1)}if(1!==((c=m[0])[0]<<16)+(c[1]<<8)+c[2]||(f=(c[4]<<8)+c[5])&&f>a.size-6)return null;192&(d=c[7])&&((j=(14&c[9])*536870912+(255&c[10])*4194304+(254&c[11])*16384+(255&c[12])*128+(254&c[13])/2)>4294967295&&(j-=8589934592),64&d?((k=(14&c[14])*536870912+(255&c[15])*4194304+(254&c[16])*16384+(255&c[17])*128+(254&c[18])/2)>4294967295&&(k-=8589934592),j-k>54e5&&(h.b.warn(Math.round((j-k)/9e4)+"s delta between PTS and DTS, align them"),j=k)):k=j),l=(g=c[8])+9,a.size-=l,i=new Uint8Array(a.size);for(var o=0,p=m.length;o<p;o++){var q=(c=m[o]).byteLength;if(l){if(l>q){l-=q;continue}c=c.subarray(l),q-=l,l=0}i.set(c,b),b+=q}return f&&(f-=g+3),{data:i,pts:j,dts:k,len:f}},a.prototype.pushAccesUnit=function(a,b){if(a.units.length&&a.frame){var c=b.samples,d=c.length;!this.config.forceKeyFrameOnDiscontinuity|| !0===a.key||b.sps&&(d||this.contiguous)?(a.id=d,c.push(a)):b.dropped++}a.debug.length&&h.b.log(a.pts+"/"+a.dts+":"+a.debug)},a.prototype._parseAVCPES=function(a,b){var c=this,d=this._avcTrack,e=this._parseAVCNALu(a.data),f=void 0,g=this.avcSample,h=void 0,i=!1,j=void 0,k=this.pushAccesUnit.bind(this),l=function(a,b,c,d){return{key:a,pts:b,dts:c,units:[],debug:d}};a.data=null,g&&e.length&&!d.audFound&&(k(g,d),g=this.avcSample=l(!1,a.pts,a.dts,"")),e.forEach(function(b){switch(b.type){case 1:h=!0,g||(g=c.avcSample=l(!0,a.pts,a.dts,"")),g.frame=!0;var e=b.data;if(i&&e.length>4){var m=new v(e).readSliceType();(2===m||4===m||7===m||9===m)&&(g.key=!0)}break;case 5:h=!0,g||(g=c.avcSample=l(!0,a.pts,a.dts,"")),g.key=!0,g.frame=!0;break;case 6:h=!0,(f=new v(c.discardEPB(b.data))).readUByte();for(var n=0,o=0,p=!1,q=0;!p&&f.bytesAvailable>1;){n=0;do n+=q=f.readUByte();while(255===q)o=0;do o+=q=f.readUByte();while(255===q)if(4===n&&0!==f.bytesAvailable){if(p=!0,181===f.readUByte()&&49===f.readUShort()&&1195456820===f.readUInt()&&3===f.readUByte()){var r=f.readUByte(),s=f.readUByte(),t=31&r,u=[r,s];for(j=0;j<t;j++)u.push(f.readUByte()),u.push(f.readUByte()),u.push(f.readUByte());c._insertSampleInOrder(c._txtTrack.samples,{type:3,pts:a.pts,bytes:u})}}else if(o<f.bytesAvailable)for(j=0;j<o;j++)f.readUByte()}break;case 7:if(h=!0,i=!0,!d.sps){var w=(f=new v(b.data)).readSPS();d.width=w.width,d.height=w.height,d.pixelRatio=w.pixelRatio,d.sps=[b.data],d.duration=c._duration;var x=b.data.subarray(1,4),y="avc1.";for(j=0;j<3;j++){var z=x[j].toString(16);z.length<2&&(z="0"+z),y+=z}d.codec=y}break;case 8:h=!0,d.pps||(d.pps=[b.data]);break;case 9:h=!1,d.audFound=!0,g&&k(g,d),g=c.avcSample=l(!1,a.pts,a.dts,"");break;case 12:h=!1;break;default:h=!1,g&&(g.debug+="unknown NAL "+b.type+" ")}g&&h&&g.units.push(b)}),b&&g&&(k(g,d),this.avcSample=null)},a.prototype._insertSampleInOrder=function(a,b){var c=a.length;if(c>0){if(b.pts>=a[c-1].pts)a.push(b);else for(var d=c-1;d>=0;d--)if(b.pts<a[d].pts){a.splice(d,0,b);break}}else a.push(b)},a.prototype._getLastNalUnit=function(){var a=this.avcSample,b=void 0;if(!a||0===a.units.length){var c=this._avcTrack.samples;a=c[c.length-1]}if(a){var d=a.units;b=d[d.length-1]}return b},a.prototype._parseAVCNALu=function(a){var b=0,c=a.byteLength,d=void 0,e=void 0,f=this._avcTrack,g=f.naluState||0,h=g,i=[],j=void 0,k=void 0,l=-1,m=void 0;for(-1===g&&(l=0,m=31&a[0],g=0,b=1);b<c;){if(d=a[b++],!g){g=d?0:1;continue}if(1===g){g=d?0:2;continue}if(d){if(1===d){if(l>=0)j={data:a.subarray(l,b-g-1),type:m},i.push(j);
1else{var n=this._getLastNalUnit();if(n&&(h&&b<=4-h&&n.state&&(n.data=n.data.subarray(0,n.data.byteLength-h)),(e=b-g-1)>0)){var o=new Uint8Array(n.data.byteLength+e);o.set(n.data,0),o.set(a.subarray(0,e),n.data.byteLength),n.data=o}}b<c?(k=31&a[b],l=b,m=k,g=0):g=-1}else g=0}else g=3}if(l>=0&&g>=0&&(j={data:a.subarray(l,c),type:m,state:g},i.push(j)),0===i.length){var p=this._getLastNalUnit();if(p){var q=new Uint8Array(p.data.byteLength+a.byteLength);q.set(p.data,0),q.set(a,p.data.byteLength),p.data=q}}return f.naluState=g,i},a.prototype.discardEPB=function(a){for(var b=a.byteLength,c=[],d=1,e=void 0,f=void 0;d<b-2;)0===a[d]&&0===a[d+1]&&3===a[d+2]?(c.push(d+2),d+=2):d++;if(0===c.length)return a;e=b-c.length,f=new Uint8Array(e);var g=0;for(d=0;d<e;g++,d++)g===c[0]&&(g++,c.shift()),f[d]=a[g];return f},a.prototype._parseAACPES=function(a){var b,c=this._audioTrack,f=a.data,g=a.pts,i=this.aacOverFlow,j=this.aacLastPTS,k=void 0,l=void 0,n=void 0,q=void 0,r=void 0;if(i){var s=new Uint8Array(i.byteLength+f.byteLength);s.set(i,0),s.set(f,i.byteLength),f=s}for(n=0,r=f.length;n<r-1&&!m(f,n);n++);if(n){var t=void 0,u=void 0;if(n<r-1?(t="AAC PES did not start with ADTS header,offset:"+n,u=!1):(t="no ADTS header found in AAC PES",u=!0),h.b.warn("parsing error:"+t),this.observer.trigger(d.a.ERROR,{type:e.b.MEDIA_ERROR,details:e.a.FRAG_PARSING_ERROR,fatal:u,reason:t}),u)return}if(o(c,this.observer,f,n,this.audioCodec),l=0,k=9216e4/(b=c.samplerate),i&&j){var v=j+k;Math.abs(v-g)>1&&(h.b.log("AAC: align PTS for overlapping frames by "+Math.round((v-g)/90)),g=v)}for(;n<r;)if(m(f,n)&&n+5<r){var w=p(c,f,n,g,l);if(w)n+=w.length,q=w.sample.pts,l++;else break}else n++;i=n<r?f.subarray(n,r):null,this.aacOverFlow=i,this.aacLastPTS=q},a.prototype._parseMPEGPES=function(a){for(var b=a.data,c=b.length,d=0,e=0,f=a.pts;e<c;)if(u.isHeader(b,e)){var g=u.appendFrame(this._audioTrack,b,e,f,d);if(g)e+=g.length,d++;else break}else e++},a.prototype._parseID3PES=function(a){this._id3Track.samples.push(a)},a}(),z=function(){function a(b,c,d){!function(a,b){if(!(a instanceof b))throw TypeError("Cannot call a class as a function")}(this,a),this.observer=b,this.config=d,this.remuxer=c}return a.prototype.resetInitSegment=function(a,b,c,d){this._audioTrack={container:"audio/mpeg",type:"audio",id:-1,sequenceNumber:0,isAAC:!1,samples:[],len:0,manifestCodec:b,duration:d,inputTimeScale:9e4}},a.prototype.resetTimeStamp=function(){},a.probe=function(a){var b=void 0,c=void 0,d=q.a.getID3Data(a,0);if(d&& void 0!==q.a.getTimeStamp(d)){for(b=d.length,c=Math.min(a.length-1,b+100);b<c;b++)if(u.probe(a,b))return h.b.log("MPEG Audio sync word found !"),!0}return!1},a.prototype.append=function(a,b,c,d){for(var e=q.a.getID3Data(a,0),f=q.a.getTimeStamp(e),g=f?90*f:9e4*b,h=e.length,i=a.length,j=0,k=0,l=this._audioTrack,m=[{pts:g,dts:g,data:e}];h<i;)if(u.isHeader(a,h)){var n=u.appendFrame(l,a,h,g,j);if(n)h+=n.length,k=n.sample.pts,j++;else break}else q.a.isHeader(a,h)?(e=q.a.getID3Data(a,h),m.push({pts:k,dts:k,data:e}),h+=e.length):h++;this.remuxer.remux(l,{samples:[]},{samples:m,inputTimeScale:9e4},{samples:[]},b,c,d)},a.prototype.destroy=function(){},a}(),A=function(){function a(){!function(a,b){if(!(a instanceof b))throw TypeError("Cannot call a class as a function")}(this,a)}return a.getSilentFrame=function(a,b){if("mp4a.40.2"===a){if(1===b)return new Uint8Array([0,200,0,128,35,128]);if(2===b)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(3===b)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);else if(4===b)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);else if(5===b)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,56]);else if(6===b)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,0,178,0,32,8,224])}else{if(1===b)return new Uint8Array([1,64,34,128,163,78,230,128,186,8,0,0,0,28,6,241,193,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(2===b)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(3===b)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94])}return null},a}(),B=function(){function a(){!function(a,b){if(!(a instanceof b))throw TypeError("Cannot call a class as a function")}(this,a)}return a.init=function(){a.types={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],".mp3":[],mvex:[],mvhd:[],pasp:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[]};var b=void 0;for(b in a.types)a.types.hasOwnProperty(b)&&(a.types[b]=[b.charCodeAt(0),b.charCodeAt(1),b.charCodeAt(2),b.charCodeAt(3)]);var c=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),d=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]);a.HDLR_TYPES={video:c,audio:d};var e=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),f=new Uint8Array([0,0,0,0,0,0,0,0]);a.STTS=a.STSC=a.STCO=f,a.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),a.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),a.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),a.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var g=new Uint8Array([105,115,111,109]),h=new Uint8Array([97,118,99,49]),i=new Uint8Array([0,0,0,1]);a.FTYP=a.box(a.types.ftyp,g,i,g,h),a.DINF=a.box(a.types.dinf,a.box(a.types.dref,e))},a.box=function(a){for(var b=Array.prototype.slice.call(arguments,1
vendor: 5,740 bytes, line 1
1),c=8,d=b.length,e=d,f=void 0;d--;)c+=b[d].byteLength;for((f=new Uint8Array(c))[0]=c>>24&255,f[1]=c>>16&255,f[2]=c>>8&255,f[3]=255&c,f.set(a,4),d=0,c=8;d<e;d++)f.set(b[d],c),c+=b[d].byteLength;return f},a.hdlr=function(b){return a.box(a.types.hdlr,a.HDLR_TYPES[b])},a.mdat=function(b){return a.box(a.types.mdat,b)},a.mdhd=function(b,c){var d=Math.floor((c*=b)/4294967296),e=Math.floor(c%4294967296);return a.box(a.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,b>>24&255,b>>16&255,b>>8&255,255&b,d>>24,d>>16&255,d>>8&255,255&d,e>>24,e>>16&255,e>>8&255,255&e,85,196,0,0]))},a.mdia=function(b){return a.box(a.types.mdia,a.mdhd(b.timescale,b.duration),a.hdlr(b.type),a.minf(b))},a.mfhd=function(b){return a.box(a.types.mfhd,new Uint8Array([0,0,0,0,b>>24,b>>16&255,b>>8&255,255&b]))},a.minf=function(b){return"audio"===b.type?a.box(a.types.minf,a.box(a.types.smhd,a.SMHD),a.DINF,a.stbl(b)):a.box(a.types.minf,a.box(a.types.vmhd,a.VMHD),a.DINF,a.stbl(b))},a.moof=function(b,c,d){return a.box(a.types.moof,a.mfhd(b),a.traf(d,c))},a.moov=function(b){for(var c=b.length,d=[];c--;)d[c]=a.trak(b[c]);return a.box.apply(null,[a.types.moov,a.mvhd(b[0].timescale,b[0].duration)].concat(d).concat(a.mvex(b)))},a.mvex=function(b){for(var c=b.length,d=[];c--;)d[c]=a.trex(b[c]);return a.box.apply(null,[a.types.mvex].concat(d))},a.mvhd=function(b,c){var d=Math.floor((c*=b)/4294967296),e=Math.floor(c%4294967296),f=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,b>>24&255,b>>16&255,b>>8&255,255&b,d>>24,d>>16&255,d>>8&255,255&d,e>>24,e>>16&255,e>>8&255,255&e,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return a.box(a.types.mvhd,f)},a.sdtp=function(b){var c=b.samples||[],d=new Uint8Array(4+c.length),e=void 0,f=void 0;for(f=0;f<c.length;f++)e=c[f].flags,d[f+4]=e.dependsOn<<4|e.isDependedOn<<2|e.hasRedundancy;return a.box(a.types.sdtp,d)},a.stbl=function(b){return a.box(a.types.stbl,a.stsd(b),a.box(a.types.stts,a.STTS),a.box(a.types.stsc,a.STSC),a.box(a.types.stsz,a.STSZ),a.box(a.types.stco,a.STCO))},a.avc1=function(b){var c=[],d=[],e=void 0,f=void 0,g=void 0;for(e=0;e<b.sps.length;e++)g=(f=b.sps[e]).byteLength,c.push(g>>>8&255),c.push(255&g),c=c.concat(Array.prototype.slice.call(f));for(e=0;e<b.pps.length;e++)g=(f=b.pps[e]).byteLength,d.push(g>>>8&255),d.push(255&g),d=d.concat(Array.prototype.slice.call(f));var h=a.box(a.types.avcC,new Uint8Array([1,c[3],c[4],c[5],255,224|b.sps.length].concat(c).concat([b.pps.length]).concat(d))),i=b.width,j=b.height,k=b.pixelRatio[0],l=b.pixelRatio[1];return a.box(a.types.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,i>>8&255,255&i,j>>8&255,255&j,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),h,a.box(a.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),a.box(a.types.pasp,new Uint8Array([k>>24,k>>16&255,k>>8&255,255&k,l>>24,l>>16&255,l>>8&255,255&l])))},a.esds=function(a){var b=a.config.length;return new Uint8Array([0,0,0,0,3,23+b,0,1,0,4,15+b,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([b]).concat(a.config).concat([6,1,2]))},a.mp4a=function(b){var c=b.samplerate;return a.box(a.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,b.channelCount,0,16,0,0,0,0,c>>8&255,255&c,0,0]),a.box(a.types.esds,a.esds(b)))},a.mp3=function(b){var c=b.samplerate;return a.box(a.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,b.channelCount,0,16,0,0,0,0,c>>8&255,255&c,0,0]))},a.stsd=function(b){return"audio"!==b.type?a.box(a.types.stsd,a.STSD,a.avc1(b)):b.isAAC||"mp3"!==b.codec?a.box(a.types.stsd,a.STSD,a.mp4a(b)):a.box(a.types.stsd,a.STSD,a.mp3(b))},a.tkhd=function(b){var c=b.id,d=b.duration*b.timescale,e=b.width,f=b.height,g=Math.floor(d/4294967296),h=Math.floor(d%4294967296);return a.box(a.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,c>>24&255,c>>16&255,c>>8&255,255&c,0,0,0,0,g>>24,g>>16&255,g>>8&255,255&g,h>>24,h>>16&255,h>>8&255,255&h,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,e>>8&255,255&e,0,0,f>>8&255,255&f,0,0]))},a.traf=function(b,c){var d=a.sdtp(b),e=b.id,f=Math.floor(c/4294967296),g=Math.floor(c%4294967296);return a.box(a.types.traf,a.box(a.types.tfhd,new Uint8Array([0,0,0,0,e>>24,e>>16&255,e>>8&255,255&e])),a.box(a.types.tfdt,new Uint8Array([1,0,0,0,f>>24,f>>16&255,f>>8&255,255&f,g>>24,g>>16&255,g>>8&255,255&g])),a.trun(b,d.length+16+20+8+16+8+8),d)},a.trak=function(b){return b.duration=b.duration||4294967295,a.box(a.types.trak,a.tkhd(b),a.mdia(b))},a.trex=function(b){var c=b.id;return a.box(a.types.trex,new Uint8Array([0,0,0,0,c>>24,c>>16&255,c>>8&255,255&c,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},a.trun=function(b,c){var d=b.samples||[],e=d.length,f=12+16*e,g=new Uint8Array(f),h=void 0,i=void 0,j=void 0,k=void 0,l=void 0,m=void 0;for(c+=8+f,g.set([0,0,15,1,e>>>24&255,e>>>16&255,e>>>8&255,255&e,c>>>24&255,c>>>16&255,c>>>8&255,255&c],0),h=0;h<e;h++)j=(i=d[h]).duration,k=i.size,l=i.flags,m=i.cts,g.set([j>>>24&255,j>>>16&255,j>>>8&255,255&j,k>>>24&255,k>>>16&255,k>>>8&255,255&k,l.isLeading<<2|l.dependsOn,l.isDependedOn<<6|l.hasRedundancy<<4|l.paddingValue<<1|l.isNonSync,61440&l.degradPrio,15&l.degradPrio,m>>>24&255,m>>>16&255,m>>>8&255,255&m],12+16*h);return a.box(a.types.trun,g)},a.initSegment=function(b){a.types||a.init();var c=a.moov(b),d=void 0;return(d=new Uint8Array(a.FTYP.byteLength+c.byteLength)).set(a.FTYP),d.set(c,a.FTYP.byteLength),d},a}(),C=function(){function a(b,c,d,e){!function(a,b){if(!(a instanceof b))throw TypeError("Cannot call a class as a function")}
vendor: 4,524 bytes, line 1
1(this,a),this.observer=b,this.config=c,this.typeSupported=d;var f=navigator.userAgent;this.isSafari=e&&e.indexOf("Apple")> -1&&f&&!f.match("CriOS"),this.ISGenerated=!1}return a.prototype.destroy=function(){},a.prototype.resetTimeStamp=function(a){this._initPTS=this._initDTS=a},a.prototype.resetInitSegment=function(){this.ISGenerated=!1},a.prototype.remux=function(a,b,c,e,f,g,i){if(this.ISGenerated||this.generateIS(a,b,f),this.ISGenerated){var j=a.samples.length,k=b.samples.length,l=f,m=f;if(j&&k){var n=(a.samples[0].dts-b.samples[0].dts)/b.inputTimeScale;l+=Math.max(0,n),m+=Math.max(0,-n)}if(j){a.timescale||(h.b.warn("regenerate InitSegment as audio detected"),this.generateIS(a,b,f));var o=this.remuxAudio(a,l,g,i);if(k){var p=void 0;o&&(p=o.endPTS-o.startPTS),b.timescale||(h.b.warn("regenerate InitSegment as video detected"),this.generateIS(a,b,f)),this.remuxVideo(b,m,g,p,i)}}else if(k){var q=this.remuxVideo(b,m,g,0,i);q&&a.codec&&this.remuxEmptyAudio(a,l,g,q)}}c.samples.length&&this.remuxID3(c,f),e.samples.length&&this.remuxText(e,f),this.observer.trigger(d.a.FRAG_PARSED)},a.prototype.generateIS=function(a,b,c){var f=this.observer,g=a.samples,i=b.samples,j=this.typeSupported,k="audio/mp4",l={},m=void 0===this._initPTS,n=void 0,o=void 0;if(m&&(n=o=1/0),a.config&&g.length&&(a.timescale=a.samplerate,h.b.log("audio sampling rate : "+a.samplerate),!a.isAAC&&(j.mpeg?(k="audio/mpeg",a.codec=""):j.mp3&&(a.codec="mp3")),l.audio={container:k,codec:a.codec,initSegment:!a.isAAC&&j.mpeg?new Uint8Array:B.initSegment([a]),metadata:{channelCount:a.channelCount}},m&&(n=o=g[0].pts-a.inputTimeScale*c)),b.sps&&b.pps&&i.length){var p=b.inputTimeScale;b.timescale=p,l.video={container:"video/mp4",codec:b.codec,initSegment:B.initSegment([b]),metadata:{width:b.width,height:b.height}},m&&(n=Math.min(n,i[0].pts-p*c),o=Math.min(o,i[0].dts-p*c),this.observer.trigger(d.a.INIT_PTS_FOUND,{initPTS:n}))}Object.keys(l).length?(f.trigger(d.a.FRAG_PARSING_INIT_SEGMENT,{tracks:l}),this.ISGenerated=!0,m&&(this._initPTS=n,this._initDTS=o)):f.trigger(d.a.ERROR,{type:e.b.MEDIA_ERROR,details:e.a.FRAG_PARSING_ERROR,fatal:!1,reason:"no audio/video samples found"})},a.prototype.remuxVideo=function(a,b,c,f,g){var i=8,j=a.timescale,k=void 0,l=void 0,m=void 0,n=void 0,o=void 0,p=void 0,q=void 0,r=a.samples,s=[],t=r.length,u=this._PTSNormalize,v=this._initDTS,w=this.nextAvcDts,x=this.isSafari;if(0!==t){x&&(c|=r.length&&w&&(g&&.1>Math.abs(b-w/j)||Math.abs(r[0].pts-w-v)<j/5)),c||(w=b*j),r.forEach(function(a){a.pts=u(a.pts-v,w),a.dts=u(a.dts-v,w)}),r.sort(function(a,b){var c=a.dts-b.dts,d=a.pts-b.pts;return c||d||a.id-b.id});var y=r.reduce(function(a,b){return Math.max(Math.min(a,b.pts-b.dts),-18e3)},0);if(y<0){h.b.warn("PTS < DTS detected in video samples, shifting DTS by "+Math.round(y/90)+" ms to overcome this issue");for(var z=0;z<r.length;z++)r[z].dts+=y}var A=r[0];o=Math.max(A.dts,0),n=Math.max(A.pts,0);var C=Math.round((o-w)/90);c&&C&&(C>1?h.b.log("AVC:"+C+" ms hole between fragments detected,filling it"):C< -1&&h.b.log("AVC:"+ -C+" ms overlapping between fragments detected"),o=w,r[0].dts=o,n=Math.max(n-C,w),r[0].pts=n,h.b.log("Video/PTS/DTS adjusted: "+Math.round(n/90)+"/"+Math.round(o/90)+",delta:"+C+" ms")),q=Math.max((A=r[r.length-1]).dts,0),p=Math.max(A.pts,0,q),x&&(k=Math.round((q-o)/(r.length-1)));for(var D=0,E=0,F=0;F<t;F++){for(var G=r[F],H=G.units,I=H.length,J=0,K=0;K<I;K++)J+=H[K].data.length;E+=J,D+=I,G.length=J,x?G.dts=o+F*k:G.dts=Math.max(G.dts,o),G.pts=Math.max(G.pts,G.dts)}var L=E+4*D+8;try{l=new Uint8Array(L)}catch(M){this.observer.trigger(d.a.ERROR,{type:e.b.MUX_ERROR,details:e.a.REMUX_ALLOC_ERROR,fatal:!1,bytes:L,reason:"fail allocating video mdat "+L});return}var N=new DataView(l.buffer);N.setUint32(0,L),l.set(B.types.mdat,4);for(var O=0;O<t;O++){for(var P=r[O],Q=P.units,R=0,S=void 0,T=0,U=Q.length;T<U;T++){var V=Q[T],W=V.data,X=V.data.byteLength;N.setUint32(i,X),i+=4,l.set(W,i),i+=X,R+=4+X}if(x)S=Math.max(0,k*Math.round((P.pts-P.dts)/k));else{if(O<t-1)k=r[O+1].dts-P.dts;else{var Y=this.config,Z=P.dts-r[O>0?O-1:O].dts;if(Y.stretchShortVideoTrack){var $=Math.floor(Y.maxBufferHole*j),_=(f?n+f*j:this.nextAudioPts)-P.pts;_>$?((k=_-Z)<0&&(k=Z),h.b.log("It is approximately "+_/90+" ms to the next segment; using duration "+k/90+" ms for the last video frame.")):k=Z}else k=Z}S=Math.round(P.pts-P.dts)}s.push({size:R,duration:k,cts:S,flags:{isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,dependsOn:P.key?2:1,isNonSync:P.key?0:1}})}this.nextAvcDts=q+k;var aa=a.dropped;
1if(a.len=0,a.nbNalu=0,a.dropped=0,s.length&&navigator.userAgent.toLowerCase().indexOf("chrome")> -1){var ab=s[0].flags;ab.dependsOn=2,ab.isNonSync=0}a.samples=s,m=B.moof(a.sequenceNumber++,o,a),a.samples=[];var ac={data1:m,data2:l,startPTS:n/j,endPTS:(p+k)/j,startDTS:o/j,endDTS:this.nextAvcDts/j,type:"video",hasAudio:!1,hasVideo:!0,nb:s.length,dropped:aa};return this.observer.trigger(d.a.FRAG_PARSING_DATA,ac),ac}},a.prototype.remuxAudio=function(a,b,c,f){var g=a.inputTimeScale,i=g/a.timescale,j=(a.isAAC?1024:1152)*i,k=this._PTSNormalize,l=this._initDTS,m=!a.isAAC&&this.typeSupported.mpeg,n=void 0,o=void 0,p=void 0,q=void 0,r=void 0,s=void 0,t=void 0,u=a.samples,v=[],w=this.nextAudioPts;if(c|=u.length&&w&&(f&&.1>Math.abs(b-w/g)||Math.abs(u[0].pts-w-l)<20*j),u.forEach(function(a){a.pts=a.dts=k(a.pts-l,b*g)}),u=u.filter(function(a){return a.pts>=0}),0!==u.length){if(c||(w=f?b*g:u[0].pts),a.isAAC)for(var x=this.config.maxAudioFramesDrift,y=0,z=w;y<u.length;){var C,D=u[y],E=Math.abs(1e3*(C=D.pts-z)/g);if(C<= -x*j)h.b.warn("Dropping 1 audio frame @ "+(z/g).toFixed(3)+"s due to "+Math.round(E)+" ms overlap."),u.splice(y,1),a.len-=D.unit.length;else if(C>=x*j&&E<1e4&&z){var F=Math.round(C/j);h.b.warn("Injecting "+F+" audio frame @ "+(z/g).toFixed(3)+"s due to "+Math.round(1e3*C/g)+" ms gap.");for(var G=0;G<F;G++){var H=Math.max(z,0);(p=A.getSilentFrame(a.manifestCodec||a.codec,a.channelCount))||(h.b.log("Unable to get silent frame for given audio codec; duplicating last frame instead."),p=D.unit.subarray()),u.splice(y,0,{unit:p,pts:H,dts:H}),a.len+=p.length,z+=j,y++}D.pts=D.dts=z,z+=j,y++}else D.pts=D.dts=z,z+=j,y++}for(var I=0,J=u.length;I<J;I++){var K=u[I],L=K.unit,M=K.pts;if(void 0!==t)o.duration=Math.round((M-t)/i);else{var N=Math.round(1e3*(M-w)/g),O=0;if(c&&a.isAAC&&N){if(N>0&&N<1e4)O=Math.round((M-w)/j),h.b.log(N+" ms hole between AAC samples detected,filling it"),O>0&&((p=A.getSilentFrame(a.manifestCodec||a.codec,a.channelCount))||(p=L.subarray()),a.len+=O*p.length);else if(N< -12){h.b.log("drop overlapping AAC sample, expected/parsed/delta:"+(w/g).toFixed(3)+"s/"+(M/g).toFixed(3)+"s/"+ -N+"ms"),a.len-=L.byteLength;continue}M=w}if(s=M,!(a.len>0))return;var P=m?a.len:a.len+8;n=m?0:8;try{q=new Uint8Array(P)}catch(Q){this.observer.trigger(d.a.ERROR,{type:e.b.MUX_ERROR,details:e.a.REMUX_ALLOC_ERROR,fatal:!1,bytes:P,reason:"fail allocating audio mdat "+P});return}!m&&(new DataView(q.buffer).setUint32(0,P),q.set(B.types.mdat,4));for(var R=0;R<O;R++)(p=A.getSilentFrame(a.manifestCodec||a.codec,a.channelCount))||(h.b.log("Unable to get silent frame for given audio codec; duplicating this frame instead."),p=L.subarray()),q.set(p,n),n+=p.byteLength,o={size:p.byteLength,cts:0,duration:1024,flags:{isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,dependsOn:1}},v.push(o)}q.set(L,n);var S=L.byteLength;n+=S,o={size:S,cts:0,duration:0,flags:{isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,dependsOn:1}},v.push(o),t=M}var T=0,U=v.length;if(U>=2&&(T=v[U-2].duration,o.duration=T),U){this.nextAudioPts=w=t+i*T,a.len=0,a.samples=v,r=m?new Uint8Array:B.moof(a.sequenceNumber++,s/i,a),a.samples=[];var V=s/g,W=w/g,X={data1:r,data2:q,startPTS:V,endPTS:W,startDTS:V,endDTS:W,type:"audio",hasAudio:!0,hasVideo:!1,nb:U};return this.observer.trigger(d.a.FRAG_PARSING_DATA,X),X}return null}},a.prototype.remuxEmptyAudio=function(a,b,c,d){var e=a.inputTimeScale,f=a.samplerate?a.samplerate:e,g=this.nextAudioPts,i=(void 0!==g?g:d.startDTS*e)+this._initDTS,j=d.endDTS*e+this._initDTS,k=e/f*1024,l=Math.ceil((j-i)/k),m=A.getSilentFrame(a.manifestCodec||a.codec,a.channelCount);if(h.b.warn("remux empty Audio"),!m){h.b.trace("Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec!");return}for(var n=[],o=0;o<l;o++){var p=i+o*k;n.push({unit:m,pts:p,dts:p}),a.len+=m.length}a.samples=n,this.remuxAudio(a,b,c)},a.prototype.remuxID3=function(a,b){var c=a.samples.length,e=void 0,f=a.inputTimeScale,g=this._initPTS,h=this._initDTS;if(c){for(var i=0;i<c;i++)(e=a.samples[i]).pts=(e.pts-g)/f,e.dts=(e.dts-h)/f;this.observer.trigger(d.a.FRAG_PARSING_METADATA,{samples:a.samples})}a.samples=[]},a.prototype.remuxText=function(a,b){a.samples.sort(function(a,b){return a.pts-b.pts});var c=a.samples.length,e=void 0,f=a.inputTimeScale,g=this._initPTS;if(c){for(var h=0;h<c;h++)(e=a.samples[h]).pts=(e.pts-g)/f;this.observer.trigger(d.a.FRAG_PARSING_USERDATA,{samples:a.samples})}a.samples=[]},a.prototype._PTSNormalize=function(a,b){var c=void 0;if(void 0===b)return a;for(c=b<a?-8589934592:8589934592;Math.abs(a-b)>4294967296;)a+=c;return a},a}(),D=function(){function a(b){!function(a,b){if(!(a instanceof b))throw TypeError("Cannot call a class as a function")}(this,a),this.observer=b}return a.prototype.destroy=function(){},a.prototype.resetTimeStamp=function(){},a.prototype.resetInitSegment=function(){},a.prototype.remux=function(a,b,c,e,f,g,h,i){var j=this.observer,k="";a&&(k+="audio"),b&&(k+="video"),j.trigger(d.a.FRAG_PARSING_DATA,{data1:i,startPTS:f,startDTS:f,type:k,hasAudio:!!a,hasVideo:!!b,nb:1,dropped:0}),j.trigger(d.a.FRAG_PARSED)},a}(),E=Object(i.a)().performance,F=function(){function a(b,c,d,e){!function(a,b){if(!(a instanceof b))throw TypeError("Cannot call a class as a function")}
1(this,a),this.observer=b,this.typeSupported=c,this.config=d,this.vendor=e}return a.prototype.destroy=function(){var a=this.demuxer;a&&a.destroy()},a.prototype.push=function(a,b,c,e,g,h,i,j,k,l,m,n){if(a.byteLength>0&&null!=b&&null!=b.key&&"AES-128"===b.method){var o=this.decrypter;null==o&&(o=this.decrypter=new f.a(this.observer,this.config));var p=this,q=void 0;try{q=E.now()}catch(r){q=Date.now()}o.decrypt(a,b.key.buffer,b.iv.buffer,function(a){var f=void 0;try{f=E.now()}catch(o){f=Date.now()}p.observer.trigger(d.a.FRAG_DECRYPTED,{stats:{tstart:q,tdecrypt:f}}),p.pushDecrypted(new Uint8Array(a),b,new Uint8Array(c),e,g,h,i,j,k,l,m,n)})}else this.pushDecrypted(new Uint8Array(a),b,new Uint8Array(c),e,g,h,i,j,k,l,m,n)},a.prototype.pushDecrypted=function(a,b,c,f,g,h,i,j,k,l,m,n){var o=this.demuxer;if(!o||(i||j)&&!this.probe(a)){for(var p=this.observer,q=this.typeSupported,t=this.config,u=[{demux:y,remux:C},{demux:s.a,remux:D},{demux:r,remux:C},{demux:z,remux:C}],v=0,w=u.length;v<w;v++){var x=u[v],A=x.demux.probe;if(A(a)){var B=this.remuxer=new x.remux(p,t,q,this.vendor);o=new x.demux(p,B,t,q),this.probe=A;break}}if(!o){p.trigger(d.a.ERROR,{type:e.b.MEDIA_ERROR,details:e.a.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"});return}this.demuxer=o}var E=this.remuxer;(i||j)&&(o.resetInitSegment(c,f,g,l),E.resetInitSegment()),i&&(o.resetTimeStamp(n),E.resetTimeStamp(n)),"function"==typeof o.setDecryptData&&o.setDecryptData(b),o.append(a,h,k,m)},a}();b.a=F},function(a,b,c){"use strict";Object.defineProperty(b,"__esModule",{value:!0});var d={};c.d(d,"newCue",function(){return a1});var e=c(5),f=c.n(e),g=c(2),h=c(3),i=c(1),j=c(0),k="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},l=new Set(["hlsEventGeneric","hlsHandlerDestroying","hlsHandlerDestroyed"]),m=function(){function a(b){!function(a,b){if(!(a instanceof b))throw TypeError("Cannot call a class as a function")}(this,a),this.hls=b,this.onEvent=this.onEvent.bind(this);for(var c=arguments.length,d=Array(c>1?c-1:0),e=1;e<c;e++)d[e-1]=arguments[e];this.handledEvents=d,this.useGenericHandler=!0,this.registerListeners()}return a.prototype.destroy=function(){this.onHandlerDestroying(),this.unregisterListeners(),this.onHandlerDestroyed()},a.prototype.onHandlerDestroying=function(){},a.prototype.onHandlerDestroyed=function(){},a.prototype.isEventHandler=function(){return"object"===k(this.handledEvents)&&this.handledEvents.length&&"function"==typeof this.onEvent},a.prototype.registerListeners=function(){this.isEventHandler()&&this.handledEvents.forEach(function(a){if(l.has(a))throw Error("Forbidden event-name: "+a);this.hls.on(a,this.onEvent)},this)},a.prototype.unregisterListeners=function(){this.isEventHandler()&&this.handledEvents.forEach(function(a){this.hls.off(a,this.onEvent)},this)},a.prototype.onEvent=function(a,b){this.onEventGeneric(a,b)},a.prototype.onEventGeneric=function(a,b){var c=function(a,b){var c="on"+a.replace("hls","");if("function"!=typeof this[c])throw Error("Event "+a+" has no generic handler in this "+this.constructor.name+" class (tried "+c+")");return this[c].bind(this,b)};try{c.call(this,a,b).call()}catch(d){j.b.error("An internal error happened while handling event "+a+'. Error message: "'+d.message+'". Here is a stacktrace:',d),this.hls.trigger(i.a.ERROR,{type:g.b.OTHER_ERROR,details:g.a.INTERNAL_EXCEPTION,fatal:!1,event:a,err:d})}},a}(),n=c(9),o=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),p=function(){function a(){!function(a,b){if(!(a instanceof b))throw TypeError("Cannot call a class as a function")}(this,a),this.method=null,this.key=null,this.iv=null,this._uri=null}return o(a,[{key:"uri",get:function(){return!this._uri&&this.reluri&&(this._uri=f.a.buildAbsoluteURL(this.baseuri,this.reluri,{alwaysNormalize:!0})),this._uri}}]),a}(),q=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),r=function(){function a(){var b;!function(a,b){if(!(a instanceof b))throw TypeError("Cannot call a class as a function")}(this,a),this._url=null,this._byteRange=null,this._decryptdata=null,this.tagList=[],this.programDateTime=null,this.rawProgramDateTime=null,this._elementaryStreams=((b={})[a.ElementaryStreamTypes.AUDIO]=!1,b[a.ElementaryStreamTypes.VIDEO]=!1,b)}return a.prototype.addElementaryStream=function(a){this._elementaryStreams[a]=!0},a.prototype.hasElementaryStream=function(a){return!0===this._elementaryStreams[a]},a.prototype.createInitializationVector=function(a){for(var b=new Uint8Array(16),c=12;c<16;c++)b[c]=a>>8*(15-c)&255;return b}
1,a.prototype.fragmentDecryptdataFromLevelkey=function(a,b){var c=a;return a&&a.method&&a.uri&&!a.iv&&((c=new p).method=a.method,c.baseuri=a.baseuri,c.reluri=a.reluri,c.iv=this.createInitializationVector(b)),c},q(a,[{key:"url",get:function(){return!this._url&&this.relurl&&(this._url=f.a.buildAbsoluteURL(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url},set:function(a){this._url=a}},{key:"byteRange",get:function(){if(!this._byteRange&&!this.rawByteRange)return[];if(this._byteRange)return this._byteRange;var a=[];if(this.rawByteRange){var b=this.rawByteRange.split("@",2);if(1===b.length){var c=this.lastByteRangeEndOffset;a[0]=c||0}else a[0]=parseInt(b[1]);a[1]=parseInt(b[0])+a[0],this._byteRange=a}return a}},{key:"byteRangeStartOffset",get:function(){return this.byteRange[0]}},{key:"byteRangeEndOffset",get:function(){return this.byteRange[1]}},{key:"decryptdata",get:function(){return this._decryptdata||(this._decryptdata=this.fragmentDecryptdataFromLevelkey(this.levelkey,this.sn)),this._decryptdata}},{key:"endProgramDateTime",get:function(){if(!Object(h.a)(this.programDateTime))return null;var a=Object(h.a)(this.duration)?this.duration:0;return this.programDateTime+1e3*a}},{key:"encrypted",get:function(){return!!(this.decryptdata&&null!==this.decryptdata.uri&&null===this.decryptdata.key)}}],[{key:"ElementaryStreamTypes",get:function(){return{AUDIO:"audio",VIDEO:"video"}}}]),a}(),s=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),t=function(){function a(b){!function(a,b){if(!(a instanceof b))throw TypeError("Cannot call a class as a function")}(this,a),this.endCC=0,this.endSN=0,this.fragments=[],this.initSegment=null,this.live=!0,this.needSidxRanges=!1,this.startCC=0,this.startSN=0,this.startTimeOffset=null,this.targetduration=0,this.totalduration=0,this.type=null,this.url=b,this.version=null}return s(a,[{key:"hasProgramDateTime",get:function(){return!!(this.fragments[0]&&Object(h.a)(this.fragments[0].programDateTime))}}]),a}(),u=/^(\d+)x(\d+)$/,v=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,w=function(){function a(b){for(var c in!function(a,b){if(!(a instanceof b))throw TypeError("Cannot call a class as a function")}(this,a),"string"==typeof b&&(b=a.parseAttrList(b)),b)b.hasOwnProperty(c)&&(this[c]=b[c])}return a.prototype.decimalInteger=function(a){var b=parseInt(this[a],10);return b>Number.MAX_SAFE_INTEGER?1/0:b},a.prototype.hexadecimalInteger=function(a){if(!this[a])return null;var b=(this[a]||"0x").slice(2);b=(1&b.length?"0":"")+b;for(var c=new Uint8Array(b.length/2),d=0;d<b.length/2;d++)c[d]=parseInt(b.slice(2*d,2*d+2),16);return c},a.prototype.hexadecimalIntegerAsNumber=function(a){var b=parseInt(this[a],16);return b>Number.MAX_SAFE_INTEGER?1/0:b},a.prototype.decimalFloatingPoint=function(a){return parseFloat(this[a])},a.prototype.enumeratedString=function(a){return this[a]},a.prototype.decimalResolution=function(a){var b=u.exec(this[a]);if(null!==b)return{width:parseInt(b[1],10),height:parseInt(b[2],10)}},a.parseAttrList=function(a){var b=void 0,c={};for(v.lastIndex=0;null!==(b=v.exec(a));){var d=b[2],e='"';0===d.indexOf(e)&&d.lastIndexOf(e)===d.length-1&&(d=d.slice(1,-1)),c[b[1]]=d}return c},a}(),x={audio:{a3ds:!0,"ac-3":!0,"ac-4":!0,alac:!0,alaw:!0,dra1:!0,"dts+":!0,"dts-":!0,dtsc:!0,dtse:!0,dtsh:!0,"ec-3":!0,enca:!0,g719:!0,g726:!0,m4ae:!0,mha1:!0,mha2:!0,mhm1:!0,mhm2:!0,mlpa:!0,mp4a:!0,"raw ":!0,Opus:!0,samr:!0,sawb:!0,sawp:!0,sevc:!0,sqcp:!0,ssmv:!0,twos:!0,ulaw:!0},video:{avc1:!0,avc2:!0,avc3:!0,avc4:!0,avcp:!0,drac:!0,dvav:!0,dvhe:!0,encv:!0,hev1:!0,hvc1:!0,mjp2:!0,mp4v:!0,mvc1:!0,mvc2:!0,mvc3:!0,mvc4:!0,resv:!0,rv60:!0,s263:!0,svc1:!0,svc2:!0,"vc-1":!0,vp08:!0,vp09:!0}};function y(a,b){return window.MediaSource.isTypeSupported((b||"video")+'/mp4;codecs="'+a+'"')}var z=/#EXT-X-STREAM-INF:([^\n\r]*)[\r\n]+([^\r\n]+)/g,A=/#EXT-X-MEDIA:(.*)/g,B=RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/|(?!#)(\S+)/.source,/|#EXT-X-BYTERANGE:*(.+)/.source,/|#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/|#.*/.source].join(""),"g"),C=/(?:(?:#(EXTM3U))|(?:#EXT-X-(PLAYLIST-TYPE):(.+))|(?:#EXT-X-(MEDIA-SEQUENCE): *(\d+))|(?:#EXT-X-(TARGETDURATION): *(\d+))|(?:#EXT-X-(KEY):(.+))|(?:#EXT-X-(START):(.+))|(?:#EXT-X-(ENDLIST))|(?:#EXT-X-(DISCONTINUITY-SEQ)UENCE:(\d+))|(?:#EXT-X-(DIS)CONTINUITY))|(?:#EXT-X-(VERSION):(\d+))|(?:#EXT-X-(MAP):(.+))|(?:(#)([^:]*):(.*))|(?:(#)(.*))(?:.*)\r?\n?/,D=/\.(mp4|m4s|m4v|m4a)$/i,E=function(){function a(){!function(a,b){if(!(a instanceof b))throw TypeError("Cannot call a class as a function")}(this,a)}return a.findGroup=function(a,b){if(!a)return null;for(var c=null,d=0;d<a.length;d++){var e=a[d];e.id===b&&(c=e)}return c},a.convertAVC1ToAVCOTI=function(a){var b=void 0,c=a.split(".");return c.length>2?(b=c.shift()+".",b+=parseInt(c.shift()).toString(16),b+=("000"+parseInt(c.shift()).toString(16)).substr(-4)):b=a,b},a.resolve=function(a,b){return f.a.buildAbsoluteURL(b,a,{alwaysNormalize:!0})},a.parseMasterPlaylist=function(b,c){var d=[],e=void 0;function f(a,b){["video","audio"].forEach(function(c){var d=a.filter(function(a){var b,d,e;return b=a,!!(e=x[d=c])&& !0===e[b.slice(0,4)]});if(d.length){var e=d.filter(function(a){return 0===a.lastIndexOf("avc1",0)||0===a.lastIndexOf("mp4a",0)});b[c+"Codec"]=e.length>0?e[0]:d[0],a=a.filter(function(a){return -1===d.indexOf(a)})}}),b.unknownCodecs=a}for(z.lastIndex=0;null!=(e=z.exec(b));){var g={},h=g.attrs=new w(e[1]);g.url=a.resolve(e[2],c);var i=h.decimalResolution("RESOLUTION");i&&(g.width=i.width,g.height=i.height),g.bitrate=h.decimalInteger("AVERAGE-BANDWIDTH")||h.decimalInteger("BANDWIDTH"),g.name=h.NAME,f([].concat((h.CODECS||"").split(/[ ,]+/)),g),g.videoCodec&& -1!==g.videoCodec.indexOf("avc1")&&(g.videoCodec=a.convertAVC1ToAVCOTI(g.videoCodec)),d.push(g)}return d},a.parseMasterPlaylistMedia=function(b,c,d){var e=arguments.length>3&& void 0!==arguments[3]?arguments[3]:[],f=void 0,g=[],h=0;for(A.lastIndex=0;null!==(f=A.exec(b));){var i={},j=new w(f[1]);if(j.TYPE===d){if(i.groupId=j["GROUP-ID"],i.name=j.NAME,i.type=d,i.default="YES"===j.DEFAULT,i.autoselect="YES"===j.AUTOSELECT,i.forced="YES"===j.FORCED,j.URI&&(i.url=a.resolve(j.URI,c)),i.lang=j.LANGUAGE,i.name||(i.name=i.lang),e.length){var k=a.findGroup(e,i.groupId);
1i.audioCodec=k?k.codec:e[0].codec}i.id=h++,g.push(i)}}return g},a.parseLevelPlaylist=function(a,b,c,d,e){var f=0,g=0,i=new t(b),k=new p,l=0,m=null,n=new r,o=void 0,q=void 0,s=null;for(B.lastIndex=0;null!==(o=B.exec(a));){var u=o[1];if(u){n.duration=parseFloat(u);var v=(" "+o[2]).slice(1);n.title=v||null,n.tagList.push(v?["INF",u,v]:["INF",u])}else if(o[3]){if(Object(h.a)(n.duration)){var x=f++;n.type=d,n.start=g,n.levelkey=k,n.sn=x,n.level=c,n.cc=l,n.urlId=e,n.baseurl=b,n.relurl=(" "+o[3]).slice(1),G(n,m),i.fragments.push(n),m=n,g+=n.duration,n=new r}}else if(o[4]){if(n.rawByteRange=(" "+o[4]).slice(1),m){var y=m.byteRangeEndOffset;y&&(n.lastByteRangeEndOffset=y)}}else if(o[5])n.rawProgramDateTime=(" "+o[5]).slice(1),n.tagList.push(["PROGRAM-DATE-TIME",n.rawProgramDateTime]),null===s&&(s=i.fragments.length);else{for(q=1,o=o[0].match(C);q<o.length&& void 0===o[q];q++);var z=(" "+o[q+1]).slice(1),A=(" "+o[q+2]).slice(1);switch(o[q]){case"#":n.tagList.push(A?[z,A]:[z]);break;case"PLAYLIST-TYPE":i.type=z.toUpperCase();break;case"MEDIA-SEQUENCE":f=i.startSN=parseInt(z);break;case"TARGETDURATION":i.targetduration=parseFloat(z);break;case"VERSION":i.version=parseInt(z);break;case"EXTM3U":break;case"ENDLIST":i.live=!1;break;case"DIS":l++,n.tagList.push(["DIS"]);break;case"DISCONTINUITY-SEQ":l=parseInt(z);break;case"KEY":var E=z,H=new w(E),I=H.enumeratedString("METHOD"),J=H.URI,K=H.hexadecimalInteger("IV");I&&(k=new p,J&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(I)>=0&&(k.method=I,k.baseuri=b,k.reluri=J,k.key=null,k.iv=K));break;case"START":var L=z,M=new w(L).decimalFloatingPoint("TIME-OFFSET");Object(h.a)(M)&&(i.startTimeOffset=M);break;case"MAP":var N=new w(z);n.relurl=N.URI,n.rawByteRange=N.BYTERANGE,n.baseurl=b,n.level=c,n.type=d,n.sn="initSegment",i.initSegment=n,(n=new r).rawProgramDateTime=i.initSegment.rawProgramDateTime;break;default:j.b.warn("line parsed but not handled: "+o)}}}return(n=m)&&!n.relurl&&(i.fragments.pop(),g-=n.duration),i.totalduration=g,i.averagetargetduration=g/i.fragments.length,i.endSN=f-1,i.startCC=i.fragments[0]?i.fragments[0].cc:0,i.endCC=l,!i.initSegment&&i.fragments.length&&i.fragments.every(function(a){return D.test(a.relurl)})&&(j.b.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),(n=new r).relurl=i.fragments[0].relurl,n.baseurl=b,n.level=c,n.type=d,n.sn="initSegment",i.initSegment=n,i.needSidxRanges=!0),s&&F(i.fragments,s),i},a}();function F(a,b){for(var c=a[b],d=b-1;d>=0;d--){var e=a[d];e.programDateTime=c.programDateTime-1e3*e.duration,c=e}}function G(a,b){a.rawProgramDateTime?a.programDateTime=Date.parse(a.rawProgramDateTime):b&&b.programDateTime&&(a.programDateTime=b.endProgramDateTime),Object(h.a)(a.programDateTime)||(a.programDateTime=null,a.rawProgramDateTime=null)}var H=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),I=window.performance,J={MANIFEST:"manifest",LEVEL:"level",AUDIO_TRACK:"audioTrack",SUBTITLE_TRACK:"subtitleTrack"},K={MAIN:"main",AUDIO:"audio",SUBTITLE:"subtitle"},L=function(a){function b(c){!function(a,b){if(!(a instanceof b))throw TypeError("Cannot call a class as a function")}(this,b);var d=function(a,b){if(!a)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return b&&("object"==typeof b||"function"==typeof b)?b:a}(this,a.call(this,c,i.a.MANIFEST_LOADING,i.a.LEVEL_LOADING,i.a.AUDIO_TRACK_LOADING,i.a.SUBTITLE_TRACK_LOADING));return d.loaders={},d}return!function(a,b){if("function"!=typeof b&&null!==b)throw TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}(b,a),b.canHaveQualityLevels=function(a){return a!==J.AUDIO_TRACK&&a!==J.SUBTITLE_TRACK},b.mapContextToLevelType=function(a){var b=a.type;switch(b){case J.AUDIO_TRACK:return K.AUDIO;case J.SUBTITLE_TRACK:return K.SUBTITLE;default:return K.MAIN}},b.getResponseUrl=function(a,b){var c=a.url;return(void 0===c||0===c.indexOf("data:"))&&(c=b.url),c},b.prototype.createInternalLoader=function(a){var b=this.hls.config,c=b.pLoader,d=b.loader,e=new(c||d)(b);return a.loader=e,this.loaders[a.type]=e,e},b.prototype.getInternalLoader=function(a){return this.loaders[a.type]},b.prototype.resetInternalLoader=function(a){this.loaders[a]&&delete this.loaders[a]},b.prototype.destroyInternalLoaders=function(){for(var a in this.loaders){var b=this.loaders[a];b&&b.destroy(),this.resetInternalLoader(a)}},b.prototype.destroy=function(){this.destroyInternalLoaders(),a.prototype.destroy.call(this)},b.prototype.onManifestLoading=function(a){this.load(a.url,{type:J.MANIFEST,level:0,id:null})},b.prototype.onLevelLoading=function(a){this.load(a.url,{type:J.LEVEL,level:a.level,id:a.id})},b.prototype.onAudioTrackLoading=function(a){this.load(a.url,{type:J.AUDIO_TRACK,level:null,id:a.id})},b.prototype.onSubtitleTrackLoading=function(a){this.load(a.url,{type:J.SUBTITLE_TRACK,level:null,id:a.id})},b.prototype.load=function(a,b){var c=this.hls.config;j.b.debug("Loading playlist of type "+b.type+", level: "+b.level+", id: "+b.id);var d=this.getInternalLoader(b);if(d){var e=d.context;if(e&&e.url===a)return j.b.trace("playlist request ongoing"),!1;j.b.warn("aborting previous loader for type: "+b.type),d.abort()}var f=void 0,g=void 0,h=void 0,i=void 0;switch(b.type){case J.MANIFEST:f=c.manifestLoadingMaxRetry,g=c.manifestLoadingTimeOut,h=c.manifestLoadingRetryDelay,i=c.manifestLoadingMaxRetryTimeout;break;case J.LEVEL:f=0,g=c.levelLoadingTimeOut;break;default:f=c.levelLoadingMaxRetry,g=c.levelLoadingTimeOut,h=c.levelLoadingRetryDelay,i=c.levelLoadingMaxRetryTimeout}d=this.createInternalLoader(b),b.url=a,b.responseType=b.responseType||"";var k={timeout:g,maxRetry:f,retryDelay:h,maxRetryDelay:i},l={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};return j.b.debug("Calling internal loader delegate for URL: "+a),d.load(b,k,l),!0},b.prototype.loadsuccess=function(a,b,c){var d=arguments.length>3&& void 0!==arguments[3]?arguments[3]:null;if(c.isSidxRequest){this._handleSidxRequest(a,c),this._handlePlaylistLoaded(a,b,c,d);return}this.resetInternalLoader(c.type);var e=a.data;if(b.tload=I.now(),0!==e.indexOf("#EXTM3U")){this._handleManifestParsingError(a,c,"no EXTM3U delimiter",d);return}e.indexOf("#EXTINF:")>0||e.indexOf("#EXT-X-TARGETDURATION:")>0?this._handleTrackOrLevelPlaylist(a,b,c,d):this._handleMasterPlaylist(a,b,c,d)},b.prototype.loaderror=function(a,b){var c=arguments.length>2&& void 0!==arguments[2]?arguments[2]:null;this._handleNetworkError(b,c)},b.prototype.loadtimeout=function(a,b){var c=arguments.length>2&& void 0!==arguments[2]?arguments[2]:null;this._handleNetworkError(b,c,!0)},b.prototype._handleMasterPlaylist=function(a,c,d,e){var f=this.hls,g=a.data,h=b.getResponseUrl(a,d),k=E.parseMasterPlaylist(g,h);if(!k.length){this._handleManifestParsingError(a,d,"no level found in manifest",e);return}var l=k.map(function(a){return{id:a.attrs.AUDIO,codec:a.audioCodec}}),m=E.parseMasterPlaylistMedia(g,h,"AUDIO",l),n=E.parseMasterPlaylistMedia(g,h,"SUBTITLES");if(m.length){var o=!1;m.forEach(function(a){a.url||(o=!0)}),!1===o&&k[0].audioCodec&&!k[0].attrs.AUDIO&&(j.b.log("audio codec signaled in quality level, but no embedded audio track signaled, create one"),m.unshift({type:"main",name:"main"}))}f.trigger(i.a.MANIFEST_LOADED,{levels:k,audioTracks:m,subtitles:n,url:h,stats:c,networkDetails:e})},b.prototype._handleTrackOrLevelPlaylist=function(a,c,d,e){var f=this.hls,g=d.id,j=d.level,k=d.type,l=b.getResponseUrl(a,d),m=Object(h.a)(g)?g:0,n=Object(h.a)(j)?j:m,o=b.mapContextToLevelType(d),p=E.parseLevelPlaylist(a.data,l,n,o,m);if(p.tload=c.tload,k===J.MANIFEST){var q={url:l,details:p};f.trigger(i.a.MANIFEST_LOADED,{levels:[q],audioTracks:[],url:l,stats:c,networkDetails:e})}if(c.tparsed=I.now(),p.needSidxRanges){var r=p.initSegment.url;this.load(r,{isSidxRequest:!0,type:k,level:j,levelDetails:p,id:g,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer"});return}d.levelDetails=p,this._handlePlaylistLoaded(a,c,d,e)},b.prototype._handleSidxRequest=function(a,b){var c=n.a.parseSegmentIndex(new Uint8Array(a.data));
1c.references.forEach(function(a,c){var d=a.info,e=b.levelDetails.fragments[c];0===e.byteRange.length&&(e.rawByteRange=String(1+d.end-d.start)+"@"+String(d.start))}),b.levelDetails.initSegment.rawByteRange=String(c.moovEndOffset)+"@0"},b.prototype._handleManifestParsingError=function(a,b,c,d){this.hls.trigger(i.a.ERROR,{type:g.b.NETWORK_ERROR,details:g.a.MANIFEST_PARSING_ERROR,fatal:!0,url:a.url,reason:c,networkDetails:d})},b.prototype._handleNetworkError=function(a,b){var c=arguments.length>2&& void 0!==arguments[2]&&arguments[2];j.b.info("A network error occured while loading a "+a.type+"-type playlist");var d=void 0,e=void 0,f=this.getInternalLoader(a);switch(a.type){case J.MANIFEST:d=c?g.a.MANIFEST_LOAD_TIMEOUT:g.a.MANIFEST_LOAD_ERROR,e=!0;break;case J.LEVEL:d=c?g.a.LEVEL_LOAD_TIMEOUT:g.a.LEVEL_LOAD_ERROR,e=!1;break;case J.AUDIO_TRACK:d=c?g.a.AUDIO_TRACK_LOAD_TIMEOUT:g.a.AUDIO_TRACK_LOAD_ERROR,e=!1;break;default:e=!1}f&&(f.abort(),this.resetInternalLoader(a.type)),this.hls.trigger(i.a.ERROR,{type:g.b.NETWORK_ERROR,details:d,fatal:e,url:f.url,loader:f,context:a,networkDetails:b})},b.prototype._handlePlaylistLoaded=function(a,c,d,e){var f=d.type,g=d.level,h=d.id,j=d.levelDetails;if(!j.targetduration){this._handleManifestParsingError(a,d,"invalid target duration",e);return}if(b.canHaveQualityLevels(d.type))this.hls.trigger(i.a.LEVEL_LOADED,{details:j,level:g||0,id:h||0,stats:c,networkDetails:e});else switch(f){case J.AUDIO_TRACK:this.hls.trigger(i.a.AUDIO_TRACK_LOADED,{details:j,id:h,stats:c,networkDetails:e});break;case J.SUBTITLE_TRACK:this.hls.trigger(i.a.SUBTITLE_TRACK_LOADED,{details:j,id:h,stats:c,networkDetails:e})}},H(b,null,[{key:"ContextType",get:function(){return J}},{key:"LevelType",get:function(){return K}}]),b}(m),M=function(a){function b(c){!function(a,b){if(!(a instanceof b))throw TypeError("Cannot call a class as a function")}(this,b);var d=function(a,b){if(!a)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return b&&("object"==typeof b||"function"==typeof b)?b:a}(this,a.call(this,c,i.a.FRAG_LOADING));return d.loaders={},d}return!function(a,b){if("function"!=typeof b&&null!==b)throw TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}(b,a),b.prototype.destroy=function(){var b=this.loaders;for(var c in b){var d=b[c];d&&d.destroy()}this.loaders={},a.prototype.destroy.call(this)},b.prototype.onFragLoading=function(a){var b=a.frag,c=b.type,d=this.loaders,e=this.hls.config,f=e.fLoader,g=e.loader;b.loaded=0;var i=d[c];i&&(j.b.warn("abort previous fragment loader for type: "+c),i.abort()),i=d[c]=b.loader=e.fLoader?new f(e):new g(e);var k=void 0,l=void 0,m=void 0;k={url:b.url,frag:b,responseType:"arraybuffer",progressData:!1};var n=b.byteRangeStartOffset,o=b.byteRangeEndOffset;Object(h.a)(n)&&Object(h.a)(o)&&(k.rangeStart=n,k.rangeEnd=o),l={timeout:e.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:e.fragLoadingMaxRetryTimeout},m={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this),onProgress:this.loadprogress.bind(this)},i.load(k,l,m)},b.prototype.loadsuccess=function(a,b,c){var d=arguments.length>3&& void 0!==arguments[3]?arguments[3]:null,e=a.data,f=c.frag;f.loader=void 0,this.loaders[f.type]=void 0,this.hls.trigger(i.a.FRAG_LOADED,{payload:e,frag:f,stats:b,networkDetails:d})},b.prototype.loaderror=function(a,b){var c=arguments.length>2&& void 0!==arguments[2]?arguments[2]:null,d=b.frag,e=d.loader;e&&e.abort(),this.loaders[d.type]=void 0,this.hls.trigger(i.a.ERROR,{type:g.b.NETWORK_ERROR,details:g.a.FRAG_LOAD_ERROR,fatal:!1,frag:b.frag,response:a,networkDetails:c})},b.prototype.loadtimeout=function(a,b){var c=arguments.length>2&& void 0!==arguments[2]?arguments[2]:null,d=b.frag,e=d.loader;e&&e.abort(),this.loaders[d.type]=void 0,this.hls.trigger(i.a.ERROR,{type:g.b.NETWORK_ERROR,details:g.a.FRAG_LOAD_TIMEOUT,fatal:!1,frag:b.frag,networkDetails:c})},b.prototype.loadprogress=function(a,b,c){var d=arguments.length>3&& void 0!==arguments[3]?arguments[3]:null,e=b.frag;e.loaded=a.loaded,this.hls.trigger(i.a.FRAG_LOAD_PROGRESS,{frag:e,stats:a,networkDetails:d})},b}(m),N=function(a){function b(c){!function(a,b){if(!(a instanceof b))throw TypeError("Cannot call a class as a function")}(this,b);var d=function(a,b){if(!a)throw ReferenceError("this hasn't been initialised - super() hasn't been called");
1return b&&("object"==typeof b||"function"==typeof b)?b:a}(this,a.call(this,c,i.a.KEY_LOADING));return d.loaders={},d.decryptkey=null,d.decrypturl=null,d}return!function(a,b){if("function"!=typeof b&&null!==b)throw TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}(b,a),b.prototype.destroy=function(){for(var a in this.loaders){var b=this.loaders[a];b&&b.destroy()}this.loaders={},m.prototype.destroy.call(this)},b.prototype.onKeyLoading=function(a){var b=a.frag,c=b.type,d=this.loaders[c],e=b.decryptdata,f=e.uri;if(f!==this.decrypturl||null===this.decryptkey){var g=this.hls.config;d&&(j.b.warn("abort previous key loader for type:"+c),d.abort()),b.loader=this.loaders[c]=new g.loader(g),this.decrypturl=f,this.decryptkey=null;var h=void 0,k=void 0,l=void 0;h={url:f,frag:b,responseType:"arraybuffer"},k={timeout:g.fragLoadingTimeOut,maxRetry:g.fragLoadingMaxRetry,retryDelay:g.fragLoadingRetryDelay,maxRetryDelay:g.fragLoadingMaxRetryTimeout},l={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)},b.loader.load(h,k,l)}else this.decryptkey&&(e.key=this.decryptkey,this.hls.trigger(i.a.KEY_LOADED,{frag:b}))},b.prototype.loadsuccess=function(a,b,c){var d=c.frag;this.decryptkey=d.decryptdata.key=new Uint8Array(a.data),d.loader=void 0,this.loaders[d.type]=void 0,this.hls.trigger(i.a.KEY_LOADED,{frag:d})},b.prototype.loaderror=function(a,b){var c=b.frag,d=c.loader;d&&d.abort(),this.loaders[b.type]=void 0,this.hls.trigger(i.a.ERROR,{type:g.b.NETWORK_ERROR,details:g.a.KEY_LOAD_ERROR,fatal:!1,frag:c,response:a})},b.prototype.loadtimeout=function(a,b){var c=b.frag,d=c.loader;d&&d.abort(),this.loaders[b.type]=void 0,this.hls.trigger(i.a.ERROR,{type:g.b.NETWORK_ERROR,details:g.a.KEY_LOAD_TIMEOUT,fatal:!1,frag:c})},b}(m),O={NOT_LOADED:"NOT_LOADED",APPENDING:"APPENDING",PARTIAL:"PARTIAL",OK:"OK"},P=function(a){function b(c){!function(a,b){if(!(a instanceof b))throw TypeError("Cannot call a class as a function")}(this,b);var d=function(a,b){if(!a)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return b&&("object"==typeof b||"function"==typeof b)?b:a}(this,a.call(this,c,i.a.BUFFER_APPENDED,i.a.FRAG_BUFFERED,i.a.FRAG_LOADED));return d.bufferPadding=.2,d.fragments=Object.create(null),d.timeRanges=Object.create(null),d.config=c.config,d}return!function(a,b){if("function"!=typeof b&&null!==b)throw TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}(b,a),b.prototype.destroy=function(){this.fragments=null,this.timeRanges=null,this.config=null,m.prototype.destroy.call(this),a.prototype.destroy.call(this)},b.prototype.getBufferedFrag=function(a,b){var c=this.fragments,d=Object.keys(c).filter(function(d){var e=c[d];if(e.body.type!==b||!e.buffered)return!1;var f=e.body;return f.startPTS<=a&&a<=f.endPTS});return 0===d.length?null:(0,c[d.pop()].body)},b.prototype.detectEvictedFragments=function(a,b){var c=this,d=void 0,e=void 0;Object.keys(this.fragments).forEach(function(f){var g=c.fragments[f];if(!0===g.buffered){var h=g.range[a];if(h){d=h.time;for(var i=0;i<d.length;i++)if(e=d[i],!1===c.isTimeBuffered(e.startPTS,e.endPTS,b)){c.removeFragment(g.body);break}}}})},b.prototype.detectPartialFragments=function(a){var b=this,c=this.getFragmentKey(a),d=this.fragments[c];d&&(d.buffered=!0,Object.keys(this.timeRanges).forEach(function(c){if(a.hasElementaryStream(c)){var e=b.timeRanges[c];d.range[c]=b.getBufferedTimes(a.startPTS,a.endPTS,e)}}))},b.prototype.getBufferedTimes=function(a,b,c){for(var d=[],e=void 0,f=void 0,g=!1,h=0;h<c.length;h++){if(e=c.start(h)-this.bufferPadding,f=c.end(h)+this.bufferPadding,a>=e&&b<=f){d.push({startPTS:Math.max(a,c.start(h)),endPTS:Math.min(b,c.end(h))});break}if(a<f&&b>e)d.push({startPTS:Math.max(a,c.start(h)),endPTS:Math.min(b,c.end(h))}),g=!0;else if(b<=e)break}return{time:d,partial:g}}
1,b.prototype.getFragmentKey=function(a){return a.type+"_"+a.level+"_"+a.urlId+"_"+a.sn},b.prototype.getPartialFragment=function(a){var b=this,c=void 0,d=void 0,e=void 0,f=null,g=0;return Object.keys(this.fragments).forEach(function(h){var i=b.fragments[h];b.isPartial(i)&&(d=i.body.startPTS-b.bufferPadding,e=i.body.endPTS+b.bufferPadding,a>=d&&a<=e&&g<=(c=Math.min(a-d,e-a))&&(f=i.body,g=c))}),f},b.prototype.getState=function(a){var b=this.getFragmentKey(a),c=this.fragments[b],d=O.NOT_LOADED;return void 0!==c&&(d=c.buffered?!0===this.isPartial(c)?O.PARTIAL:O.OK:O.APPENDING),d},b.prototype.isPartial=function(a){return!0===a.buffered&&(void 0!==a.range.video&& !0===a.range.video.partial|| void 0!==a.range.audio&& !0===a.range.audio.partial)},b.prototype.isTimeBuffered=function(a,b,c){for(var d=void 0,e=void 0,f=0;f<c.length;f++){if(d=c.start(f)-this.bufferPadding,e=c.end(f)+this.bufferPadding,a>=d&&b<=e)return!0;if(b<=d)break}return!1},b.prototype.onFragLoaded=function(a){var b=a.frag;Object(h.a)(b.sn)&&!b.bitrateTest&&(this.fragments[this.getFragmentKey(b)]={body:b,range:Object.create(null),buffered:!1})},b.prototype.onBufferAppended=function(a){var b=this;this.timeRanges=a.timeRanges,Object.keys(this.timeRanges).forEach(function(a){var c=b.timeRanges[a];b.detectEvictedFragments(a,c)})},b.prototype.onFragBuffered=function(a){this.detectPartialFragments(a.frag)},b.prototype.hasFragment=function(a){var b=this.getFragmentKey(a);return void 0!==this.fragments[b]},b.prototype.removeFragment=function(a){var b=this.getFragmentKey(a);delete this.fragments[b]},b.prototype.removeAllFragments=function(){this.fragments=Object.create(null)},b}(m),Q={search:function(a,b){for(var c=0,d=a.length-1,e=null,f=null;c<=d;){var g=b(f=a[e=(c+d)/2|0]);if(g>0)c=e+1;else{if(!(g<0))return f;d=e-1}}return null}},R=function(){function a(){!function(a,b){if(!(a instanceof b))throw TypeError("Cannot call a class as a function")}(this,a)}return a.isBuffered=function(a,b){try{if(a){for(var c=a.buffered,d=0;d<c.length;d++)if(b>=c.start(d)&&b<=c.end(d))return!0}}catch(e){}return!1},a.bufferInfo=function(a,b,c){try{if(a){var d=a.buffered,e=[],f=void 0;for(f=0;f<d.length;f++)e.push({start:d.start(f),end:d.end(f)});return this.bufferedInfo(e,b,c)}}catch(g){}return{len:0,start:b,end:b,nextStart:void 0}},a.bufferedInfo=function(a,b,c){var d=[],e=void 0,f=void 0,g=void 0,h=void 0,i=void 0;for(a.sort(function(a,b){var c=a.start-b.start;return c||b.end-a.end}),i=0;i<a.length;i++){var j=d.length;if(j){var k=d[j-1].end;a[i].start-k<c?a[i].end>k&&(d[j-1].end=a[i].end):d.push(a[i])}else d.push(a[i])}for(i=0,e=0,f=g=b;i<d.length;i++){var l=d[i].start,m=d[i].end;if(b+c>=l&&b<m)f=l,e=(g=m)-b;else if(b+c<l){h=l;break}}return{len:e,start:f,end:g,nextStart:h}},a}(),S=c(7),T=c.n(S),U=c(12),V=c.n(U),W=c(10);function X(){if("undefined"!=typeof window)return window.MediaSource||window.WebKitMediaSource}var Y=c(4),Z=Object(Y.a)(),$=X(),_=function(){function a(b,c){!function(a,b){if(!(a instanceof b))throw TypeError("Cannot call a class as a function")}(this,a),this.hls=b,this.id=c;var d=this.observer=new T.a,e=b.config;d.trigger=function(a){for(var b=arguments.length,c=Array(b>1?b-1:0),e=1;e<b;e++)c[e-1]=arguments[e];d.emit.apply(d,[a,a].concat(c))},d.off=function(a){for(var b=arguments.length,c=Array(b>1?b-1:0),e=1;e<b;e++)c[e-1]=arguments[e];d.removeListener.apply(d,[a].concat(c))};var f=(function(a,c){(c=c||{}).frag=this.frag,c.id=this.id,b.trigger(a,c)}).bind(this);d.on(i.a.FRAG_DECRYPTED,f),d.on(i.a.FRAG_PARSING_INIT_SEGMENT,f),d.on(i.a.FRAG_PARSING_DATA,f),d.on(i.a.FRAG_PARSED,f),d.on(i.a.ERROR,f),d.on(i.a.FRAG_PARSING_METADATA,f),d.on(i.a.FRAG_PARSING_USERDATA,f),d.on(i.a.INIT_PTS_FOUND,f);var h={mp4:$.isTypeSupported("video/mp4"),mpeg:$.isTypeSupported("audio/mpeg"),mp3:$.isTypeSupported('audio/mp4; codecs="mp3"')},k=navigator.vendor;if(e.enableWorker&&"undefined"!=typeof Worker){j.b.log("demuxing in webworker");var l=void 0;try{l=this.w=V()(13),this.onwmsg=this.onWorkerMessage.bind(this),l.addEventListener("message",this.onwmsg),l.onerror=function(a){b.trigger(i.a.ERROR,{type:g.b.OTHER_ERROR,details:g.a.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",err:{message:a.message+" ("+a.filename+":"+a.lineno+")"}})}
1,l.postMessage({cmd:"init",typeSupported:h,vendor:k,id:c,config:JSON.stringify(e)})}catch(m){j.b.error("error while initializing DemuxerWorker, fallback on DemuxerInline"),l&&Z.URL.revokeObjectURL(l.objectURL),this.demuxer=new W.a(d,h,e,k),this.w=void 0}}else this.demuxer=new W.a(d,h,e,k)}return a.prototype.destroy=function(){var a=this.w;if(a)a.removeEventListener("message",this.onwmsg),a.terminate(),this.w=null;else{var b=this.demuxer;b&&(b.destroy(),this.demuxer=null)}var c=this.observer;c&&(c.removeAllListeners(),this.observer=null)},a.prototype.push=function(a,b,c,d,e,f,g,i){var k=this.w,l=Object(h.a)(e.startDTS)?e.startDTS:e.start,m=e.decryptdata,n=this.frag,o=!(n&&e.cc===n.cc),p=!(n&&e.level===n.level),q=n&&e.sn===n.sn+1,r=!p&&q;if(o&&j.b.log(this.id+":discontinuity detected"),p&&j.b.log(this.id+":switch detected"),this.frag=e,k)k.postMessage({cmd:"demux",data:a,decryptdata:m,initSegment:b,audioCodec:c,videoCodec:d,timeOffset:l,discontinuity:o,trackSwitch:p,contiguous:r,duration:f,accurateTimeOffset:g,defaultInitPTS:i},a instanceof ArrayBuffer?[a]:[]);else{var s=this.demuxer;s&&s.push(a,m,b,c,d,l,o,p,r,f,g,i)}},a.prototype.onWorkerMessage=function(a){var b=a.data,c=this.hls;switch(b.event){case"init":Z.URL.revokeObjectURL(this.w.objectURL);break;case i.a.FRAG_PARSING_DATA:b.data.data1=new Uint8Array(b.data1),b.data2&&(b.data.data2=new Uint8Array(b.data2));default:b.data=b.data||{},b.data.frag=this.frag,b.data.id=this.id,c.trigger(b.event,b.data)}},a}();function aa(a,b,c){switch(b){case"audio":a.audioGroupIds||(a.audioGroupIds=[]),a.audioGroupIds.push(c);break;case"text":a.textGroupIds||(a.textGroupIds=[]),a.textGroupIds.push(c)}}function ab(a,b,c){var d=a[b],e=a[c],f=e.startPTS;Object(h.a)(f)?c>b?(d.duration=f-d.start,d.duration<0&&j.b.warn("negative duration computed for frag "+d.sn+",level "+d.level+", there should be some duration drift between playlist and fragment!")):(e.duration=d.start-f,e.duration<0&&j.b.warn("negative duration computed for frag "+e.sn+",level "+e.level+", there should be some duration drift between playlist and fragment!")):c>b?e.start=d.start+d.duration:e.start=Math.max(d.start-e.duration,0)}function ac(a,b,c,d,e,f){var g=c;if(Object(h.a)(b.startPTS)){var i=Math.abs(b.startPTS-c);Object(h.a)(b.deltaPTS)?b.deltaPTS=Math.max(i,b.deltaPTS):b.deltaPTS=i,g=Math.max(c,b.startPTS),c=Math.min(c,b.startPTS),d=Math.max(d,b.endPTS),e=Math.min(e,b.startDTS),f=Math.max(f,b.endDTS)}var j=c-b.start;b.start=b.startPTS=c,b.maxStartPTS=g,b.endPTS=d,b.startDTS=e,b.endDTS=f,b.duration=d-c;var k=b.sn;if(!a||k<a.startSN||k>a.endSN)return 0;var l=void 0,m=void 0,n=void 0;for(l=k-a.startSN,m=a.fragments,m[l]=b,n=l;n>0;n--)ab(m,n,n-1);for(n=l;n<m.length-1;n++)ab(m,n,n+1);return a.PTSKnown=!0,j}function ad(a,b){var c=Math.max(a.startSN,b.startSN)-b.startSN,d=Math.min(a.endSN,b.endSN)-b.startSN,e=b.startSN-a.startSN,f=a.fragments,g=b.fragments,i=0,k=void 0;if(b.initSegment&&a.initSegment&&(b.initSegment=a.initSegment),d<c){b.PTSKnown=!1;return}for(var l=c;l<=d;l++){var m=f[e+l],n=g[l];n&&m&&(i=m.cc-n.cc,Object(h.a)(m.startPTS)&&(n.start=n.startPTS=m.startPTS,n.endPTS=m.endPTS,n.duration=m.duration,n.backtracked=m.backtracked,n.dropped=m.dropped,k=n))}if(i)for(j.b.log("discontinuity sliding from playlist, take drift into account"),l=0;l<g.length;l++)g[l].cc+=i;if(k)ac(b,k,k.startPTS,k.endPTS,k.startDTS,k.endDTS);else if(e>=0&&e<f.length){var o=f[e].start;for(l=0;l<g.length;l++)g[l].start+=o}b.PTSKnown=a.PTSKnown}var ae={toString:function(a){for(var b="",c=a.length,d=0;d<c;d++)b+="["+a.start(d).toFixed(3)+","+a.end(d).toFixed(3)+"]";return b}};function af(a,b){b.fragments.forEach(function(b){if(b){var c=b.start+a;b.start=b.startPTS=c,b.endPTS=c+b.duration}}),b.PTSKnown=!0}function ag(a,b,c){ah(a,c,b),!c.PTSKnown&&b&&ai(c,b.details)}function ah(a,b,c){var d,e,f,g;if(d=a,e=c,f=b,g=!1,e&&e.details&&f&&(f.endCC>f.startCC||d&&d.cc<f.startCC)&&(g=!0),g){var h=function(a,b){var c=a.fragments,d=b.fragments;if(!d.length||!c.length){j.b.log("No fragments to align");return}var e=function(a,b){for(var c=null,d=0;d<a.length;d+=1){var e=a[d];if(e&&e.cc===b){c=e;break}}return c}(c,d[0].cc);if(!e||e&&!e.startPTS){j.b.log("No frag in previous level to align on");return}return e}(c.details,b);h&&(j.b.log("Adjusting PTS using last level due to CC increase within current level"),af(h.start,b))}}function ai(a,b){if(b&&b.fragments.length&&a.hasProgramDateTime&&b.hasProgramDateTime){var c=b.fragments[0].programDateTime,d=(a.fragments[0].programDateTime-c)/1e3+b.fragments[0].start;Object(h.a)(d)&&(j.b.log("adjusting PTS using programDateTime delta, sliding:"+d.toFixed(3)),af(d,a))}}var aj=function(a){function b(c){!function(a,b){if(!(a instanceof b))throw TypeError("Cannot call a class as a function")}(this,b);for(var d=arguments.length,e=Array(d>1?d-1:0),f=1;f<d;f++)e[f-1]=arguments[f];var g=function(a,b){if(!a)throw ReferenceError("this hasn't been initialised - super() hasn't been called");
1return b&&("object"==typeof b||"function"==typeof b)?b:a}(this,a.call.apply(a,[this,c].concat(e)));return g._tickInterval=null,g._tickTimer=null,g._tickCallCount=0,g._boundTick=g.tick.bind(g),g}return!function(a,b){if("function"!=typeof b&&null!==b)throw TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}(b,a),b.prototype.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},b.prototype.hasInterval=function(){return!!this._tickInterval},b.prototype.hasNextTick=function(){return!!this._tickTimer},b.prototype.setInterval=function(a){function b(b){return a.apply(this,arguments)}return b.toString=function(){return a.toString()},b}(function(a){return!this._tickInterval&&(this._tickInterval=setInterval(this._boundTick,a),!0)}),b.prototype.clearInterval=function(a){function b(){return a.apply(this,arguments)}return b.toString=function(){return a.toString()},b}(function(){return!!this._tickInterval&&(clearInterval(this._tickInterval),this._tickInterval=null,!0)}),b.prototype.clearNextTick=function(){return!!this._tickTimer&&(clearTimeout(this._tickTimer),this._tickTimer=null,!0)},b.prototype.tick=function(){this._tickCallCount++,1===this._tickCallCount&&(this.doTick(),this._tickCallCount>1&&(this.clearNextTick(),this._tickTimer=setTimeout(this._boundTick,0)),this._tickCallCount=0)},b.prototype.doTick=function(){},b}(m);function ak(){var a=arguments.length>0&& void 0!==arguments[0]?arguments[0]:0,b=arguments.length>1&& void 0!==arguments[1]?arguments[1]:0,c=arguments[2],d=Math.min(b,c.duration+(c.deltaPTS?c.deltaPTS:0));return c.start+c.duration-d<=a?1:c.start-d>a&&c.start?-1:0}function al(a,b,c){var d=1e3*Math.min(b,c.duration+(c.deltaPTS?c.deltaPTS:0));return c.endProgramDateTime-d>a}var am=function(){function a(b,c,d,e){!function(a,b){if(!(a instanceof b))throw TypeError("Cannot call a class as a function")}(this,a),this.config=b,this.media=c,this.fragmentTracker=d,this.hls=e,this.stallReported=!1}return a.prototype.poll=function(a,b){var c=this.config,d=this.media,e=d.currentTime,f=window.performance.now();if(e!==a){this.stallReported&&(j.b.warn("playback not stuck anymore @"+e+", after "+Math.round(f-this.stalled)+"ms"),this.stallReported=!1),this.stalled=null,this.nudgeRetry=0;return}if(!(d.ended||!d.buffered.length||d.readyState>2||d.seeking&&R.isBuffered(d,e))){var g=f-this.stalled,h=R.bufferInfo(d,e,c.maxBufferHole);if(this.stalled)g>=1e3&&this._reportStall(h.len);else{this.stalled=f;return}this._tryFixBufferStall(h,g)}},a.prototype._tryFixBufferStall=function(a,b){var c=this.config,d=this.fragmentTracker,e=this.media.currentTime,f=d.getPartialFragment(e);f&&this._trySkipBufferHole(f),a.len>.5&&b>1e3*c.highBufferWatchdogPeriod&&(this.stalled=null,this._tryNudgeBuffer())},a.prototype._reportStall=function(a){var b=this.hls,c=this.media;this.stallReported||(this.stallReported=!0,j.b.warn("Playback stalling at @"+c.currentTime+" due to low buffer"),b.trigger(i.a.ERROR,{type:g.b.MEDIA_ERROR,details:g.a.BUFFER_STALLED_ERROR,fatal:!1,buffer:a}))},a.prototype._trySkipBufferHole=function(a){for(var b=this.hls,c=this.media,d=c.currentTime,e=0,f=0;f<c.buffered.length;f++){var h=c.buffered.start(f);if(d>=e&&d<h){c.currentTime=Math.max(h,c.currentTime+.1),j.b.warn("skipping hole, adjusting currentTime from "+d+" to "+c.currentTime),this.stalled=null,b.trigger(i.a.ERROR,{type:g.b.MEDIA_ERROR,details:g.a.BUFFER_SEEK_OVER_HOLE,fatal:!1,reason:"fragment loaded with buffer holes, seeking from "+d+" to "+c.currentTime,frag:a});return}e=c.buffered.end(f)}},a.prototype._tryNudgeBuffer=function(){var a=this.config,b=this.hls,c=this.media,d=c.currentTime,e=(this.nudgeRetry||0)+1;if(this.nudgeRetry=e,e<a.nudgeMaxRetry){var f=d+e*a.nudgeOffset;j.b.log("adjust currentTime from "+d+" to "+f),c.currentTime=f,b.trigger(i.a.ERROR,{type:g.b.MEDIA_ERROR,details:g.a.BUFFER_NUDGE_ON_STALL,fatal:!1})}else j.b.error("still stuck in high buffer @"+d+" after "+a.nudgeMaxRetry+", raise fatal error"),b.trigger(i.a.ERROR,{type:g.b.MEDIA_ERROR,details:g.a.BUFFER_STALLED_ERROR,fatal:!0})},a}(),an=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),ao={STOPPED:"STOPPED",IDLE:"IDLE",KEY_LOADING:"KEY_LOADING",FRAG_LOADING:"FRAG_LOADING",FRAG_LOADING_WAITING_RETRY:"FRAG_LOADING_WAITING_RETRY",WAITING_LEVEL:"WAITING_LEVEL",PARSING:"PARSING",PARSED:"PARSED",BUFFER_FLUSHING:"BUFFER_FLUSHING",ENDED:"ENDED",ERROR:"ERROR"},ap=function(a){function b(c,d){!function(a,b){if(!(a instanceof b))throw TypeError("Cannot call a class as a function")}(this,b);var e=function(a,b){if(!a)throw ReferenceError("this hasn't been initialised - super() hasn't been called");
vendor: 22,914 bytes, line 1
1return b&&("object"==typeof b||"function"==typeof b)?b:a}(this,a.call(this,c,i.a.MEDIA_ATTACHED,i.a.MEDIA_DETACHING,i.a.MANIFEST_LOADING,i.a.MANIFEST_PARSED,i.a.LEVEL_LOADED,i.a.KEY_LOADED,i.a.FRAG_LOADED,i.a.FRAG_LOAD_EMERGENCY_ABORTED,i.a.FRAG_PARSING_INIT_SEGMENT,i.a.FRAG_PARSING_DATA,i.a.FRAG_PARSED,i.a.ERROR,i.a.AUDIO_TRACK_SWITCHING,i.a.AUDIO_TRACK_SWITCHED,i.a.BUFFER_CREATED,i.a.BUFFER_APPENDED,i.a.BUFFER_FLUSHED));return e.fragmentTracker=d,e.config=c.config,e.audioCodecSwap=!1,e._state=ao.STOPPED,e.stallReported=!1,e.gapController=null,e}return!function(a,b){if("function"!=typeof b&&null!==b)throw TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}(b,a),b.prototype.onHandlerDestroying=function(){this.stopLoad(),a.prototype.onHandlerDestroying.call(this)},b.prototype.onHandlerDestroyed=function(){this.state=ao.STOPPED,this.fragmentTracker=null,a.prototype.onHandlerDestroyed.call(this)},b.prototype.startLoad=function(a){if(this.levels){var b=this.lastCurrentTime,c=this.hls;if(this.stopLoad(),this.setInterval(100),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var d=c.startLevel;-1===d&&(d=0,this.bitrateTest=!0),this.level=c.nextLoadLevel=d,this.loadedmetadata=!1}b>0&& -1===a&&(j.b.log("override startPosition with lastCurrentTime @"+b.toFixed(3)),a=b),this.state=ao.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=a,this.tick()}else this.forceStartLoad=!0,this.state=ao.STOPPED},b.prototype.stopLoad=function(){var a=this.fragCurrent;a&&(a.loader&&a.loader.abort(),this.fragmentTracker.removeFragment(a),this.fragCurrent=null),this.fragPrevious=null,this.demuxer&&(this.demuxer.destroy(),this.demuxer=null),this.clearInterval(),this.state=ao.STOPPED,this.forceStartLoad=!1},b.prototype.doTick=function(){switch(this.state){case ao.BUFFER_FLUSHING:this.fragLoadError=0;break;case ao.IDLE:this._doTickIdle();break;case ao.WAITING_LEVEL:var a=this.levels[this.level];a&&a.details&&(this.state=ao.IDLE);break;case ao.FRAG_LOADING_WAITING_RETRY:var b=window.performance.now(),c=this.retryDate;(!c||b>=c||this.media&&this.media.seeking)&&(j.b.log("mediaController: retryDate reached, switch back to IDLE state"),this.state=ao.IDLE);case ao.ERROR:case ao.STOPPED:case ao.FRAG_LOADING:case ao.PARSING:case ao.PARSED:case ao.ENDED:}this._checkBuffer(),this._checkFragmentChanged()},b.prototype._doTickIdle=function(){var a=this.hls,b=a.config,c=this.media;if(void 0!==this.levelLastLoaded&&(c|| !this.startFragRequested&&b.startFragPrefetch)){var d=void 0;d=this.loadedmetadata?c.currentTime:this.nextLoadPosition;var e=a.nextLoadLevel,f=this.levels[e];if(f){var g=f.bitrate,h=void 0;h=g?Math.max(8*b.maxBufferSize/g,b.maxBufferLength):b.maxBufferLength,h=Math.min(h,b.maxMaxBufferLength);var k=R.bufferInfo(this.mediaBuffer?this.mediaBuffer:c,d,b.maxBufferHole),l=k.len;if(!(l>=h)){j.b.trace("buffer length of "+l.toFixed(3)+" is below max of "+h.toFixed(3)+". checking for more payload ..."),this.level=a.nextLoadLevel=e;var m=f.details;if(!m||m.live&&this.levelLastLoaded!==e){this.state=ao.WAITING_LEVEL;return}var n=this.fragPrevious;if(!m.live&&n&&!n.backtracked&&n.sn===m.endSN&&!k.nextStart&&Math.min(c.duration,n.start+n.duration)-Math.max(k.end,n.start)<=Math.max(.2,n.duration)){var o={};this.altAudio&&(o.type="video"),this.hls.trigger(i.a.BUFFER_EOS,o),this.state=ao.ENDED;return}this._fetchPayloadOrEos(d,k,m)}}}},b.prototype._fetchPayloadOrEos=function(a,b,c){var d=this.fragPrevious,e=this.level,f=c.fragments,g=f.length;if(0!==g){var h=f[0].start,i=f[g-1].start+f[g-1].duration,k=b.end,l=void 0;if(c.initSegment&&!c.initSegment.data)l=c.initSegment;else if(c.live){var m=this.config.initialLiveManifestSize;if(g<m){j.b.warn("Can not start playback of a level, reason: not enough fragments "+g+" < "+m);return}if(null===(l=this._ensureFragmentAtLivePoint(c,k,h,i,d,f,g)))return}else k<h&&(l=f[0]);l||(l=this._findFragment(h,d,g,f,k,i,c)),l&&(l.encrypted?(j.b.log("Loading key for "+l.sn+" of ["+c.startSN+" ,"+c.endSN+"],level "+e),this._loadKey(l)):(j.b.log("Loading "+l.sn+" of ["+c.startSN+" ,"+c.endSN+"],level "+e+", currentTime:"+a.toFixed(3)+",bufferEnd:"+k.toFixed(3)),this._loadFragment(l)))}},b.prototype._ensureFragmentAtLivePoint=function(a,b,c,d,e,f,g){var i=this.hls.config,k=this.media,l=void 0,m=void 0!==i.liveMaxLatencyDuration?i.liveMaxLatencyDuration:i.liveMaxLatencyDurationCount*a.targetduration;if(b<Math.max(c-i.maxFragLookUpTolerance,d-m)){var n=this.liveSyncPosition=this.computeLivePosition(c,a);j.b.log("buffer end: "+b.toFixed(3)+" is located too far from the end of live sliding playlist, reset currentTime to : "+n.toFixed(3)),b=n,k&&k.readyState&&k.duration>n&&(k.currentTime=n),this.nextLoadPosition=n}if(a.PTSKnown&&b>d&&k&&k.readyState)return null;if(this.startFragRequested&&!a.PTSKnown){if(e){if(a.hasProgramDateTime)j.b.log("live playlist, switching playlist, load frag with same PDT: "+e.programDateTime),l=function(a,b,c){if(!Array.isArray(a)||!a.length||!Object(h.a)(b)||b<a[0].programDateTime||b>=a[a.length-1].endProgramDateTime)return null;c=c||0;for(var d=0;d<a.length;++d){var e=a[d];if(al(b,c,e))return e}return null}(f,e.endProgramDateTime,i.maxFragLookUpTolerance);else{var o=e.sn+1;if(o>=a.startSN&&o<=a.endSN){var p=f[o-a.startSN];e.cc===p.cc&&(l=p,j.b.log("live playlist, switching playlist, load frag with next SN: "+l.sn))}!l&&(l=Q.search(f,function(a){return e.cc-a.cc}))&&j.b.log("live playlist, switching playlist, load frag with same CC: "+l.sn)}}l||(l=f[Math.min(g-1,Math.round(g/2))],j.b.log("live playlist, switching playlist, unknown, load middle frag : "+l.sn))}return l},b.prototype._findFragment=function(a,b,c,d,e,f,g){var h=this.hls.config,i=void 0;if(e<f){var k=e>f-h.maxFragLookUpTolerance?0:h.maxFragLookUpTolerance;i=function(a,b){var c=arguments.length>2&& void 0!==arguments[2]?arguments[2]:0,d=arguments.length>3&& void 0!==arguments[3]?arguments[3]:0,e=a?b[a.sn-b[0].sn+1]:null;return e&&!ak(c,d,e)?e:Q.search(b,ak.bind(null,c,d))}(b,d,e,k)}else i=d[c-1];if(i){var l=i.sn-g.startSN,m=b&&i.level===b.level,n=d[l-1],o=d[l+1];if(b&&i.sn===b.sn){if(m&&!i.backtracked){if(i.sn<g.endSN){var p=b.deltaPTS;p&&p>h.maxBufferHole&&b.dropped&&l?(i=n,j.b.warn("SN just loaded, with large PTS gap between audio and video, maybe frag is not starting with a keyframe ? load previous one to try to overcome this")):(i=o,j.b.log("SN just loaded, load next one: "+i.sn,i))}else i=null}else i.backtracked&&(o&&o.backtracked?(j.b.warn("Already backtracked from fragment "+o.sn+", will not backtrack to fragment "+i.sn+". Loading fragment "+o.sn),i=o):(j.b.warn("Loaded fragment with dropped frames, backtracking 1 segment to find a keyframe"),i.dropped=0,n?(i=n).backtracked=!0:l&&(i=null)))}}return i},b.prototype._loadKey=function(a){this.state=ao.KEY_LOADING,this.hls.trigger(i.a.KEY_LOADING,{frag:a})},b.prototype._loadFragment=function(a){var b=this.fragmentTracker.getState(a);this.fragCurrent=a,this.startFragRequested=!0,Object(h.a)(a.sn)&&!a.bitrateTest&&(this.nextLoadPosition=a.start+a.duration),a.backtracked||b===O.NOT_LOADED||b===O.PARTIAL?(a.autoLevel=this.hls.autoLevelEnabled,a.bitrateTest=this.bitrateTest,this.hls.trigger(i.a.FRAG_LOADING,{frag:a}),this.demuxer||(this.demuxer=new _(this.hls,"main")),this.state=ao.FRAG_LOADING):b===O.APPENDING&&this._reduceMaxBufferLength(a.duration)&&this.fragmentTracker.removeFragment(a)},b.prototype.getBufferedFrag=function(a){return this.fragmentTracker.getBufferedFrag(a,L.LevelType.MAIN)},b.prototype.followingBufferedFrag=function(a){return a?this.getBufferedFrag(a.endPTS+.5):null},b.prototype._checkFragmentChanged=function(){var a=void 0,b=void 0,c=this.media;if(c&&c.readyState&& !1===c.seeking&&((b=c.currentTime)>this.lastCurrentTime&&(this.lastCurrentTime=b),R.isBuffered(c,b)?a=this.getBufferedFrag(b):R.isBuffered(c,b+.1)&&(a=this.getBufferedFrag(b+.1)),a)){var d=a;if(d!==this.fragPlaying){this.hls.trigger(i.a.FRAG_CHANGED,{frag:d});var e=d.level;this.fragPlaying&&this.fragPlaying.level===e||this.hls.trigger(i.a.LEVEL_SWITCHED,{level:e}),this.fragPlaying=d}}},b.prototype.immediateLevelSwitch=function(){if(j.b.log("immediateLevelSwitch"),!this.immediateSwitch){this.immediateSwitch=!0;var a=this.media,b=void 0;a?(b=a.paused,a.pause()):b=!0,this.previouslyPaused=b}var c=this.fragCurrent;c&&c.loader&&c.loader.abort(),this.fragCurrent=null,this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},b.prototype.immediateLevelSwitchEnd=function(){var a=this.media;a&&a.buffered.length&&(this.immediateSwitch=!1,R.isBuffered(a,a.currentTime)&&(a.currentTime-=1e-4),this.previouslyPaused||a.play())},b.prototype.nextLevelSwitch=function(){var a=this.media;if(a&&a.readyState){var b=void 0,c=void 0,d=void 0;if((c=this.getBufferedFrag(a.currentTime))&&c.startPTS>1&&this.flushMainBuffer(0,c.startPTS-1),a.paused)b=0;else{var e=this.hls.nextLoadLevel,f=this.levels[e],g=this.fragLastKbps;b=g&&this.fragCurrent?this.fragCurrent.duration*f.bitrate/(1e3*g)+1:0}if((d=this.getBufferedFrag(a.currentTime+b))&&(d=this.followingBufferedFrag(d))){var h=this.fragCurrent;h&&h.loader&&h.loader.abort(),this.fragCurrent=null,this.flushMainBuffer(d.maxStartPTS,Number.POSITIVE_INFINITY)}}},b.prototype.flushMainBuffer=function(a,b){this.state=ao.BUFFER_FLUSHING;var c={startOffset:a,endOffset:b};this.altAudio&&(c.type="video"),this.hls.trigger(i.a.BUFFER_FLUSHING,c)},b.prototype.onMediaAttached=function(a){var b=this.media=this.mediaBuffer=a.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),this.onvended=this.onMediaEnded.bind(this),b.addEventListener("seeking",this.onvseeking),b.addEventListener("seeked",this.onvseeked),b.addEventListener("ended",this.onvended);var c=this.config;this.levels&&c.autoStartLoad&&this.hls.startLoad(c.startPosition),this.gapController=new am(c,b,this.fragmentTracker,this.hls)},b.prototype.onMediaDetaching=function(){var a=this.media;a&&a.ended&&(j.b.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0);var b=this.levels;b&&b.forEach(function(a){a.details&&a.details.fragments.forEach(function(a){a.backtracked=void 0})}),a&&(a.removeEventListener("seeking",this.onvseeking),a.removeEventListener("seeked",this.onvseeked),a.removeEventListener("ended",this.onvended),this.onvseeking=this.onvseeked=this.onvended=null),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.stopLoad()},b.prototype.onMediaSeeking=function(){var a=this.media,b=a?a.currentTime:void 0,c=this.config;Object(h.a)(b)&&j.b.log("media seeking to "+b.toFixed(3));var d=this.mediaBuffer?this.mediaBuffer:a,e=R.bufferInfo(d,b,this.config.maxBufferHole);if(this.state===ao.FRAG_LOADING){var f=this.fragCurrent;if(0===e.len&&f){var g=c.maxFragLookUpTolerance,i=f.start-g,k=f.start+f.duration+g;b<i||b>k?(f.loader&&(j.b.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),f.loader.abort()),this.fragCurrent=null,this.fragPrevious=null,this.state=ao.IDLE):j.b.log("seeking outside of buffer but within currently loaded fragment range")}}else this.state===ao.ENDED&&(0===e.len&&(this.fragPrevious=0),this.state=ao.IDLE);a&&(this.lastCurrentTime=b),this.loadedmetadata||(this.nextLoadPosition=this.startPosition=b),this.tick()},b.prototype.onMediaSeeked=function(){var a=this.media,b=a?a.currentTime:void 0;Object(h.a)(b)&&j.b.log("media seeked to "+b.toFixed(3)),this.tick()},b.prototype.onMediaEnded=function(){j.b.log("media ended"),this.startPosition=this.lastCurrentTime=0},b.prototype.onManifestLoading=function(){j.b.log("trigger BUFFER_RESET"),this.hls.trigger(i.a.BUFFER_RESET),this.fragmentTracker.removeAllFragments(),this.stalled=!1,this.startPosition=this.lastCurrentTime=0},b.prototype.onManifestParsed=function(a){var b=!1,c=!1,d=void 0;a.levels.forEach(function(a){(d=a.audioCodec)&&(-1!==d.indexOf("mp4a.40.2")&&(b=!0),-1!==d.indexOf("mp4a.40.5")&&(c=!0))}),this.audioCodecSwitch=b&&c,this.audioCodecSwitch&&j.b.log("both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=a.levels,this.startFragRequested=!1;var e=this.config;(e.autoStartLoad||this.forceStartLoad)&&this.hls.startLoad(e.startPosition)},b.prototype.onLevelLoaded=function(a){var b=a.details,c=a.level,d=this.levels[this.levelLastLoaded],e=this.levels[c],f=b.totalduration,g=0;if(j.b.log("level "+c+" loaded ["+b.startSN+","+b.endSN+"],duration:"+f),b.live){var k=e.details;k&&b.fragments.length>0?(ad(k,b),g=b.fragments[0].start,this.liveSyncPosition=this.computeLivePosition(g,k),b.PTSKnown&&Object(h.a)(g)?j.b.log("live playlist sliding:"+g.toFixed(3)):(j.b.log("live playlist - outdated PTS, unknown sliding"),ag(this.fragPrevious,d,b))):(j.b.log("live playlist - first load, unknown sliding"),b.PTSKnown=!1,ag(this.fragPrevious,d,b))}else b.PTSKnown=!1;if(e.details=b,this.levelLastLoaded=c,this.hls.trigger(i.a.LEVEL_UPDATED,{details:b,level:c}),!1===this.startFragRequested){if(-1===this.startPosition|| -1===this.lastCurrentTime){var l=b.startTimeOffset;Object(h.a)(l)?(l<0&&(j.b.log("negative start time offset "+l+", count from end of last fragment"),l=g+f+l),j.b.log("start time offset found in playlist, adjust startPosition to "+l),this.startPosition=l):b.live?(this.startPosition=this.computeLivePosition(g,b),j.b.log("configure startPosition to "+this.startPosition)):this.startPosition=0,this.lastCurrentTime=this.startPosition}this.nextLoadPosition=this.startPosition}this.state===ao.WAITING_LEVEL&&(this.state=ao.IDLE),this.tick()},b.prototype.onKeyLoaded=function(){this.state===ao.KEY_LOADING&&(this.state=ao.IDLE,this.tick())},b.prototype.onFragLoaded=function(a){var b=this.fragCurrent,c=this.hls,d=this.levels,e=this.media,f=a.frag;if(this.state===ao.FRAG_LOADING&&b&&"main"===f.type&&f.level===b.level&&f.sn===b.sn){var g=a.stats,h=d[b.level],k=h.details;if(this.bitrateTest=!1,this.stats=g,j.b.log("Loaded "+b.sn+" of ["+k.startSN+" ,"+k.endSN+"],level "+b.level),f.bitrateTest&&c.nextLoadLevel)this.state=ao.IDLE,this.startFragRequested=!1,g.tparsed=g.tbuffered=window.performance.now(),c.trigger(i.a.FRAG_BUFFERED,{stats:g,frag:b,id:"main"}),this.tick();else if("initSegment"===f.sn)this.state=ao.IDLE,g.tparsed=g.tbuffered=window.performance.now(),k.initSegment.data=a.payload,c.trigger(i.a.FRAG_BUFFERED,{stats:g,frag:b,id:"main"}),this.tick();else{j.b.log("Parsing "+b.sn+" of ["+k.startSN+" ,"+k.endSN+"],level "+b.level+", cc "+b.cc),this.state=ao.PARSING,this.pendingBuffering=!0,this.appended=!1,f.bitrateTest&&(f.bitrateTest=!1,this.fragmentTracker.onFragLoaded({frag:f}));var l=!(e&&e.seeking)&&(k.PTSKnown||!k.live),m=k.initSegment?k.initSegment.data:[],n=this._getAudioCodec(h),o=this.demuxer=this.demuxer||new _(this.hls,"main");o.push(a.payload,m,n,h.videoCodec,b,k.totalduration,l)}}this.fragLoadError=0},b.prototype.onFragParsingInitSegment=function(a){var b=this.fragCurrent,c=a.frag;if(b&&"main"===a.id&&c.sn===b.sn&&c.level===b.level&&this.state===ao.PARSING){var d=a.tracks,e=void 0,f=void 0;if(d.audio&&this.altAudio&&delete d.audio,f=d.audio){var g=this.levels[this.level].audioCodec,h=navigator.userAgent.toLowerCase();g&&this.audioCodecSwap&&(j.b.log("swapping playlist audio codec"),g=-1!==g.indexOf("mp4a.40.5")?"mp4a.40.2":"mp4a.40.5"),this.audioCodecSwitch&&1!==f.metadata.channelCount&& -1===h.indexOf("firefox")&&(g="mp4a.40.5"),-1!==h.indexOf("android")&&"audio/mpeg"!==f.container&&(g="mp4a.40.2",j.b.log("Android: force audio codec to "+g)),f.levelCodec=g,f.id=a.id}for(e in(f=d.video)&&(f.levelCodec=this.levels[this.level].videoCodec,f.id=a.id),this.hls.trigger(i.a.BUFFER_CODECS,d),d){f=d[e],j.b.log("main track:"+e+",container:"+f.container+",codecs[level/parsed]=["+f.levelCodec+"/"+f.codec+"]");var k=f.initSegment;k&&(this.appended=!0,this.pendingBuffering=!0,this.hls.trigger(i.a.BUFFER_APPENDING,{type:e,data:k,parent:"main",content:"initSegment"}))}this.tick()}},b.prototype.onFragParsingData=function(a){var b=this,c=this.fragCurrent,d=a.frag;if(c&&"main"===a.id&&d.sn===c.sn&&d.level===c.level&&!("audio"===a.type&&this.altAudio)&&this.state===ao.PARSING){var e=this.levels[this.level],f=c;if(Object(h.a)(a.endPTS)||(a.endPTS=a.startPTS+c.duration,a.endDTS=a.startDTS+c.duration),!0===a.hasAudio&&f.addElementaryStream(r.ElementaryStreamTypes.AUDIO),!0===a.hasVideo&&f.addElementaryStream(r.ElementaryStreamTypes.VIDEO),j.b.log("Parsed "+a.type+",PTS:["+a.startPTS.toFixed(3)+","+a.endPTS.toFixed(3)+"],DTS:["+a.startDTS.toFixed(3)+"/"+a.endDTS.toFixed(3)+"],nb:"+a.nb+",dropped:"+(a.dropped||0)),"video"===a.type){if(f.dropped=a.dropped,f.dropped){if(f.backtracked)j.b.warn("Already backtracked on this fragment, appending with the gap",f.sn);else{var g=e.details;if(g&&f.sn===g.startSN)j.b.warn("missing video frame(s) on first frag, appending with gap",f.sn);else{j.b.warn("missing video frame(s), backtracking fragment",f.sn),this.fragmentTracker.removeFragment(f),f.backtracked=!0,this.nextLoadPosition=a.startPTS,this.state=ao.IDLE,this.fragPrevious=f,this.tick();return}}}else f.backtracked=!1}var k=ac(e.details,f,a.startPTS,a.endPTS,a.startDTS,a.endDTS),l=this.hls;l.trigger(i.a.LEVEL_PTS_UPDATED,{details:e.details,level:this.level,drift:k,type:a.type,start:a.startPTS,end:a.endPTS}),[a.data1,a.data2].forEach(function(c){c&&c.length&&b.state===ao.PARSING&&(b.appended=!0,b.pendingBuffering=!0,l.trigger(i.a.BUFFER_APPENDING,{type:a.type,data:c,parent:"main",content:"data"}))}),this.tick()}},b.prototype.onFragParsed=function(a){var b=this.fragCurrent,c=a.frag;b&&"main"===a.id&&c.sn===b.sn&&c.level===b.level&&this.state===ao.PARSING&&(this.stats.tparsed=window.performance.now(),this.state=ao.PARSED,this._checkAppendedParsed())},b.prototype.onAudioTrackSwitching=function(a){var b=!!a.url,c=a.id;if(!b){if(this.mediaBuffer!==this.media){j.b.log("switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var d=this.fragCurrent;d.loader&&(j.b.log("switching to main audio track, cancel main fragment load"),d.loader.abort()),this.fragCurrent=null,this.fragPrevious=null,this.demuxer&&(this.demuxer.destroy(),this.demuxer=null),this.state=ao.IDLE}var e=this.hls;e.trigger(i.a.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),e.trigger(i.a.AUDIO_TRACK_SWITCHED,{id:c}),this.altAudio=!1}},b.prototype.onAudioTrackSwitched=function(a){var b=a.id,c=!!this.hls.audioTracks[b].url;if(c){var d=this.videoBuffer;d&&this.mediaBuffer!==d&&(j.b.log("switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=d)}this.altAudio=c,this.tick()},b.prototype.onBufferCreated=function(a){var b=a.tracks,c=void 0,d=void 0,e=!1;for(var f in b){var g=b[f];"main"===g.id?(d=f,c=g,"video"===f&&(this.videoBuffer=b[f].buffer)):e=!0}e&&c?(j.b.log("alternate track found, use "+d+".buffered to schedule main fragment loading"),this.mediaBuffer=c.buffer):this.mediaBuffer=this.media},b.prototype.onBufferAppended=function(a){if("main"===a.parent){var b=this.state;(b===ao.PARSING||b===ao.PARSED)&&(this.pendingBuffering=a.pending>0,this._checkAppendedParsed())}},b.prototype._checkAppendedParsed=function(){if(this.state===ao.PARSED&&(!this.appended||!this.pendingBuffering)){var a=this.fragCurrent;if(a){var b=this.mediaBuffer?this.mediaBuffer:this.media;j.b.log("main buffered : "+ae.toString(b.buffered)),this.fragPrevious=a;var c=this.stats;c.tbuffered=window.performance.now(),this.fragLastKbps=Math.round(8*c.total/(c.tbuffered-c.tfirst)),this.hls.trigger(i.a.FRAG_BUFFERED,{stats:c,frag:a,id:"main"}),this.state=ao.IDLE}this.tick()}},b.prototype.onError=function(a){var b=a.frag||this.fragCurrent;if(!b||"main"===b.type){var c=!!this.media&&R.isBuffered(this.media,this.media.currentTime)&&R.isBuffered(this.media,this.media.currentTime+.5);switch(a.details){case g.a.FRAG_LOAD_ERROR:case g.a.FRAG_LOAD_TIMEOUT:case g.a.KEY_LOAD_ERROR:case g.a.KEY_LOAD_TIMEOUT:if(!a.fatal){if(this.fragLoadError+1<=this.config.fragLoadingMaxRetry){var d=Math.min(Math.pow(2,this.fragLoadError)*this.config.fragLoadingRetryDelay,this.config.fragLoadingMaxRetryTimeout);j.b.warn("mediaController: frag loading failed, retry in "+d+" ms"),this.retryDate=window.performance.now()+d,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.fragLoadError++,this.state=ao.FRAG_LOADING_WAITING_RETRY}else j.b.error("mediaController: "+a.details+" reaches max retry, redispatch as fatal ..."),a.fatal=!0,this.state=ao.ERROR}break;case g.a.LEVEL_LOAD_ERROR:case g.a.LEVEL_LOAD_TIMEOUT:this.state===ao.ERROR||(a.fatal?(this.state=ao.ERROR,j.b.warn("streamController: "+a.details+",switch to "+this.state+" state ...")):a.levelRetry||this.state!==ao.WAITING_LEVEL||(this.state=ao.IDLE));break;case g.a.BUFFER_FULL_ERROR:"main"===a.parent&&(this.state===ao.PARSING||this.state===ao.PARSED)&&(c?(this._reduceMaxBufferLength(this.config.maxBufferLength),this.state=ao.IDLE):(j.b.warn("buffer full error also media.currentTime is not buffered, flush everything"),this.fragCurrent=null,this.flushMainBuffer(0,Number.POSITIVE_INFINITY)))}}},b.prototype._reduceMaxBufferLength=function(a){var b=this.config;return b.maxMaxBufferLength>=a&&(b.maxMaxBufferLength/=2,j.b.warn("main:reduce max buffer length to "+b.maxMaxBufferLength+"s"),!0)},b.prototype._checkBuffer=function(){var a=this.media;if(a&&0!==a.readyState){var b=(this.mediaBuffer?this.mediaBuffer:a).buffered;!this.loadedmetadata&&b.length?(this.loadedmetadata=!0,this._seekToStartPos()):this.immediateSwitch?this.immediateLevelSwitchEnd():this.gapController.poll(this.lastCurrentTime,b)}},b.prototype.onFragLoadEmergencyAborted=function(){this.state=ao.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tick()},b.prototype.onBufferFlushed=function(){var a=this.mediaBuffer?this.mediaBuffer:this.media;a&&this.fragmentTracker.detectEvictedFragments(r.ElementaryStreamTypes.VIDEO,a.buffered),this.state=ao.IDLE,this.fragPrevious=null},b.prototype.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},b.prototype.computeLivePosition=function(a,b){var c=void 0!==this.config.liveSyncDuration?this.config.liveSyncDuration:this.config.liveSyncDurationCount*b.targetduration;return a+Math.max(0,b.totalduration-c)},b.prototype._seekToStartPos=function(){var a=this.media,b=a.currentTime,c=a.seeking?b:this.startPosition;b!==c&&(j.b.log("target start position not buffered, seek to buffered.start(0) "+c+" from current time "+b+" "),a.currentTime=c)},b.prototype._getAudioCodec=function(a){var b=this.config.defaultAudioCodec||a.audioCodec;return this.audioCodecSwap&&(j.b.log("swapping playlist audio codec"),b&&(b=-1!==b.indexOf("mp4a.40.5")?"mp4a.40.2":"mp4a.40.5")),b}
1,an(b,[{key:"state",set:function(a){if(this.state!==a){var b=this.state;this._state=a,j.b.log("main stream:"+b+"->"+a),this.hls.trigger(i.a.STREAM_STATE_TRANSITION,{previousState:b,nextState:a})}},get:function(){return this._state}},{key:"currentLevel",get:function(){var a=this.media;if(a){var b=this.getBufferedFrag(a.currentTime);if(b)return b.level}return -1}},{key:"nextBufferedFrag",get:function(){var a=this.media;return a?this.followingBufferedFrag(this.getBufferedFrag(a.currentTime)):null}},{key:"nextLevel",get:function(){var a=this.nextBufferedFrag;return a?a.level:-1}},{key:"liveSyncPosition",get:function(){return this._liveSyncPosition},set:function(a){this._liveSyncPosition=a}}]),b}(aj),aq="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},ar=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),as=window.performance,at=function(a){function b(c){!function(a,b){if(!(a instanceof b))throw TypeError("Cannot call a class as a function")}(this,b);var d=function(a,b){if(!a)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return b&&("object"==typeof b||"function"==typeof b)?b:a}(this,a.call(this,c,i.a.MANIFEST_LOADED,i.a.LEVEL_LOADED,i.a.AUDIO_TRACK_SWITCHED,i.a.FRAG_LOADED,i.a.ERROR));return d.canload=!1,d.currentLevelIndex=null,d.manualLevelIndex=-1,d.timer=null,d}return!function(a,b){if("function"!=typeof b&&null!==b)throw TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}(b,a),b.prototype.onHandlerDestroying=function(){this.clearTimer(),this.manualLevelIndex=-1},b.prototype.clearTimer=function(){null!==this.timer&&(clearTimeout(this.timer),this.timer=null)},b.prototype.startLoad=function(){var a=this._levels;this.canload=!0,this.levelRetryCount=0,a&&a.forEach(function(a){a.loadError=0;var b=a.details;b&&b.live&&(a.details=void 0)}),null!==this.timer&&this.loadLevel()},b.prototype.stopLoad=function(){this.canload=!1},b.prototype.onManifestLoaded=function(a){var b=[],c=void 0,d={},e=null,f=!1,h=!1,k=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),l=[];if(a.levels.forEach(function(a){a.loadError=0,a.fragmentError=!1,f=f||!!a.videoCodec,h=h||!!a.audioCodec||!!(a.attrs&&a.attrs.AUDIO),k&&a.audioCodec&& -1!==a.audioCodec.indexOf("mp4a.40.34")&&(a.audioCodec=void 0),(e=d[a.bitrate])?e.url.push(a.url):(a.url=[a.url],a.urlId=0,d[a.bitrate]=a,b.push(a)),a.attrs&&a.attrs.AUDIO&&aa(e||a,"audio",a.attrs.AUDIO),a.attrs&&a.attrs.SUBTITLES&&aa(e||a,"text",a.attrs.SUBTITLES)}),f&&h&&(b=b.filter(function(a){return!!a.videoCodec})),b=b.filter(function(a){var b=a.audioCodec,c=a.videoCodec;return(!b||y(b))&&(!c||y(c))}),a.audioTracks&&(l=a.audioTracks.filter(function(a){return!a.audioCodec||y(a.audioCodec,"audio")})).forEach(function(a,b){a.id=b}),b.length>0){c=b[0].bitrate,b.sort(function(a,b){return a.bitrate-b.bitrate}),this._levels=b;for(var m=0;m<b.length;m++)if(b[m].bitrate===c){this._firstLevel=m,j.b.log("manifest loaded,"+b.length+" level(s) found, first bitrate:"+c);break}this.hls.trigger(i.a.MANIFEST_PARSED,{levels:b,audioTracks:l,firstLevel:this._firstLevel,stats:a.stats,audio:h,video:f,altAudio:l.length>0&&f})}else this.hls.trigger(i.a.ERROR,{type:g.b.MEDIA_ERROR,details:g.a.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:this.hls.url,reason:"no level with compatible codecs found in manifest"})},b.prototype.setLevelInternal=function(a){var b=this._levels,c=this.hls;if(a>=0&&a<b.length){if(this.clearTimer(),this.currentLevelIndex!==a){j.b.log("switching to level "+a),this.currentLevelIndex=a;var d=b[a];d.level=a,c.trigger(i.a.LEVEL_SWITCHING,d)}var e=b[a],f=e.details;if(!f||f.live){var h=e.urlId;c.trigger(i.a.LEVEL_LOADING,{url:e.url[h],level:a,id:h})}}else c.trigger(i.a.ERROR,{type:g.b.OTHER_ERROR,details:g.a.LEVEL_SWITCH_ERROR,level:a,fatal:!1,reason:"invalid level idx"})}
1,b.prototype.onError=function(a){if(a.fatal){a.type===g.b.NETWORK_ERROR&&this.clearTimer();return}var b=!1,c=!1,d=void 0;switch(a.details){case g.a.FRAG_LOAD_ERROR:case g.a.FRAG_LOAD_TIMEOUT:case g.a.KEY_LOAD_ERROR:case g.a.KEY_LOAD_TIMEOUT:d=a.frag.level,c=!0;break;case g.a.LEVEL_LOAD_ERROR:case g.a.LEVEL_LOAD_TIMEOUT:d=a.context.level,b=!0;break;case g.a.REMUX_ALLOC_ERROR:d=a.level,b=!0}void 0!==d&&this.recoverLevel(a,d,b,c)},b.prototype.recoverLevel=function(a,b,c,d){var e=this,f=this.hls.config,g=a.details,h=this._levels[b],i=void 0,k=void 0,l=void 0;if(h.loadError++,h.fragmentError=d,c){if(this.levelRetryCount+1<=f.levelLoadingMaxRetry)k=Math.min(Math.pow(2,this.levelRetryCount)*f.levelLoadingRetryDelay,f.levelLoadingMaxRetryTimeout),this.timer=setTimeout(function(){return e.loadLevel()},k),a.levelRetry=!0,this.levelRetryCount++,j.b.warn("level controller, "+g+", retry in "+k+" ms, current retry count is "+this.levelRetryCount);else{j.b.error("level controller, cannot recover from "+g+" error"),this.currentLevelIndex=null,this.clearTimer(),a.fatal=!0;return}}(c||d)&&((i=h.url.length)>1&&h.loadError<i?(h.urlId=(h.urlId+1)%i,h.details=void 0,j.b.warn("level controller, "+g+" for level "+b+": switching to redundant URL-id "+h.urlId)):-1===this.manualLevelIndex?(l=0===b?this._levels.length-1:b-1,j.b.warn("level controller, "+g+": switch to "+l),this.hls.nextAutoLevel=this.currentLevelIndex=l):d&&(j.b.warn("level controller, "+g+": reload a fragment"),this.currentLevelIndex=null))},b.prototype.onFragLoaded=function(a){var b=a.frag;if(void 0!==b&&"main"===b.type){var c=this._levels[b.level];void 0!==c&&(c.fragmentError=!1,c.loadError=0,this.levelRetryCount=0)}},b.prototype.onLevelLoaded=function(a){var b=this,c=a.level;if(c===this.currentLevelIndex){var d=this._levels[c];d.fragmentError||(d.loadError=0,this.levelRetryCount=0);var e=a.details;if(e.live){var f=1e3*(e.averagetargetduration?e.averagetargetduration:e.targetduration),g=f,h=d.details;h&&e.endSN===h.endSN&&(g/=2,j.b.log("same live playlist, reload twice faster")),g-=as.now()-a.stats.trequest,g=Math.max(f/2,Math.round(g)),j.b.log("live playlist, reload in "+Math.round(g)+" ms"),this.timer=setTimeout(function(){return b.loadLevel()},g)}else this.clearTimer()}},b.prototype.onAudioTrackSwitched=function(a){var b=this.hls.audioTracks[a.id].groupId,c=this.hls.levels[this.currentLevelIndex];if(c&&c.audioGroupIds){var d=c.audioGroupIds.findIndex(function(a){return a===b});d!==c.urlId&&(c.urlId=d,this.startLoad())}},b.prototype.loadLevel=function(){if(j.b.debug("call to loadLevel"),null!==this.currentLevelIndex&&this.canload){var a=this._levels[this.currentLevelIndex];if((void 0===a?"undefined":aq(a))==="object"&&a.url.length>0){var b=this.currentLevelIndex,c=a.urlId,d=a.url[c];j.b.log("Attempt loading level index "+b+" with URL-id "+c),this.hls.trigger(i.a.LEVEL_LOADING,{url:d,level:b,id:c})}}},ar(b,[{key:"levels",get:function(){return this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(a){var b=this._levels;b&&(a=Math.min(a,b.length-1),this.currentLevelIndex===a&&b[a].details||this.setLevelInternal(a))}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(a){this.manualLevelIndex=a,void 0===this._startLevel&&(this._startLevel=a),-1!==a&&(this.level=a)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(a){this._firstLevel=a}},{key:"startLevel",get:function(){if(void 0!==this._startLevel)return this._startLevel;var a=this.hls.config.startLevel;return void 0!==a?a:this._firstLevel},set:function(a){this._startLevel=a}},{key:"nextLoadLevel",get:function(){return -1!==this.manualLevelIndex?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(a){this.level=a,-1===this.manualLevelIndex&&(this.hls.nextAutoLevel=a)}}]),b}(m),au=c(6);function av(a,b){var c=null;try{c=new window.Event("addtrack")}catch(d){(c=document.createEvent("Event")).initEvent("addtrack",!1,!1)}c.track=a,b.dispatchEvent(c)}function aw(a){if(a&&a.cues)for(;a.cues.length>0;)a.removeCue(a.cues[0])}var ax=function(a){function b(c){!function(a,b){if(!(a instanceof b))throw TypeError("Cannot call a class as a function")}(this,b);var d=function(a,b){if(!a)throw ReferenceError("this hasn't been initialised - super() hasn't been called");
1return b&&("object"==typeof b||"function"==typeof b)?b:a}(this,a.call(this,c,i.a.MEDIA_ATTACHED,i.a.MEDIA_DETACHING,i.a.FRAG_PARSING_METADATA));return d.id3Track=void 0,d.media=void 0,d}return!function(a,b){if("function"!=typeof b&&null!==b)throw TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}(b,a),b.prototype.destroy=function(){m.prototype.destroy.call(this)},b.prototype.onMediaAttached=function(a){this.media=a.media,this.media},b.prototype.onMediaDetaching=function(){aw(this.id3Track),this.id3Track=void 0,this.media=void 0},b.prototype.getID3Track=function(a){for(var b=0;b<a.length;b++){var c=a[b];if("metadata"===c.kind&&"id3"===c.label)return av(c,this.media),c}return this.media.addTextTrack("metadata","id3")},b.prototype.onFragParsingMetadata=function(a){var b=a.frag,c=a.samples;this.id3Track||(this.id3Track=this.getID3Track(this.media.textTracks),this.id3Track.mode="hidden");for(var d=window.WebKitDataCue||window.VTTCue||window.TextTrackCue,e=0;e<c.length;e++){var f=au.a.getID3Frames(c[e].data);if(f){var g=c[e].pts,h=e<c.length-1?c[e+1].pts:b.endPTS;g===h&&(h+=1e-4);for(var i=0;i<f.length;i++){var j=f[i];if(!au.a.isTimeStampFrame(j)){var k=new d(g,h,"");k.value=j,this.id3Track.addCue(k)}}}}},b}(m),ay=function(){function a(b){!function(a,b){if(!(a instanceof b))throw TypeError("Cannot call a class as a function")}(this,a),this.alpha_=b?Math.exp(Math.log(.5)/b):0,this.estimate_=0,this.totalWeight_=0}return a.prototype.sample=function(a,b){var c=Math.pow(this.alpha_,a);this.estimate_=b*(1-c)+c*this.estimate_,this.totalWeight_+=a},a.prototype.getTotalWeight=function(){return this.totalWeight_},a.prototype.getEstimate=function(){if(!this.alpha_)return this.estimate_;var a=1-Math.pow(this.alpha_,this.totalWeight_);return this.estimate_/a},a}(),az=function(){function a(b,c,d,e){!function(a,b){if(!(a instanceof b))throw TypeError("Cannot call a class as a function")}(this,a),this.hls=b,this.defaultEstimate_=e,this.minWeight_=.001,this.minDelayMs_=50,this.slow_
vendor: 5,167 bytes, line 1
1=new ay(c),this.fast_=new ay(d)}return a.prototype.sample=function(a,b){a=Math.max(a,this.minDelayMs_);var c=8e3*b/a,d=a/1e3;this.fast_.sample(d,c),this.slow_.sample(d,c)},a.prototype.canEstimate=function(){var a=this.fast_;return a&&a.getTotalWeight()>=this.minWeight_},a.prototype.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},a.prototype.destroy=function(){},a}(),aA=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),aB=window.performance,aC=function(a){function b(c){!function(a,b){if(!(a instanceof b))throw TypeError("Cannot call a class as a function")}(this,b);var d=function(a,b){if(!a)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return b&&("object"==typeof b||"function"==typeof b)?b:a}(this,a.call(this,c,i.a.FRAG_LOADING,i.a.FRAG_LOADED,i.a.FRAG_BUFFERED,i.a.ERROR));return d.lastLoadedFragLevel=0,d._nextAutoLevel=-1,d.hls=c,d.timer=null,d._bwEstimator=null,d.onCheck=d._abandonRulesCheck.bind(d),d}return!function(a,b){if("function"!=typeof b&&null!==b)throw TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}(b,a),b.prototype.destroy=function(){this.clearTimer(),m.prototype.destroy.call(this)},b.prototype.onFragLoading=function(a){var b=a.frag;if("main"===b.type&&(this.timer||(this.fragCurrent=b,this.timer=setInterval(this.onCheck,100)),!this._bwEstimator)){var c=this.hls,d=c.config,e=b.level,f=c.levels[e].details.live,g=void 0,h=void 0;f?(g=d.abrEwmaFastLive,h=d.abrEwmaSlowLive):(g=d.abrEwmaFastVoD,h=d.abrEwmaSlowVoD),this._bwEstimator=new az(c,h,g,d.abrEwmaDefaultEstimate)}},b.prototype._abandonRulesCheck=function(){var a=this.hls,b=a.media,c=this.fragCurrent;if(c){var d=c.loader,e=a.minAutoLevel;if(!d||d.stats&&d.stats.aborted){j.b.warn("frag loader destroy or aborted, disarm abandonRules"),this.clearTimer(),this._nextAutoLevel=-1;return}var f=d.stats;if(b&&f&&(!b.paused&&0!==b.playbackRate||!b.readyState)&&c.autoLevel&&c.level){var g=aB.now()-f.trequest,h=Math.abs(b.playbackRate);if(g>500*c.duration/h){var k=a.levels,l=Math.max(1,f.bw?f.bw/8:1e3*f.loaded/g),m=k[c.level],n=m.realBitrate?Math.max(m.realBitrate,m.bitrate):m.bitrate,o=f.total?f.total:Math.max(f.loaded,Math.round(c.duration*n/8)),p=b.currentTime,q=(o-f.loaded)/l,r=(R.bufferInfo(b,p,a.config.maxBufferHole).end-p)/h;if(r<2*c.duration/h&&q>r){var s=void 0,t=void 0;for(t=c.level-1;t>e;t--){var u=k[t].realBitrate?Math.max(k[t].realBitrate,k[t].bitrate):k[t].bitrate;if((s=c.duration*u/(6.4*l))<r)break}s<q&&(j.b.warn("loading too slow, abort fragment loading and switch to level "+t+":fragLoadedDelay["+t+"]<fragLoadedDelay["+(c.level-1)+"];bufferStarvationDelay:"+s.toFixed(1)+"<"+q.toFixed(1)+":"+r.toFixed(1)),a.nextLoadLevel=t,this._bwEstimator.sample(g,f.loaded),d.abort(),this.clearTimer(),a.trigger(i.a.FRAG_LOAD_EMERGENCY_ABORTED,{frag:c,stats:f}))}}}}},b.prototype.onFragLoaded=function(a){var b=a.frag;if("main"===b.type&&Object(h.a)(b.sn)){if(this.clearTimer(),this.lastLoadedFragLevel=b.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var c=this.hls.levels[b.level],d=(c.loaded?c.loaded.bytes:0)+a.stats.loaded,e=(c.loaded?c.loaded.duration:0)+a.frag.duration;c.loaded={bytes:d,duration:e},c.realBitrate=Math.round(8*d/e)}if(a.frag.bitrateTest){var f=a.stats;f.tparsed=f.tbuffered=f.tload,this.onFragBuffered(a)}}},b.prototype.onFragBuffered=function(a){var b=a.stats,c=a.frag;if(!0!==b.aborted&&"main"===c.type&&Object(h.a)(c.sn)&&(!c.bitrateTest||b.tload===b.tbuffered)){var d=b.tparsed-b.trequest;j.b.log("latency/loading/parsing/append/kbps:"+Math.round(b.tfirst-b.trequest)+"/"+Math.round(b.tload-b.tfirst)+"/"+Math.round(b.tparsed-b.tload)+"/"+Math.round(b.tbuffered-b.tparsed)+"/"+Math.round(8*b.loaded/(b.tbuffered-b.trequest))),this._bwEstimator.sample(d,b.loaded),b.bwEstimate=this._bwEstimator.getEstimate(),c.bitrateTest?this.bitrateTestDelay=d/1e3:this.bitrateTestDelay=0}},b.prototype.onError=function(a){switch(a.details){case g.a.FRAG_LOAD_ERROR:case g.a.FRAG_LOAD_TIMEOUT:this.clearTimer()}},b.prototype.clearTimer=function(){clearInterval(this.timer),this.timer=null},b.prototype._findBestLevel=function(a,b,c,d,e,f,g,h,i){for(var k=e;k>=d;k--){var l=i[k];if(l){var m=l.details,n=m?m.totalduration/m.fragments.length:b,o=!!m&&m.live,p=void 0;p=k<=a?g*c:h*c;var q=i[k].realBitrate?Math.max(i[k].realBitrate,i[k].bitrate):i[k].bitrate,r=q*n/p;if(j.b.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+k+"/"+Math.round(p)+"/"+q+"/"+n+"/"+f+"/"+r),p>q&&(!r||o&&!this.bitrateTestDelay||r<f))return k}}return -1},aA(b,[{key:"nextAutoLevel",get:function(){var a=this._nextAutoLevel,b=this._bwEstimator;if(-1!==a&&(!b||!b.canEstimate()))return a;var c=this._nextABRAutoLevel;
1return -1!==a&&(c=Math.min(a,c)),c},set:function(a){this._nextAutoLevel=a}},{key:"_nextABRAutoLevel",get:function(){var a=this.hls,b=a.maxAutoLevel,c=a.levels,d=a.config,e=a.minAutoLevel,f=a.media,g=this.lastLoadedFragLevel,h=this.fragCurrent?this.fragCurrent.duration:0,i=f?f.currentTime:0,k=f&&0!==f.playbackRate?Math.abs(f.playbackRate):1,l=this._bwEstimator?this._bwEstimator.getEstimate():d.abrEwmaDefaultEstimate,m=(R.bufferInfo(f,i,d.maxBufferHole).end-i)/k,n=this._findBestLevel(g,h,l,e,b,m,d.abrBandWidthFactor,d.abrBandWidthUpFactor,c);if(n>=0)return n;j.b.trace("rebuffering expected to happen, lets try to find a quality level minimizing the rebuffering");var o=h?Math.min(h,d.maxStarvationDelay):d.maxStarvationDelay,p=d.abrBandWidthFactor,q=d.abrBandWidthUpFactor;if(0===m){var r=this.bitrateTestDelay;r&&(o=(h?Math.min(h,d.maxLoadingDelay):d.maxLoadingDelay)-r,j.b.trace("bitrate test took "+Math.round(1e3*r)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*o)+" ms"),p=q=1)}return Math.max(n=this._findBestLevel(g,h,l,e,b,m+o,p,q,c),0)}}]),b}(m),aD=X(),aE=function(a){function b(c){!function(a,b){if(!(a instanceof b))throw TypeError("Cannot call a class as a function")}(this,b);var d=function(a,b){if(!a)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return b&&("object"==typeof b||"function"==typeof b)?b:a}(this,a.call(this,c,i.a.MEDIA_ATTACHING,i.a.MEDIA_DETACHING,i.a.MANIFEST_PARSED,i.a.BUFFER_RESET,i.a.BUFFER_APPENDING,i.a.BUFFER_CODECS,i.a.BUFFER_EOS,i.a.BUFFER_FLUSHING,i.a.LEVEL_PTS_UPDATED,i.a.LEVEL_UPDATED));return d._msDuration=null,d._levelDuration=null,d._live=null,d._objectUrl=null,d.onsbue=d.onSBUpdateEnd.bind(d),d.onsbe=d.onSBUpdateError.bind(d),d.pendingTracks={},d.tracks={},d}return!function(a,b){if("function"!=typeof b&&null!==b)throw TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}(b,a),b.prototype.destroy=function(){m.prototype.destroy.call(this)},b.prototype.onLevelPtsUpdated=function(a){var b=a.type,c=this.tracks.audio;if("audio"===b&&c&&"audio/mpeg"===c.container){var d=this.sourceBuffer.audio;if(Math.abs(d.timestampOffset-a.start)>.1){var e=d.updating;try{d.abort()}catch(f){e=!0,j.b.warn("can not abort audio buffer: "+f)}e?this.audioTimestampOffset=a.start:(j.b.warn("change mpeg audio timestamp offset from "+d.timestampOffset+" to "+a.start),d.timestampOffset=a.start)}}},b.prototype.onManifestParsed=function(a){var b=a.audio,c=a.video||a.levels.length&&a.altAudio,d=0;a.altAudio&&(b||c)&&(d=(b?1:0)+(c?1:0),j.b.log(d+" sourceBuffer(s) expected")),this.sourceBufferNb=d},b.prototype.onMediaAttaching=function(a){var b=this.media=a.media;if(b){var c=this.mediaSource=new aD;this.onmso=this.onMediaSourceOpen.bind(this),this.onmse=this.onMediaSourceEnded.bind(this),this.onmsc=this.onMediaSourceClose.bind(this),c.addEventListener("sourceopen",this.onmso),c.addEventListener("sourceended",this.onmse),c.addEventListener("sourceclose",this.onmsc),b.src=window.URL.createObjectURL(c),this._objectUrl=b.src}},b.prototype.onMediaDetaching=function(){j.b.log("media source detaching");var a=this.mediaSource;if(a){if("open"===a.readyState)try{a.endOfStream()}catch(b){j.b.warn("onMediaDetaching:"+b.message+" while calling endOfStream")}a.removeEventListener("sourceopen",this.onmso),a.removeEventListener("sourceended",this.onmse),a.removeEventListener("sourceclose",this.onmsc),this.media&&(window.URL.revokeObjectURL(this._objectUrl),this.media.src===this._objectUrl?(this.media.removeAttribute("src"),this.media.load()):j.b.warn("media.src was changed by a third party - skip cleanup")),this.mediaSource=null,this.media=null,this._objectUrl=null,this.pendingTracks={},this.tracks={},this.sourceBuffer={},this.flushRange=[],this.segments=[],this.appended=0}this.onmso=this.onmse=this.onmsc=null,this.hls.trigger(i.a.MEDIA_DETACHED)},b.prototype.onMediaSourceOpen=function(){j.b.log("media source opened"),this.hls.trigger(i.a.MEDIA_ATTA
vendor: 5,839 bytes, line 1
1CHED,{media:this.media});var a=this.mediaSource;a&&a.removeEventListener("sourceopen",this.onmso),this.checkPendingTracks()},b.prototype.checkPendingTracks=function(){var a=this.pendingTracks,b=Object.keys(a).length;b&&(this.sourceBufferNb<=b||0===this.sourceBufferNb)&&(this.createSourceBuffers(a),this.pendingTracks={},this.doAppending())},b.prototype.onMediaSourceClose=function(){j.b.log("media source closed")},b.prototype.onMediaSourceEnded=function(){j.b.log("media source ended")},b.prototype.onSBUpdateEnd=function(){if(this.audioTimestampOffset){var a=this.sourceBuffer.audio;j.b.warn("change mpeg audio timestamp offset from "+a.timestampOffset+" to "+this.audioTimestampOffset),a.timestampOffset=this.audioTimestampOffset,delete this.audioTimestampOffset}this._needsFlush&&this.doFlush(),this._needsEos&&this.checkEos(),this.appending=!1;var b=this.parent,c=this.segments.reduce(function(a,c){return c.parent===b?a+1:a},0),d={},e=this.sourceBuffer;for(var f in e)d[f]=e[f].buffered;this.hls.trigger(i.a.BUFFER_APPENDED,{parent:b,pending:c,timeRanges:d}),this._needsFlush||this.doAppending(),this.updateMediaElementDuration()},b.prototype.onSBUpdateError=function(a){j.b.error("sourceBuffer error:",a),this.hls.trigger(i.a.ERROR,{type:g.b.MEDIA_ERROR,details:g.a.BUFFER_APPENDING_ERROR,fatal:!1})},b.prototype.onBufferReset=function(){var a=this.sourceBuffer;for(var b in a){var c=a[b];try{this.mediaSource.removeSourceBuffer(c),c.removeEventListener("updateend",this.onsbue),c.removeEventListener("error",this.onsbe)}catch(d){}}this.sourceBuffer={},this.flushRange=[],this.segments=[],this.appended=0},b.prototype.onBufferCodecs=function(a){if(0===Object.keys(this.sourceBuffer).length){for(var b in a)this.pendingTracks[b]=a[b];var c=this.mediaSource;c&&"open"===c.readyState&&this.checkPendingTracks()}},b.prototype.createSourceBuffers=function(a){var b=this.sourceBuffer,c=this.mediaSource;for(var d in a)if(!b[d]){var e=a[d],f=e.levelCodec||e.codec,h=e.container+";codecs="+f;j.b.log("creating sourceBuffer("+h+")");try{var k=b[d]=c.addSourceBuffer(h);k.addEventListener("updateend",this.onsbue),k.addEventListener("error",this.onsbe),this.tracks[d]={codec:f,container:e.container},e.buffer=k}catch(l){j.b.error("error while trying to add sourceBuffer:"+l.message),this.hls.trigger(i.a.ERROR,{type:g.b.MEDIA_ERROR,details:g.a.BUFFER_ADD_CODEC_ERROR,fatal:!1,err:l,mimeType:h})}}this.hls.trigger(i.a.BUFFER_CREATED,{tracks:a})},b.prototype.onBufferAppending=function(a){this._needsFlush||(this.segments?this.segments.push(a):this.segments=[a],this.doAppending())},b.prototype.onBufferAppendFail=function(a){j.b.error("sourceBuffer error:",a.event),this.hls.trigger(i.a.ERROR,{type:g.b.MEDIA_ERROR,details:g.a.BUFFER_APPENDING_ERROR,fatal:!1})},b.prototype.onBufferEos=function(a){var b=this.sourceBuffer,c=a.type;for(var d in b)c&&d!==c||b[d].ended||(b[d].ended=!0,j.b.log(d+" sourceBuffer now EOS"));this.checkEos()},b.prototype.checkEos=function(){var a=this.sourceBuffer,b=this.mediaSource;if(!b||"open"!==b.readyState){this._needsEos=!1;return}for(var c in a){var d=a[c];if(!d.ended)return;if(d.updating){this._needsEos=!0;return}}j.b.log("all media data available, signal endOfStream() to MediaSource and stop loading fragment");try{b.endOfStream()}catch(e){j.b.warn("exception while calling mediaSource.endOfStream()")}this._needsEos=!1},b.prototype.onBufferFlushing=function(a){this.flushRange.push({start:a.startOffset,end:a.endOffset,type:a.type}),this.flushBufferCounter=0,this.doFlush()},b.prototype.onLevelUpdated=function(a){var b=a.details;b.fragments.length>0&&(this._levelDuration=b.totalduration+b.fragments[0].start,this._live=b.live,this.updateMediaElementDuration())},b.prototype.updateMediaElementDuration=function(){var a=this.hls.config,b=void 0;if(null!==this._levelDuration&&this.media&&this.mediaSource&&this.sourceBuffer&&0!==this.media.readyState&&"open"===this.mediaSource.readyState){for(var c in this.sourceBuffer)if(!0===this.sourceBuffer[c].updating)return;b=this.media.duration,null===this._msDuration&&(this._msDuration=this.mediaSource.duration),!0===this._live&& !0===a.liveDurationInfinity?(j.b.log("Media Source duration is set to Infinity"),this._msDuration=this.mediaSource.duration=1/0):(this._levelDuration>this._msDuration&&this._levelDuration>b||!Object(h.a)(b))&&(j.b.log("Updating Media Source duration to "+this._levelDuration.toFixed(3)),this._msDuration=this.mediaSource.duration=this._levelDuration)}},b.prototype.doFlush=function(){for(;this.flushRange.length;){var a=this.flushRange[0];if(this.flushBuffer(a.start,a.end,a.type))this.flushRange.shift(),this.flushBufferCounter=0;else{this._needsFlush=!0;return}}if(0===this.flushRange.length){this._needsFlush=!1;var b=0,c=this.sourceBuffer;try{for(var d in c)b+=c[d].buffered.length}catch(e){j.b.error("error while accessing sourceBuffer.buffered")}this.appended=b,this.hls.trigger(i.a.BUFFER_FLUSHED)}},b.prototype.doAppending=function(){var a=this.hls,b=this.sourceBuffer,c=this.segments;if(Object.keys(b).length){if(this.media.error){this.segments=[],j.b.error("trying to append although a media error occured, flush segment and abort");return}if(this.appending)return;if(c&&c.length){var d=c.shift();try{var e=b[d.type];e?e.updating?c.unshift(d):(e.ended=!1,this.parent=d.parent,e.appendBuffer(d.data),this.appendError=0,this.appended++,this.appending=!0):this.onSBUpdateEnd()}catch(f){j.b.error("error while trying to append buffer:"+f.message),c.unshift(d);var h={type:g.b.MEDIA_ERROR,parent:d.parent};22!==f.code?(this.appendError?this.appendError++:this.appendError=1,h.details=g.a.BUFFER_APPEND_ERROR,this.appendError>a.config.appendErrorMaxRetry?(j.b.log("fail "+a.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),c=[],h.fatal=!0,a.trigger(i.a.ERROR,h)):(h.fatal=!1,a.trigger(i.a.ERROR,h))
1):(this.segments=[],h.details=g.a.BUFFER_FULL_ERROR,h.fatal=!1,a.trigger(i.a.ERROR,h))}}}},b.prototype.flushBuffer=function(a,b,c){var d=void 0,e=void 0,f=void 0,g=void 0,h=void 0,i=void 0,k=this.sourceBuffer;if(Object.keys(k).length){if(j.b.log("flushBuffer,pos/start/end: "+this.media.currentTime.toFixed(3)+"/"+a+"/"+b),this.flushBufferCounter<this.appended){for(var l in k)if(!c||l===c){if((d=k[l]).ended=!1,d.updating)return j.b.warn("cannot flush, sb updating in progress"),!1;try{for(e=0;e<d.buffered.length;e++)if(f=d.buffered.start(e),g=d.buffered.end(e),-1!==navigator.userAgent.toLowerCase().indexOf("firefox")&&b===Number.POSITIVE_INFINITY?(h=a,i=b):(h=Math.max(f,a),i=Math.min(g,b)),Math.min(i,g)-h>.5)return this.flushBufferCounter++,j.b.log("flush "+l+" ["+h+","+i+"], of ["+f+","+g+"], pos:"+this.media.currentTime),d.remove(h,i),!1}catch(m){j.b.warn("exception while accessing sourcebuffer, it might have been removed from MediaSource")}}}else j.b.warn("abort flushing too many retries");j.b.log("buffer flushed")}return!0},b}(m),aF=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),aG=function(a){function b(c){!function(a,b){if(!(a instanceof b))throw TypeError("Cannot call a class as a function")}(this,b);var d=function(a,b){if(!a)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return b&&("object"==typeof b||"function"==typeof b)?b:a}(this,a.call(this,c,i.a.FPS_DROP_LEVEL_CAPPING,i.a.MEDIA_ATTACHING,i.a.MANIFEST_PARSED,i.a.BUFFER_CODECS,i.a.MEDIA_DETACHING));return d.autoLevelCapping=Number.POSITIVE_INFINITY,d.firstLevel=null,d.levels=[],d.media=null,d.restrictedLevels=[],d.timer=null,d}return!function(a,b){if("function"!=typeof b&&null!==b)throw TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}(b,a),b.prototype.destroy=function(){this.hls.config.capLevelToPlayerSize&&(this.media=null,this._stopCapping())},b.prototype.onFpsDropLevelCapping=function(a){b.isLevelAllowed(a.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(a.droppedLevel)},b.prototype.onMediaAttaching=function(a){this.media=a.media instanceof window.HTMLVideoElement?a.media:null},b.prototype.onManifestParsed=function(a){var b=this.hls;this.restrictedLevels=[],this.levels=a.levels,this.firstLevel=a.firstLevel,b.config.capLevelToPlayerSize&&(a.video||a.levels.length&&a.altAudio)&&this._startCapping()},b.prototype.onBufferCodecs=function(a){this.hls.config.capLevelToPlayerSize&&a.video&&this._startCapping()},b.prototype.onLevelsUpdated=function(a){this.levels=a.levels},b.prototype.onMediaDetaching=function(){this._stopCapping()},b.prototype.detectPlayerSize=function(){if(this.media){var a=this.levels?this.levels.length:0;if(a){var b=this.hls;b.autoLevelCapping=this.getMaxLevel(a-1),b.autoLevelCapping>this.autoLevelCapping&&b.streamController.nextLevelSwitch(),this.autoLevelCapping=b.autoLevelCapping}}},b.prototype.getMaxLevel=function(a){var c=this;if(!this.levels)return -1;var d=this.levels.filter(function(d,e){return b.isLevelAllowed(e,c.restrictedLevels)&&e<=a});return b.getMaxLevelByMediaSize(d,this.mediaWidth,this.mediaHeight)},b.prototype._startCapping=function(){!this.timer&&(this.autoLevelCapping=Number.POSITIVE_INFINITY,this.hls.firstLevel=this.getMaxLevel(this.firstLevel),clearInterval(this.timer),this.timer=setInterval(this.detectPlayerSize.bind(this),1e3),this.detectPlayerSize())},b.prototype._stopCapping=function(){this.restrictedLevels=[],this.firstLevel=null,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(this.timer=clearInterval(this.timer),this.timer=null)},b.isLevelAllowed=function(a){var b=arguments.length>1&& void 0!==arguments[1]?arguments[1]:[];return -1===b.indexOf(a)},b.getMaxLevelByMediaSize=function(a,b,c){if(!a||a&&!a.length)return -1;for(var d=a.length-1,e=0;e<a.length;e+=1){var f,g,h=a[e];if((h.width>=b||h.height>=c)&&(f=h,!(g=a[e+1])||f.width!==g.width||f.height!==g.height)){d=e;break}}return d},aF(b,[{key:"mediaWidth",get:function(){var a=void 0,c=this.media;return c&&(a=c.width||c.clientWidth||c.offsetWidth,a*=b.contentScaleFactor),a}
1},{key:"mediaHeight",get:function(){var a=void 0,c=this.media;return c&&(a=c.height||c.clientHeight||c.offsetHeight,a*=b.contentScaleFactor),a}}],[{key:"contentScaleFactor",get:function(){var a=1;try{a=window.devicePixelRatio}catch(b){}return a}}]),b}(m),aH=window.performance,aI=function(a){function b(c){return!function(a,b){if(!(a instanceof b))throw TypeError("Cannot call a class as a function")}(this,b),function(a,b){if(!a)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return b&&("object"==typeof b||"function"==typeof b)?b:a}(this,a.call(this,c,i.a.MEDIA_ATTACHING))}return!function(a,b){if("function"!=typeof b&&null!==b)throw TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}(b,a),b.prototype.destroy=function(){this.timer&&clearInterval(this.timer),this.isVideoPlaybackQualityAvailable=!1},b.prototype.onMediaAttaching=function(a){var b=this.hls.config;b.capLevelOnFPSDrop&&("function"==typeof(this.video=a.media instanceof window.HTMLVideoElement?a.media:null).getVideoPlaybackQuality&&(this.isVideoPlaybackQualityAvailable=!0),clearInterval(this.timer),this.timer=setInterval(this.checkFPSInterval.bind(this),b.fpsDroppedMonitoringPeriod))},b.prototype.checkFPS=function(a,b,c){var d=aH.now();if(b){if(this.lastTime){var e=d-this.lastTime,f=c-this.lastDroppedFrames,g=b-this.lastDecodedFrames,h=1e3*f/e,k=this.hls;if(k.trigger(i.a.FPS_DROP,{currentDropped:f,currentDecoded:g,totalDroppedFrames:c}),h>0&&f>k.config.fpsDroppedMonitoringThreshold*g){var l=k.currentLevel;j.b.warn("drop FPS ratio greater than max allowed value for currentLevel: "+l),l>0&&(-1===k.autoLevelCapping||k.autoLevelCapping>=l)&&(l-=1,k.trigger(i.a.FPS_DROP_LEVEL_CAPPING,{level:l,droppedLevel:k.currentLevel}),k.autoLevelCapping=l,k.streamController.nextLevelSwitch())}}this.lastTime=d,this.lastDroppedFrames=c,this.lastDecodedFrames=b}},b.prototype.checkFPSInterval=function(){var a=this.video;if(a){if(this.isVideoPlaybackQualityAvailable){var b=a.getVideoPlaybackQuality();this.checkFPS(a,b.totalVideoFrames,b.droppedVideoFrames)}else this.checkFPS(a,a.webkitDecodedFrameCount,a.webkitDroppedFrameCount)}},b}(m),aJ=window,aK=aJ.performance,aL=aJ.XMLHttpRequest,aM=function(){function a(b){!function(a,b){if(!(a instanceof b))throw TypeError("Cannot call a class as a function")}(this,a),b&&b.xhrSetup&&(this.xhrSetup=b.xhrSetup)}return a.prototype.destroy=function(){this.abort(),this.loader=null},a.prototype.abort=function(){var a=this.loader;a&&4!==a.readyState&&(this.stats.aborted=!0,a.abort()),window.clearTimeout(this.requestTimeout),this.requestTimeout=null,window.clearTimeout(this.retryTimeout),this.retryTimeout=null},a.prototype.load=function(a,b,c){this.context=a,this.config=b,this.callbacks=c,this.stats={trequest:aK.now(),retry:0},this.retryDelay=b.retryDelay,this.loadInternal()},a.prototype.loadInternal=function(){var a=void 0,b=this.context;a=this.loader=new aL;var c=this.stats;c.tfirst=0,c.loaded=0;var d=this.xhrSetup;try{if(d)try{d(a,b.url)}catch(e){a.open("GET",b.url,!0),d(a,b.url)}a.readyState||a.open("GET",b.url,!0)}catch(f){this.callbacks.onError({code:a.status,text:f.message},b,a);return}b.rangeEnd&&a.setRequestHeader("Range","bytes="+b.rangeStart+"-"+(b.rangeEnd-1)),a.onreadystatechange=this.readystatechange.bind(this),a.onprogress=this.loadprogress.bind(this),a.responseType=b.responseType,this.requestTimeout=window.setTimeout(this.loadtimeout.bind(this),this.config.timeout),a.send()},a.prototype.readystatechange=function(a){var b=a.currentTarget,c=b.readyState,d=this.stats,e=this.context,f=this.config;if(!d.aborted&&c>=2){if(window.clearTimeout(this.requestTimeout),0===d.tfirst&&(d.tfirst=Math.max(aK.now(),d.trequest)),4===c){var g=b.status;if(g>=200&&g<300){d.tload=Math.max(d.tfirst,aK.now());var h=void 0,i=void 0;i="arraybuffer"===e.responseType?(h=b.response).byteLength:(h=b.responseText).length,d.loaded=d.total=i;var k={url:b.responseURL,data:h};this.callbacks.onSuccess(k,d,e,b)}else d.retry>=f.maxRetry||g>=400&&g<499?(j.b.error(g+" while loading "+e.url),this.callbacks.onError({code:g,text:b.statusText},e,b)):(j.b.warn(g+" while loading "+e.url+", retrying in "+this.retryDelay+"..."),this.destroy(),this.retryTimeout=window.setTimeout(this.loadInternal.bind(this),this.retryDelay),this.retryDelay=Math.min(2*this.retryDelay,f.maxRetryDelay),d.retry++)}else this.requestTimeout=window.setTimeout(this.loadtimeout.bind(this),f.timeout)}},a.prototype.loadtimeout=function(){j.b.warn("timeout while loading "+this.context.url),this.callbacks.onTimeout(this.stats,this.context,null)},a.prototype.loadprogress=function(a){var b=a.currentTarget,c=this.stats;c.loaded=a.loaded,a.lengthComputable&&(c.total=a.total);var d=this.callbacks.onProgress;d&&d(c,this.context,null,b)},a}(),aN=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),aO=function(a){function b(c){!function(a,b){if(!(a instanceof b))throw TypeError("Cannot call a class as a function")}(this,b);var d=function(a,b){if(!a)throw ReferenceError("this hasn't been initialised - super() hasn't been called");
1return b&&("object"==typeof b||"function"==typeof b)?b:a}(this,a.call(this,c,i.a.MANIFEST_LOADING,i.a.MANIFEST_PARSED,i.a.AUDIO_TRACK_LOADED,i.a.AUDIO_TRACK_SWITCHED,i.a.LEVEL_LOADED,i.a.ERROR));return d._trackId=-1,d._selectDefaultTrack=!0,d.tracks=[],d.trackIdBlacklist=Object.create(null),d.audioGroupId=null,d}return!function(a,b){if("function"!=typeof b&&null!==b)throw TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}(b,a),b.prototype.onManifestLoading=function(){this.tracks=[],this._trackId=-1,this._selectDefaultTrack=!0},b.prototype.onManifestParsed=function(a){var b=this.tracks=a.audioTracks||[];this.hls.trigger(i.a.AUDIO_TRACKS_UPDATED,{audioTracks:b})},b.prototype.onAudioTrackLoaded=function(a){if(a.id>=this.tracks.length){j.b.warn("Invalid audio track id:",a.id);return}if(j.b.log("audioTrack "+a.id+" loaded"),this.tracks[a.id].details=a.details,a.details.live&&!this.hasInterval()){var b=1e3*a.details.targetduration;this.setInterval(b)}
1!a.details.live&&this.hasInterval()&&this.clearInterval()},b.prototype.onAudioTrackSwitched=function(a){var b=this.tracks[a.id].groupId;b&&this.audioGroupId!==b&&(this.audioGroupId=b)},b.prototype.onLevelLoaded=function(a){var b=this.hls.levels[a.level];if(b.audioGroupIds){var c=b.audioGroupIds[b.urlId];this.audioGroupId!==c&&(this.audioGroupId=c,this._selectInitialAudioTrack())}},b.prototype.onError=function(a){if(a.type===g.b.NETWORK_ERROR)a.fatal&&this.clearInterval(),a.details===g.a.AUDIO_TRACK_LOAD_ERROR&&(j.b.warn("Network failure on audio-track id:",a.context.id),this._handleLoadError())},b.prototype._setAudioTrack=function(a){if(this._trackId===a&&this.tracks[this._trackId].details){j.b.debug("Same id as current audio-track passed, and track details available -> no-op");return}if(a<0||a>=this.tracks.length){j.b.warn("Invalid id passed to audio-track controller");return}var b=this.tracks[a];j.b.log("Now switching to audio-track index "+a),this.clearInterval(),this._trackId=a;var c=b.url,d=b.type,e=b.id;this.hls.trigger(i.a.AUDIO_TRACK_SWITCHING,{id:e,type:d,url:c}),this._loadTrackDetailsIfNeeded(b)},b.prototype.doTick=function(){this._updateTrack(this._trackId)},b.prototype._selectInitialAudioTrack=function(){var a=this,b=this.tracks;if(b.length){var c=this.tracks[this._trackId],d=null;if(c&&(d=c.name),this._selectDefaultTrack){var e=b.filter(function(a){return a.default});e.length?b=e:j.b.warn("No default audio tracks defined")}var f=!1,h=function(){b.forEach(function(b){!f&&(a.audioGroupId&&b.groupId!==a.audioGroupId||d&&d!==b.name||(a._setAudioTrack(b.id),f=!0))})};h(),f||(d=null,h()),f||(j.b.error("No track found for running audio group-ID: "+this.audioGroupId),this.hls.trigger(i.a.ERROR,{type:g.b.MEDIA_ERROR,details:g.a.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))}},b.prototype._needsTrackLoading=function(a){var b=a.details;return!b||!!b.live||void 0},b.prototype._loadTrackDetailsIfNeeded=function(a){if(this._needsTrackLoading(a)){var b=a.url,c=a.id;j.b.log("loading audio-track playlist for id: "+c),this.hls.trigger(i.a.AUDIO_TRACK_LOADING,{url:b,id:c})}},b.prototype._updateTrack=function(a){if(!(a<0)&&!(a>=this.tracks.length)){this.clearInterval(),this._trackId=a,j.b.log("trying to update audio-track "+a);var b=this.tracks[a];this._loadTrackDetailsIfNeeded(b)}},b.prototype._handleLoadError=function(){this.trackIdBlacklist[this._trackId]=!0;var a=this._trackId,b=this.tracks[a],c=b.name,d=b.language,e=b.groupId;j.b.warn("Loading failed on audio track id: "+a+", group-id: "+e+', name/language: "'+c+'" / "'+d+'"');for(var f=a,g=0;g<this.tracks.length;g++)if(!this.trackIdBlacklist[g]&&this.tracks[g].name===c){f=g;break}if(f===a){j.b.warn('No fallback audio-track found for name/language: "'+c+'" / "'+d+'"');return}j.b.log("Attempting audio-track fallback id:",f,"group-id:",this.tracks[f].groupId),this._setAudioTrack(f)},aN(b,[{key:"audioTracks",get:function(){return this.tracks}},{key:"audioTrack",get:function(){return this._trackId},set:function(a){this._setAudioTrack(a),this._selectDefaultTrack=!1}}]),b}(aj),aP=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),aQ=window.performance,aR={STOPPED:"STOPPED",STARTING:"STARTING",IDLE:"IDLE",PAUSED:"PAUSED",KEY_LOADING:"KEY_LOADING",FRAG_LOADING:"FRAG_LOADING",FRAG_LOADING_WAITING_RETRY:"FRAG_LOADING_WAITING_RETRY",WAITING_TRACK:"WAITING_TRACK",PARSING:"PARSING",PARSED:"PARSED",BUFFER_FLUSHING:"BUFFER_FLUSHING",ENDED:"ENDED",ERROR:"ERROR",WAITING_INIT_PTS:"WAITING_INIT_PTS"},aS=function(a){function b(c,d){!function(a,b){if(!(a instanceof b))throw TypeError("Cannot call a class as a function")}(this,b);var e=function(a,b){if(!a)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return b&&("object"==typeof b||"function"==typeof b)?b:a}(this,a.call(this,c,i.a.MEDIA_ATTACHED,i.a.MEDIA_DETACHING,i.a.AUDIO_TRACKS_UPDATED,i.a.AUDIO_TRACK_SWITCHING,i.a.AUDIO_TRACK_LOADED,i.a.KEY_LOADED,i.a.FRAG_LOADED,i.a.FRAG_PARSING_INIT_SEGMENT,i.a.FRAG_PARSING_DATA,i.a.FRAG_PARSED,i.a.ERROR,i.a.BUFFER_RESET,i.a.BUFFER_CREATED,i.a.BUFFER_APPENDED,i.a.BUFFER_FLUSHED,i.a.INIT_PTS_FOUND));return e.fragmentTracker=d,e.config=c.config,e.audioCodecSwap=!1,e._state=aR.STOPPED,e.initPTS=[],e.waitingFragment=null,e.videoTrackCC=null,e}return!function(a,b){if("function"!=typeof b&&null!==b)throw TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}(b,a),b.prototype.onHandlerDestroying=function(){this.stopLoad(),a.prototype.onHandlerDestroying.call(this)},b.prototype.onHandlerDestroyed=function(){this.state=aR.STOPPED,this.fragmentTracker=null,a.prototype.onHandlerDestroyed.call(this)},b.prototype.onInitPtsFound=function(a){var b=a.id,c=a.frag.cc,d=a.initPTS;"main"===b&&(this.initPTS[c]=d,this.videoTrackCC=c,j.b.log("InitPTS for cc: "+c+" found from video track: "+d),this.state===aR.WAITING_INIT_PTS&&this.tick())}
vendor: 13,966 bytes, line 1
1,b.prototype.startLoad=function(a){if(this.tracks){var b=this.lastCurrentTime;this.stopLoad(),this.setInterval(100),this.fragLoadError=0,b>0&& -1===a?(j.b.log("audio:override startPosition with lastCurrentTime @"+b.toFixed(3)),this.state=aR.IDLE):(this.lastCurrentTime=this.startPosition?this.startPosition:a,this.state=aR.STARTING),this.nextLoadPosition=this.startPosition=this.lastCurrentTime,this.tick()}else this.startPosition=a,this.state=aR.STOPPED},b.prototype.stopLoad=function(){var a=this.fragCurrent;a&&(a.loader&&a.loader.abort(),this.fragmentTracker.removeFragment(a),this.fragCurrent=null),this.fragPrevious=null,this.demuxer&&(this.demuxer.destroy(),this.demuxer=null),this.state=aR.STOPPED},b.prototype.doTick=function(){var a=void 0,b=void 0,c=void 0,d=this.hls,e=d.config;switch(this.state){case aR.ERROR:case aR.PAUSED:case aR.BUFFER_FLUSHING:break;case aR.STARTING:this.state=aR.WAITING_TRACK,this.loadedmetadata=!1;break;case aR.IDLE:var f=this.tracks;if(!f|| !this.media&&(this.startFragRequested||!e.startFragPrefetch))break;if(this.loadedmetadata)a=this.media.currentTime;else if(void 0===(a=this.nextLoadPosition))break;var g=this.mediaBuffer?this.mediaBuffer:this.media,k=this.videoBuffer?this.videoBuffer:this.media,l=R.bufferInfo(g,a,e.maxBufferHole),m=R.bufferInfo(k,a,e.maxBufferHole),n=l.len,o=l.end,p=this.fragPrevious,q=Math.min(e.maxBufferLength,e.maxMaxBufferLength),r=Math.max(q,m.len),s=this.audioSwitch,t=this.trackId;if((n<r||s)&&t<f.length){if(void 0===(c=f[t].details)){this.state=aR.WAITING_TRACK;break}if(!s&&!c.live&&p&&p.sn===c.endSN&&!l.nextStart&&(!this.media.seeking||this.media.duration-o<p.duration/2)){this.hls.trigger(i.a.BUFFER_EOS,{type:"audio"}),this.state=aR.ENDED;break}var u,v,w=c.fragments,x=w.length,y=w[0].start,z=w[x-1].start+w[x-1].duration,A=void 0;if(s){if(c.live&&!c.PTSKnown)j.b.log("switching audiotrack, live stream, unknown PTS,load first fragment"),o=0;else if(o=a,c.PTSKnown&&a<y){if(!(l.end>y)&&!l.nextStart)return;j.b.log("alt audio track ahead of main track, seek to start of alt audio track"),this.media.currentTime=y+.05}}if(c.initSegment&&!c.initSegment.data)A=c.initSegment;else if(o<=y){if(A=w[0],null!==this.videoTrackCC&&A.cc!==this.videoTrackCC&&(A=(u=w,v=this.videoTrackCC,Q.search(u,function(a){return a.cc<v?1:a.cc>v?-1:0}))),c.live&&A.loadIdx&&A.loadIdx===this.fragLoadIdx){var B=l.nextStart?l.nextStart:y;j.b.log("no alt audio available @currentTime:"+this.media.currentTime+", seeking @"+(B+.05)),this.media.currentTime=B+.05;return}}else{var C=void 0,D=e.maxFragLookUpTolerance,E=p?w[p.sn-w[0].sn+1]:void 0,F=function(a){var b=Math.min(D,a.duration);return a.start+a.duration-b<=o?1:a.start-b>o&&a.start?-1:0};o<z?(o>z-D&&(D=0),C=E&&!F(E)?E:Q.search(w,F)):C=w[x-1],C&&(A=C,y=C.start,p&&A.level===p.level&&A.sn===p.sn&&(A.sn<c.endSN?(A=w[A.sn+1-c.startSN],j.b.log("SN just loaded, load next one: "+A.sn)):A=null))}A&&(A.encrypted?(j.b.log("Loading key for "+A.sn+" of ["+c.startSN+" ,"+c.endSN+"],track "+t),this.state=aR.KEY_LOADING,d.trigger(i.a.KEY_LOADING,{frag:A})):(j.b.log("Loading "+A.sn+", cc: "+A.cc+" of ["+c.startSN+" ,"+c.endSN+"],track "+t+", currentTime:"+a+",bufferEnd:"+o.toFixed(3)),(s||this.fragmentTracker.getState(A)===O.NOT_LOADED)&&(this.fragCurrent=A,this.startFragRequested=!0,Object(h.a)(A.sn)&&(this.nextLoadPosition=A.start+A.duration),d.trigger(i.a.FRAG_LOADING,{frag:A}),this.state=aR.FRAG_LOADING)))}break;case aR.WAITING_TRACK:(b=this.tracks[this.trackId])&&b.details&&(this.state=aR.IDLE);break;case aR.FRAG_LOADING_WAITING_RETRY:var G=aQ.now(),H=this.retryDate,I=(g=this.media)&&g.seeking;(!H||G>=H||I)&&(j.b.log("audioStreamController: retryDate reached, switch back to IDLE state"),this.state=aR.IDLE);break;case aR.WAITING_INIT_PTS:var J=this.videoTrackCC;if(void 0===this.initPTS[J])break;var K=this.waitingFragment;if(K){var L=K.frag.cc;J!==L?(b=this.tracks[this.trackId]).details&&b.details.live&&(j.b.warn("Waiting fragment CC ("+L+") does not match video track CC ("+J+")"),this.waitingFragment=null,this.state=aR.IDLE):(this.state=aR.FRAG_LOADING,this.onFragLoaded(this.waitingFragment),this.waitingFragment=null)}else this.state=aR.IDLE;case aR.STOPPED:case aR.FRAG_LOADING:case aR.PARSING:case aR.PARSED:case aR.ENDED:}},b.prototype.onMediaAttached=function(a){var b=this.media=this.mediaBuffer=a.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),b.addEventListener("seeking",this.onvseeking),b.addEventListener("ended",this.onvended);var c=this.config;this.tracks&&c.autoStartLoad&&this.startLoad(c.startPosition)},b.prototype.onMediaDetaching=function(){var a=this.media;a&&a.ended&&(j.b.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),a&&(a.removeEventListener("seeking",this.onvseeking),a.removeEventListener("ended",this.onvended),this.onvseeking=this.onvseeked=this.onvended=null),this.media=this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1,this.stopLoad()},b.prototype.onMediaSeeking=function(){this.state===aR.ENDED&&(this.state=aR.IDLE),this.media&&(this.lastCurrentTime=this.media.currentTime),this.tick()},b.prototype.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},b.prototype.onAudioTracksUpdated=function(a){j.b.log("audio tracks updated"),this.tracks=a.audioTracks},b.prototype.onAudioTrackSwitching=function(a){var b=!!a.url;this.trackId=a.id,this.fragCurrent=null,this.state=aR.PAUSED,this.waitingFragment=null,b?this.setInterval(100):this.demuxer&&(this.demuxer.destroy(),this.demuxer=null),b&&(this.audioSwitch=!0,this.state=aR.IDLE),this.tick()},b.prototype.onAudioTrackLoaded=function(a){var b=a.details,c=a.id,d=this.tracks[c],e=b.totalduration,f=0;if(j.b.log("track "+c+" loaded ["+b.startSN+","+b.endSN+"],duration:"+e),b.live){var g=d.details;g&&b.fragments.length>0?(ad(g,b),f=b.fragments[0].start,b.PTSKnown?j.b.log("live audio playlist sliding:"+f.toFixed(3)):j.b.log("live audio playlist - outdated PTS, unknown sliding")):(b.PTSKnown=!1,j.b.log("live audio playlist - first load, unknown sliding"))}else b.PTSKnown=!1;if(d.details=b,!this.startFragRequested){if(-1===this.startPosition){var i=b.startTimeOffset;Object(h.a)(i)?(j.b.log("start time offset found in playlist, adjust startPosition to "+i),this.startPosition=i):this.startPosition=0}this.nextLoadPosition=this.startPosition}this.state===aR.WAITING_TRACK&&(this.state=aR.IDLE),this.tick()},b.prototype.onKeyLoaded=function(){this.state===aR.KEY_LOADING&&(this.state=aR.IDLE,this.tick())},b.prototype.onFragLoaded=function(a){var b=this.fragCurrent,c=a.frag;if(this.state===aR.FRAG_LOADING&&b&&"audio"===c.type&&c.level===b.level&&c.sn===b.sn){var d=this.tracks[this.trackId],e=d.details,f=e.totalduration,g=b.level,h=b.sn,k=b.cc,l=this.config.defaultAudioCodec||d.audioCodec||"mp4a.40.2",m=this.stats=a.stats;if("initSegment"===h)this.state=aR.IDLE,m.tparsed=m.tbuffered=aQ.now(),e.initSegment.data=a.payload,this.hls.trigger(i.a.FRAG_BUFFERED,{stats:m,frag:b,id:"audio"}),this.tick();else{this.state=aR.PARSING,this.appended=!1,this.demuxer||(this.demuxer=new _(this.hls,"audio"));var n=this.initPTS[k],o=e.initSegment?e.initSegment.data:[];if(e.initSegment|| void 0!==n){this.pendingBuffering=!0,j.b.log("Demuxing "+h+" of ["+e.startSN+" ,"+e.endSN+"],track "+g);var p=!1;this.demuxer.push(a.payload,o,l,null,b,f,p,n)}else j.b.log("unknown video PTS for continuity counter "+k+", waiting for video PTS before demuxing audio frag "+h+" of ["+e.startSN+" ,"+e.endSN+"],track "+g),this.waitingFragment=a,this.state=aR.WAITING_INIT_PTS}}this.fragLoadError=0},b.prototype.onFragParsingInitSegment=function(a){var b=this.fragCurrent,c=a.frag;if(b&&"audio"===a.id&&c.sn===b.sn&&c.level===b.level&&this.state===aR.PARSING){var d=a.tracks,e=void 0;if(d.video&&delete d.video,e=d.audio){e.levelCodec=e.codec,e.id=a.id,this.hls.trigger(i.a.BUFFER_CODECS,d),j.b.log("audio track:audio,container:"+e.container+",codecs[level/parsed]=["+e.levelCodec+"/"+e.codec+"]");var f=e.initSegment;if(f){var g={type:"audio",data:f,parent:"audio",content:"initSegment"};this.audioSwitch?this.pendingData=[g]:(this.appended=!0,this.pendingBuffering=!0,this.hls.trigger(i.a.BUFFER_APPENDING,g))}this.tick()}}},b.prototype.onFragParsingData=function(a){var b=this,c=this.fragCurrent,d=a.frag;if(c&&"audio"===a.id&&"audio"===a.type&&d.sn===c.sn&&d.level===c.level&&this.state===aR.PARSING){var e=this.trackId,f=this.tracks[e],k=this.hls;Object(h.a)(a.endPTS)||(a.endPTS=a.startPTS+c.duration,a.endDTS=a.startDTS+c.duration),c.addElementaryStream(r.ElementaryStreamTypes.AUDIO),j.b.log("parsed "+a.type+",PTS:["+a.startPTS.toFixed(3)+","+a.endPTS.toFixed(3)+"],DTS:["+a.startDTS.toFixed(3)+"/"+a.endDTS.toFixed(3)+"],nb:"+a.nb),ac(f.details,c,a.startPTS,a.endPTS);var l=this.audioSwitch,m=this.media,n=!1;if(l&&m){if(m.readyState){var o=m.currentTime;j.b.log("switching audio track : currentTime:"+o),o>=a.startPTS&&(j.b.log("switching audio track : flushing all audio"),this.state=aR.BUFFER_FLUSHING,k.trigger(i.a.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),n=!0,this.audioSwitch=!1,k.trigger(i.a.AUDIO_TRACK_SWITCHED,{id:e}))}else this.audioSwitch=!1,k.trigger(i.a.AUDIO_TRACK_SWITCHED,{id:e})}var p=this.pendingData;if(!p){j.b.warn("Apparently attempt to enqueue media payload without codec initialization data upfront"),k.trigger(i.a.ERROR,{type:g.b.MEDIA_ERROR,details:null,fatal:!0});return}this.audioSwitch||([a.data1,a.data2].forEach(function(b){b&&b.length&&p.push({type:a.type,data:b,parent:"audio",content:"data"})}),n||!p.length||(p.forEach(function(a){b.state===aR.PARSING&&(b.pendingBuffering=!0,b.hls.trigger(i.a.BUFFER_APPENDING,a))}),this.pendingData=[],this.appended=!0)),this.tick()}},b.prototype.onFragParsed=function(a){var b=this.fragCurrent,c=a.frag;b&&"audio"===a.id&&c.sn===b.sn&&c.level===b.level&&this.state===aR.PARSING&&(this.stats.tparsed=aQ.now(),this.state=aR.PARSED,this._checkAppendedParsed())},b.prototype.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},b.prototype.onBufferCreated=function(a){var b=a.tracks.audio;b&&(this.mediaBuffer=b.buffer,this.loadedmetadata=!0),a.tracks.video&&(this.videoBuffer=a.tracks.video.buffer)},b.prototype.onBufferAppended=function(a){if("audio"===a.parent){var b=this.state;(b===aR.PARSING||b===aR.PARSED)&&(this.pendingBuffering=a.pending>0,this._checkAppendedParsed())}},b.prototype._checkAppendedParsed=function(){if(this.state===aR.PARSED&&(!this.appended||!this.pendingBuffering)){var a=this.fragCurrent,b=this.stats,c=this.hls;if(a){this.fragPrevious=a,b.tbuffered=aQ.now(),c.trigger(i.a.FRAG_BUFFERED,{stats:b,frag:a,id:"audio"});var d=this.mediaBuffer?this.mediaBuffer:this.media;j.b.log("audio buffered : "+ae.toString(d.buffered)),this.audioSwitch&&this.appended&&(this.audioSwitch=!1,c.trigger(i.a.AUDIO_TRACK_SWITCHED,{id:this.trackId})),this.state=aR.IDLE}this.tick()}},b.prototype.onError=function(a){var b=a.frag;if(!b||"audio"===b.type)switch(a.details){case g.a.FRAG_LOAD_ERROR:case g.a.FRAG_LOAD_TIMEOUT:var c=a.frag;if(c&&"audio"!==c.type)break;if(!a.fatal){var d=this.fragLoadError;d?d++:d=1;var e=this.config;if(d<=e.fragLoadingMaxRetry){this.fragLoadError=d;var f=Math.min(Math.pow(2,d-1)*e.fragLoadingRetryDelay,e.fragLoadingMaxRetryTimeout);j.b.warn("AudioStreamController: frag loading failed, retry in "+f+" ms"),this.retryDate=aQ.now()+f,this.state=aR.FRAG_LOADING_WAITING_RETRY}else j.b.error("AudioStreamController: "+a.details+" reaches max retry, redispatch as fatal ..."),a.fatal=!0,this.state=aR.ERROR}break;case g.a.AUDIO_TRACK_LOAD_ERROR:case g.a.AUDIO_TRACK_LOAD_TIMEOUT:case g.a.KEY_LOAD_ERROR:case g.a.KEY_LOAD_TIMEOUT:this.state!==aR.ERROR&&(this.state=a.fatal?aR.ERROR:aR.IDLE,j.b.warn("AudioStreamController: "+a.details+" while loading frag, now switching to "+this.state+" state ..."));break;case g.a.BUFFER_FULL_ERROR:if("audio"===a.parent&&(this.state===aR.PARSING||this.state===aR.PARSED)){var h=this.mediaBuffer,k=this.media.currentTime;if(h&&R.isBuffered(h,k)&&R.isBuffered(h,k+.5)){var l=this.config;l.maxMaxBufferLength>=l.maxBufferLength&&(l.maxMaxBufferLength/=2,j.b.warn("AudioStreamController: reduce max buffer length to "+l.maxMaxBufferLength+"s")),this.state=aR.IDLE}else j.b.warn("AudioStreamController: buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,this.state=aR.BUFFER_FLUSHING,this.hls.trigger(i.a.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"})}}},b.prototype.onBufferFlushed=function(){var a=this,b=this.pendingData;b&&b.length?(j.b.log("AudioStreamController: appending pending audio data after buffer flushed"),b.forEach(function(b){a.hls.trigger(i.a.BUFFER_APPENDING,b)}),this.appended=!0,this.pendingData=[],this.state=aR.PARSED):(this.state=aR.IDLE,this.fragPrevious=null,this.tick())},aP(b,[{key:"state",set:function(a){if(this.state!==a){var b=this.state;this._state=a,j.b.log("audio stream:"+b+"->"+a)}},get:function(){return this._state}}]),b}(aj),aT=function(){if("undefined"!=typeof window&&window.VTTCue)return window.VTTCue;var a={"":!0,lr:!0,rl:!0},b={start:!0,middle:!0,end:!0,left:!0,right:!0};function c(a){return"string"==typeof a&& !!b[a.toLowerCase()]&&a.toLowerCase()}function d(a){for(var b=1;b<arguments.length;b++){var c=arguments[b];for(var d in c)a[d]=c[d]}return a}function e(b,e,f){var g=this,h=function(){if("undefined"!=typeof navigator)return/MSIE\s8\.0/.test(navigator.userAgent)}(),i={};h?g=document.createElement("custom"):i.enumerable=!0,g.hasBeenReset=!1;var j="",k=!1,l=b,m=e,n=f,o=null,p="",q=!0,r="auto",s="start",t=50,u="middle",v=50,w="middle";if(Object.defineProperty(g,"id",d({},i,{get:function(){return j},set:function(a){j=""+a}})),Object.defineProperty(g,"pauseOnExit",d({},i,{get:function(){return k},set:function(a){k=!!a}})),Object.defineProperty(g,"startTime",d({},i,{get:function(){return l}
1,set:function(a){if("number"!=typeof a)throw TypeError("Start time must be set to a number.");l=a,this.hasBeenReset=!0}})),Object.defineProperty(g,"endTime",d({},i,{get:function(){return m},set:function(a){if("number"!=typeof a)throw TypeError("End time must be set to a number.");m=a,this.hasBeenReset=!0}})),Object.defineProperty(g,"text",d({},i,{get:function(){return n},set:function(a){n=""+a,this.hasBeenReset=!0}})),Object.defineProperty(g,"region",d({},i,{get:function(){return o},set:function(a){o=a,this.hasBeenReset=!0}})),Object.defineProperty(g,"vertical",d({},i,{get:function(){return p},set:function(b){var c,d=(c=b,"string"==typeof c&& !!a[c.toLowerCase()]&&c.toLowerCase());if(!1===d)throw SyntaxError("An invalid or illegal string was specified.");p=d,this.hasBeenReset=!0}})),Object.defineProperty(g,"snapToLines",d({},i,{get:function(){return q},set:function(a){q=!!a,this.hasBeenReset=!0}})),Object.defineProperty(g,"line",d({},i,{get:function(){return r},set:function(a){if("number"!=typeof a&&"auto"!==a)throw SyntaxError("An invalid number or illegal string was specified.");r=a,this.hasBeenReset=!0}})),Object.defineProperty(g,"lineAlign",d({},i,{get:function(){return s},set:function(a){var b=c(a);if(!b)throw SyntaxError("An invalid or illegal string was specified.");s=b,this.hasBeenReset=!0}})),Object.defineProperty(g,"position",d({},i,{get:function(){return t},set:function(a){if(a<0||a>100)throw Error("Position must be between 0 and 100.");t=a,this.hasBeenReset=!0}})),Object.defineProperty(g,"positionAlign",d({},i,{get:function(){return u},set:function(a){var b=c(a);if(!b)throw SyntaxError("An invalid or illegal string was specified.");u=b,this.hasBeenReset=!0}})),Object.defineProperty(g,"size",d({},i,{get:function(){return v},set:function(a){if(a<0||a>100)throw Error("Size must be between 0 and 100.");v=a,this.hasBeenReset=!0}})),Object.defineProperty(g,"align",d({},i,{get:function(){return w},set:function(a){var b=c(a);if(!b)throw SyntaxError("An invalid or illegal string was specified.");w=b,this.hasBeenReset=!0}})),g.displayState=void 0,h)return g}return e.prototype.getCueAsHTML=function(){return window.WebVTT.convertCueToDOMTree(window,this.text)},e}(),aU=function(){return{decode:function(a){if(!a)return"";if("string"!=typeof a)throw Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(a))}}};function aV(){this.window=window,this.state="INITIAL",this.buffer="",this.decoder=new aU,this.regionList=[]}function aW(){this.values=Object.create(null)}function aX(a,b,c,d){var e=d?a.split(d):[a];for(var f in e){if("string"==typeof e[f]){var g=e[f].split(c);if(2===g.length){var h=g[0],i=g[1];b(h,i)}}}}aW.prototype={set:function(a,b){this.get(a)||""===b||(this.values[a]=b)},get:function(a,b,c){return c?this.has(a)?this.values[a]:b[c]:this.has(a)?this.values[a]:b},has:function(a){return a in this.values},alt:function(a,b,c){for(var d=0;d<c.length;++d)if(b===c[d]){this.set(a,b);break}},integer:function(a,b){/^-?\d+$/.test(b)&&this.set(a,parseInt(b,10))},percent:function(a,b){return!!(b.match(/^([\d]{1,3})(\.[\d]*)?%$/)&&(b=parseFloat(b))>=0&&b<=100)&&(this.set(a,b),!0)}};var aY=new aT(0,0,0),aZ="middle"===aY.align?"middle":"center";function a$(a,b,c){var d,e,f,g,h,i=a;function j(){var b=function(a){function b(a,b,c,d){return(0|a)*3600+(0|b)*60+(0|c)+(0|d)/1e3}var c=a.match(/^(\d+):(\d{2})(:\d{2})?\.(\d{3})/);return c?c[3]?b(c[1],c[2],c[3].replace(":",""),c[4]):c[1]>59?b(c[1],c[2],0,c[4]):b(0,c[1],c[2],c[4]):null}(a);if(null===b)throw Error("Malformed timestamp: "+i);return a=a.replace(/^[^\sa-zA-Z-]+/,""),b}function k(){a=a.replace(/^\s+/,"")}if(k(),b.startTime=j(),k(),"-->"!==a.substr(0,3))throw Error("Malformed time stamp (time stamps must be separated by '-->'): "+i);a=a.substr(3),k(),b.endTime=j(),k(),d=a,e=b,f=new aW,aX(d,function(a,b){switch(a){case"region":for(var d=c.length-1;d>=0;d--)if(c[d].id===b){f.set(a,c[d].region);break}break;case"vertical":f.alt(a,b,["rl","lr"]);break;case"line":var e=b.split(","),g=e[0];f.integer(a,g),f.percent(a,g)&&f.set("snapToLines",!1),f.alt(a,g,["auto"]),2===e.length&&f.alt("lineAlign",e[1],["start",aZ,"end"]);break;case"position":e=b.split(","),f.percent(a,e[0]),2===e.length&&f.alt("positionAlign",e[1],["start",aZ,"end","line-left","line-right","auto"]);break;case"size":f.percent(a,b);break;case"align":f.alt(a,b,["start",aZ,"end","left","right"])}}
1,/:/,/\s/),e.region=f.get("region",null),e.vertical=f.get("vertical",""),"auto"===(g=f.get("line","auto"))&& -1===aY.line&&(g=-1),e.line=g,e.lineAlign=f.get("lineAlign","start"),e.snapToLines=f.get("snapToLines",!0),e.size=f.get("size",100),e.align=f.get("align",aZ),"auto"===(h=f.get("position","auto"))&&50===aY.position&&(h="start"===e.align||"left"===e.align?0:"end"===e.align||"right"===e.align?100:50),e.position=h}function a_(a){return a.replace(/<br(?: \/)?>/gi,"\n")}aV.prototype={parse:function(a){var b=this;function c(){var a=b.buffer,c=0;for(a=a_(a);c<a.length&&"\r"!==a[c]&&"\n"!==a[c];)++c;var d=a.substr(0,c);return"\r"===a[c]&& ++c,"\n"===a[c]&& ++c,b.buffer=a.substr(c),d}function d(a){aX(a,function(a,b){},/:/)}a&&(b.buffer+=b.decoder.decode(a,{stream:!0}));try{var e=void 0;if("INITIAL"===b.state){if(!/\r\n|\n/.test(b.buffer))return this;var f=(e=c()).match(/^()?WEBVTT([ \t].*)?$/);if(!f||!f[0])throw Error("Malformed WebVTT signature.");b.state="HEADER"}for(var g=!1;b.buffer&&/\r\n|\n/.test(b.buffer);)switch(g?g=!1:e=c(),b.state){case"HEADER":/:/.test(e)?d(e):e||(b.state="ID");continue;case"NOTE":e||(b.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(e)){b.state="NOTE";break}if(!e)continue;if(b.cue=new aT(0,0,""),b.state="CUE",-1===e.indexOf("-->")){b.cue.id=e;continue}case"CUE":try{a$(e,b.cue,b.regionList)}catch(h){b.cue=null,b.state="BADCUE";continue}b.state="CUETEXT";continue;case"CUETEXT":var i=-1!==e.indexOf("-->");if(!e||i&&(g=!0)){b.oncue&&b.oncue(b.cue),b.cue=null,b.state="ID";continue}b.cue.text&&(b.cue.text+="\n"),b.cue.text+=e;continue;case"BADCUE":e||(b.state="ID");continue}}catch(j){"CUETEXT"===b.state&&b.cue&&b.oncue&&b.oncue(b.cue),b.cue=null,b.state="INITIAL"===b.state?"BADWEBVTT":"BADCUE"}return this},flush:function(){var a=this;try{if(a.buffer+=a.decoder.decode(),(a.cue||"HEADER"===a.state)&&(a.buffer+="\n\n",a.parse()),"INITIAL"===a.state)throw Error("Malformed WebVTT signature.")}catch(b){throw b}return a.onflush&&a.onflush(),this}};var a0=aV;function a1(a,b,c,d){for(var e=void 0,f=void 0,g=void 0,h=void 0,i=void 0,j=window.VTTCue||window.TextTrackCue,k=0;k<d.rows.length;k++)if(e=d.rows[k],g=!0,h=0,i="",!e.isEmpty()){for(var l=0;l<e.chars.length;l++)e.chars[l].uchar.match(/\s/)&&g?h++:(i+=e.chars[l].uchar,g=!1);e.cueStartTime=b,b===c&&(c+=1e-4),f=new j(b,c,a_(i.trim())),h>=16?h--:h++,navigator.userAgent.match(/Firefox\//)?f.line=k+1:f.line=k>7?k-2:k+1,f.align="left",f.position=Math.max(0,Math.min(100,100*(h/32)+(navigator.userAgent.match(/Firefox\//)?50:0))),a.addCue(f)}}function a2(a,b){if(!(a instanceof b))throw TypeError("Cannot call a class as a function")}var a3={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,128:174,129:176,130:189,131:191,132:8482,133:162,134:163,135:9834,136:224,137:32,138:232,139:226,140:234,141:238,142:244,143:251,144:193,145:201,146:211,147:218,148:220,149:252,150:8216,151:161,152:42,153:8217,154:9473,155:169,156:8480,157:8226,158:8220,159:8221,160:192,161:194,162:199,163:200,164:202,165:203,166:235,167:206,168:207,169:239,170:212,171:217,172:249,173:219,174:171,175:187,176:195,177:227,178:205,179:204,180:236,181:210,182:242,183:213,184:245,185:123,186:125,187:92,188:94,189:95,190:124,191:8764,192:196,193:228,194:214,195:246,196:223,197:165,198:164,199:9475,200:197,201:229,202:216,203:248,204:9487,205:9491,206:9495,207:9499},a4=function(a){var b=a;return a3.hasOwnProperty(a)&&(b=a3[a]),String.fromCharCode(b)},a5={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},a6={17:2,18:4,21:6,22:8,23:10,19:13,20:15},a7={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},a8={25:2,26:4,29:6,30:8,31:10,27:13,28:15},a9=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],ba={verboseFilter:{DATA:3,DEBUG:3,INFO:2,WARNING:2,TEXT:1,ERROR:0},time:null,verboseLevel:0,setTime:function(a){this.time=a},log:function(a,b){this.verboseFilter[a],this.verboseLevel}},bb=function(a){for(var b=[],c=0;c<a.length;c++)b.push(a[c].toString(16));return b},bc=function(){function a(b,c,d,e,f){a2(this,a),this.foreground=b||"white",this.underline=c||!1,this.italics=d||
vendor: 8,181 bytes, line 1
1!1,this.background=e||"black",this.flash=f||!1}return a.prototype.reset=function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},a.prototype.setStyles=function(a){for(var b=["foreground","underline","italics","background","flash"],c=0;c<b.length;c++){var d=b[c];a.hasOwnProperty(d)&&(this[d]=a[d])}},a.prototype.isDefault=function(){return"white"===this.foreground&&!this.underline&&!this.italics&&"black"===this.background&&!this.flash},a.prototype.equals=function(a){return this.foreground===a.foreground&&this.underline===a.underline&&this.italics===a.italics&&this.background===a.background&&this.flash===a.flash},a.prototype.copy=function(a){this.foreground=a.foreground,this.underline=a.underline,this.italics=a.italics,this.background=a.background,this.flash=a.flash},a.prototype.toString=function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash},a}(),bd=function(){function a(b,c,d,e,f,g){a2(this,a),this.uchar=b||" ",this.penState=new bc(c,d,e,f,g)}return a.prototype.reset=function(){this.uchar=" ",this.penState.reset()},a.prototype.setChar=function(a,b){this.uchar=a,this.penState.copy(b)},a.prototype.setPenState=function(a){this.penState.copy(a)},a.prototype.equals=function(a){return this.uchar===a.uchar&&this.penState.equals(a.penState)},a.prototype.copy=function(a){this.uchar=a.uchar,this.penState.copy(a.penState)},a.prototype.isEmpty=function(){return" "===this.uchar&&this.penState.isDefault()},a}(),be=function(){function a(){a2(this,a),this.chars=[];for(var b=0;b<100;b++)this.chars.push(new bd);this.pos=0,this.currPenState=new bc}return a.prototype.equals=function(a){for(var b=!0,c=0;c<100;c++)if(!this.chars[c].equals(a.chars[c])){b=!1;break}return b},a.prototype.copy=function(a){for(var b=0;b<100;b++)this.chars[b].copy(a.chars[b])},a.prototype.isEmpty=function(){for(var a=!0,b=0;b<100;b++)if(!this.chars[b].isEmpty()){a=!1;break}return a},a.prototype.setCursor=function(a){this.pos!==a&&(this.pos=a),this.pos<0?(ba.log("ERROR","Negative cursor position "+this.pos),this.pos=0):this.pos>100&&(ba.log("ERROR","Too large cursor position "+this.pos),this.pos=100)},a.prototype.moveCursor=function(a){var b=this.pos+a;if(a>1)for(var c=this.pos+1;c<b+1;c++)this.chars[c].setPenState(this.currPenState);this.setCursor(b)},a.prototype.backSpace=function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},a.prototype.insertChar=function(a){a>=144&&this.backSpace();var b=a4(a);if(this.pos>=100){ba.log("ERROR","Cannot insert "+a.toString(16)+" ("+b+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(b,this.currPenState),this.moveCursor(1)},a.prototype.clearFromPos=function(a){var b=void 0;for(b=a;b<100;b++)this.chars[b].reset()},a.prototype.clear=function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},a.prototype.clearToEndOfRow=function(){this.clearFromPos(this.pos)},a.prototype.getTextString=function(){for(var a=[],b=!0,c=0;c<100;c++){var d=this.chars[c].uchar;" "!==d&&(b=!1),a.push(d)}return b?"":a.join("")},a.prototype.setPenStyles=function(a){this.currPenState.setStyles(a),this.chars[this.pos].setPenState(this.currPenState)},a}(),bf=function(){function a(){a2(this,a),this.rows=[];for(var b=0;b<15;b++)this.rows.push(new be);this.currRow=14,this.nrRollUpRows=null,this.reset()}return a.prototype.reset=function(){for(var a=0;a<15;a++)this.rows[a].clear();this.currRow=14},a.prototype.equals=function(a){for(var b=!0,c=0;c<15;c++)if(!this.rows[c].equals(a.rows[c])){b=!1;break}return b},a.prototype.copy=function(a){for(var b=0;b<15;b++)this.rows[b].copy(a.rows[b])},a.prototype.isEmpty=function(){for(var a=!0,b=0;b<15;b++)if(!this.rows[b].isEmpty()){a=!1;break}return a},a.prototype.backSpace=function(){this.rows[this.currRow].backSpace()},a.prototype.clearToEndOfRow=function(){this.rows[this.currRow].clearToEndOfRow()},a.prototype.insertChar=function(a){this.rows[this.currRow].insertChar(a)},a.prototype.setPen=function(a){this.rows[this.currRow].setPenStyles(a)},a.prototype.moveCursor=function(a){this.rows[this.currRow].moveCursor(a)},a.prototype.setCursor=function(a){ba.log("INFO","setCursor: "+a),this.rows[this.currRow].setCursor(a)},a.prototype.setPAC=function(a){ba.log("INFO","pacData = "+JSON.stringify(a));var b=a.row-1;if(this.nrRollUpRows&&b<this.nrRollUpRows-1&&(b=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==b){for(var c=0;c<15;c++)this.rows[c].clear();var d=this.currRow+1-this.nrRollUpRows,e=this.lastOutputScreen;if(e){var f=e.rows[d].cueStartTime;if(f&&f<ba.time)for(var g=0;g<this.nrRollUpRows;g++)this.rows[b-this.nrRollUpRows+g+1].copy(e.rows[d+g])}}this.currRow=b;var h=this.rows[this.currRow];if(null!==a.indent){var i=Math.max(a.indent-1,0);h.setCursor(a.indent),a.color=h.chars[i].penState.foreground}var j={foreground:a.color,underline:a.underline,italics:a.italics,background:"black",flash:!1};this.setPen(j)},a.prototype.setBkgData=function(a){ba.log("INFO","bkgData = "+JSON.stringify(a)),this.backSpace(),this.setPen(a),this.insertChar(32)},a.prototype.setRollUpRows=function(a){this.nrRollUpRows=a},a.prototype.rollUp=function(){if(null===this.nrRollUpRows){ba.log("DEBUG","roll_up but nrRollUpRows not set yet");return}ba.log("TEXT",this.getDisplayText());var a=this.currRow+1-this.nrRollUpRows,b=this.rows.splice(a,1)[0];b.clear(),this.rows.splice(this.currRow,0,b),ba.log("INFO","Rolling up")},a.prototype.getDisplayText=function(a){a=a||!1;for(var b=[],c="",d=-1,e=0;e<15;e++){var f=this.rows[e].getTextString();f&&(d=e+1,a?b.push("Row "+d+": '"+f+"'"):b.push(f.trim()))}return b.length>0&&(c=a?"["+b.join(" | ")+"]":b.join("\n")),c},a.prototype.getTextAndFormat=function(){return this.rows},a}(),bg=function(){function a(b,c){a2(this,a),this.chNr=b,this.outputFilter=c,this.mode=null,this.verbose=0,this.displayedMemory=new bf,this.nonDisplayedMemory=new bf,this.lastOutputScreen=new bf,this.currRollUpRow=this.displayedMemory.rows[14],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null}return a.prototype.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.currRollUpRow=this.displayedMemory.rows[14],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.lastCueEndTime=null},a.prototype.getHandler=function(){return this.outputFilter},a.prototype.setHandler=function(a){this.outputFilter=a},a.prototype.setPAC=function(a){this.writeScreen.setPAC(a)},a.prototype.setBkgData=function(a){this.writeScreen.setBkgData(a)},a.prototype.setMode=function(a){a!==this.mode&&(this.mode=a,ba.log("INFO","MODE="+a),"MODE_POP-ON"===this.mode?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset()),"MODE_ROLL-UP"!==this.mode&&(this.displayedMemory.nrRollUpRows=null,this.nonDisplayedMemory.nrRollUpRows=null),this.mode=a)},a.prototype.insertChars=function(a){for(var b=0;b<a.length;b++)this.writeScreen.insertChar(a[b]);var c=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";ba.log("INFO",c+": "+this.writeScreen.getDisplayText(!0)),("MODE_PAINT-ON"===this.mode||"MODE_ROLL-UP"===this.mode)&&(ba.log("TEXT","DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())},a.prototype.ccRCL=function(){ba.log("INFO","RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},a.prototype.ccBS=function(){ba.log("INFO","BS - BackSpace"),"MODE_TEXT"!==this.mode&&(this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate())},a.prototype.ccAOF=function(){},a.prototype.ccAON=function(){},a.prototype.ccDER=function(){ba.log("INFO","DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},a.prototype.ccRU=function(a){ba.log("INFO","RU("+a+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(a)},a.prototype.ccFON=function(){ba.log("INFO","FON - Flash On"),this.writeScreen.setPen({flash:!0})},a.prototype.ccRDC=function(){ba.log("INFO","RDC - Resume Direct 
1Captioning"),this.setMode("MODE_PAINT-ON")},a.prototype.ccTR=function(){ba.log("INFO","TR"),this.setMode("MODE_TEXT")},a.prototype.ccRTD=function(){ba.log("INFO","RTD"),this.setMode("MODE_TEXT")},a.prototype.ccEDM=function(){ba.log("INFO","EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)},a.prototype.ccCR=function(){ba.log("CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)},a.prototype.ccENM=function(){ba.log("INFO","ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},a.prototype.ccEOC=function(){if(ba.log("INFO","EOC - End Of Caption"),"MODE_POP-ON"===this.mode){var a=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=a,this.writeScreen=this.nonDisplayedMemory,ba.log("TEXT","DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)},a.prototype.ccTO=function(a){ba.log("INFO","TO("+a+") - Tab Offset"),this.writeScreen.moveCursor(a)},a.prototype.ccMIDROW=function(a){var b={flash:!1};if(b.underline=a%2==1,b.italics=a>=46,b.italics)b.foreground="white";else{var c=Math.floor(a/2)-16,d=["white","green","blue","cyan","red","yellow","magenta"];b.foreground=d[c]}ba.log("INFO","MIDROW: "+JSON.stringify(b)),this.writeScreen.setPen(b)},a.prototype.outputDataUpdate=function(){var a=arguments.length>0&& void 0!==arguments[0]&&arguments[0],b=ba.time;null!==b&&this.outputFilter&&(null!==this.cueStartTime||this.displayedMemory.isEmpty()?this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue&&(this.outputFilter.newCue(this.cueStartTime,b,this.lastOutputScreen),!0===a&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue()),this.cueStartTime=this.displayedMemory.isEmpty()?null:b):this.cueStartTime=b,this.lastOutputScreen.copy(this.displayedMemory))},a.prototype.cueSplitAtTime=function(a){this.outputFilter&&!this.displayedMemory.isEmpty()&&(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,a,this.displayedMemory),this.cueStartTime=a)},a}(),bh=function(){function a(b,c,d){a2(this,a),this.field=b||1,this.outputs=[c,d],this.channels=[new bg(1,c),new bg(2,d)],this.currChNr=-1,this.lastCmdA=null,this.lastCmdB=null,this.bufferedData=[],this.startTime=null,this.lastTime=null,this.dataCounters={padding:0,char:0,cmd:0,other:0}}return a.prototype.getHandler=function(a){return this.channels[a].getHandler()},a.prototype.setHandler=function(a,b){this.channels[a].setHandler(b)},a.prototype.addData=function(a,b){var c=void 0,d=void 0,e=void 0,f=!1;this.lastTime=a,ba.setTime(a);for(var g=0;g<b.length;g+=2){if(d=127&b[g],e=127&b[g+1],0===d&&0===e){this.dataCounters.padding+=2;continue}ba.log("DATA","["+bb([b[g],b[g+1]])+"] -> ("+bb([d,e])+")"),(c=this.parseCmd(d,e))||(c=this.parseMidrow(d,e)),c||(c=this.parsePAC(d,e)),c||(c=this.parseBackgroundAttributes(d,e)),!c&&(f=this.parseChars(d,e))&&(this.currChNr&&this.currChNr>=0?this.channels[this.currChNr-1].insertChars(f):ba.log("WARNING","No channel found yet. TEXT-MODE?")),c?this.dataCounters.cmd+=2:f?this.dataCounters.char+=2:(this.dataCounters.other+=2,ba.log("WARNING","Couldn't parse cleaned data "+bb([d,e])+" orig: "+bb([b[g],b[g+1]])))}},a.prototype.parseCmd=function(a,b){var c=null;if(!((20===a||28===a)&&b>=32&&b<=47||(23===a||31===a)&&b>=33&&b<=35))return!1;if(a===this.lastCmdA&&b===this.lastCmdB)return this.lastCmdA=null,this.lastCmdB=null,ba.log("DEBUG","Repeated command ("+bb([a,b])+") is dropped"),!0;c=20===a||23===a?1:2;var d=this.channels[c-1];return 20===a||28===a?32===b?d.ccRCL():33===b?d.ccBS():34===b?d.ccAOF():35===b?d.ccAON():36===b?d.ccDER():37===b?d.ccRU(2):38===b?d.ccRU(3):39===b?d.ccRU(4):40===b?d.ccFON():41===b?d.ccRDC():42===b?d.ccTR():43===b?d.ccRTD():44===b?d.ccEDM():45===b?d.ccCR():46===b?d.ccENM():47===b&&d.ccEOC():d.ccTO(b-32),this.lastCmdA=a,this.lastCmdB=b,this.currChNr=c,!0},a.prototype.parseMidrow=function(a,b){var c=null;if((17===a||25===a)&&b>=32&&b<=47)return(c=17===a?1:2)!==this.currChNr?(ba.log("ERROR","Mismatch channel in midrow parsing"),!1):(this.channels[c-1].ccMIDROW(b),ba.log("DEBUG","MIDROW ("+bb([a,b])+")"),!0);return!1},a.prototype.parsePAC=function(a,b){var c=null,d=null;if(!((a>=17&&a<=23||a>=25&&a<=31)&&b>=64&&b<=127||(16===a||24===a)&&b>=64&&b<=95))return!1;if(a===this.lastCmdA&&b===this.lastCmdB)return this.lastCmdA=null,this.lastCmdB=null,!0;c=a<=23?1:2,d=b>=64&&b<=95?1===c?a5[a]:a7[a]:1===c?a6[a]:a8[a];var e=this.interpretPAC(d,b);return this.channels[c-1].setPAC(e),this.lastCmdA=a,this.lastCmdB=b,this.currChNr=c,!0},a.prototype.interpretPAC=function(a,b){var c=b,d={color:null,italics:!1,indent:null,underline:!1,row:a};return c=b>95?b-96:b-64,d.underline=(1&c)==1,c<=13?d.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(c/2)]:c<=15?(d.italics=!0,d.color="white"):d.indent=4*Math.floor((c-16)/2),d},a.prototype.parseChars=function(a,b){var c=null,d=null,e=null;if(a>=25?(c=2,e=a-8):(c=1,e=a),e>=17&&e<=19){var f=b;f=17===e?b+80:18===e?b+112:b+144,ba.log("INFO","Special char '"+a4(f)+"' in channel "+c),d=[f]}else a>=32&&a<=127&&(d=0===b?[a]:[a,b]);if(d){var g=bb(d);ba.log("DEBUG","Char codes =  "+g.join(",")),this.lastCmdA=null,this.lastCmdB=null}return d}
1,a.prototype.parseBackgroundAttributes=function(a,b){var c=void 0,d=void 0,e=void 0,f=void 0;return((16===a||24===a)&&b>=32&&b<=47||(23===a||31===a)&&b>=45&&b<=47)&&(c={},16===a||24===a?(d=Math.floor((b-32)/2),c.background=a9[d],b%2==1&&(c.background=c.background+"_semi")):45===b?c.background="transparent":(c.foreground="black",47===b&&(c.underline=!0)),e=a<24?1:2,(0,this.channels[e-1]).setBkgData(c),this.lastCmdA=null,this.lastCmdB=null,!0)},a.prototype.reset=function(){for(var a=0;a<this.channels.length;a++)this.channels[a]&&this.channels[a].reset();this.lastCmdA=null,this.lastCmdB=null},a.prototype.cueSplitAtTime=function(a){for(var b=0;b<this.channels.length;b++)this.channels[b]&&this.channels[b].cueSplitAtTime(a)},a}(),bi=function(){function a(b,c){!function(a,b){if(!(a instanceof b))throw TypeError("Cannot call a class as a function")}(this,a),this.timelineController=b,this.trackName=c,this.startTime=null,this.endTime=null,this.screen=null}return a.prototype.dispatchCue=function(){null!==this.startTime&&(this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen),this.startTime=null)},a.prototype.newCue=function(a,b,c){(null===this.startTime||this.startTime>a)&&(this.startTime=a),this.endTime=b,this.screen=c,this.timelineController.createCaptionsTrack(this.trackName)},a}(),bj=function(a,b,c){return a.substr(c||0,b.length)===b},bk=function(a){var b=parseInt(a.substr(-3)),c=parseInt(a.substr(-6,2)),d=parseInt(a.substr(-9,2)),e=a.length>9?parseInt(a.substr(0,a.indexOf(":"))):0;return Object(h.a)(b)&&Object(h.a)(c)&&Object(h.a)(d)&&Object(h.a)(e)?(b+=1e3*c,b+=6e4*d,b+=36e5*e):-1},bl=function(a){for(var b=5381,c=a.length;c;)b=33*b^a.charCodeAt(--c);return(b>>>0).toString()},bm=function(a,b,c){var d=a[b],e=a[d.prevCC];if(!e|| !e.new&&d.new){a.ccOffset=a.presentationOffset=d.start,d.new=!1;return}for(;e&&e.new;)a.ccOffset+=d.start-e.start,d.new=!1,e=a[(d=e).prevCC];a.presentationOffset=c},bn={parse:function(a,b,c,d,e,f){var g=Object(au.b)(new Uint8Array(a)).trim().replace(/\r\n|\n\r|\n|\r/g,"\n").split("\n"),h="00:00.000",i=0,j=0,k=0,l=[],m=void 0,n=!0,o=new a0;o.oncue=function(a){var b=c[d],e=c.ccOffset;b&&b.new&&(void 0!==j?e=c.ccOffset=b.start:bm(c,d,k)),k&&(e=k+c.ccOffset-c.presentationOffset),a.startTime+=e-j,a.endTime+=e-j,a.id=bl(a.startTime.toString())+bl(a.endTime.toString())+bl(a.text),a.text=decodeURIComponent(encodeURIComponent(a.text)),a.endTime>0&&l.push(a)},o.onparsingerror=function(a){m=a},o.onflush=function(){if(m&&f){f(m);return}e(l)},g.forEach(function(a){if(n){if(bj(a,"X-TIMESTAMP-MAP=")){n=!1,a.substr(16).split(",").forEach(function(a){bj(a,"LOCAL:")?h=a.substr(6):bj(a,"MPEGTS:")&&(i=parseInt(a.substr(7)))});try{b=b<0?b+8589934592:b,i-=b,j=bk(h)/1e3,k=i/9e4,-1===j&&(m=Error("Malformed X-TIMESTAMP-MAP: "+a))}catch(c){m=Error("Malformed X-TIMESTAMP-MAP: "+a)}return}""===a&&(n=!1)}o.parse(a+"\n")}),o.flush()}};function bo(a,b,c,d){return Math.min(b,d)-Math.max(a,c)}var bp=function(a){function b(c){!function(a,b){if(!(a instanceof b))throw TypeError("Cannot call a class as a function")}(this,b);var d=function(a,b){if(!a)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return b&&("object"==typeof b||"function"==typeof b)?b:a}(this,a.call(this,c,i.a.MEDIA_ATTACHING,i.a.MEDIA_DETACHING,i.a.FRAG_PARSING_USERDATA,i.a.FRAG_DECRYPTED,i.a.MANIFEST_LOADING,i.a.MANIFEST_LOADED,i.a.FRAG_LOADED,i.a.LEVEL_SWITCHING,i.a.INIT_PTS_FOUND));if(d.hls=c,d.config=c.config,d.enabled=!0,d.Cues=c.config.cueHandler,d.textTracks=[],d.tracks=[],d.unparsedVttFrags=[],d.initPTS=void 0,d.cueRanges=[],d.captionsTracks={},d.captionsProperties={textTrack1:{label:d.config.captionsTextTrack1Label,languageCode:d.config.captionsTextTrack1LanguageCode},textTrack2:{label:d.config.captionsTextTrack2Label,languageCode:d.config.captionsTextTrack2LanguageCode}},d.config.enableCEA708Captions){var e=new bi(d,"textTrack1"),f=new bi(d,"textTrack2");d.cea608Parser=new bh(0,e,f)}return d}return!function(a,b){if("function"!=typeof b&&null!==b)throw TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}(b,a),b.prototype.addCues=function(a,b,c,d){for(var e=this.cueRanges,f=!1,g=e.length;g--;){var h=e[g],i=bo(h[0],h[1],b,c);if(i>=0&&(h[0]=Math.min(h[0],b),h[1]=Math.max(h[1],c),f=!0,i/(c-b)>.5))return}f||e.push([b,c]),this.Cues.newCue(this.captionsTracks[a],b,c,d)},b.prototype.onInitPtsFound=function(a){var b=this;void 0===this.initPTS&&(this.initPTS=a.initPTS),this.unparsedVttFrags.length&&(this.unparsedVttFrags.forEac
1h(function(a){b.onFragLoaded(a)}),this.unparsedVttFrags=[])},b.prototype.getExistingTrack=function(a){var b=this.media;if(b)for(var c=0;c<b.textTracks.length;c++){var d=b.textTracks[c];if(d[a])return d}return null},b.prototype.createCaptionsTrack=function(a){var b=this.captionsProperties[a],c=b.label,d=b.languageCode,e=this.captionsTracks;if(!e[a]){var f=this.getExistingTrack(a);if(f)e[a]=f,aw(e[a]),av(e[a],this.media);else{var g=this.createTextTrack("captions",c,d);g&&(g[a]=!0,e[a]=g)}}},b.prototype.createTextTrack=function(a,b,c){var d=this.media;if(d)return d.addTextTrack(a,b,c)},b.prototype.destroy=function(){m.prototype.destroy.call(this)},b.prototype.onMediaAttaching=function(a){this.media=a.media,this._cleanTracks()},b.prototype.onMediaDetaching=function(){var a=this.captionsTracks;Object.keys(a).forEach(function(b){aw(a[b]),delete a[b]})},b.prototype.onManifestLoading=function(){this.lastSn=-1,this.prevCC=-1,this.vttCCs={ccOffset:0,presentationOffset:0},this._cleanTracks()},b.prototype._cleanTracks=function(){var a=this.media;if(a){var b=a.textTracks;if(b)for(var c=0;c<b.length;c++)aw(b[c])}},b.prototype.onManifestLoaded=function(a){var b=this;if(this.textTracks=[],this.unparsedVttFrags=this.unparsedVttFrags||[],this.initPTS=void 0,this.cueRanges=[],this.config.enableWebVTT){this.tracks=a.subtitles||[];var c=this.media?this.media.textTracks:[];this.tracks.forEach(function(a,d){var e=void 0;if(d<c.length){var f,g,h=c[d];f=h,g=a,f&&f.label===g.name&&!(f.textTrack1||f.textTrack2)&&(e=h)}e||(e=b.createTextTrack("subtitles",a.name,a.lang)),a.default?e.mode=b.hls.subtitleDisplay?"showing":"hidden":e.mode="disabled",b.textTracks.push(e)})}},b.prototype.onLevelSwitching=function(){this.enabled="NONE"!==this.hls.currentLevel.closedCaptions},b.prototype.onFragLoaded=function(a){var b=a.frag,c=a.payload;if("main"===b.type){var d=b.sn;if(d!==this.lastSn+1){var e=this.cea608Parser;e&&e.reset()}this.lastSn=d}else if("subtitle"===b.type){if(c.byteLength){if(void 0===this.initPTS){this.unparsedVttFrags.push(a);return}var f=b.decryptdata;(null==f||null==f.key||"AES-128"!==f.method)&&this._parseVTTs(b,c)}else this.hls.trigger(i.a.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:b})}},b.prototype._parseVTTs=function(a,b){var c=this.vttCCs;c[a.cc]||(c[a.cc]={start:a.start,prevCC:this.prevCC,new:!0},this.prevCC=a.cc);var d=this.textTracks,e=this.hls;bn.parse(b,this.initPTS,c,a.cc,function(b){var c=d[a.trackId];if("disabled"===c.mode){e.trigger(i.a.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:a});return}b.forEach(function(a){if(!c.cues.getCueById(a.id))try{c.addCue(a)}catch(b){var d=new window.TextTrackCue(a.startTime,a.endTime,a.text);d.id=a.id,c.addCue(d)}}),e.trigger(i.a.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:a})},function(b){j.b.log("Failed to parse VTT cue: "+b),e.trigger(i.a.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:a})})},b.prototype.onFragDecrypted=function(a){var b=a.payload,c=a.frag;if("subtitle"===c.type){if(void 0===this.initPTS){this.unparsedVttFrags.push(a);return}this._parseVTTs(c,b)}},b.prototype.onFragParsingUserdata=function(a){if(this.enabled&&this.config.enableCEA708Captions)for(var b=0;b<a.samples.length;b++){var c=this.extractCea608Data(a.samples[b].bytes);this.cea608Parser.addData(a.samples[b].pts,c)}},b.prototype.extractCea608Data=function(a){for(var b=31&a[0],c=2,d=void 0,e=void 0,f=void 0,g=void 0,h=void 0,i=[],j=0;j<b;j++)d=a[c++],e=127&a[c++],f=127&a[c++],g=(4&d)!=0,h=3&d,(0!==e||0!==f)&&g&&0===h&&(i.push(e),i.push(f));return i},b}(m),bq=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}();function br(a){for(var b=[],c=0;c<a.length;c++)"subtitles"===a[c].kind&&b.push(a[c]);return b}var bs=function(a){function b(c){!function(a,b){if(!(a instanceof b))throw TypeError("Cannot call a class as a function")}(this,b);var d=function(a,b){if(!a)throw ReferenceError("this hasn't been initialised - super() hasn't been called");
1return b&&("object"==typeof b||"function"==typeof b)?b:a}(this,a.call(this,c,i.a.MEDIA_ATTACHED,i.a.MEDIA_DETACHING,i.a.MANIFEST_LOADING,i.a.MANIFEST_LOADED,i.a.SUBTITLE_TRACK_LOADED));return d.tracks=[],d.trackId=-1,d.media=null,d.subtitleDisplay=!0,d}return!function(a,b){if("function"!=typeof b&&null!==b)throw TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}(b,a),b.prototype._onTextTracksChanged=function(){if(this.media){for(var a=-1,b=br(this.media.textTracks),c=0;c<b.length;c++)if("hidden"===b[c].mode)a=c;else if("showing"===b[c].mode){a=c;break}this.subtitleTrack=a}},b.prototype.destroy=function(){m.prototype.destroy.call(this)},b.prototype.onMediaAttached=function(a){var b=this;this.media=a.media,this.media&&(this.queuedDefaultTrack&&(this.subtitleTrack=this.queuedDefaultTrack,delete this.queuedDefaultTrack),this.trackChangeListener=this._onTextTracksChanged.bind(this),this.useTextTrackPolling=!(this.media.textTracks&&"onchange"in this.media.textTracks),this.useTextTrackPolling?this.subtitlePollingInterval=setInterval(function(){b.trackChangeListener()},500):this.media.textTracks.addEventListener("change",this.trackChangeListener))},b.prototype.onMediaDetaching=function(){this.media&&(this.useTextTrackPolling?clearInterval(this.subtitlePollingInterval):this.media.textTracks.removeEventListener("change",this.trackChangeListener),this.media=null)},b.prototype.onManifestLoading=function(){this.tracks=[],this.trackId=-1},b.prototype.onManifestLoaded=function(a){var b=this,c=a.subtitles||[];this.tracks=c,this.trackId=-1,this.hls.trigger(i.a.SUBTITLE_TRACKS_UPDATED,{subtitleTracks:c}),c.forEach(function(a){a.default&&(b.media?b.subtitleTrack=a.id:b.queuedDefaultTrack=a.id)})},b.prototype.onTick=function(){var a=this.trackId,b=this.tracks[a];if(b){var c=b.details;(!c||c.live)&&(j.b.log("(re)loading playlist for subtitle track "+a),this.hls.trigger(i.a.SUBTITLE_TRACK_LOADING,{url:b.url,id:a}))}},b.prototype.onSubtitleTrackLoaded=function(a){var b=this;a.id<this.tracks.length&&(j.b.log("subtitle track "+a.id+" loaded"),this.tracks[a.id].details=a.details,a.details.live&&!this.timer&&(this.timer=setInterval(function(){b.onTick()},1e3*a.details.targetduration,this)),!a.details.live&&this.timer&&this._stopTimer())},b.prototype.setSubtitleTrackInternal=function(a){var b=this.hls,c=this.tracks;if("number"==typeof a&&!(a< -1)&&!(a>=c.length)){if(this._stopTimer(),this.trackId=a,j.b.log("switching to subtitle track "+a),b.trigger(i.a.SUBTITLE_TRACK_SWITCH,{id:a}),-1!==a){var d=c[a],e=d.details;(!e||e.live)&&(j.b.log("(re)loading playlist for subtitle track "+a),b.trigger(i.a.SUBTITLE_TRACK_LOADING,{url:d.url,id:a}))}}},b.prototype._stopTimer=function(){this.timer&&(clearInterval(this.timer),this.timer=null)},b.prototype._toggleTrackModes=function(a){var b=this.media,c=this.subtitleDisplay,d=this.trackId;if(b){var e=br(b.textTracks);if(-1===a)[].slice.call(e).forEach(function(a){a.mode="disabled"});else{var f=e[d];f&&(f.mode="disabled")}var g=e[a];g&&(g.mode=c?"showing":"hidden")}},bq(b,[{key:"subtitleTracks",get:function(){return this.tracks}},{key:"subtitleTrack",get:function(){return this.trackId},set:function(a){this.trackId!==a&&(this._toggleTrackModes(a),this.setSubtitleTrackInternal(a))}}]),b}(m),bt=c(8),bu=window.performance,bv={STOPPED:"STOPPED",IDLE:"IDLE",KEY_LOADING:"KEY_LOADING",FRAG_LOADING:"FRAG_LOADING"},bw=function(a){function b(c){!function(a,b){if(!(a instanceof b))throw TypeError("Cannot call a class as a function")}(this,b);var d=function(a,b){if(!a)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return b&&("object"==typeof b||"function"==typeof b)?b:a}(this,a.call(this,c,i.a.MEDIA_ATTACHED,i.a.ERROR,i.a.KEY_LOADED,i.a.FRAG_LOADED,i.a.SUBTITLE_TRACKS_UPDATED,i.a.SUBTITLE_TRACK_SWITCH,i.a.SUBTITLE_TRACK_LOADED,i.a.SUBTITLE_FRAG_PROCESSED));return d.config=c.config,d.vttFragSNsProcessed={},d.vttFragQueues=void 0,d.currentlyProcessing=null,d.state=bv.STOPPED,d.currentTrackId=-1,d.decrypter=new bt.a(c.observer,c.config),d}return!function(a,b){if("function"!=typeof b&&null!==b)throw TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}(b,a),b.prototype.onHandlerDestroyed=function(){this.state=bv.STOPPED},b.prototype.clearVttFragQueues=function(){var a=this;this.vttFragQueues={},this.tracks.forEach(function(b){a.vttFragQueues[b.id]=[]})},b.prototype.nextFrag=function(){if(null===this.currentlyProcessing&&this.currentTrackId> -1&&this.vttFragQueues[this.currentTrackId].length){var a=this.currentlyProcessing=this.vttFragQueues[this.currentTrackId].shift();this.fragCurrent=a,this.hls.trigger(i.a.FRAG_LOADING,{frag:a}),this.state=bv.FRAG_LOADING}},b.prototype.onSubtitleFragProcessed=function(a){a.success&&this.vttFragSNsProcessed[a.frag.trackId].push(a.frag.sn),this.currentlyProcessing=null,this.state=bv.IDLE,this.nextFrag()},b.prototype.onMediaAttached=function(){this.state=bv.IDLE},b.prototype.onError=function(a){var b=a.frag;
1(!b||"subtitle"===b.type)&&this.currentlyProcessing&&(this.currentlyProcessing=null,this.nextFrag())},b.prototype.doTick=function(){var a=this;switch(this.state){case bv.IDLE:var b,c=this.tracks,d=this.currentTrackId,e=this.vttFragSNsProcessed[d],f=this.vttFragQueues[d],g=this.currentlyProcessing?this.currentlyProcessing.sn:-1,h=function(a){return e.indexOf(a.sn)> -1},k=function(a){return f.some(function(b){return b.sn===a.sn})};if(!c||(d<c.length&&(b=c[d].details),void 0===b))break;b.fragments.forEach(function(b){h(b)||b.sn===g||k(b)||(b.encrypted?(j.b.log("Loading key for "+b.sn),a.state=bv.KEY_LOADING,a.hls.trigger(i.a.KEY_LOADING,{frag:b})):(b.trackId=d,f.push(b),a.nextFrag()))})}},b.prototype.onSubtitleTracksUpdated=function(a){var b=this;j.b.log("subtitle tracks updated"),this.tracks=a.subtitleTracks,this.clearVttFragQueues(),this.vttFragSNsProcessed={},this.tracks.forEach(function(a){b.vttFragSNsProcessed[a.id]=[]})},b.prototype.onSubtitleTrackSwitch=function(a){if(this.currentTrackId=a.id,this.tracks&& -1!==this.currentTrackId){var b=this.tracks[this.currentTrackId];b&&b.details&&this.tick()}},b.prototype.onSubtitleTrackLoaded=function(){this.tick()},b.prototype.onKeyLoaded=function(){this.state===bv.KEY_LOADING&&(this.state=bv.IDLE,this.tick())},b.prototype.onFragLoaded=function(a){var b=this.fragCurrent,c=a.frag.decryptdata,d=a.frag,e=this.hls;if(this.state===bv.FRAG_LOADING&&b&&"subtitle"===a.frag.type&&b.sn===a.frag.sn&&a.payload.byteLength>0&&null!=c&&null!=c.key&&"AES-128"===c.method){var f=void 0;try{f=bu.now()}catch(g){f=Date.now()}this.decrypter.decrypt(a.payload,c.key.buffer,c.iv.buffer,function(a){var b=void 0;try{b=bu.now()}catch(c){b=Date.now()}e.trigger(i.a.FRAG_DECRYPTED,{frag:d,payload:a,stats:{tstart:f,tdecrypt:b}})})}},b}(aj),bx=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),by=window.XMLHttpRequest,bz={WIDEVINE:"com.widevine.alpha",PLAYREADY:"com.microsoft.playready"},bA=function(a,b,c){var d={videoCapabilities:[]};return b.forEach(function(a){d.videoCapabilities.push({contentType:'video/mp4; codecs="'+a+'"'})}),[d]},bB=function(a,b,c){if(a===bz.WIDEVINE)return bA(b,c);throw Error("Unknown key-system: "+a)},bC=function(a){function b(c){!function(a,b){if(!(a instanceof b))throw TypeError("Cannot call a class as a function")}(this,b);var d=function(a,b){if(!a)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return b&&("object"==typeof b||"function"==typeof b)?b:a}(this,a.call(this,c,i.a.MEDIA_ATTACHED,i.a.MANIFEST_PARSED));return d._widevineLicenseUrl=c.config.widevineLicenseUrl,d._licenseXhrSetup=c.config.licenseXhrSetup,d._emeEnabled=c.config.emeEnabled,d._requestMediaKeySystemAccess=c.config.requestMediaKeySystemAccessFunc,d._mediaKeysList=[],d._media=null,d._hasSetMediaKeys=!1,d._isMediaEncrypted=!1,d._requestLicenseFailureCount=0,d}return!function(a,b){if("function"!=typeof b&&null!==b)throw TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}(b,a),b.prototype.getLicenseServerUrl=function(a){var b=void 0;return(b=a===bz.WIDEVINE?this._widevineLicenseUrl:null)||(j.b.error('No license server URL configured for key-system "'+a+'"'),this.hls.trigger(i.a.ERROR,{type:g.b.KEY_SYSTEM_ERROR,details:g.a.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})),b},b.prototype._attemptKeySystemAccess=function(a,b,c){var d=this,e=bB(a,b,c);if(!e){j.b.warn("Can not create config for key-system (maybe because platform is not supported):",a);return}j.b.log("Requesting encrypted media key-system access"),this.requestMediaKeySystemAccess(a,e).then(function(b){d._onMediaKeySystemAccessObtained(a,b)}).catch(function(b){j.b.error('Failed to obtain key-system "'+a+'" access:',b)})},b.prototype._onMediaKeySystemAccessObtained=function(a,b){var c=this;
1j.b.log('Access for key-system "'+a+'" obtained');var d={mediaKeys:null,mediaKeysSession:null,mediaKeysSessionInitialized:!1,mediaKeySystemAccess:b,mediaKeySystemDomain:a};this._mediaKeysList.push(d),b.createMediaKeys().then(function(b){d.mediaKeys=b,j.b.log('Media-keys created for key-system "'+a+'"'),c._onMediaKeysCreated()}).catch(function(a){j.b.error("Failed to create media-keys:",a)})},b.prototype._onMediaKeysCreated=function(){var a=this;this._mediaKeysList.forEach(function(b){b.mediaKeysSession||(b.mediaKeysSession=b.mediaKeys.createSession(),a._onNewMediaKeySession(b.mediaKeysSession))})},b.prototype._onNewMediaKeySession=function(a){var b=this;j.b.log("New key-system session "+a.sessionId),a.addEventListener("message",function(c){b._onKeySessionMessage(a,c.message)},!1)},b.prototype._onKeySessionMessage=function(a,b){j.b.log("Got EME message event, creating license request"),this._requestLicense(b,function(b){j.b.log("Received license data, updating key-session"),a.update(b)})},b.prototype._onMediaEncrypted=function(a,b){j.b.log('Media is encrypted using "'+a+'" init data type'),this._isMediaEncrypted=!0,this._mediaEncryptionInitDataType=a,this._mediaEncryptionInitData=b,this._attemptSetMediaKeys(),this._generateRequestWithPreferredKeySession()},b.prototype._attemptSetMediaKeys=function(){if(!this._hasSetMediaKeys){var a=this._mediaKeysList[0];if(!a||!a.mediaKeys){j.b.error("Fatal: Media is encrypted but no CDM access or no keys have been obtained yet"),this.hls.trigger(i.a.ERROR,{type:g.b.KEY_SYSTEM_ERROR,details:g.a.KEY_SYSTEM_NO_KEYS,fatal:!0});return}j.b.log("Setting keys for encrypted media"),this._media.setMediaKeys(a.mediaKeys),this._hasSetMediaKeys=!0}},b.prototype._generateRequestWithPreferredKeySession=function(){var a=this,b=this._mediaKeysList[0];if(!b){j.b.error("Fatal: Media is encrypted but not any key-system access has been obtained yet"),this.hls.trigger(i.a.ERROR,{type:g.b.KEY_SYSTEM_ERROR,details:g.a.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}if(b.mediaKeysSessionInitialized){j.b.warn("Key-Session already initialized but requested again");return}var c=b.mediaKeysSession;c||(j.b.error("Fatal: Media is encrypted but no key-session existing"),this.hls.trigger(i.a.ERROR,{type:g.b.KEY_SYSTEM_ERROR,details:g.a.KEY_SYSTEM_NO_SESSION,fatal:!0}));var d=this._mediaEncryptionInitDataType,e=this._mediaEncryptionInitData;j.b.log('Generating key-session request for "'+d+'" init data type'),b.mediaKeysSessionInitialized=!0,c.generateRequest(d,e).then(function(){j.b.debug("Key-session generation succeeded")}).catch(function(b){j.b.error("Error generating key-session request:",b),a.hls.trigger(i.a.ERROR,{type:g.b.KEY_SYSTEM_ERROR,details:g.a.KEY_SYSTEM_NO_SESSION,fatal:!1})})},b.prototype._createLicenseXhr=function(a,b,c){var d=new by,e=this._licenseXhrSetup;try{if(e)try{e(d,a)}catch(f){d.open("POST",a,!0),e(d,a)}d.readyState||d.open("POST",a,!0)}catch(h){j.b.error("Error setting up key-system license XHR",h),this.hls.trigger(i.a.ERROR,{type:g.b.KEY_SYSTEM_ERROR,details:g.a.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}return d.responseType="arraybuffer",d.onreadystatechange=this._onLicenseRequestReadyStageChange.bind(this,d,a,b,c),d},b.prototype._onLicenseRequestReadyStageChange=function(a,b,c,d){if(4===a.readyState){if(200===a.status)this._requestLicenseFailureCount=0,j.b.log("License request succeeded"),d(a.response);else{if(j.b.error("License Request XHR failed ("+b+"). Status: "+a.status+" ("+a.statusText+")"),this._requestLicenseFailureCount++,this._requestLicenseFailureCount<=3){var e=3-this._requestLicenseFailureCount+1;j.b.warn("Retrying license request, "+e+" attempts left"),this._requestLicense(c,d);return}this.hls.trigger(i.a.ERROR,{type:g.b.KEY_SYSTEM_ERROR,details:g.a.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}}},b.prototype._generateLicenseRequestChallenge=function(a,b){var c=void 0;return a.mediaKeySystemDomain===bz.PLAYREADY?j.b.error("PlayReady is not supported (yet)"):a.mediaKeySystemDomain===bz.WIDEVINE?c=b:j.b.error("Unsupported key-system:",a.mediaKeySystemDomain),c},b.prototype._requestLicense=function(a,b){j.b.log("Requesting content license for key-system");var c=this._mediaKeysList[0];if(!c){j.b.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(i.a.ERROR,{type:g.b.KEY_SYSTEM_ERROR,details:g.a.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}var d=this.getLicenseServerUrl(c.mediaKeySystemDomain),e=this._createLicenseXhr(d,a,b);j.b.log("Sending license request to URL: "+d),e.send(this._generateLicenseRequestChallenge(c,a))},b.prototype.onMediaAttached=function(a){var b=this;if(this._emeEnabled){var c=a.media;this._media=c,c.addEventListener("encrypted",function(a){b._onMediaEncrypted(a.initDataType,a.initData)})}}
1,b.prototype.onManifestParsed=function(a){if(this._emeEnabled){var b=a.levels.map(function(a){return a.audioCodec}),c=a.levels.map(function(a){return a.videoCodec});this._attemptKeySystemAccess(bz.WIDEVINE,b,c)}},bx(b,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),b}(m),bD={autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,initialLiveManifestSize:1,maxBufferLength:30,maxBufferSize:6e7,maxBufferHole:.5,lowBufferWatchdogPeriod:.5,highBufferWatchdogPeriod:3,nudgeOffset:.1,nudgeMaxRetry:3,maxFragLookUpTolerance:.25,liveSyncDurationCount:3,liveMaxLatencyDurationCount:1/0,liveSyncDuration:void 0,liveMaxLatencyDuration:void 0,liveDurationInfinity:!1,maxMaxBufferLength:600,enableWorker:!0,enableSoftwareAES:!0,manifestLoadingTimeOut:1e4,manifestLoadingMaxRetry:1,manifestLoadingRetryDelay:1e3,manifestLoadingMaxRetryTimeout:64e3,startLevel:void 0,levelLoadingTimeOut:1e4,levelLoadingMaxRetry:4,levelLoadingRetryDelay:1e3,levelLoadingMaxRetryTimeout:64e3,fragLoadingTimeOut:2e4,fragLoadingMaxRetry:6,fragLoadingRetryDelay:1e3,fragLoadingMaxRetryTimeout:64e3,startFragPrefetch:!1,fpsDroppedMonitoringPeriod:5e3,fpsDroppedMonitoringThreshold:.2,appendErrorMaxRetry:3,loader:aM,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,abrController:aC,bufferController:aE,capLevelController:aG,fpsController:aI,stretchShortVideoTrack:!1,maxAudioFramesDrift:1,forceKeyFrameOnDiscontinuity:!0,abrEwmaFastLive:3,abrEwmaSlowLive:9,abrEwmaFastVoD:3,abrEwmaSlowVoD:9,abrEwmaDefaultEstimate:5e5,abrBandWidthFactor:.95,abrBandWidthUpFactor:.7,abrMaxWithRealBitrate:!1,maxStarvationDelay:4,maxLoadingDelay:4,minAutoBitrate:0,emeEnabled:!1,widevineLicenseUrl:void 0,requestMediaKeySystemAccessFunc:"undefined"!=typeof window&&window.navigator&&window.navigator.requestMediaKeySystemAccess?window.navigator.requestMediaKeySystemAccess.bind(window.navigator):null};bD.subtitleStreamController=bw,bD.subtitleTrackController=bs,bD.timelineController=bp,bD.cueHandler=d,bD.enableCEA708Captions=!0,bD.enableWebVTT=!0,bD.captionsTextTrack1Label="English",bD.captionsTextTrack1LanguageCode="en",bD.captionsTextTrack2Label="Spanish",bD.captionsTextTrack2LanguageCode="es",bD.audioStreamController=aS,bD.audioTrackController=aO,bD.emeController=bC;var bE=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}();c(14);var bF=function(){function a(){var b=this,c=arguments.length>0&& void 0!==arguments[0]?arguments[0]:{};!function(a,b){if(!(a instanceof b))throw TypeError("Cannot call a class as a function")}(this,a);var d=a.DefaultConfig;if((c.liveSyncDurationCount||c.liveMaxLatencyDurationCount)&&(c.liveSyncDuration||c.liveMaxLatencyDuration))throw Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");for(var e in d)e in c||(c[e]=d[e]);if(void 0!==c.liveMaxLatencyDurationCount&&c.liveMaxLatencyDurationCount<=c.liveSyncDurationCount)throw Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be gt "liveSyncDurationCount"');if(void 0!==c.liveMaxLatencyDuration&&(c.liveMaxLatencyDuration<=c.liveSyncDuration|| void 0===c.liveSyncDuration))throw Error('Illegal hls.js config: "liveMaxLatencyDuration" must be gt "liveSyncDuration"');Object(j.a)(c.debug),this.config=c,this._autoLevelCapping=-1;var f=this.observer=new T.a;f.trigger=function(a){for(var b=arguments.length,c=Array(b>1?b-1:0),d=1;d<b;d++)c[d-1]=arguments[d];f.emit.apply(f,[a,a].concat(c))},f.off=function(a){for(var b=arguments.length,c=Array(b>1?b-1:0),d=1;d<b;d++)c[d-1]=arguments[d];f.removeListener.apply(f,[a].concat(c))},this.on=f.on.bind(f),this.off=f.off.bind(f),this.once=f.once.bind(f),this.trigger=f.trigger.bind(f);var g=this.abrController=new c.abrController(this),h=new c.bufferController(this),i=new c.capLevelController(this),
vendor: 9,753 bytes, line 1
1k=new c.fpsController(this),l=new L(this),m=new M(this),n=new N(this),o=new ax(this),p=this.levelController=new at(this),q=new P(this),r=this.streamController=new ap(this,q),s=[p,r],t=c.audioStreamController;t&&s.push(new t(this,q)),this.networkControllers=s;var u=[l,m,n,g,h,i,k,o,q];if(t=c.audioTrackController){var v=new t(this);this.audioTrackController=v,u.push(v)}if(t=c.subtitleTrackController){var w=new t(this);this.subtitleTrackController=w,u.push(w)}if(t=c.emeController){var x=new t(this);this.emeController=x,u.push(x)}[c.subtitleStreamController,c.timelineController].forEach(function(a){a&&u.push(new a(b))}),this.coreComponents=u}return a.isSupported=function(){var a,b,c,d;return a=X(),b=window.SourceBuffer||window.WebKitSourceBuffer,c=a&&"function"==typeof a.isTypeSupported&&a.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),d=!b||b.prototype&&"function"==typeof b.prototype.appendBuffer&&"function"==typeof b.prototype.remove,!!c&&!!d},bE(a,null,[{key:"version",get:function(){return"0.11.0"}},{key:"Events",get:function(){return i.a}},{key:"ErrorTypes",get:function(){return g.b}},{key:"ErrorDetails",get:function(){return g.a}},{key:"DefaultConfig",get:function(){return a.defaultConfig?a.defaultConfig:bD},set:function(b){a.defaultConfig=b}}]),a.prototype.destroy=function(){j.b.log("destroy"),this.trigger(i.a.DESTROYING),this.detachMedia(),this.coreComponents.concat(this.networkControllers).forEach(function(a){a.destroy()}),this.url=null,this.observer.removeAllListeners(),this._autoLevelCapping=-1},a.prototype.attachMedia=function(a){j.b.log("attachMedia"),this.media=a,this.trigger(i.a.MEDIA_ATTACHING,{media:a})},a.prototype.detachMedia=function(){j.b.log("detachMedia"),this.trigger(i.a.MEDIA_DETACHING),this.media=null},a.prototype.loadSource=function(a){a=f.a.buildAbsoluteURL(window.location.href,a,{alwaysNormalize:!0}),j.b.log("loadSource:"+a),this.url=a,this.trigger(i.a.MANIFEST_LOADING,{url:a})},a.prototype.startLoad=function(){var a=arguments.length>0&& void 0!==arguments[0]?arguments[0]:-1;j.b.log("startLoad("+a+")"),this.networkControllers.forEach(function(b){b.startLoad(a)})},a.prototype.stopLoad=function(){j.b.log("stopLoad"),this.networkControllers.forEach(function(a){a.stopLoad()})},a.prototype.swapAudioCodec=function(){j.b.log("swapAudioCodec"),this.streamController.swapAudioCodec()},a.prototype.recoverMediaError=function(){j.b.log("recoverMediaError");var a=this.media;this.detachMedia(),this.attachMedia(a)},bE(a,[{key:"levels",get:function(){return this.levelController.levels}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(a){j.b.log("set currentLevel:"+a),this.loadLevel=a,this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(a){j.b.log("set nextLevel:"+a),this.levelController.manualLevel=a,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(a){j.b.log("set loadLevel:"+a),this.levelController.manualLevel=a}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(a){this.levelController.nextLoadLevel=a}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(a){j.b.log("set firstLevel:"+a),this.levelController.firstLevel=a}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(a){j.b.log("set startLevel:"+a);var b=this;-1!==a&&(a=Math.max(a,b.minAutoLevel)),b.levelController.startLevel=a}},{key:"autoLevelCapping",get:function(){return this._autoLevelCapping},set:function(a){j.b.log("set autoLevelCapping:"+a),this._autoLevelCapping=a}},{key:"autoLevelEnabled",get:function(){return -1===this.levelController.manualLevel}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){for(var a=this.levels,b=this.config.minAutoBitrate,c=a?a.length:0,d=0;d<c;d++)if((a[d].realBitrate?Math.max(a[d].realBitrate,a[d].bitrate):a[d].bitrate)>b)return d;return 0}},{key:"maxAutoLevel",get:function(){var a=this.levels,b=this.autoLevelCapping,c=void 0;return -1===b&&a&&a.length?a.length-1:b}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(a){var b=this;b.abrController.nextAutoLevel=Math.max(b.minAutoLevel,a)}},{key:"audioTracks",get:function(){var a=this.audioTrackController;return a?a.audioTracks:[]}},{key:"audioTrack",get:function(){var a=this.audioTrackController;return a?a.audioTrack:-1},set:function(a){var b=this.audioTrackController;b&&(b.audioTrack=a)}},{key:"liveSyncPosition",get:function(){return this.streamController.liveSyncPosition}},{key:"subtitleTracks",get:function(){var a=this.subtitleTrackController;return a?a.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var a=this.subtitleTrackController;return a?a.subtitleTrack:-1},set:function(a){var b=this.subtitleTrackController;b&&(b.subtitleTrack=a)}},{key:"subtitleDisplay",get:function(){var a=this.subtitleTrackController;return!!a&&a.subtitleDisplay},set:function(a){var b=this.subtitleTrackController;b&&(b.subtitleDisplay=a)}}]),a}();b.default=bF},function(a,b,c){function d(a){var b={};function c(d){if(b[d])return b[d].exports;var e=b[d]={i:d,l:!1,exports:{}};return a[d].call(e.exports,e,e.exports,c),e.l=!0,e.exports}c.m=a,c.c=b,c.i=function(a){return a},c.d=function(a,b,d){c.o(a,b)||Object.defineProperty(a,b,{configurable:!1,enumerable:!0,get:d})},c.n=function(a){var b=a&&a.__esModule?function(){return a.default}:function(){return a};return c.d(b,"a",b),b},c.o=function(a,b){return Object.prototype.hasOwnProperty.call(a,b)},c.p="/",c.oe=function(a){throw console.error(a),a};var d=c(c.s=ENTRY_MODULE);return d.default||d}var e="[\\.|\\-|\\+|\\w|/|@]+",f="\\((/\\*.*?\\*/)?s?.*?("+e+").*?\\)";function g(a){return(a+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function h(a,b,d){var h,i={};i[d]=[];var j=b.toString(),k=j.match(/^function\s?\(\w+,\s*\w+,\s*(\w+)\)/);if(!k)return i;for(var l=k[1],m=RegExp("(\\\\n|\\W)"+g(l)+f,"g");h=m.exec(j);)"dll-reference"!==h[3]&&i[d].push(h[3]);for(m=RegExp("\\("+g(l)+'\\("(dll-reference\\s('+e+'))"\\)\\)'+f,"g");h=m.exec(j);)a[h[2]]||(i[d].push(h[1]),a[h[2]]=c(h[1]).m),i[h[2]]=i[h[2]]||[],i[h[2]].push(h[4]);return i}function i(a){return Object.keys(a).reduce(function(b,c){return b||a[c].length>0},!1)}a.exports=function(a,b){b=b||{};var e={main:c.m},f=b.all?{main:Object.keys(e)}:function(a,b){for(var c={main:[b]},d={main:[]},e={main:{}};i(c);)for(var f=Object.keys(c),g=0;g<f.length;g++){var j=f[g],k=c[j].pop();if(e[j]=e[j]||{},!e[j][k]&&a[j][k]){e[j][k]=!0,d[j]=d[j]||[],d[j].push(k);for(var l=h(a,a[j][k],j),m=Object.keys(l),n=0;n<m.length;n++)c[m[n]]=c[m[n]]||[],c[m[n]]=c[m[n]].concat(l[m[n]])}}return d}(e,a),g="";Object.keys(f).filter(function(a){return"main"!==a}).forEach(function(a){for(var b=0;f[a][b];)b++;f[a].push(b),e[a][b]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",g=g+"var "+a+" = ("+d.toString().replace("ENTRY_MODULE",JSON.stringify(b))+")({"+f[a].map(function(b){return""+JSON.stringify(b)+": "+e[a][b].toString()}).join(",")+"});\n"}),g=g+"("+d.toString().replace("ENTRY_MODULE",JSON.stringify(a))+")({"+f.main.map(function(a){return""+JSON.stringify(a)+": "+e.main[a].toString()}).join(",")+"})(self);";var j=new window.Blob([g],{type:"text/javascript"});if(b.bare)return j;var k=(window.URL||window.webkitURL||window.mozURL||window.msURL).createObjectURL(j),l=new window.Worker(k);return l.objectURL=k,l}},function(a,b,c){"use strict";Object.defineProperty(b,"__esModule",{value:!0});var d=c(10),e=c(1),f=c(0),g=c(7),h=c.n(g),i=function(a){var b=new h.a;b.trigger=function(a){for(var c=arguments.length,d=Array(c>1?c-1:0),e=1;e<c;e++)d[e-1]=arguments[e];b.emit.apply(b,[a,a].concat(d))},b.off=function(a){for(var c=arguments.length,d=Array(c>1?c-1:0),e=1;e<c;e++)d[e-1]=arguments[e];b.removeListener.apply(b,[a].concat(d))};var c=function(b,c){a.postMessage({event:b,data:c})};a.addEventListener("message",function(e){var g=e.data;switch(g.cmd){case"init":var h=JSON.parse(g.config);a.demuxer=new d.a(b,g.typeSupported,h,g.vendor);try{Object(f.a)(!0===h.debug)}catch(i){console.warn("demuxerWorker: unable to enable logs")}c("init",null);break;case"demux":a.demuxer.push(g.data,g.decryptdata,g.initSegment,g.audioCodec,g.videoCodec,g.timeOffset,g.discontinuity,g.trackSwitch,g.contiguous,g.duration,g.accurateTimeOffset,g.defaultInitPTS)}}),b.on(e.a.FRAG_DECRYPTED,c),b.on(e.a.FRAG_PARSING_INIT_SEGMENT,c),b.on(e.a.FRAG_PARSED,c),b.on(e.a.ERROR,c),b.on(e.a.FRAG_PARSING_METADATA,c),b.on(e.a.FRAG_PARSING_USERDATA,c),b.on(e.a.INIT_PTS_FOUND,c),b.on(e.a.FRAG_PARSING_DATA,function(b,c){var d=[],e={event:b,data:c};c.data1&&(e.data1=c.data1.buffer,d.push(c.data1.buffer),delete c.data1),c.data2&&(e.data2=c.data2.buffer,d.push(c.data2.buffer),delete c.data2),a.postMessage(e,d)})};b.default=i},function(a,b){/*! http://mths.be/endswith v0.2.0 by @mathias */ if(!String.prototype.endsWith){var c,d,e;c=function(){try{var a={},b=Object.defineProperty,c=b(a,a,a)&&b}catch(d){}return c}(),d=({}).toString,e=function(a){if(this==null)throw TypeError();var b=String(this);if(a&&"[object RegExp]"==d.call(a))throw TypeError();var c=b.length,e=String(a),f=e.length,g=c;if(arguments.length>1){var h=arguments[1];void 0!==h&&(g=h?Number(h):0)!=g&&(g=0)}var i=Math.min(Math.max(g,0),c)-f;if(i<0)return!1;for(var j=-1;++j<f;)if(b.charCodeAt(i+j)!=e.charCodeAt(j))return!1;return!0},c?c(String.prototype,"endsWith",{value:e,configurable:!0,writable:!0}):String.prototype.endsWith=e}}]).default})}}])

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.