!function t(e,i,n){function a(s,o){if(!i[s]){if(!e[s]){var d="function"==typeof require&&require;if(!o&&d)return d(s,!0);if(r)return r(s,!0);var u=new Error("Cannot find module '"+s+"'");throw u.code="MODULE_NOT_FOUND",u}var h=i[s]={exports:{}};e[s][0].call(h.exports,function(t){var i=e[s][1][t];return a(i||t)},h,h.exports,t,e,i,n)}return i[s].exports}for(var r="function"==typeof require&&require,s=0;s1){var n=i[0].replace(/"/g,"").trim(),a=i[1].replace(/"/g,"").trim();e.parameters[n]=a}}),e},s=function(t){return t.map(function(t){return t.replace(/avc1\.(\d+)\.(\d+)/i,function(t,e,i){return"avc1."+("00"+Number(e).toString(16)).slice(-2)+"00"+("00"+Number(i).toString(16)).slice(-2)})})};i.default={isAudioCodec:n,parseContentType:r,isVideoCodec:a,translateLegacyCodecs:s},e.exports=i.default},{}],3:[function(t,e,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0});var n=function(t,e,i){var n=e.player_;if(i.captions&&i.captions.length){t.inbandTextTracks_||(t.inbandTextTracks_={});for(var a in i.captionStreams)if(!t.inbandTextTracks_[a]){n.tech_.trigger({type:"usage",name:"hls-608"});var r=n.textTracks().getTrackById(a);t.inbandTextTracks_[a]=r||n.addRemoteTextTrack({kind:"captions",id:a,label:a},!1).track}}i.metadata&&i.metadata.length&&!t.metadataTrack_&&(t.metadataTrack_=n.addRemoteTextTrack({kind:"metadata",label:"Timed Metadata"},!1).track,t.metadataTrack_.inBandMetadataTrackDispatchType=i.metadata.dispatchType)};i.default=n,e.exports=i.default},{}],4:[function(t,e,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0});var n={TIME_BETWEEN_CHUNKS:1,BYTES_PER_CHUNK:32768};i.default=n,e.exports=i.default},{}],5:[function(t,e,i){(function(n){"use strict";function a(t){return t&&t.__esModule?t:{default:t}}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(i,"__esModule",{value:!0});var o=function(){function t(t,e){for(var i=0;i=0&&(this.timestampOffset_=t,this.mediaSource_.swfObj.vjs_discontinuity(),this.basePtsOffset_=NaN,this.audioBufferEnd_=NaN,this.videoBufferEnd_=NaN,this.transmuxer_.postMessage({action:"reset"}))}}),Object.defineProperty(this,"buffered",{get:function(){if(!(this.mediaSource_&&this.mediaSource_.swfObj&&"vjs_getProperty"in this.mediaSource_.swfObj))return p.default.createTimeRange();var t=this.mediaSource_.swfObj.vjs_getProperty("buffered");return t&&t.length&&(t[0][0]=C(t[0][0],3),t[0][1]=C(t[0][1],3)),p.default.createTimeRanges(t)}}),this.mediaSource_.player_.on("seeked",function(){if((0,g.default)(0,1/0,i.metadataTrack_),i.inbandTextTracks_)for(var t in i.inbandTextTracks_)(0,g.default)(0,1/0,i.inbandTextTracks_[t])});var s=this.onHlsReset_.bind(this);this.mediaSource_.player_.tech_.on("hls-reset",s),this.mediaSource_.player_.tech_.hls.on("dispose",function(){i.transmuxer_.terminate(),i.mediaSource_.player_.tech_.off("hls-reset",s)})}return s(e,t),o(e,[{key:"appendBuffer",value:function(t){var e=void 0;if(this.updating)throw e=new Error("SourceBuffer.append() cannot be called while an update is in progress"),e.name="InvalidStateError",e.code=11,e;this.updating=!0,this.mediaSource_.readyState="open",this.trigger({type:"update"}),this.transmuxer_.postMessage({action:"push",data:t.buffer,byteOffset:t.byteOffset,byteLength:t.byteLength},[t.buffer]),this.transmuxer_.postMessage({action:"flush"})}},{key:"abort",value:function(){this.buffer_=[],this.bufferSize_=0,this.mediaSource_.swfObj.vjs_abort(),this.updating&&(this.updating=!1,this.trigger({type:"updateend"}))}},{key:"remove",value:function(t,e){if((0,g.default)(t,e,this.metadataTrack_),this.inbandTextTracks_)for(var i in this.inbandTextTracks_)(0,g.default)(t,e,this.inbandTextTracks_[i]);this.trigger({type:"update"}),this.trigger({type:"updateend"})}},{key:"receiveBuffer_",value:function(t){var e=this;(0,_.default)(this,this.mediaSource_,t),(0,v.addTextTrackData)(this,t.captions,t.metadata),M(function(){var i=e.convertTagsToData_(t);0===e.buffer_.length&&M(e.processBuffer_.bind(e)),i&&(e.buffer_.push(i),e.bufferSize_+=i.byteLength)})}},{key:"processBuffer_",value:function(){var t=this,e=A.default.BYTES_PER_CHUNK;if(!this.buffer_.length)return void(!1!==this.updating&&(this.updating=!1,this.trigger({type:"updateend"})));var i=this.buffer_[0].subarray(0,e);i.byteLength=n){for(;--u;){var h=r[u];if(!(h.pts>n)&&(h.keyFrame||h.metaDataTag))break}for(;u;){if(!r[u-1].metaDataTag)break;u--}}var f=r.slice(u),p=void 0;for(p=isNaN(this.audioBufferEnd_)?n:this.audioBufferEnd_+.1,f.length&&(p=Math.min(p,f[0].pts)),u=0;u=p);)u++;var c=s.slice(u);c.length&&(this.audioBufferEnd_=c[c.length-1].pts),f.length&&(this.videoBufferEnd_=f[f.length-1].pts);var l=this.getOrderedTags_(f,c);if(0!==l.length){if(l[0].ptsthis.nativeMediaSource_.duration||isNaN(this.nativeMediaSource_.duration))&&(this.nativeMediaSource_.duration=e)}},{key:"addSourceBuffer",value:function(t){var e=void 0,i=(0,_.parseContentType)(t);if(/^(video|audio)\/mp2t$/i.test(i.type)){var n=[];i.parameters&&i.parameters.codecs&&(n=i.parameters.codecs.split(","),n=(0,_.translateLegacyCodecs)(n),n=n.filter(function(t){return(0,_.isAudioCodec)(t)||(0,_.isVideoCodec)(t)})),0===n.length&&(n=["avc1.4d400d","mp4a.40.2"]),e=new g.default(this,n),0!==this.sourceBuffers.length&&(this.sourceBuffers[0].createRealSourceBuffers_(),e.createRealSourceBuffers_(),this.sourceBuffers[0].audioDisabled_=!0)}else e=this.nativeMediaSource_.addSourceBuffer(t);return this.sourceBuffers.push(e),e}}]),e}(l.default.EventTarget);i.default=v,e.exports=i.default}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],9:[function(t,e,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0});var n=function(t,e,i){var n=void 0,a=void 0;if(i&&i.cues)for(n=i.cues.length;n--;)a=i.cues[n],a.startTime<=e&&a.endTime>=t&&i.removeCue(a)};i.default=n,e.exports=i.default},{}],10:[function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function a(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(i,"__esModule",{value:!0});var r=function(){function t(t,e){for(var i=0;in);a++);return t.slice(a)};i.gopsSafeToAlignWith=T;var w=function(t,e,i){if(!e.length)return t;if(i)return e.slice();var n=e[0].pts,a=0;for(a;a=n);a++);return t.slice(0,a).concat(e)};i.updateGopBuffer=w;var k=function(t,e,i,n){for(var a=Math.ceil(9e4*(e-n)),r=Math.ceil(9e4*(i-n)),s=t.slice(),o=t.length;o--&&!(t[o].pts<=r););if(-1===o)return s;for(var d=o+1;d--&&!(t[d].pts<=a););return d=Math.max(d,0),s.splice(d,o-d+1),s};i.removeGopBuffer=k;var A=function(t){function e(t,i){var n=this;a(this,e),o(Object.getPrototypeOf(e.prototype),"constructor",this).call(this,u.default.EventTarget),this.timestampOffset_=0,this.pendingBuffers_=[],this.bufferUpdating_=!1,this.mediaSource_=t,this.codecs_=i,this.audioCodec_=null,this.videoCodec_=null,this.audioDisabled_=!1,this.appendAudioInitSegment_=!0,this.gopBuffer_=[],this.timeMapping_=0,this.safeAppend_=u.default.browser.IE_VERSION>=11;var r={remux:!1,alignGopsAtEnd:this.safeAppend_};this.codecs_.forEach(function(t){(0,v.isAudioCodec)(t)?n.audioCodec_=t:(0,v.isVideoCodec)(t)&&(n.videoCodec_=t)}),this.transmuxer_=(0,g.default)(_.default,b()),this.transmuxer_.postMessage({action:"init",options:r}),this.transmuxer_.onmessage=function(t){return"data"===t.data.action?n.data_(t):"done"===t.data.action?n.done_(t):"gopInfo"===t.data.action?n.appendGopInfo_(t):void 0},Object.defineProperty(this,"timestampOffset",{get:function(){return this.timestampOffset_},set:function(t){"number"==typeof t&&t>=0&&(this.timestampOffset_=t,this.appendAudioInitSegment_=!0,this.gopBuffer_.length=0,this.timeMapping_=0,this.transmuxer_.postMessage({action:"setTimestampOffset",timestampOffset:t}))}}),Object.defineProperty(this,"appendWindowStart",{get:function(){return(this.videoBuffer_||this.audioBuffer_).appendWindowStart},set:function(t){this.videoBuffer_&&(this.videoBuffer_.appendWindowStart=t),this.audioBuffer_&&(this.audioBuffer_.appendWindowStart=t)}}),Object.defineProperty(this,"updating",{get:function(){return!!(this.bufferUpdating_||!this.audioDisabled_&&this.audioBuffer_&&this.audioBuffer_.updating||this.videoBuffer_&&this.videoBuffer_.updating)}}),Object.defineProperty(this,"buffered",{get:function(){var t=null,e=null,i=0,n=[],a=[];if(!this.videoBuffer_&&!this.audioBuffer_)return u.default.createTimeRange();if(!this.videoBuffer_)return this.audioBuffer_.buffered;if(!this.audioBuffer_)return this.videoBuffer_.buffered;if(this.audioDisabled_)return this.videoBuffer_.buffered;if(0===this.videoBuffer_.buffered.length&&0===this.audioBuffer_.buffered.length)return u.default.createTimeRange();for(var r=this.videoBuffer_.buffered,s=this.audioBuffer_.buffered,o=r.length;o--;)n.push({time:r.start(o),type:"start"}),n.push({time:r.end(o),type:"end"});for(o=s.length;o--;)n.push({time:s.start(o),type:"start"}),n.push({time:s.end(o),type:"end"});for(n.sort(function(t,e){return t.time-e.time}),o=0;o>4?i+20:i+10},this.parseAdtsSize=function(t,e){var i=(224&t[e+5])>>5,n=t[e+4]<<3;return 6144&t[e+3]|n|i},this.push=function(i){var n,a,r,s,o=0,d=0;for(t.length?(s=t.length,t=new Uint8Array(i.byteLength+s),t.set(t.subarray(0,s)),t.set(i,s)):t=i;t.length-d>=3;)if(t[d]!=="I".charCodeAt(0)||t[d+1]!=="D".charCodeAt(0)||t[d+2]!=="3".charCodeAt(0))if(!0&t[d]&&240==(240&t[d+1])){if(t.length-d<7)break;if((o=this.parseAdtsSize(t,d))>t.length)break;r={type:"audio",data:t.subarray(d,d+o),pts:e,dts:e},this.trigger("data",r),d+=o}else d++;else{if(t.length-d<10)break;if((o=this.parseId3TagSize(t,d))>t.length)break;a={type:"timed-metadata",data:t.subarray(d,d+o)},this.trigger("data",a),d+=o}n=t.length-d,t=n>0?t.subarray(d):new Uint8Array}},n.prototype=new a,e.exports=n},{}],16:[function(t,e,i){"use strict";var n,a=t(35),r=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];n=function(){var t;n.prototype.init.call(this),this.push=function(e){var i,n,a,s,o,d,u=0,h=0;if("audio"===e.type)for(t?(s=t,t=new Uint8Array(s.byteLength+e.data.byteLength),t.set(s),t.set(e.data,s.byteLength)):t=e.data;u+5>5,o=1024*(1+(3&t[u+6])),d=9e4*o/r[(60&t[u+2])>>>2],a=u+i,t.byteLength>>6&3),channelcount:(1&t[u+2])<<2|(192&t[u+3])>>>6,samplerate:r[(60&t[u+2])>>>2],samplingfrequencyindex:(60&t[u+2])>>>2,samplesize:16,data:t.subarray(u+7+n,a)}),t.byteLength===a)return void(t=void 0);h++,t=t.subarray(a)}else u++},this.flush=function(){this.trigger("done")}},n.prototype=new a,e.exports=n},{}],17:[function(t,e,i){"use strict";var n,a,r,s=t(35),o=t(34);a=function(){var t,e,i=0;a.prototype.init.call(this),this.push=function(n){var a;for(e?(a=new Uint8Array(e.byteLength+n.data.byteLength),a.set(e),a.set(n.data,e.byteLength),e=a):e=n.data;i3&&this.trigger("data",e.subarray(i+3)),e=null,i=0,this.trigger("done")}},a.prototype=new s,r={100:!0,110:!0,122:!0,244:!0,44:!0,83:!0,86:!0,118:!0,128:!0,138:!0,139:!0,134:!0},n=function(){var t,e,i,s,d,u,h,f=new a;n.prototype.init.call(this),t=this,this.push=function(t){"video"===t.type&&(e=t.trackId,i=t.pts,s=t.dts,f.push(t))},f.on("data",function(n){var a={trackId:e,pts:i,dts:s,data:n};switch(31&n[0]){case 5:a.nalUnitType="slice_layer_without_partitioning_rbsp_idr";break;case 6:a.nalUnitType="sei_rbsp",a.escapedRBSP=d(n.subarray(1));break;case 7:a.nalUnitType="seq_parameter_set_rbsp",a.escapedRBSP=d(n.subarray(1)),a.config=u(a.escapedRBSP);break;case 8:a.nalUnitType="pic_parameter_set_rbsp";break;case 9:a.nalUnitType="access_unit_delimiter_rbsp"}t.trigger("data",a)}),f.on("done",function(){t.trigger("done")}),this.flush=function(){f.flush()},h=function(t,e){var i,n,a=8,r=8;for(i=0;i0)throw new Error("Attempted to create new NAL wihout closing the old one");a=this.length,this.length+=4,this.position=this.length},this.endNalUnit=function(t){var e,i;this.length===a+4?this.length-=4:a>0&&(e=a+4,i=this.length-e,this.position=a,this.view.setUint32(this.position,i),this.position=this.length,t&&t.push(this.bytes.subarray(e,e+i))),a=0},this.writeMetaDataDouble=function(t,e){var i;if(s(this,2+t.length+9),this.view.setUint16(this.position,t.length),this.position+=2,"width"===t)this.bytes.set(o,this.position),this.position+=5;else if("height"===t)this.bytes.set(d,this.position),this.position+=6;else if("videocodecid"===t)this.bytes.set(u,this.position),this.position+=12;else for(i=0;i>>16,this.bytes[14]=(65280&t)>>>8,this.bytes[15]=(255&t)>>>0;break;case n.AUDIO_TAG:this.bytes[11]=175,this.bytes[12]=e?0:1;break;case n.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,110,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,a),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,s(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=n.frameTime(this.bytes),this}},n.AUDIO_TAG=8,n.VIDEO_TAG=9,n.METADATA_TAG=18,n.isAudioFrame=function(t){return n.AUDIO_TAG===t[0]},n.isVideoFrame=function(t){return n.VIDEO_TAG===t[0]},n.isMetaData=function(t){return n.METADATA_TAG===t[0]},n.isKeyFrame=function(t){return n.isVideoFrame(t)?23===t[11]:!!n.isAudioFrame(t)||!!n.isMetaData(t)},n.frameTime=function(t){var e=t[4]<<16;return e|=t[5]<<8,e|=t[6]<<0,e|=t[7]<<24},e.exports=n},{}],22:[function(t,e,i){e.exports={tag:t(21),Transmuxer:t(24),getFlvHeader:t(20)}},{}],23:[function(t,e,i){"use strict";var n=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}})};e.exports=n},{}],24:[function(t,e,i){"use strict";var n,a,r,s,o,d,u=t(35),h=t(21),f=t(26),p=t(16),c=t(17).H264Stream,l=t(19),m=t(23);s=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))},o=function(t,e){var i=new h(h.METADATA_TAG);return i.dts=e,i.pts=e,i.writeMetaDataDouble("videocodecid",7),i.writeMetaDataDouble("width",t.width),i.writeMetaDataDouble("height",t.height),i},d=function(t,e){var i,n=new h(h.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=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 h(h.AUDIO_TAG),r.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 h(h.METADATA_TAG),n.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 h(h.AUDIO_TAG,!0),n.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)}},r.prototype=new u,a=function(t){var e,i,n=[];a.prototype.init.call(this),this.finishFrame=function(n,a){if(a){if(e&&t&&t.newMetadata&&(a.keyFrame||0===n.length)){var r=o(e,a.dts).finalize(),s=d(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){s(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 m;n.length&&"access_unit_delimiter_rbsp"!==n[0].nalUnitType;)n.shift();if(0===n.length)return void this.trigger("done","VideoSegmentStream");for(;n.length;)a=n.shift(),"seq_parameter_set_rbsp"===a.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 h(h.VIDEO_TAG),i.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")}},a.prototype=new u,n=function(t){var e,i,s,o,d,u,h,m,g,y,_,v,b=this;n.prototype.init.call(this),t=t||{},this.metadataStream=new f.MetadataStream,t.metadataStream=this.metadataStream,e=new f.TransportPacketStream,i=new f.TransportParseStream,s=new f.ElementaryStream,o=new f.TimestampRolloverStream("video"),d=new f.TimestampRolloverStream("audio"),u=new f.TimestampRolloverStream("timed-metadata"),h=new p,m=new c,v=new l(t),e.pipe(i).pipe(s),s.pipe(o).pipe(m),s.pipe(d).pipe(h),s.pipe(u).pipe(this.metadataStream).pipe(v),_=new f.CaptionStream,m.pipe(_).pipe(v),s.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&&!g&&(v.numberOfTracks++,g=new a(i),m.pipe(g).pipe(v)),n&&!y&&(v.numberOfTracks++,y=new r(n),h.pipe(y).pipe(v),g&&g.on("keyframe",y.onVideoKeyFrame))}}),this.push=function(t){e.push(t)},this.flush=function(){e.flush()},this.resetCaptions=function(){_.reset()},v.on("data",function(t){b.trigger("data",t)}),v.on("done",function(){b.trigger("done")})},n.prototype=new u,e.exports=n},{}],25:[function(t,e,i){"use strict";var n=t(35),a=function(t){for(var e=0,i={payloadType:-1,payloadSize:0},n=0,a=0;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.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.topRow_=13,this.mode_="rollUp";else if(e===this.ROLL_UP_3_ROWS_)this.topRow_=12,this.mode_="rollUp";else if(e===this.ROLL_UP_4_ROWS_)this.topRow_=11,this.mode_="rollUp";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_[14]=this.nonDisplayed_[14].slice(0,-1):this.displayed_[14]=this.displayed_[14].slice(0,-1);else if(e===this.ERASE_DISPLAYED_MEMORY_)this.flushDisplayed(t.pts),this.displayed_=f();else if(e===this.ERASE_NON_DISPLAYED_MEMORY_)this.nonDisplayed_=f();else if(e===this.RESUME_DIRECT_CAPTIONING_)this.mode_="paintOn";else if(this.isSpecialCharacter(n,a))n=(3&n)<<8,r=u(n|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_[14]=this.displayed_[14].slice(0,-1),n=(3&n)<<8,r=u(n|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==(14&a)&&this.addFormatting(t.pts,["i"]),1==(1&a)&&this.addFormatting(t.pts,["u"]);else if(this.isOffsetControlCode(n,a))this.column_+=3&a;else if(this.isPAC(n,a)){var s=h.indexOf(7968&e);s!==this.row_&&(this.clearFormatting(t.pts),this.row_=s),1&a&&-1===this.formatting_.indexOf("u")&&this.addFormatting(t.pts,["u"]),16==(16&e)&&(this.column_=4*((14&e)>>1)),this.isColorPAC(a)&&14==(14&a)&&this.addFormatting(t.pts,["i"])}else this.isNormalChar(n)&&(0===a&&(a=null),r=u(n),r+=u(a),this[this.mode_](t.pts,r),this.column_+=r.length)}};p.prototype=new n,p.prototype.flushDisplayed=function(t){var e=this.displayed_.map(function(t){return t.trim()}).join("\n").replace(/^\n+|\n+$/g,"");e.length&&this.trigger("data",{startPts:this.startPts_,endPts:t,text:e,stream:this.name_})},p.prototype.reset=function(){this.mode_="popOn",this.topRow_=0,this.startPts_=0,this.displayed_=f(),this.nonDisplayed_=f(),this.lastControlCode_=null,this.column_=0,this.row_=14,this.formatting_=[]},p.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_},p.prototype.isSpecialCharacter=function(t,e){return t===this.EXT_&&e>=48&&e<=63},p.prototype.isExtCharacter=function(t,e){return(t===this.EXT_+1||t===this.EXT_+2)&&e>=32&&e<=63},p.prototype.isMidRowCode=function(t,e){return t===this.EXT_&&e>=32&&e<=47},p.prototype.isOffsetControlCode=function(t,e){return t===this.OFFSET_&&e>=33&&e<=35},p.prototype.isPAC=function(t,e){return t>=this.BASE_&&t=64&&e<=127},p.prototype.isColorPAC=function(t){return t>=64&&t<=79||t>=96&&t<=127},p.prototype.isNormalChar=function(t){return t>=32&&t<=127},p.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)},p.prototype.clearFormatting=function(t){if(this.formatting_.length){var e=this.formatting_.reverse().reduce(function(t,e){return t+""},"");this.formatting_=[],this[this.mode_](t,e)}},p.prototype.popOn=function(t,e){var i=this.nonDisplayed_[this.row_];i+=e,this.nonDisplayed_[this.row_]=i},p.prototype.rollUp=function(t,e){var i=this.displayed_[14];i+=e,this.displayed_[14]=i},p.prototype.shiftRowsUp_=function(){var t;for(t=0;t>>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=d.H264_STREAM_TYPE:i.pid===this.programMapTable.audio?i.streamType=d.ADTS_STREAM_TYPE:i.streamType=this.programMapTable["timed-metadata"][i.pid],i.type="pes",i.data=t.subarray(e),this.trigger("data",i)}},a.prototype=new s,a.STREAM_TYPES={h264:27,adts:15},r=function(){var t=this,e={data:[],size:0},i={data:[],size:0},n={data:[],size:0},a=function(t,e){var i;e.packetLength=6+(t[4]<<8|t[5]),e.dataAlignmentIndicator=0!=(4&t[6]),i=t[7],192&i&&(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(e,i,n){var r,s=new Uint8Array(e.size),o={type:i},d=0,u=0,h=!1;if(e.data.length&&!(e.size<9)){for(o.trackId=e.data[0].pid,d=0;d>>2;l*=4,l+=3&c[7],d.timeStamp=l,void 0===e.pts&&void 0===e.dts&&(e.pts=d.timeStamp,e.dts=d.timeStamp),this.trigger("timestamp",d)}e.frames.push(d),n+=10,n+=r}while(ne&&(i=-1);Math.abs(e-t)>4294967296;)t+=8589934592*i;return t},r=function(t){var e,i;r.prototype.init.call(this),this.type_=t,this.push=function(t){t.type===this.type_&&(void 0===i&&(i=t.dts),t.dts=a(t.dts,i),t.pts=a(t.pts,i),e=t.dts,this.trigger("data",t))},this.flush=function(){i=e,this.trigger("done")},this.discontinuity=function(){i=void 0,e=void 0}};r.prototype=new n,e.exports={TimestampRolloverStream:r,handleRollover:a}},{}],30:[function(t,e,i){e.exports={generator:t(31),Transmuxer:t(32).Transmuxer,AudioSegmentStream:t(32).AudioSegmentStream,VideoSegmentStream:t(32).VideoSegmentStream}},{}],31:[function(t,e,i){"use strict";var n,a,r,s,o,d,u,h,f,p,c,l,m,g,y,_,v,b,S,T,w,k,A,O,M,E,C,x,B,D,P,U,L,R,I,j,N=Math.pow(2,32)-1;!function(){var t;if(A={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],mvex:[],mvhd:[],sdtp:[],smhd:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],styp:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[]},"undefined"!=typeof Uint8Array){for(t in A)A.hasOwnProperty(t)&&(A[t]=[t.charCodeAt(0),t.charCodeAt(1),t.charCodeAt(2),t.charCodeAt(3)]);O=new Uint8Array(["i".charCodeAt(0),"s".charCodeAt(0),"o".charCodeAt(0),"m".charCodeAt(0)]),E=new Uint8Array(["a".charCodeAt(0),"v".charCodeAt(0),"c".charCodeAt(0),"1".charCodeAt(0)]),M=new Uint8Array([0,0,0,1]),C=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),x=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]),B={video:C,audio:x},U=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),P=new Uint8Array([0,0,0,0,0,0,0,0]),L=new Uint8Array([0,0,0,0,0,0,0,0]),R=L,I=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),j=L,D=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}}(),n=function(t){var e,i,n,a=[],r=0;for(e=1;e>>1,t.samplingfrequencyindex<<7|t.channelcount<<3,6,1,2]))},s=function(){return n(A.ftyp,O,M,O,E)},_=function(t){return n(A.hdlr,B[t])},o=function(t){return n(A.mdat,t)},y=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),n(A.mdhd,e)},g=function(t){return n(A.mdia,y(t),_(t.type),u(t))},d=function(t){return n(A.mfhd,new Uint8Array([0,0,0,0,(4278190080&t)>>24,(16711680&t)>>16,(65280&t)>>8,255&t]))},u=function(t){return n(A.minf,"video"===t.type?n(A.vmhd,D):n(A.smhd,P),a(),b(t))},h=function(t,e){for(var i=[],a=e.length;a--;)i[a]=T(e[a]);return n.apply(null,[A.moof,d(t)].concat(i))},f=function(t){for(var e=t.length,i=[];e--;)i[e]=l(t[e]);return n.apply(null,[A.moov,c(4294967295)].concat(i).concat(p(t)))},p=function(t){for(var e=t.length,i=[];e--;)i[e]=w(t[e]);return n.apply(null,[A.mvex].concat(i))},c=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 n(A.mvhd,e)},v=function(t){var e,i,a=t.samples||[],r=new Uint8Array(4+a.length);for(i=0;i>>8),r.push(255&i[e].byteLength),r=r.concat(Array.prototype.slice.call(i[e]));for(e=0;e>>8),s.push(255&a[e].byteLength),s=s.concat(Array.prototype.slice.call(a[e]));return n(A.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]),n(A.avcC,new Uint8Array([1,t.profileIdc,t.profileCompatibility,t.levelIdc,255].concat([i.length]).concat(r).concat([a.length]).concat(s))),n(A.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])))},e=function(t){return n(A.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]),r(t))}}(),m=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 n(A.tkhd,e)},T=function(t){var e,i,a,r,s,o,d;return e=n(A.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])),o=Math.floor(t.baseMediaDecodeTime/(N+1)),d=Math.floor(t.baseMediaDecodeTime%(N+1)),i=n(A.tfdt,new Uint8Array([1,0,0,0,o>>>24&255,o>>>16&255,o>>>8&255,255&o,d>>>24&255,d>>>16&255,d>>>8&255,255&d])),s=92,"audio"===t.type?(a=k(t,s),n(A.traf,e,i,a)):(r=v(t),a=k(t,r.length+s),n(A.traf,e,i,a,r))},l=function(t){return t.duration=t.duration||4294967295,n(A.trak,m(t),g(t))},w=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),n(A.trex,e)},function(){var t,e,i;i=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]},e=function(t,e){var a,r,s,o;for(r=t.samples||[],e+=20+16*r.length,a=i(r,e),o=0;o>>24,(16711680&s.duration)>>>16,(65280&s.duration)>>>8,255&s.duration,(4278190080&s.size)>>>24,(16711680&s.size)>>>16,(65280&s.size)>>>8,255&s.size,s.flags.isLeading<<2|s.flags.dependsOn,s.flags.isDependedOn<<6|s.flags.hasRedundancy<<4|s.flags.paddingValue<<1|s.flags.isNonSyncSample,61440&s.flags.degradationPriority,15&s.flags.degradationPriority,(4278190080&s.compositionTimeOffset)>>>24,(16711680&s.compositionTimeOffset)>>>16,(65280&s.compositionTimeOffset)>>>8,255&s.compositionTimeOffset]);return n(A.trun,new Uint8Array(a))},t=function(t,e){var a,r,s,o;for(r=t.samples||[],e+=20+8*r.length,a=i(r,e),o=0;o>>24,(16711680&s.duration)>>>16,(65280&s.duration)>>>8,255&s.duration,(4278190080&s.size)>>>24,(16711680&s.size)>>>16,(65280&s.size)>>>8,255&s.size]);return n(A.trun,new Uint8Array(a))},k=function(i,n){return"audio"===i.type?t(i,n):e(i,n)}}(),e.exports={ftyp:s,mdat:o,moof:h,moov:f,initSegment:function(t){var e,i=s(),n=f(t);return e=new Uint8Array(i.byteLength+n.byteLength),e.set(i),e.set(n,i.byteLength),e}}},{}],32:[function(t,e,i){"use strict";var n,a,r,s,o,d,u,h,f,p,c,l=t(35),m=t(31),g=t(26),y=t(16),_=t(17).H264Stream,v=t(15),b=t(18),S=t(33),T=["audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize"],w=["width","height","profileIdc","levelIdc","profileCompatibility"];o=function(){return{size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0}}},d=function(t){return t[0]==="I".charCodeAt(0)&&t[1]==="D".charCodeAt(0)&&t[2]==="3".charCodeAt(0)},p=function(t,e){var i;if(t.length!==e.length)return!1;for(i=0;i45e3))){for(n=b[t.samplerate],n||(n=e[0].data),a=0;a=n?e:(t.minSegmentDts=1/0,e.filter(function(e){return e.dts>=n&&(t.minSegmentDts=Math.min(t.minSegmentDts,e.dts),t.minSegmentPts=t.minSegmentDts,!0)}))},this.generateSampleTable_=function(t){var e,i,n=[];for(e=0;e=-1e4&&i<=45e3&&(!n||o>i)&&(n=r,o=i));return n?n.gop:null},this.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},this.groupNalsIntoFrames_=function(t){var e,i,n=[],a=[];for(n.byteLength=0,e=0;en.pts?e++:(i++,r-=a.byteLength,s-=a.nalCount,o-=a.duration);return 0===i?t:i===t.length?null:(u=t.slice(i),u.byteLength=r,u.duration=o,u.nalCount=s,u.pts=u[0].pts,u.dts=u[0].dts,u)},this.alignGopsAtEnd_=function(t){var e,i,n,a,r,s;for(e=d.length-1,i=t.length-1,r=null,s=!1;e>=0&&i>=0;){if(n=d[e],a=t[i],n.pts===a.pts){s=!0;break}n.pts>a.pts?e--:(e===d.length-1&&(r=i),i--)}if(!s&&null===r)return null;var o;if(0===(o=s?i:r))return t;var u=t.slice(o),h=u.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 u.byteLength=h.byteLength,u.duration=h.duration,u.nalCount=h.nalCount,u.pts=u[0].pts,u.dts=u[0].dts,u},this.alignGopsWith=function(t){d=t}},n.prototype=new l,u=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))},h=function(t){delete t.minSegmentDts,delete t.maxSegmentDts,delete t.minSegmentPts,delete t.maxSegmentPts},f=function(t){var e,i,n=t.minSegmentDts-t.timelineStartInfo.dts;return e=t.timelineStartInfo.baseMediaDecodeTime,e+=n,e=Math.max(0,e),"audio"===t.type&&(i=t.samplerate/9e4,e*=i,e=Math.floor(e)),e},s=function(t,e){this.numberOfTracks=0,this.metadataStream=e,void 0!==t.remux?this.remuxTracks=!!t.remux:this.remuxTracks=!0,this.pendingTracks=[],this.videoTrack=null,this.pendingBoxes=[],this.pendingCaptions=[],this.pendingMetadata=[],this.pendingBytes=0,this.emittedTracks=0,s.prototype.init.call(this),this.push=function(t){return t.text?this.pendingCaptions.push(t):t.frames?this.pendingMetadata.push(t):(this.pendingTracks.push(t.track),this.pendingBoxes.push(t.boxes),this.pendingBytes+=t.boxes.byteLength,"video"===t.track.type&&(this.videoTrack=t.track),void("audio"===t.track.type&&(this.audioTrack=t.track)))}},s.prototype=new l,s.prototype.flush=function(t){var e,i,n,a,r=0,s={captions:[],captionStreams:{},metadata:[],info:{}},o=0;if(this.pendingTracks.length=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0))}for(this.videoTrack?(o=this.videoTrack.timelineStartInfo.pts,w.forEach(function(t){s.info[t]=this.videoTrack[t]},this)):this.audioTrack&&(o=this.audioTrack.timelineStartInfo.pts,T.forEach(function(t){s.info[t]=this.audioTrack[t]},this)),1===this.pendingTracks.length?s.type=this.pendingTracks[0].type:s.type="combined",this.emittedTracks+=this.pendingTracks.length,n=m.initSegment(this.pendingTracks),s.initSegment=new Uint8Array(n.byteLength),s.initSegment.set(n),s.data=new Uint8Array(this.pendingBytes),a=0;a=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0)},r=function(t){var e,i,o=this,u=!0;r.prototype.init.call(this),t=t||{},this.baseMediaDecodeTime=t.baseMediaDecodeTime||0,this.transmuxPipeline_={},this.setupAacPipeline=function(){var e={};this.transmuxPipeline_=e,e.type="aac",e.metadataStream=new g.MetadataStream,e.aacStream=new v,e.audioTimestampRolloverStream=new g.TimestampRolloverStream("audio"),e.timedMetadataTimestampRolloverStream=new g.TimestampRolloverStream("timed-metadata"),e.adtsStream=new y,e.coalesceStream=new s(t,e.metadataStream),e.headOfPipeline=e.aacStream,e.aacStream.pipe(e.audioTimestampRolloverStream).pipe(e.adtsStream),e.aacStream.pipe(e.timedMetadataTimestampRolloverStream).pipe(e.metadataStream).pipe(e.coalesceStream),e.metadataStream.on("timestamp",function(t){e.aacStream.setTimestamp(t.timeStamp)}),e.aacStream.on("data",function(t){"timed-metadata"!==t.type||e.audioSegmentStream||(i=i||{timelineStartInfo:{baseMediaDecodeTime:o.baseMediaDecodeTime},codec:"adts",type:"audio"},e.coalesceStream.numberOfTracks++,e.audioSegmentStream=new a(i),e.adtsStream.pipe(e.audioSegmentStream).pipe(e.coalesceStream))}),e.coalesceStream.on("data",this.trigger.bind(this,"data")),e.coalesceStream.on("done",this.trigger.bind(this,"done"))},this.setupTsPipeline=function(){var r={};this.transmuxPipeline_=r,r.type="ts",r.metadataStream=new g.MetadataStream,r.packetStream=new g.TransportPacketStream,r.parseStream=new g.TransportParseStream,r.elementaryStream=new g.ElementaryStream,r.videoTimestampRolloverStream=new g.TimestampRolloverStream("video"),r.audioTimestampRolloverStream=new g.TimestampRolloverStream("audio"),r.timedMetadataTimestampRolloverStream=new g.TimestampRolloverStream("timed-metadata"),r.adtsStream=new y,r.h264Stream=new _,r.captionStream=new g.CaptionStream,r.coalesceStream=new s(t,r.metadataStream),r.headOfPipeline=r.packetStream,r.packetStream.pipe(r.parseStream).pipe(r.elementaryStream),r.elementaryStream.pipe(r.videoTimestampRolloverStream).pipe(r.h264Stream),r.elementaryStream.pipe(r.audioTimestampRolloverStream).pipe(r.adtsStream),r.elementaryStream.pipe(r.timedMetadataTimestampRolloverStream).pipe(r.metadataStream).pipe(r.coalesceStream),r.h264Stream.pipe(r.captionStream).pipe(r.coalesceStream),r.elementaryStream.on("data",function(s){var d;if("metadata"===s.type){for(d=s.tracks.length;d--;)e||"video"!==s.tracks[d].type?i||"audio"!==s.tracks[d].type||(i=s.tracks[d],i.timelineStartInfo.baseMediaDecodeTime=o.baseMediaDecodeTime):(e=s.tracks[d],e.timelineStartInfo.baseMediaDecodeTime=o.baseMediaDecodeTime);e&&!r.videoSegmentStream&&(r.coalesceStream.numberOfTracks++,r.videoSegmentStream=new n(e,t),r.videoSegmentStream.on("timelineStartInfo",function(t){i&&(i.timelineStartInfo=t,r.audioSegmentStream.setEarliestDts(t.dts))}),r.videoSegmentStream.on("processedGopsInfo",o.trigger.bind(o,"gopInfo")),r.videoSegmentStream.on("baseMediaDecodeTime",function(t){i&&r.audioSegmentStream.setVideoBaseMediaDecodeTime(t)}),r.h264Stream.pipe(r.videoSegmentStream).pipe(r.coalesceStream)),i&&!r.audioSegmentStream&&(r.coalesceStream.numberOfTracks++,r.audioSegmentStream=new a(i),r.adtsStream.pipe(r.audioSegmentStream).pipe(r.coalesceStream))}}),r.coalesceStream.on("data",this.trigger.bind(this,"data")),r.coalesceStream.on("done",this.trigger.bind(this,"done"))},this.setBaseMediaDecodeTime=function(t){var n=this.transmuxPipeline_;this.baseMediaDecodeTime=t,i&&(i.timelineStartInfo.dts=void 0,i.timelineStartInfo.pts=void 0,h(i),i.timelineStartInfo.baseMediaDecodeTime=t,n.audioTimestampRolloverStream&&n.audioTimestampRolloverStream.discontinuity()),e&&(n.videoSegmentStream&&(n.videoSegmentStream.gopCache_=[],n.videoTimestampRolloverStream.discontinuity()),e.timelineStartInfo.dts=void 0,e.timelineStartInfo.pts=void 0,h(e),n.captionStream.reset(),e.timelineStartInfo.baseMediaDecodeTime=t),n.timedMetadataTimestampRolloverStream&&n.timedMetadataTimestampRolloverStream.discontinuity()},this.setAudioAppendStart=function(t){i&&this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(t)},this.alignGopsWith=function(t){e&&this.transmuxPipeline_.videoSegmentStream&&this.transmuxPipeline_.videoSegmentStream.alignGopsWith(t)},this.push=function(t){if(u){var e=d(t);e&&"aac"!==this.transmuxPipeline_.type?this.setupAacPipeline():e||"ts"===this.transmuxPipeline_.type||this.setupTsPipeline(),u=!1}this.transmuxPipeline_.headOfPipeline.push(t)},this.flush=function(){u=!0,this.transmuxPipeline_.headOfPipeline.flush()},this.resetCaptions=function(){this.transmuxPipeline_.captionStream&&this.transmuxPipeline_.captionStream.reset()}},r.prototype=new l,e.exports={Transmuxer:r,VideoSegmentStream:n,AudioSegmentStream:a,AUDIO_PROPERTIES:T,VIDEO_PROPERTIES:w}},{}],33:[function(t,e,i){var n,a,r,s,o,d;n=function(t){return 9e4*t},a=function(t,e){return t*e},r=function(t){return t/9e4},s=function(t,e){return t/e},o=function(t,e){return n(s(t,e))},d=function(t,e){return a(r(t),e)},e.exports={secondsToVideoTs:n,secondsToAudioTs:a,videoTsToSeconds:r,audioTsToSeconds:s,audioTsToVideoTs:o,videoTsToAudioTs:d}},{}],34:[function(t,e,i){"use strict";var n;n=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 new 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?(i<<=t,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,n>0?i<<=a:e>0&&this.loadWord(),a=t-a,a>0?r<>>t))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()},e.exports=n},{}],35:[function(t,e,i){"use strict";var n=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(a=i.length,n=0;n