PageSourceSearch

https://kviff.tv/_next/static/chunks/fe77c09f.828e9dbd926071a5.js

js kviff.tv collected 2026-10-02 10:34:13 UTC 108,412 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3160],{77371:function(t){var e;e=function(){"use strict";var t=function(){this.init=function(){var t={};this.on=function(e,i){t[e]||(t[e]=[]),t[e]=t[e].concat(i)},this.off=function(e,i){var n;return!!t[e]&&(n=t[e].indexOf(i),t[e]=t[e].slice(),t[e].splice(n,1),n>-1)},this.trigger=function(e){var i,n,a,r;if(i=t[e]){if(2==arguments.length)for(n=0,a=i.length;n<a;++n)i[n].call(this,arguments[1]);else{for(r=[],n=arguments.length,n=1;n<arguments.length;++n)r.push(arguments[n]);for(n=0,a=i.length;n<a;++n)i[n].apply(this,r)}}},this.dispose=function(){t={}}}};t.prototype.pipe=function(t){return this.on("data",function(e){t.push(e)}),this.on("done",function(e){t.flush(e)}),this.on("partialdone",function(e){t.partialFlush(e)}),this.on("endedtimeline",function(e){t.endTimeline(e)}),this.on("reset",function(e){t.reset(e)}),t},t.prototype.push=function(t){this.trigger("data",t)},t.prototype.flush=function(t){this.trigger("done",t)},t.prototype.partialFlush=function(t){this.trigger("partialdone",t)},t.prototype.endTimeline=function(t){this.trigger("endedtimeline",t)},t.prototype.reset=function(t){this.trigger("reset",t)},q=function(t){return 9e4*t},K=function(t,e){return t*e},X=function(t){return t/9e4},Z=function(t,e){return t/e},$=function(t,e){return q(Z(t,e))},J=function(t,e){return K(X(t),e)},Q=function(t,e,i){return X(i?t:t-e)};var e={ONE_SECOND_IN_TS:9e4,videoTsToSeconds:X,audioTsToVideoTs:$,videoTsToAudioTs:J,metadataTsToSeconds:Q},i=e.ONE_SECOND_IN_TS,n=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];(tr=function(t){var e,a=0;tr.prototype.init.call(this),this.push=function(r){var s,o,d,h,p,u,l=0;if(t||(a=0),"audio"===r.type)for(e?((e=new Uint8Array((h=e).byteLength+r.data.byteLength)).set(h),e.set(r.data,h.byteLength)):e=r.data;l+5<e.length;){if(255!==e[l]||(246&e[l+1])!=240){l++;continue}if(o=(1&~e[l+1])*2,s=(3&e[l+3])<<11|e[l+4]<<3|(224&e[l+5])>>5,u=(p=((3&e[l+6])+1)*1024)*i/n[(60&e[l+2])>>>2],d=l+s,e.byteLength<d)return;if(this.trigger("data",{pts:r.pts+a*u,dts:r.dts+a*u,sampleCount:p,audioobjecttype:(e[l+2]>>>6&3)+1,channelcount:(1&e[l+2])<<2|(192&e[l+3])>>>6,samplerate:n[(60&e[l+2])>>>2],samplingfrequencyindex:(60&e[l+2])>>>2,samplesize:16,data:e.subarray(l+7+o,d)}),a++,e.byteLength===d){e=void 0;return}e=e.subarray(d)}},this.flush=function(){a=0,this.trigger("done")},this.reset=function(){e=void 0,this.trigger("reset")},this.endTimeline=function(){e=void 0,this.trigger("endedtimeline")}}).prototype=new t;var a=tr;ts=function(t){var e=t.byteLength,i=0,n=0;this.length=function(){return 8*e},this.bitsAvailable=function(){return 8*e+n},this.loadWord=function(){var a=t.byteLength-e,r=new Uint8Array(4),s=Math.min(4,e);if(0===s)throw Error("no bytes available");r.set(t.subarray(a,a+s)),i=new DataView(r.buffer).getUint32(0),n=8*s,e-=s},this.skipBits=function(t){var a;n>t||(t-=n,a=Math.floor(t/8),t-=8*a,e-=a,this.loadWord()),i<<=t,n-=t},this.readBits=function(t){var a=Math.min(n,t),r=i>>>32-a;return((n-=a)>0?i<<=a:e>0&&this.loadWord(),(a=t-a)>0)?r<<a|this.readBits(a):r},this.skipLeadingZeros=function(){var t;for(t=0;t<n;++t)if((i&2147483648>>>t)!=0)return i<<=t,n-=t,t;return this.loadWord(),t+this.skipLeadingZeros()},this.skipUnsignedExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.skipExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.readUnsignedExpGolomb=function(){var t=this.skipLeadingZeros();return this.readBits(t+1)-1},this.readExpGolomb=function(){var t=this.readUnsignedExpGolomb();return 1&t?1+t>>>1:-1*(t>>>1)},this.readBoolean=function(){return 1===this.readBits(1)},this.readUnsignedByte=function(){return this.readBits(8)},this.loadWord()},(td=function(){var t,e,i=0;td.prototype.init.call(this),this.push=function(n){e?((a=new Uint8Array(e.byteLength+n.data.byteLength)).set(e),a.set(n.data,e.byteLength),e=a):e=n.data;for(var a,r=e.byteLength;i<r-3;i++)if(1===e[i+2]){t=i+5;break}for(;t<r;)switch(e[t]){case 0:if(0!==e[t-1]){t+=2;break}if(0!==e[t-2]){t++;break}i+3!==t-2&&this.trigger("data",e.subarray(i+3,t-2));do t++;while(1!==e[t]&&t<r);i=t-2,t+=3;break;case 1:if(0!==e[t-1]||0!==e[t-2]){t+=3;break}this.trigger("data",e.subarray(i+3,t-2)),i=t-2,t+=3;break;default:t+=3}e=e.subarray(i),t-=i,i=0},this.reset=function(){e=null,i=0,this.trigger("reset")},this.flush=function(){e&&e.byteLength>3&&this.trigger("data",e.subarray(i+3)),e=null,i=0,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")}}).prototype=new t,th={100:!0,110:!0,122:!0,244:!0,44:!0,83:!0,86:!0,118:!0,128:!0,138:!0,139:!0,134:!0},(to=function(){var t,e,i,n,a,r,s,o=new td;to.prototype.init.call(this),t=this,this.push=function(t){"video"===t.type&&(e=t.trackId,i=t.pts,n=t.dts,o.push(t))},o.on("data",function(s){var o={trackId:e,pts:i,dts:n,data:s};switch(31&s[0]){case 5:o.nalUnitType="slice_layer_without_partitioning_rbsp_idr";break;case 6:o.nalUnitType="sei_rbsp",o.escapedRBSP=a(s.subarray(1));break;case 7:o.nalUnitType="seq_parameter_set_rbsp",o.escapedRBSP=a(s.subarray(1)),o.config=r(o.escapedRBSP);break;case 8:o.nalUnitType="pic_parameter_set_rbsp";break;case 9:o.nalUnitType="access_unit_delimiter_rbsp"}t.trigger("data",o)}),o.on("done",function(){t.trigger("done")}),o.on("partialdone",function(){t.trigger("partialdone")}),o.on("reset",function(){t.trigger("reset")}),o.on("endedtimeline",function(){t.trigger("endedtimeline")}),this.flush=function(){o.flush()},this.partialFlush=function(){o.partialFlush()},this.reset=function(){o.reset()},this.endTimeline=function(){o.endTimeline()},s=function(t,e){var i,n=8,a=8;for(i=0;i<t;i++)0!==a&&(a=(n+e.readExpGolomb()+256)%256),n=0===a?n:a},a=function(t){for(var e,i,n=t.byteLength,a=[],r=1;r<n-2;)0===t[r]&&0===t[r+1]&&3===t[r+2]?(a.push(r+2),r+=2):r++;if(0===a.length)return t;i=new Uint8Array(e=n-a.length);var s=0;for(r=0;r<e;s++,r++)s===a[0]&&(s++,a.shift()),i[r]=t[s];return i},r=function(t){var e,i,n,a,r,o,d,h,p,u,l,c,f,m=0,g=0,y=0,b=0,v=1;if(i=(e=new ts(t)).readUnsignedByte(),a=e.readUnsignedByte(),n=e.readUnsignedByte(),e.skipUnsignedExpGolomb(),th[i]&&(3===(r=e.readUnsignedExpGolomb())&&e.skipBits(1),e.skipUnsignedExpGolomb(),e.skipUnsignedExpGolomb(),e.skipBits(1),e.readBoolean()))for(f=0,l=3!==r?8:12;f<l;f++)e.readBoolean()&&(f<6?s(16,e):s(64,e));if(e.skipUnsignedExpGolomb(),0===(o=e.readUnsignedExpGolomb()))e.readUnsignedExpGolomb();else if(1===o)for(e.skipBits(1),e.skipExpGolomb(),e.skipExpGolomb(),d=e.readUnsignedExpGolomb(),f=0;f<d;f++)e.skipExpGolomb();if(e.skipUnsignedExpGolomb(),e.skipBits(1),h=e.readUnsignedExpGolomb(),p=e.readUnsignedExpGolomb(),0===(u=e.readBits(1))&&e.skipBits(1),e.skipBits(1),e.readBoolean()&&(m=e.readUnsignedExpGolomb(),g=e.readUnsignedExpGolomb(),y=e.readUnsignedExpGolomb(),b=e.readUnsignedExpGolomb()),e.readBoolean()&&e.readBoolean()){switch(e.readUnsignedByte()){case 1:c=[1,1];break;case 2:c=[12,11];break;case 3:c=[10,11];break;case 4:c=[16,11];break;case 5:c=[40,33];break;case 6:c=[24,11];break;case 7:c=[20,11];break;case 8:c=[32,11];break;case 9:c=[80,33];break;case 10:c=[18,11];break;case 11:c=[15,11];break;case 12:c=[64,33];break;case 13:c=[160,99];break;case 14:c=[4,3];break;case 15:c=[3,2];break;case 16:c=[2,1];break;case 255:c=[e.readUnsignedByte()<<8|e.readUnsignedByte(),e.readUnsignedByte()<<8|e.readUnsignedByte()]}c&&(v=c[0]/c[1])}return{profileIdc:i,levelIdc:n,profileCompatibility:a,width:Math.ceil(((h+1)*16-2*m-2*g)*v),height:(2-u)*(p+1)*16-2*y-2*b,sarRatio:c}}}).prototype=new t;var r={H264Stream:to,NalByteStream:td},s={Adts:a,h264:r};(function(){var t;if(tO={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],mvex:[],mvhd:[],pasp:[],sdtp:[],smhd:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],styp:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[]},"undefined"!=typeof Uint8Array){for(t in tO)tO.hasOwnProperty(t)&&(tO[t]=[t.charCodeAt(0),t.charCodeAt(1),t.charCodeAt(2),t.charCodeAt(3)]);tM=new Uint8Array([105,115,111,109]),tx=new Uint8Array([97,118,99,49]),tE=new Uint8Array([0,0,0,1]),tR={video: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]),audio: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])},tB=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),tF=new Uint8Array([0,0,0,0,0,0,0,0]),tV=tz=new Uint8Array([0,0,0,0,0,0,0,0]),tG=new 
vendor: 4,442 bytes, line 1
1Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),tW=tz,tN=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}})(),tp=function(t){var e,i,n=[],a=0;for(e=1;e<arguments.length;e++)n.push(arguments[e]);for(e=n.length;e--;)a+=n[e].byteLength;for(new DataView((i=new Uint8Array(a+8)).buffer,i.byteOffset,i.byteLength).setUint32(0,i.byteLength),i.set(t,4),e=0,a=8;e<n.length;e++)i.set(n[e],a),a+=n[e].byteLength;return i},tu=function(){return tp(tO.dinf,tp(tO.dref,tB))},tl=function(t){return tp(tO.esds,new Uint8Array([0,0,0,0,3,25,0,0,0,4,17,64,21,0,6,0,0,0,218,192,0,0,218,192,5,2,t.audioobjecttype<<3|t.samplingfrequencyindex>>>1,t.samplingfrequencyindex<<7|t.channelcount<<3,6,1,2]))},tc=function(){return tp(tO.ftyp,tM,tE,tM,tx)},tU=function(t){return tp(tO.hdlr,tR[t])},tf=function(t){return tp(tO.mdat,t)},tk=function(t){var e=new Uint8Array([0,0,0,0,0,0,0,2,0,0,0,3,0,1,95,144,t.duration>>>24&255,t.duration>>>16&255,t.duration>>>8&255,255&t.duration,85,196,0,0]);return t.samplerate&&(e[12]=t.samplerate>>>24&255,e[13]=t.samplerate>>>16&255,e[14]=t.samplerate>>>8&255,e[15]=255&t.samplerate),tp(tO.mdhd,e)},t_=function(t){return tp(tO.mdia,tk(t),tU(t.type),tg(t))},tm=function(t){return tp(tO.mfhd,new Uint8Array([0,0,0,0,(4278190080&t)>>24,(16711680&t)>>16,(65280&t)>>8,255&t]))},tg=function(t){return tp(tO.minf,"video"===t.type?tp(tO.vmhd,tN):tp(tO.smhd,tF),tu(),tD(t))},ty=function(t,e){for(var i=[],n=e.length;n--;)i[n]=tP(e[n]);return tp.apply(null,[tO.moof,tm(t)].concat(i))},tb=function(t){for(var e=t.length,i=[];e--;)i[e]=tT(t[e]);return tp.apply(null,[tO.moov,tS(4294967295)].concat(i).concat(tv(t)))},tv=function(t){for(var e=t.length,i=[];e--;)i[e]=tI(t[e]);return tp.apply(null,[tO.mvex].concat(i))},tS=function(t){var e=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,2,0,1,95,144,(4278190080&t)>>24,(16711680&t)>>16,(65280&t)>>8,255&t,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 tp(tO.mvhd,e)},tA=function(t){var e,i,n=t.samples||[],a=new Uint8Array(4+n.length);for(i=0;i<n.length;i++)e=n[i].flags,a[i+4]=e.dependsOn<<4|e.isDependedOn<<2|e.hasRedundancy;return tp(tO.sdtp,a)},tD=function(t){return tp(tO.stbl,tC(t),tp(tO.stts,tW),tp(tO.stsc,tV),tp(tO.stsz,tG),tp(tO.stco,tz))},tC=function(t){return tp(tO.stsd,new Uint8Array([0,0,0,0,0,0,0,1]),"video"===t.type?tt(t):te(t))},tt=function(t){var e,i,n=t.sps||[],a=t.pps||[],r=[],s=[];for(e=0;e<n.length;e++)r.push((65280&n[e].byteLength)>>>8),r.push(255&n[e].byteLength),r=r.concat(Array.prototype.slice.call(n[e]));for(e=0;e<a.length;e++)s.push((65280&a[e].byteLength)>>>8),s.push(255&a[e].byteLength),s=s.concat(Array.prototype.slice.call(a[e]));if(i=[tO.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,(65280&t.width)>>8,255&t.width,(65280&t.height)>>8,255&t.height,0,72,0,0,0,72,0,0,0,0,0,0,0,1,19,118,105,100,101,111,106,115,45,99,111,110,116,114,105,98,45,104,108,115,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),tp(tO.avcC,new Uint8Array([1,t.profileIdc,t.profileCompatibility,t.levelIdc,255].concat([n.length],r,[a.length],s))),tp(tO.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192]))],t.sarRatio){var o=t.sarRatio[0],d=t.sarRatio[1];i.push(tp(tO.pasp,new Uint8Array([(4278190080&o)>>24,(16711680&o)>>16,(65280&o)>>8,255&o,(4278190080&d)>>24,(16711680&d)>>16,(65280&d)>>8,255&d])))}return tp.apply(null,i)},te=function(t){return tp(tO.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,(65280&t.channelcount)>>8,255&t.channelcount,(65280&t.samplesize)>>8,255&t.samplesize,0,0,0,0,(65280&t.samplerate)>>8,255&t.samplerate,0,0]),tl(t))},tw=function(t){var e=new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,(4278190080&t.id)>>24,(16711680&t.id)>>16,(65280&t.id)>>8,255&t.id,0,0,0,0,(4278190080&t.duration)>>24,(16711680&t.duration)>>16,(65280&t.duration)>>8,255&t.duration,0,0,0,0,0,0,0,0,0,0,0,0,1,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,(65280&t.width)>>8,255&t.width,0,0,(65280&t.height)>>8,255&t.height,0,0]);return tp(tO.tkhd,e)},tP=function(t){var e,i,n,a,r,s;return(e=tp(tO.tfhd,new Uint8Array([0,0,0,58,(4278190080&t.id)>>24,(16711680&t.id)>>16,(65280&t.id)>>8,255&t.id,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0])),r=Math.floor(t.baseMediaDecodeTime/4294967296),s=Math.floor(t.baseMediaDecodeTime%4294967296),i=tp(tO.tfdt,new Uint8Array([1,0,0,0,r>>>24&255,r>>>16&255,r>>>8&255,255&r,s>>>24&255,s>>>16&255,s>>>
vendor: 4,205 bytes, line 1
18&255,255&s])),"audio"===t.type)?(n=tL(t,92),tp(tO.traf,e,i,n)):(a=tA(t),n=tL(t,a.length+92),tp(tO.traf,e,i,n,a))},tT=function(t){return t.duration=t.duration||4294967295,tp(tO.trak,tw(t),t_(t))},tI=function(t){var e=new Uint8Array([0,0,0,0,(4278190080&t.id)>>24,(16711680&t.id)>>16,(65280&t.id)>>8,255&t.id,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return"video"!==t.type&&(e[e.length-1]=0),tp(tO.trex,e)},ta=function(t,e){var i=0,n=0,a=0,r=0;return t.length&&(void 0!==t[0].duration&&(i=1),void 0!==t[0].size&&(n=2),void 0!==t[0].flags&&(a=4),void 0!==t[0].compositionTimeOffset&&(r=8)),[0,0,i|n|a|r,1,(4278190080&t.length)>>>24,(16711680&t.length)>>>16,(65280&t.length)>>>8,255&t.length,(4278190080&e)>>>24,(16711680&e)>>>16,(65280&e)>>>8,255&e]},tn=function(t,e){var i,n,a,r,s,o;for(e+=20+16*(r=t.samples||[]).length,(n=new Uint8Array((a=ta(r,e)).length+16*r.length)).set(a),i=a.length,o=0;o<r.length;o++)s=r[o],n[i++]=(4278190080&s.duration)>>>24,n[i++]=(16711680&s.duration)>>>16,n[i++]=(65280&s.duration)>>>8,n[i++]=255&s.duration,n[i++]=(4278190080&s.size)>>>24,n[i++]=(16711680&s.size)>>>16,n[i++]=(65280&s.size)>>>8,n[i++]=255&s.size,n[i++]=s.flags.isLeading<<2|s.flags.dependsOn,n[i++]=s.flags.isDependedOn<<6|s.flags.hasRedundancy<<4|s.flags.paddingValue<<1|s.flags.isNonSyncSample,n[i++]=61440&s.flags.degradationPriority,n[i++]=15&s.flags.degradationPriority,n[i++]=(4278190080&s.compositionTimeOffset)>>>24,n[i++]=(16711680&s.compositionTimeOffset)>>>16,n[i++]=(65280&s.compositionTimeOffset)>>>8,n[i++]=255&s.compositionTimeOffset;return tp(tO.trun,n)},ti=function(t,e){var i,n,a,r,s,o;for(e+=20+8*(r=t.samples||[]).length,(i=new Uint8Array((a=ta(r,e)).length+8*r.length)).set(a),n=a.length,o=0;o<r.length;o++)s=r[o],i[n++]=(4278190080&s.duration)>>>24,i[n++]=(16711680&s.duration)>>>16,i[n++]=(65280&s.duration)>>>8,i[n++]=255&s.duration,i[n++]=(4278190080&s.size)>>>24,i[n++]=(16711680&s.size)>>>16,i[n++]=(65280&s.size)>>>8,i[n++]=255&s.size;return tp(tO.trun,i)},tL=function(t,e){return"audio"===t.type?ti(t,e):tn(t,e)};var o={ftyp:tc,mdat:tf,moof:ty,moov:tb,initSegment:function(t){var e,i=tc(),n=tb(t);return(e=new Uint8Array(i.byteLength+n.byteLength)).set(i),e.set(n,i.byteLength),e}},d=function(t){return t>>>0},h=function(t){return""+(String.fromCharCode(t[0])+String.fromCharCode(t[1])+String.fromCharCode(t[2])+String.fromCharCode(t[3]))},p=function t(e,i){var n,a,r,s,o,p=[];if(!i.length)return null;for(n=0;n<e.byteLength;)a=d(e[n]<<24|e[n+1]<<16|e[n+2]<<8|e[n+3]),r=h(e.subarray(n+4,n+8)),s=a>1?n+a:e.byteLength,r===i[0]&&(1===i.length?p.push(e.subarray(n+8,s)):(o=t(e.subarray(n+8,s),i.slice(1))).length&&(p=p.concat(o))),n=s;return p},u=function(t){var e,i=new DataView(t.buffer,t.byteOffset,t.byteLength),n={version:t[0],flags:new Uint8Array(t.subarray(1,4)),trackId:i.getUint32(4)},a=1&n.flags[2],r=2&n.flags[2],s=8&n.flags[2],o=16&n.flags[2],d=32&n.flags[2],h=65536&n.flags[0],p=131072&n.flags[0];return e=8,a&&(e+=4,n.baseDataOffset=i.getUint32(12),e+=4),r&&(n.sampleDescriptionIndex=i.getUint32(e),e+=4),s&&(n.defaultSampleDuration=i.getUint32(e),e+=4),o&&(n.defaultSampleSize=i.getUint32(e),e+=4),d&&(n.defaultSampleFlags=i.getUint32(e)),h&&(n.durationIsEmpty=!0),!a&&p&&(n.baseDataOffsetIsMoof=!0),n},l=function(t){return{isLeading:(12&t[0])>>>2,dependsOn:3&t[0],isDependedOn:(192&t[1])>>>6,hasRedundancy:(48&t[1])>>>4,paddingValue:(14&t[1])>>>1,isNonSyncSample:1&t[1],degradationPriority:t[2]<<8|t[3]}},c=function(t){var e,i={version:t[0],flags:new Uint8Array(t.subarray(1,4)),samples:[]},n=new DataView(t.buffer,t.byteOffset,t.byteLength),a=1&i.flags[2],r=4&i.flags[2],s=1&i.flags[1],o=2&i.flags[1],d=4&i.flags[1],h=8&i.flags[1],p=n.getUint32(4),u=8;for(a&&(i.dataOffset=n.getInt32(u),u+=4),r&&p&&(e={flags:l(t.subarray(u,u+4))},u+=4,s&&(e.duration=n.getUint32(u),u+=4),o&&(e.size=n.getUint32(u),u+=4),h&&(1===i.version?e.compositionTimeOffset=n.getInt32(u):e.compositionTimeOffset=n.getUint32(u),u+=4),i.samples.push(e),p--);p--;)e={},s&&(e.duration=n.getUint32(u),u+=4),o&&(e.size=n.getUint32(u),u+=4),d&&(e.flags=l(t.subarray(u,u+4)),u+=4),h&&(1===i.version?e.compositionTimeOffset=n.getInt32(u):e.compositionTimeOffset=n.getUint32(u),u+=4),i.samples.push(e);return i}
1,f=function(t){var e={version:t[0],flags:new Uint8Array(t.subarray(1,4)),baseMediaDecodeTime:d(t[4]<<24|t[5]<<16|t[6]<<8|t[7])};return 1===e.version&&(e.baseMediaDecodeTime*=4294967296,e.baseMediaDecodeTime+=d(t[8]<<24|t[9]<<16|t[10]<<8|t[11])),e},m=function(t){return("00"+t.toString(16)).slice(-2)};tj=function(t){return p(t,["moov","trak"]).reduce(function(t,e){var i,n,a,r;return(i=p(e,["tkhd"])[0])&&(n=0===i[0]?12:20,a=d(i[n]<<24|i[n+1]<<16|i[n+2]<<8|i[n+3]),r=p(e,["mdia","mdhd"])[0])?(n=0===r[0]?12:20,t[a]=d(r[n]<<24|r[n+1]<<16|r[n+2]<<8|r[n+3]),t):null},{})},tY=function(t,e){var i,n,a;return i=p(e,["moof","traf"]),n=[].concat.apply([],i.map(function(e){return p(e,["tfhd"]).map(function(i){var n,a;return n=t[d(i[4]<<24|i[5]<<16|i[6]<<8|i[7])]||9e4,(a="number"!=typeof(a=p(e,["tfdt"]).map(function(t){var e,i;return e=t[0],i=d(t[4]<<24|t[5]<<16|t[6]<<8|t[7]),1===e&&(i*=4294967296,i+=d(t[8]<<24|t[9]<<16|t[10]<<8|t[11])),i})[0])||isNaN(a)?1/0:a)/n})})),isFinite(a=Math.min.apply(null,n))?a:0},tH=function(t,e){var i,n=p(e,["moof","traf"]),a=0,r=0;if(n&&n.length){var s=p(n[0],["tfhd"])[0],o=p(n[0],["trun"])[0],d=p(n[0],["tfdt"])[0];if(s&&(i=u(s).trackId),d&&(a=f(d).baseMediaDecodeTime),o){var h=c(o);h.samples&&h.samples.length&&(r=h.samples[0].compositionTimeOffset||0)}}return(a+r)/(t[i]||9e4)},tq=function(t){var e=p(t,["moov","trak"]),i=[];return e.forEach(function(t){var e=p(t,["mdia","hdlr"]),n=p(t,["tkhd"]);e.forEach(function(t,e){var a,r,s=h(t.subarray(8,12)),o=n[e];"vide"===s&&(r=0===(a=new DataView(o.buffer,o.byteOffset,o.byteLength)).getUint8(0)?a.getUint32(12):a.getUint32(20),i.push(r))})}),i},tX=function(t){var e=0===t[0]?12:20;return d(t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3])},tK=function(t){var e=p(t,["moov","trak"]),i=[];return e.forEach(function(t){var e={},n=p(t,["tkhd"])[0];n&&(d=(o=new DataView(n.buffer,n.byteOffset,n.byteLength)).getUint8(0),e.id=0===d?o.getUint32(12):o.getUint32(20));var a=p(t,["mdia","hdlr"])[0];if(a){var r=h(a.subarray(8,12));"vide"===r?e.type="video":"soun"===r?e.type="audio":e.type=r}var s=p(t,["mdia","minf","stbl","stsd"])[0];if(s){var o,d,u,l=s.subarray(8);e.codec=h(l.subarray(4,8));var c=p(l,[e.codec])[0];c&&(/^[a-z]vc[1-9]$/i.test(e.codec)?"avcC"===h((u=c.subarray(78)).subarray(4,8))&&u.length>11?(e.codec+=".",e.codec+=m(u[9]),e.codec+=m(u[10]),e.codec+=m(u[11])):e.codec="avc1.4d400d":/^mp4[a,v]$/i.test(e.codec)?"esds"===h((u=c.subarray(28)).subarray(4,8))&&u.length>20&&0!==u[19]?(e.codec+="."+m(u[19]),e.codec+="."+m(u[20]>>>2&63).replace(/^0/,"")):e.codec="mp4a.40.2":e.codec=e.codec.toLowerCase())}var f=p(t,["mdia","mdhd"])[0];f&&(e.timescale=tX(f)),i.push(e)}),i};var g=function(t,e){var i={size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0,isNonSyncSample:1}};return i.dataOffset=e,i.compositionTimeOffset=t.pts-t.dts,i.duration=t.duration,i.size=4*t.length,i.size+=t.byteLength,t.keyFrame&&(i.flags.dependsOn=2,i.flags.isNonSyncSample=0),i},y={groupNalsIntoFrames:function(t){var e,i,n=[],a=[];for(e=0,a.byteLength=0,a.nalCount=0,a.duration=0,n.byteLength=0;e<t.length;e++)"access_unit_delimiter_rbsp"===(i=t[e]).nalUnitType?(n.length&&(n.duration=i.dts-n.dts,a.byteLength+=n.byteLength,a.nalCount+=n.length,a.duration+=n.duration,a.push(n)),(n=[i]).byteLength=i.data.byteLength,n.pts=i.pts,n.dts=i.dts):("slice_layer_without_partitioning_rbsp_idr"===i.nalUnitType&&(n.keyFrame=!0),n.duration=i.dts-n.dts,n.byteLength+=i.data.byteLength,n.push(i));return a.length&&(!n.duration||n.duration<=0)&&(n.duration=a[a.length-1].duration),a.byteLength+=n.byteLength,a.nalCount+=n.length,a.duration+=n.duration,a.push(n),a},groupFramesIntoGops:function(t){var e,i,n=[],a=[];for(e=0,n.byteLength=0,n.nalCount=0,n.duration=0,n.pts=t[0].pts,n.dts=t[0].dts,a.byteLength=0,a.nalCount=0,a.duration=0,a.pts=t[0].pts,a.dts=t[0].dts;e<t.length;e++)(i=t[e]).keyFrame?(n.length&&(a.push(n),a.byteLength+=n.byteLength,a.nalCount+=n.nalCount,a.duration+=n.duration),(n=[i]).nalCount=i.length,n.byteLength=i.byteLength,n.pts=i.pts,n.dts=i.dts,n.duration=i.duration):(n.duration+=i.duration,n.nalCount+=i.length,n.byteLength+=i.byteLength,n.push(i));return a.length&&n.duration<=0&&(n.duration=a[a.length-1].duration),a.byteLength+=n.byteLength,a.nalCount+=n.nalCount,a.duration+=n.duration,a.push(n),a},extendFirstKeyFrame:function(t){var e;return!t[0][0].keyFrame&&t.length>1&&(e=t.shift(),t.byteLength-=e.byteLength,t.nalCount-=e.nalCount,t[0][0].dts=e.dts,t[0][0].pts=e.pts,t[0][0].duration+=e.duration),t},generateSampleTable:function(t,e){var i,n,a,r,s=e||0,o=[];for(i=0;i<t.length;i++)for(n=0,r=t[i];n<r.length;n++)a=g(r[n],s),s+=a.size,o.push(a);return o}
1,concatenateNalData:function(t){var e,i,n,a,r,s,o=0,d=new Uint8Array(t.byteLength+4*t.nalCount),h=new DataView(d.buffer);for(e=0;e<t.length;e++)for(i=0,a=t[e];i<a.length;i++)for(n=0,r=a[i];n<r.length;n++)s=r[n],h.setUint32(o,s.data.byteLength),o+=4,d.set(s.data,o),o+=s.data.byteLength;return d},generateSampleTableForFrame:function(t,e){var i=[];return i.push(g(t,e||0)),i},concatenateNalDataForFrame:function(t){var e,i,n=0,a=new Uint8Array(t.byteLength+4*t.length),r=new DataView(a.buffer);for(e=0;e<t.length;e++)i=t[e],r.setUint32(n,i.data.byteLength),n+=4,a.set(i.data,n),n+=i.data.byteLength;return a}},b=[33,16,5,32,164,27],v=[33,65,108,84,1,2,4,8,168,2,4,8,17,191,252],S=function(t){for(var e=[];t--;)e.push(0);return e},T=function(){if(!tZ){var t;tZ=Object.keys(t={96e3:[b,[227,64],S(154),[56]],88200:[b,[231],S(170),[56]],64e3:[b,[248,192],S(240),[56]],48e3:[b,[255,192],S(268),[55,148,128],S(54),[112]],44100:[b,[255,192],S(268),[55,163,128],S(84),[112]],32e3:[b,[255,192],S(268),[55,234],S(226),[112]],24e3:[b,[255,192],S(268),[55,255,128],S(268),[111,112],S(126),[224]],16e3:[b,[255,192],S(268),[55,255,128],S(268),[111,255],S(269),[223,108],S(195),[1,192]],12e3:[v,S(268),[3,127,248],S(268),[6,255,240],S(268),[13,255,224],S(268),[27,253,128],S(259),[56]],11025:[v,S(268),[3,127,248],S(268),[6,255,240],S(268),[13,255,224],S(268),[27,255,192],S(268),[55,175,128],S(108),[112]],8e3:[v,S(268),[3,121,16],S(47),[7]]}).reduce(function(e,i){return e[i]=new Uint8Array(t[i].reduce(function(t,e){return t.concat(e)},[])),e},{})}return tZ},w=function(t){var e,i=0;for(e=0;e<t.length;e++)i+=t[e].data.byteLength;return i},_=function(t,i,n,a){var r,s,o,d,h=0,p=0,u=0;if(i.length&&(r=e.audioTsToVideoTs(t.baseMediaDecodeTime,t.samplerate),h=Math.ceil(e.ONE_SECOND_IN_TS/(t.samplerate/1024)),n&&a&&(u=(p=Math.floor((r-Math.max(n,a))/h))*h),!(p<1)&&!(u>e.ONE_SECOND_IN_TS/2))){for((s=T()[t.samplerate])||(s=i[0].data),o=0;o<p;o++)d=i[0],i.splice(0,0,{data:s,dts:d.dts-h,pts:d.pts-h});return t.baseMediaDecodeTime-=Math.floor(e.videoTsToAudioTs(u,t.samplerate)),u}},k=function(t,e,i){return e.minSegmentDts>=i?t:(e.minSegmentDts=1/0,t.filter(function(t){return t.dts>=i&&(e.minSegmentDts=Math.min(e.minSegmentDts,t.dts),e.minSegmentPts=e.minSegmentDts,!0)}))},U=function(t){var e,i=[];for(e=0;e<t.length;e++)i.push({size:t[e].data.byteLength,duration:1024});return i},A=function(t){var e,i,n=0,a=new Uint8Array(w(t));for(e=0;e<t.length;e++)i=t[e],a.set(i.data,n),n+=i.data.byteLength;return a},D=e.ONE_SECOND_IN_TS,C={clearDtsInfo:function(t){delete t.minSegmentDts,delete t.maxSegmentDts,delete t.minSegmentPts,delete t.maxSegmentPts},calculateTrackBaseMediaDecodeTime:function(t,e){var i,n=t.minSegmentDts;return e||(n-=t.timelineStartInfo.dts),i=Math.max(0,i=t.timelineStartInfo.baseMediaDecodeTime+n),"audio"===t.type&&(i*=t.samplerate/D,i=Math.floor(i)),i},collectDtsInfo:function(t,e){"number"==typeof e.pts&&(void 0===t.timelineStartInfo.pts&&(t.timelineStartInfo.pts=e.pts),void 0===t.minSegmentPts?t.minSegmentPts=e.pts:t.minSegmentPts=Math.min(t.minSegmentPts,e.pts),void 0===t.maxSegmentPts?t.maxSegmentPts=e.pts:t.maxSegmentPts=Math.max(t.maxSegmentPts,e.pts)),"number"==typeof e.dts&&(void 0===t.timelineStartInfo.dts&&(t.timelineStartInfo.dts=e.dts),void 0===t.minSegmentDts?t.minSegmentDts=e.dts:t.minSegmentDts=Math.min(t.minSegmentDts,e.dts),void 0===t.maxSegmentDts?t.maxSegmentDts=e.dts:t.maxSegmentDts=Math.max(t.maxSegmentDts,e.dts))}},P=function(t){for(var e=0,i={payloadType:-1,payloadSize:0},n=0,a=0;e<t.byteLength&&128!==t[e];){for(;255===t[e];)n+=255,e++;for(n+=t[e++];255===t[e];)a+=255,e++;if(a+=t[e++],!i.payload&&4===n){if("GA94"===String.fromCharCode(t[e+3],t[e+4],t[e+5],t[e+6])){i.payloadType=n,i.payloadSize=a,i.payload=t.subarray(e,e+a);break}i.payload=void 0}e+=a,n=0,a=0}return i},I=function(t,e){var i,n,a,r,s=[];if(!(64&e[0]))return s;for(i=0,n=31&e[0];i<n;i++)r={type:3&e[(a=3*i)+2],pts:t},4&e[a+2]&&(r.ccData=e[a+3]<<8|e[a+4],s.push(r));return s},L=function t(e){e=e||{},t.prototype.init.call(this),this.parse708captions_="boolean"!=typeof e.parse708captions||e.parse708captions,this.captionPackets_=[],this.ccStreams_=[new G(0,0),new G(0,1),new G(1,0),new G(1,1)],this.parse708captions_&&(this.cc708Stream_=new N),this.reset(),this.ccStreams_.forEach(function(t){t.on("data",this.trigger.bind(this,"data")),t.on("partialdone",this.trigger.bind(this,"partialdone")),t.on("done",this.trigger.bind(this,"done"))},this),this.parse708captions_&&(this.cc708Stream_.on("data",this.trigger.bind(this,"data")),this.cc708Stream_.on("partialdone",this.trigger.bind(this,"partialdone")),this.cc708Stream_.on("done",this.trigger.bind(this,"done")))};L.prototype=new t,L.prototype.push=function(t){var e,i,n,a;if("sei_rbsp"===t.nalUnitType&&(e=P(t.escapedRBSP)).payload&&4===e.payloadType&&(i=181!==(a=e).payload[0]||(a.payload[1]<<8|a.payload[2])!=49||"GA94"!==String.fromCharCode(a.payload[3],a.payload[4],a.payload[5],a.payload[6])||3!==a.payload[7]?null:a.payload.subarray(8,a.payload.length-1))){if(t.dts<this.latestDts_){this.ignoreNextEqualDts_=!0;return}if(t.dts===this.latestDts_&&this.ignoreNextEqualDts_){this.numSameDts_--,this.numSameDts_||(this.ignoreNextEqualDts_=!1);return}n=I(t.pts,i),this.captionPackets_=this.captionPackets_.concat(n),this.latestDts_!==t.dts&&(this.numSameDts_=0),this.numSameDts_++,this.latestDts_=t.dts}}
1,L.prototype.flushCCStreams=function(t){this.ccStreams_.forEach(function(e){return"flush"===t?e.flush():e.partialFlush()},this)},L.prototype.flushStream=function(t){if(!this.captionPackets_.length){this.flushCCStreams(t);return}this.captionPackets_.forEach(function(t,e){t.presortIndex=e}),this.captionPackets_.sort(function(t,e){return t.pts===e.pts?t.presortIndex-e.presortIndex:t.pts-e.pts}),this.captionPackets_.forEach(function(t){t.type<2?this.dispatchCea608Packet(t):this.dispatchCea708Packet(t)},this),this.captionPackets_.length=0,this.flushCCStreams(t)},L.prototype.flush=function(){return this.flushStream("flush")},L.prototype.partialFlush=function(){return this.flushStream("partialFlush")},L.prototype.reset=function(){this.latestDts_=null,this.ignoreNextEqualDts_=!1,this.numSameDts_=0,this.activeCea608Channel_=[null,null],this.ccStreams_.forEach(function(t){t.reset()})},L.prototype.dispatchCea608Packet=function(t){this.setsTextOrXDSActive(t)?this.activeCea608Channel_[t.type]=null:this.setsChannel1Active(t)?this.activeCea608Channel_[t.type]=0:this.setsChannel2Active(t)&&(this.activeCea608Channel_[t.type]=1),null!==this.activeCea608Channel_[t.type]&&this.ccStreams_[(t.type<<1)+this.activeCea608Channel_[t.type]].push(t)},L.prototype.setsChannel1Active=function(t){return(30720&t.ccData)==4096},L.prototype.setsChannel2Active=function(t){return(30720&t.ccData)==6144},L.prototype.setsTextOrXDSActive=function(t){return(28928&t.ccData)==256||(30974&t.ccData)==4138||(30974&t.ccData)==6186},L.prototype.dispatchCea708Packet=function(t){this.parse708captions_&&this.cc708Stream_.push(t)};var O={127:9834,4128:32,4129:160,4133:8230,4138:352,4140:338,4144:9608,4145:8216,4146:8217,4147:8220,4148:8221,4149:8226,4153:8482,4154:353,4156:339,4157:8480,4159:376,4214:8539,4215:8540,4216:8541,4217:8542,4218:9168,4219:9124,4220:9123,4221:9135,4222:9126,4223:9121,4256:12600},M=function(t){var e=O[t]||t;return 4096&t&&t===e?"":String.fromCharCode(e)},E=function(t){return 32<=t&&t<=127||160<=t&&t<=255},x=function(t){this.windowNum=t,this.reset()};x.prototype.reset=function(){this.clearText(),this.pendingNewLine=!1,this.winAttr={},this.penAttr={},this.penLoc={},this.penColor={},this.visible=0,this.rowLock=0,this.columnLock=0,this.priority=0,this.relativePositioning=0,this.anchorVertical=0,this.anchorHorizontal=0,this.anchorPoint=0,this.rowCount=1,this.virtualRowCount=this.rowCount+1,this.columnCount=41,this.windowStyle=0,this.penStyle=0},x.prototype.getText=function(){return this.rows.join("\n")},x.prototype.clearText=function(){this.rows=[""],this.rowIdx=0},x.prototype.newLine=function(t){for(this.rows.length>=this.virtualRowCount&&"function"==typeof this.beforeRowOverflow&&this.beforeRowOverflow(t),this.rows.length>0&&(this.rows.push(""),this.rowIdx++);this.rows.length>this.virtualRowCount;)this.rows.shift(),this.rowIdx--},x.prototype.isEmpty=function(){return 0===this.rows.length||1===this.rows.length&&""===this.rows[0]},x.prototype.addText=function(t){this.rows[this.rowIdx]+=t},x.prototype.backspace=function(){if(!this.isEmpty()){var t=this.rows[this.rowIdx];this.rows[this.rowIdx]=t.substr(0,t.length-1)}};var R=function(t){this.serviceNum=t,this.text="",this.currentWindow=new x(-1),this.windows=[]};R.prototype.init=function(t,e){this.startPts=t;for(var i=0;i<8;i++)this.windows[i]=new x(i),"function"==typeof e&&(this.windows[i].beforeRowOverflow=e)},R.prototype.setCurrentWindow=function(t){this.currentWindow=this.windows[t]};var N=function t(){t.prototype.init.call(this);var e=this;this.current708Packet=null,this.services={},this.push=function(t){3===t.type?e.new708Packet():null===e.current708Packet&&e.new708Packet(),e.add708Bytes(t)}};N.prototype=new t,N.prototype.new708Packet=function(){null!==this.current708Packet&&this.push708Packet(),this.current708Packet={data:[],ptsVals:[]}},N.prototype.add708Bytes=function(t){var e=t.ccData;this.current708Packet.ptsVals.push(t.pts),this.current708Packet.data.push(e>>>8),this.current708Packet.data.push(255&e)},N.prototype.push708Packet=function(){var t=this.current708Packet,e=t.data,i=null,n=null,a=0,r=e[a++];for(t.seq=r>>6,t.sizeCode=63&r;a<e.length;a++)i=(r=e[a++])>>5,n=31&r,7===i&&n>0&&(i=r=e[a++]),this.pushServiceBlock(i,a,n),n>0&&(a+=n-1)}
1,N.prototype.pushServiceBlock=function(t,e,i){var n,a=e,r=this.current708Packet.data,s=this.services[t];for(s||(s=this.initService(t,a));a<e+i&&a<r.length;a++)E(n=r[a])?a=this.handleText(a,s):16===n?a=this.extendedCommands(a,s):128<=n&&n<=135?a=this.setCurrentWindow(a,s):152<=n&&n<=159?a=this.defineWindow(a,s):136===n?a=this.clearWindows(a,s):140===n?a=this.deleteWindows(a,s):137===n?a=this.displayWindows(a,s):138===n?a=this.hideWindows(a,s):139===n?a=this.toggleWindows(a,s):151===n?a=this.setWindowAttributes(a,s):144===n?a=this.setPenAttributes(a,s):145===n?a=this.setPenColor(a,s):146===n?a=this.setPenLocation(a,s):143===n?s=this.reset(a,s):8===n?s.currentWindow.backspace():12===n?s.currentWindow.clearText():13===n?s.currentWindow.pendingNewLine=!0:14===n?s.currentWindow.clearText():141===n&&a++},N.prototype.extendedCommands=function(t,e){return E(this.current708Packet.data[++t])&&(t=this.handleText(t,e,!0)),t},N.prototype.getPts=function(t){return this.current708Packet.ptsVals[Math.floor(t/2)]},N.prototype.initService=function(t,e){var i=this;return this.services[t]=new R(t),this.services[t].init(this.getPts(e),function(e){i.flushDisplayed(e,i.services[t])}),this.services[t]},N.prototype.handleText=function(t,e,i){var n=M((i?4096:0)|this.current708Packet.data[t]),a=e.currentWindow;return a.pendingNewLine&&!a.isEmpty()&&a.newLine(this.getPts(t)),a.pendingNewLine=!1,a.addText(n),t},N.prototype.setCurrentWindow=function(t,e){var i=this.current708Packet.data[t];return e.setCurrentWindow(7&i),t},N.prototype.defineWindow=function(t,e){var i=this.current708Packet.data,n=i[t],a=7&n;e.setCurrentWindow(a);var r=e.currentWindow;return n=i[++t],r.visible=(32&n)>>5,r.rowLock=(16&n)>>4,r.columnLock=(8&n)>>3,r.priority=7&n,n=i[++t],r.relativePositioning=(128&n)>>7,r.anchorVertical=127&n,n=i[++t],r.anchorHorizontal=n,n=i[++t],r.anchorPoint=(240&n)>>4,r.rowCount=15&n,n=i[++t],r.columnCount=63&n,n=i[++t],r.windowStyle=(56&n)>>3,r.penStyle=7&n,r.virtualRowCount=r.rowCount+1,t},N.prototype.setWindowAttributes=function(t,e){var i=this.current708Packet.data,n=i[t],a=e.currentWindow.winAttr;return n=i[++t],a.fillOpacity=(192&n)>>6,a.fillRed=(48&n)>>4,a.fillGreen=(12&n)>>2,a.fillBlue=3&n,n=i[++t],a.borderType=(192&n)>>6,a.borderRed=(48&n)>>4,a.borderGreen=(12&n)>>2,a.borderBlue=3&n,n=i[++t],a.borderType+=(128&n)>>5,a.wordWrap=(64&n)>>6,a.printDirection=(48&n)>>4,a.scrollDirection=(12&n)>>2,a.justify=3&n,n=i[++t],a.effectSpeed=(240&n)>>4,a.effectDirection=(12&n)>>2,a.displayEffect=3&n,t},N.prototype.flushDisplayed=function(t,e){for(var i=[],n=0;n<8;n++)e.windows[n].visible&&!e.windows[n].isEmpty()&&i.push(e.windows[n].getText());e.endPts=t,e.text=i.join("\n\n"),this.pushCaption(e),e.startPts=t},N.prototype.pushCaption=function(t){""!==t.text&&(this.trigger("data",{startPts:t.startPts,endPts:t.endPts,text:t.text,stream:"cc708_"+t.serviceNum}),t.text="",t.startPts=t.endPts)},N.prototype.displayWindows=function(t,e){var i=this.current708Packet.data[++t],n=this.getPts(t);this.flushDisplayed(n,e);for(var a=0;a<8;a++)i&1<<a&&(e.windows[a].visible=1);return t},N.prototype.hideWindows=function(t,e){var i=this.current708Packet.data[++t],n=this.getPts(t);this.flushDisplayed(n,e);for(var a=0;a<8;a++)i&1<<a&&(e.windows[a].visible=0);return t},N.prototype.toggleWindows=function(t,e){var i=this.current708Packet.data[++t],n=this.getPts(t);this.flushDisplayed(n,e);for(var a=0;a<8;a++)i&1<<a&&(e.windows[a].visible^=1);return t},N.prototype.clearWindows=function(t,e){var i=this.current708Packet.data[++t],n=this.getPts(t);this.flushDisplayed(n,e);for(var a=0;a<8;a++)i&1<<a&&e.windows[a].clearText();return t},N.prototype.deleteWindows=function(t,e){var i=this.current708Packet.data[++t],n=this.getPts(t);this.flushDisplayed(n,e);for(var a=0;a<8;a++)i&1<<a&&e.windows[a].reset();return t},N.prototype.setPenAttributes=function(t,e){var i=this.current708Packet.data,n=i[t],a=e.currentWindow.penAttr;return n=i[++t],a.textTag=(240&n)>>4,a.offset=(12&n)>>2,a.penSize=3&n,n=i[++t],a.italics=(128&n)>>7,a.underline=(64&n)>>6,a.edgeType=(56&n)>>3,a.fontStyle=7&n,t},N.prototype.setPenColor=function(t,e){var i=this.current708Packet.data,n=i[t],a=e.currentWindow.penColor;return n=i[++t],a.fgOpacity=(192&n)>>6,a.fgRed=(48&n)>>4,a.fgGreen=(12&n)>>2,a.fgBlue=3&n,n=i[++t],a.bgOpacity=(192&n)>>6,a.bgRed=(48&n)>>4,a.bgGreen=(12&n)>>2,a.bgBlue=3&n,n=i[++t],a.edgeRed=(48&n)>>4,a.edgeGreen=(12&n)>>2,a.edgeBlue=3&n,t},N.prototype.setPenLocation=function(t,e){var i=this.current708Packet.data,n=i[t],a=e.currentWindow.penLoc;return e.currentWindow.pendingNewLine=!0,n=i[++t],a.row=15&n,n=i[++t],a.column=63&n,t},N.prototype.reset=function(t,e){var i=this.getPts(t);return this.flushDisplayed(i,e),this.initService(e.serviceNum,t)};var F={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,304:174,305:176,306:189,307:191,308:8482,309:162,310:163,311:9834,312:224,313:160,314:232,315:226,316:234,317:238,318:244,319:251,544:193,545:201,546:211,547:218,548:220,549:252,550:8216,551:161,552:42,553:39,554:8212,555:169,556:8480,557:8226,558:8220,559:8221,560:192,561:194,562:199,563:200,564:202,565:203,566:235,567:206,568:207,569:239,570:212,571:217,572:249,573:219,574:171,575:187,800:195,801:227,802:205,803:204,804:236,805:210,806:242,807:213,808:245,809:123,810:125,811:92,812:94,813:95,814:124,815:126,816:196,817:228,818:214,819:246,820:223,821:165,822:164,823:9474,824:197,825:229,826:216,827:248,828:9484,829:9488,830:9492,831:9496},B=function(t){return null===t?"":String.fromCharCode(t=F[t]||t)},z=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],V=function(){for(var t=[],e=15;e--;)t.push("");return t},G=function t(e,i){t.prototype.init.call(this),this.field_=e||0,this.dataChannel_=i||0,this.name_="CC"+((this.field_<<1|this.dataChannel_)+1),this.setConstants(),this.reset(),this.push=function(t){var e,i,n,a,r;if((e=32639&t.ccData)===this.lastControlCode_){this.lastControlCode_=null;return}if((61440&e)==4096?this.lastControlCode_=e:e!==this.PADDING_&&(this.lastControlCode_=null),n=e>>>8,a=255&e,e!==this.PADDING_){if(e===this.RESUME_CAPTION_LOADING_)this.mode_="popOn";else if(e===this.END_OF_CAPTION_)this.mode_="popOn",this.clearFormatting(t.pts),this.flushDisplayed(t.pts),i=this.displayed_,this.displayed_=this.nonDisplayed_,this.nonDisplayed_=i,this.startPts_=t.pts;else if(e===this.ROLL_UP_2_ROWS_)this.rollUpRows_=2,this.setRollUp(t.pts);else if(e===this.ROLL_UP_3_ROWS_)this.rollUpRows_=3,this.setRollUp(t.pts);else if(e===this.ROLL_UP_4_ROWS_)this.rollUpRows_=4,this.setRollUp(t.pts);else if(e===this.CARRIAGE_RETURN_)this.clearFormatting(t.pts),this.flushDisplayed(t.pts),this.shiftRowsUp_(),this.startPts_=t.pts;else if(e===this.BACKSPACE_)"popOn"===this.mode_?this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1):this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1);else if(e===this.ERASE_DISPLAYED_MEMORY_)this.flushDisplayed(t.pts),this.displayed_=V();else if(e===this.ERASE_NON_DISPLAYED_MEMORY_)this.nonDisplayed_=V();else if(e===this.RESUME_DIRECT_CAPTIONING_)"paintOn"!==this.mode_&&(this.flushDisplayed(t.pts),this.displayed_=V()),this.mode_="paintOn",this.startPts_=t.pts;else if(this.isSpecialCharacter(n,a))r=B((n=(3&n)<<8)|a),this[this.mode_](t.pts,r),this.column_++;else if(this.isExtCharacter(n,a))"popOn"===this.mode_?this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1):this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1),r=B((n=(3&n)<<8)|a),this[this.mode_](t.pts,r),this.column_++;else if(this.isMidRowCode(n,a))this.clearFormatting(t.pts),this[this.mode_](t.pts," "),this.column_++,(14&a)==14&&this.addFormatting(t.pts,["i"]),(1&a)==1&&this.addFormatting(t.pts,["u"]);else if(this.isOffsetControlCode(n,a))this.column_+=3&a;else if(this.isPAC(n,a)){var s=z.indexOf(7968&e);"rollUp"===this.mode_&&(s-this.rollUpRows_+1<0&&(s=this.rollUpRows_-1),this.setRollUp(t.pts,s)),s!==this.row_&&(this.clearFormatting(t.pts),this.row_=s),1&a&&-1===this.formatting_.indexOf("u")&&this.addFormatting(t.pts,["u"]),(16&e)==16&&(this.column_=((14&e)>>1)*4),this.isColorPAC(a)&&(14&a)==14&&this.addFormatting(t.pts,["i"])}else this.isNormalChar(n)&&(0===a&&(a=null),r=B(n)+B(a),this[this.mode_](t.pts,r),this.column_+=r.length)}}};G.prototype=new t,G.prototype.flushDisplayed=function(t){var e=this.displayed_.map(function(t){try{return t.trim()}catch(t){return console.error("Skipping malformed caption."),""}}).join("\n").replace(/^\n+|\n+$/g,"");e.length&&this.trigger("data",{startPts:this.startPts_,endPts:t,text:e,stream:this.name_})},G.prototype.reset=function(){this.mode_="popOn",this.topRow_=0,this.startPts_=0,this.displayed_=V(),this.nonDisplayed_=V(),this.lastControlCode_=null,this.column_=0,this.row_=14,this.rollUpRows_=2,this.formatting_=[]},G.prototype.setConstants=function(){0===this.dataChannel_?(this.BASE_=16,this.EXT_=17,this.CONTROL_=(20|this.field_)<<8,this.OFFSET_=23):1===this.dataChannel_&&(this.BASE_=24,this.EXT_=25,this.CONTROL_=(28|this.field_)<<8,this.OFFSET_=31),this.PADDING_=0,this.RESUME_CAPTION_LOADING_=32|this.CONTROL_,this.END_OF_CAPTION_=47|this.CONTROL_,this.ROLL_UP_2_ROWS_=37|this.CONTROL_,this.ROLL_UP_3_ROWS_=38|this.CONTROL_,this.ROLL_UP_4_ROWS_=39|this.CONTROL_,this.CARRIAGE_RETURN_=45|this.CONTROL_,this.RESUME_DIRECT_CAPTIONING_=41|this.CONTROL_,this.BACKSPACE_=33|this.CONTROL_,this.ERASE_DISPLAYED_MEMORY_=44|this.CONTROL_,this.ERASE_NON_DISPLAYED_MEMORY_=46|this.CONTROL_},G.prototype.isSpecialCharacter=function(t,e){return t===this.EXT_&&e>=48&&e<=63},G.prototype.isExtCharacter=function(t,e){return(t===this.EXT_+1||t===this.EXT_+2)&&e>=32&&e<=63},G.prototype.isMidRowCode=function(t,e){return t===this.EXT_&&e>=32&&e<=47},G.prototype.isOffsetControlCode=function(t,e){return t===this.OFFSET_&&e>=33&&e<=35},G.prototype.isPAC=function(t,e){return t>=this.BASE_&&t<this.BASE_+8&&e>=64&&e<=127},G.prototype.isColorPAC=function(t){return t>=64&&t<=79||t>=96&&t<=127},G.prototype.isNormalChar=function(t){return t>=32&&t<=127},G.prototype.setRollUp=function(t,e){if("rollUp"!==this.mode_&&(this.row_=14,this.mode_="rollUp",this.flushDisplayed(t),this.nonDisplayed_=V(),this.displayed_=V()),void 0!==e&&e!==this.row_)for(var i=0;i<this.rollUpRows_;i++)this.displayed_[e-i]=this.displayed_[this.row_-i],this.displayed_[this.row_-i]="";void 0===e&&(e=this.row_),this.topRow_=e-this.rollUpRows_+1},G.prototype.addFormatting=function(t,e){this.formatting_=this.formatting_.concat(e);var i=e.reduce(function(t,e){return t+"<"+e+">"},"");this[this.mode_](t,i)},G.prototype.clearFormatting=function(t){if(this.formatting_.length){var e=this.formatting_.reverse().reduce(function(t,e){return t+"<
1/"+e+">"},"");this.formatting_=[],this[this.mode_](t,e)}},G.prototype.popOn=function(t,e){var i=this.nonDisplayed_[this.row_];i+=e,this.nonDisplayed_[this.row_]=i},G.prototype.rollUp=function(t,e){var i=this.displayed_[this.row_];i+=e,this.displayed_[this.row_]=i},G.prototype.shiftRowsUp_=function(){var t;for(t=0;t<this.topRow_;t++)this.displayed_[t]="";for(t=this.row_+1;t<15;t++)this.displayed_[t]="";for(t=this.topRow_;t<this.row_;t++)this.displayed_[t]=this.displayed_[t+1];this.displayed_[this.row_]=""},G.prototype.paintOn=function(t,e){var i=this.displayed_[this.row_];i+=e,this.displayed_[this.row_]=i};var W={H264_STREAM_TYPE:27,ADTS_STREAM_TYPE:15,METADATA_STREAM_TYPE:21},j="shared",Y=function(t,e){var i=1;for(t>e&&(i=-1);Math.abs(e-t)>4294967296;)t+=8589934592*i;return t},H=function t(e){var i,n;t.prototype.init.call(this),this.type_=e||j,this.push=function(t){(this.type_===j||t.type===this.type_)&&(void 0===n&&(n=t.dts),t.dts=Y(t.dts,n),t.pts=Y(t.pts,n),i=t.dts,this.trigger("data",t))},this.flush=function(){n=i,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.discontinuity=function(){n=void 0,i=void 0},this.reset=function(){this.discontinuity(),this.trigger("reset")}};H.prototype=new t;var q,K,X,Z,$,J,Q,tt,te,ti,tn,ta,tr,ts,to,td,th,tp,tu,tl,tc,tf,tm,tg,ty,tb,tv,tS,tT,tw,t_,tk,tU,tA,tD,tC,tP,tI,tL,tO,tM,tE,tx,tR,tN,tF,tB,tz,tV,tG,tW,tj,tY,tH,tq,tK,tX,tZ,t$,tJ=function(t,e,i){var n,a="";for(n=e;n<i;n++)a+="%"+("00"+t[n].toString(16)).slice(-2);return a},tQ=function(t,e,i){return decodeURIComponent(tJ(t,e,i))},t0=function(t){return t[0]<<21|t[1]<<14|t[2]<<7|t[3]},t1={TXXX:function(t){var e;if(3===t.data[0]){for(e=1;e<t.data.length;e++)if(0===t.data[e]){t.description=tQ(t.data,1,e),t.value=tQ(t.data,e+1,t.data.length).replace(/\0*$/,"");break}t.data=t.value}},WXXX:function(t){var e;if(3===t.data[0]){for(e=1;e<t.data.length;e++)if(0===t.data[e]){t.description=tQ(t.data,1,e),t.url=tQ(t.data,e+1,t.data.length);break}}},PRIV:function(t){var e;for(e=0;e<t.data.length;e++)if(0===t.data[e]){t.owner=unescape(tJ(t.data,0,e));break}t.privateData=t.data.subarray(e+1),t.data=t.privateData}};(t$=function(t){var e,i={debug:!!(t&&t.debug),descriptor:t&&t.descriptor},n=0,a=[],r=0;if(t$.prototype.init.call(this),this.dispatchType=W.METADATA_STREAM_TYPE.toString(16),i.descriptor)for(e=0;e<i.descriptor.length;e++)this.dispatchType+=("00"+i.descriptor[e].toString(16)).slice(-2);this.push=function(t){var e,s,o,d,h;if("timed-metadata"===t.type){if(t.dataAlignmentIndicator&&(r=0,a.length=0),0===a.length&&(t.data.length<10||73!==t.data[0]||68!==t.data[1]||51!==t.data[2])){i.debug&&console.log("Skipping unrecognized metadata packet");return}if(a.push(t),r+=t.data.byteLength,1===a.length&&(n=t0(t.data.subarray(6,10))+10),!(r<n)){for(h=0,e={data:new Uint8Array(n),frames:[],pts:a[0].pts,dts:a[0].dts};h<n;)e.data.set(a[0].data.subarray(0,n-h),h),h+=a[0].data.byteLength,r-=a[0].data.byteLength,a.shift();s=10,64&e.data[5]&&(s+=4+t0(e.data.subarray(10,14)),n-=t0(e.data.subarray(16,20)));do{if((o=t0(e.data.subarray(s+4,s+8)))<1)return console.log("Malformed ID3 frame encountered. Skipping metadata parsing.");if((d={id:String.fromCharCode(e.data[s],e.data[s+1],e.data[s+2],e.data[s+3]),data:e.data.subarray(s+10,s+o+10)}).key=d.id,t1[d.id]&&(t1[d.id](d),"com.apple.streaming.transportStreamTimestamp"===d.owner)){var p=d.data,u=(1&p[3])<<30|p[4]<<22|p[5]<<14|p[6]<<6|p[7]>>>2;u*=4,u+=3&p[7],d.timeStamp=u,void 0===e.pts&&void 0===e.dts&&(e.pts=d.timeStamp,e.dts=d.timeStamp),this.trigger("timestamp",d)}e.frames.push(d),s+=10+o}while(s<n);this.trigger("data",e)}}}}).prototype=new t;var t2=t$;(eI=function(){var t=new Uint8Array(188),e=0;eI.prototype.init.call(this),this.push=function(i){var n,a=0,r=188;for(e?((n=new Uint8Array(i.byteLength+e)).set(t.subarray(0,e)),n.set(i,e),e=0):n=i;r<n.byteLength;){if(71===n[a]&&71===n[r]){this.trigger("data",n.subarray(a,r)),a+=188,r+=188;continue}a++,r++}a<n.byteLength&&(t.set(n.subarray(a),0),e=n.byteLength-a)},this.flush=function(){188===e&&71===t[0]&&(this.trigger("data",t),e=0),this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.reset=function(){e=0,this.trigger("reset")}}).prototype=new t,(eL=function(){var t,e,i,n;eL.prototype.init.call(this),n=this,this.packetsWaitingForPmt=[],this.programMapTable=void 0,t=function(t,n){var a=0;
1n.payloadUnitStartIndicator&&(a+=t[a]+1),"pat"===n.type?e(t.subarray(a),n):i(t.subarray(a),n)},e=function(t,e){e.section_number=t[7],e.last_section_number=t[8],n.pmtPid=(31&t[10])<<8|t[11],e.pmtPid=n.pmtPid},i=function(t,e){var i,a;if(1&t[5]){for(n.programMapTable={video:null,audio:null,"timed-metadata":{}},i=3+((15&t[1])<<8|t[2])-4,a=12+((15&t[10])<<8|t[11]);a<i;){var r=t[a],s=(31&t[a+1])<<8|t[a+2];r===W.H264_STREAM_TYPE&&null===n.programMapTable.video?n.programMapTable.video=s:r===W.ADTS_STREAM_TYPE&&null===n.programMapTable.audio?n.programMapTable.audio=s:r===W.METADATA_STREAM_TYPE&&(n.programMapTable["timed-metadata"][s]=r),a+=((15&t[a+3])<<8|t[a+4])+5}e.programMapTable=n.programMapTable}},this.push=function(e){var i={},n=4;if(i.payloadUnitStartIndicator=!!(64&e[1]),i.pid=31&e[1],i.pid<<=8,i.pid|=e[2],(48&e[3])>>>4>1&&(n+=e[n]+1),0===i.pid)i.type="pat",t(e.subarray(n),i),this.trigger("data",i);else if(i.pid===this.pmtPid)for(i.type="pmt",t(e.subarray(n),i),this.trigger("data",i);this.packetsWaitingForPmt.length;)this.processPes_.apply(this,this.packetsWaitingForPmt.shift());else void 0===this.programMapTable?this.packetsWaitingForPmt.push([e,n,i]):this.processPes_(e,n,i)},this.processPes_=function(t,e,i){i.pid===this.programMapTable.video?i.streamType=W.H264_STREAM_TYPE:i.pid===this.programMapTable.audio?i.streamType=W.ADTS_STREAM_TYPE:i.streamType=this.programMapTable["timed-metadata"][i.pid],i.type="pes",i.data=t.subarray(e),this.trigger("data",i)}}).prototype=new t,eL.STREAM_TYPES={h264:27,adts:15},(eO=function(){var t,e=this,i={data:[],size:0},n={data:[],size:0},a={data:[],size:0},r=function(t,e){var i,n=t[0]<<16|t[1]<<8|t[2];e.data=new Uint8Array,1===n&&(e.packetLength=6+(t[4]<<8|t[5]),e.dataAlignmentIndicator=(4&t[6])!=0,192&(i=t[7])&&(e.pts=(14&t[9])<<27|(255&t[10])<<20|(254&t[11])<<12|(255&t[12])<<5|(254&t[13])>>>3,e.pts*=4,e.pts+=(6&t[13])>>>1,e.dts=e.pts,64&i&&(e.dts=(14&t[14])<<27|(255&t[15])<<20|(254&t[16])<<12|(255&t[17])<<5|(254&t[18])>>>3,e.dts*=4,e.dts+=(6&t[18])>>>1)),e.data=t.subarray(9+t[8]))},s=function(t,i,n){var a,s=new Uint8Array(t.size),o={type:i},d=0,h=0,p=!1;if(t.data.length&&!(t.size<9)){for(d=0,o.trackId=t.data[0].pid;d<t.data.length;d++)a=t.data[d],s.set(a.data,h),h+=a.data.byteLength;r(s,o),p="video"===i||o.packetLength<=t.size,(n||p)&&(t.size=0,t.data.length=0),p&&e.trigger("data",o)}};eO.prototype.init.call(this),this.push=function(r){({pat:function(){},pes:function(){var t,e;switch(r.streamType){case W.H264_STREAM_TYPE:t=i,e="video";break;case W.ADTS_STREAM_TYPE:t=n,e="audio";break;case W.METADATA_STREAM_TYPE:t=a,e="timed-metadata";break;default:return}r.payloadUnitStartIndicator&&s(t,e,!0),t.data.push(r),t.size+=r.data.byteLength},pmt:function(){var i={type:"metadata",tracks:[]};null!==(t=r.programMapTable).video&&i.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+t.video,codec:"avc",type:"video"}),null!==t.audio&&i.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+t.audio,codec:"adts",type:"audio"}),e.trigger("data",i)}})[r.type]()},this.reset=function(){i.size=0,i.data.length=0,n.size=0,n.data.length=0,this.trigger("reset")},this.flushStreams_=function(){s(i,"video"),s(n,"audio"),s(a,"timed-metadata")},this.flush=function(){this.flushStreams_(),this.trigger("done")}}).prototype=new t;var t8={PAT_PID:0,MP2T_PACKET_LENGTH:188,TransportPacketStream:eI,TransportParseStream:eL,ElementaryStream:eO,TimestampRolloverStream:H,CaptionStream:L,Cea608Stream:G,Cea708Stream:N,MetadataStream:t2};for(var t4 in W)W.hasOwnProperty(t4)&&(t8[t4]=W[t4]);var t6=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],t5=function(t,e){var i=t[e+6]<<21|t[e+7]<<14|t[e+8]<<7|t[e+9];return(i=i>=0?i:0,(16&t[e+5])>>4)?i+20:i+10},t3=function(t){return t[0]<<21|t[1]<<14|t[2]<<7|t[3]},t7=function(t,e,i){var n,a="";for(n=e;n<i;n++)a+="%"+("00"+t[n].toString(16)).slice(-2);return a},t9={isLikelyAacData:function(t){var e=function t(e,i){return e.length-i<10||73!==e[i]||68!==e[i+1]||51!==e[i+2]?i:(i+=t5(e,i),t(e,i))}(t,0);return t.length>=e+2&&(255&t[e])==255&&(240&t[e+1])==240&&(22&t[e+1])==16},parseId3TagSize:t5,parseAdtsSize:function(t,e){var i=(224&t[e+5])>>5,n=t[e+4]<<3;return 6144&t[e+3]|n|i},parseType:function(t,e){return 73===t[e]&&68===t[e+1]&&51===t[e+2]?"timed-metadata":!0&t[e]&&(240&t[e+1])==240?"audio":null},parseSampleRate:function(t){for(var e=0;e+5<t.length;){if(255!==t[e]||(246&t[e+1])!=240){e++;continue}return t6[(60&t[e+2])>>>2]}return null},parseAacTimestamp:function(t){var e,i,n;e=10,64&t[5]&&(e+=4+t3(t.subarray(10,14)));do{if((i=t3(t.subarray(e+4,e+8)))<1)break;if("PRIV"===String.fromCharCode(t[e],t[e+1],t[e+2],t[e+3])){n=t.subarray(e+10,e+i+10);for(var a=0;a<n.byteLength;a++)if(0===n[a]){if("com.apple.streaming.transportStreamTimestamp"===unescape(t7(n,0,a))){var r=n.subarray(a+1),s=(1&r[3])<<30|r[4]<<22|r[5]<<14|r[6]<<6|r[7]>>>2;return s*=4,s+=3&r[7]}break}}e+=10+i}while(e<t.byteLength);return null}};(eM=function(){var t=new Uint8Array,e=0;eM.prototype.init.call(this),this.setTimestamp=function(t){e=t},this.push=function(i){var n,a,r,s=0,o=0;for(t.length?(r=t.length,(t=new Uint8Array(i.byteLength+r)).set(t.subarray(0,r)),t.set(i,r)):t=i;t.length-o>=3;){if(73===t[o]&&68===t[o+1]&&51===t[o+2]){if(t.length-o<10||(s=t9.parseId3TagSize(t,o),o+s>t.length))break;n={type:"timed-metadata",data:t.subarray(o,o+s)},this.trigger("data",n),o+=s;continue}if((255&t[o])==255&&(240&t[o+1])==240){if(t.length-o<7||(s=t9.parseAdtsSize(t,o),o+s>t.length))break;a={type:"audio",data:t.subarray(o,o+s),pts:e,dts:e},this.trigger("data",a),o+=s;continue}o++}t=t.length-o>0?t.subarray(o):new Uint8Array},this.reset=function(){t=new Uint8Array,this.trigger("reset")},this.endTimeline=function(){t=new Uint8Array,this.trigger("endedtimeline")}}).prototype=new t;var et=eM,ee=["audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize"],ei=["width","height","profileIdc","levelIdc","profileCompatibility","sarRatio"],en=r.H264Stream,ea=t9.isLikelyAacData,er=e.ONE_SECOND_IN_TS,es=function(t,e){var i;if(t.length!==e.length)return!1;for(i=0;i<t.length;i++)if(t[i]!==e[i])return!1;return!0}
1,eo=function(t,e,i,n,a,r){return{start:{dts:t,pts:t+(i-e)},end:{dts:t+(n-e),pts:t+(a-i)},prependedContentDuration:r,baseMediaDecodeTime:t}};(ex=function(t,i){var n=[],a=0,r=0,s=0,d=1/0;i=i||{},ex.prototype.init.call(this),this.push=function(e){C.collectDtsInfo(t,e),t&&ee.forEach(function(i){t[i]=e[i]}),n.push(e)},this.setEarliestDts=function(t){r=t},this.setVideoBaseMediaDecodeTime=function(t){d=t},this.setAudioAppendStart=function(t){s=t},this.flush=function(){var h,p,u,l,c,f,m;if(0===n.length){this.trigger("done","AudioSegmentStream");return}h=k(n,t,r),t.baseMediaDecodeTime=C.calculateTrackBaseMediaDecodeTime(t,i.keepOriginalTimestamps),m=_(t,h,s,d),t.samples=U(h),u=o.mdat(A(h)),n=[],l=new Uint8Array((p=o.moof(a,[t])).byteLength+u.byteLength),a++,l.set(p),l.set(u,p.byteLength),C.clearDtsInfo(t),c=Math.ceil(1024*er/t.samplerate),h.length&&(f=h.length*c,this.trigger("segmentTimingInfo",eo(e.audioTsToVideoTs(t.baseMediaDecodeTime,t.samplerate),h[0].dts,h[0].pts,h[0].dts+f,h[0].pts+f,m||0)),this.trigger("timingInfo",{start:h[0].pts,end:h[0].pts+f})),this.trigger("data",{track:t,boxes:l}),this.trigger("done","AudioSegmentStream")},this.reset=function(){C.clearDtsInfo(t),n=[],this.trigger("reset")}}).prototype=new t,(eE=function(t,e){var i,n,a=0,r=[],s=[];e=e||{},eE.prototype.init.call(this),delete t.minPTS,this.gopCache_=[],this.push=function(e){C.collectDtsInfo(t,e),"seq_parameter_set_rbsp"!==e.nalUnitType||i||(i=e.config,t.sps=[e.data],ei.forEach(function(e){t[e]=i[e]},this)),"pic_parameter_set_rbsp"!==e.nalUnitType||n||(n=e.data,t.pps=[e.data]),r.push(e)},this.flush=function(){for(var i,n,d,h,p,u,l,c,f,m=0;r.length&&"access_unit_delimiter_rbsp"!==r[0].nalUnitType;)r.shift();if(0===r.length){this.resetStream_(),this.trigger("done","VideoSegmentStream");return}if(n=y.groupNalsIntoFrames(r),(h=y.groupFramesIntoGops(n))[0][0].keyFrame||((d=this.getGopForFusion_(r[0],t))?(m=d.duration,h.unshift(d),h.byteLength+=d.byteLength,h.nalCount+=d.nalCount,h.pts=d.pts,h.dts=d.dts,h.duration+=d.duration):h=y.extendFirstKeyFrame(h)),s.length){if(!(i=e.alignGopsAtEnd?this.alignGopsAtEnd_(h):this.alignGopsAtStart_(h))){this.gopCache_.unshift({gop:h.pop(),pps:t.pps,sps:t.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),r=[],this.resetStream_(),this.trigger("done","VideoSegmentStream");return}C.clearDtsInfo(t),h=i}C.collectDtsInfo(t,h),t.samples=y.generateSampleTable(h),u=o.mdat(y.concatenateNalData(h)),t.baseMediaDecodeTime=C.calculateTrackBaseMediaDecodeTime(t,e.keepOriginalTimestamps),this.trigger("processedGopsInfo",h.map(function(t){return{pts:t.pts,dts:t.dts,byteLength:t.byteLength}})),c=h[0],f=h[h.length-1],this.trigger("segmentTimingInfo",eo(t.baseMediaDecodeTime,c.dts,c.pts,f.dts+f.duration,f.pts+f.duration,m)),this.trigger("timingInfo",{start:h[0].pts,end:h[h.length-1].pts+h[h.length-1].duration}),this.gopCache_.unshift({gop:h.pop(),pps:t.pps,sps:t.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),r=[],this.trigger("baseMediaDecodeTime",t.baseMediaDecodeTime),this.trigger("timelineStartInfo",t.timelineStartInfo),l=new Uint8Array((p=o.moof(a,[t])).byteLength+u.byteLength),a++,l.set(p),l.set(u,p.byteLength),this.trigger("data",{track:t,boxes:l}),this.resetStream_(),this.trigger("done","VideoSegmentStream")},this.reset=function(){this.resetStream_(),r=[],this.gopCache_.length=0,s.length=0,this.trigger("reset")},this.resetStream_=function(){C.clearDtsInfo(t),i=void 0,n=void 0},this.getGopForFusion_=function(e){var i,n,a,r,s,o=1/0;for(s=0;s<this.gopCache_.length;s++)a=(r=this.gopCache_[s]).gop,t.pps&&es(t.pps[0],r.pps[0])&&t.sps&&es(t.sps[0],r.sps[0])&&!(a.dts<t.timelineStartInfo.dts)&&(i=e.dts-a.dts-a.duration)>=-1e4&&i<=45e3&&(!n||o>i)&&(n=r,o=i);return n?n.gop:null},this.alignGopsAtStart_=function(t){var e,i,n,a,r,o,d,h;for(r=t.byteLength,o=t.nalCount,d=t.duration,e=i=0;e<s.length&&i<t.length&&(n=s[e],a=t[i],n.pts!==a.pts);){if(a.pts>n.pts){e++;continue}i++,r-=a.byteLength,o-=a.nalCount,d-=a.duration}return 0===i?t:i===t.length?null:((h=t.slice(i)).byteLength=r,h.duration=d,h.nalCount=o,h.pts=h[0].pts,h.dts=h[0].dts,h)},this.alignGopsAtEnd_=function(t){for(e=s.length-1,i=t.length-1,r=null,o=!1;e>=0&&i>=0;){if(n=s[e],a=t[i],n.pts===a.pts){o=!0;break}if(n.pts>a.pts){e--;continue}e===s.length-1&&(r=i),i--}if(!o&&null===r)return null;if(0===(d=o?i:r))return t;
vendor: 7,621 bytes, line 1
1var e,i,n,a,r,o,d,h=t.slice(d),p=h.reduce(function(t,e){return t.byteLength+=e.byteLength,t.duration+=e.duration,t.nalCount+=e.nalCount,t},{byteLength:0,duration:0,nalCount:0});return h.byteLength=p.byteLength,h.duration=p.duration,h.nalCount=p.nalCount,h.pts=h[0].pts,h.dts=h[0].dts,h},this.alignGopsWith=function(t){s=t}}).prototype=new t,(eN=function(t,e){this.numberOfTracks=0,this.metadataStream=e,void 0!==(t=t||{}).remux?this.remuxTracks=!!t.remux:this.remuxTracks=!0,"boolean"==typeof t.keepOriginalTimestamps?this.keepOriginalTimestamps=t.keepOriginalTimestamps:this.keepOriginalTimestamps=!1,this.pendingTracks=[],this.videoTrack=null,this.pendingBoxes=[],this.pendingCaptions=[],this.pendingMetadata=[],this.pendingBytes=0,this.emittedTracks=0,eN.prototype.init.call(this),this.push=function(t){return t.text?this.pendingCaptions.push(t):t.frames?this.pendingMetadata.push(t):void(this.pendingTracks.push(t.track),this.pendingBytes+=t.boxes.byteLength,"video"===t.track.type&&(this.videoTrack=t.track,this.pendingBoxes.push(t.boxes)),"audio"===t.track.type&&(this.audioTrack=t.track,this.pendingBoxes.unshift(t.boxes)))}}).prototype=new t,eN.prototype.flush=function(t){var i,n,a,r,s=0,d={captions:[],captionStreams:{},metadata:[],info:{}},h=0;if(this.pendingTracks.length<this.numberOfTracks){if("VideoSegmentStream"!==t&&"AudioSegmentStream"!==t||this.remuxTracks)return;if(0===this.pendingTracks.length){this.emittedTracks++,this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0);return}}if(this.videoTrack?(h=this.videoTrack.timelineStartInfo.pts,ei.forEach(function(t){d.info[t]=this.videoTrack[t]},this)):this.audioTrack&&(h=this.audioTrack.timelineStartInfo.pts,ee.forEach(function(t){d.info[t]=this.audioTrack[t]},this)),this.videoTrack||this.audioTrack){for(1===this.pendingTracks.length?d.type=this.pendingTracks[0].type:d.type="combined",this.emittedTracks+=this.pendingTracks.length,a=o.initSegment(this.pendingTracks),d.initSegment=new Uint8Array(a.byteLength),d.initSegment.set(a),d.data=new Uint8Array(this.pendingBytes),r=0;r<this.pendingBoxes.length;r++)d.data.set(this.pendingBoxes[r],s),s+=this.pendingBoxes[r].byteLength;for(r=0;r<this.pendingCaptions.length;r++)(i=this.pendingCaptions[r]).startTime=e.metadataTsToSeconds(i.startPts,h,this.keepOriginalTimestamps),i.endTime=e.metadataTsToSeconds(i.endPts,h,this.keepOriginalTimestamps),d.captionStreams[i.stream]=!0,d.captions.push(i);for(r=0;r<this.pendingMetadata.length;r++)(n=this.pendingMetadata[r]).cueTime=e.metadataTsToSeconds(n.pts,h,this.keepOriginalTimestamps),d.metadata.push(n);for(d.metadata.dispatchType=this.metadataStream.dispatchType,this.pendingTracks.length=0,this.videoTrack=null,this.pendingBoxes.length=0,this.pendingCaptions.length=0,this.pendingBytes=0,this.pendingMetadata.length=0,this.trigger("data",d),r=0;r<d.captions.length;r++)i=d.captions[r],this.trigger("caption",i);for(r=0;r<d.metadata.length;r++)n=d.metadata[r],this.trigger("id3Frame",n)}this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0)},eN.prototype.setRemux=function(t){this.remuxTracks=t},(eR=function(t){var e,i,n=this,r=!0;eR.prototype.init.call(this),t=t||{},this.baseMediaDecodeTime=t.baseMediaDecodeTime||0,this.transmuxPipeline_={},this.setupAacPipeline=function(){var r={};this.transmuxPipeline_=r,r.type="aac",r.metadataStream=new t8.MetadataStream,r.aacStream=new et,r.audioTimestampRolloverStream=new t8.TimestampRolloverStream("audio"),r.timedMetadataTimestampRolloverStream=new t8.TimestampRolloverStream("timed-metadata"),r.adtsStream=new a,r.coalesceStream=new eN(t,r.metadataStream),r.headOfPipeline=r.aacStream,r.aacStream.pipe(r.audioTimestampRolloverStream).pipe(r.adtsStream),r.aacStream.pipe(r.timedMetadataTimestampRolloverStream).pipe(r.metadataStream).pipe(r.coalesceStream),r.metadataStream.on("timestamp",function(t){r.aacStream.setTimestamp(t.timeStamp)}),r.aacStream.on("data",function(a){"timed-metadata"!==a.type&&"audio"!==a.type||r.audioSegmentStream||(i=i||{timelineStartInfo:{baseMediaDecodeTime:n.baseMediaDecodeTime},codec:"adts",type:"audio"},r.coalesceStream.numberOfTracks++,r.audioSegmentStream=new ex(i,t),r.audioSegmentStream.on("timingInfo",n.trigger.bind(n,"audioTimingInfo")),r.adtsStream.pipe(r.audioSegmentStream).pipe(r.coalesceStream),n.trigger("trackinfo",{hasAudio:!!i,hasVideo:!!e}))}),r.coalesceStream.on("data",this.trigger.bind(this,"data")),r.coalesceStream.on("done",this.trigger.bind(this,"done"))},this.setupTsPipeline=function(){var r={};this.transmuxPipeline_=r,r.type="ts",r.metadataStream=new t8.MetadataStream,r.packetStream=new t8.TransportPacketStream,r.parseStream=new t8.TransportParseStream,r.elementaryStream=new t8.ElementaryStream,r.timestampRolloverStream=new t8.TimestampRolloverStream,r.adtsStream=new a,r.h264Stream=new en,r.captionStream=new t8.CaptionStream(t),r.coalesceStream=new eN(t,r.metadataStream),r.headOfPipeline=r.packetStream,r.packetStream.pipe(r.parseStream).pipe(r.elementaryStream).pipe(r.timestampRolloverStream),r.timestampRolloverStream.pipe(r.h264Stream),r.timestampRolloverStream.pipe(r.adtsStream),r.timestampRolloverStream.pipe(r.metadataStream).pipe(r.coalesceStream),r.h264Stream.pipe(r.captionStream).pipe(r.coalesceStream),r.elementaryStream.on("data",function(a){var s;if("metadata"===a.type){for(s=a.tracks.length;s--;)e||"video"!==a.tracks[s].type?i||"audio"!==a.tracks[s].type||((i=a.tracks[s]).timelineStartInfo.baseMediaDecodeTime=n.baseMediaDecodeTime):(e=a.tracks[s]).timelineStartInfo.baseMediaDecodeTime=n.baseMediaDecodeTime;e&&!r.videoSegmentStream&&(r.coalesceStream.numberOfTracks++,r.videoSegmentStream=new eE(e,t),r.videoSegmentStream.on("timelineStartInfo",function(e){i&&!t.keepOriginalTimestamps&&(i.timelineStartInfo=e,r.audioSegmentStream.setEarliestDts(e.dts-n.baseMediaDecodeTime))}),r.videoSegmentStream.on("processedGopsInfo",n.trigger.bind(n,"gopInfo")),r.videoSegmentStream.on("segmentTimingInfo",n.trigger.bind(n,"videoSegmentTimingInfo")),r.videoSegmentStream.on("baseMediaDecodeTime",function(t){i&&r.audioSegmentStream.setVideoBaseMediaDecodeTime(t)}),r.videoSegmentStream.on("timingInfo",n.trigger.bind(n,"videoTimingInfo")),r.h264Stream.pipe(r.videoSegmentStream).pipe(r.coalesceStream)),i&&!r.audioSegmentStream&&(r.coalesceStream.numberOfTracks++,r.audioSegmentStream=new ex(i,t),r.audioSegmentStream.on("timingInfo",n.trigger.bind(n,"audioTimingInfo")),r.audioSegmentStream.on("segmentTimingInfo",n.trigger.bind(n,"audioSegmentTimingInfo")),r.adtsStream.pipe(r.audioSegmentStream).pipe(r.coalesceStream)),n.trigger("trackinfo",{hasAudio:!!i,hasVideo:!!e})}}),r.coalesceStream.on("data",this.trigger.bind(this,"data")),r.coalesceStream.on("id3Frame",function(t){t.dispatchType=r.metadataStream.dispatchType,n.trigger("id3Frame",t)}),r.coalesceStream.on("caption",this.trigger.bind(this,"caption")),r.coalesceStream.on("done",this.trigger.bind(this,"done"))},this.setBaseMediaDecodeTime=function(n){var a=this.transmuxPipeline_;t.keepOriginalTimestamps||(this.baseMediaDecodeTime=n),i&&(i.timelineStartInfo.dts=void 0,i.timelineStartInfo.pts=void 0,C.clearDtsInfo(i),a.audioTimestampRolloverStream&&a.audioTimestampRolloverStream.discontinuity()),e&&(a.videoSegmentStream&&(a.videoSegmentStream.gopCache_=[]),e.timelineStartInfo.dts=void 0,e.timelineStartInfo.pts=void 0,C.clearDtsInfo(e),a.captionStream.reset()),a.timestampRolloverStream&&a.timestampRolloverStream.discontinuity()},this.setAudioAppendStart=function(t){i&&this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(t)},this.setRemux=function(e){var i=this.transmuxPipeline_;
1t.remux=e,i&&i.coalesceStream&&i.coalesceStream.setRemux(e)},this.alignGopsWith=function(t){e&&this.transmuxPipeline_.videoSegmentStream&&this.transmuxPipeline_.videoSegmentStream.alignGopsWith(t)},this.push=function(t){if(r){var e=ea(t);e&&"aac"!==this.transmuxPipeline_.type?this.setupAacPipeline():e||"ts"===this.transmuxPipeline_.type||this.setupTsPipeline(),r=!1}this.transmuxPipeline_.headOfPipeline.push(t)},this.flush=function(){r=!0,this.transmuxPipeline_.headOfPipeline.flush()},this.endTimeline=function(){this.transmuxPipeline_.headOfPipeline.endTimeline()},this.reset=function(){this.transmuxPipeline_.headOfPipeline&&this.transmuxPipeline_.headOfPipeline.reset()},this.resetCaptions=function(){this.transmuxPipeline_.captionStream&&this.transmuxPipeline_.captionStream.reset()}}).prototype=new t;var ed=eR,eh=eE,ep=ex,eu=function(t){for(var e,i,n=t.byteLength,a=[],r=1;r<n-2;)0===t[r]&&0===t[r+1]&&3===t[r+2]?(a.push(r+2),r+=2):r++;if(0===a.length)return t;i=new Uint8Array(e=n-a.length);var s=0;for(r=0;r<e;s++,r++)s===a[0]&&(s++,a.shift()),i[r]=t[s];return i},el=function(t,e){for(var i=t,n=0;n<e.length;n++){var a=e[n];if(i<a.size)return a;i-=a.size}return null},ec=function(t,e,i){var n,a,r,s,o=new DataView(t.buffer,t.byteOffset,t.byteLength),d=[];for(a=0;a+4<t.length;a+=r)if(r=o.getUint32(a),a+=4,!(r<=0))switch(31&t[a]){case 6:var h=t.subarray(a+1,a+1+r),p=el(a,e);if(n={nalUnitType:"sei_rbsp",size:r,data:h,escapedRBSP:eu(h),trackId:i},p)n.pts=p.pts,n.dts=p.dts,s=p;else if(s)n.pts=s.pts,n.dts=s.dts;else{console.log("We've encountered a nal unit without data. See mux.js#233.");break}d.push(n)}return d},ef=function(t,e,i){var n=e,a=i.defaultSampleDuration||0,r=i.defaultSampleSize||0,s=i.trackId,o=[];return t.forEach(function(t){var e=c(t).samples;e.forEach(function(t){void 0===t.duration&&(t.duration=a),void 0===t.size&&(t.size=r),t.trackId=s,t.dts=n,void 0===t.compositionTimeOffset&&(t.compositionTimeOffset=0),t.pts=n+t.compositionTimeOffset,n+=t.duration}),o=o.concat(e)}),o},em=function(t,e){var i=p(t,["moof","traf"]),n=p(t,["mdat"]),a={},r=[];return n.forEach(function(t,e){var n=i[e];r.push({mdat:t,traf:n})}),r.forEach(function(t){var i,n=t.mdat,r=t.traf,s=u(p(r,["tfhd"])[0]),o=s.trackId,d=p(r,["tfdt"]),h=d.length>0?f(d[0]).baseMediaDecodeTime:0,l=p(r,["trun"]);e===o&&l.length>0&&(i=ec(n,ef(l,h,s),o),a[o]||(a[o]=[]),a[o]=a[o].concat(i))}),a};(eF=function(t,e){var i,n=0,a=16384,r=function(t,e){var i,n=t.position+e;n<t.bytes.byteLength||((i=new Uint8Array(2*n)).set(t.bytes.subarray(0,t.position),0),t.bytes=i,t.view=new DataView(t.bytes.buffer))},s=eF.widthBytes||new Uint8Array(5),o=eF.heightBytes||new Uint8Array(6),d=eF.videocodecidBytes||new Uint8Array(12);if(!eF.widthBytes){for(i=0;i<5;i++)s[i]="width".charCodeAt(i);for(i=0;i<6;i++)o[i]="height".charCodeAt(i);for(i=0;i<12;i++)d[i]="videocodecid".charCodeAt(i);eF.widthBytes=s,eF.heightBytes=o,eF.videocodecidBytes=d}switch(this.keyFrame=!1,t){case eF.VIDEO_TAG:this.length=16,a*=6;break;case eF.AUDIO_TAG:this.length=13,this.keyFrame=!0;break;case eF.METADATA_TAG:this.length=29,this.keyFrame=!0;break;default:throw Error("Unknown FLV tag type")}this.bytes=new Uint8Array(a),this.view=new DataView(this.bytes.buffer),this.bytes[0]=t,this.position=this.length,this.keyFrame=e,this.pts=0,this.dts=0,this.writeBytes=function(t,e,i){var n,a=e||0;n=a+(i=i||t.byteLength),r(this,i),this.bytes.set(t.subarray(a,n),this.position),this.position+=i,this.length=Math.max(this.length,this.position)},this.writeByte=function(t){r(this,1),this.bytes[this.position]=t,this.position++,this.length=Math.max(this.length,this.position)},this.writeShort=function(t){r(this,2),this.view.setUint16(this.position,t),this.position+=2,this.length=Math.max(this.length,this.position)},this.negIndex=function(t){return this.bytes[this.length-t]},this.nalUnitSize=function(){return 0===n?0:this.length-(n+4)},this.startNalUnit=function(){if(n>0)throw Error("Attempted to create new NAL wihout closing the old one");n=this.length,this.length+=4,this.position=this.length},this.endNalUnit=function(t){var e,i;this.length===n+4?this.length-=4:n>0&&(e=n+4,i=this.length-e,this.position=n,this.view.setUint32(this.position,i),this.position=this.length,t&&t.push(this.bytes.subarray(e,e+i))),n=0},this.writeMetaDataDouble=function(t,e){var i;if(r(this,2+t.length+9),this.view.setUint16(this.position,t.length),this.position+=2,"width"===t)this.bytes.set(s,this.position),this.position+=5;else if("height"===t)this.bytes.set(o,this.position),this.position+=6;else if("videocodecid"===t)this.bytes.set(d,this.position),this.position+=12;else for(i=0;i<t.length;i++)this.bytes[this.position]=t.charCodeAt(i),this.position++;this.position++,this.view.setFloat64(this.position,e),this.position+=8,this.length=Math.max(this.length,this.position),++n},this.writeMetaDataBoolean=function(t,e){var i;for(r(this,2),this.view.setUint16(this.position,t.length),this.position+=2,i=0;i<t.length;i++)r(this,1),this.bytes[this.position]=t.charCodeAt(i),this.position++;r(this,2),this.view.setUint8(this.position,1),this.position++,this.view.setUint8(this.position,e?1:0),this.position++,this.length=Math.max(this.length,this.position),++n},this.finalize=function(){var t,i;switch(this.bytes[0]){case eF.VIDEO_TAG:this.bytes[11]=(this.keyFrame||e?16:32)|7,this.bytes[12]=e?0:1,t=this.pts-this.dts,this.bytes[13]=(16711680&t)>>>16,this.bytes[14]=(65280&t)>>>8,this.bytes[15]=(255&t)>>>0;break;case eF.AUDIO_TAG:this.bytes[11]=175,this.bytes[12]=e?0:1;break;case eF.METADATA_TAG:this.position=11,this.view.setUint8(this.position,2),this.position++,this.view.setUint16(this.position,10),this.position+=2,this.bytes.set([111,
1110,77,101,116,97,68,97,116,97],this.position),this.position+=10,this.bytes[this.position]=8,this.position++,this.view.setUint32(this.position,n),this.position=this.length,this.bytes.set([0,0,9],this.position),this.position+=3,this.length=this.position}return i=this.length-11,this.bytes[1]=(16711680&i)>>>16,this.bytes[2]=(65280&i)>>>8,this.bytes[3]=(255&i)>>>0,this.bytes[4]=(16711680&this.dts)>>>16,this.bytes[5]=(65280&this.dts)>>>8,this.bytes[6]=(255&this.dts)>>>0,this.bytes[7]=(4278190080&this.dts)>>>24,this.bytes[8]=0,this.bytes[9]=0,this.bytes[10]=0,r(this,4),this.view.setUint32(this.length,this.length),this.length+=4,this.position+=4,this.bytes=this.bytes.subarray(0,this.length),this.frameTime=eF.frameTime(this.bytes),this}}).AUDIO_TAG=8,eF.VIDEO_TAG=9,eF.METADATA_TAG=18,eF.isAudioFrame=function(t){return eF.AUDIO_TAG===t[0]},eF.isVideoFrame=function(t){return eF.VIDEO_TAG===t[0]},eF.isMetaData=function(t){return eF.METADATA_TAG===t[0]},eF.isKeyFrame=function(t){return eF.isVideoFrame(t)?23===t[11]:!!(eF.isAudioFrame(t)||eF.isMetaData(t))},eF.frameTime=function(t){var e=t[4]<<16;return e|=t[5]<<8,e|=t[6]<<0,e|=t[7]<<24};var eg=eF,ey=function t(e){this.numberOfTracks=0,this.metadataStream=e.metadataStream,this.videoTags=[],this.audioTags=[],this.videoTrack=null,this.audioTrack=null,this.pendingCaptions=[],this.pendingMetadata=[],this.pendingTracks=0,this.processedTracks=0,t.prototype.init.call(this),this.push=function(t){return t.text?this.pendingCaptions.push(t):t.frames?this.pendingMetadata.push(t):void("video"===t.track.type&&(this.videoTrack=t.track,this.videoTags=t.tags,this.pendingTracks++),"audio"===t.track.type&&(this.audioTrack=t.track,this.audioTags=t.tags,this.pendingTracks++))}};ey.prototype=new t,ey.prototype.flush=function(t){var e,i,n,a,r={tags:{},captions:[],captionStreams:{},metadata:[]};if((!(this.pendingTracks<this.numberOfTracks)||("VideoSegmentStream"===t||"AudioSegmentStream"===t)&&(0!==this.pendingTracks||(this.processedTracks++,!(this.processedTracks<this.numberOfTracks))))&&(this.processedTracks+=this.pendingTracks,this.pendingTracks=0,!(this.processedTracks<this.numberOfTracks))){for(this.videoTrack?a=this.videoTrack.timelineStartInfo.pts:this.audioTrack&&(a=this.audioTrack.timelineStartInfo.pts),r.tags.videoTags=this.videoTags,r.tags.audioTags=this.audioTags,n=0;n<this.pendingCaptions.length;n++)(i=this.pendingCaptions[n]).startTime=i.startPts-a,i.startTime/=9e4,i.endTime=i.endPts-a,i.endTime/=9e4,r.captionStreams[i.stream]=!0,r.captions.push(i);for(n=0;n<this.pendingMetadata.length;n++)(e=this.pendingMetadata[n]).cueTime=e.pts-a,e.cueTime/=9e4,r.metadata.push(e);r.metadata.dispatchType=this.metadataStream.dispatchType,this.videoTrack=null,this.audioTrack=null,this.videoTags=[],this.audioTags=[],this.pendingCaptions.length=0,this.pendingMetadata.length=0,this.pendingTracks=0,this.processedTracks=0,this.trigger("data",r),this.trigger("done")}};var eb=function(){var t=this;this.list=[],this.push=function(t){this.list.push({bytes:t.bytes,dts:t.dts,pts:t.pts,keyFrame:t.keyFrame,metaDataTag:t.metaDataTag})},Object.defineProperty(this,"length",{get:function(){return t.list.length}})},ev=r.H264Stream;eG=function(t,e){"number"==typeof e.pts&&(void 0===t.timelineStartInfo.pts?t.timelineStartInfo.pts=e.pts:t.timelineStartInfo.pts=Math.min(t.timelineStartInfo.pts,e.pts)),"number"==typeof e.dts&&(void 0===t.timelineStartInfo.dts?t.timelineStartInfo.dts=e.dts:t.timelineStartInfo.dts=Math.min(t.timelineStartInfo.dts,e.dts))},eW=function(t,e){var i=new eg(eg.METADATA_TAG);return i.dts=e,i.pts=e,i.writeMetaDataDouble("videocodecid",7),i.writeMetaDataDouble("width",t.width),i.writeMetaDataDouble("height",t.height),i},ej=function(t,e){var i,n=new eg(eg.VIDEO_TAG,!0);for(n.dts=e,n.pts=e,n.writeByte(1),n.writeByte(t.profileIdc),n.writeByte(t.profileCompatibility),n.writeByte(t.levelIdc),n.writeByte(255),n.writeByte(225),n.writeShort(t.sps[0].length),n.writeBytes(t.sps[0]),n.writeByte(t.pps.length),i=0;i<t.pps.length;++i)n.writeShort(t.pps[i].length),n.writeBytes(t.pps[i]);return n},(eV=function(t){var e,i=[],n=[];eV.prototype.init.call(this),this.push=function(e){eG(t,e),t&&(t.audioobjecttype=e.audioobjecttype,t.channelcount=e.channelcount,t.samplerate=e.s
vendor: 4,402 bytes, line 1
1amplerate,t.samplingfrequencyindex=e.samplingfrequencyindex,t.samplesize=e.samplesize,t.extraData=t.audioobjecttype<<11|t.samplingfrequencyindex<<7|t.channelcount<<3),e.pts=Math.round(e.pts/90),e.dts=Math.round(e.dts/90),i.push(e)},this.flush=function(){var a,r,s,o=new eb;if(0===i.length){this.trigger("done","AudioSegmentStream");return}for(s=-1/0;i.length;)a=i.shift(),n.length&&a.pts>=n[0]&&(s=n.shift(),this.writeMetaDataTags(o,s)),(t.extraData!==e||a.pts-s>=1e3)&&(this.writeMetaDataTags(o,a.pts),e=t.extraData,s=a.pts),(r=new eg(eg.AUDIO_TAG)).pts=a.pts,r.dts=a.dts,r.writeBytes(a.data),o.push(r.finalize());n.length=0,e=null,this.trigger("data",{track:t,tags:o.list}),this.trigger("done","AudioSegmentStream")},this.writeMetaDataTags=function(e,i){var n;(n=new eg(eg.METADATA_TAG)).pts=i,n.dts=i,n.writeMetaDataDouble("audiocodecid",10),n.writeMetaDataBoolean("stereo",2===t.channelcount),n.writeMetaDataDouble("audiosamplerate",t.samplerate),n.writeMetaDataDouble("audiosamplesize",16),e.push(n.finalize()),(n=new eg(eg.AUDIO_TAG,!0)).pts=i,n.dts=i,n.view.setUint16(n.position,t.extraData),n.position+=2,n.length=Math.max(n.length,n.position),e.push(n.finalize())},this.onVideoKeyFrame=function(t){n.push(t)}}).prototype=new t,(ez=function(t){var e,i,n=[];ez.prototype.init.call(this),this.finishFrame=function(n,a){if(a){if(e&&t&&t.newMetadata&&(a.keyFrame||0===n.length)){var r=eW(e,a.dts).finalize(),s=ej(t,a.dts).finalize();r.metaDataTag=s.metaDataTag=!0,n.push(r),n.push(s),t.newMetadata=!1,this.trigger("keyframe",a.dts)}a.endNalUnit(),n.push(a.finalize()),i=null}},this.push=function(e){eG(t,e),e.pts=Math.round(e.pts/90),e.dts=Math.round(e.dts/90),n.push(e)},this.flush=function(){for(var a,r=new eb;n.length&&"access_unit_delimiter_rbsp"!==n[0].nalUnitType;)n.shift();if(0===n.length){this.trigger("done","VideoSegmentStream");return}for(;n.length;)"seq_parameter_set_rbsp"===(a=n.shift()).nalUnitType?(t.newMetadata=!0,e=a.config,t.width=e.width,t.height=e.height,t.sps=[a.data],t.profileIdc=e.profileIdc,t.levelIdc=e.levelIdc,t.profileCompatibility=e.profileCompatibility,i.endNalUnit()):"pic_parameter_set_rbsp"===a.nalUnitType?(t.newMetadata=!0,t.pps=[a.data],i.endNalUnit()):"access_unit_delimiter_rbsp"===a.nalUnitType?(i&&this.finishFrame(r,i),(i=new eg(eg.VIDEO_TAG)).pts=a.pts,i.dts=a.dts):("slice_layer_without_partitioning_rbsp_idr"===a.nalUnitType&&(i.keyFrame=!0),i.endNalUnit()),i.startNalUnit(),i.writeBytes(a.data);i&&this.finishFrame(r,i),this.trigger("data",{track:t,tags:r.list}),this.trigger("done","VideoSegmentStream")}}).prototype=new t,(eB=function(t){var e,i,n,r,s,o,d,h,p,u,l,c,f=this;eB.prototype.init.call(this),t=t||{},this.metadataStream=new t8.MetadataStream,t.metadataStream=this.metadataStream,e=new t8.TransportPacketStream,i=new t8.TransportParseStream,n=new t8.ElementaryStream,r=new t8.TimestampRolloverStream("video"),s=new t8.TimestampRolloverStream("audio"),o=new t8.TimestampRolloverStream("timed-metadata"),d=new a,h=new ev,c=new ey(t),e.pipe(i).pipe(n),n.pipe(r).pipe(h),n.pipe(s).pipe(d),n.pipe(o).pipe(this.metadataStream).pipe(c),l=new t8.CaptionStream(t),h.pipe(l).pipe(c),n.on("data",function(t){var e,i,n;if("metadata"===t.type){for(e=t.tracks.length;e--;)"video"===t.tracks[e].type?i=t.tracks[e]:"audio"===t.tracks[e].type&&(n=t.tracks[e]);i&&!p&&(c.numberOfTracks++,p=new ez(i),h.pipe(p).pipe(c)),n&&!u&&(c.numberOfTracks++,u=new eV(n),d.pipe(u).pipe(c),p&&p.on("keyframe",u.onVideoKeyFrame))}}),this.push=function(t){e.push(t)},this.flush=function(){e.flush()},this.resetCaptions=function(){l.reset()},c.on("data",function(t){f.trigger("data",t)}),c.on("done",function(){f.trigger("done")})}).prototype=new t;var eS=eB,eT=e.ONE_SECOND_IN_TS,ew=function t(e,i){var n=[],a=0,r=0,s=0,d=1/0,h=null,p=null;i=i||{},t.prototype.init.call(this),this.push=function(t){C.collectDtsInfo(e,t),e&&ee.forEach(function(i){e[i]=t[i]}),n.push(t)},this.setEarliestDts=function(t){r=t},this.setVideoBaseMediaDecodeTime=function(t){d=t},this.setAudioAppendStart=function(t){s=t},this.processFrames_=function(){var t,u,l,c,f;0!==n.length&&0!==(t=k(n,e,r)).length&&(e.baseMediaDecodeTime=C.calculateTrackBaseMediaDecodeTime(e,i.keepOriginalTimestamps),_(e,t,s,d),e.samples=U(t),l=o.mdat(A(t)),n=[],u=o.moof(a,[e]),a++,e.initSegment=o.initSegment([e]),(c=new Uint8Array(u.byteLength+l.byteLength)).set(u),c.set(l,u.byteLength),C.clearDtsInfo(e),null===h&&
1(p=h=t[0].pts),p+=t.length*(1024*eT/e.samplerate),f={start:h},this.trigger("timingInfo",f),this.trigger("data",{track:e,boxes:c}))},this.flush=function(){this.processFrames_(),this.trigger("timingInfo",{start:h,end:p}),this.resetTiming_(),this.trigger("done","AudioSegmentStream")},this.partialFlush=function(){this.processFrames_(),this.trigger("partialdone","AudioSegmentStream")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline","AudioSegmentStream")},this.resetTiming_=function(){C.clearDtsInfo(e),h=null,p=null},this.reset=function(){this.resetTiming_(),n=[],this.trigger("reset")}};ew.prototype=new t;var e_=function t(e,i){var n,a,r,s=0,d=[],h=[],p=null,u=null,l=!0;i=i||{},t.prototype.init.call(this),this.push=function(t){C.collectDtsInfo(e,t),void 0===e.timelineStartInfo.dts&&(e.timelineStartInfo.dts=t.dts),"seq_parameter_set_rbsp"!==t.nalUnitType||n||(n=t.config,e.sps=[t.data],ei.forEach(function(t){e[t]=n[t]},this)),"pic_parameter_set_rbsp"!==t.nalUnitType||a||(a=t.data,e.pps=[t.data]),d.push(t)},this.processNals_=function(t){for(d=h.concat(d);d.length&&"access_unit_delimiter_rbsp"!==d[0].nalUnitType;)d.shift();if(0!==d.length){var n,a=y.groupNalsIntoFrames(d);if(a.length){if(h=a[a.length-1],t&&(a.pop(),a.duration-=h.duration,a.nalCount-=h.length,a.byteLength-=h.byteLength),!a.length){d=[];return}if(this.trigger("timelineStartInfo",e.timelineStartInfo),l){if(!(r=y.groupFramesIntoGops(a))[0][0].keyFrame){if(!(r=y.extendFirstKeyFrame(r))[0][0].keyFrame){d=[].concat.apply([],a).concat(h),h=[];return}(a=[].concat.apply([],r)).duration=r.duration}l=!1}for(null===p&&(u=p=a[0].pts),u+=a.duration,this.trigger("timingInfo",{start:p,end:u}),n=0;n<a.length;n++){var c=a[n];e.samples=y.generateSampleTableForFrame(c);var f=o.mdat(y.concatenateNalDataForFrame(c));C.clearDtsInfo(e),C.collectDtsInfo(e,c),e.baseMediaDecodeTime=C.calculateTrackBaseMediaDecodeTime(e,i.keepOriginalTimestamps);var m=o.moof(s,[e]);s++,e.initSegment=o.initSegment([e]);var g=new Uint8Array(m.byteLength+f.byteLength);g.set(m),g.set(f,m.byteLength),this.trigger("data",{track:e,boxes:g,sequence:s,videoFrameDts:c.dts,videoFramePts:c.pts})}d=[]}}},this.resetTimingAndConfig_=function(){n=void 0,a=void 0,p=null,u=null},this.partialFlush=function(){this.processNals_(!0),this.trigger("partialdone","VideoSegmentStream")},this.flush=function(){this.processNals_(!1),this.resetTimingAndConfig_(),this.trigger("done","VideoSegmentStream")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline","VideoSegmentStream")},this.reset=function(){this.resetTimingAndConfig_(),h=[],d=[],l=!0,this.trigger("reset")}};e_.prototype=new t;var ek=t9.isLikelyAacData,eU=function(e){return e.prototype=new t,e.prototype.init.call(e),e},eA=function(t){var i={type:"ts",tracks:{audio:null,video:null},packet:new t8.TransportPacketStream,parse:new t8.TransportParseStream,elementary:new t8.ElementaryStream,timestampRollover:new t8.TimestampRolloverStream,adts:new s.Adts,h264:new s.h264.H264Stream,captionStream:new t8.CaptionStream(t),metadataStream:new t8.MetadataStream};return i.headOfPipeline=i.packet,i.packet.pipe(i.parse).pipe(i.elementary).pipe(i.timestampRollover),i.timestampRollover.pipe(i.h264),i.h264.pipe(i.captionStream),i.timestampRollover.pipe(i.metadataStream),i.timestampRollover.pipe(i.adts),i.elementary.on("data",function(e){if("metadata"===e.type){for(var n=0;n<e.tracks.length;n++)i.tracks[e.tracks[n].type]||(i.tracks[e.tracks[n].type]=e.tracks[n],i.tracks[e.tracks[n].type].timelineStartInfo.baseMediaDecodeTime=t.baseMediaDecodeTime);i.tracks.video&&!i.videoSegmentStream&&(i.videoSegmentStream=new e_(i.tracks.video,t),i.videoSegmentStream.on("timelineStartInfo",function(e){i.tracks.audio&&!t.keepOriginalTimestamps&&i.audioSegmentStream.setEarliestDts(e.dts-t.baseMediaDecodeTime)}),i.videoSegmentStream.on("timingInfo",i.trigger.bind(i,"videoTimingInfo")),i.videoSegmentStream.on("data",function(t){i.trigger("data",{type:"video",data:t})}),i.videoSegmentStream.on("done",i.trigger.bind(i,"done")),i.videoSegmentStream.on("partialdone",i.trigger.bind(i,"partialdone")),i.videoSegmentStream.on("endedtimeline",i.trigger.bind(i,"endedtimeline")),i.h264.pipe(i.videoSegmentStream)),i.tracks.audio&&!i.audioSegmentStream&&(i.audioSegmentStream=new ew(i.tracks.audio,t),i.audioSegmentStream.on("data",function(t){i.trigger("data",{type:"audio",data:t})}),i.audioSegmentStream.on("done",i.trigger.bind(i,"done")),i.audioSegmentStream.on("partialdone",i.trigger.bind(i,"partialdone")),i.audioSegmentStream.on("endedtimeline",i.trigger.bind(i,"endedtimeline")),i.audioSegmentStream.on("timingInfo",i.trigger.bind(i,"audioTimingInfo")),i.adts.pipe(i.audioSegmentStream)),i.trigger("trackinfo",{hasAudio:!!i.tracks.audio,hasVideo:!!i.tracks.video})}}),i.captionStream.on("data",function(n){var a;a=i.tracks.video&&i.tracks.video.timelineStartInfo.pts||0,n.startTime=e.metadataTsToSeconds(n.startPts,a,t.keepOriginalTimestamps),n.endTime=e.metadataTsToSeconds(n.endPts,a,t.keepOriginalTimestamps),i.trigger("caption",n)}),(i=eU(i)).metadataStream.on("data",i.trigger.bind(i,"id3Frame")),i},eD=function(t){var e={type:"aac",tracks:{audio:null},metadataStream:new t8.MetadataStream,aacStream:new et,audioRollover:new t8.TimestampRolloverStream("audio"),timedMetadataRollover:new t8.TimestampRolloverStream("timed-metadata"),adtsStream:new a(!0)};return e.headOfPipeline=e.aacStream,e.aacStream.pipe(e.audioRollover).pipe(e.adtsStream),e.aacStream.pipe(e.timedMetadataRollover).pipe(e.metadataStream),e.metadataStream.on("timestamp",function(t){e.aacStream.setTimestamp(t.timeStamp)}),e.aacStream.on("data",function(i){"timed-metadata"!==i.type&&"audio"!==i.type||e.audioSegmentStream||(e.tracks.audio=e.tracks.audio||{timelineStartInfo:{baseMediaDecodeTime:t.baseMediaDecodeTime},codec:"adts",type:"audio"},e.audioSegmentStream=new ew(e.tracks.audio,t),e.audioSegmentStream.on("data",function(t){e.trigger("data",{type:"audio",data:t})}),e.audioSegmentStream.on("partialdone",e.trigger.bind(e,"partialdone")),e.audioSegmentStream.on("done",e.trigger.bind(e,"done")),e.audioSegmentStream.on("endedtimeline",e.trigger.bind(e,"endedtimeline")),e.audioSegmentStream.on("timingInfo",e.trigger.bind(e,"audioTimingInfo")),e.adtsStream.pipe(e.audioSegmentStream),e.trigger("trackinfo",{hasAudio:!!e.tracks.audio,hasVideo:!!e.tracks.video}))}),(e=eU(e)).metadataStream.on("data",e.trigger.bind(e,"id3Frame")),e},eC=function(t,i){t.on("data",i.trigger.bind(i,"data")),t.on("done",i.trigger.bind(i,"done")),t.on("partialdone",i.trigger.bind(i,"partialdone")),t.on("endedtimeline",i.trigger.bind(i,"endedtimeline")),t.on("audioTimingInfo",i.trigger.bind(i,"audioTimingInfo")),t.on("videoTimingInfo",i.trigger.bind(i,"videoTimingInfo")),t.on("trackinfo",i.trigger.bind(i,"trackinfo")),t.on("id3Frame",function(n){n.dispatchType=t.metadataStream.dispatchType,n.cueTime=e.videoTsToSeconds(n.pts),i.trigger("id3Frame",n)}),t.on("caption",function(t){i.trigger("caption",t)})},eP=function t(e){var i=null,n=!0;e=e||{},t.prototype.init.call(this),e.baseMediaDecodeTime=e.baseMediaDecodeTime||0,this.push=function(t){if(n){var a=ek(t);a&&(!i||"aac"!==i.type)?eC(i=eD(e),this):a||i&&"ts"===i.type||eC(i=eA(e),this),n=!1}i.headOfPipeline.push(t)},this.flush=function(){i&&(n=!0,i.headOfPipeline.flush())},this.partialFlush=function(){i&&i.headOfPipeline.partialFlush()},this.endTimeline=function(){i&&i.headOfPipeline.endTimeline()},this.reset=function(){i&&i.headOfPipeline.reset()},this.setBaseMediaDecodeTime=function(t){e.keepOriginalTimestamps||(e.baseMediaDecodeTime=t),i&&(i.tracks.audio&&(i.tracks.audio.timelineStartInfo.dts=void 0,i.tracks.audio.timelineStartInfo.pts=void 0,C.clearDtsInfo(i.tracks.audio),i.audioRollover&&i.audioRollover.discontinuity()),i.tracks.video&&(i.videoSegmentStream&&(i.videoSegmentStream.gopCache_=[]),i.tracks.video.timelineStartInfo.dts=void 0,i.tracks.video.timelineStartInfo.pts=void 0,C.clearDtsInfo(i.tracks.video)),i.timestampRollover&&i.timestampRollover.discontinuity())},this.setRemux=function(t){e.remux=t,i&&i.coalesceStream&&i.coalesceStream.setRemux(t)},this.setAudioAppendStart=function(t){i&&i.tracks.audio&&i.audioSegmentStream&&i.audioSegmentStream.setAudioAppendStart(t)},this.alignGopsWith=function(t){}}
1;eP.prototype=new t;var eI,eL,eO,eM,eE,ex,eR,eN,eF,eB,ez,eV,eG,eW,ej,eY,eH,eq=function(t){return new Date(1e3*t-20828448e5)},eK=function(t){var e,i,n=new DataView(t.buffer,t.byteOffset,t.byteLength),a=[];for(e=0;e+4<t.length;e+=i){if(i=n.getUint32(e),e+=4,i<=0){a.push("<span style='color:red;'>MALFORMED DATA</span>");continue}switch(31&t[e]){case 1:a.push("slice_layer_without_partitioning_rbsp");break;case 5:a.push("slice_layer_without_partitioning_rbsp_idr");break;case 6:a.push("sei_rbsp");break;case 7:a.push("seq_parameter_set_rbsp");break;case 8:a.push("pic_parameter_set_rbsp");break;case 9:a.push("access_unit_delimiter_rbsp");break;default:a.push("UNKNOWN NAL - "+t[e]&31)}}return a},eX={avc1:function(t){var e=new DataView(t.buffer,t.byteOffset,t.byteLength);return{dataReferenceIndex:e.getUint16(6),width:e.getUint16(24),height:e.getUint16(26),horizresolution:e.getUint16(28)+e.getUint16(30)/16,vertresolution:e.getUint16(32)+e.getUint16(34)/16,frameCount:e.getUint16(40),depth:e.getUint16(74),config:eY(t.subarray(78,t.byteLength))}},avcC:function(t){var e,i,n,a,r=new DataView(t.buffer,t.byteOffset,t.byteLength),s={configurationVersion:t[0],avcProfileIndication:t[1],profileCompatibility:t[2],avcLevelIndication:t[3],lengthSizeMinusOne:3&t[4],sps:[],pps:[]},o=31&t[5];for(a=0,n=6;a<o;a++)i=r.getUint16(n),n+=2,s.sps.push(new Uint8Array(t.subarray(n,n+i))),n+=i;for(e=t[n],n++,a=0;a<e;a++)i=r.getUint16(n),n+=2,s.pps.push(new Uint8Array(t.subarray(n,n+i))),n+=i;return s},btrt:function(t){var e=new DataView(t.buffer,t.byteOffset,t.byteLength);return{bufferSizeDB:e.getUint32(0),maxBitrate:e.getUint32(4),avgBitrate:e.getUint32(8)}},edts:function(t){return{boxes:eY(t)}},elst:function(t){var e,i=new DataView(t.buffer,t.byteOffset,t.byteLength),n={version:i.getUint8(0),flags:new Uint8Array(t.subarray(1,4)),edits:[]},a=i.getUint32(4);for(e=8;a;a--)0===n.version?(n.edits.push({segmentDuration:i.getUint32(e),mediaTime:i.getInt32(e+4),mediaRate:i.getUint16(e+8)+i.getUint16(e+10)/65536}),e+=12):(n.edits.push({segmentDuration:4294967296*i.getUint32(e)+i.getUint32(e+4),mediaTime:4294967296*i.getUint32(e+8)+i.getUint32(e+12),mediaRate:i.getUint16(e+16)+i.getUint16(e+18)/65536}),e+=20);return n},esds:function(t){return{version:t[0],flags:new Uint8Array(t.subarray(1,4)),esId:t[6]<<8|t[7],streamPriority:31&t[8],decoderConfig:{objectProfileIndication:t[11],streamType:t[12]>>>2&63,bufferSize:t[13]<<16|t[14]<<8|t[15],maxBitrate:t[16]<<24|t[17]<<16|t[18]<<8|t[19],avgBitrate:t[20]<<24|t[21]<<16|t[22]<<8|t[23],decoderConfigDescriptor:{tag:t[24],length:t[25],audioObjectType:t[26]>>>3&31,samplingFrequencyIndex:(7&t[26])<<1|t[27]>>>7&1,channelConfiguration:t[27]>>>3&15}}}},ftyp:function(t){for(var e=new DataView(t.buffer,t.byteOffset,t.byteLength),i={majorBrand:h(t.subarray(0,4)),minorVersion:e.getUint32(4),compatibleBrands:[]},n=8;n<t.byteLength;)i.compatibleBrands.push(h(t.subarray(n,n+4))),n+=4;return i},dinf:function(t){return{boxes:eY(t)}},dref:function(t){return{version:t[0],flags:new Uint8Array(t.subarray(1,4)),dataReferences:eY(t.subarray(8))}},hdlr:function(t){var e={version:new DataView(t.buffer,t.byteOffset,t.byteLength).getUint8(0),flags:new Uint8Array(t.subarray(1,4)),handlerType:h(t.subarray(8,12)),name:""},i=8;for(i=24;i<t.byteLength;i++){if(0===t[i]){i++;break}e.name+=String.fromCharCode(t[i])}return e.name=decodeURIComponent(escape(e.name)),e},mdat:function(t){return{byteLength:t.byteLength,nals:eK(t)}},mdhd:function(t){var e,i=new DataView(t.buffer,t.byteOffset,t.byteLength),n=4,a={version:i.getUint8(0),flags:new Uint8Array(t.subarray(1,4)),language:""};return 1===a.version?(n+=4,a.creationTime=eq(i.getUint32(n)),n+=8,a.modificationTime=eq(i.getUint32(n)),n+=4,a.timescale=i.getUint32(n),n+=8):(a.creationTime=eq(i.getUint32(n)),n+=4,a.modificationTime=eq(i.getUint32(n)),n+=4,a.timescale=i.getUint32(n),n+=4),a.duration=i.getUint32(n),n+=4,e=i.getUint16(n),a.language+=String.fromCharCode((e>>10)+96),a.language+=String.fromCharCode(((992&e)>>5)+96),a.language+=String.fromCharCode((31&e)+96),a},mdia:function(t){return{boxes:eY(t)}},mfhd:function(t){return{version:t[0],flags:new Uint8Array(t.subarray(1,4)),sequenceNumber:t[4]<<24|t[5]<<16|t[6]<<8|t[7]}},minf:function(t){return{boxes:eY(t)}},mp4a:function(t){var e=new DataView(t.buffer,t.byteOffset,t.byteLength),i={dataReferenceIndex:e.getUint16(6),channelcount:e.getUint16(16),samplesize:e.getUint16(18),samplerate:e.getUint16(24)+e.getUint16(26)/65536};return t.byteLength>28&&(i.streamDescriptor=eY(t.subarray(28))[0]),i},moof:function(t){return{boxes:eY(t)}},moov:function(t){return{boxes:eY(t)}},mvex:function(t){return{boxes:eY(t)}},mvhd:function(t){var e=new DataView(t.buffer,t.byteOffset,t.byteLength),i=4,n={version:e.getUint8(0),flags:new Uint8Array(t.subarray(1,4))};return 1===n.version?(i+=4,n.creationTime=eq(e.getUint32(i)),i+=8,n.modificationTime=eq(e.getUint32(i)),i+=4,n.timescale=e.getUint32(i),i+=8):(n.creationTime=eq(e.getUint32(i)),i+=4,n.modificationTime=eq(e.getUint32(i)),i+=4,n.timescale=e.getUint32(i),i+=4),n.duration=e.getUint32(i),i+=4,n.rate=e.getUint16(i)+e.getUint16(i+2)/16,i+=4,n.volume=e.getUint8(i)+e.getUint8(i+1)/8,i+=12,n.matrix=new Uint32Array(t.subarray(i,i+36)),i+=60,n.nextTrackId=e.getUint32(i),n},pdin:function(t){var e=new DataView(t.buffer,t.byteOffset,t.byteLength);return{version:e.getUint8(0),flags:new Uint8Array(t.subarray(1,4)),rate:e.getUint32(4),initialDelay:e.getUint32(8)}},sdtp:function(t){var e,i={version:t[0],flags:new Uint8Array(t.subarray(1,4)),samples:[]};for(e=4;e<t.byteLength;e++)i.samples.push({dependsOn:(48&t[e])>>4,isDependedOn:(12&t[e])>>2,hasRedundancy:3&t[e]});return i},sidx:function(t){var e=new DataView(t.buffer,t.byteOffset,t.byteLength),i={version:t[0],flags:new Uint8Array(t.subarray(1,4)),references:[],referenceId:e.getUint32(4),timescale:e.getUint32(8)},n=12;0===i.version?(i.earliestPresentationTime=e.getUint32(n),i.firstOffset=e.getUint32(n+4),n+=8):(i.earliestPresentationTime=4294967296*e.getUint32(n)+e.getUint32(n+4),i.firstOffset=4294967296*e.getUint32(n+8)+e.getUint32(n+12),n+=16),n+=2;var a=e.getUint16(n);for(n+=2;a>0;n+=12,a--)i.references.push({referenceType:(128&t[n])>>>7,referencedSize:2147483647&e.getUint32(n),subsegmentDuration:e.getUint32(n+4),startsWithSap:!!(128&t[n+8]),sapType:(112&t[n+8])>>>4,sapDeltaTime:268435455&e.getUint32(n+8)});return i},smhd:function(t){return{version:t[0],flags:new Uint8Array(t.subarray(1,4)),balance:t[4]+t[5]/256}},stbl:function(t){return{boxes:eY(t)}},ctts:function(t){var e,i=new DataView(t.buffer,t.byteOffset,t.byteLength),n={version:i.getUint8(0),flags:new Uint8Array(t.subarray(1,4)),compositionOffsets:[]},a=i.getUint32(4);for(e=8;a;
1e+=8,a--)n.compositionOffsets.push({sampleCount:i.getUint32(e),sampleOffset:i[0===n.version?"getUint32":"getInt32"](e+4)});return n},stss:function(t){var e,i=new DataView(t.buffer,t.byteOffset,t.byteLength),n={version:i.getUint8(0),flags:new Uint8Array(t.subarray(1,4)),syncSamples:[]},a=i.getUint32(4);for(e=8;a;e+=4,a--)n.syncSamples.push(i.getUint32(e));return n},stco:function(t){var e,i=new DataView(t.buffer,t.byteOffset,t.byteLength),n={version:t[0],flags:new Uint8Array(t.subarray(1,4)),chunkOffsets:[]},a=i.getUint32(4);for(e=8;a;e+=4,a--)n.chunkOffsets.push(i.getUint32(e));return n},stsc:function(t){var e,i=new DataView(t.buffer,t.byteOffset,t.byteLength),n=i.getUint32(4),a={version:t[0],flags:new Uint8Array(t.subarray(1,4)),sampleToChunks:[]};for(e=8;n;e+=12,n--)a.sampleToChunks.push({firstChunk:i.getUint32(e),samplesPerChunk:i.getUint32(e+4),sampleDescriptionIndex:i.getUint32(e+8)});return a},stsd:function(t){return{version:t[0],flags:new Uint8Array(t.subarray(1,4)),sampleDescriptions:eY(t.subarray(8))}},stsz:function(t){var e,i=new DataView(t.buffer,t.byteOffset,t.byteLength),n={version:t[0],flags:new Uint8Array(t.subarray(1,4)),sampleSize:i.getUint32(4),entries:[]};for(e=12;e<t.byteLength;e+=4)n.entries.push(i.getUint32(e));return n},stts:function(t){var e,i=new DataView(t.buffer,t.byteOffset,t.byteLength),n={version:t[0],flags:new Uint8Array(t.subarray(1,4)),timeToSamples:[]},a=i.getUint32(4);for(e=8;a;e+=8,a--)n.timeToSamples.push({sampleCount:i.getUint32(e),sampleDelta:i.getUint32(e+4)});return n},styp:function(t){return eX.ftyp(t)},tfdt:f,tfhd:u,tkhd:function(t){var e=new DataView(t.buffer,t.byteOffset,t.byteLength),i=4,n={version:e.getUint8(0),flags:new Uint8Array(t.subarray(1,4))};return 1===n.version?(i+=4,n.creationTime=eq(e.getUint32(i)),i+=8,n.modificationTime=eq(e.getUint32(i)),i+=4,n.trackId=e.getUint32(i),i+=12):(n.creationTime=eq(e.getUint32(i)),i+=4,n.modificationTime=eq(e.getUint32(i)),i+=4,n.trackId=e.getUint32(i),i+=8),n.duration=e.getUint32(i),i+=12,n.layer=e.getUint16(i),i+=2,n.alternateGroup=e.getUint16(i),i+=2,n.volume=e.getUint8(i)+e.getUint8(i+1)/8,i+=4,n.matrix=new Uint32Array(t.subarray(i,i+36)),i+=36,n.width=e.getUint16(i)+e.getUint16(i+2)/65536,i+=4,n.height=e.getUint16(i)+e.getUint16(i+2)/65536,n},traf:function(t){return{boxes:eY(t)}},trak:function(t){return{boxes:eY(t)}},trex:function(t){var e=new DataView(t.buffer,t.byteOffset,t.byteLength);return{version:t[0],flags:new Uint8Array(t.subarray(1,4)),trackId:e.getUint32(4),defaultSampleDescriptionIndex:e.getUint32(8),defaultSampleDuration:e.getUint32(12),defaultSampleSize:e.getUint32(16),sampleDependsOn:3&t[20],sampleIsDependedOn:(192&t[21])>>6,sampleHasRedundancy:(48&t[21])>>4,samplePaddingValue:(14&t[21])>>1,sampleIsDifferenceSample:!!(1&t[21]),sampleDegradationPriority:e.getUint16(22)}},trun:c,"url ":function(t){return{version:t[0],flags:new Uint8Array(t.subarray(1,4))}},vmhd:function(t){var e=new DataView(t.buffer,t.byteOffset,t.byteLength);return{version:t[0],flags:new Uint8Array(t.subarray(1,4)),graphicsmode:e.getUint16(4),opcolor:new Uint16Array([e.getUint16(6),e.getUint16(8),e.getUint16(10)])}}},eZ={inspect:eY=function(t){for(var e,i,n,a,r,s=0,o=[],d=new ArrayBuffer(t.length),p=new Uint8Array(d),u=0;u<t.length;++u)p[u]=t[u];for(e=new DataView(d);s<t.byteLength;)i=e.getUint32(s),n=h(t.subarray(s+4,s+8)),a=i>1?s+i:t.byteLength,(r=(eX[n]||function(t){return{data:t}})(t.subarray(s+8,a))).size=i,r.type=n,o.push(r),s=a;return o},textify:eH=function(t,e){var i;return i=Array(2*(e=e||0)+1).join(" "),t.map(function(t,n){return i+t.type+"\n"+Object.keys(t).filter(function(t){return"type"!==t&&"boxes"!==t}).map(function(e){var n=i+"  "+e+": ",a=t[e];if(a instanceof Uint8Array||a instanceof Uint32Array){var r=Array.prototype.slice.call(new Uint8Array(a.buffer,a.byteOffset,a.byteLength)).map(function(t){return" "+("00"+t.toString(16)).slice(-2)}).join("").match(/.{1,24}/g);return r?1===r.length?n+"<"+r.join("").slice(1)+">":n+"<\n"+r.map(function(t){return i+"  "+t}).join("\n")+"\n"+i+"  >":n+"<>"}return n+JSON.stringify(a,null,2).split("\n").map(function(t,e){return 0===e?t:i+"  "+t}).join("\n")}).join("\n")+(t.boxes?"\n"+eH(t.boxes,e+1):"")}).join("\n")},parseType:h,findBox:p,parseTraf:eX.traf,parseTfdt:eX.tfdt,parseHdlr:eX.hdlr,parseTfhd:eX.tfhd,parseTrun:eX.trun,parseSidx:eX.sidx},e$={8:"audio",9:"video",18:"metadata"},eJ=function(t){for(var e,i=[];t.byteLength>0;)e=0,i.push("0x"+("00"+t[e++].toString(16)).slice(-2).toUpperCase()),t=t.subarray(e);return i.join(" ")},eQ=function(t,e){var i=t[1]&parseInt("01111111",2)<<16|t[2]<<8|t[3];return(e=e||{}).avcPacketType=["AVC Sequence Header","AVC NALU","AVC End-of-Sequence"][t[0]],e.CompositionTime=t[1]&parseInt("10000000",2)?-i:i,1===t[0]?e.nalUnitTypeRaw=eJ(t.subarray(4,100)):e.data=eJ(t.subarray(4)),e},e0=function(t,e){var i=t[0]&parseInt("00001111",2);return((e=e||{}).frameType=["Unknown","Keyframe (for AVC, a seekable frame)","Inter frame (for AVC, a nonseekable frame)","Disposable inter frame (H.263 only)","Generated keyframe (reserved for server use only)","Video info/command frame"][(t[0]&parseInt("11110000",2))>>>4],e.codecID=i,7===i)?eQ(t.subarray(1),e):e},e1=function(t,e){var i,n,a=(t[0]&parseInt("11110000",2))>>>4;return((e=e||{}).soundFormat=["Linear PCM, platform endian","ADPCM","MP3","Linear PCM, little endian","Nellymoser 
116-kHz mono","Nellymoser 8-kHz mono","Nellymoser","G.711 A-law logarithmic PCM","G.711 mu-law logarithmic PCM","reserved","AAC","Speex","MP3 8-Khz","Device-specific sound"][a],e.soundRate=["5.5-kHz","11-kHz","22-kHz","44-kHz"][(t[0]&parseInt("00001100",2))>>>2],e.soundSize=(t[0]&parseInt("00000010",2))>>>1?"16-bit":"8-bit",e.soundType=t[0]&parseInt("00000001",2)?"Stereo":"Mono",10===a)?(i=t.subarray(1),(n=(n=e)||{}).aacPacketType=["AAC Sequence Header","AAC Raw"][i[0]],n.data=eJ(i.subarray(1)),n):e},e2=function(t){var e={tagType:e$[t[0]],dataSize:t[1]<<16|t[2]<<8|t[3],timestamp:t[7]<<24|t[4]<<16|t[5]<<8|t[6],streamID:t[8]<<16|t[9]<<8|t[10]};switch(t[0]){case 8:e1(t.subarray(11),e);break;case 9:e0(t.subarray(11),e)}return e},e8=function(t){var e=31&t[1];return e<<=8,e|=t[2]},e4=function(t){return!!(64&t[1])},e6=function(t){var e=0;return(48&t[3])>>>4>1&&(e+=t[4]+1),e},e5=function(t){switch(t){case 5:return"slice_layer_without_partitioning_rbsp_idr";case 6:return"sei_rbsp";case 7:return"seq_parameter_set_rbsp";case 8:return"pic_parameter_set_rbsp";case 9:return"access_unit_delimiter_rbsp";default:return null}},e3={};e3.ts={parseType:function(t,e){var i=e8(t);return 0===i?"pat":i===e?"pmt":e?"pes":null},parsePat:function(t){var e=e4(t),i=4+e6(t);return e&&(i+=t[i]+1),(31&t[i+10])<<8|t[i+11]},parsePmt:function(t){var e,i={},n=e4(t),a=4+e6(t);
1if(n&&(a+=t[a]+1),1&t[a+5]){e=3+((15&t[a+1])<<8|t[a+2])-4;for(var r=12+((15&t[a+10])<<8|t[a+11]);r<e;){var s=a+r;i[(31&t[s+1])<<8|t[s+2]]=t[s],r+=((15&t[s+3])<<8|t[s+4])+5}return i}},parsePayloadUnitStartIndicator:e4,parsePesType:function(t,e){switch(e[e8(t)]){case W.H264_STREAM_TYPE:return"video";case W.ADTS_STREAM_TYPE:return"audio";case W.METADATA_STREAM_TYPE:return"timed-metadata";default:return null}},parsePesTime:function(t){if(!e4(t))return null;var e,i=4+e6(t);if(i>=t.byteLength)return null;var n=null;return 192&(e=t[i+7])&&((n={}).pts=(14&t[i+9])<<27|(255&t[i+10])<<20|(254&t[i+11])<<12|(255&t[i+12])<<5|(254&t[i+13])>>>3,n.pts*=4,n.pts+=(6&t[i+13])>>>1,n.dts=n.pts,64&e&&(n.dts=(14&t[i+14])<<27|(255&t[i+15])<<20|(254&t[i+16])<<12|(255&t[i+17])<<5|(254&t[i+18])>>>3,n.dts*=4,n.dts+=(6&t[i+18])>>>1)),n},videoPacketContainsKeyFrame:function(t){for(var e=4+e6(t),i=t.subarray(e),n=0,a=0,r=!1;a<i.byteLength-3;a++)if(1===i[a+2]){n=a+5;break}for(;n<i.byteLength;)switch(i[n]){case 0:if(0!==i[n-1]){n+=2;break}if(0!==i[n-2]){n++;break}a+3!==n-2&&"slice_layer_without_partitioning_rbsp_idr"===e5(31&i[a+3])&&(r=!0);do n++;while(1!==i[n]&&n<i.length);a=n-2,n+=3;break;case 1:if(0!==i[n-1]||0!==i[n-2]){n+=3;break}"slice_layer_without_partitioning_rbsp_idr"===e5(31&i[a+3])&&(r=!0),a=n-2,n+=3;break;default:n+=3}return i=i.subarray(a),n-=a,a=0,i&&i.byteLength>3&&"slice_layer_without_partitioning_rbsp_idr"===e5(31&i[a+3])&&(r=!0),r}},e3.aac=t9;var e7=e.ONE_SECOND_IN_TS,e9=function(t,e){for(var i,n=0,a=188;a<t.byteLength;){if(71===t[n]&&71===t[a]){switch(i=t.subarray(n,a),e3.ts.parseType(i,e.pid)){case"pat":e.pid=e3.ts.parsePat(i);break;case"pmt":var r=e3.ts.parsePmt(i);e.table=e.table||{},Object.keys(r).forEach(function(t){e.table[t]=r[t]})}n+=188,a+=188;continue}n++,a++}},it=function(t,e,i){for(var n,a,r,s,o=0,d=188,h=!1;d<=t.byteLength;){if(71===t[o]&&(71===t[d]||d===t.byteLength)){if(n=t.subarray(o,d),"pes"===e3.ts.parseType(n,e.pid)&&(a=e3.ts.parsePesType(n,e.table),r=e3.ts.parsePayloadUnitStartIndicator(n),"audio"===a&&r&&(s=e3.ts.parsePesTime(n))&&(s.type="audio",i.audio.push(s),h=!0)),h)break;o+=188,d+=188;continue}o++,d++}for(o=(d=t.byteLength)-188,h=!1;o>=0;){if(71===t[o]&&(71===t[d]||d===t.byteLength)){if(n=t.subarray(o,d),"pes"===e3.ts.parseType(n,e.pid)&&(a=e3.ts.parsePesType(n,e.table),r=e3.ts.parsePayloadUnitStartIndicator(n),"audio"===a&&r&&(s=e3.ts.parsePesTime(n))&&(s.type="audio",i.audio.push(s),h=!0)),h)break;o-=188,d-=188;continue}o--,d--}},ie=function(t,e,i){for(var n,a,r,s,o,d,h,p=0,u=188,l=!1,c={data:[],size:0};u<t.byteLength;){if(71===t[p]&&71===t[u]){if(n=t.subarray(p,u),"pes"===e3.ts.parseType(n,e.pid)&&(a=e3.ts.parsePesType(n,e.table),r=e3.ts.parsePayloadUnitStartIndicator(n),"video"===a&&(r&&!l&&(s=e3.ts.parsePesTime(n))&&(s.type="video",i.video.push(s),l=!0),!i.firstKeyFrame))){if(r&&0!==c.size){for(o=new Uint8Array(c.size),d=0;c.data.length;)h=c.data.shift(),o.set(h,d),d+=h.byteLength;if(e3.ts.videoPacketContainsKeyFrame(o)){var f=e3.ts.parsePesTime(o);f?(i.firstKeyFrame=f,i.firstKeyFrame.type="video"):console.warn("Failed to extract PTS/DTS from PES at first keyframe. This could be an unusual TS segment, or else mux.js did not parse your TS segment correctly. If you know your TS segments do contain PTS/DTS on keyframes please file a bug report! You can try ffprobe to double check for yourself.")}c.size=0}c.data.push(n),c.size+=n.byteLength}if(l&&i.firstKeyFrame)break;p+=188,u+=188;continue}p++,u++}for(p=(u=t.byteLength)-188,l=!1;p>=0;){if(71===t[p]&&71===t[u]){if(n=t.subarray(p,u),"pes"===e3.ts.parseType(n,e.pid)&&(a=e3.ts.parsePesType(n,e.table),r=e3.ts.parsePayloadUnitStartIndicator(n),"video"===a&&r&&(s=e3.ts.parsePesTime(n))&&(s.type="video",i.video.push(s),l=!0)),l)break;p-=188,u-=188;continue}p--,u--}},ii=function(t,e){if(t.audio&&t.audio.length){var i=e;(void 0===i||isNaN(i))&&(i=t.audio[0].dts),t.audio.forEach(function(t){t.dts=Y(t.dts,i),t.pts=Y(t.pts,i),t.dtsTime=t.dts/e7,t.ptsTime=t.pts/e7})}if(t.video&&t.video.length){var n=e;if((void 0===n||isNaN(n))&&(n=t.video[0].dts),t.video.forEach(function(t){t.dts=Y(t.dts,n),t.pts=Y(t.pts,n),t.dtsTime=t.dts/e7,t.ptsTime=t.pts/e7}),t.firstKeyFrame){var a=t.firstKeyFrame;a.dts=Y(a.dts,n),a.pts=Y(a.pts,n),a.dtsTime=a.dts/e7,a.ptsTime=a.pts/e7}}},ia=function(t){for(var e,i=!1,n=0,a=null,r=null,s=0,o=0;t.length-o>=3;){switch(e3.aac.parseType(t,o)){case"timed-metadata":if(t.length-o<10||(s=e3.aac.parseId3TagSize(t,o))>t.length){i=!0;break}null===r&&(e=t.subarray(o,o+s),r=e3.aac.parseAacTimestamp(e)),o+=s;break;case"audio":if(t.length-o<7||(s=e3.aac.parseAdtsSize(t,o))>t.length){i=!0;break}null===a&&(e=t.subarray(o,o+s),a=e3.aac.parseSampleRate(e)),n++,o+=s;break;default:o++}if(i)return null}if(null===a||null===r)return null;var d=e7/a;return{audio:[{type:"audio",dts:r,pts:r},{type:"audio",dts:r+1024*n*d,pts:r+1024*n*d}]}},ir=function(t){var e={pid:null,table:null},i={};for(var n in e9(t,e),e.table)if(e.table.hasOwnProperty(n))switch(e.table[n]){case W.H264_STREAM_TYPE:i.video=[],ie(t,e,i),0===i.video.length&&delete i.video;break;case W.ADTS_STREAM_TYPE:i.audio=[],it(t,e,i),0===i.audio.length&&delete i.audio}return i},is={codecs:s,mp4:{generator:o,probe:{findBox:p,parseType:h,timescale:tj,startTime:tY,compositionStartTime:tH,videoTrackIds:tq,tracks:tK,getTimescaleFromMediaHeader:tX},Transmuxer:ed,AudioSegmentStream:ep,VideoSegmentStream:eh,CaptionParser:function(){var t,e,i,n,a,r,s=!1;this.isInitialized=function(){return s},this.init=function(e){t=new L,s=!0,r=!!e&&e.isPartial,t.on("data",function(t){t.startTime=t.startPts/n,t.endTime=t.endPts/n,a.captions.push(t),a.captionStream
1s[t.stream]=!0})},this.isNewInit=function(t,e){return(!t||0!==t.length)&&(!e||"object"!=typeof e||0!==Object.keys(e).length)&&(i!==t[0]||n!==e[i])},this.parse=function(t,r,s){if(!this.isInitialized()||!r||!s)return null;if(this.isNewInit(r,s))n=s[i=r[0]];else if(null===i||!n)return e.push(t),null;for(;e.length>0;){var o,d,h,p=e.shift();this.parse(p,r,s)}return null!==(d=i,h=n,o=null===d?null:{seiNals:em(t,d)[d],timescale:h})&&o.seiNals?(this.pushNals(o.seiNals),this.flushStream(),a):null},this.pushNals=function(e){if(!this.isInitialized()||!e||0===e.length)return null;e.forEach(function(e){t.push(e)})},this.flushStream=function(){if(!this.isInitialized())return null;r?t.partialFlush():t.flush()},this.clearParsedCaptions=function(){a.captions=[],a.captionStreams={}},this.resetCaptionStream=function(){if(!this.isInitialized())return null;t.reset()},this.clearAllCaptions=function(){this.clearParsedCaptions(),this.resetCaptionStream()},this.reset=function(){e=[],i=null,n=null,a?this.clearParsedCaptions():a={captions:[],captionStreams:{}},this.resetCaptionStream()},this.reset()}},flv:{tag:eg,Transmuxer:eS,getFlvHeader:function(t,e,i){var n,a,r,s=new Uint8Array(9),o=new DataView(s.buffer);return(t=t||0,e=void 0===e||e,i=void 0===i||i,o.setUint8(0,70),o.setUint8(1,76),o.setUint8(2,86),o.setUint8(3,1),o.setUint8(4,(e?4:0)|(i?1:0)),o.setUint32(5,s.byteLength),t<=0)?((a=new Uint8Array(s.byteLength+4)).set(s),a.set([0,0,0,0],s.byteLength)):((n=new eg(eg.METADATA_TAG)).pts=n.dts=0,n.writeMetaDataDouble("duration",t),r=n.finalize().length,(a=new Uint8Array(s.byteLength+r)).set(s),a.set(o.byteLength,r)),a}},mp2t:t8,partial:{Transmuxer:eP}};return is.mp4.tools=eZ,is.flv.tools={inspectTag:e2,inspect:function(t){var e,i,n=[];for(i=13;i<t.byteLength;)e=(t[i+1]<<16|t[i+2]<<8|t[i+3])+11,n.push(e2(t.subarray(i,i+e))),i+=e+4;return n},textify:function(t){return JSON.stringify(t,null,2)}},is.mp2t.tools={inspect:function(t,e){var i;return(i=e3.aac.isLikelyAacData(t)?ia(t):ir(t))&&(i.audio||i.video)?(ii(i,e),i):null},parseAudioPes_:it},is},t.exports=e()}}]);

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.