(window.webpackJsonp=window.webpackJsonp||[]).push([[82],{293:function(t,e,n){"use strict";var r,o,m,d,h,l,c,S,f,y,T,v=n(79),_=n(442),k=n(435),D=n(436),x=n(437).H264Stream,M=n(865),L=n(866),C=n(867),P=["audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize"],w=["width","height","profileIdc","levelIdc","profileCompatibility"],I=9e4;h=function(){return{size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0}}},l=function(data){return data[0]==="I".charCodeAt(0)&&data[1]==="D".charCodeAt(0)&&data[2]==="3".charCodeAt(0)},y=function(a,b){var i;if(a.length!==b.length)return!1;for(i=0;i45e3))){for((o=L[track.samplerate])||(o=t[0].data),i=0;i=n?t:(track.minSegmentDts=1/0,t.filter(function(t){return t.dts>=n&&(track.minSegmentDts=Math.min(track.minSegmentDts,t.dts),track.minSegmentPts=track.minSegmentDts,!0)}))},this.generateSampleTable_=function(t){var i,e,n=[];for(i=0;i=-1e4&&e<=45e3&&(!n||m>e)&&(n=o,m=e));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 i,e,n=[],r=[];for(n.byteLength=0,i=0;ir.pts?e++:(n++,m-=o.byteLength,h-=o.nalCount,l-=o.duration);return 0===n?t:n===t.length?null:((c=t.slice(n)).byteLength=m,c.duration=l,c.nalCount=h,c.pts=c[0].pts,c.dts=c[0].dts,c)},this.alignGopsAtEnd_=function(t){var e,n,r,o,m,h,l;for(e=d.length-1,n=t.length-1,m=null,h=!1;e>=0&&n>=0;){if(r=d[e],o=t[n],r.pts===o.pts){h=!0;break}r.pts>o.pts?e--:(e===d.length-1&&(m=n),n--)}if(!h&&null===m)return null;if(0===(l=h?n:m))return t;var c=t.slice(l),S=c.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 c.byteLength=S.byteLength,c.duration=S.duration,c.nalCount=S.nalCount,c.pts=c[0].pts,c.dts=c[0].dts,c},this.alignGopsWith=function(t){d=t}}).prototype=new v,c=function(track,data){"number"==typeof data.pts&&(void 0===track.timelineStartInfo.pts&&(track.timelineStartInfo.pts=data.pts),void 0===track.minSegmentPts?track.minSegmentPts=data.pts:track.minSegmentPts=Math.min(track.minSegmentPts,data.pts),void 0===track.maxSegmentPts?track.maxSegmentPts=data.pts:track.maxSegmentPts=Math.max(track.maxSegmentPts,data.pts)),"number"==typeof data.dts&&(void 0===track.timelineStartInfo.dts&&(track.timelineStartInfo.dts=data.dts),void 0===track.minSegmentDts?track.minSegmentDts=data.dts:track.minSegmentDts=Math.min(track.minSegmentDts,data.dts),void 0===track.maxSegmentDts?track.maxSegmentDts=data.dts:track.maxSegmentDts=Math.max(track.maxSegmentDts,data.dts))},S=function(track){delete track.minSegmentDts,delete track.maxSegmentDts,delete track.minSegmentPts,delete track.maxSegmentPts},f=function(track){var t,e=track.minSegmentDts-track.timelineStartInfo.dts;return t=track.timelineStartInfo.baseMediaDecodeTime,t+=e,t=Math.max(0,t),"audio"===track.type&&(t*=track.samplerate/I,t=Math.floor(t)),t},(d=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,d.prototype.init.call(this),this.push=function(output){return output.text?this.pendingCaptions.push(output):output.frames?this.pendingMetadata.push(output):(this.pendingTracks.push(output.track),this.pendingBoxes.push(output.boxes),this.pendingBytes+=output.boxes.byteLength,"video"===output.track.type&&(this.videoTrack=output.track),void("audio"===output.track.type&&(this.audioTrack=output.track)))}}).prototype=new v,d.prototype.flush=function(t){var caption,e,n,i,r=0,o={captions:[],captionStreams:{},metadata:[],info:{}},m=0;if(this.pendingTracks.length=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0))}for(this.videoTrack?(m=this.videoTrack.timelineStartInfo.pts,w.forEach(function(t){o.info[t]=this.videoTrack[t]},this)):this.audioTrack&&(m=this.audioTrack.timelineStartInfo.pts,P.forEach(function(t){o.info[t]=this.audioTrack[t]},this)),1===this.pendingTracks.length?o.type=this.pendingTracks[0].type:o.type="combined",this.emittedTracks+=this.pendingTracks.length,n=_.initSegment(this.pendingTracks),o.initSegment=new Uint8Array(n.byteLength),o.initSegment.set(n),o.data=new Uint8Array(this.pendingBytes),i=0;i=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0)},(m=function(t){var e,n,h=this,c=!0;m.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 k.MetadataStream,e.aacStream=new M,e.audioTimestampRolloverStream=new k.TimestampRolloverStream("audio"),e.timedMetadataTimestampRolloverStream=new k.TimestampRolloverStream("timed-metadata"),e.adtsStream=new D,e.coalesceStream=new d(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(data){"timed-metadata"!==data.type||e.audioSegmentStream||(n=n||{timelineStartInfo:{baseMediaDecodeTime:h.baseMediaDecodeTime},codec:"adts",type:"audio"},e.coalesceStream.numberOfTracks++,e.audioSegmentStream=new o(n),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 m={};this.transmuxPipeline_=m,m.type="ts",m.metadataStream=new k.MetadataStream,m.packetStream=new k.TransportPacketStream,m.parseStream=new k.TransportParseStream,m.elementaryStream=new k.ElementaryStream,m.videoTimestampRolloverStream=new k.TimestampRolloverStream("video"),m.audioTimestampRolloverStream=new k.TimestampRolloverStream("audio"),m.timedMetadataTimestampRolloverStream=new k.TimestampRolloverStream("timed-metadata"),m.adtsStream=new D,m.h264Stream=new x,m.captionStream=new k.CaptionStream,m.coalesceStream=new d(t,m.metadataStream),m.headOfPipeline=m.packetStream,m.packetStream.pipe(m.parseStream).pipe(m.elementaryStream),m.elementaryStream.pipe(m.videoTimestampRolloverStream).pipe(m.h264Stream),m.elementaryStream.pipe(m.audioTimestampRolloverStream).pipe(m.adtsStream),m.elementaryStream.pipe(m.timedMetadataTimestampRolloverStream).pipe(m.metadataStream).pipe(m.coalesceStream),m.h264Stream.pipe(m.captionStream).pipe(m.coalesceStream),m.elementaryStream.on("data",function(data){var i;if("metadata"===data.type){for(i=data.tracks.length;i--;)e||"video"!==data.tracks[i].type?n||"audio"!==data.tracks[i].type||((n=data.tracks[i]).timelineStartInfo.baseMediaDecodeTime=h.baseMediaDecodeTime):(e=data.tracks[i]).timelineStartInfo.baseMediaDecodeTime=h.baseMediaDecodeTime;e&&!m.videoSegmentStream&&(m.coalesceStream.numberOfTracks++,m.videoSegmentStream=new r(e,t),m.videoSegmentStream.on("timelineStartInfo",function(t){n&&(n.timelineStartInfo=t,m.audioSegmentStream.setEarliestDts(t.dts))}),m.videoSegmentStream.on("processedGopsInfo",h.trigger.bind(h,"gopInfo")),m.videoSegmentStream.on("baseMediaDecodeTime",function(t){n&&m.audioSegmentStream.setVideoBaseMediaDecodeTime(t)}),m.h264Stream.pipe(m.videoSegmentStream).pipe(m.coalesceStream)),n&&!m.audioSegmentStream&&(m.coalesceStream.numberOfTracks++,m.audioSegmentStream=new o(n),m.adtsStream.pipe(m.audioSegmentStream).pipe(m.coalesceStream))}}),m.coalesceStream.on("data",this.trigger.bind(this,"data")),m.coalesceStream.on("done",this.trigger.bind(this,"done"))},this.setBaseMediaDecodeTime=function(t){var r=this.transmuxPipeline_;this.baseMediaDecodeTime=t,n&&(n.timelineStartInfo.dts=void 0,n.timelineStartInfo.pts=void 0,S(n),n.timelineStartInfo.baseMediaDecodeTime=t,r.audioTimestampRolloverStream&&r.audioTimestampRolloverStream.discontinuity()),e&&(r.videoSegmentStream&&(r.videoSegmentStream.gopCache_=[],r.videoTimestampRolloverStream.discontinuity()),e.timelineStartInfo.dts=void 0,e.timelineStartInfo.pts=void 0,S(e),r.captionStream.reset(),e.timelineStartInfo.baseMediaDecodeTime=t),r.timedMetadataTimestampRolloverStream&&r.timedMetadataTimestampRolloverStream.discontinuity()},this.setAudioAppendStart=function(t){n&&this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(t)},this.alignGopsWith=function(t){e&&this.transmuxPipeline_.videoSegmentStream&&this.transmuxPipeline_.videoSegmentStream.alignGopsWith(t)},this.push=function(data){if(c){var t=l(data);t&&"aac"!==this.transmuxPipeline_.type?this.setupAacPipeline():t||"ts"===this.transmuxPipeline_.type||this.setupTsPipeline(),c=!1}this.transmuxPipeline_.headOfPipeline.push(data)},this.flush=function(){c=!0,this.transmuxPipeline_.headOfPipeline.flush()},this.resetCaptions=function(){this.transmuxPipeline_.captionStream&&this.transmuxPipeline_.captionStream.reset()}}).prototype=new v,t.exports={Transmuxer:m,VideoSegmentStream:r,AudioSegmentStream:o,AUDIO_PROPERTIES:P,VIDEO_PROPERTIES:w}}}]);