filesbox/web/dist/design/designstatic/chatroom/video/videojs-contrib-hls.min.js
2024-07-26 14:10:54 +08:00

13 lines
210 KiB
JavaScript

(function C(B,U,O){function A(S,b){if(!U[S]){if(!B[S]){var _=typeof require=="function"&&require;if(!b&&_)return _(S,!0);if(k)return k(S,!0);var l=new Error("Cannot find module '"+S+"'");throw l.code="MODULE_NOT_FOUND",l}var g=U[S]={exports:{}};B[S][0].call(g.exports,function(s){var u=B[S][1][s];return A(u||s)},g,g.exports,C,B,U,O)}return U[S].exports}for(var k=typeof require=="function"&&require,w=0;w<O.length;w++)A(O[w]);return A})({1:[function(C,B,U){"use strict";Object.defineProperty(U,"__esModule",{value:!0});var O=function(){function b(_,l){var g=[],s=!0,u=!1,i=void 0;try{for(var c,t=_[Symbol.iterator]();!(s=(c=t.next()).done)&&(g.push(c.value),!l||g.length!==l);s=!0);}catch(e){u=!0,i=e}finally{try{!s&&t.return&&t.return()}finally{if(u)throw i}}return g}return function(_,l){if(Array.isArray(_))return _;if(Symbol.iterator in Object(_))return b(_,l);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),A=C(30),k=function(b){return b&&b.__esModule?b:{default:b}}(A),w=function(b,_){for(var l=b.cues,g=0;g<l.length;g++){var s=l[g];if(_>=s.adStartTime&&_<=s.adEndTime)return s}return null},S=function(b,_){var l=arguments.length<=2||arguments[2]===void 0?0:arguments[2];if(b.segments)for(var g=l,s=void 0,u=0;u<b.segments.length;u++){var i=b.segments[u];if(s||(s=w(_,g+i.duration/2)),s){if("cueIn"in i){s.endTime=g,s.adEndTime=g,g+=i.duration,s=null;continue}if(g<s.endTime){g+=i.duration;continue}s.endTime+=i.duration}else if("cueOut"in i&&(s=new k.default.VTTCue(g,g+i.duration,i.cueOut),s.adStartTime=g,s.adEndTime=g+parseFloat(i.cueOut),_.addCue(s)),"cueOutCont"in i){var c=void 0,t=void 0,e=i.cueOutCont.split("/").map(parseFloat),r=O(e,2);c=r[0],t=r[1],s=new k.default.VTTCue(g,g+i.duration,""),s.adStartTime=g-c,s.adEndTime=s.adStartTime+t,_.addCue(s)}g+=i.duration}};U.default={updateAdCues:S,findAdCue:w},B.exports=U.default},{}],2:[function(C,B,U){"use strict";Object.defineProperty(U,"__esModule",{value:!0});var O=function(_,l){return _.start(l)+"-"+_.end(l)},A=function(_,l){var g=_.toString(16);return"00".substring(0,2-g.length)+g+(l%2?" ":"")},k=function(_){return _>=32&&_<126?String.fromCharCode(_):"."},w=function(_){var l={};return Object.keys(_).forEach(function(g){var s=_[g];ArrayBuffer.isView(s)?l[g]={bytes:s.buffer,byteOffset:s.byteOffset,byteLength:s.byteLength}:l[g]=s}),l},S=function(_){var l=_.byterange||{length:Infinity,offset:0};return[l.length,l.offset,_.resolvedUri].join(",")},b={hexDump:function(_){for(var l=Array.prototype.slice.call(_),g="",s=void 0,u=void 0,i=0;i<l.length/16;i++)s=l.slice(16*i,16*i+16).map(A).join(""),u=l.slice(16*i,16*i+16).map(k).join(""),g+=s+" "+u+`
`;return g},tagDump:function(_){return b.hexDump(_.bytes)},textRanges:function(_){var l="",g=void 0;for(g=0;g<_.length;g++)l+=O(_,g)+" ";return l},createTransferableMessage:w,initSegmentId:S};U.default=b,B.exports=U.default},{}],3:[function(C,B,U){"use strict";Object.defineProperty(U,"__esModule",{value:!0}),U.default={GOAL_BUFFER_LENGTH:30,MAX_GOAL_BUFFER_LENGTH:60,GOAL_BUFFER_LENGTH_RATE:1,BANDWIDTH_VARIANCE:1.2,BUFFER_LOW_WATER_LINE:0,MAX_BUFFER_LOW_WATER_LINE:30,BUFFER_LOW_WATER_LINE_RATE:1},B.exports=U.default},{}],4:[function(C,B,U){"use strict";Object.defineProperty(U,"__esModule",{value:!0});var O=C(30),A=function(b){return b&&b.__esModule?b:{default:b}}(O),k=C(23),w=C(2),S=function(b){b.onmessage=function(_){var l=_.data,g=new Uint8Array(l.encrypted.bytes,l.encrypted.byteOffset,l.encrypted.byteLength),s=new Uint32Array(l.key.bytes,l.key.byteOffset,l.key.byteLength/4),u=new Uint32Array(l.iv.bytes,l.iv.byteOffset,l.iv.byteLength/4);new k.Decrypter(g,s,u,function(i,c){A.default.postMessage((0,w.createTransferableMessage)({source:l.source,decrypted:c}),[c.buffer])})}};U.default=function(b){return new S(b)},B.exports=U.default},{}],5:[function(C,B,U){(function(O){"use strict";function A(G){return G&&G.__esModule?G:{default:G}}function k(G,F){if(!(G instanceof F))throw new TypeError("Cannot call a class as a function")}function w(G,F){if(typeof F!="function"&&F!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof F);G.prototype=Object.create(F&&F.prototype,{constructor:{value:G,enumerable:!1,writable:!0,configurable:!0}}),F&&(Object.setPrototypeOf?Object.setPrototypeOf(G,F):G.__proto__=F)}Object.defineProperty(U,"__esModule",{value:!0});var S=function(){function G(F,P){for(var x=0;x<P.length;x++){var D=P[x];D.enumerable=D.enumerable||!1,D.configurable=!0,"value"in D&&(D.writable=!0),Object.defineProperty(F,D.key,D)}}return function(F,P,x){return P&&G(F.prototype,P),x&&G(F,x),F}}(),b=function(G,F,P){for(var x=!0;x;){var D=G,R=F,j=P;x=!1,D===null&&(D=Function.prototype);var H=Object.getOwnPropertyDescriptor(D,R);if(H!==void 0){if("value"in H)return H.value;var Y=H.get;return Y===void 0?void 0:Y.call(j)}var K=Object.getPrototypeOf(D);if(K===null)return;G=K,F=R,P=j,x=!0,H=K=void 0}},_=C(8),l=A(_),g=C(15),s=A(g),u=C(18),i=A(u),c=C(11),t=A(c),e=typeof window!="undefined"?window.videojs:O!==void 0?O.videojs:null,r=A(e),n=C(1),p=A(n),a=C(17),m=A(a),h=C(64),f=C(75),o=A(f),v=C(4),T=A(v),E=C(3),y=A(E),d=void 0,L={videoCodec:"avc1",videoObjectTypeIndicator:".4d400d",audioProfile:"2"},I=["mediaRequests","mediaRequestsAborted","mediaRequestsTimedout","mediaRequestsErrored","mediaTransferDuration","mediaBytesTransferred"],M=function(G){return this.audioSegmentLoader_[G]+this.mainSegmentLoader_[G]},q=function(G,F){if(typeof G!=typeof F||Object.keys(G).length!==Object.keys(F).length)return!0;for(var P in G)if(G[P]!==F[P])return!0;return!1},V=function(G){var F={codecCount:0},P=void 0;return F.codecCount=G.split(",").length,F.codecCount=F.codecCount||2,P=/(^|\s|,)+(avc1)([^ ,]*)/i.exec(G),P&&(F.videoCodec=P[2],F.videoObjectTypeIndicator=P[3]),F.audioProfile=/(^|\s|,)+mp4a.[0-9A-Fa-f]+\.([0-9A-Fa-f]+)/i.exec(G),F.audioProfile=F.audioProfile&&F.audioProfile[2],F},W=function(G){return G.replace(/avc1\.(\d+)\.(\d+)/i,function(F){return(0,h.translateLegacyCodecs)([F])[0]})};U.mapLegacyAvcCodecs_=W;var X=function(G,F,P){return G+"/"+F+'; codecs="'+P.filter(function(x){return!!x}).join(", ")+'"'},$=function(G){return G.segments&&G.segments.length&&G.segments[0].map?"mp4":"mp2t"},Q=function(G){var F=G.attributes||{};return F.CODECS?V(F.CODECS):L},N=function(G,F){var P=$(F),x=Q(F),D=F.attributes||{},R=!0,j=!1;if(!F)return[];if(G.mediaGroups.AUDIO&&D.AUDIO){var H=G.mediaGroups.AUDIO[D.AUDIO];if(H){j=!0,R=!1;for(var Y in H)if(!H[Y].uri){R=!0;break}}}j&&!x.audioProfile&&(r.default.log.warn("Multiple audio tracks present but no audio codec string is specified. Attempting to use the default audio codec (mp4a.40.2)"),x.audioProfile=L.audioProfile);var K={};x.videoCodec&&(K.video=""+x.videoCodec+x.videoObjectTypeIndicator),x.audioProfile&&(K.audio="mp4a.40."+x.audioProfile);var Z=X("audio",P,[K.audio]),ee=X("video",P,[K.video]),J=X("video",P,[K.video,K.audio]);return j?!R&&K.video?[ee,Z]:[J,Z]:K.video?[J]:[Z]};U.mimeTypesForPlaylist_=N;var z=function(G){function F(P){var x=this;k(this,F),b(Object.getPrototypeOf(F.prototype),"constructor",this).call(this);var D=P.url,R=P.withCredentials,j=P.mode,H=P.tech,Y=P.bandwidth,K=P.externHls,Z=P.useCueTags,ee=P.blacklistDuration;if(!D)throw new Error("A non-empty playlist URL is required");d=K,this.withCredentials=R,this.tech_=H,this.hls_=H.hls,this.mode_=j,this.useCueTags_=Z,this.blacklistDuration=ee,this.useCueTags_&&(this.cueTagsTrack_=this.tech_.addTextTrack("metadata","ad-cues"),this.cueTagsTrack_.inBandMetadataTrackDispatchType=""),this.requestOptions_={withCredentials:this.withCredentials,timeout:null},this.audioGroups_={},this.subtitleGroups_={groups:{},tracks:{}},this.mediaSource=new r.default.MediaSource({mode:j}),this.audioinfo_=null,this.mediaSource.on("audioinfo",this.handleAudioinfoUpdate_.bind(this)),this.mediaSource.addEventListener("sourceopen",this.handleSourceOpen_.bind(this)),this.seekable_=r.default.createTimeRanges(),this.hasPlayed_=function(){return!1},this.syncController_=new m.default(P),this.segmentMetadataTrack_=H.addRemoteTextTrack({kind:"metadata",label:"segment-metadata"},!0).track,this.decrypter_=(0,o.default)(T.default);var J={hls:this.hls_,mediaSource:this.mediaSource,currentTime:this.tech_.currentTime.bind(this.tech_),seekable:function(){return x.seekable()},seeking:function(){return x.tech_.seeking()},duration:function(){return x.mediaSource.duration},hasPlayed:function(){return x.hasPlayed_()},goalBufferLength:function(){return x.goalBufferLength()},bandwidth:Y,syncController:this.syncController_,decrypter:this.decrypter_};this.masterPlaylistLoader_=new l.default(D,this.hls_,this.withCredentials),this.setupMasterPlaylistLoaderListeners_(),this.audioPlaylistLoader_=null,this.subtitlePlaylistLoader_=null,this.mainSegmentLoader_=new s.default(r.default.mergeOptions(J,{segmentMetadataTrack:this.segmentMetadataTrack_,loaderType:"main"}),P),this.audioSegmentLoader_=new s.default(r.default.mergeOptions(J,{loaderType:"audio"}),P),this.subtitleSegmentLoader_=new i.default(r.default.mergeOptions(J,{loaderType:"vtt"}),P),this.setupSegmentLoaderListeners_(),I.forEach(function(te){x[te+"_"]=M.bind(x,te)}),this.masterPlaylistLoader_.load()}return w(F,G),S(F,[{key:"setupMasterPlaylistLoaderListeners_",value:function(){var P=this;this.masterPlaylistLoader_.on("loadedmetadata",function(){var x=P.masterPlaylistLoader_.media(),D=1.5*P.masterPlaylistLoader_.targetDuration*1e3;P.masterPlaylistLoader_.isLowestEnabledRendition_()?P.requestOptions_.timeout=0:P.requestOptions_.timeout=D,x.endList&&P.tech_.preload()!=="none"&&(P.mainSegmentLoader_.playlist(x,P.requestOptions_),P.mainSegmentLoader_.load()),P.fillAudioTracks_(),P.setupAudio(),P.fillSubtitleTracks_(),P.setupSubtitles(),P.triggerPresenceUsage_(P.master(),x);try{P.setupSourceBuffers_()}catch(R){return r.default.log.warn("Failed to create SourceBuffers",R),P.mediaSource.endOfStream("decode")}P.setupFirstPlay(),P.trigger("audioupdate"),P.trigger("selectedinitialmedia")}),this.masterPlaylistLoader_.on("loadedplaylist",function(){var x=P.masterPlaylistLoader_.media();if(!x)return P.initialMedia_=P.selectPlaylist(),void P.masterPlaylistLoader_.media(P.initialMedia_);P.useCueTags_&&P.updateAdCues_(x),P.mainSegmentLoader_.playlist(x,P.requestOptions_),P.updateDuration(),P.tech_.paused()||P.mainSegmentLoader_.load(),x.endList||function(){var D=function(){var R=P.seekable();R.length!==0&&P.mediaSource.addSeekableRange_(R.start(0),R.end(0))};P.duration()!==Infinity?function(){var R=function j(){P.duration()===Infinity?D():P.tech_.one("durationchange",j)};P.tech_.one("durationchange",R)}():D()}()}),this.masterPlaylistLoader_.on("error",function(){P.blacklistCurrentPlaylist(P.masterPlaylistLoader_.error)}),this.masterPlaylistLoader_.on("mediachanging",function(){P.mainSegmentLoader_.abort(),P.mainSegmentLoader_.pause()}),this.masterPlaylistLoader_.on("mediachange",function(){var x=P.masterPlaylistLoader_.media(),D=1.5*P.masterPlaylistLoader_.targetDuration*1e3,R=void 0,j=void 0;P.masterPlaylistLoader_.isLowestEnabledRendition_()?P.requestOptions_.timeout=0:P.requestOptions_.timeout=D,P.mainSegmentLoader_.playlist(x,P.requestOptions_),P.mainSegmentLoader_.load(),R=P.activeAudioGroup(),j=R.filter(function(H){return H.enabled})[0],j||(P.mediaGroupChanged(),P.trigger("audioupdate")),P.setupSubtitles(),P.tech_.trigger({type:"mediachange",bubbles:!0})}),this.masterPlaylistLoader_.on("playlistunchanged",function(){var x=P.masterPlaylistLoader_.media();P.stuckAtPlaylistEnd_(x)&&(P.blacklistCurrentPlaylist({message:"Playlist no longer updating."}),P.tech_.trigger("playliststuck"))}),this.masterPlaylistLoader_.on("renditiondisabled",function(){P.tech_.trigger({type:"usage",name:"hls-rendition-disabled"})}),this.masterPlaylistLoader_.on("renditionenabled",function(){P.tech_.trigger({type:"usage",name:"hls-rendition-enabled"})})}},{key:"triggerPresenceUsage_",value:function(P,x){var D=P.mediaGroups||{},R=!0,j=Object.keys(D.AUDIO);for(var H in D.AUDIO)for(var Y in D.AUDIO[H]){var K=D.AUDIO[H][Y];K.uri||(R=!1)}R&&this.tech_.trigger({type:"usage",name:"hls-demuxed"}),Object.keys(D.SUBTITLES).length&&this.tech_.trigger({type:"usage",name:"hls-webvtt"}),d.Playlist.isAes(x)&&this.tech_.trigger({type:"usage",name:"hls-aes"}),d.Playlist.isFmp4(x)&&this.tech_.trigger({type:"usage",name:"hls-fmp4"}),j.length&&Object.keys(D.AUDIO[j[0]]).length>1&&this.tech_.trigger({type:"usage",name:"hls-alternate-audio"}),this.useCueTags_&&this.tech_.trigger({type:"usage",name:"hls-playlist-cue-tags"})}},{key:"setupSegmentLoaderListeners_",value:function(){var P=this;this.mainSegmentLoader_.on("bandwidthupdate",function(){var x=P.selectPlaylist(),D=P.masterPlaylistLoader_.media(),R=P.tech_.buffered(),j=R.length?R.end(R.length-1)-P.tech_.currentTime():0,H=P.bufferLowWaterLine();(!D.endList||P.duration()<y.default.MAX_BUFFER_LOW_WATER_LINE||x.attributes.BANDWIDTH<D.attributes.BANDWIDTH||j>=H)&&P.masterPlaylistLoader_.media(x),P.tech_.trigger("bandwidthupdate")}),this.mainSegmentLoader_.on("progress",function(){P.trigger("progress")}),this.mainSegmentLoader_.on("error",function(){P.blacklistCurrentPlaylist(P.mainSegmentLoader_.error())}),this.mainSegmentLoader_.on("syncinfoupdate",function(){P.onSyncInfoUpdate_()}),this.mainSegmentLoader_.on("timestampoffset",function(){P.tech_.trigger({type:"usage",name:"hls-timestamp-offset"})}),this.audioSegmentLoader_.on("syncinfoupdate",function(){P.onSyncInfoUpdate_()}),this.mainSegmentLoader_.on("ended",function(){P.onEndOfStream()}),this.audioSegmentLoader_.on("ended",function(){P.onEndOfStream()}),this.audioSegmentLoader_.on("error",function(){r.default.log.warn("Problem encountered with the current alternate audio track. Switching back to default."),P.audioSegmentLoader_.abort(),P.audioPlaylistLoader_=null,P.setupAudio()}),this.subtitleSegmentLoader_.on("error",this.handleSubtitleError_.bind(this))}},{key:"handleAudioinfoUpdate_",value:function(P){if(d.supportsAudioInfoChange_()||!this.audioInfo_||!q(this.audioInfo_,P.info))return void(this.audioInfo_=P.info);var x=`had different audio properties (channels, sample rate, etc.) or changed in some other way. This behavior is currently unsupported in Firefox 48 and below due to an issue:
https://bugzilla.mozilla.org/show_bug.cgi?id=1247138
`,D=this.activeAudioGroup().map(function(H){return H.enabled}).indexOf(!0),R=this.activeAudioGroup()[D],j=this.activeAudioGroup().filter(function(H){return H.properties_&&H.properties_.default})[0];this.audioPlaylistLoader_?(x="The audio track '"+R.label+"' that we tried to switch to "+x+" Unfortunately this means we will have to return you to the main track '"+j.label+"'. Sorry!",j.enabled=!0,this.activeAudioGroup().splice(D,1),this.trigger("audioupdate")):(x="The rendition that we tried to switch to "+x+"Unfortunately that means we will have to blacklist the current playlist and switch to another. Sorry!",this.blacklistCurrentPlaylist()),r.default.log.warn(x),this.setupAudio()}},{key:"mediaSecondsLoaded_",value:function(){return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded+this.mainSegmentLoader_.mediaSecondsLoaded)}},{key:"fillAudioTracks_",value:function(){var P=this.master(),x=P.mediaGroups||{};x&&x.AUDIO&&Object.keys(x.AUDIO).length!==0&&this.mode_==="html5"||(x.AUDIO={main:{default:{default:!0}}});for(var D in x.AUDIO){this.audioGroups_[D]||(this.audioGroups_[D]=[]);for(var R in x.AUDIO[D]){var j=x.AUDIO[D][R],H=new r.default.AudioTrack({id:R,kind:this.audioTrackKind_(j),enabled:!1,language:j.language,label:R});H.properties_=j,this.audioGroups_[D].push(H)}}(this.activeAudioGroup().filter(function(Y){return Y.properties_.default})[0]||this.activeAudioGroup()[0]).enabled=!0}},{key:"audioTrackKind_",value:function(P){var x=P.default?"main":"alternative";return P.characteristics&&P.characteristics.indexOf("public.accessibility.describes-video")>=0&&(x="main-desc"),x}},{key:"fillSubtitleTracks_",value:function(){var P=this.master(),x=P.mediaGroups||{};for(var D in x.SUBTITLES){this.subtitleGroups_.groups[D]||(this.subtitleGroups_.groups[D]=[]);for(var R in x.SUBTITLES[D]){var j=x.SUBTITLES[D][R];if(!j.forced&&(this.subtitleGroups_.groups[D].push(r.default.mergeOptions({id:R},j)),typeof this.subtitleGroups_.tracks[R]=="undefined")){var H=this.tech_.addRemoteTextTrack({id:R,kind:"subtitles",enabled:!1,language:j.language,label:R},!0).track;this.subtitleGroups_.tracks[R]=H}}}}},{key:"load",value:function(){this.mainSegmentLoader_.load(),this.audioPlaylistLoader_&&this.audioSegmentLoader_.load(),this.subtitlePlaylistLoader_&&this.subtitleSegmentLoader_.load()}},{key:"activeAudioGroup",value:function(){var P=this.masterPlaylistLoader_.media(),x=void 0;return P.attributes.AUDIO&&(x=this.audioGroups_[P.attributes.AUDIO]),x||this.audioGroups_.main}},{key:"activeSubtitleGroup_",value:function(){var P=this.masterPlaylistLoader_.media(),x=void 0;return P?(P.attributes.SUBTITLES&&(x=this.subtitleGroups_.groups[P.attributes.SUBTITLES]),x||this.subtitleGroups_.groups.main):null}},{key:"activeSubtitleTrack_",value:function(){for(var P in this.subtitleGroups_.tracks)if(this.subtitleGroups_.tracks[P].mode==="showing")return this.subtitleGroups_.tracks[P];return null}},{key:"handleSubtitleError_",value:function(){r.default.log.warn("Problem encountered loading the subtitle track. Switching back to default."),this.subtitleSegmentLoader_.abort();var P=this.activeSubtitleTrack_();P&&(P.mode="disabled"),this.setupSubtitles()}},{key:"mediaGroupChanged",value:function(){var P=this.getActiveAudioTrack_();this.stopAudioLoaders_(),this.resyncAudioLoaders_(P)}},{key:"setupAudio",value:function(){var P=this.getActiveAudioTrack_();this.stopAudioLoaders_(),this.resetAudioLoaders_(P)}},{key:"getActiveAudioTrack_",value:function(){var P=this.activeAudioGroup(),x=P.filter(function(D){return D.enabled})[0];return x||(x=P.filter(function(D){return D.properties_.default})[0]||P[0],x.enabled=!0),x}},{key:"stopAudioLoaders_",value:function(){this.audioPlaylistLoader_&&(this.audioPlaylistLoader_.dispose(),this.audioPlaylistLoader_=null),this.audioSegmentLoader_.pause()}},{key:"resetAudioLoaders_",value:function(P){if(!P.properties_.resolvedUri)return void this.mainSegmentLoader_.resetEverything();this.audioSegmentLoader_.resetEverything(),this.setupAudioPlaylistLoader_(P)}},{key:"resyncAudioLoaders_",value:function(P){P.properties_.resolvedUri&&(this.audioSegmentLoader_.resyncLoader(),this.setupAudioPlaylistLoader_(P))}},{key:"setupAudioPlaylistLoader_",value:function(P){var x=this;this.audioPlaylistLoader_=new l.default(P.properties_.resolvedUri,this.hls_,this.withCredentials),this.audioPlaylistLoader_.load(),this.audioPlaylistLoader_.on("loadedmetadata",function(){var D=x.audioPlaylistLoader_.media();x.audioSegmentLoader_.playlist(D,x.requestOptions_),(!x.tech_.paused()||D.endList&&x.tech_.preload()!=="none")&&x.audioSegmentLoader_.load(),D.endList||x.audioPlaylistLoader_.trigger("firstplay")}),this.audioPlaylistLoader_.on("loadedplaylist",function(){var D=void 0;if(x.audioPlaylistLoader_&&(D=x.audioPlaylistLoader_.media()),!D)return void x.audioPlaylistLoader_.media(x.audioPlaylistLoader_.playlists.master.playlists[0]);x.audioSegmentLoader_.playlist(D,x.requestOptions_)}),this.audioPlaylistLoader_.on("error",function(){r.default.log.warn("Problem encountered loading the alternate audio track. Switching back to default."),x.audioSegmentLoader_.abort(),x.setupAudio()})}},{key:"setupSubtitles",value:function(){var P=this,x=this.activeSubtitleGroup_(),D=this.activeSubtitleTrack_();if(this.subtitleSegmentLoader_.pause(),!D)return void(this.subtitlePlaylistLoader_&&(this.subtitlePlaylistLoader_.dispose(),this.subtitlePlaylistLoader_=null));var R=x.filter(function(j){return j.id===D.id})[0];this.subtitlePlaylistLoader_&&this.subtitlePlaylistLoader_.media()&&this.subtitlePlaylistLoader_.media().resolvedUri===R.resolvedUri||(this.subtitlePlaylistLoader_&&this.subtitlePlaylistLoader_.dispose(),this.subtitleSegmentLoader_.resetEverything(),this.subtitlePlaylistLoader_=new l.default(R.resolvedUri,this.hls_,this.withCredentials),this.subtitlePlaylistLoader_.on("loadedmetadata",function(){var j=P.subtitlePlaylistLoader_.media();P.subtitleSegmentLoader_.playlist(j,P.requestOptions_),P.subtitleSegmentLoader_.track(P.activeSubtitleTrack_()),(!P.tech_.paused()||j.endList&&P.tech_.preload()!=="none")&&P.subtitleSegmentLoader_.load()}),this.subtitlePlaylistLoader_.on("loadedplaylist",function(){var j=void 0;P.subtitlePlaylistLoader_&&(j=P.subtitlePlaylistLoader_.media()),j&&P.subtitleSegmentLoader_.playlist(j,P.requestOptions_)}),this.subtitlePlaylistLoader_.on("error",this.handleSubtitleError_.bind(this))),this.subtitlePlaylistLoader_.media()&&this.subtitlePlaylistLoader_.media().resolvedUri===R.resolvedUri?this.subtitleSegmentLoader_.load():this.subtitlePlaylistLoader_.load()}},{key:"fastQualityChange_",value:function(){var P=this.selectPlaylist();P!==this.masterPlaylistLoader_.media()&&(this.masterPlaylistLoader_.media(P),this.mainSegmentLoader_.resetLoader())}},{key:"play",value:function(){if(!this.setupFirstPlay()){this.tech_.ended()&&this.tech_.setCurrentTime(0),this.hasPlayed_()&&this.load();var P=this.tech_.seekable();return this.tech_.duration()===Infinity&&this.tech_.currentTime()<P.start(0)?this.tech_.setCurrentTime(P.end(P.length-1)):void 0}}},{key:"setupFirstPlay",value:function(){var P=void 0,x=this.masterPlaylistLoader_.media();return!(!x||this.tech_.paused()||this.hasPlayed_())&&(x.endList||(this.trigger("firstplay"),P=this.seekable(),P.length&&this.tech_.setCurrentTime(P.end(0))),this.hasPlayed_=function(){return!0},this.load(),!0)}},{key:"handleSourceOpen_",value:function(){try{this.setupSourceBuffers_()}catch(P){return r.default.log.warn("Failed to create Source Buffers",P),this.mediaSource.endOfStream("decode")}this.tech_.autoplay()&&this.tech_.play(),this.trigger("sourceopen")}},{key:"onEndOfStream",value:function(){var P=this.mainSegmentLoader_.ended_;this.audioPlaylistLoader_&&(P=P&&this.audioSegmentLoader_.ended_),P&&this.mediaSource.endOfStream()}},{key:"stuckAtPlaylistEnd_",value:function(P){if(!this.seekable().length)return!1;var x=this.syncController_.getExpiredTime(P,this.mediaSource.duration);if(x===null)return!1;var D=d.Playlist.playlistEnd(P,x),R=this.tech_.currentTime(),j=this.tech_.buffered();if(!j.length)return D-R<=t.default.TIME_FUDGE_FACTOR;var H=j.end(j.length-1);return H-R<=t.default.TIME_FUDGE_FACTOR&&D-H<=t.default.TIME_FUDGE_FACTOR}},{key:"blacklistCurrentPlaylist",value:function(){var P=arguments.length<=0||arguments[0]===void 0?{}:arguments[0],x=void 0,D=void 0;if(!(x=P.playlist||this.masterPlaylistLoader_.media())){this.error=P;try{return this.mediaSource.endOfStream("network")}catch(j){return this.trigger("error")}}var R=this.masterPlaylistLoader_.isFinalRendition_();return R?(r.default.log.warn("Problem encountered with the current HLS playlist. Trying again since it is the final playlist."),this.tech_.trigger("retryplaylist"),this.masterPlaylistLoader_.load(R)):(x.excludeUntil=Date.now()+1e3*this.blacklistDuration,this.tech_.trigger("blacklistplaylist"),this.tech_.trigger({type:"usage",name:"hls-rendition-blacklisted"}),D=this.selectPlaylist(),r.default.log.warn("Problem encountered with the current HLS playlist."+(P.message?" "+P.message:"")+" Switching to another playlist."),this.masterPlaylistLoader_.media(D))}},{key:"pauseLoading",value:function(){this.mainSegmentLoader_.pause(),this.audioPlaylistLoader_&&this.audioSegmentLoader_.pause(),this.subtitlePlaylistLoader_&&this.subtitleSegmentLoader_.pause()}},{key:"setCurrentTime",value:function(P){var x=t.default.findRange(this.tech_.buffered(),P);if(!this.masterPlaylistLoader_||!this.masterPlaylistLoader_.media()||!this.masterPlaylistLoader_.media().segments)return 0;var D=this.mode_==="flash"||this.mode_==="auto"&&!r.default.MediaSource.supportsNativeMediaSources();if(x&&x.length&&!D)return P;this.mainSegmentLoader_.resetEverything(),this.mainSegmentLoader_.abort(),this.audioPlaylistLoader_&&(this.audioSegmentLoader_.resetEverything(),this.audioSegmentLoader_.abort()),this.subtitlePlaylistLoader_&&(this.subtitleSegmentLoader_.resetEverything(),this.subtitleSegmentLoader_.abort()),this.tech_.paused()||(this.mainSegmentLoader_.load(),this.audioPlaylistLoader_&&this.audioSegmentLoader_.load(),this.subtitlePlaylistLoader_&&this.subtitleSegmentLoader_.load())}},{key:"duration",value:function(){return this.masterPlaylistLoader_?this.mediaSource?this.mediaSource.duration:d.Playlist.duration(this.masterPlaylistLoader_.media()):0}},{key:"seekable",value:function(){return this.seekable_}},{key:"onSyncInfoUpdate_",value:function(){var P=void 0,x=void 0;if(this.masterPlaylistLoader_){var D=this.masterPlaylistLoader_.media();if(D){var R=this.syncController_.getExpiredTime(D,this.mediaSource.duration);if(R!==null&&(P=d.Playlist.seekable(D,R),P.length!==0)){if(this.audioPlaylistLoader_&&(D=this.audioPlaylistLoader_.media(),(R=this.syncController_.getExpiredTime(D,this.mediaSource.duration))===null||(x=d.Playlist.seekable(D,R),x.length===0)))return;x?x.start(0)>P.end(0)||P.start(0)>x.end(0)?this.seekable_=P:this.seekable_=r.default.createTimeRanges([[x.start(0)>P.start(0)?x.start(0):P.start(0),x.end(0)<P.end(0)?x.end(0):P.end(0)]]):this.seekable_=P,this.tech_.trigger("seekablechanged")}}}}},{key:"updateDuration",value:function(){var P=this,x=this.mediaSource.duration,D=d.Playlist.duration(this.masterPlaylistLoader_.media()),R=this.tech_.buffered(),j=function H(){P.mediaSource.duration=D,P.tech_.trigger("durationchange"),P.mediaSource.removeEventListener("sourceopen",H)};R.length>0&&(D=Math.max(D,R.end(R.length-1))),x!==D&&(this.mediaSource.readyState!=="open"?this.mediaSource.addEventListener("sourceopen",j):j())}},{key:"dispose",value:function(){this.decrypter_.terminate(),this.masterPlaylistLoader_.dispose(),this.mainSegmentLoader_.dispose(),this.audioPlaylistLoader_&&this.audioPlaylistLoader_.dispose(),this.subtitlePlaylistLoader_&&this.subtitlePlaylistLoader_.dispose(),this.audioSegmentLoader_.dispose(),this.subtitleSegmentLoader_.dispose()}},{key:"master",value:function(){return this.masterPlaylistLoader_.master}},{key:"media",value:function(){return this.masterPlaylistLoader_.media()||this.initialMedia_}},{key:"setupSourceBuffers_",value:function(){var P=this.masterPlaylistLoader_.media(),x=void 0;if(P&&this.mediaSource.readyState==="open"){if(x=N(this.masterPlaylistLoader_.master,P),x.length<1)return this.error="No compatible SourceBuffer configuration for the variant stream:"+P.resolvedUri,this.mediaSource.endOfStream("decode");this.mainSegmentLoader_.mimeType(x[0]),x[1]&&this.audioSegmentLoader_.mimeType(x[1]),this.excludeIncompatibleVariants_(P)}}},{key:"excludeIncompatibleVariants_",value:function(P){var x=this.masterPlaylistLoader_.master,D=2,R=null,j=void 0;P.attributes.CODECS&&(j=V(P.attributes.CODECS),R=j.videoCodec,D=j.codecCount),x.playlists.forEach(function(H){var Y={codecCount:2,videoCodec:null};if(H.attributes.CODECS){var K=H.attributes.CODECS;Y=V(K),window.MediaSource&&window.MediaSource.isTypeSupported&&!window.MediaSource.isTypeSupported('video/mp4; codecs="'+W(K)+'"')&&(H.excludeUntil=Infinity)}Y.codecCount!==D&&(H.excludeUntil=Infinity),Y.videoCodec!==R&&(H.excludeUntil=Infinity)})}},{key:"updateAdCues_",value:function(P){var x=0,D=this.seekable();D.length&&(x=D.start(0)),p.default.updateAdCues(P,this.cueTagsTrack_,x)}},{key:"goalBufferLength",value:function(){var P=this.tech_.currentTime(),x=y.default.GOAL_BUFFER_LENGTH,D=y.default.GOAL_BUFFER_LENGTH_RATE,R=Math.max(x,y.default.MAX_GOAL_BUFFER_LENGTH);return Math.min(x+P*D,R)}},{key:"bufferLowWaterLine",value:function(){var P=this.tech_.currentTime(),x=y.default.BUFFER_LOW_WATER_LINE,D=y.default.BUFFER_LOW_WATER_LINE_RATE,R=Math.max(x,y.default.MAX_BUFFER_LOW_WATER_LINE);return Math.min(x+P*D,R)}}]),F}(r.default.EventTarget);U.MasterPlaylistController=z}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],6:[function(C,B,U){(function(O){"use strict";Object.defineProperty(U,"__esModule",{value:!0});var A=typeof window!="undefined"?window.videojs:O!==void 0?O.videojs:null,k=function(m){return m&&m.__esModule?m:{default:m}}(A),w=C(2),S={FAILURE:2,TIMEOUT:-101,ABORTED:-102};U.REQUEST_ERRORS=S;var b=function(m){var h=void 0;return h=m.offset+m.length-1,"bytes="+m.offset+"-"+h},_=function(m){var h={};return m.byterange&&(h.Range=b(m.byterange)),h},l=function(m){m.forEach(function(h){h.abort()})},g=function(m){return{bandwidth:m.bandwidth,bytesReceived:m.bytesReceived||0,roundTripTime:m.roundTripTime||0}},s=function(m){var h=m.target,f=Date.now()-h.requestTime,o={bandwidth:Infinity,bytesReceived:0,roundTripTime:f||0};return o.bytesReceived=m.loaded,o.bandwidth=Math.floor(o.bytesReceived/o.roundTripTime*8*1e3),o},u=function(m,h){return h.timedout?{status:h.status,message:"HLS request timed-out at URL: "+h.uri,code:S.TIMEOUT,xhr:h}:h.aborted?{status:h.status,message:"HLS request aborted at URL: "+h.uri,code:S.ABORTED,xhr:h}:m?{status:h.status,message:"HLS request errored at URL: "+h.uri,code:S.FAILURE,xhr:h}:null},i=function(m,h){return function(f,o){var v=o.response,T=u(f,o);if(T)return h(T,m);if(v.byteLength!==16)return h({status:o.status,message:"Invalid HLS key at URL: "+o.uri,code:S.FAILURE,xhr:o},m);var E=new DataView(v);return m.key.bytes=new Uint32Array([E.getUint32(0),E.getUint32(4),E.getUint32(8),E.getUint32(12)]),h(null,m)}},c=function(m,h){return function(f,o){var v=o.response,T=u(f,o);return T?h(T,m):v.byteLength===0?h({status:o.status,message:"Empty HLS segment content at URL: "+o.uri,code:S.FAILURE,xhr:o},m):(m.map.bytes=new Uint8Array(o.response),h(null,m))}},t=function(m,h){return function(f,o){var v=o.response,T=u(f,o);return T?h(T,m):v.byteLength===0?h({status:o.status,message:"Empty HLS segment content at URL: "+o.uri,code:S.FAILURE,xhr:o},m):(m.stats=g(o),m.key?m.encryptedBytes=new Uint8Array(o.response):m.bytes=new Uint8Array(o.response),h(null,m))}},e=function(m,h,f){var o=function v(T){if(T.data.source===h.requestId){m.removeEventListener("message",v);var E=T.data.decrypted;return h.bytes=new Uint8Array(E.bytes,E.byteOffset,E.byteLength),f(null,h)}};m.addEventListener("message",o),m.postMessage((0,w.createTransferableMessage)({source:h.requestId,encrypted:h.encryptedBytes,key:h.key.bytes,iv:h.key.iv}),[h.encryptedBytes.buffer,h.key.bytes.buffer])},r=function(m){return m.reduce(function(h,f){return f.code>h.code?f:h})},n=function(m,h,f){var o=[],v=0;return function(T,E){if(T&&(l(m),o.push(T)),(v+=1)===m.length){if(E.endOfAllRequests=Date.now(),o.length>0){var y=r(o);return f(y,E)}return E.encryptedBytes?e(h,E,f):f(null,E)}}},p=function(m,h){return function(f){return m.stats=k.default.mergeOptions(m.stats,s(f)),!m.stats.firstBytesReceivedAt&&m.stats.bytesReceived&&(m.stats.firstBytesReceivedAt=Date.now()),h(f,m)}},a=function(m,h,f,o,v,T){var E=[],y=n(E,f,T);if(o.key){var d=k.default.mergeOptions(h,{uri:o.key.resolvedUri,responseType:"arraybuffer"}),L=i(o,y),I=m(d,L);E.push(I)}if(o.map&&!o.map.bytes){var M=k.default.mergeOptions(h,{uri:o.map.resolvedUri,responseType:"arraybuffer",headers:_(o.map)}),q=c(o,y),V=m(M,q);E.push(V)}var W=k.default.mergeOptions(h,{uri:o.resolvedUri,responseType:"arraybuffer",headers:_(o)}),X=t(o,y),$=m(W,X);return $.addEventListener("progress",p(o,v)),E.push($),function(){return l(E)}};U.mediaSegmentRequest=a}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],7:[function(C,B,U){(function(O){"use strict";function A(c){return c&&c.__esModule?c:{default:c}}function k(c,t){if(!(c instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(U,"__esModule",{value:!0});var w=function(){function c(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(t,e,r){return e&&c(t.prototype,e),r&&c(t,r),t}}(),S=C(30),b=A(S),_=C(11),l=A(_),g=typeof window!="undefined"?window.videojs:O!==void 0?O.videojs:null,s=A(g),u=["seeking","seeked","pause","playing","error"],i=function(){function c(t){var e=this;k(this,c),this.tech_=t.tech,this.seekable=t.seekable,this.consecutiveUpdates=0,this.lastRecordedTime=null,this.timer_=null,this.checkCurrentTimeTimeout_=null,t.debug&&(this.logger_=s.default.log.bind(s.default,"playback-watcher ->")),this.logger_("initialize");var r=function(){return e.techWaiting_()},n=function(){return e.cancelTimer_()},p=function(){return e.fixesBadSeeks_()};this.tech_.on("seekablechanged",p),this.tech_.on("waiting",r),this.tech_.on(u,n),this.monitorCurrentTime_(),this.dispose=function(){e.logger_("dispose"),e.tech_.off("seekablechanged",p),e.tech_.off("waiting",r),e.tech_.off(u,n),e.checkCurrentTimeTimeout_&&b.default.clearTimeout(e.checkCurrentTimeTimeout_),e.cancelTimer_()}}return w(c,[{key:"monitorCurrentTime_",value:function(){this.checkCurrentTime_(),this.checkCurrentTimeTimeout_&&b.default.clearTimeout(this.checkCurrentTimeTimeout_),this.checkCurrentTimeTimeout_=b.default.setTimeout(this.monitorCurrentTime_.bind(this),250)}},{key:"checkCurrentTime_",value:function(){if(this.tech_.seeking()&&this.fixesBadSeeks_())return this.consecutiveUpdates=0,void(this.lastRecordedTime=this.tech_.currentTime());if(!this.tech_.paused()&&!this.tech_.seeking()){var t=this.tech_.currentTime(),e=this.tech_.buffered();if(this.lastRecordedTime===t&&(!e.length||t+.1>=e.end(e.length-1)))return this.techWaiting_();this.consecutiveUpdates>=5&&t===this.lastRecordedTime?(this.consecutiveUpdates++,this.waiting_()):t===this.lastRecordedTime?this.consecutiveUpdates++:(this.consecutiveUpdates=0,this.lastRecordedTime=t)}}},{key:"cancelTimer_",value:function(){this.consecutiveUpdates=0,this.timer_&&(this.logger_("cancelTimer_"),clearTimeout(this.timer_)),this.timer_=null}},{key:"fixesBadSeeks_",value:function(){var t=this.seekable(),e=this.tech_.currentTime();if(this.tech_.seeking()&&this.outsideOfSeekableWindow_(t,e)){var r=t.end(t.length-1);return this.logger_("Trying to seek outside of seekable at time "+e+" with seekable range "+l.default.printableRange(t)+". Seeking to "+r+"."),this.tech_.setCurrentTime(r),!0}return!1}},{key:"waiting_",value:function(){if(!this.techWaiting_()){var t=this.tech_.currentTime(),e=this.tech_.buffered(),r=l.default.findRange(e,t);return r.length&&t+3<=r.end(0)?(this.cancelTimer_(),this.tech_.setCurrentTime(t),this.logger_("Stopped at "+t+" while inside a buffered region ["+r.start(0)+" -> "+r.end(0)+"]. Attempting to resume playback by seeking to the current time."),void this.tech_.trigger({type:"usage",name:"hls-unknown-waiting"})):void 0}}},{key:"techWaiting_",value:function(){var t=this.seekable(),e=this.tech_.currentTime();if(this.tech_.seeking()&&this.fixesBadSeeks_()||this.tech_.seeking()||this.timer_!==null)return!0;if(this.fellOutOfLiveWindow_(t,e)){var r=t.end(t.length-1);return this.logger_("Fell out of live window at time "+e+". Seeking to live point (seekable end) "+r),this.cancelTimer_(),this.tech_.setCurrentTime(r),this.tech_.trigger({type:"usage",name:"hls-live-resync"}),!0}var n=this.tech_.buffered(),p=l.default.findNextRange(n,e);if(this.videoUnderflow_(p,n,e))return this.cancelTimer_(),this.tech_.setCurrentTime(e),this.tech_.trigger({type:"usage",name:"hls-video-underflow"}),!0;if(p.length>0){var a=p.start(0)-e;return this.logger_("Stopped at "+e+", setting timer for "+a+", seeking to "+p.start(0)),this.timer_=setTimeout(this.skipTheGap_.bind(this),1e3*a,e),!0}return!1}},{key:"outsideOfSeekableWindow_",value:function(t,e){return!!t.length&&(e<t.start(0)-.1||e>t.end(t.length-1)+.1)}},{key:"fellOutOfLiveWindow_",value:function(t,e){return!!(t.length&&t.start(0)>0&&e<t.start(0))}},{key:"videoUnderflow_",value:function(t,e,r){if(t.length===0){var n=this.gapFromVideoUnderflow_(e,r);if(n)return this.logger_("Encountered a gap in video from "+n.start+" to "+n.end+". Seeking to current time "+r),!0}return!1}},{key:"skipTheGap_",value:function(t){var e=this.tech_.buffered(),r=this.tech_.currentTime(),n=l.default.findNextRange(e,r);this.cancelTimer_(),n.length!==0&&r===t&&(this.logger_("skipTheGap_:","currentTime:",r,"scheduled currentTime:",t,"nextRange start:",n.start(0)),this.tech_.setCurrentTime(n.start(0)+l.default.TIME_FUDGE_FACTOR),this.tech_.trigger({type:"usage",name:"hls-gap-skip"}))}},{key:"gapFromVideoUnderflow_",value:function(t,e){for(var r=l.default.findGaps(t),n=0;n<r.length;n++){var p=r.start(n),a=r.end(n);if(e-p<4&&e-p>2)return{start:p,end:a}}return null}},{key:"logger_",value:function(){}}]),c}();U.default=i,B.exports=U.default}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],8:[function(C,B,U){(function(O){"use strict";function A(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(U,"__esModule",{value:!0});var k=C(14),w=A(k),S=typeof window!="undefined"?window.videojs:O!==void 0?O.videojs:null,b=C(10),_=C(31),l=A(_),g=C(30),s=A(g),u=function(t,e,r){var n=e.slice(),p=void 0,a=void 0;for(r=r||0,p=Math.min(t.length,e.length+r),a=r;a<p;a++)n[a-r]=(0,S.mergeOptions)(t[a],n[a-r]);return n},i=function(t,e){for(var r=!1,n=(0,S.mergeOptions)(t,{}),p=t.playlists.length,a=void 0,m=void 0,h=void 0;p--;)if(a=n.playlists[p],a.uri===e.uri){if(a.segments&&e.segments&&a.segments.length===e.segments.length&&a.mediaSequence===e.mediaSequence)continue;for(n.playlists[p]=(0,S.mergeOptions)(a,e),n.playlists[e.uri]=n.playlists[p],a.segments&&(n.playlists[p].segments=u(a.segments,e.segments,e.mediaSequence-a.mediaSequence)),h=0,n.playlists[p].segments&&(h=n.playlists[p].segments.length);h--;)m=n.playlists[p].segments[h],m.resolvedUri||(m.resolvedUri=(0,w.default)(a.resolvedUri,m.uri)),m.key&&!m.key.resolvedUri&&(m.key.resolvedUri=(0,w.default)(a.resolvedUri,m.key.uri)),m.map&&!m.map.resolvedUri&&(m.map.resolvedUri=(0,w.default)(a.resolvedUri,m.map.uri));r=!0}return r?n:null},c=function t(e,r,n){var p=this,a=this,m=void 0,h=void 0,f=void 0,o=void 0;if(t.prototype.constructor.call(this),this.hls_=r,!e)throw new Error("A non-empty playlist URL is required");f=function(v,T,E){a.setBandwidth(h||v),h=null,E&&(a.state=E),a.error={playlist:a.master.playlists[T],status:v.status,message:"HLS playlist request error at URL: "+T,responseText:v.responseText,code:v.status>=500?4:2},a.trigger("error")},o=function(v,T){var E=void 0,y=void 0,d=void 0;a.setBandwidth(h||v),h=null,a.state="HAVE_METADATA",E=new l.default.Parser,E.push(v.responseText),E.end(),E.manifest.uri=T,E.manifest.attributes=E.manifest.attributes||{},d=i(a.master,E.manifest),y=1e3*(E.manifest.targetDuration||10),a.targetDuration=E.manifest.targetDuration,d?(a.master=d,a.media_=a.master.playlists[E.manifest.uri]):(y/=2,a.trigger("playlistunchanged")),a.media().endList||(s.default.clearTimeout(m),m=s.default.setTimeout(function(){a.trigger("mediaupdatetimeout")},y)),a.trigger("loadedplaylist")},a.state="HAVE_NOTHING",a.dispose=function(){a.stopRequest(),s.default.clearTimeout(m),a.off()},a.stopRequest=function(){if(h){var v=h;h=null,v.onreadystatechange=null,v.abort()}},a.enabledPlaylists_=function(){return a.master.playlists.filter(b.isEnabled).length},a.isLowestEnabledRendition_=function(){if(a.master.playlists.length===1)return!0;var v=a.media(),T=v.attributes.BANDWIDTH||Number.MAX_VALUE;return a.master.playlists.filter(function(E){return!!(0,b.isEnabled)(E)&&(E.attributes.BANDWIDTH||0)<T}).length===0},a.isFinalRendition_=function(){return a.master.playlists.filter(b.isEnabled).length===1},a.media=function(v){var T=a.state,E=void 0;if(!v)return a.media_;if(a.state==="HAVE_NOTHING")throw new Error("Cannot switch media playlist from "+a.state);if(typeof v=="string"){if(!a.master.playlists[v])throw new Error("Unknown playlist URI: "+v);v=a.master.playlists[v]}if(E=!a.media_||v.uri!==a.media_.uri,a.master.playlists[v.uri].endList)return h&&(h.onreadystatechange=null,h.abort(),h=null),a.state="HAVE_METADATA",a.media_=v,void(E&&(a.trigger("mediachanging"),a.trigger("mediachange")));if(E){if(a.state="SWITCHING_MEDIA",h){if((0,w.default)(a.master.uri,v.uri)===h.url)return;h.onreadystatechange=null,h.abort(),h=null}this.media_&&this.trigger("mediachanging"),h=this.hls_.xhr({uri:(0,w.default)(a.master.uri,v.uri),withCredentials:n},function(y,d){if(h){if(y)return f(h,v.uri,T);o(d,v.uri),T==="HAVE_MASTER"?a.trigger("loadedmetadata"):a.trigger("mediachange")}})}},a.setBandwidth=function(v){a.bandwidth=v.bandwidth},a.on("mediaupdatetimeout",function(){a.state==="HAVE_METADATA"&&(a.state="HAVE_CURRENT_METADATA",h=this.hls_.xhr({uri:(0,w.default)(a.master.uri,a.media().uri),withCredentials:n},function(v,T){if(h)return v?f(h,a.media().uri,"HAVE_METADATA"):void o(h,a.media().uri)}))}),a.on("firstplay",function(){var v=a.media();v&&(v.syncInfo={mediaSequence:v.mediaSequence,time:0})}),a.pause=function(){a.stopRequest(),s.default.clearTimeout(m),a.state==="HAVE_NOTHING"&&(a.started=!1)},a.load=function(v){var T=a.media();if(s.default.clearTimeout(m),v){var E=T?T.targetDuration/2*1e3:5e3;return void(m=s.default.setTimeout(a.load.bind(null,!1),E))}if(!a.started)return void a.start();T&&!T.endList?a.trigger("mediaupdatetimeout"):a.trigger("loadedplaylist")},a.start=function(){a.started=!0,h=p.hls_.xhr({uri:e,withCredentials:n},function(v,T){var E=void 0,y=void 0,d=void 0;if(h){if(h=null,v)return a.error={status:T.status,message:"HLS playlist request error at URL: "+e,responseText:T.responseText,code:2},a.state==="HAVE_NOTHING"&&(a.started=!1),a.trigger("error");if(E=new l.default.Parser,E.push(T.responseText),E.end(),a.state="HAVE_MASTER",E.manifest.uri=e,E.manifest.playlists){for(a.master=E.manifest,d=a.master.playlists.length;d--;)y=a.master.playlists[d],a.master.playlists[y.uri]=y,y.resolvedUri=(0,w.default)(a.master.uri,y.uri),y.attributes||(y.attributes={},S.log.warn("Invalid playlist STREAM-INF detected. Missing BANDWIDTH attribute."));return["AUDIO","SUBTITLES"].forEach(function(L){for(var I in a.master.mediaGroups[L])for(var M in a.master.mediaGroups[L][I]){var q=a.master.mediaGroups[L][I][M];q.uri&&(q.resolvedUri=(0,w.default)(a.master.uri,q.uri))}}),a.trigger("loadedplaylist"),void(h||a.media(E.manifest.playlists[0]))}return a.master={mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:s.default.location.href,playlists:[{uri:e}]},a.master.playlists[e]=a.master.playlists[0],a.master.playlists[0].resolvedUri=e,a.master.playlists[0].attributes=a.master.playlists[0].attributes||{},o(T,e),a.trigger("loadedmetadata")}})}};c.prototype=new S.EventTarget,U.default=c,B.exports=U.default}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],9:[function(C,B,U){"use strict";function O(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(U,"__esModule",{value:!0});var A=C(3),k=O(A),w=C(10),S=O(w),b=function(t,e){var r=void 0;return t?(r=window.getComputedStyle(t),r?r[e]:""):""},_=function(t,e){var r=t.slice();t.sort(function(n,p){var a=e(n,p);return a===0?r.indexOf(n)-r.indexOf(p):a})},l=function(t,e){var r=void 0,n=void 0;return t.attributes.BANDWIDTH&&(r=t.attributes.BANDWIDTH),r=r||window.Number.MAX_VALUE,e.attributes.BANDWIDTH&&(n=e.attributes.BANDWIDTH),n=n||window.Number.MAX_VALUE,r-n};U.comparePlaylistBandwidth=l;var g=function(t,e){var r=void 0,n=void 0;return t.attributes.RESOLUTION&&t.attributes.RESOLUTION.width&&(r=t.attributes.RESOLUTION.width),r=r||window.Number.MAX_VALUE,e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width&&(n=e.attributes.RESOLUTION.width),n=n||window.Number.MAX_VALUE,r===n&&t.attributes.BANDWIDTH&&e.attributes.BANDWIDTH?t.attributes.BANDWIDTH-e.attributes.BANDWIDTH:r-n};U.comparePlaylistResolution=g;var s=function(t,e,r,n){var p=t.playlists.map(function(d){var L=void 0,I=void 0,M=void 0;return L=d.attributes.RESOLUTION&&d.attributes.RESOLUTION.width,I=d.attributes.RESOLUTION&&d.attributes.RESOLUTION.height,M=d.attributes.BANDWIDTH,M=M||window.Number.MAX_VALUE,{bandwidth:M,width:L,height:I,playlist:d}});_(p,function(d,L){return d.bandwidth-L.bandwidth}),p=p.filter(function(d){return S.default.isEnabled(d.playlist)});var a=p.filter(function(d){return d.bandwidth*k.default.BANDWIDTH_VARIANCE<e}),m=a[a.length-1],h=a.filter(function(d){return d.bandwidth===m.bandwidth})[0],f=a.filter(function(d){return d.width&&d.height});_(f,function(d,L){return d.width-L.width});var o=f.filter(function(d){return d.width===r&&d.height===n});m=o[o.length-1];var v=o.filter(function(d){return d.bandwidth===m.bandwidth})[0],T=void 0,E=void 0,y=void 0;return v||(T=f.filter(function(d){return d.width>r||d.height>n}),E=T.filter(function(d){return d.width===T[0].width&&d.height===T[0].height}),m=E[E.length-1],y=E.filter(function(d){return d.bandwidth===m.bandwidth})[0]),(y||v||h||p[0]).playlist},u=function(){return s(this.playlists.master,this.systemBandwidth,parseInt(b(this.tech_.el(),"width"),10),parseInt(b(this.tech_.el(),"height"),10))};U.lastBandwidthSelector=u;var i=function(t){var e=-1;if(t<0||t>1)throw new Error("Moving average bandwidth decay must be between 0 and 1.");return function(){return e<0&&(e=this.systemBandwidth),e=t*this.systemBandwidth+(1-t)*e,s(this.playlists.master,e,parseInt(b(this.tech_.el(),"width"),10),parseInt(b(this.tech_.el(),"height"),10))}};U.movingAverageBandwidthSelector=i;var c=function(t){var e=t.master,r=t.currentTime,n=t.bandwidth,p=t.duration,a=t.segmentDuration,m=t.timeUntilRebuffer,h=t.currentTimeline,f=t.syncController,o=e.playlists.filter(S.default.hasAttribute.bind(null,"BANDWIDTH")),v=o.map(function(E){var y=f.getSyncPoint(E,p,h,r),d=y?1:2;return{playlist:E,rebufferingImpact:S.default.estimateSegmentRequestTime(a,n,E)*d-m}}),T=v.filter(function(E){return E.rebufferingImpact<=0});return _(T,function(E,y){return l(y.playlist,E.playlist)}),T.length?T[0]:(_(v,function(E,y){return E.rebufferingImpact-y.rebufferingImpact}),v[0]||null)};U.minRebufferMaxBandwidthSelector=c},{}],10:[function(C,B,U){(function(O){"use strict";Object.defineProperty(U,"__esModule",{value:!0});var A=typeof window!="undefined"?window.videojs:O!==void 0?O.videojs:null,k=C(30),w=function(v){return v&&v.__esModule?v:{default:v}}(k),S={UNSAFE_LIVE_SEGMENTS:3},b=function(v,T){var E=0,y=T-v.mediaSequence,d=v.segments[y];if(d){if(typeof d.start!="undefined")return{result:d.start,precise:!0};if(typeof d.end!="undefined")return{result:d.end-d.duration,precise:!0}}for(;y--;){if(d=v.segments[y],typeof d.end!="undefined")return{result:E+d.end,precise:!0};if(E+=d.duration,typeof d.start!="undefined")return{result:E+d.start,precise:!0}}return{result:E,precise:!1}},_=function(v,T){for(var E=0,y=void 0,d=T-v.mediaSequence;d<v.segments.length;d++){if(y=v.segments[d],typeof y.start!="undefined")return{result:y.start-E,precise:!0};if(E+=y.duration,typeof y.end!="undefined")return{result:y.end-E,precise:!0}}return{result:-1,precise:!1}},l=function(v,T,E){var y=void 0,d=void 0;return T===void 0&&(T=v.mediaSequence+v.segments.length),T<v.mediaSequence?0:(y=b(v,T),y.precise?y.result:(d=_(v,T),d.precise?d.result:y.result+E))},g=function(v,T,E){if(!v)return 0;if(typeof E!="number"&&(E=0),T===void 0){if(v.totalDuration)return v.totalDuration;if(!v.endList)return w.default.Infinity}return l(v,T,E)};U.duration=g;var s=function(v,T,E){var y=0;if(T>E){var d=[E,T];T=d[0],E=d[1]}if(T<0){for(var L=T;L<Math.min(0,E);L++)y+=v.targetDuration;T=0}for(var L=T;L<E;L++)y+=v.segments[L].duration;return y};U.sumDurations=s;var u=function(v,T,E){if(!v||!v.segments)return null;if(v.endList)return g(v);if(T===null)return null;T=T||0;var y=E?Math.max(0,v.segments.length-S.UNSAFE_LIVE_SEGMENTS):Math.max(0,v.segments.length);return l(v,v.mediaSequence+y,T)};U.playlistEnd=u;var i=function(v,T){var E=T||0,y=u(v,T,!0);return y===null?(0,A.createTimeRange)():(0,A.createTimeRange)(E,y)};U.seekable=i;var c=function(v){return v-Math.floor(v)==0},t=function(v,T){if(c(T))return T+.1*v;for(var E=T.toString().split(".")[1].length,y=1;y<=E;y++){var d=Math.pow(10,y),L=T*d;if(c(L)||y===E)return(L+v)/d}},e=t.bind(null,1),r=t.bind(null,-1),n=function(v,T,E,y){var d=void 0,L=void 0,I=v.segments.length,M=T-y;if(M<0){if(E>0){for(d=E-1;d>=0;d--)if(L=v.segments[d],(M+=r(L.duration))>0)return{mediaIndex:d,startTime:y-s(v,E,d)}}return{mediaIndex:0,startTime:T}}if(E<0){for(d=E;d<0;d++)if((M-=v.targetDuration)<0)return{mediaIndex:0,startTime:T};E=0}for(d=E;d<I;d++)if(L=v.segments[d],(M-=e(L.duration))<0)return{mediaIndex:d,startTime:y+s(v,E,d)};return{mediaIndex:I-1,startTime:T}};U.getMediaInfoForTime=n;var p=function(v){return v.excludeUntil&&v.excludeUntil>Date.now()};U.isBlacklisted=p;var a=function(v){var T=p(v);return!v.disabled&&!T};U.isEnabled=a;var m=function(v){for(var T=0;T<v.segments.length;T++)if(v.segments[T].key)return!0;return!1};U.isAes=m;var h=function(v){for(var T=0;T<v.segments.length;T++)if(v.segments[T].map)return!0;return!1};U.isFmp4=h;var f=function(v,T){return T.attributes&&T.attributes[v]};U.hasAttribute=f;var o=function(v,T,E){var y=arguments.length<=3||arguments[3]===void 0?0:arguments[3];return f("BANDWIDTH",E)?(v*E.attributes.BANDWIDTH-8*y)/T:NaN};U.estimateSegmentRequestTime=o,S.duration=g,S.seekable=i,S.getMediaInfoForTime=n,S.isEnabled=a,S.isBlacklisted=p,S.playlistEnd=u,S.isAes=m,S.isFmp4=h,S.hasAttribute=f,S.estimateSegmentRequestTime=o,U.default=S}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],11:[function(C,B,U){(function(O){"use strict";Object.defineProperty(U,"__esModule",{value:!0});var A=function(){function r(n,p){var a=[],m=!0,h=!1,f=void 0;try{for(var o,v=n[Symbol.iterator]();!(m=(o=v.next()).done)&&(a.push(o.value),!p||a.length!==p);m=!0);}catch(T){h=!0,f=T}finally{try{!m&&v.return&&v.return()}finally{if(h)throw f}}return a}return function(n,p){if(Array.isArray(n))return n;if(Symbol.iterator in Object(n))return r(n,p);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),k=typeof window!="undefined"?window.videojs:O!==void 0?O.videojs:null,w=function(r){return r&&r.__esModule?r:{default:r}}(k),S=function(r,n){var p=A(n,2),a=p[0],m=p[1];return Math.min(Math.max(a,r),m)},b=function(r,n){var p=[],a=void 0;if(r&&r.length)for(a=0;a<r.length;a++)n(r.start(a),r.end(a))&&p.push([r.start(a),r.end(a)]);return w.default.createTimeRanges(p)},_=function(r,n){return b(r,function(p,a){return p-1/30<=n&&a+1/30>=n})},l=function(r,n){return b(r,function(p){return p-1/30>=n})},g=function(r){if(r.length<2)return w.default.createTimeRanges();for(var n=[],p=1;p<r.length;p++){var a=r.end(p-1),m=r.start(p);n.push([a,m])}return w.default.createTimeRanges(n)},s=function(r,n){var p=void 0,a=void 0,m=void 0,h=[],f=[],o=function(v){return v[0]<=m&&v[1]>=m};if(r)for(p=0;p<r.length;p++)a=r.start(p),m=r.end(p),f.push([a,m]);if(n)for(p=0;p<n.length;p++)a=n.start(p),m=n.end(p),f.some(o)||h.push(m);return h.length!==1?null:h[0]},u=function(r,n){var p=null,a=null,m=0,h=[],f=[];if(!(r&&r.length&&n&&n.length))return w.default.createTimeRange();for(var o=r.length;o--;)h.push({time:r.start(o),type:"start"}),h.push({time:r.end(o),type:"end"});for(o=n.length;o--;)h.push({time:n.start(o),type:"start"}),h.push({time:n.end(o),type:"end"});for(h.sort(function(v,T){return v.time-T.time}),o=0;o<h.length;o++)h[o].type==="start"?++m==2&&(p=h[o].time):h[o].type==="end"&&--m==1&&(a=h[o].time),p!==null&&a!==null&&(f.push([p,a]),p=null,a=null);return w.default.createTimeRanges(f)},i=function(r,n,p,a){for(var m=n.end(0)-n.start(0),h=r.end(0)-r.start(0),f=m-h,o=u(r,a),v=u(n,a),T=0,E=0,y=o.length;y--;)T+=o.end(y)-o.start(y),o.start(y)===p&&(T+=f);for(y=v.length;y--;)E+=v.end(y)-v.start(y);return Math.max(T,E)/m*100},c=function(r,n,p,a){var m=r+n,h=w.default.createTimeRanges([[r,m]]),f=w.default.createTimeRanges([[S(r,[p,m]),m]]);if(f.start(0)===f.end(0))return 0;var o=i(f,h,p,a);return isNaN(o)||o===Infinity||o===-Infinity?0:o},t=function(r){var n=[];if(!r||!r.length)return"";for(var p=0;p<r.length;p++)n.push(r.start(p)+" => "+r.end(p));return n.join(", ")},e=function(r,n){var p=arguments.length<=2||arguments[2]===void 0?1:arguments[2];return((r.length?r.end(r.length-1):0)-n)/p};U.default={findRange:_,findNextRange:l,findGaps:g,findSoleUncommonTimeRangesEnd:s,getSegmentBufferedPercent:c,TIME_FUDGE_FACTOR:1/30,printableRange:t,timeUntilRebuffer:e},B.exports=U.default}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],12:[function(C,B,U){(function(O){"use strict";Object.defineProperty(U,"__esModule",{value:!0});var A=typeof window!="undefined"?window.videojs:O!==void 0?O.videojs:null,k=function(_){return _&&_.__esModule?_:{default:_}}(A),w={errorInterval:30,getSource:function(_){return _(this.tech({IWillNotUseThisInPlugins:!0}).currentSource_)}},S=function _(l,g){var s=0,u=0,i=k.default.mergeOptions(w,g);l.ready(function(){l.trigger({type:"usage",name:"hls-error-reload-initialized"})});var c=function(){u&&l.currentTime(u)},t=function(p){p!=null&&(u=l.duration()!==Infinity&&l.currentTime()||0,l.one("loadedmetadata",c),l.src(p),l.trigger({type:"usage",name:"hls-error-reload"}),l.play())},e=function(){return Date.now()-s<1e3*i.errorInterval?void l.trigger({type:"usage",name:"hls-error-reload-canceled"}):i.getSource&&typeof i.getSource=="function"?(s=Date.now(),i.getSource.call(l,t)):void k.default.log.error("ERROR: reloadSourceOnError - The option getSource must be a function!")},r=function p(){l.off("loadedmetadata",c),l.off("error",e),l.off("dispose",p)},n=function(p){r(),_(l,p)};l.on("error",e),l.on("dispose",r),l.reloadSourceOnError=n},b=function(_){S(this,_)};U.default=b,B.exports=U.default}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],13:[function(C,B,U){"use strict";function O(b,_){if(!(b instanceof _))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(U,"__esModule",{value:!0});var A=C(10),k=function(b,_,l,g){var s=b.master.playlists[_],u=(0,A.isBlacklisted)(s),i=(0,A.isEnabled)(s);return g===void 0?i:(g?delete s.disabled:s.disabled=!0,g===i||u||(l(),g?b.trigger("renditionenabled"):b.trigger("renditiondisabled")),g)},w=function b(_,l,g){O(this,b);var s=_.masterPlaylistController_.fastQualityChange_.bind(_.masterPlaylistController_);if(l.attributes.RESOLUTION){var u=l.attributes.RESOLUTION;this.width=u.width,this.height=u.height}this.bandwidth=l.attributes.BANDWIDTH,this.id=g,this.enabled=k.bind(this,_.playlists,l.uri,s)},S=function(b){var _=b.playlists;b.representations=function(){return _.master.playlists.filter(function(l){return!(0,A.isBlacklisted)(l)}).map(function(l,g){return new w(b,l,l.uri)})}};U.default=S,B.exports=U.default},{}],14:[function(C,B,U){"use strict";function O(_){return _&&_.__esModule?_:{default:_}}Object.defineProperty(U,"__esModule",{value:!0});var A=C(61),k=O(A),w=C(30),S=O(w),b=function(_,l){return/^[a-z]+:/i.test(l)?l:(/\/\//i.test(_)||(_=k.default.buildAbsoluteURL(S.default.location.href,_)),k.default.buildAbsoluteURL(_,l))};U.default=b,B.exports=U.default},{}],15:[function(C,B,U){(function(O){"use strict";function A(E){return E&&E.__esModule?E:{default:E}}function k(E,y){if(!(E instanceof y))throw new TypeError("Cannot call a class as a function")}function w(E,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof y);E.prototype=Object.create(y&&y.prototype,{constructor:{value:E,enumerable:!1,writable:!0,configurable:!0}}),y&&(Object.setPrototypeOf?Object.setPrototypeOf(E,y):E.__proto__=y)}Object.defineProperty(U,"__esModule",{value:!0});var S=function(){function E(y,d){for(var L=0;L<d.length;L++){var I=d[L];I.enumerable=I.enumerable||!1,I.configurable=!0,"value"in I&&(I.writable=!0),Object.defineProperty(y,I.key,I)}}return function(y,d,L){return d&&E(y.prototype,d),L&&E(y,L),y}}(),b=function(E,y,d){for(var L=!0;L;){var I=E,M=y,q=d;L=!1,I===null&&(I=Function.prototype);var V=Object.getOwnPropertyDescriptor(I,M);if(V!==void 0){if("value"in V)return V.value;var W=V.get;return W===void 0?void 0:W.call(q)}var X=Object.getPrototypeOf(I);if(X===null)return;E=X,y=M,d=q,L=!0,V=X=void 0}},_=C(10),l=A(_),g=typeof window!="undefined"?window.videojs:O!==void 0?O.videojs:null,s=A(g),u=C(16),i=A(u),c=C(3),t=A(c),e=C(30),r=A(e),n=C(71),p=A(n),a=C(2),m=C(6),h=C(11),f=C(9),o=function(E,y,d){if(!E||!y)return!1;var L=E.segments,I=d===L.length;return E.endList&&y.readyState==="open"&&I},v=function(E){return typeof E=="number"&&isFinite(E)},T=function(E){function y(d){var L=this,I=arguments.length<=1||arguments[1]===void 0?{}:arguments[1];if(k(this,y),b(Object.getPrototypeOf(y.prototype),"constructor",this).call(this),!d)throw new TypeError("Initialization settings are required");if(typeof d.currentTime!="function")throw new TypeError("No currentTime getter specified");if(!d.mediaSource)throw new TypeError("No MediaSource specified");this.state="INIT",this.bandwidth=d.bandwidth,this.throughput={rate:0,count:0},this.roundTrip=NaN,this.resetStats_(),this.mediaIndex=null,this.hasPlayed_=d.hasPlayed,this.currentTime_=d.currentTime,this.seekable_=d.seekable,this.seeking_=d.seeking,this.duration_=d.duration,this.mediaSource_=d.mediaSource,this.hls_=d.hls,this.loaderType_=d.loaderType,this.segmentMetadataTrack_=d.segmentMetadataTrack,this.goalBufferLength_=d.goalBufferLength,this.checkBufferTimeout_=null,this.error_=void 0,this.currentTimeline_=-1,this.pendingSegment_=null,this.mimeType_=null,this.sourceUpdater_=null,this.xhrOptions_=null,this.activeInitSegmentId_=null,this.initSegments_={},this.decrypter_=d.decrypter,this.syncController_=d.syncController,this.syncPoint_={segmentIndex:0,time:0},this.syncController_.on("syncinfoupdate",function(){return L.trigger("syncinfoupdate")}),this.mediaSource_.addEventListener("sourceopen",function(){return L.ended_=!1}),this.fetchAtBuffer_=!1,I.debug&&(this.logger_=s.default.log.bind(s.default,"segment-loader",this.loaderType_,"->"))}return w(y,E),S(y,[{key:"resetStats_",value:function(){this.mediaBytesTransferred=0,this.mediaRequests=0,this.mediaRequestsAborted=0,this.mediaRequestsTimedout=0,this.mediaRequestsErrored=0,this.mediaTransferDuration=0,this.mediaSecondsLoaded=0}},{key:"dispose",value:function(){this.state="DISPOSED",this.pause(),this.abort_(),this.sourceUpdater_&&this.sourceUpdater_.dispose(),this.resetStats_()}},{key:"abort",value:function(){if(this.state!=="WAITING")return void(this.pendingSegment_&&(this.pendingSegment_=null));this.abort_(),this.state="READY",this.paused()||this.monitorBuffer_()}},{key:"abort_",value:function(){this.pendingSegment_&&this.pendingSegment_.abortRequests(),this.pendingSegment_=null}},{key:"error",value:function(d){return d!==void 0&&(this.error_=d),this.pendingSegment_=null,this.error_}},{key:"endOfStream",value:function(){this.ended_=!0,this.pause(),this.trigger("ended")}},{key:"buffered_",value:function(){return this.sourceUpdater_?this.sourceUpdater_.buffered():s.default.createTimeRanges()}},{key:"initSegment",value:function(d){var L=!(arguments.length<=1||arguments[1]===void 0)&&arguments[1];if(!d)return null;var I=(0,a.initSegmentId)(d),M=this.initSegments_[I];return L&&!M&&d.bytes&&(this.initSegments_[I]=M={resolvedUri:d.resolvedUri,byterange:d.byterange,bytes:d.bytes}),M||d}},{key:"couldBeginLoading_",value:function(){return this.playlist_&&(this.sourceUpdater_||this.mimeType_&&this.state==="INIT")&&!this.paused()}},{key:"load",value:function(){if(this.monitorBuffer_(),this.playlist_){if(this.syncController_.setDateTimeMapping(this.playlist_),this.state==="INIT"&&this.couldBeginLoading_())return this.init_();!this.couldBeginLoading_()||this.state!=="READY"&&this.state!=="INIT"||(this.state="READY")}}},{key:"init_",value:function(){return this.state="READY",this.sourceUpdater_=new i.default(this.mediaSource_,this.mimeType_),this.resetEverything(),this.monitorBuffer_()}},{key:"playlist",value:function(d){var L=arguments.length<=1||arguments[1]===void 0?{}:arguments[1];if(d){var I=this.playlist_,M=this.pendingSegment_;if(this.playlist_=d,this.xhrOptions_=L,this.hasPlayed_()||(d.syncInfo={mediaSequence:d.mediaSequence,time:0}),this.trigger("syncinfoupdate"),this.state==="INIT"&&this.couldBeginLoading_())return this.init_();if(!I||I.uri!==d.uri)return void(this.mediaIndex!==null&&this.resyncLoader());var q=d.mediaSequence-I.mediaSequence;this.logger_("mediaSequenceDiff",q),this.mediaIndex!==null&&(this.mediaIndex-=q),M&&(M.mediaIndex-=q,M.mediaIndex>=0&&(M.segment=d.segments[M.mediaIndex])),this.syncController_.saveExpiredSegmentInfo(I,d)}}},{key:"pause",value:function(){this.checkBufferTimeout_&&(r.default.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=null)}},{key:"paused",value:function(){return this.checkBufferTimeout_===null}},{key:"mimeType",value:function(d){this.mimeType_||(this.mimeType_=d,this.state==="INIT"&&this.couldBeginLoading_()&&this.init_())}},{key:"resetEverything",value:function(){this.ended_=!1,this.resetLoader(),this.remove(0,Infinity)}},{key:"resetLoader",value:function(){this.fetchAtBuffer_=!1,this.resyncLoader()}},{key:"resyncLoader",value:function(){this.mediaIndex=null,this.syncPoint_=null,this.abort()}},{key:"remove",value:function(d,L){this.sourceUpdater_&&this.sourceUpdater_.remove(d,L),(0,p.default)(d,L,this.segmentMetadataTrack_)}},{key:"monitorBuffer_",value:function(){this.checkBufferTimeout_&&r.default.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=r.default.setTimeout(this.monitorBufferTick_.bind(this),1)}},{key:"monitorBufferTick_",value:function(){this.state==="READY"&&this.fillBuffer_(),this.checkBufferTimeout_&&r.default.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=r.default.setTimeout(this.monitorBufferTick_.bind(this),500)}},{key:"fillBuffer_",value:function(){if(!this.sourceUpdater_.updating()){this.syncPoint_||(this.syncPoint_=this.syncController_.getSyncPoint(this.playlist_,this.duration_(),this.currentTimeline_,this.currentTime_()));var d=this.checkBuffer_(this.buffered_(),this.playlist_,this.mediaIndex,this.hasPlayed_(),this.currentTime_(),this.syncPoint_);if(d){if(o(this.playlist_,this.mediaSource_,d.mediaIndex))return void this.endOfStream();(d.mediaIndex!==this.playlist_.segments.length-1||this.mediaSource_.readyState!=="ended"||this.seeking_())&&((d.timeline!==this.currentTimeline_||d.startOfSegment!==null&&d.startOfSegment<this.sourceUpdater_.timestampOffset())&&(this.syncController_.reset(),d.timestampOffset=d.startOfSegment),this.loadSegment_(d))}}}},{key:"checkBuffer_",value:function(d,L,I,M,q,V){var W=0,X=void 0;d.length&&(W=d.end(d.length-1));var $=Math.max(0,W-q);if(!L.segments.length||$>=this.goalBufferLength_()||!M&&$>=1)return null;if(this.logger_("checkBuffer_","mediaIndex:",I,"hasPlayed:",M,"currentTime:",q,"syncPoint:",V,"fetchAtBuffer:",this.fetchAtBuffer_,"bufferedTime:",$),V===null)return I=this.getSyncSegmentCandidate_(L),this.logger_("getSync","mediaIndex:",I),this.generateSegmentInfo_(L,I,null,!0);if(I!==null){this.logger_("walkForward","mediaIndex:",I+1);var Q=L.segments[I];return X=Q&&Q.end?Q.end:W,this.generateSegmentInfo_(L,I+1,X,!1)}if(this.fetchAtBuffer_){var N=l.default.getMediaInfoForTime(L,W,V.segmentIndex,V.time);I=N.mediaIndex,X=N.startTime}else{var N=l.default.getMediaInfoForTime(L,q,V.segmentIndex,V.time);I=N.mediaIndex,X=N.startTime}return this.logger_("getMediaIndexForTime","mediaIndex:",I,"startOfSegment:",X),this.generateSegmentInfo_(L,I,X,!1)}},{key:"getSyncSegmentCandidate_",value:function(d){var L=this;if(this.currentTimeline_===-1)return 0;var I=d.segments.map(function(M,q){return{timeline:M.timeline,segmentIndex:q}}).filter(function(M){return M.timeline===L.currentTimeline_});return I.length?I[Math.min(I.length-1,1)].segmentIndex:Math.max(d.segments.length-1,0)}},{key:"generateSegmentInfo_",value:function(d,L,I,M){if(L<0||L>=d.segments.length)return null;var q=d.segments[L];return{requestId:"segment-loader-"+Math.random(),uri:q.resolvedUri,mediaIndex:L,isSyncRequest:M,startOfSegment:I,playlist:d,bytes:null,encryptedBytes:null,timestampOffset:null,timeline:q.timeline,duration:q.duration,segment:q}}},{key:"abortRequestEarly_",value:function(d){if(this.hls_.tech_.paused()||!this.xhrOptions_.timeout||!this.playlist_.attributes.BANDWIDTH||Date.now()-(d.firstBytesReceivedAt||Date.now())<1e3)return!1;var L=this.currentTime_(),I=d.bandwidth,M=this.pendingSegment_.duration,q=l.default.estimateSegmentRequestTime(M,I,this.playlist_,d.bytesReceived),V=(0,h.timeUntilRebuffer)(this.buffered_(),L,this.hls_.tech_.playbackRate())-1;if(q<=V)return!1;var W=(0,f.minRebufferMaxBandwidthSelector)({master:this.hls_.playlists.master,currentTime:L,bandwidth:I,duration:this.duration_(),segmentDuration:M,timeUntilRebuffer:V,currentTimeline:this.currentTimeline_,syncController:this.syncController_});if(W){var X=q-V,$=X-W.rebufferingImpact,Q=.5;return V<=h.TIME_FUDGE_FACTOR&&(Q=1),!W.playlist||W.playlist.uri===this.playlist_.uri||$<Q?!1:(this.bandwidth=W.playlist.attributes.BANDWIDTH*t.default.BANDWIDTH_VARIANCE+1,this.abort(),this.trigger("bandwidthupdate"),!0)}}},{key:"handleProgress_",value:function(d,L){this.pendingSegment_&&L.requestId===this.pendingSegment_.requestId&&!this.abortRequestEarly_(L.stats)&&this.trigger("progress")}},{key:"loadSegment_",value:function(d){this.state="WAITING",this.pendingSegment_=d,this.trimBackBuffer_(d),d.abortRequests=(0,m.mediaSegmentRequest)(this.hls_.xhr,this.xhrOptions_,this.decrypter_,this.createSimplifiedSegmentObj_(d),this.handleProgress_.bind(this),this.segmentRequestFinished_.bind(this))}},{key:"trimBackBuffer_",value:function(d){var L=this.seekable_(),I=this.currentTime_(),M=0;(M=L.length&&L.start(0)>0&&L.start(0)<I?L.start(0):I-30)>0&&this.remove(0,M)}},{key:"createSimplifiedSegmentObj_",value:function(d){var L=d.segment,I={resolvedUri:L.resolvedUri,byterange:L.byterange,requestId:d.requestId};if(L.key){var M=L.key.iv||new Uint32Array([0,0,0,d.mediaIndex+d.playlist.mediaSequence]);I.key={resolvedUri:L.key.resolvedUri,iv:M}}return L.map&&(I.map=this.initSegment(L.map)),I}},{key:"segmentRequestFinished_",value:function(d,L){if(this.mediaRequests+=1,L.stats&&(this.mediaBytesTransferred+=L.stats.bytesReceived,this.mediaTransferDuration+=L.stats.roundTripTime),!this.pendingSegment_)return void(this.mediaRequestsAborted+=1);if(L.requestId===this.pendingSegment_.requestId){if(d)return this.pendingSegment_=null,this.state="READY",d.code===m.REQUEST_ERRORS.ABORTED?void(this.mediaRequestsAborted+=1):(this.pause(),d.code===m.REQUEST_ERRORS.TIMEOUT?(this.mediaRequestsTimedout+=1,this.bandwidth=1,this.roundTrip=NaN,void this.trigger("bandwidthupdate")):(this.mediaRequestsErrored+=1,this.error(d),void this.trigger("error")));this.bandwidth=L.stats.bandwidth,this.roundTrip=L.stats.roundTripTime,L.map&&(L.map=this.initSegment(L.map,!0)),this.processSegmentResponse_(L)}}},{key:"processSegmentResponse_",value:function(d){var L=this.pendingSegment_;L.bytes=d.bytes,d.map&&(L.segment.map.bytes=d.map.bytes),L.endOfAllRequests=d.endOfAllRequests,this.handleSegment_()}},{key:"handleSegment_",value:function(){var d=this;if(!this.pendingSegment_)return void(this.state="READY");this.state="APPENDING";var L=this.pendingSegment_,I=L.segment;if(this.syncController_.probeSegmentInfo(L),L.isSyncRequest)return this.trigger("syncinfoupdate"),this.pendingSegment_=null,void(this.state="READY");L.timestampOffset!==null&&L.timestampOffset!==this.sourceUpdater_.timestampOffset()&&(this.sourceUpdater_.timestampOffset(L.timestampOffset),this.trigger("timestampoffset")),I.map&&function(){var M=(0,a.initSegmentId)(I.map);if(!d.activeInitSegmentId_||d.activeInitSegmentId_!==M){var q=d.initSegment(I.map);d.sourceUpdater_.appendBuffer(q.bytes,function(){d.activeInitSegmentId_=M})}}(),L.byteLength=L.bytes.byteLength,typeof I.start=="number"&&typeof I.end=="number"?this.mediaSecondsLoaded+=I.end-I.start:this.mediaSecondsLoaded+=I.duration,this.sourceUpdater_.appendBuffer(L.bytes,this.handleUpdateEnd_.bind(this))}},{key:"handleUpdateEnd_",value:function(){if(this.logger_("handleUpdateEnd_","segmentInfo:",this.pendingSegment_),!this.pendingSegment_)return this.state="READY",void(this.paused()||this.monitorBuffer_());var d=this.pendingSegment_,L=d.segment,I=this.mediaIndex!==null;if(this.pendingSegment_=null,this.recordThroughput_(d),this.addSegmentMetadataCue_(d),this.state="READY",this.mediaIndex=d.mediaIndex,this.fetchAtBuffer_=!0,this.currentTimeline_=d.timeline,this.trigger("syncinfoupdate"),L.end&&this.currentTime_()-L.end>3*d.playlist.targetDuration)return void this.resetEverything();I&&this.trigger("bandwidthupdate"),this.trigger("progress"),o(d.playlist,this.mediaSource_,d.mediaIndex+1)&&this.endOfStream(),this.paused()||this.monitorBuffer_()}},{key:"recordThroughput_",value:function(d){var L=this.throughput.rate,I=Date.now()-d.endOfAllRequests+1,M=Math.floor(d.byteLength/I*8*1e3);this.throughput.rate+=(M-L)/++this.throughput.count}},{key:"logger_",value:function(){}},{key:"addSegmentMetadataCue_",value:function(d){if(this.segmentMetadataTrack_){var L=d.segment,I=L.start,M=L.end;if(v(I)&&v(M)){(0,p.default)(I,M,this.segmentMetadataTrack_);var q=r.default.WebKitDataCue||r.default.VTTCue,V={uri:d.uri,timeline:d.timeline,playlist:d.playlist.uri,start:I,end:M},W=JSON.stringify(V),X=new q(I,M,W);X.value=V,this.segmentMetadataTrack_.addCue(X)}}}}]),y}(s.default.EventTarget);U.default=T,B.exports=U.default}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],16:[function(C,B,U){(function(O){"use strict";function A(l,g){if(!(l instanceof g))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(U,"__esModule",{value:!0});var k=function(){function l(g,s){for(var u=0;u<s.length;u++){var i=s[u];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(g,i.key,i)}}return function(g,s,u){return s&&l(g.prototype,s),u&&l(g,u),g}}(),w=typeof window!="undefined"?window.videojs:O!==void 0?O.videojs:null,S=function(l){return l&&l.__esModule?l:{default:l}}(w),b=function(){},_=function(){function l(g,s){var u=this;A(this,l);var i=function(){u.sourceBuffer_=g.addSourceBuffer(s),u.onUpdateendCallback_=function(){var c=u.pendingCallback_;u.pendingCallback_=null,c&&c(),u.runCallback_()},u.sourceBuffer_.addEventListener("updateend",u.onUpdateendCallback_),u.runCallback_()};this.callbacks_=[],this.pendingCallback_=null,this.timestampOffset_=0,this.mediaSource=g,this.processedAppend_=!1,g.readyState==="closed"?g.addEventListener("sourceopen",i):i()}return k(l,[{key:"abort",value:function(g){var s=this;this.processedAppend_&&this.queueCallback_(function(){s.sourceBuffer_.abort()},g)}},{key:"appendBuffer",value:function(g,s){var u=this;this.processedAppend_=!0,this.queueCallback_(function(){u.sourceBuffer_.appendBuffer(g)},s)}},{key:"buffered",value:function(){return this.sourceBuffer_?this.sourceBuffer_.buffered:S.default.createTimeRanges()}},{key:"remove",value:function(g,s){var u=this;this.processedAppend_&&this.queueCallback_(function(){u.sourceBuffer_.remove(g,s)},b)}},{key:"updating",value:function(){return!this.sourceBuffer_||this.sourceBuffer_.updating||this.pendingCallback_}},{key:"timestampOffset",value:function(g){var s=this;return g!==void 0&&(this.queueCallback_(function(){s.sourceBuffer_.timestampOffset=g}),this.timestampOffset_=g),this.timestampOffset_}},{key:"queueCallback_",value:function(g,s){this.callbacks_.push([g.bind(this),s]),this.runCallback_()}},{key:"runCallback_",value:function(){var g=void 0;!this.updating()&&this.callbacks_.length&&(g=this.callbacks_.shift(),this.pendingCallback_=g[1],g[0]())}},{key:"dispose",value:function(){this.sourceBuffer_.removeEventListener("updateend",this.onUpdateendCallback_),this.sourceBuffer_&&this.mediaSource.readyState==="open"&&this.sourceBuffer_.abort()}}]),l}();U.default=_,B.exports=U.default}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],17:[function(C,B,U){(function(O){"use strict";function A(e){return e&&e.__esModule?e:{default:e}}function k(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}function w(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof r);e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),r&&(Object.setPrototypeOf?Object.setPrototypeOf(e,r):e.__proto__=r)}Object.defineProperty(U,"__esModule",{value:!0});var S=function(){function e(r,n){for(var p=0;p<n.length;p++){var a=n[p];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(r,a.key,a)}}return function(r,n,p){return n&&e(r.prototype,n),p&&e(r,p),r}}(),b=function(e,r,n){for(var p=!0;p;){var a=e,m=r,h=n;p=!1,a===null&&(a=Function.prototype);var f=Object.getOwnPropertyDescriptor(a,m);if(f!==void 0){if("value"in f)return f.value;var o=f.get;return o===void 0?void 0:o.call(h)}var v=Object.getPrototypeOf(a);if(v===null)return;e=v,r=m,n=h,p=!0,f=v=void 0}},_=C(55),l=A(_),g=C(57),s=C(10),u=typeof window!="undefined"?window.videojs:O!==void 0?O.videojs:null,i=A(u),c=[{name:"VOD",run:function(e,r,n,p,a){return n!==Infinity?{time:0,segmentIndex:0}:null}},{name:"ProgramDateTime",run:function(e,r,n,p,a){return e.datetimeToDisplayTime&&r.dateTimeObject?{time:r.dateTimeObject.getTime()/1e3+e.datetimeToDisplayTime,segmentIndex:0}:null}},{name:"Segment",run:function(e,r,n,p,a){var m=r.segments||[],h=null,f=null;a=a||0;for(var o=0;o<m.length;o++){var v=m[o];if(v.timeline===p&&typeof v.start!="undefined"){var T=Math.abs(a-v.start);if(f!==null&&f<T)break;(!h||f===null||f>=T)&&(f=T,h={time:v.start,segmentIndex:o})}}return h}},{name:"Discontinuity",run:function(e,r,n,p,a){var m=null;if(a=a||0,r.discontinuityStarts&&r.discontinuityStarts.length)for(var h=null,f=0;f<r.discontinuityStarts.length;f++){var o=r.discontinuityStarts[f],v=r.discontinuitySequence+f+1,T=e.discontinuities[v];if(T){var E=Math.abs(a-T.time);if(h!==null&&h<E)break;(!m||h===null||h>=E)&&(h=E,m={time:T.time,segmentIndex:o})}}return m}},{name:"Playlist",run:function(e,r,n,p,a){return r.syncInfo?{time:r.syncInfo.time,segmentIndex:r.syncInfo.mediaSequence-r.mediaSequence}:null}}];U.syncPointStrategies=c;var t=function(e){function r(){var n=arguments.length<=0||arguments[0]===void 0?{}:arguments[0];k(this,r),b(Object.getPrototypeOf(r.prototype),"constructor",this).call(this),this.inspectCache_=void 0,this.timelines=[],this.discontinuities=[],this.datetimeToDisplayTime=null,n.debug&&(this.logger_=i.default.log.bind(i.default,"sync-controller ->"))}return w(r,e),S(r,[{key:"getSyncPoint",value:function(n,p,a,m){var h=this.runStrategies_(n,p,a,m);return h.length?this.selectSyncPoint_(h,{key:"time",value:m}):null}},{key:"getExpiredTime",value:function(n,p){if(!n||!n.segments)return null;var a=this.runStrategies_(n,p,n.discontinuitySequence,0);if(!a.length)return null;var m=this.selectSyncPoint_(a,{key:"segmentIndex",value:0});return m.segmentIndex>0&&(m.time*=-1),Math.abs(m.time+(0,s.sumDurations)(n,m.segmentIndex,0))}},{key:"runStrategies_",value:function(n,p,a,m){for(var h=[],f=0;f<c.length;f++){var o=c[f],v=o.run(this,n,p,a,m);v&&(v.strategy=o.name,h.push({strategy:o.name,syncPoint:v}),this.logger_("syncPoint found via <"+o.name+">:",v))}return h}},{key:"selectSyncPoint_",value:function(n,p){for(var a=n[0].syncPoint,m=Math.abs(n[0].syncPoint[p.key]-p.value),h=n[0].strategy,f=1;f<n.length;f++){var o=Math.abs(n[f].syncPoint[p.key]-p.value);o<m&&(m=o,a=n[f].syncPoint,h=n[f].strategy)}return this.logger_("syncPoint with strategy <"+h+"> chosen: ",a),a}},{key:"saveExpiredSegmentInfo",value:function(n,p){for(var a=p.mediaSequence-n.mediaSequence,m=a-1;m>=0;m--){var h=n.segments[m];if(h&&typeof h.start!="undefined"){p.syncInfo={mediaSequence:n.mediaSequence+m,time:h.start},this.logger_("playlist sync:",p.syncInfo),this.trigger("syncinfoupdate");break}}}},{key:"setDateTimeMapping",value:function(n){if(!this.datetimeToDisplayTime&&n.dateTimeObject){var p=n.dateTimeObject.getTime()/1e3;this.datetimeToDisplayTime=-p}}},{key:"reset",value:function(){this.inspectCache_=void 0}},{key:"probeSegmentInfo",value:function(n){var p=n.segment,a=void 0;(a=p.map?this.probeMp4Segment_(n):this.probeTsSegment_(n))&&this.calculateSegmentTimeMapping_(n,a)&&this.saveDiscontinuitySyncInfo_(n)}},{key:"probeMp4Segment_",value:function(n){var p=n.segment,a=l.default.timescale(p.map.bytes),m=l.default.startTime(a,n.bytes);return n.timestampOffset!==null&&(n.timestampOffset-=m),{start:m,end:m+p.duration}}},{key:"probeTsSegment_",value:function(n){var p=(0,g.inspect)(n.bytes,this.inspectCache_),a=void 0,m=void 0;return p?(p.video&&p.video.length===2?(this.inspectCache_=p.video[1].dts,a=p.video[0].dtsTime,m=p.video[1].dtsTime):p.audio&&p.audio.length===2&&(this.inspectCache_=p.audio[1].dts,a=p.audio[0].dtsTime,m=p.audio[1].dtsTime),{start:a,end:m}):null}},{key:"timestampOffsetForTimeline",value:function(n){return typeof this.timelines[n]=="undefined"?null:this.timelines[n].time}},{key:"calculateSegmentTimeMapping_",value:function(n,p){var a=n.segment,m=this.timelines[n.timeline];if(n.timestampOffset!==null)this.logger_("tsO:",n.timestampOffset),m={time:n.startOfSegment,mapping:n.startOfSegment-p.start},this.timelines[n.timeline]=m,this.trigger("timestampoffset"),a.start=n.startOfSegment,a.end=p.end+m.mapping;else{if(!m)return!1;a.start=p.start+m.mapping,a.end=p.end+m.mapping}return!0}},{key:"saveDiscontinuitySyncInfo_",value:function(n){var p=n.playlist,a=n.segment;if(a.discontinuity)this.discontinuities[a.timeline]={time:a.start,accuracy:0};else if(p.discontinuityStarts.length)for(var m=0;m<p.discontinuityStarts.length;m++){var h=p.discontinuityStarts[m],f=p.discontinuitySequence+m+1,o=h-n.mediaIndex,v=Math.abs(o);if(!this.discontinuities[f]||this.discontinuities[f].accuracy>v){var T=void 0;T=o<0?a.start-(0,s.sumDurations)(p,n.mediaIndex,h):a.end+(0,s.sumDurations)(p,n.mediaIndex+1,h),this.discontinuities[f]={time:T,accuracy:v}}}}},{key:"logger_",value:function(){}}]),r}(i.default.EventTarget);U.default=t}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],18:[function(C,B,U){(function(O){"use strict";function A(a){return a&&a.__esModule?a:{default:a}}function k(a,m){if(!(a instanceof m))throw new TypeError("Cannot call a class as a function")}function w(a,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof m);a.prototype=Object.create(m&&m.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),m&&(Object.setPrototypeOf?Object.setPrototypeOf(a,m):a.__proto__=m)}Object.defineProperty(U,"__esModule",{value:!0});var S=function(){function a(m,h){for(var f=0;f<h.length;f++){var o=h[f];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(m,o.key,o)}}return function(m,h,f){return h&&a(m.prototype,h),f&&a(m,f),m}}(),b=function(a,m,h){for(var f=!0;f;){var o=a,v=m,T=h;f=!1,o===null&&(o=Function.prototype);var E=Object.getOwnPropertyDescriptor(o,v);if(E!==void 0){if("value"in E)return E.value;var y=E.get;return y===void 0?void 0:y.call(T)}var d=Object.getPrototypeOf(o);if(d===null)return;a=d,m=v,h=T,f=!0,E=d=void 0}},_=C(15),l=A(_),g=typeof window!="undefined"?window.videojs:O!==void 0?O.videojs:null,s=A(g),u=C(30),i=A(u),c=C(71),t=A(c),e=C(2),r=new Uint8Array(`
`.split("").map(function(a){return a.charCodeAt(0)})),n=function(a){return String.fromCharCode.apply(null,a)},p=function(a){function m(h){var f=arguments.length<=1||arguments[1]===void 0?{}:arguments[1];k(this,m),b(Object.getPrototypeOf(m.prototype),"constructor",this).call(this,h,f),this.mediaSource_=null,this.subtitlesTrack_=null}return w(m,a),S(m,[{key:"buffered_",value:function(){if(!this.subtitlesTrack_||!this.subtitlesTrack_.cues.length)return s.default.createTimeRanges();var h=this.subtitlesTrack_.cues,f=h[0].startTime,o=h[h.length-1].startTime;return s.default.createTimeRanges([[f,o]])}},{key:"initSegment",value:function(h){var f=!(arguments.length<=1||arguments[1]===void 0)&&arguments[1];if(!h)return null;var o=(0,e.initSegmentId)(h),v=this.initSegments_[o];if(f&&!v&&h.bytes){var T=r.byteLength+h.bytes.byteLength,E=new Uint8Array(T);E.set(h.bytes),E.set(r,h.bytes.byteLength),this.initSegments_[o]=v={resolvedUri:h.resolvedUri,byterange:h.byterange,bytes:E}}return v||h}},{key:"couldBeginLoading_",value:function(){return this.playlist_&&this.subtitlesTrack_&&!this.paused()}},{key:"init_",value:function(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()}},{key:"track",value:function(h){this.subtitlesTrack_=h,this.state==="INIT"&&this.couldBeginLoading_()&&this.init_()}},{key:"remove",value:function(h,f){(0,t.default)(h,f,this.subtitlesTrack_)}},{key:"fillBuffer_",value:function(){var h=this;this.syncPoint_||(this.syncPoint_=this.syncController_.getSyncPoint(this.playlist_,this.duration_(),this.currentTimeline_,this.currentTime_()));var f=this.checkBuffer_(this.buffered_(),this.playlist_,this.mediaIndex,this.hasPlayed_(),this.currentTime_(),this.syncPoint_);if(f=this.skipEmptySegments_(f)){if(this.syncController_.timestampOffsetForTimeline(f.timeline)===null){var o=function(){h.state="READY",h.paused()||h.monitorBuffer_()};return this.syncController_.one("timestampoffset",o),void(this.state="WAITING_ON_TIMELINE")}this.loadSegment_(f)}}},{key:"skipEmptySegments_",value:function(h){for(;h&&h.segment.empty;)h=this.generateSegmentInfo_(h.playlist,h.mediaIndex+1,h.startOfSegment+h.duration,h.isSyncRequest);return h}},{key:"handleSegment_",value:function(){var h=this;if(!this.pendingSegment_)return void(this.state="READY");this.state="APPENDING";var f=this.pendingSegment_,o=f.segment;if(typeof i.default.WebVTT!="function"&&this.subtitlesTrack_&&this.subtitlesTrack_.tech_){var v=function(){var T=function(){h.handleSegment_()};return h.state="WAITING_ON_VTTJS",h.subtitlesTrack_.tech_.one("vttjsloaded",T),h.subtitlesTrack_.tech_.one("vttjserror",function(){h.subtitlesTrack_.tech_.off("vttjsloaded",T),h.error({message:"Error loading vtt.js"}),h.state="READY",h.pause(),h.trigger("error")}),{v:void 0}}();if(typeof v=="object")return v.v}o.requested=!0;try{this.parseVTTCues_(f)}catch(T){return this.error({message:T.message}),this.state="READY",this.pause(),this.trigger("error")}if(this.updateTimeMapping_(f,this.syncController_.timelines[f.timeline],this.playlist_),f.isSyncRequest)return this.trigger("syncinfoupdate"),this.pendingSegment_=null,void(this.state="READY");f.byteLength=f.bytes.byteLength,this.mediaSecondsLoaded+=o.duration,f.cues.length&&this.remove(f.cues[0].endTime,f.cues[f.cues.length-1].endTime),f.cues.forEach(function(T){h.subtitlesTrack_.addCue(T)}),this.handleUpdateEnd_()}},{key:"parseVTTCues_",value:function(h){var f=void 0,o=!1;typeof i.default.TextDecoder=="function"?f=new i.default.TextDecoder("utf8"):(f=i.default.WebVTT.StringDecoder(),o=!0);var v=new i.default.WebVTT.Parser(i.default,i.default.vttjs,f);if(h.cues=[],h.timestampmap={MPEGTS:0,LOCAL:0},v.oncue=h.cues.push.bind(h.cues),v.ontimestampmap=function(y){return h.timestampmap=y},v.onparsingerror=function(y){s.default.log.warn("Error encountered when parsing cues: "+y.message)},h.segment.map){var T=h.segment.map.bytes;o&&(T=n(T)),v.parse(T)}var E=h.bytes;o&&(E=n(E)),v.parse(E),v.flush()}},{key:"updateTimeMapping_",value:function(h,f,o){var v=h.segment;if(f){if(!h.cues.length)return void(v.empty=!0);var T=h.timestampmap,E=T.MPEGTS/9e4-T.LOCAL+f.mapping;if(h.cues.forEach(function(L){L.startTime+=E,L.endTime+=E}),!o.syncInfo){var y=h.cues[0].startTime,d=h.cues[h.cues.length-1].startTime;o.syncInfo={mediaSequence:o.mediaSequence+h.mediaIndex,time:Math.min(y,d-v.duration)}}}}}]),m}(l.default);U.default=p,B.exports=U.default}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],19:[function(C,B,U){(function(O){"use strict";Object.defineProperty(U,"__esModule",{value:!0});var A=typeof window!="undefined"?window.videojs:O!==void 0?O.videojs:null,k=function(S){return S&&S.__esModule?S:{default:S}}(A),w=function(){return function S(b,_){b=(0,A.mergeOptions)({timeout:45e3},b);var l=S.beforeRequest||k.default.Hls.xhr.beforeRequest;if(l&&typeof l=="function"){var g=l(b);g&&(b=g)}var s=(0,A.xhr)(b,function(i,c){var t=s.response;!i&&t&&(s.responseTime=Date.now(),s.roundTripTime=s.responseTime-s.requestTime,s.bytesReceived=t.byteLength||t.length,s.bandwidth||(s.bandwidth=Math.floor(s.bytesReceived/s.roundTripTime*8*1e3))),i&&i.code==="ETIMEDOUT"&&(s.timedout=!0),i||s.aborted||c.statusCode===200||c.statusCode===206||c.statusCode===0||(i=new Error("XHR Failed with a response of: "+(s&&(t||s.responseText)))),_(i,s)}),u=s.abort;return s.abort=function(){return s.aborted=!0,u.apply(s,arguments)},s.uri=b.uri,s.requestTime=Date.now(),s}};U.default=w,B.exports=U.default}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],20:[function(C,B,U){"use strict";function O(b,_){if(!(b instanceof _))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(U,"__esModule",{value:!0});var A=function(){function b(_,l){for(var g=0;g<l.length;g++){var s=l[g];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(_,s.key,s)}}return function(_,l,g){return l&&b(_.prototype,l),g&&b(_,g),_}}(),k=function(){var b=[[[],[],[],[],[]],[[],[],[],[],[]]],_=b[0],l=b[1],g=_[4],s=l[4],u=void 0,i=void 0,c=void 0,t=[],e=[],r=void 0,n=void 0,p=void 0,a=void 0,m=void 0,h=void 0;for(u=0;u<256;u++)e[(t[u]=u<<1^283*(u>>7))^u]=u;for(i=c=0;!g[i];i^=r||1,c=e[c]||1)for(a=c^c<<1^c<<2^c<<3^c<<4,a=a>>8^255&a^99,g[i]=a,s[a]=i,p=t[n=t[r=t[i]]],h=16843009*p^65537*n^257*r^16843008*i,m=257*t[a]^16843008*a,u=0;u<4;u++)_[u][i]=m=m<<24^m>>>8,l[u][a]=h=h<<24^h>>>8;for(u=0;u<5;u++)_[u]=_[u].slice(0),l[u]=l[u].slice(0);return b},w=null,S=function(){function b(_){O(this,b),w||(w=k()),this._tables=[[w[0][0].slice(),w[0][1].slice(),w[0][2].slice(),w[0][3].slice(),w[0][4].slice()],[w[1][0].slice(),w[1][1].slice(),w[1][2].slice(),w[1][3].slice(),w[1][4].slice()]];var l=void 0,g=void 0,s=void 0,u=void 0,i=void 0,c=this._tables[0][4],t=this._tables[1],e=_.length,r=1;if(e!==4&&e!==6&&e!==8)throw new Error("Invalid aes key size");for(u=_.slice(0),i=[],this._key=[u,i],l=e;l<4*e+28;l++)s=u[l-1],(l%e==0||e===8&&l%e==4)&&(s=c[s>>>24]<<24^c[s>>16&255]<<16^c[s>>8&255]<<8^c[255&s],l%e==0&&(s=s<<8^s>>>24^r<<24,r=r<<1^283*(r>>7))),u[l]=u[l-e]^s;for(g=0;l;g++,l--)s=u[3&g?l:l-4],i[g]=l<=4||g<4?s:t[0][c[s>>>24]]^t[1][c[s>>16&255]]^t[2][c[s>>8&255]]^t[3][c[255&s]]}return A(b,[{key:"decrypt",value:function(_,l,g,s,u,i){var c=this._key[1],t=_^c[0],e=s^c[1],r=g^c[2],n=l^c[3],p=void 0,a=void 0,m=void 0,h=c.length/4-2,f=void 0,o=4,v=this._tables[1],T=v[0],E=v[1],y=v[2],d=v[3],L=v[4];for(f=0;f<h;f++)p=T[t>>>24]^E[e>>16&255]^y[r>>8&255]^d[255&n]^c[o],a=T[e>>>24]^E[r>>16&255]^y[n>>8&255]^d[255&t]^c[o+1],m=T[r>>>24]^E[n>>16&255]^y[t>>8&255]^d[255&e]^c[o+2],n=T[n>>>24]^E[t>>16&255]^y[e>>8&255]^d[255&r]^c[o+3],o+=4,t=p,e=a,r=m;for(f=0;f<4;f++)u[(3&-f)+i]=L[t>>>24]<<24^L[e>>16&255]<<16^L[r>>8&255]<<8^L[255&n]^c[o++],p=t,t=e,e=r,r=n,n=p}}]),b}();U.default=S,B.exports=U.default},{}],21:[function(C,B,U){"use strict";function O(l,g){if(!(l instanceof g))throw new TypeError("Cannot call a class as a function")}function A(l,g){if(typeof g!="function"&&g!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof g);l.prototype=Object.create(g&&g.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),g&&(Object.setPrototypeOf?Object.setPrototypeOf(l,g):l.__proto__=g)}Object.defineProperty(U,"__esModule",{value:!0});var k=function(){function l(g,s){for(var u=0;u<s.length;u++){var i=s[u];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(g,i.key,i)}}return function(g,s,u){return s&&l(g.prototype,s),u&&l(g,u),g}}(),w=function(l,g,s){for(var u=!0;u;){var i=l,c=g,t=s;u=!1,i===null&&(i=Function.prototype);var e=Object.getOwnPropertyDescriptor(i,c);if(e!==void 0){if("value"in e)return e.value;var r=e.get;return r===void 0?void 0:r.call(t)}var n=Object.getPrototypeOf(i);if(n===null)return;l=n,g=c,s=t,u=!0,e=n=void 0}},S=C(24),b=function(l){return l&&l.__esModule?l:{default:l}}(S),_=function(l){function g(){O(this,g),w(Object.getPrototypeOf(g.prototype),"constructor",this).call(this,b.default),this.jobs=[],this.delay=1,this.timeout_=null}return A(g,l),k(g,[{key:"processJob_",value:function(){this.jobs.shift()(),this.jobs.length?this.timeout_=setTimeout(this.processJob_.bind(this),this.delay):this.timeout_=null}},{key:"push",value:function(s){this.jobs.push(s),this.timeout_||(this.timeout_=setTimeout(this.processJob_.bind(this),this.delay))}}]),g}(b.default);U.default=_,B.exports=U.default},{}],22:[function(C,B,U){"use strict";function O(i){return i&&i.__esModule?i:{default:i}}function A(i,c){if(!(i instanceof c))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(U,"__esModule",{value:!0});var k=function(){function i(c,t){for(var e=0;e<t.length;e++){var r=t[e];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(c,r.key,r)}}return function(c,t,e){return t&&i(c.prototype,t),e&&i(c,e),c}}(),w=C(20),S=O(w),b=C(21),_=O(b),l=C(26),g=function(i){return i<<24|(65280&i)<<8|(16711680&i)>>8|i>>>24},s=function(i,c,t){var e=new Int32Array(i.buffer,i.byteOffset,i.byteLength>>2),r=new S.default(Array.prototype.slice.call(c)),n=new Uint8Array(i.byteLength),p=new Int32Array(n.buffer),a=void 0,m=void 0,h=void 0,f=void 0,o=void 0,v=void 0,T=void 0,E=void 0,y=void 0;for(a=t[0],m=t[1],h=t[2],f=t[3],y=0;y<e.length;y+=4)o=g(e[y]),v=g(e[y+1]),T=g(e[y+2]),E=g(e[y+3]),r.decrypt(o,v,T,E,p,y),p[y]=g(p[y]^a),p[y+1]=g(p[y+1]^m),p[y+2]=g(p[y+2]^h),p[y+3]=g(p[y+3]^f),a=o,m=v,h=T,f=E;return n};U.decrypt=s;var u=function(){function i(c,t,e,r){A(this,i);var n=i.STEP,p=new Int32Array(c.buffer),a=new Uint8Array(c.byteLength),m=0;for(this.asyncStream_=new _.default,this.asyncStream_.push(this.decryptChunk_(p.subarray(m,m+n),t,e,a)),m=n;m<p.length;m+=n)e=new Uint32Array([g(p[m-4]),g(p[m-3]),g(p[m-2]),g(p[m-1])]),this.asyncStream_.push(this.decryptChunk_(p.subarray(m,m+n),t,e,a));this.asyncStream_.push(function(){r(null,(0,l.unpad)(a))})}return k(i,[{key:"decryptChunk_",value:function(c,t,e,r){return function(){var n=s(c,t,e);r.set(n,c.byteOffset)}}}],[{key:"STEP",get:function(){return 32e3}}]),i}();U.Decrypter=u,U.default={Decrypter:u,decrypt:s}},{}],23:[function(C,B,U){"use strict";Object.defineProperty(U,"__esModule",{value:!0});var O=C(22),A=C(21),k=function(w){return w&&w.__esModule?w:{default:w}}(A);U.default={decrypt:O.decrypt,Decrypter:O.Decrypter,AsyncStream:k.default},B.exports=U.default},{}],24:[function(C,B,U){"use strict";function O(w,S){if(!(w instanceof S))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(U,"__esModule",{value:!0});var A=function(){function w(S,b){for(var _=0;_<b.length;_++){var l=b[_];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(S,l.key,l)}}return function(S,b,_){return b&&w(S.prototype,b),_&&w(S,_),S}}(),k=function(){function w(){O(this,w),this.listeners={}}return A(w,[{key:"on",value:function(S,b){this.listeners[S]||(this.listeners[S]=[]),this.listeners[S].push(b)}},{key:"off",value:function(S,b){var _=void 0;return!!this.listeners[S]&&(_=this.listeners[S].indexOf(b),this.listeners[S].splice(_,1),_>-1)}},{key:"trigger",value:function(S){var b=void 0,_=void 0,l=void 0,g=void 0;if(b=this.listeners[S])if(arguments.length===2)for(l=b.length,_=0;_<l;++_)b[_].call(this,arguments[1]);else for(g=Array.prototype.slice.call(arguments,1),l=b.length,_=0;_<l;++_)b[_].apply(this,g)}},{key:"dispose",value:function(){this.listeners={}}},{key:"pipe",value:function(S){this.on("data",function(b){S.push(b)})}}]),w}();U.default=k,B.exports=U.default},{}],25:[function(C,B,U){"use strict";var O;B.exports=function(A){var k=O[A.byteLength%16||0],w=new Uint8Array(A.byteLength+k.length);return w.set(A),w.set(k,A.byteLength),w},O=[[16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16],[15,15,15,15,15,15,15,15,15,15,15,15,15,15,15],[14,14,14,14,14,14,14,14,14,14,14,14,14,14],[13,13,13,13,13,13,13,13,13,13,13,13,13],[12,12,12,12,12,12,12,12,12,12,12,12],[11,11,11,11,11,11,11,11,11,11,11],[10,10,10,10,10,10,10,10,10,10],[9,9,9,9,9,9,9,9,9],[8,8,8,8,8,8,8,8],[7,7,7,7,7,7,7],[6,6,6,6,6,6],[5,5,5,5,5],[4,4,4,4],[3,3,3],[2,2],[1]]},{}],26:[function(C,B,U){"use strict";U.pad=C(25),U.unpad=C(27)},{}],27:[function(C,B,U){"use strict";B.exports=function(O){return O.subarray(0,O.byteLength-O[O.byteLength-1])}},{}],28:[function(C,B,U){},{}],29:[function(C,B,U){(function(O){var A,k=O!==void 0?O:typeof window!="undefined"?window:{},w=C(28);typeof document!="undefined"?A=document:(A=k["__GLOBAL_DOCUMENT_CACHE@4"])||(A=k["__GLOBAL_DOCUMENT_CACHE@4"]=w),B.exports=A}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],30:[function(C,B,U){(function(O){var A;A=typeof window!="undefined"?window:O!==void 0?O:typeof self!="undefined"?self:{},B.exports=A}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],31:[function(C,B,U){"use strict";function O(l){return l&&l.__esModule?l:{default:l}}var A=C(32),k=O(A),w=C(33),S=O(w),b=C(34),_=O(b);B.exports={LineStream:k.default,ParseStream:S.default,Parser:_.default}},{}],32:[function(C,B,U){"use strict";function O(l,g){if(!(l instanceof g))throw new TypeError("Cannot call a class as a function")}function A(l,g){if(!l)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!g||typeof g!="object"&&typeof g!="function"?l:g}function k(l,g){if(typeof g!="function"&&g!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof g);l.prototype=Object.create(g&&g.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),g&&(Object.setPrototypeOf?Object.setPrototypeOf(l,g):l.__proto__=g)}Object.defineProperty(U,"__esModule",{value:!0});var w=function(){function l(g,s){for(var u=0;u<s.length;u++){var i=s[u];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(g,i.key,i)}}return function(g,s,u){return s&&l(g.prototype,s),u&&l(g,u),g}}(),S=C(35),b=function(l){return l&&l.__esModule?l:{default:l}}(S),_=function(l){function g(){O(this,g);var s=A(this,(g.__proto__||Object.getPrototypeOf(g)).call(this));return s.buffer="",s}return k(g,l),w(g,[{key:"push",value:function(s){var u=void 0;for(this.buffer+=s,u=this.buffer.indexOf(`
`);u>-1;u=this.buffer.indexOf(`
`))this.trigger("data",this.buffer.substring(0,u)),this.buffer=this.buffer.substring(u+1)}}]),g}(b.default);U.default=_},{}],33:[function(C,B,U){"use strict";function O(u,i){if(!(u instanceof i))throw new TypeError("Cannot call a class as a function")}function A(u,i){if(!u)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!i||typeof i!="object"&&typeof i!="function"?u:i}function k(u,i){if(typeof i!="function"&&i!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof i);u.prototype=Object.create(i&&i.prototype,{constructor:{value:u,enumerable:!1,writable:!0,configurable:!0}}),i&&(Object.setPrototypeOf?Object.setPrototypeOf(u,i):u.__proto__=i)}Object.defineProperty(U,"__esModule",{value:!0});var w=function(){function u(i,c){var t=[],e=!0,r=!1,n=void 0;try{for(var p,a=i[Symbol.iterator]();!(e=(p=a.next()).done)&&(t.push(p.value),!c||t.length!==c);e=!0);}catch(m){r=!0,n=m}finally{try{!e&&a.return&&a.return()}finally{if(r)throw n}}return t}return function(i,c){if(Array.isArray(i))return i;if(Symbol.iterator in Object(i))return u(i,c);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),S=function(){function u(i,c){for(var t=0;t<c.length;t++){var e=c[t];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(i,e.key,e)}}return function(i,c,t){return c&&u(i.prototype,c),t&&u(i,t),i}}(),b=C(35),_=function(u){return u&&u.__esModule?u:{default:u}}(b),l=function(){return new RegExp('(?:^|,)((?:[^=]*)=(?:"[^"]*"|[^,]*))')},g=function(u){for(var i=u.split(l()),c={},t=i.length,e=void 0;t--;)i[t]!==""&&(e=/([^=]*)=(.*)/.exec(i[t]).slice(1),e[0]=e[0].replace(/^\s+|\s+$/g,""),e[1]=e[1].replace(/^\s+|\s+$/g,""),e[1]=e[1].replace(/^['"](.*)['"]$/g,"$1"),c[e[0]]=e[1]);return c},s=function(u){function i(){return O(this,i),A(this,(i.__proto__||Object.getPrototypeOf(i)).call(this))}return k(i,u),S(i,[{key:"push",value:function(c){var t=void 0,e=void 0;if(c=c.replace(/^[\u0000\s]+|[\u0000\s]+$/g,""),c.length!==0){if(c[0]!=="#")return void this.trigger("data",{type:"uri",uri:c});if(c.indexOf("#EXT")!==0)return void this.trigger("data",{type:"comment",text:c.slice(1)});if(c=c.replace("\r",""),t=/^#EXTM3U/.exec(c))return void this.trigger("data",{type:"tag",tagType:"m3u"});if(t=/^#EXTINF:?([0-9\.]*)?,?(.*)?$/.exec(c))return e={type:"tag",tagType:"inf"},t[1]&&(e.duration=parseFloat(t[1])),t[2]&&(e.title=t[2]),void this.trigger("data",e);if(t=/^#EXT-X-TARGETDURATION:?([0-9.]*)?/.exec(c))return e={type:"tag",tagType:"targetduration"},t[1]&&(e.duration=parseInt(t[1],10)),void this.trigger("data",e);if(t=/^#ZEN-TOTAL-DURATION:?([0-9.]*)?/.exec(c))return e={type:"tag",tagType:"totalduration"},t[1]&&(e.duration=parseInt(t[1],10)),void this.trigger("data",e);if(t=/^#EXT-X-VERSION:?([0-9.]*)?/.exec(c))return e={type:"tag",tagType:"version"},t[1]&&(e.version=parseInt(t[1],10)),void this.trigger("data",e);if(t=/^#EXT-X-MEDIA-SEQUENCE:?(\-?[0-9.]*)?/.exec(c))return e={type:"tag",tagType:"media-sequence"},t[1]&&(e.number=parseInt(t[1],10)),void this.trigger("data",e);if(t=/^#EXT-X-DISCONTINUITY-SEQUENCE:?(\-?[0-9.]*)?/.exec(c))return e={type:"tag",tagType:"discontinuity-sequence"},t[1]&&(e.number=parseInt(t[1],10)),void this.trigger("data",e);if(t=/^#EXT-X-PLAYLIST-TYPE:?(.*)?$/.exec(c))return e={type:"tag",tagType:"playlist-type"},t[1]&&(e.playlistType=t[1]),void this.trigger("data",e);if(t=/^#EXT-X-BYTERANGE:?([0-9.]*)?@?([0-9.]*)?/.exec(c))return e={type:"tag",tagType:"byterange"},t[1]&&(e.length=parseInt(t[1],10)),t[2]&&(e.offset=parseInt(t[2],10)),void this.trigger("data",e);if(t=/^#EXT-X-ALLOW-CACHE:?(YES|NO)?/.exec(c))return e={type:"tag",tagType:"allow-cache"},t[1]&&(e.allowed=!/NO/.test(t[1])),void this.trigger("data",e);if(t=/^#EXT-X-MAP:?(.*)$/.exec(c)){if(e={type:"tag",tagType:"map"},t[1]){var r=g(t[1]);if(r.URI&&(e.uri=r.URI),r.BYTERANGE){var n=r.BYTERANGE.split("@"),p=w(n,2),a=p[0],m=p[1];e.byterange={},a&&(e.byterange.length=parseInt(a,10)),m&&(e.byterange.offset=parseInt(m,10))}}return void this.trigger("data",e)}if(t=/^#EXT-X-STREAM-INF:?(.*)$/.exec(c)){if(e={type:"tag",tagType:"stream-inf"},t[1]){if(e.attributes=g(t[1]),e.attributes.RESOLUTION){var h=e.attributes.RESOLUTION.split("x"),f={};h[0]&&(f.width=parseInt(h[0],10)),h[1]&&(f.height=parseInt(h[1],10)),e.attributes.RESOLUTION=f}e.attributes.BANDWIDTH&&(e.attributes.BANDWIDTH=parseInt(e.attributes.BANDWIDTH,10)),e.attributes["PROGRAM-ID"]&&(e.attributes["PROGRAM-ID"]=parseInt(e.attributes["PROGRAM-ID"],10))}return void this.trigger("data",e)}if(t=/^#EXT-X-MEDIA:?(.*)$/.exec(c))return e={type:"tag",tagType:"media"},t[1]&&(e.attributes=g(t[1])),void this.trigger("data",e);if(t=/^#EXT-X-ENDLIST/.exec(c))return void this.trigger("data",{type:"tag",tagType:"endlist"});if(t=/^#EXT-X-DISCONTINUITY/.exec(c))return void this.trigger("data",{type:"tag",tagType:"discontinuity"});if(t=/^#EXT-X-PROGRAM-DATE-TIME:?(.*)$/.exec(c))return e={type:"tag",tagType:"program-date-time"},t[1]&&(e.dateTimeString=t[1],e.dateTimeObject=new Date(t[1])),void this.trigger("data",e);if(t=/^#EXT-X-KEY:?(.*)$/.exec(c))return e={type:"tag",tagType:"key"},t[1]&&(e.attributes=g(t[1]),e.attributes.IV&&(e.attributes.IV.substring(0,2).toLowerCase()==="0x"&&(e.attributes.IV=e.attributes.IV.substring(2)),e.attributes.IV=e.attributes.IV.match(/.{8}/g),e.attributes.IV[0]=parseInt(e.attributes.IV[0],16),e.attributes.IV[1]=parseInt(e.attributes.IV[1],16),e.attributes.IV[2]=parseInt(e.attributes.IV[2],16),e.attributes.IV[3]=parseInt(e.attributes.IV[3],16),e.attributes.IV=new Uint32Array(e.attributes.IV))),void this.trigger("data",e);if(t=/^#EXT-X-CUE-OUT-CONT:?(.*)?$/.exec(c))return e={type:"tag",tagType:"cue-out-cont"},t[1]?e.data=t[1]:e.data="",void this.trigger("data",e);if(t=/^#EXT-X-CUE-OUT:?(.*)?$/.exec(c))return e={type:"tag",tagType:"cue-out"},t[1]?e.data=t[1]:e.data="",void this.trigger("data",e);if(t=/^#EXT-X-CUE-IN:?(.*)?$/.exec(c))return e={type:"tag",tagType:"cue-in"},t[1]?e.data=t[1]:e.data="",void this.trigger("data",e);this.trigger("data",{type:"tag",data:c.slice(4)})}}}]),i}(_.default);U.default=s},{}],34:[function(C,B,U){"use strict";function O(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")}function k(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||typeof e!="object"&&typeof e!="function"?t:e}function w(t,e){if(typeof e!="function"&&e!==null)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(U,"__esModule",{value:!0});var S=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},b=function(){function t(e,r){for(var n=0;n<r.length;n++){var p=r[n];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(e,p.key,p)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),_=C(35),l=O(_),g=C(32),s=O(g),u=C(33),i=O(u),c=function(t){function e(){A(this,e);var r=k(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));r.lineStream=new s.default,r.parseStream=new i.default,r.lineStream.pipe(r.parseStream);var n=r,p=[],a={},m=void 0,h=void 0,f=function(){},o={AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},v=0;return r.manifest={allowCache:!0,discontinuityStarts:[],segments:[]},r.parseStream.on("data",function(T){var E=void 0,y=void 0;({tag:function(){({"allow-cache":function(){this.manifest.allowCache=T.allowed,"allowed"in T||(this.trigger("info",{message:"defaulting allowCache to YES"}),this.manifest.allowCache=!0)},byterange:function(){var d={};"length"in T&&(a.byterange=d,d.length=T.length,"offset"in T||(this.trigger("info",{message:"defaulting offset to zero"}),T.offset=0)),"offset"in T&&(a.byterange=d,d.offset=T.offset)},endlist:function(){this.manifest.endList=!0},inf:function(){"mediaSequence"in this.manifest||(this.manifest.mediaSequence=0,this.trigger("info",{message:"defaulting media sequence to zero"})),"discontinuitySequence"in this.manifest||(this.manifest.discontinuitySequence=0,this.trigger("info",{message:"defaulting discontinuity sequence to zero"})),T.duration>0&&(a.duration=T.duration),T.duration===0&&(a.duration=.01,this.trigger("info",{message:"updating zero segment duration to a small value"})),this.manifest.segments=p},key:function(){return T.attributes?T.attributes.METHOD==="NONE"?void(h=null):T.attributes.URI?(T.attributes.METHOD||this.trigger("warn",{message:"defaulting key method to AES-128"}),h={method:T.attributes.METHOD||"AES-128",uri:T.attributes.URI},void(typeof T.attributes.IV!="undefined"&&(h.iv=T.attributes.IV))):void this.trigger("warn",{message:"ignoring key declaration without URI"}):void this.trigger("warn",{message:"ignoring key declaration without attribute list"})},"media-sequence":function(){if(!isFinite(T.number))return void this.trigger("warn",{message:"ignoring invalid media sequence: "+T.number});this.manifest.mediaSequence=T.number},"discontinuity-sequence":function(){if(!isFinite(T.number))return void this.trigger("warn",{message:"ignoring invalid discontinuity sequence: "+T.number});this.manifest.discontinuitySequence=T.number,v=T.number},"playlist-type":function(){if(!/VOD|EVENT/.test(T.playlistType))return void this.trigger("warn",{message:"ignoring unknown playlist type: "+T.playlist});this.manifest.playlistType=T.playlistType},map:function(){m={},T.uri&&(m.uri=T.uri),T.byterange&&(m.byterange=T.byterange)},"stream-inf":function(){if(this.manifest.playlists=p,this.manifest.mediaGroups=this.manifest.mediaGroups||o,!T.attributes)return void this.trigger("warn",{message:"ignoring empty stream-inf attributes"});a.attributes||(a.attributes={}),S(a.attributes,T.attributes)},media:function(){if(this.manifest.mediaGroups=this.manifest.mediaGroups||o,!(T.attributes&&T.attributes.TYPE&&T.attributes["GROUP-ID"]&&T.attributes.NAME))return void this.trigger("warn",{message:"ignoring incomplete or missing media group"});var d=this.manifest.mediaGroups[T.attributes.TYPE];d[T.attributes["GROUP-ID"]]=d[T.attributes["GROUP-ID"]]||{},E=d[T.attributes["GROUP-ID"]],y={default:/yes/i.test(T.attributes.DEFAULT)},y.default?y.autoselect=!0:y.autoselect=/yes/i.test(T.attributes.AUTOSELECT),T.attributes.LANGUAGE&&(y.language=T.attributes.LANGUAGE),T.attributes.URI&&(y.uri=T.attributes.URI),T.attributes["INSTREAM-ID"]&&(y.instreamId=T.attributes["INSTREAM-ID"]),T.attributes.CHARACTERISTICS&&(y.characteristics=T.attributes.CHARACTERISTICS),T.attributes.FORCED&&(y.forced=/yes/i.test(T.attributes.FORCED)),E[T.attributes.NAME]=y},discontinuity:function(){v+=1,a.discontinuity=!0,this.manifest.discontinuityStarts.push(p.length)},"program-date-time":function(){this.manifest.dateTimeString=T.dateTimeString,this.manifest.dateTimeObject=T.dateTimeObject},targetduration:function(){if(!isFinite(T.duration)||T.duration<0)return void this.trigger("warn",{message:"ignoring invalid target duration: "+T.duration});this.manifest.targetDuration=T.duration},totalduration:function(){if(!isFinite(T.duration)||T.duration<0)return void this.trigger("warn",{message:"ignoring invalid total duration: "+T.duration});this.manifest.totalDuration=T.duration},"cue-out":function(){a.cueOut=T.data},"cue-out-cont":function(){a.cueOutCont=T.data},"cue-in":function(){a.cueIn=T.data}}[T.tagType]||f).call(n)},uri:function(){a.uri=T.uri,p.push(a),!this.manifest.targetDuration||"duration"in a||(this.trigger("warn",{message:"defaulting segment duration to the target duration"}),a.duration=this.manifest.targetDuration),h&&(a.key=h),a.timeline=v,m&&(a.map=m),a={}},comment:function(){}})[T.type].call(n)}),r}return w(e,t),b(e,[{key:"push",value:function(r){this.lineStream.push(r)}},{key:"end",value:function(){this.lineStream.push(`
`)}}]),e}(l.default);U.default=c},{}],35:[function(C,B,U){"use strict";function O(w,S){if(!(w instanceof S))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(U,"__esModule",{value:!0});var A=function(){function w(S,b){for(var _=0;_<b.length;_++){var l=b[_];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(S,l.key,l)}}return function(S,b,_){return b&&w(S.prototype,b),_&&w(S,_),S}}(),k=function(){function w(){O(this,w),this.listeners={}}return A(w,[{key:"on",value:function(S,b){this.listeners[S]||(this.listeners[S]=[]),this.listeners[S].push(b)}},{key:"off",value:function(S,b){if(!this.listeners[S])return!1;var _=this.listeners[S].indexOf(b);return this.listeners[S].splice(_,1),_>-1}},{key:"trigger",value:function(S){var b=this.listeners[S],_=void 0,l=void 0,g=void 0;if(b)if(arguments.length===2)for(l=b.length,_=0;_<l;++_)b[_].call(this,arguments[1]);else for(g=Array.prototype.slice.call(arguments,1),l=b.length,_=0;_<l;++_)b[_].apply(this,g)}},{key:"dispose",value:function(){this.listeners={}}},{key:"pipe",value:function(S){this.on("data",function(b){S.push(b)})}}]),w}();U.default=k},{}],36:[function(C,B,U){"use strict";var O,A=C(60);O=function(){var k=new Uint8Array,w=0;O.prototype.init.call(this),this.setTimestamp=function(S){w=S},this.parseId3TagSize=function(S,b){var _=S[b+6]<<21|S[b+7]<<14|S[b+8]<<7|S[b+9];return(16&S[b+5])>>4?_+20:_+10},this.parseAdtsSize=function(S,b){var _=(224&S[b+5])>>5,l=S[b+4]<<3;return 6144&S[b+3]|l|_},this.push=function(S){var b,_,l,g,s=0,u=0;for(k.length?(g=k.length,k=new Uint8Array(S.byteLength+g),k.set(k.subarray(0,g)),k.set(S,g)):k=S;k.length-u>=3;)if(k[u]!=="I".charCodeAt(0)||k[u+1]!=="D".charCodeAt(0)||k[u+2]!=="3".charCodeAt(0))if(!0&k[u]&&(240&k[u+1])==240){if(k.length-u<7||(s=this.parseAdtsSize(k,u))>k.length)break;l={type:"audio",data:k.subarray(u,u+s),pts:w,dts:w},this.trigger("data",l),u+=s}else u++;else{if(k.length-u<10||(s=this.parseId3TagSize(k,u))>k.length)break;_={type:"timed-metadata",data:k.subarray(u,u+s)},this.trigger("data",_),u+=s}b=k.length-u,k=b>0?k.subarray(u):new Uint8Array}},O.prototype=new A,B.exports=O},{}],37:[function(C,B,U){"use strict";var O=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],A=function(s){return s[0]<<21|s[1]<<14|s[2]<<7|s[3]},k=function(s,u,i){var c,t="";for(c=u;c<i;c++)t+="%"+("00"+s[c].toString(16)).slice(-2);return t},w=function(s,u,i){return unescape(k(s,u,i))},S=function(s,u){var i=s[u+6]<<21|s[u+7]<<14|s[u+8]<<7|s[u+9];return(16&s[u+5])>>4?i+20:i+10},b=function(s,u){var i=(224&s[u+5])>>5,c=s[u+4]<<3;return 6144&s[u+3]|c|i},_=function(s,u){return s[u]==="I".charCodeAt(0)&&s[u+1]==="D".charCodeAt(0)&&s[u+2]==="3".charCodeAt(0)?"timed-metadata":!0&s[u]&&(240&s[u+1])==240?"audio":null},l=function(s){for(var u=0;u+5<s.length;){if(s[u]===255&&(246&s[u+1])==240)return O[(60&s[u+2])>>>2];u++}return null},g=function(s){var u,i,c;u=10,64&s[5]&&(u+=4,u+=A(s.subarray(10,14)));do{if((i=A(s.subarray(u+4,u+8)))<1)return null;if(String.fromCharCode(s[u],s[u+1],s[u+2],s[u+3])==="PRIV"){c=s.subarray(u+10,u+i+10);for(var t=0;t<c.byteLength;t++)if(c[t]===0){var e=w(c,0,t);if(e==="com.apple.streaming.transportStreamTimestamp"){var r=c.subarray(t+1),n=(1&r[3])<<30|r[4]<<22|r[5]<<14|r[6]<<6|r[7]>>>2;return n*=4,n+=3&r[7]}break}}u+=10,u+=i}while(u<s.byteLength);return null};B.exports={parseId3TagSize:S,parseAdtsSize:b,parseType:_,parseSampleRate:l,parseAacTimestamp:g}},{}],38:[function(C,B,U){"use strict";var O,A=C(60),k=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];O=function(){var w;O.prototype.init.call(this),this.push=function(S){var b,_,l,g,s,u,i=0,c=0;if(S.type==="audio")for(w?(g=w,w=new Uint8Array(g.byteLength+S.data.byteLength),w.set(g),w.set(S.data,g.byteLength)):w=S.data;i+5<w.length;)if(w[i]===255&&(246&w[i+1])==240){if(_=2*(1&~w[i+1]),b=(3&w[i+3])<<11|w[i+4]<<3|(224&w[i+5])>>5,s=1024*(1+(3&w[i+6])),u=9e4*s/k[(60&w[i+2])>>>2],l=i+b,w.byteLength<l)return;if(this.trigger("data",{pts:S.pts+c*u,dts:S.dts+c*u,sampleCount:s,audioobjecttype:1+(w[i+2]>>>6&3),channelcount:(1&w[i+2])<<2|(192&w[i+3])>>>6,samplerate:k[(60&w[i+2])>>>2],samplingfrequencyindex:(60&w[i+2])>>>2,samplesize:16,data:w.subarray(i+7+_,l)}),w.byteLength===l)return void(w=void 0);c++,w=w.subarray(l)}else i++},this.flush=function(){this.trigger("done")}},O.prototype=new A,B.exports=O},{}],39:[function(C,B,U){"use strict";var O,A,k,w=C(60),S=C(59);A=function(){var b,_,l=0;A.prototype.init.call(this),this.push=function(g){var s;for(_?(s=new Uint8Array(_.byteLength+g.data.byteLength),s.set(_),s.set(g.data,_.byteLength),_=s):_=g.data;l<_.byteLength-3;l++)if(_[l+2]===1){b=l+5;break}for(;b<_.byteLength;)switch(_[b]){case 0:if(_[b-1]!==0){b+=2;break}if(_[b-2]!==0){b++;break}l+3!==b-2&&this.trigger("data",_.subarray(l+3,b-2));do b++;while(_[b]!==1&&b<_.length);l=b-2,b+=3;break;case 1:if(_[b-1]!==0||_[b-2]!==0){b+=3;break}this.trigger("data",_.subarray(l+3,b-2)),l=b-2,b+=3;break;default:b+=3}_=_.subarray(l),b-=l,l=0},this.flush=function(){_&&_.byteLength>3&&this.trigger("data",_.subarray(l+3)),_=null,l=0,this.trigger("done")}},A.prototype=new w,k={100:!0,110:!0,122:!0,244:!0,44:!0,83:!0,86:!0,118:!0,128:!0,138:!0,139:!0,134:!0},O=function(){var b,_,l,g,s,u,i,c=new A;O.prototype.init.call(this),b=this,this.push=function(t){t.type==="video"&&(_=t.trackId,l=t.pts,g=t.dts,c.push(t))},c.on("data",function(t){var e={trackId:_,pts:l,dts:g,data:t};switch(31&t[0]){case 5:e.nalUnitType="slice_layer_without_partitioning_rbsp_idr";break;case 6:e.nalUnitType="sei_rbsp",e.escapedRBSP=s(t.subarray(1));break;case 7:e.nalUnitType="seq_parameter_set_rbsp",e.escapedRBSP=s(t.subarray(1)),e.config=u(e.escapedRBSP);break;case 8:e.nalUnitType="pic_parameter_set_rbsp";break;case 9:e.nalUnitType="access_unit_delimiter_rbsp"}b.trigger("data",e)}),c.on("done",function(){b.trigger("done")}),this.flush=function(){c.flush()},i=function(t,e){var r,n,p=8,a=8;for(r=0;r<t;r++)a!==0&&(n=e.readExpGolomb(),a=(p+n+256)%256),p=a===0?p:a},s=function(t){for(var e,r,n=t.byteLength,p=[],a=1;a<n-2;)t[a]===0&&t[a+1]===0&&t[a+2]===3?(p.push(a+2),a+=2):a++;if(p.length===0)return t;e=n-p.length,r=new Uint8Array(e);var m=0;for(a=0;a<e;m++,a++)m===p[0]&&(m++,p.shift()),r[a]=t[m];return r},u=function(t){var e,r,n,p,a,m,h,f,o,v,T,E,y,d=0,L=0,I=0,M=0,q=1;if(e=new S(t),r=e.readUnsignedByte(),p=e.readUnsignedByte(),n=e.readUnsignedByte(),e.skipUnsignedExpGolomb(),k[r]&&(a=e.readUnsignedExpGolomb(),a===3&&e.skipBits(1),e.skipUnsignedExpGolomb(),e.skipUnsignedExpGolomb(),e.skipBits(1),e.readBoolean()))for(T=a!==3?8:12,y=0;y<T;y++)e.readBoolean()&&(y<6?i(16,e):i(64,e));if(e.skipUnsignedExpGolomb(),(m=e.readUnsignedExpGolomb())===0)e.readUnsignedExpGolomb();else if(m===1)for(e.skipBits(1),e.skipExpGolomb(),e.skipExpGolomb(),h=e.readUnsignedExpGolomb(),y=0;y<h;y++)e.skipExpGolomb();if(e.skipUnsignedExpGolomb(),e.skipBits(1),f=e.readUnsignedExpGolomb(),o=e.readUnsignedExpGolomb(),v=e.readBits(1),v===0&&e.skipBits(1),e.skipBits(1),e.readBoolean()&&(d=e.readUnsignedExpGolomb(),L=e.readUnsignedExpGolomb(),I=e.readUnsignedExpGolomb(),M=e.readUnsignedExpGolomb()),e.readBoolean()&&e.readBoolean()){switch(e.readUnsignedByte()){case 1:E=[1,1];break;case 2:E=[12,11];break;case 3:E=[10,11];break;case 4:E=[16,11];break;case 5:E=[40,33];break;case 6:E=[24,11];break;case 7:E=[20,11];break;case 8:E=[32,11];break;case 9:E=[80,33];break;case 10:E=[18,11];break;case 11:E=[15,11];break;case 12:E=[64,33];break;case 13:E=[160,99];break;case 14:E=[4,3];break;case 15:E=[3,2];break;case 16:E=[2,1];break;case 255:E=[e.readUnsignedByte()<<8|e.readUnsignedByte(),e.readUnsignedByte()<<8|e.readUnsignedByte()]}E&&(q=E[0]/E[1])}return{profileIdc:r,levelIdc:n,profileCompatibility:p,width:Math.ceil((16*(f+1)-2*d-2*L)*q),height:(2-v)*(o+1)*16-2*I-2*M}}},O.prototype=new w,B.exports={H264Stream:O,NalByteStream:A}},{}],40:[function(C,B,U){var O=[33,16,5,32,164,27],A=[33,65,108,84,1,2,4,8,168,2,4,8,17,191,252],k=function(S){for(var b=[];S--;)b.push(0);return b},w={96e3:[O,[227,64],k(154),[56]],88200:[O,[231],k(170),[56]],64e3:[O,[248,192],k(240),[56]],48e3:[O,[255,192],k(268),[55,148,128],k(54),[112]],44100:[O,[255,192],k(268),[55,163,128],k(84),[112]],32e3:[O,[255,192],k(268),[55,234],k(226),[112]],24e3:[O,[255,192],k(268),[55,255,128],k(268),[111,112],k(126),[224]],16e3:[O,[255,192],k(268),[55,255,128],k(268),[111,255],k(269),[223,108],k(195),[1,192]],12e3:[A,k(268),[3,127,248],k(268),[6,255,240],k(268),[13,255,224],k(268),[27,253,128],k(259),[56]],11025:[A,k(268),[3,127,248],k(268),[6,255,240],k(268),[13,255,224],k(268),[27,255,192],k(268),[55,175,128],k(108),[112]],8e3:[A,k(268),[3,121,16],k(47),[7]]};B.exports=function(S){return Object.keys(S).reduce(function(b,_){return b[_]=new Uint8Array(S[_].reduce(function(l,g){return l.concat(g)},[])),b},{})}(w)},{}],41:[function(C,B,U){"use strict";var O=C(60),A=function(k){this.numberOfTracks=0,this.metadataStream=k.metadataStream,this.videoTags=[],this.audioTags=[],this.videoTrack=null,this.audioTrack=null,this.pendingCaptions=[],this.pendingMetadata=[],this.pendingTracks=0,this.processedTracks=0,A.prototype.init.call(this),this.push=function(w){return w.text?this.pendingCaptions.push(w):w.frames?this.pendingMetadata.push(w):(w.track.type==="video"&&(this.videoTrack=w.track,this.videoTags=w.tags,this.pendingTracks++),void(w.track.type==="audio"&&(this.audioTrack=w.track,this.audioTags=w.tags,this.pendingTracks++)))}};A.prototype=new O,A.prototype.flush=function(k){var w,S,b,_,l={tags:{},captions:[],metadata:[]};if(!(this.pendingTracks<this.numberOfTracks&&(k!=="VideoSegmentStream"&&k!=="AudioSegmentStream"||this.pendingTracks===0&&++this.processedTracks<this.numberOfTracks))&&(this.processedTracks+=this.pendingTracks,this.pendingTracks=0,!(this.processedTracks<this.numberOfTracks))){for(this.videoTrack?_=this.videoTrack.timelineStartInfo.pts:this.audioTrack&&(_=this.audioTrack.timelineStartInfo.pts),l.tags.videoTags=this.videoTags,l.tags.audioTags=this.audioTags,b=0;b<this.pendingCaptions.length;b++)S=this.pendingCaptions[b],S.startTime=S.startPts-_,S.startTime/=9e4,S.endTime=S.endPts-_,S.endTime/=9e4,l.captions.push(S);for(b=0;b<this.pendingMetadata.length;b++)w=this.pendingMetadata[b],w.cueTime=w.pts-_,w.cueTime/=9e4,l.metadata.push(w);l.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",l),this.trigger("done")}},B.exports=A},{}],42:[function(C,B,U){"use strict";var O=C(43),A=function(k,w,S){var b,_,l,g=new Uint8Array(9),s=new DataView(g.buffer);return k=k||0,w=w===void 0||w,S=S===void 0||S,s.setUint8(0,70),s.setUint8(1,76),s.setUint8(2,86),s.setUint8(3,1),s.setUint8(4,(w?4:0)|(S?1:0)),s.setUint32(5,g.byteLength),k<=0?(_=new Uint8Array(g.byteLength+4),_.set(g),_.set([0,0,0,0],g.byteLength),_):(b=new O(O.METADATA_TAG),b.pts=b.dts=0,b.writeMetaDataDouble("duration",k),l=b.finalize().length,_=new Uint8Array(g.byteLength+l),_.set(g),_.set(s.byteLength,l),_)};B.exports=A},{}],43:[function(C,B,U){"use strict";var O;O=function(A,k){var w,S=0,b=16384,_=function(u,i){var c,t=u.position+i;t<u.bytes.byteLength||(c=new Uint8Array(2*t),c.set(u.bytes.subarray(0,u.position),0),u.bytes=c,u.view=new DataView(u.bytes.buffer))},l=O.widthBytes||new Uint8Array("width".length),g=O.heightBytes||new Uint8Array("height".length),s=O.videocodecidBytes||new Uint8Array("videocodecid".length);if(!O.widthBytes){for(w=0;w<"width".length;w++)l[w]="width".charCodeAt(w);for(w=0;w<"height".length;w++)g[w]="height".charCodeAt(w);for(w=0;w<"videocodecid".length;w++)s[w]="videocodecid".charCodeAt(w);O.widthBytes=l,O.heightBytes=g,O.videocodecidBytes=s}switch(this.keyFrame=!1,A){case O.VIDEO_TAG:this.length=16,b*=6;break;case O.AUDIO_TAG:this.length=13,this.keyFrame=!0;break;case O.METADATA_TAG:this.length=29,this.keyFrame=!0;break;default:throw new Error("Unknown FLV tag type")}this.bytes=new Uint8Array(b),this.view=new DataView(this.bytes.buffer),this.bytes[0]=A,this.position=this.length,this.keyFrame=k,this.pts=0,this.dts=0,this.writeBytes=function(u,i,c){var t,e=i||0;c=c||u.byteLength,t=e+c,_(this,c),this.bytes.set(u.subarray(e,t),this.position),this.position+=c,this.length=Math.max(this.length,this.position)},this.writeByte=function(u){_(this,1),this.bytes[this.position]=u,this.position++,this.length=Math.max(this.length,this.position)},this.writeShort=function(u){_(this,2),this.view.setUint16(this.position,u),this.position+=2,this.length=Math.max(this.length,this.position)},this.negIndex=function(u){return this.bytes[this.length-u]},this.nalUnitSize=function(){return S===0?0:this.length-(S+4)},this.startNalUnit=function(){if(S>0)throw new Error("Attempted to create new NAL wihout closing the old one");S=this.length,this.length+=4,this.position=this.length},this.endNalUnit=function(u){var i,c;this.length===S+4?this.length-=4:S>0&&(i=S+4,c=this.length-i,this.position=S,this.view.setUint32(this.position,c),this.position=this.length,u&&u.push(this.bytes.subarray(i,i+c))),S=0},this.writeMetaDataDouble=function(u,i){var c;if(_(this,2+u.length+9),this.view.setUint16(this.position,u.length),this.position+=2,u==="width")this.bytes.set(l,this.position),this.position+=5;else if(u==="height")this.bytes.set(g,this.position),this.position+=6;else if(u==="videocodecid")this.bytes.set(s,this.position),this.position+=12;else for(c=0;c<u.length;c++)this.bytes[this.position]=u.charCodeAt(c),this.position++;this.position++,this.view.setFloat64(this.position,i),this.position+=8,this.length=Math.max(this.length,this.position),++S},this.writeMetaDataBoolean=function(u,i){var c;for(_(this,2),this.view.setUint16(this.position,u.length),this.position+=2,c=0;c<u.length;c++)_(this,1),this.bytes[this.position]=u.charCodeAt(c),this.position++;_(this,2),this.view.setUint8(this.position,1),this.position++,this.view.setUint8(this.position,i?1:0),this.position++,this.length=Math.max(this.length,this.position),++S},this.finalize=function(){var u,i;switch(this.bytes[0]){case O.VIDEO_TAG:this.bytes[11]=7|(this.keyFrame||k?16:32),this.bytes[12]=k?0:1,u=this.pts-this.dts,this.bytes[13]=(16711680&u)>>>16,this.bytes[14]=(65280&u)>>>8,this.bytes[15]=(255&u)>>>0;break;case O.AUDIO_TAG:this.bytes[11]=175,this.bytes[12]=k?0:1;break;case O.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,S),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,_(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=O.frameTime(this.bytes),this}},O.AUDIO_TAG=8,O.VIDEO_TAG=9,O.METADATA_TAG=18,O.isAudioFrame=function(A){return O.AUDIO_TAG===A[0]},O.isVideoFrame=function(A){return O.VIDEO_TAG===A[0]},O.isMetaData=function(A){return O.METADATA_TAG===A[0]},O.isKeyFrame=function(A){return O.isVideoFrame(A)?A[11]===23:!!O.isAudioFrame(A)||!!O.isMetaData(A)},O.frameTime=function(A){var k=A[4]<<16;return k|=A[5]<<8,k|=A[6]<<0,k|=A[7]<<24},B.exports=O},{}],44:[function(C,B,U){B.exports={tag:C(43),Transmuxer:C(46),getFlvHeader:C(42)}},{}],45:[function(C,B,U){"use strict";var O=function(){var A=this;this.list=[],this.push=function(k){this.list.push({bytes:k.bytes,dts:k.dts,pts:k.pts,keyFrame:k.keyFrame,metaDataTag:k.metaDataTag})},Object.defineProperty(this,"length",{get:function(){return A.list.length}})};B.exports=O},{}],46:[function(C,B,U){"use strict";var O,A,k,w,S,b,_=C(60),l=C(43),g=C(48),s=C(38),u=C(39).H264Stream,i=C(41),c=C(45);w=function(t,e){typeof e.pts=="number"&&(t.timelineStartInfo.pts===void 0?t.timelineStartInfo.pts=e.pts:t.timelineStartInfo.pts=Math.min(t.timelineStartInfo.pts,e.pts)),typeof e.dts=="number"&&(t.timelineStartInfo.dts===void 0?t.timelineStartInfo.dts=e.dts:t.timelineStartInfo.dts=Math.min(t.timelineStartInfo.dts,e.dts))},S=function(t,e){var r=new l(l.METADATA_TAG);return r.dts=e,r.pts=e,r.writeMetaDataDouble("videocodecid",7),r.writeMetaDataDouble("width",t.width),r.writeMetaDataDouble("height",t.height),r},b=function(t,e){var r,n=new l(l.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),r=0;r<t.pps.length;++r)n.writeShort(t.pps[r].length),n.writeBytes(t.pps[r]);return n},k=function(t){var e,r=[];k.prototype.init.call(this),this.push=function(n){w(t,n),t&&t.channelcount===void 0&&(t.audioobjecttype=n.audioobjecttype,t.channelcount=n.channelcount,t.samplerate=n.samplerate,t.samplingfrequencyindex=n.samplingfrequencyindex,t.samplesize=n.samplesize,t.extraData=t.audioobjecttype<<11|t.samplingfrequencyindex<<7|t.channelcount<<3),n.pts=Math.round(n.pts/90),n.dts=Math.round(n.dts/90),r.push(n)},this.flush=function(){var n,p,a,m=new c;if(r.length===0)return void this.trigger("done","AudioSegmentStream");for(a=-Infinity;r.length;)n=r.shift(),(t.extraData!==e||n.pts-a>=1e3)&&(p=new l(l.METADATA_TAG),p.pts=n.pts,p.dts=n.dts,p.writeMetaDataDouble("audiocodecid",10),p.writeMetaDataBoolean("stereo",t.channelcount===2),p.writeMetaDataDouble("audiosamplerate",t.samplerate),p.writeMetaDataDouble("audiosamplesize",16),m.push(p.finalize()),e=t.extraData,p=new l(l.AUDIO_TAG,!0),p.pts=n.pts,p.dts=n.dts,p.view.setUint16(p.position,t.extraData),p.position+=2,p.length=Math.max(p.length,p.position),m.push(p.finalize()),a=n.pts),p=new l(l.AUDIO_TAG),p.pts=n.pts,p.dts=n.dts,p.writeBytes(n.data),m.push(p.finalize());e=null,this.trigger("data",{track:t,tags:m.list}),this.trigger("done","AudioSegmentStream")}},k.prototype=new _,A=function(t){var e,r,n=[];A.prototype.init.call(this),this.finishFrame=function(p,a){if(a){if(e&&t&&t.newMetadata&&(a.keyFrame||p.length===0)){var m=S(e,a.dts).finalize(),h=b(t,a.dts).finalize();m.metaDataTag=h.metaDataTag=!0,p.push(m),p.push(h),t.newMetadata=!1}a.endNalUnit(),p.push(a.finalize()),r=null}},this.push=function(p){w(t,p),p.pts=Math.round(p.pts/90),p.dts=Math.round(p.dts/90),n.push(p)},this.flush=function(){for(var p,a=new c;n.length&&n[0].nalUnitType!=="access_unit_delimiter_rbsp";)n.shift();if(n.length===0)return void this.trigger("done","VideoSegmentStream");for(;n.length;)p=n.shift(),p.nalUnitType==="seq_parameter_set_rbsp"?(t.newMetadata=!0,e=p.config,t.width=e.width,t.height=e.height,t.sps=[p.data],t.profileIdc=e.profileIdc,t.levelIdc=e.levelIdc,t.profileCompatibility=e.profileCompatibility,r.endNalUnit()):p.nalUnitType==="pic_parameter_set_rbsp"?(t.newMetadata=!0,t.pps=[p.data],r.endNalUnit()):p.nalUnitType==="access_unit_delimiter_rbsp"?(r&&this.finishFrame(a,r),r=new l(l.VIDEO_TAG),r.pts=p.pts,r.dts=p.dts):(p.nalUnitType==="slice_layer_without_partitioning_rbsp_idr"&&(r.keyFrame=!0),r.endNalUnit()),r.startNalUnit(),r.writeBytes(p.data);r&&this.finishFrame(a,r),this.trigger("data",{track:t,tags:a.list}),this.trigger("done","VideoSegmentStream")}},A.prototype=new _,O=function(t){var e,r,n,p,a,m,h,f,o,v,T,E,y=this;O.prototype.init.call(this),t=t||{},this.metadataStream=new g.MetadataStream,t.metadataStream=this.metadataStream,e=new g.TransportPacketStream,r=new g.TransportParseStream,n=new g.ElementaryStream,p=new g.TimestampRolloverStream("video"),a=new g.TimestampRolloverStream("audio"),m=new g.TimestampRolloverStream("timed-metadata"),h=new s,f=new u,E=new i(t),e.pipe(r).pipe(n),n.pipe(p).pipe(f),n.pipe(a).pipe(h),n.pipe(m).pipe(this.metadataStream).pipe(E),T=new g.CaptionStream,f.pipe(T).pipe(E),n.on("data",function(d){var L,I,M;if(d.type==="metadata"){for(L=d.tracks.length;L--;)d.tracks[L].type==="video"?I=d.tracks[L]:d.tracks[L].type==="audio"&&(M=d.tracks[L]);I&&!o&&(E.numberOfTracks++,o=new A(I),f.pipe(o).pipe(E)),M&&!v&&(E.numberOfTracks++,v=new k(M),h.pipe(v).pipe(E))}}),this.push=function(d){e.push(d)},this.flush=function(){e.flush()},E.on("data",function(d){y.trigger("data",d)}),E.on("done",function(){y.trigger("done")})},O.prototype=new _,B.exports=O},{}],47:[function(C,B,U){"use strict";var O=C(60),A=function(s){for(var u=0,i={payloadType:-1,payloadSize:0},c=0,t=0;u<s.byteLength&&s[u]!==128;){for(;s[u]===255;)c+=255,u++;for(c+=s[u++];s[u]===255;)t+=255,u++;if(t+=s[u++],!i.payload&&c===4){i.payloadType=c,i.payloadSize=t,i.payload=s.subarray(u,u+t);break}u+=t,c=0,t=0}return i},k=function(s){return s.payload[0]!==181||(s.payload[1]<<8|s.payload[2])!=49||String.fromCharCode(s.payload[3],s.payload[4],s.payload[5],s.payload[6])!=="GA94"||s.payload[7]!==3?null:s.payload.subarray(8,s.payload.length-1)},w=function(s,u){var i,c,t,e,r=[];if(!(64&u[0]))return r;for(c=31&u[0],i=0;i<c;i++)t=3*i,e={type:3&u[t+2],pts:s},4&u[t+2]&&(e.ccData=u[t+3]<<8|u[t+4],r.push(e));return r},S=function(){S.prototype.init.call(this),this.captionPackets_=[],this.field1_=new g,this.field1_.on("data",this.trigger.bind(this,"data")),this.field1_.on("done",this.trigger.bind(this,"done"))};S.prototype=new O,S.prototype.push=function(s){var u,i;s.nalUnitType==="sei_rbsp"&&(u=A(s.escapedRBSP),u.payloadType===4&&(i=k(u))&&(this.captionPackets_=this.captionPackets_.concat(w(s.pts,i))))},S.prototype.flush=function(){if(!this.captionPackets_.length)return void this.field1_.flush();this.captionPackets_.forEach(function(s,u){s.presortIndex=u}),this.captionPackets_.sort(function(s,u){return s.pts===u.pts?s.presortIndex-u.presortIndex:s.pts-u.pts}),this.captionPackets_.forEach(this.field1_.push,this.field1_),this.captionPackets_.length=0,this.field1_.flush()};var b={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608},_=function(s){return s===null?"":(s=b[s]||s,String.fromCharCode(s))},l=function(){for(var s=[],u=15;u--;)s.push("");return s},g=function(){g.prototype.init.call(this),this.mode_="popOn",this.topRow_=0,this.startPts_=0,this.displayed_=l(),this.nonDisplayed_=l(),this.lastControlCode_=null,this.push=function(s){if(s.type===0){var u,i,c,t;if((u=32639&s.ccData)===this.lastControlCode_)return void(this.lastControlCode_=null);switch(this.lastControlCode_=(61440&u)==4096?u:null,u){case 0:break;case 5152:this.mode_="popOn";break;case 5167:this.flushDisplayed(s.pts),i=this.displayed_,this.displayed_=this.nonDisplayed_,this.nonDisplayed_=i,this.startPts_=s.pts;break;case 5157:this.topRow_=13,this.mode_="rollUp";break;case 5158:this.topRow_=12,this.mode_="rollUp";break;case 5159:this.topRow_=11,this.mode_="rollUp";break;case 5165:this.flushDisplayed(s.pts),this.shiftRowsUp_(),this.startPts_=s.pts;break;case 5153:this.mode_==="popOn"?this.nonDisplayed_[14]=this.nonDisplayed_[14].slice(0,-1):this.displayed_[14]=this.displayed_[14].slice(0,-1);break;case 5164:this.flushDisplayed(s.pts),this.displayed_=l();break;case 5166:this.nonDisplayed_=l();break;default:if(c=u>>>8,t=255&u,c>=16&&c<=23&&t>=64&&t<=127&&(c!==16||t<96)&&(c=32,t=null),(c===17||c===25)&&t>=48&&t<=63&&(c=9834,t=""),(240&c)==16)return;c===0&&(c=null),t===0&&(t=null),this[this.mode_](s.pts,c,t)}}}};g.prototype=new O,g.prototype.flushDisplayed=function(s){var u=this.displayed_.map(function(i){return i.trim()}).filter(function(i){return i.length}).join(`
`);u.length&&this.trigger("data",{startPts:this.startPts_,endPts:s,text:u})},g.prototype.popOn=function(s,u,i){var c=this.nonDisplayed_[14];c+=_(u),c+=_(i),this.nonDisplayed_[14]=c},g.prototype.rollUp=function(s,u,i){var c=this.displayed_[14];c===""&&(this.flushDisplayed(s),this.startPts_=s),c+=_(u),c+=_(i),this.displayed_[14]=c},g.prototype.shiftRowsUp_=function(){var s;for(s=0;s<this.topRow_;s++)this.displayed_[s]="";for(s=this.topRow_;s<14;s++)this.displayed_[s]=this.displayed_[s+1];this.displayed_[14]=""},B.exports={CaptionStream:S,Cea608Stream:g}},{}],48:[function(C,B,U){"use strict";var O,A,k,w=C(60),S=C(47),b=C(51),_=C(52).TimestampRolloverStream,l=C(51);O=function(){var u=new Uint8Array(188),i=0;O.prototype.init.call(this),this.push=function(c){var t,e=0,r=188;for(i?(t=new Uint8Array(c.byteLength+i),t.set(u.subarray(0,i)),t.set(c,i),i=0):t=c;r<t.byteLength;)t[e]!==71||t[r]!==71?(e++,r++):(this.trigger("data",t.subarray(e,r)),e+=188,r+=188);e<t.byteLength&&(u.set(t.subarray(e),0),i=t.byteLength-e)},this.flush=function(){i===188&&u[0]===71&&(this.trigger("data",u),i=0),this.trigger("done")}},O.prototype=new w,A=function(){var u,i,c,t;A.prototype.init.call(this),t=this,this.packetsWaitingForPmt=[],this.programMapTable=void 0,u=function(e,r){var n=0;r.payloadUnitStartIndicator&&(n+=e[n]+1),r.type==="pat"?i(e.subarray(n),r):c(e.subarray(n),r)},i=function(e,r){r.section_number=e[7],r.last_section_number=e[8],t.pmtPid=(31&e[10])<<8|e[11],r.pmtPid=t.pmtPid},c=function(e,r){var n,p,a,m;if(1&e[5]){for(t.programMapTable={},n=(15&e[1])<<8|e[2],p=3+n-4,a=(15&e[10])<<8|e[11],m=12+a;m<p;)t.programMapTable[(31&e[m+1])<<8|e[m+2]]=e[m],m+=5+((15&e[m+3])<<8|e[m+4]);for(r.programMapTable=t.programMapTable;t.packetsWaitingForPmt.length;)t.processPes_.apply(t,t.packetsWaitingForPmt.shift())}},this.push=function(e){var r={},n=4;r.payloadUnitStartIndicator=!!(64&e[1]),r.pid=31&e[1],r.pid<<=8,r.pid|=e[2],(48&e[3])>>>4>1&&(n+=e[n]+1),r.pid===0?(r.type="pat",u(e.subarray(n),r),this.trigger("data",r)):r.pid===this.pmtPid?(r.type="pmt",u(e.subarray(n),r),this.trigger("data",r)):this.programMapTable===void 0?this.packetsWaitingForPmt.push([e,n,r]):this.processPes_(e,n,r)},this.processPes_=function(e,r,n){n.streamType=this.programMapTable[n.pid],n.type="pes",n.data=e.subarray(r),this.trigger("data",n)}},A.prototype=new w,A.STREAM_TYPES={h264:27,adts:15},k=function(){var u=this,i={data:[],size:0},c={data:[],size:0},t={data:[],size:0},e=function(n,p){var a;p.packetLength=6+(n[4]<<8|n[5]),p.dataAlignmentIndicator=(4&n[6])!=0,a=n[7],192&a&&(p.pts=(14&n[9])<<27|(255&n[10])<<20|(254&n[11])<<12|(255&n[12])<<5|(254&n[13])>>>3,p.pts*=4,p.pts+=(6&n[13])>>>1,p.dts=p.pts,64&a&&(p.dts=(14&n[14])<<27|(255&n[15])<<20|(254&n[16])<<12|(255&n[17])<<5|(254&n[18])>>>3,p.dts*=4,p.dts+=(6&n[18])>>>1)),p.data=n.subarray(9+n[8])},r=function(n,p,a){var m,h=new Uint8Array(n.size),f={type:p},o=0,v=0,T=!1;if(n.data.length&&!(n.size<9)){for(f.trackId=n.data[0].pid,o=0;o<n.data.length;o++)m=n.data[o],h.set(m.data,v),v+=m.data.byteLength;e(h,f),T=p==="video"||f.packetLength===n.size,(a||T)&&(n.size=0,n.data.length=0),T&&u.trigger("data",f)}};k.prototype.init.call(this),this.push=function(n){({pat:function(){},pes:function(){var p,a;switch(n.streamType){case b.H264_STREAM_TYPE:case l.H264_STREAM_TYPE:p=i,a="video";break;case b.ADTS_STREAM_TYPE:p=c,a="audio";break;case b.METADATA_STREAM_TYPE:p=t,a="timed-metadata";break;default:return}n.payloadUnitStartIndicator&&r(p,a,!0),p.data.push(n),p.size+=n.data.byteLength},pmt:function(){var p,a,m={type:"metadata",tracks:[]},h=n.programMapTable;for(p in h)h.hasOwnProperty(p)&&(a={timelineStartInfo:{baseMediaDecodeTime:0}},a.id=+p,h[p]===l.H264_STREAM_TYPE?(a.codec="avc",a.type="video"):h[p]===l.ADTS_STREAM_TYPE&&(a.codec="adts",a.type="audio"),m.tracks.push(a));u.trigger("data",m)}})[n.type]()},this.flush=function(){r(i,"video"),r(c,"audio"),r(t,"timed-metadata"),this.trigger("done")}},k.prototype=new w;var g={PAT_PID:0,MP2T_PACKET_LENGTH:188,TransportPacketStream:O,TransportParseStream:A,ElementaryStream:k,TimestampRolloverStream:_,CaptionStream:S.CaptionStream,Cea608Stream:S.Cea608Stream,MetadataStream:C(49)};for(var s in b)b.hasOwnProperty(s)&&(g[s]=b[s]);B.exports=g},{}],49:[function(C,B,U){"use strict";var O,A=C(60),k=C(51),w=function(g,s,u){var i,c="";for(i=s;i<u;i++)c+="%"+("00"+g[i].toString(16)).slice(-2);return c},S=function(g,s,u){return decodeURIComponent(w(g,s,u))},b=function(g,s,u){return unescape(w(g,s,u))},_=function(g){return g[0]<<21|g[1]<<14|g[2]<<7|g[3]},l={TXXX:function(g){var s;if(g.data[0]===3){for(s=1;s<g.data.length;s++)if(g.data[s]===0){g.description=S(g.data,1,s),g.value=S(g.data,s+1,g.data.length).replace(/\0*$/,"");break}g.data=g.value}},WXXX:function(g){var s;if(g.data[0]===3){for(s=1;s<g.data.length;s++)if(g.data[s]===0){g.description=S(g.data,1,s),g.url=S(g.data,s+1,g.data.length);break}}},PRIV:function(g){var s;for(s=0;s<g.data.length;s++)if(g.data[s]===0){g.owner=b(g.data,0,s);break}g.privateData=g.data.subarray(s+1),g.data=g.privateData}};O=function(g){var s,u={debug:!(!g||!g.debug),descriptor:g&&g.descriptor},i=0,c=[],t=0;if(O.prototype.init.call(this),this.dispatchType=k.METADATA_STREAM_TYPE.toString(16),u.descriptor)for(s=0;s<u.descriptor.length;s++)this.dispatchType+=("00"+u.descriptor[s].toString(16)).slice(-2);this.push=function(e){var r,n,p,a,m,h;if(e.type==="timed-metadata"){if(e.dataAlignmentIndicator&&(t=0,c.length=0),c.length===0&&(e.data.length<10||e.data[0]!=="I".charCodeAt(0)||e.data[1]!=="D".charCodeAt(0)||e.data[2]!=="3".charCodeAt(0)))return void(u.debug&&console.log("Skipping unrecognized metadata packet"));if(c.push(e),t+=e.data.byteLength,c.length===1&&(i=_(e.data.subarray(6,10)),i+=10),!(t<i)){for(r={data:new Uint8Array(i),frames:[],pts:c[0].pts,dts:c[0].dts},m=0;m<i;)r.data.set(c[0].data.subarray(0,i-m),m),m+=c[0].data.byteLength,t-=c[0].data.byteLength,c.shift();n=10,64&r.data[5]&&(n+=4,n+=_(r.data.subarray(10,14)),i-=_(r.data.subarray(16,20)));do{if((p=_(r.data.subarray(n+4,n+8)))<1)return console.log("Malformed ID3 frame encountered. Skipping metadata parsing.");if(h=String.fromCharCode(r.data[n],r.data[n+1],r.data[n+2],r.data[n+3]),a={id:h,data:r.data.subarray(n+10,n+p+10)},a.key=a.id,l[a.id]&&(l[a.id](a),a.owner==="com.apple.streaming.transportStreamTimestamp")){var f=a.data,o=(1&f[3])<<30|f[4]<<22|f[5]<<14|f[6]<<6|f[7]>>>2;o*=4,o+=3&f[7],a.timeStamp=o,r.pts===void 0&&r.dts===void 0&&(r.pts=a.timeStamp,r.dts=a.timeStamp),this.trigger("timestamp",a)}r.frames.push(a),n+=10,n+=p}while(n<i);this.trigger("data",r)}}}},O.prototype=new A,B.exports=O},{}],50:[function(C,B,U){"use strict";var O=C(51),A=function(i){var c=31&i[1];return c<<=8,c|=i[2]},k=function(i){return!!(64&i[1])},w=function(i){var c=0;return(48&i[3])>>>4>1&&(c+=i[4]+1),c},S=function(i,c){var t=A(i);return t===0?"pat":t===c?"pmt":c?"pes":null},b=function(i){var c=k(i),t=4+w(i);return c&&(t+=i[t]+1),(31&i[t+10])<<8|i[t+11]},_=function(i){var c={},t=k(i),e=4+w(i);if(t&&(e+=i[e]+1),1&i[e+5]){var r,n,p;r=(15&i[e+1])<<8|i[e+2],n=3+r-4,p=(15&i[e+10])<<8|i[e+11];for(var a=12+p;a<n;){var m=e+a;c[(31&i[m+1])<<8|i[m+2]]=i[m],a+=5+((15&i[m+3])<<8|i[m+4])}return c}},l=function(i,c){switch(c[A(i)]){case O.H264_STREAM_TYPE:return"video";case O.ADTS_STREAM_TYPE:return"audio";case O.METADATA_STREAM_TYPE:return"timed-metadata";default:return null}},g=function(i){if(!k(i))return null;var c=4+w(i);if(c>=i.byteLength)return null;var t,e=null;return t=i[c+7],192&t&&(e={},e.pts=(14&i[c+9])<<27|(255&i[c+10])<<20|(254&i[c+11])<<12|(255&i[c+12])<<5|(254&i[c+13])>>>3,e.pts*=4,e.pts+=(6&i[c+13])>>>1,e.dts=e.pts,64&t&&(e.dts=(14&i[c+14])<<27|(255&i[c+15])<<20|(254&i[c+16])<<12|(255&i[c+17])<<5|(254&i[c+18])>>>3,e.dts*=4,e.dts+=(6&i[c+18])>>>1)),e},s=function(i){switch(i){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}},u=function(i){for(var c,t=4+w(i),e=i.subarray(t),r=0,n=0,p=!1;n<e.byteLength-3;n++)if(e[n+2]===1){r=n+5;break}for(;r<e.byteLength;)switch(e[r]){case 0:if(e[r-1]!==0){r+=2;break}if(e[r-2]!==0){r++;break}n+3!==r-2&&(c=s(31&e[n+3]))==="slice_layer_without_partitioning_rbsp_idr"&&(p=!0);do r++;while(e[r]!==1&&r<e.length);n=r-2,r+=3;break;case 1:if(e[r-1]!==0||e[r-2]!==0){r+=3;break}c=s(31&e[n+3]),c==="slice_layer_without_partitioning_rbsp_idr"&&(p=!0),n=r-2,r+=3;break;default:r+=3}return e=e.subarray(n),r-=n,n=0,e&&e.byteLength>3&&(c=s(31&e[n+3]))==="slice_layer_without_partitioning_rbsp_idr"&&(p=!0),p};B.exports={parseType:S,parsePat:b,parsePmt:_,parsePayloadUnitStartIndicator:k,parsePesType:l,parsePesTime:g,videoPacketContainsKeyFrame:u}},{}],51:[function(C,B,U){"use strict";B.exports={H264_STREAM_TYPE:27,ADTS_STREAM_TYPE:15,METADATA_STREAM_TYPE:21}},{}],52:[function(C,B,U){"use strict";var O=C(60),A=function(w,S){var b=1;for(w>S&&(b=-1);Math.abs(S-w)>4294967296;)w+=8589934592*b;return w},k=function(w){var S,b;k.prototype.init.call(this),this.type_=w,this.push=function(_){_.type===this.type_&&(b===void 0&&(b=_.dts),_.dts=A(_.dts,b),_.pts=A(_.pts,b),S=_.dts,this.trigger("data",_))},this.flush=function(){b=S,this.trigger("done")},this.discontinuity=function(){b=void 0,S=void 0}};k.prototype=new O,B.exports={TimestampRolloverStream:k,handleRollover:A}},{}],53:[function(C,B,U){B.exports={generator:C(54),Transmuxer:C(56).Transmuxer,AudioSegmentStream:C(56).AudioSegmentStream,VideoSegmentStream:C(56).VideoSegmentStream}},{}],54:[function(C,B,U){"use strict";var O,A,k,w,S,b,_,l,g,s,u,i,c,t,e,r,n,p,a,m,h,f,o,v,T,E,y,d,L,I,M,q,V,W,X,$,Q=Math.pow(2,32)-1;(function(){var N;if(o={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:[]},typeof Uint8Array!="undefined"){for(N in o)o.hasOwnProperty(N)&&(o[N]=[N.charCodeAt(0),N.charCodeAt(1),N.charCodeAt(2),N.charCodeAt(3)]);v=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)]),T=new Uint8Array([0,0,0,1]),y=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),d=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]),L={video:y,audio:d},q=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),M=new Uint8Array([0,0,0,0,0,0,0,0]),V=new Uint8Array([0,0,0,0,0,0,0,0]),W=V,X=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),$=V,I=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}})(),O=function(N){var z,G,F,P=[],x=0;for(z=1;z<arguments.length;z++)P.push(arguments[z]);for(z=P.length;z--;)x+=P[z].byteLength;for(G=new Uint8Array(x+8),F=new DataView(G.buffer,G.byteOffset,G.byteLength),F.setUint32(0,G.byteLength),G.set(N,4),z=0,x=8;z<P.length;z++)G.set(P[z],x),x+=P[z].byteLength;return G},A=function(){return O(o.dinf,O(o.dref,q))},k=function(N){return O(o.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,N.audioobjecttype<<3|N.samplingfrequencyindex>>>1,N.samplingfrequencyindex<<7|N.channelcount<<3,6,1,2]))},w=function(){return O(o.ftyp,v,T,v,E)},r=function(N){return O(o.hdlr,L[N])},S=function(N){return O(o.mdat,N)},e=function(N){var z=new Uint8Array([0,0,0,0,0,0,0,2,0,0,0,3,0,1,95,144,N.duration>>>24&255,N.duration>>>16&255,N.duration>>>8&255,255&N.duration,85,196,0,0]);return N.samplerate&&(z[12]=N.samplerate>>>24&255,z[13]=N.samplerate>>>16&255,z[14]=N.samplerate>>>8&255,z[15]=255&N.samplerate),O(o.mdhd,z)},t=function(N){return O(o.mdia,e(N),r(N.type),_(N))},b=function(N){return O(o.mfhd,new Uint8Array([0,0,0,0,(4278190080&N)>>24,(16711680&N)>>16,(65280&N)>>8,255&N]))},_=function(N){return O(o.minf,N.type==="video"?O(o.vmhd,I):O(o.smhd,M),A(),p(N))},l=function(N,z){for(var G=[],F=z.length;F--;)G[F]=m(z[F]);return O.apply(null,[o.moof,b(N)].concat(G))},g=function(N){for(var z=N.length,G=[];z--;)G[z]=i(N[z]);return O.apply(null,[o.moov,u(4294967295)].concat(G).concat(s(N)))},s=function(N){for(var z=N.length,G=[];z--;)G[z]=h(N[z]);return O.apply(null,[o.mvex].concat(G))},u=function(N){var z=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,2,0,1,95,144,(4278190080&N)>>24,(16711680&N)>>16,(65280&N)>>8,255&N,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 O(o.mvhd,z)},n=function(N){var z,G,F=N.samples||[],P=new Uint8Array(4+F.length);for(G=0;G<F.length;G++)z=F[G].flags,P[G+4]=z.dependsOn<<4|z.isDependedOn<<2|z.hasRedundancy;return O(o.sdtp,P)},p=function(N){return O(o.stbl,a(N),O(o.stts,$),O(o.stsc,W),O(o.stsz,X),O(o.stco,V))},function(){var N,z;a=function(G){return O(o.stsd,new Uint8Array([0,0,0,0,0,0,0,1]),G.type==="video"?N(G):z(G))},N=function(G){var F,P=G.sps||[],x=G.pps||[],D=[],R=[];for(F=0;F<P.length;F++)D.push((65280&P[F].byteLength)>>>8),D.push(255&P[F].byteLength),D=D.concat(Array.prototype.slice.call(P[F]));for(F=0;F<x.length;F++)R.push((65280&x[F].byteLength)>>>8),R.push(255&x[F].byteLength),R=R.concat(Array.prototype.slice.call(x[F]));return O(o.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&G.width)>>8,255&G.width,(65280&G.height)>>8,255&G.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]),O(o.avcC,new Uint8Array([1,G.profileIdc,G.profileCompatibility,G.levelIdc,255].concat([P.length]).concat(D).concat([x.length]).concat(R))),O(o.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])))},z=function(G){return O(o.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,(65280&G.channelcount)>>8,255&G.channelcount,(65280&G.samplesize)>>8,255&G.samplesize,0,0,0,0,(65280&G.samplerate)>>8,255&G.samplerate,0,0]),k(G))}}(),c=function(N){var z=new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,(4278190080&N.id)>>24,(16711680&N.id)>>16,(65280&N.id)>>8,255&N.id,0,0,0,0,(4278190080&N.duration)>>24,(16711680&N.duration)>>16,(65280&N.duration)>>8,255&N.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&N.width)>>8,255&N.width,0,0,(65280&N.height)>>8,255&N.height,0,0]);return O(o.tkhd,z)},m=function(N){var z,G,F,P,x,D,R;return z=O(o.tfhd,new Uint8Array([0,0,0,58,(4278190080&N.id)>>24,(16711680&N.id)>>16,(65280&N.id)>>8,255&N.id,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0])),D=Math.floor(N.baseMediaDecodeTime/(Q+1)),R=Math.floor(N.baseMediaDecodeTime%(Q+1)),G=O(o.tfdt,new Uint8Array([1,0,0,0,D>>>24&255,D>>>16&255,D>>>8&255,255&D,R>>>24&255,R>>>16&255,R>>>8&255,255&R])),x=92,N.type==="audio"?(F=f(N,x),O(o.traf,z,G,F)):(P=n(N),F=f(N,P.length+x),O(o.traf,z,G,F,P))},i=function(N){return N.duration=N.duration||4294967295,O(o.trak,c(N),t(N))},h=function(N){var z=new Uint8Array([0,0,0,0,(4278190080&N.id)>>24,(16711680&N.id)>>16,(65280&N.id)>>8,255&N.id,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return N.type!=="video"&&(z[z.length-1]=0),O(o.trex,z)},function(){var N,z,G;G=function(F,P){var x=0,D=0,R=0,j=0;return F.length&&(F[0].duration!==void 0&&(x=1),F[0].size!==void 0&&(D=2),F[0].flags!==void 0&&(R=4),F[0].compositionTimeOffset!==void 0&&(j=8)),[0,0,x|D|R|j,1,(4278190080&F.length)>>>24,(16711680&F.length)>>>16,(65280&F.length)>>>8,255&F.length,(4278190080&P)>>>24,(16711680&P)>>>16,(65280&P)>>>8,255&P]},z=function(F,P){var x,D,R,j;for(D=F.samples||[],P+=20+16*D.length,x=G(D,P),j=0;j<D.length;j++)R=D[j],x=x.concat([(4278190080&R.duration)>>>24,(16711680&R.duration)>>>16,(65280&R.duration)>>>8,255&R.duration,(4278190080&R.size)>>>24,(16711680&R.size)>>>16,(65280&R.size)>>>8,255&R.size,R.flags.isLeading<<2|R.flags.dependsOn,R.flags.isDependedOn<<6|R.flags.hasRedundancy<<4|R.flags.paddingValue<<1|R.flags.isNonSyncSample,61440&R.flags.degradationPriority,15&R.flags.degradationPriority,(4278190080&R.compositionTimeOffset)>>>24,(16711680&R.compositionTimeOffset)>>>16,(65280&R.compositionTimeOffset)>>>8,255&R.compositionTimeOffset]);return O(o.trun,new Uint8Array(x))},N=function(F,P){var x,D,R,j;for(D=F.samples||[],P+=20+8*D.length,x=G(D,P),j=0;j<D.length;j++)R=D[j],x=x.concat([(4278190080&R.duration)>>>24,(16711680&R.duration)>>>16,(65280&R.duration)>>>8,255&R.duration,(4278190080&R.size)>>>24,(16711680&R.size)>>>16,(65280&R.size)>>>8,255&R.size]);return O(o.trun,new Uint8Array(x))},f=function(F,P){return F.type==="audio"?N(F,P):z(F,P)}}(),B.exports={ftyp:w,mdat:S,moof:l,moov:g,initSegment:function(N){var z,G=w(),F=g(N);return z=new Uint8Array(G.byteLength+F.byteLength),z.set(G),z.set(F,G.byteLength),z}}},{}],55:[function(C,B,U){"use strict";var O,A,k,w;O=function(S,b){var _,l,g,s,u,i=[];if(!b.length)return null;for(_=0;_<S.byteLength;)l=S[_]<<24,l|=S[_+1]<<16,l|=S[_+2]<<8,l|=S[_+3],g=A(S.subarray(_+4,_+8)),s=l>1?_+l:S.byteLength,g===b[0]&&(b.length===1?i.push(S.subarray(_+8,s)):(u=O(S.subarray(_+8,s),b.slice(1)),u.length&&(i=i.concat(u)))),_=s;return i},A=function(S){var b="";return b+=String.fromCharCode(S[0]),b+=String.fromCharCode(S[1]),b+=String.fromCharCode(S[2]),b+=String.fromCharCode(S[3])},k=function(S){var b={};return O(S,["moov","trak"]).reduce(function(_,l){var g,s,u,i,c;return(g=O(l,["tkhd"])[0])?(s=g[0],u=s===0?12:20,i=g[u]<<24|g[u+1]<<16|g[u+2]<<8|g[u+3],(c=O(l,["mdia","mdhd"])[0])?(s=c[0],u=s===0?12:20,_[i]=c[u]<<24|c[u+1]<<16|c[u+2]<<8|c[u+3],_):null):null},b)},w=function(S,b){var _,l,g;return _=O(b,["moof","traf"]),l=[].concat.apply([],_.map(function(s){return O(s,["tfhd"]).map(function(u){var i,c,t;return i=u[4]<<24|u[5]<<16|u[6]<<8|u[7],c=S[i]||9e4,t=O(s,["tfdt"]).map(function(e){var r,n;return r=e[0],n=e[4]<<24|e[5]<<16|e[6]<<8|e[7],r===1&&(n*=Math.pow(2,32),n+=e[8]<<24|e[9]<<16|e[10]<<8|e[11]),n})[0],(t=t||Infinity)/c})})),g=Math.min.apply(null,l),isFinite(g)?g:0},B.exports={parseType:A,timescale:k,startTime:w}},{}],56:[function(C,B,U){"use strict";var O,A,k,w,S,b,_,l,g,s,u,i=C(60),c=C(54),t=C(48),e=C(38),r=C(39).H264Stream,n=C(36),p=C(40),a=C(58),m=["audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize"],h=["width","height","profileIdc","levelIdc","profileCompatibility"];S=function(){return{size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0}}},b=function(f){return f[0]==="I".charCodeAt(0)&&f[1]==="D".charCodeAt(0)&&f[2]==="3".charCodeAt(0)},s=function(f,o){var v;if(f.length!==o.length)return!1;for(v=0;v<f.length;v++)if(f[v]!==o[v])return!1;return!0},u=function(f){var o,v,T=0;for(o=0;o<f.length;o++)v=f[o],T+=v.data.byteLength;return T},A=function(f){var o=[],v=0,T=0,E=0,y=Infinity;A.prototype.init.call(this),this.push=function(d){_(f,d),f&&m.forEach(function(L){f[L]=d[L]}),o.push(d)},this.setEarliestDts=function(d){T=d-f.timelineStartInfo.baseMediaDecodeTime},this.setVideoBaseMediaDecodeTime=function(d){y=d},this.setAudioAppendStart=function(d){E=d},this.flush=function(){var d,L,I,M;if(o.length===0)return void this.trigger("done","AudioSegmentStream");d=this.trimAdtsFramesByEarliestDts_(o),f.baseMediaDecodeTime=g(f),this.prefixWithSilence_(f,d),f.samples=this.generateSampleTable_(d),I=c.mdat(this.concatenateFrameData_(d)),o=[],L=c.moof(v,[f]),M=new Uint8Array(L.byteLength+I.byteLength),v++,M.set(L),M.set(I,L.byteLength),l(f),this.trigger("data",{track:f,boxes:M}),this.trigger("done","AudioSegmentStream")},this.prefixWithSilence_=function(d,L){var I,M,q,V=0,W=0,X=0,$=0;if(L.length&&(I=a.audioTsToVideoTs(d.baseMediaDecodeTime,d.samplerate),V=Math.ceil(9e4/(d.samplerate/1024)),E&&y&&(W=I-Math.max(E,y),X=Math.floor(W/V),$=X*V),!(X<1||$>45e3))){for(M=p[d.samplerate],M||(M=L[0].data),q=0;q<X;q++)L.splice(q,0,{data:M});d.baseMediaDecodeTime-=Math.floor(a.videoTsToAudioTs($,d.samplerate))}},this.trimAdtsFramesByEarliestDts_=function(d){return f.minSegmentDts>=T?d:(f.minSegmentDts=Infinity,d.filter(function(L){return L.dts>=T&&(f.minSegmentDts=Math.min(f.minSegmentDts,L.dts),f.minSegmentPts=f.minSegmentDts,!0)}))},this.generateSampleTable_=function(d){var L,I,M=[];for(L=0;L<d.length;L++)I=d[L],M.push({size:I.data.byteLength,duration:1024});return M},this.concatenateFrameData_=function(d){var L,I,M=0,q=new Uint8Array(u(d));for(L=0;L<d.length;L++)I=d[L],q.set(I.data,M),M+=I.data.byteLength;return q}},A.prototype=new i,O=function(f){var o,v,T=0,E=[];O.prototype.init.call(this),delete f.minPTS,this.gopCache_=[],this.push=function(y){_(f,y),y.nalUnitType!=="seq_parameter_set_rbsp"||o||(o=y.config,f.sps=[y.data],h.forEach(function(d){f[d]=o[d]},this)),y.nalUnitType!=="pic_parameter_set_rbsp"||v||(v=y.data,f.pps=[y.data]),E.push(y)},this.flush=function(){for(var y,d,L,I,M,q;E.length&&E[0].nalUnitType!=="access_unit_delimiter_rbsp";)E.shift();if(E.length===0)return this.resetStream_(),void this.trigger("done","VideoSegmentStream");y=this.groupNalsIntoFrames_(E),L=this.groupFramesIntoGops_(y),L[0][0].keyFrame||(d=this.getGopForFusion_(E[0],f),d?(L.unshift(d),L.byteLength+=d.byteLength,L.nalCount+=d.nalCount,L.pts=d.pts,L.dts=d.dts,L.duration+=d.duration):L=this.extendFirstKeyFrame_(L)),_(f,L),f.samples=this.generateSampleTable_(L),M=c.mdat(this.concatenateNalData_(L)),this.gopCache_.unshift({gop:L.pop(),pps:f.pps,sps:f.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),E=[],f.baseMediaDecodeTime=g(f),this.trigger("baseMediaDecodeTime",f.baseMediaDecodeTime),this.trigger("timelineStartInfo",f.timelineStartInfo),I=c.moof(T,[f]),q=new Uint8Array(I.byteLength+M.byteLength),T++,q.set(I),q.set(M,I.byteLength),this.trigger("data",{track:f,boxes:q}),this.resetStream_(),this.trigger("done","VideoSegmentStream")},this.resetStream_=function(){l(f),o=void 0,v=void 0},this.getGopForFusion_=function(y){var d,L,I,M,q,V=Infinity;for(q=0;q<this.gopCache_.length;q++)M=this.gopCache_[q],I=M.gop,f.pps&&s(f.pps[0],M.pps[0])&&f.sps&&s(f.sps[0],M.sps[0])&&(I.dts<f.timelineStartInfo.dts||(d=y.dts-I.dts-I.duration)>=-1e4&&d<=45e3&&(!L||V>d)&&(L=M,V=d));return L?L.gop:null},this.extendFirstKeyFrame_=function(y){var d;return!y[0][0].keyFrame&&y.length>1&&(d=y.shift(),y.byteLength-=d.byteLength,y.nalCount-=d.nalCount,y[0][0].dts=d.dts,y[0][0].pts=d.pts,y[0][0].duration+=d.duration),y},this.groupNalsIntoFrames_=function(y){var d,L,I=[],M=[];for(I.byteLength=0,d=0;d<y.length;d++)L=y[d],L.nalUnitType==="access_unit_delimiter_rbsp"?(I.length&&(I.duration=L.dts-I.dts,M.push(I)),I=[L],I.byteLength=L.data.byteLength,I.pts=L.pts,I.dts=L.dts):(L.nalUnitType==="slice_layer_without_partitioning_rbsp_idr"&&(I.keyFrame=!0),I.duration=L.dts-I.dts,I.byteLength+=L.data.byteLength,I.push(L));return M.length&&(!I.duration||I.duration<=0)&&(I.duration=M[M.length-1].duration),M.push(I),M},this.groupFramesIntoGops_=function(y){var d,L,I=[],M=[];for(I.byteLength=0,I.nalCount=0,I.duration=0,I.pts=y[0].pts,I.dts=y[0].dts,M.byteLength=0,M.nalCount=0,M.duration=0,M.pts=y[0].pts,M.dts=y[0].dts,d=0;d<y.length;d++)L=y[d],L.keyFrame?(I.length&&(M.push(I),M.byteLength+=I.byteLength,M.nalCount+=I.nalCount,M.duration+=I.duration),I=[L],I.nalCount=L.length,I.byteLength=L.byteLength,I.pts=L.pts,I.dts=L.dts,I.duration=L.duration):(I.duration+=L.duration,I.nalCount+=L.length,I.byteLength+=L.byteLength,I.push(L));return M.length&&I.duration<=0&&(I.duration=M[M.length-1].duration),M.byteLength+=I.byteLength,M.nalCount+=I.nalCount,M.duration+=I.duration,M.push(I),M},this.generateSampleTable_=function(y,d){var L,I,M,q,V,W=d||0,X=[];for(L=0;L<y.length;L++)for(q=y[L],I=0;I<q.length;I++)V=q[I],M=S(),M.dataOffset=W,M.compositionTimeOffset=V.pts-V.dts,M.duration=V.duration,M.size=4*V.length,M.size+=V.byteLength,V.keyFrame&&(M.flags.dependsOn=2),W+=M.size,X.push(M);return X},this.concatenateNalData_=function(y){var d,L,I,M,q,V,W=0,X=y.byteLength,$=y.nalCount,Q=X+4*$,N=new Uint8Array(Q),z=new DataView(N.buffer);for(d=0;d<y.length;d++)for(M=y[d],L=0;L<M.length;L++)for(q=M[L],I=0;I<q.length;I++)V=q[I],z.setUint32(W,V.data.byteLength),W+=4,N.set(V.data,W),W+=V.data.byteLength;return N}},O.prototype=new i,_=function(f,o){typeof o.pts=="number"&&(f.timelineStartInfo.pts===void 0&&(f.timelineStartInfo.pts=o.pts),f.minSegmentPts===void 0?f.minSegmentPts=o.pts:f.minSegmentPts=Math.min(f.minSegmentPts,o.pts),f.maxSegmentPts===void 0?f.maxSegmentPts=o.pts:f.maxSegmentPts=Math.max(f.maxSegmentPts,o.pts)),typeof o.dts=="number"&&(f.timelineStartInfo.dts===void 0&&(f.timelineStartInfo.dts=o.dts),f.minSegmentDts===void 0?f.minSegmentDts=o.dts:f.minSegmentDts=Math.min(f.minSegmentDts,o.dts),f.maxSegmentDts===void 0?f.maxSegmentDts=o.dts:f.maxSegmentDts=Math.max(f.maxSegmentDts,o.dts))},l=function(f){delete f.minSegmentDts,delete f.maxSegmentDts,delete f.minSegmentPts,delete f.maxSegmentPts},g=function(f){var o,v,T=f.minSegmentDts-f.timelineStartInfo.dts;return o=f.timelineStartInfo.baseMediaDecodeTime,o+=T,o=Math.max(0,o),f.type==="audio"&&(v=f.samplerate/9e4,o*=v,o=Math.floor(o)),o},w=function(f,o){this.numberOfTracks=0,this.metadataStream=o,typeof f.remux!="undefined"?this.remuxTracks=!!f.remux:this.remuxTracks=!0,this.pendingTracks=[],this.videoTrack=null,this.pendingBoxes=[],this.pendingCaptions=[],this.pendingMetadata=[],this.pendingBytes=0,this.emittedTracks=0,w.prototype.init.call(this),this.push=function(v){return v.text?this.pendingCaptions.push(v):v.frames?this.pendingMetadata.push(v):(this.pendingTracks.push(v.track),this.pendingBoxes.push(v.boxes),this.pendingBytes+=v.boxes.byteLength,v.track.type==="video"&&(this.videoTrack=v.track),void(v.track.type==="audio"&&(this.audioTrack=v.track)))}},w.prototype=new i,w.prototype.flush=function(f){var o,v,T,E,y=0,d={captions:[],metadata:[],info:{}},L=0;if(this.pendingTracks.length<this.numberOfTracks){if(f!=="VideoSegmentStream"&&f!=="AudioSegmentStream"||this.remuxTracks)return;if(this.pendingTracks.length===0)return void(++this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0))}for(this.videoTrack?(L=this.videoTrack.timelineStartInfo.pts,h.forEach(function(I){d.info[I]=this.videoTrack[I]},this)):this.audioTrack&&(L=this.audioTrack.timelineStartInfo.pts,m.forEach(function(I){d.info[I]=this.audioTrack[I]},this)),this.pendingTracks.length===1?d.type=this.pendingTracks[0].type:d.type="combined",this.emittedTracks+=this.pendingTracks.length,T=c.initSegment(this.pendingTracks),d.initSegment=new Uint8Array(T.byteLength),d.initSegment.set(T),d.data=new Uint8Array(this.pendingBytes),E=0;E<this.pendingBoxes.length;E++)d.data.set(this.pendingBoxes[E],y),y+=this.pendingBoxes[E].byteLength;for(E=0;E<this.pendingCaptions.length;E++)o=this.pendingCaptions[E],o.startTime=o.startPts-L,o.startTime/=9e4,o.endTime=o.endPts-L,o.endTime/=9e4,d.captions.push(o);for(E=0;E<this.pendingMetadata.length;E++)v=this.pendingMetadata[E],v.cueTime=v.pts-L,v.cueTime/=9e4,d.metadata.push(v);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),this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0)},k=function(f){var o,v,T=this,E=!0;k.prototype.init.call(this),f=f||{},this.baseMediaDecodeTime=f.baseMediaDecodeTime||0,this.transmuxPipeline_={},this.setupAacPipeline=function(){var y={};this.transmuxPipeline_=y,y.type="aac",y.metadataStream=new t.MetadataStream,y.aacStream=new n,y.audioTimestampRolloverStream=new t.TimestampRolloverStream("audio"),y.timedMetadataTimestampRolloverStream=new t.TimestampRolloverStream("timed-metadata"),y.adtsStream=new e,y.coalesceStream=new w(f,y.metadataStream),y.headOfPipeline=y.aacStream,y.aacStream.pipe(y.audioTimestampRolloverStream).pipe(y.adtsStream),y.aacStream.pipe(y.timedMetadataTimestampRolloverStream).pipe(y.metadataStream).pipe(y.coalesceStream),y.metadataStream.on("timestamp",function(d){y.aacStream.setTimestamp(d.timeStamp)}),y.aacStream.on("data",function(d){d.type!=="timed-metadata"||y.audioSegmentStream||(v=v||{timelineStartInfo:{baseMediaDecodeTime:T.baseMediaDecodeTime},codec:"adts",type:"audio"},y.coalesceStream.numberOfTracks++,y.audioSegmentStream=new A(v),y.adtsStream.pipe(y.audioSegmentStream).pipe(y.coalesceStream))}),y.coalesceStream.on("data",this.trigger.bind(this,"data")),y.coalesceStream.on("done",this.trigger.bind(this,"done"))},this.setupTsPipeline=function(){var y={};this.transmuxPipeline_=y,y.type="ts",y.metadataStream=new t.MetadataStream,y.packetStream=new t.TransportPacketStream,y.parseStream=new t.TransportParseStream,y.elementaryStream=new t.ElementaryStream,y.videoTimestampRolloverStream=new t.TimestampRolloverStream("video"),y.audioTimestampRolloverStream=new t.TimestampRolloverStream("audio"),y.timedMetadataTimestampRolloverStream=new t.TimestampRolloverStream("timed-metadata"),y.adtsStream=new e,y.h264Stream=new r,y.captionStream=new t.CaptionStream,y.coalesceStream=new w(f,y.metadataStream),y.headOfPipeline=y.packetStream,y.packetStream.pipe(y.parseStream).pipe(y.elementaryStream),y.elementaryStream.pipe(y.videoTimestampRolloverStream).pipe(y.h264Stream),y.elementaryStream.pipe(y.audioTimestampRolloverStream).pipe(y.adtsStream),y.elementaryStream.pipe(y.timedMetadataTimestampRolloverStream).pipe(y.metadataStream).pipe(y.coalesceStream),y.h264Stream.pipe(y.captionStream).pipe(y.coalesceStream),y.elementaryStream.on("data",function(d){var L;if(d.type==="metadata"){for(L=d.tracks.length;L--;)o||d.tracks[L].type!=="video"?v||d.tracks[L].type!=="audio"||(v=d.tracks[L],v.timelineStartInfo.baseMediaDecodeTime=T.baseMediaDecodeTime):(o=d.tracks[L],o.timelineStartInfo.baseMediaDecodeTime=T.baseMediaDecodeTime);o&&!y.videoSegmentStream&&(y.coalesceStream.numberOfTracks++,y.videoSegmentStream=new O(o),y.videoSegmentStream.on("timelineStartInfo",function(I){v&&(v.timelineStartInfo=I,y.audioSegmentStream.setEarliestDts(I.dts))}),y.videoSegmentStream.on("baseMediaDecodeTime",function(I){v&&y.audioSegmentStream.setVideoBaseMediaDecodeTime(I)}),y.h264Stream.pipe(y.videoSegmentStream).pipe(y.coalesceStream)),v&&!y.audioSegmentStream&&(y.coalesceStream.numberOfTracks++,y.audioSegmentStream=new A(v),y.adtsStream.pipe(y.audioSegmentStream).pipe(y.coalesceStream))}}),y.coalesceStream.on("data",this.trigger.bind(this,"data")),y.coalesceStream.on("done",this.trigger.bind(this,"done"))},this.setBaseMediaDecodeTime=function(y){var d=this.transmuxPipeline_;this.baseMediaDecodeTime=y,v&&(v.timelineStartInfo.dts=void 0,v.timelineStartInfo.pts=void 0,l(v),v.timelineStartInfo.baseMediaDecodeTime=y,d.audioTimestampRolloverStream&&d.audioTimestampRolloverStream.discontinuity()),o&&(d.videoSegmentStream&&(d.videoSegmentStream.gopCache_=[],d.videoTimestampRolloverStream.discontinuity()),o.timelineStartInfo.dts=void 0,o.timelineStartInfo.pts=void 0,l(o),o.timelineStartInfo.baseMediaDecodeTime=y),d.timedMetadataTimestampRolloverStream&&d.timedMetadataTimestampRolloverStream.discontinuity()},this.setAudioAppendStart=function(y){v&&this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(y)},this.push=function(y){if(E){var d=b(y);d&&this.transmuxPipeline_.type!=="aac"?this.setupAacPipeline():d||this.transmuxPipeline_.type==="ts"||this.setupTsPipeline(),E=!1}this.transmuxPipeline_.headOfPipeline.push(y)},this.flush=function(){E=!0,this.transmuxPipeline_.headOfPipeline.flush()}},k.prototype=new i,B.exports={Transmuxer:k,VideoSegmentStream:O,AudioSegmentStream:A,AUDIO_PROPERTIES:m,VIDEO_PROPERTIES:h}},{}],57:[function(C,B,U){"use strict";var O=C(51),A=C(52).handleRollover,k={};k.ts=C(50),k.aac=C(37);var w=function(i){return i[0]==="I".charCodeAt(0)&&i[1]==="D".charCodeAt(0)&&i[2]==="3".charCodeAt(0)},S=function(i,c){for(var t,e=0,r=188;r<i.byteLength;)if(i[e]!==71||i[r]!==71)e++,r++;else{switch(t=i.subarray(e,r),k.ts.parseType(t,c.pid)){case"pat":c.pid||(c.pid=k.ts.parsePat(t));break;case"pmt":c.table||(c.table=k.ts.parsePmt(t))}if(c.pid&&c.table)return;e+=188,r+=188}},b=function(i,c,t){for(var e,r,n,p,a=0,m=188,h=!1;m<i.byteLength;)if(i[a]!==71||i[m]!==71)a++,m++;else{switch(e=i.subarray(a,m),k.ts.parseType(e,c.pid)){case"pes":r=k.ts.parsePesType(e,c.table),n=k.ts.parsePayloadUnitStartIndicator(e),r==="audio"&&n&&(p=k.ts.parsePesTime(e))&&(p.type="audio",t.audio.push(p),h=!0)}if(h)break;a+=188,m+=188}for(m=i.byteLength,a=m-188,h=!1;a>=0;)if(i[a]!==71||i[m]!==71)a--,m--;else{switch(e=i.subarray(a,m),k.ts.parseType(e,c.pid)){case"pes":r=k.ts.parsePesType(e,c.table),n=k.ts.parsePayloadUnitStartIndicator(e),r==="audio"&&n&&(p=k.ts.parsePesTime(e))&&(p.type="audio",t.audio.push(p),h=!0)}if(h)break;a-=188,m-=188}},_=function(i,c,t){for(var e,r,n,p,a,m,h,f=0,o=188,v=!1,T={data:[],size:0};o<i.byteLength;)if(i[f]!==71||i[o]!==71)f++,o++;else{switch(e=i.subarray(f,o),k.ts.parseType(e,c.pid)){case"pes":if(r=k.ts.parsePesType(e,c.table),n=k.ts.parsePayloadUnitStartIndicator(e),r==="video"&&(n&&!v&&(p=k.ts.parsePesTime(e))&&(p.type="video",t.video.push(p),v=!0),!t.firstKeyFrame)){if(n&&T.size!==0){for(a=new Uint8Array(T.size),m=0;T.data.length;)h=T.data.shift(),a.set(h,m),m+=h.byteLength;k.ts.videoPacketContainsKeyFrame(a)&&(t.firstKeyFrame=k.ts.parsePesTime(a),t.firstKeyFrame.type="video"),T.size=0}T.data.push(e),T.size+=e.byteLength}}if(v&&t.firstKeyFrame)break;f+=188,o+=188}for(o=i.byteLength,f=o-188,v=!1;f>=0;)if(i[f]!==71||i[o]!==71)f--,o--;else{switch(e=i.subarray(f,o),k.ts.parseType(e,c.pid)){case"pes":r=k.ts.parsePesType(e,c.table),n=k.ts.parsePayloadUnitStartIndicator(e),r==="video"&&n&&(p=k.ts.parsePesTime(e))&&(p.type="video",t.video.push(p),v=!0)}if(v)break;f-=188,o-=188}},l=function(i,c){if(i.audio&&i.audio.length){var t=c;t===void 0&&(t=i.audio[0].dts),i.audio.forEach(function(n){n.dts=A(n.dts,t),n.pts=A(n.pts,t),n.dtsTime=n.dts/9e4,n.ptsTime=n.pts/9e4})}if(i.video&&i.video.length){var e=c;if(e===void 0&&(e=i.video[0].dts),i.video.forEach(function(n){n.dts=A(n.dts,e),n.pts=A(n.pts,e),n.dtsTime=n.dts/9e4,n.ptsTime=n.pts/9e4}),i.firstKeyFrame){var r=i.firstKeyFrame;r.dts=A(r.dts,e),r.pts=A(r.pts,e),r.dtsTime=r.dts/9e4,r.ptsTime=r.dts/9e4}}},g=function(i){for(var c,t=!1,e=0,r=null,n=null,p=0,a=0;i.length-a>=3;){switch(k.aac.parseType(i,a)){case"timed-metadata":if(i.length-a<10){t=!0;break}if((p=k.aac.parseId3TagSize(i,a))>i.length){t=!0;break}n===null&&(c=i.subarray(a,a+p),n=k.aac.parseAacTimestamp(c)),a+=p;break;case"audio":if(i.length-a<7){t=!0;break}if((p=k.aac.parseAdtsSize(i,a))>i.length){t=!0;break}r===null&&(c=i.subarray(a,a+p),r=k.aac.parseSampleRate(c)),e++,a+=p;break;default:a++}if(t)return null}if(r===null||n===null)return null;var m=9e4/r;return{audio:[{type:"audio",dts:n,pts:n},{type:"audio",dts:n+1024*e*m,pts:n+1024*e*m}]}},s=function(i){var c={pid:null,table:null},t={};S(i,c);for(var e in c.table)if(c.table.hasOwnProperty(e)){var r=c.table[e];switch(r){case O.H264_STREAM_TYPE:t.video=[],_(i,c,t),t.video.length===0&&delete t.video;break;case O.ADTS_STREAM_TYPE:t.audio=[],b(i,c,t),t.audio.length===0&&delete t.audio}}return t},u=function(i,c){var t,e=w(i);return(t=e?g(i):s(i))&&(t.audio||t.video)?(l(t,c),t):null};B.exports={inspect:u}},{}],58:[function(C,B,U){var O,A,k,w,S,b;O=function(_){return 9e4*_},A=function(_,l){return _*l},k=function(_){return _/9e4},w=function(_,l){return _/l},S=function(_,l){return O(w(_,l))},b=function(_,l){return A(k(_),l)},B.exports={secondsToVideoTs:O,secondsToAudioTs:A,videoTsToSeconds:k,audioTsToSeconds:w,audioTsToVideoTs:S,videoTsToAudioTs:b}},{}],59:[function(C,B,U){"use strict";var O;O=function(A){var k=A.byteLength,w=0,S=0;this.length=function(){return 8*k},this.bitsAvailable=function(){return 8*k+S},this.loadWord=function(){var b=A.byteLength-k,_=new Uint8Array(4),l=Math.min(4,k);if(l===0)throw new Error("no bytes available");_.set(A.subarray(b,b+l)),w=new DataView(_.buffer).getUint32(0),S=8*l,k-=l},this.skipBits=function(b){var _;S>b?(w<<=b,S-=b):(b-=S,_=Math.floor(b/8),b-=8*_,k-=_,this.loadWord(),w<<=b,S-=b)},this.readBits=function(b){var _=Math.min(S,b),l=w>>>32-_;return S-=_,S>0?w<<=_:k>0&&this.loadWord(),_=b-_,_>0?l<<_|this.readBits(_):l},this.skipLeadingZeros=function(){var b;for(b=0;b<S;++b)if((w&2147483648>>>b)!=0)return w<<=b,S-=b,b;return this.loadWord(),b+this.skipLeadingZeros()},this.skipUnsignedExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.skipExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.readUnsignedExpGolomb=function(){var b=this.skipLeadingZeros();return this.readBits(b+1)-1},this.readExpGolomb=function(){var b=this.readUnsignedExpGolomb();return 1&b?1+b>>>1:-1*(b>>>1)},this.readBoolean=function(){return this.readBits(1)===1},this.readUnsignedByte=function(){return this.readBits(8)},this.loadWord()},B.exports=O},{}],60:[function(C,B,U){"use strict";var O=function(){this.init=function(){var A={};this.on=function(k,w){A[k]||(A[k]=[]),A[k]=A[k].concat(w)},this.off=function(k,w){var S;return!!A[k]&&(S=A[k].indexOf(w),A[k]=A[k].slice(),A[k].splice(S,1),S>-1)},this.trigger=function(k){var w,S,b,_;if(w=A[k])if(arguments.length===2)for(b=w.length,S=0;S<b;++S)w[S].call(this,arguments[1]);else{for(_=[],S=arguments.length,S=1;S<arguments.length;++S)_.push(arguments[S]);for(b=w.length,S=0;S<b;++S)w[S].apply(this,_)}},this.dispose=function(){A={}}}};O.prototype.pipe=function(A){return this.on("data",function(k){A.push(k)}),this.on("done",function(k){A.flush(k)}),A},O.prototype.push=function(A){this.trigger("data",A)},O.prototype.flush=function(A){this.trigger("done",A)},B.exports=O},{}],61:[function(C,B,U){(function(O){var A={buildAbsoluteURL:function(k,w){if(w=w.trim(),/^[a-z]+:/i.test(w))return w;var S=null,b=null,_=/^([^#]*)(.*)$/.exec(w);_&&(b=_[2],w=_[1]);var l=/^([^\?]*)(.*)$/.exec(w);l&&(S=l[2],w=l[1]);var g=/^([^#]*)(.*)$/.exec(k);g&&(k=g[1]);var s=/^([^\?]*)(.*)$/.exec(k);s&&(k=s[1]);var u=/^(([a-z]+:)?\/\/[^:\/]+(:[0-9]+)?)?(\/?.*)$/i.exec(k);if(!u)throw new Error("Error trying to parse base URL.");var i=u[2]||"",c=u[1]||"",t=u[4];t.indexOf("/")!==0&&c!==""&&(t="/"+t);var e=null;return e=/^\/\//.test(w)?i+"//"+A.buildAbsolutePath("",w.substring(2)):/^\//.test(w)?c+"/"+A.buildAbsolutePath("",w.substring(1)):A.buildAbsolutePath(c+t,w),S&&(e+=S),b&&(e+=b),e},buildAbsolutePath:function(k,w){for(var S,b,_=w,l="",g=k.replace(/[^\/]*$/,_.replace(/(\/|^)(?:\.?\/+)+/g,"$1")),s=0;(b=g.indexOf("/../",s))>-1;s=b+S)S=/^\/(?:\.\.\/)*/.exec(g.slice(b))[0].length,l=(l+g.substring(s,b)).replace(new RegExp("(?:\\/+[^\\/]*){0,"+(S-1)/3+"}$"),"/");return l+g.substr(s)}};typeof U=="object"&&typeof B=="object"?B.exports=A:typeof define=="function"&&define.amd?define([],function(){return A}):typeof U=="object"?U.URLToolkit=A:O.URLToolkit=A})(this)},{}],62:[function(C,B,U){(function(O){"use strict";function A(s){return s&&s.__esModule?s:{default:s}}Object.defineProperty(U,"__esModule",{value:!0});var k=C(30),w=A(k),S=typeof window!="undefined"?window.videojs:O!==void 0?O.videojs:null,b=A(S),_=function(s){Object.defineProperties(s.frame,{id:{get:function(){return b.default.log.warn("cue.frame.id is deprecated. Use cue.value.key instead."),s.value.key}},value:{get:function(){return b.default.log.warn("cue.frame.value is deprecated. Use cue.value.data instead."),s.value.data}},privateData:{get:function(){return b.default.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead."),s.value.data}}})},l=function(s){return isNaN(s)||Math.abs(s)===Infinity?Number.MAX_VALUE:s},g=function(s,u,i){var c=w.default.WebKitDataCue||w.default.VTTCue;u&&u.forEach(function(t){this.inbandTextTrack_.addCue(new c(t.startTime+this.timestampOffset,t.endTime+this.timestampOffset,t.text))},s),i&&function(){var t=l(s.mediaSource_.duration);i.forEach(function(e){var r=e.cueTime+this.timestampOffset;e.frames.forEach(function(n){var p=new c(r,r,n.value||n.url||n.data||"");p.frame=n,p.value=n,_(p),this.metadataTrack_.addCue(p)},this)},s),s.metadataTrack_&&s.metadataTrack_.cues&&s.metadataTrack_.cues.length&&function(){for(var e=s.metadataTrack_.cues,r=[],n=0;n<e.length;n++)e[n]&&r.push(e[n]);var p=r.reduce(function(m,h){var f=m[h.startTime]||[];return f.push(h),m[h.startTime]=f,m},{}),a=Object.keys(p).sort(function(m,h){return Number(m)-Number(h)});a.forEach(function(m,h){var f=p[m],o=Number(a[h+1])||t;f.forEach(function(v){v.endTime=o})})}()}()};U.default={addTextTrackData:g,durationOfVideo:l},B.exports=U.default}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],63:[function(C,B,U){"use strict";Object.defineProperty(U,"__esModule",{value:!0});var O=function(k,w,S){for(var b=k.remoteTextTracks()||[],_=0;_<b.length;_++){var l=b[_];l.kind===w&&l.label===S&&k.removeRemoteTextTrack(l)}};U.removeExistingTrack=O;var A=function(k){O(k,"captions","cc1"),O(k,"metadata","Timed Metadata")};U.cleanupTextTracks=A},{}],64:[function(C,B,U){"use strict";Object.defineProperty(U,"__esModule",{value:!0});var O=function(S){return/mp4a\.\d+.\d+/i.test(S)},A=function(S){return/avc1\.[\da-f]+/i.test(S)},k=function(S){var b={type:"",parameters:{}},_=S.trim().split(";");return b.type=_.shift().trim(),_.forEach(function(l){var g=l.trim().split("=");if(g.length>1){var s=g[0].replace(/"/g,"").trim(),u=g[1].replace(/"/g,"").trim();b.parameters[s]=u}}),b},w=function(S){return S.map(function(b){return b.replace(/avc1\.(\d+)\.(\d+)/i,function(_,l,g){return"avc1."+("00"+Number(l).toString(16)).slice(-2)+"00"+("00"+Number(g).toString(16)).slice(-2)})})};U.default={isAudioCodec:O,parseContentType:k,isVideoCodec:A,translateLegacyCodecs:w},B.exports=U.default},{}],65:[function(C,B,U){"use strict";Object.defineProperty(U,"__esModule",{value:!0});var O=C(63),A=function(k,w,S){var b=w.player_;S.captions&&S.captions.length&&!k.inbandTextTrack_&&((0,O.removeExistingTrack)(b,"captions","cc1"),k.inbandTextTrack_=b.addRemoteTextTrack({kind:"captions",label:"cc1"},!1).track,b.tech_.trigger({type:"usage",name:"hls-608"})),S.metadata&&S.metadata.length&&!k.metadataTrack_&&((0,O.removeExistingTrack)(b,"metadata","Timed Metadata",!0),k.metadataTrack_=b.addRemoteTextTrack({kind:"metadata",label:"Timed Metadata"},!1).track,k.metadataTrack_.inBandMetadataTrackDispatchType=S.metadata.dispatchType)};U.default=A,B.exports=U.default},{}],66:[function(C,B,U){"use strict";Object.defineProperty(U,"__esModule",{value:!0});var O={TIME_BETWEEN_CHUNKS:1,BYTES_PER_CHUNK:32768};U.default=O,B.exports=U.default},{}],67:[function(C,B,U){(function(O){"use strict";function A(a){return a&&a.__esModule?a:{default:a}}function k(a,m){if(!(a instanceof m))throw new TypeError("Cannot call a class as a function")}function w(a,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof m);a.prototype=Object.create(m&&m.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),m&&(Object.setPrototypeOf?Object.setPrototypeOf(a,m):a.__proto__=m)}Object.defineProperty(U,"__esModule",{value:!0});var S=function(){function a(m,h){for(var f=0;f<h.length;f++){var o=h[f];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(m,o.key,o)}}return function(m,h,f){return h&&a(m.prototype,h),f&&a(m,f),m}}(),b=function(a,m,h){for(var f=!0;f;){var o=a,v=m,T=h;f=!1,o===null&&(o=Function.prototype);var E=Object.getOwnPropertyDescriptor(o,v);if(E!==void 0){if("value"in E)return E.value;var y=E.get;return y===void 0?void 0:y.call(T)}var d=Object.getPrototypeOf(o);if(d===null)return;a=d,m=v,h=T,f=!0,E=d=void 0}},_=C(29),l=A(_),g=typeof window!="undefined"?window.videojs:O!==void 0?O.videojs:null,s=A(g),u=C(68),i=A(u),c=C(66),t=A(c),e=C(64),r=C(63),n=function(a){function m(){var h=this;k(this,m),b(Object.getPrototypeOf(m.prototype),"constructor",this).call(this),this.sourceBuffers=[],this.readyState="closed",this.on(["sourceopen","webkitsourceopen"],function(f){h.swfObj=l.default.getElementById(f.swfId),h.player_=(0,s.default)(h.swfObj.parentNode),h.tech_=h.swfObj.tech,h.readyState="open",h.tech_.on("seeking",function(){for(var o=h.sourceBuffers.length;o--;)h.sourceBuffers[o].abort()}),h.tech_.hls&&h.tech_.hls.on("dispose",function(){(0,r.cleanupTextTracks)(h.player_)}),h.swfObj&&h.swfObj.vjs_load()})}return w(m,a),S(m,[{key:"addSeekableRange_",value:function(){}},{key:"addSourceBuffer",value:function(h){var f=(0,e.parseContentType)(h),o=void 0;if(f.type!=="video/mp2t"&&f.type!=="audio/mp2t")throw new Error("NotSupportedError (Video.js)");return o=new i.default(this),this.sourceBuffers.push(o),o}},{key:"endOfStream",value:function(h){h==="network"?this.tech_.error(2):h==="decode"&&this.tech_.error(3),this.readyState!=="ended"&&(this.readyState="ended",this.swfObj.vjs_endOfStream())}}]),m}(s.default.EventTarget);U.default=n;try{Object.defineProperty(n.prototype,"duration",{get:function(){return this.swfObj?this.swfObj.vjs_getProperty("duration"):NaN},set:function(a){var m=void 0,h=this.swfObj.vjs_getProperty("duration");if(this.swfObj.vjs_setProperty("duration",a),a<h)for(m=0;m<this.sourceBuffers.length;m++)this.sourceBuffers[m].remove(a,h);return a}})}catch(a){n.prototype.duration=NaN}for(var p in t.default)n[p]=t.default[p];B.exports=U.default}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],68:[function(C,B,U){(function(O){"use strict";function A(d){return d&&d.__esModule?d:{default:d}}function k(d,L){if(!(d instanceof L))throw new TypeError("Cannot call a class as a function")}function w(d,L){if(typeof L!="function"&&L!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof L);d.prototype=Object.create(L&&L.prototype,{constructor:{value:d,enumerable:!1,writable:!0,configurable:!0}}),L&&(Object.setPrototypeOf?Object.setPrototypeOf(d,L):d.__proto__=L)}Object.defineProperty(U,"__esModule",{value:!0});var S=function(){function d(L,I){for(var M=0;M<I.length;M++){var q=I[M];q.enumerable=q.enumerable||!1,q.configurable=!0,"value"in q&&(q.writable=!0),Object.defineProperty(L,q.key,q)}}return function(L,I,M){return I&&d(L.prototype,I),M&&d(L,M),L}}(),b=function(d,L,I){for(var M=!0;M;){var q=d,V=L,W=I;M=!1,q===null&&(q=Function.prototype);var X=Object.getOwnPropertyDescriptor(q,V);if(X!==void 0){if("value"in X)return X.value;var $=X.get;return $===void 0?void 0:$.call(W)}var Q=Object.getPrototypeOf(q);if(Q===null)return;d=Q,L=V,I=W,M=!0,X=Q=void 0}},_=C(30),l=A(_),g=typeof window!="undefined"?window.videojs:O!==void 0?O.videojs:null,s=A(g),u=C(44),i=A(u),c=C(71),t=A(c),e=C(65),r=A(e),n=C(62),p=C(69),a=A(p),m=C(75),h=A(m),f=C(66),o=A(f),v=function(d){l.default.setTimeout(d,o.default.TIME_BETWEEN_CHUNKS)},T=function(){return Math.random().toString(36).slice(2,8)},E=function(d,L){(typeof L!="number"||L<0)&&(L=0);var I=Math.pow(10,L);return Math.round(d*I)/I},y=function(d){function L(I){var M=this;k(this,L),b(Object.getPrototypeOf(L.prototype),"constructor",this).call(this);var q=void 0;this.chunkSize_=o.default.BYTES_PER_CHUNK,this.buffer_=[],this.bufferSize_=0,this.basePtsOffset_=NaN,this.mediaSource_=I,this.audioBufferEnd_=NaN,this.videoBufferEnd_=NaN,this.updating=!1,this.timestampOffset_=0,q=l.default.btoa(String.fromCharCode.apply(null,Array.prototype.slice.call(i.default.getFlvHeader())));var V=this.mediaSource_.player_.id().replace(/[^a-zA-Z0-9]/g,"_");this.flashEncodedHeaderName_="vjs_flashEncodedHeader_"+V+T(),this.flashEncodedDataName_="vjs_flashEncodedData_"+V+T(),l.default[this.flashEncodedHeaderName_]=function(){return delete l.default[M.flashEncodedHeaderName_],q},this.mediaSource_.swfObj.vjs_appendChunkReady(this.flashEncodedHeaderName_),this.transmuxer_=(0,h.default)(a.default),this.transmuxer_.postMessage({action:"init",options:{}}),this.transmuxer_.onmessage=function(W){W.data.action==="data"&&M.receiveBuffer_(W.data.segment)},this.one("updateend",function(){M.mediaSource_.tech_.trigger("loadedmetadata")}),Object.defineProperty(this,"timestampOffset",{get:function(){return this.timestampOffset_},set:function(W){typeof W=="number"&&W>=0&&(this.timestampOffset_=W,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 s.default.createTimeRange();var W=this.mediaSource_.swfObj.vjs_getProperty("buffered");return W&&W.length&&(W[0][0]=E(W[0][0],3),W[0][1]=E(W[0][1],3)),s.default.createTimeRanges(W)}}),this.mediaSource_.player_.on("seeked",function(){(0,t.default)(0,Infinity,M.metadataTrack_),(0,t.default)(0,Infinity,M.inbandTextTrack_)}),this.mediaSource_.player_.tech_.hls.on("dispose",function(){M.transmuxer_.terminate()})}return w(L,d),S(L,[{key:"appendBuffer",value:function(I){var M=void 0;if(this.updating)throw M=new Error("SourceBuffer.append() cannot be called while an update is in progress"),M.name="InvalidStateError",M.code=11,M;this.updating=!0,this.mediaSource_.readyState="open",this.trigger({type:"update"}),this.transmuxer_.postMessage({action:"push",data:I.buffer,byteOffset:I.byteOffset,byteLength:I.byteLength},[I.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(I,M){(0,t.default)(I,M,this.metadataTrack_),(0,t.default)(I,M,this.inbandTextTrack_),this.trigger({type:"update"}),this.trigger({type:"updateend"})}},{key:"receiveBuffer_",value:function(I){var M=this;(0,r.default)(this,this.mediaSource_,I),(0,n.addTextTrackData)(this,I.captions,I.metadata),v(function(){var q=M.convertTagsToData_(I);M.buffer_.length===0&&v(M.processBuffer_.bind(M)),q&&(M.buffer_.push(q),M.bufferSize_+=q.byteLength)})}},{key:"processBuffer_",value:function(){var I=this,M=o.default.BYTES_PER_CHUNK;if(!this.buffer_.length)return void(this.updating!==!1&&(this.updating=!1,this.trigger({type:"updateend"})));var q=this.buffer_[0].subarray(0,M);q.byteLength<M||this.buffer_[0].byteLength===M?this.buffer_.shift():this.buffer_[0]=this.buffer_[0].subarray(M),this.bufferSize_-=q.byteLength;for(var V=[],W=q.byteLength,X=0;X<W;X++)V.push(String.fromCharCode(q[X]));var $=l.default.btoa(V.join(""));l.default[this.flashEncodedDataName_]=function(){return v(I.processBuffer_.bind(I)),delete l.default[I.flashEncodedDataName_],$},this.mediaSource_.swfObj.vjs_appendChunkReady(this.flashEncodedDataName_)}},{key:"convertTagsToData_",value:function(I){var M=0,q=this.mediaSource_.tech_,V=0,W=void 0,X=I.tags.videoTags,$=I.tags.audioTags;if(isNaN(this.basePtsOffset_)&&(X.length||$.length)){var Q=X[0]||{pts:Infinity},N=$[0]||{pts:Infinity};this.basePtsOffset_=Math.min(N.pts,Q.pts)}q.seeking()&&(this.videoBufferEnd_=NaN,this.audioBufferEnd_=NaN),isNaN(this.videoBufferEnd_)?(q.buffered().length&&(V=q.buffered().end(0)-this.timestampOffset),q.seeking()&&(V=Math.max(V,q.currentTime()-this.timestampOffset)),V*=1e3,V+=this.basePtsOffset_):V=this.videoBufferEnd_+.1;var z=X.length;if(z&&X[z-1].pts>=V){for(;--z;){var G=X[z];if(!(G.pts>V)&&(G.keyFrame||G.metaDataTag))break}for(;z&&X[z-1].metaDataTag;)z--}var F=X.slice(z),P=void 0;for(P=isNaN(this.audioBufferEnd_)?V:this.audioBufferEnd_+.1,F.length&&(P=Math.min(P,F[0].pts)),z=0;z<$.length&&!($[z].pts>=P);)z++;var x=$.slice(z);x.length&&(this.audioBufferEnd_=x[x.length-1].pts),F.length&&(this.videoBufferEnd_=F[F.length-1].pts);var D=this.getOrderedTags_(F,x);if(D.length!==0){if(D[0].pts<V&&q.seeking()){var R=q.currentTime(),j=(V-D[0].pts)/1e3,H=R-j;H<1/30&&(H=0);try{this.mediaSource_.swfObj.vjs_adjustCurrentTime(H)}catch(Z){}}for(var Y=0;Y<D.length;Y++)M+=D[Y].bytes.byteLength;W=new Uint8Array(M);for(var Y=0,K=0;Y<D.length;Y++)W.set(D[Y].bytes,K),K+=D[Y].bytes.byteLength;return W}}},{key:"getOrderedTags_",value:function(I,M){for(var q=void 0,V=[];I.length||M.length;)q=I.length?M.length&&M[0].dts<I[0].dts?M.shift():I.shift():M.shift(),V.push(q);return V}}]),L}(s.default.EventTarget);U.default=y,B.exports=U.default}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],69:[function(C,B,U){"use strict";function O(u){return u&&u.__esModule?u:{default:u}}function A(u,i){if(!(u instanceof i))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(U,"__esModule",{value:!0});var k=function(){function u(i,c){for(var t=0;t<c.length;t++){var e=c[t];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(i,e.key,e)}}return function(i,c,t){return c&&u(i.prototype,c),t&&u(i,t),i}}(),w=C(30),S=O(w),b=C(44),_=O(b),l=function(u){u.on("data",function(i){S.default.postMessage({action:"data",segment:i})}),u.on("done",function(i){S.default.postMessage({action:"done"})})},g=function(){function u(i){A(this,u),this.options=i||{},this.init()}return k(u,[{key:"init",value:function(){this.transmuxer&&this.transmuxer.dispose(),this.transmuxer=new _.default.Transmuxer(this.options),l(this.transmuxer)}},{key:"push",value:function(i){var c=new Uint8Array(i.data,i.byteOffset,i.byteLength);this.transmuxer.push(c)}},{key:"reset",value:function(){this.init()}},{key:"flush",value:function(){this.transmuxer.flush()}}]),u}(),s=function(u){u.onmessage=function(i){if(i.data.action==="init"&&i.data.options)return void(this.messageHandlers=new g(i.data.options));this.messageHandlers||(this.messageHandlers=new g),i.data&&i.data.action&&i.data.action!=="init"&&this.messageHandlers[i.data.action]&&this.messageHandlers[i.data.action](i.data)}};U.default=function(u){return new s(u)},B.exports=U.default},{}],70:[function(C,B,U){(function(O){"use strict";function A(a){return a&&a.__esModule?a:{default:a}}function k(a,m){if(!(a instanceof m))throw new TypeError("Cannot call a class as a function")}function w(a,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof m);a.prototype=Object.create(m&&m.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),m&&(Object.setPrototypeOf?Object.setPrototypeOf(a,m):a.__proto__=m)}Object.defineProperty(U,"__esModule",{value:!0});var S=function(){function a(m,h){for(var f=0;f<h.length;f++){var o=h[f];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(m,o.key,o)}}return function(m,h,f){return h&&a(m.prototype,h),f&&a(m,f),m}}(),b=function(a,m,h){for(var f=!0;f;){var o=a,v=m,T=h;f=!1,o===null&&(o=Function.prototype);var E=Object.getOwnPropertyDescriptor(o,v);if(E!==void 0){if("value"in E)return E.value;var y=E.get;return y===void 0?void 0:y.call(T)}var d=Object.getPrototypeOf(o);if(d===null)return;a=d,m=v,h=T,f=!0,E=d=void 0}},_=C(30),l=A(_),g=C(29),s=A(g),u=typeof window!="undefined"?window.videojs:O!==void 0?O.videojs:null,i=A(u),c=C(74),t=A(c),e=C(62),r=C(64),n=C(63),p=function(a){function m(){var h=this;k(this,m),b(Object.getPrototypeOf(m.prototype),"constructor",this).call(this);var f=void 0;this.nativeMediaSource_=new l.default.MediaSource;for(f in this.nativeMediaSource_)f in m.prototype||typeof this.nativeMediaSource_[f]!="function"||(this[f]=this.nativeMediaSource_[f].bind(this.nativeMediaSource_));this.duration_=NaN,Object.defineProperty(this,"duration",{get:function(){return this.duration_===Infinity?this.duration_:this.nativeMediaSource_.duration},set:function(o){if(this.duration_=o,o!==Infinity)return void(this.nativeMediaSource_.duration=o)}}),Object.defineProperty(this,"seekable",{get:function(){return this.duration_===Infinity?i.default.createTimeRanges([[0,this.nativeMediaSource_.duration]]):this.nativeMediaSource_.seekable}}),Object.defineProperty(this,"readyState",{get:function(){return this.nativeMediaSource_.readyState}}),Object.defineProperty(this,"activeSourceBuffers",{get:function(){return this.activeSourceBuffers_}}),this.sourceBuffers=[],this.activeSourceBuffers_=[],this.updateActiveSourceBuffers_=function(){if(h.activeSourceBuffers_.length=0,h.sourceBuffers.length===1){var o=h.sourceBuffers[0];return o.appendAudioInitSegment_=!0,o.audioDisabled_=!o.audioCodec_,void h.activeSourceBuffers_.push(o)}for(var v=!1,T=!0,E=0;E<h.player_.audioTracks().length;E++){var y=h.player_.audioTracks()[E];if(y.enabled&&y.kind!=="main"){v=!0,T=!1;break}}h.sourceBuffers.forEach(function(d){if(d.appendAudioInitSegment_=!0,d.videoCodec_&&d.audioCodec_)d.audioDisabled_=v;else if(d.videoCodec_&&!d.audioCodec_)d.audioDisabled_=!0,T=!1;else if(!d.videoCodec_&&d.audioCodec_&&(d.audioDisabled_=T,T))return;h.activeSourceBuffers_.push(d)})},this.onPlayerMediachange_=function(){h.sourceBuffers.forEach(function(o){o.appendAudioInitSegment_=!0})},["sourceopen","sourceclose","sourceended"].forEach(function(o){this.nativeMediaSource_.addEventListener(o,this.trigger.bind(this))},this),this.on("sourceopen",function(o){var v=s.default.querySelector('[src="'+h.url_+'"]');v&&(h.player_=(0,i.default)(v.parentNode),h.player_.audioTracks&&h.player_.audioTracks()&&(h.player_.audioTracks().on("change",h.updateActiveSourceBuffers_),h.player_.audioTracks().on("addtrack",h.updateActiveSourceBuffers_),h.player_.audioTracks().on("removetrack",h.updateActiveSourceBuffers_)),h.player_.on("mediachange",h.onPlayerMediachange_))}),this.on("sourceended",function(o){for(var v=(0,e.durationOfVideo)(h.duration),T=0;T<h.sourceBuffers.length;T++){var E=h.sourceBuffers[T],y=E.metadataTrack_&&E.metadataTrack_.cues;y&&y.length&&(y[y.length-1].endTime=v)}}),this.on("sourceclose",function(o){this.sourceBuffers.forEach(function(v){v.transmuxer_&&v.transmuxer_.terminate()}),this.sourceBuffers.length=0,this.player_&&((0,n.cleanupTextTracks)(this.player_),this.player_.audioTracks&&this.player_.audioTracks()&&(this.player_.audioTracks().off("change",this.updateActiveSourceBuffers_),this.player_.audioTracks().off("addtrack",this.updateActiveSourceBuffers_),this.player_.audioTracks().off("removetrack",this.updateActiveSourceBuffers_)),this.player_.el_&&this.player_.off("mediachange",this.onPlayerMediachange_))})}return w(m,a),S(m,[{key:"addSeekableRange_",value:function(h,f){var o=void 0;if(this.duration!==Infinity)throw o=new Error("MediaSource.addSeekableRange() can only be invoked when the duration is Infinity"),o.name="InvalidStateError",o.code=11,o;(f>this.nativeMediaSource_.duration||isNaN(this.nativeMediaSource_.duration))&&(this.nativeMediaSource_.duration=f)}},{key:"addSourceBuffer",value:function(h){var f=void 0,o=(0,r.parseContentType)(h);if(/^(video|audio)\/mp2t$/i.test(o.type)){var v=[];o.parameters&&o.parameters.codecs&&(v=o.parameters.codecs.split(","),v=(0,r.translateLegacyCodecs)(v),v=v.filter(function(T){return(0,r.isAudioCodec)(T)||(0,r.isVideoCodec)(T)})),v.length===0&&(v=["avc1.4d400d","mp4a.40.2"]),f=new t.default(this,v),this.sourceBuffers.length!==0&&(this.sourceBuffers[0].createRealSourceBuffers_(),f.createRealSourceBuffers_(),this.sourceBuffers[0].audioDisabled_=!0)}else f=this.nativeMediaSource_.addSourceBuffer(h);return this.sourceBuffers.push(f),f}}]),m}(i.default.EventTarget);U.default=p,B.exports=U.default}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],71:[function(C,B,U){"use strict";Object.defineProperty(U,"__esModule",{value:!0});var O=function(A,k,w){var S=void 0,b=void 0;if(w&&w.cues)for(S=w.cues.length;S--;)b=w.cues[S],b.startTime<=k&&b.endTime>=A&&w.removeCue(b)};U.default=O,B.exports=U.default},{}],72:[function(C,B,U){"use strict";function O(u){return u&&u.__esModule?u:{default:u}}function A(u,i){if(!(u instanceof i))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(U,"__esModule",{value:!0});var k=function(){function u(i,c){for(var t=0;t<c.length;t++){var e=c[t];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(i,e.key,e)}}return function(i,c,t){return c&&u(i.prototype,c),t&&u(i,t),i}}(),w=C(30),S=O(w),b=C(53),_=O(b),l=function(u){u.on("data",function(i){var c=i.initSegment;i.initSegment={data:c.buffer,byteOffset:c.byteOffset,byteLength:c.byteLength};var t=i.data;i.data=t.buffer,S.default.postMessage({action:"data",segment:i,byteOffset:t.byteOffset,byteLength:t.byteLength},[i.data])}),u.captionStream&&u.captionStream.on("data",function(i){S.default.postMessage({action:"caption",data:i})}),u.on("done",function(i){S.default.postMessage({action:"done"})})},g=function(){function u(i){A(this,u),this.options=i||{},this.init()}return k(u,[{key:"init",value:function(){this.transmuxer&&this.transmuxer.dispose(),this.transmuxer=new _.default.Transmuxer(this.options),l(this.transmuxer)}},{key:"push",value:function(i){var c=new Uint8Array(i.data,i.byteOffset,i.byteLength);this.transmuxer.push(c)}},{key:"reset",value:function(){this.init()}},{key:"setTimestampOffset",value:function(i){var c=i.timestampOffset||0;this.transmuxer.setBaseMediaDecodeTime(Math.round(9e4*c))}},{key:"setAudioAppendStart",value:function(i){this.transmuxer.setAudioAppendStart(Math.ceil(9e4*i.appendStart))}},{key:"flush",value:function(i){this.transmuxer.flush()}}]),u}(),s=function(u){u.onmessage=function(i){if(i.data.action==="init"&&i.data.options)return void(this.messageHandlers=new g(i.data.options));this.messageHandlers||(this.messageHandlers=new g),i.data&&i.data.action&&i.data.action!=="init"&&this.messageHandlers[i.data.action]&&this.messageHandlers[i.data.action](i.data)}};U.default=function(u){return new s(u)},B.exports=U.default},{}],73:[function(C,B,U){(function(O){"use strict";function A(n){return n&&n.__esModule?n:{default:n}}Object.defineProperty(U,"__esModule",{value:!0});var k=C(30),w=A(k),S=C(67),b=A(S),_=C(70),l=A(_),g=typeof window!="undefined"?window.videojs:O!==void 0?O.videojs:null,s=A(g),u=0,i={mode:"auto"};s.default.mediaSources={};var c=function(n,p){var a=s.default.mediaSources[n];if(!a)throw new Error("Media Source not found (Video.js)");a.trigger({type:"sourceopen",swfId:p})},t=function(){return!!w.default.MediaSource&&!!w.default.MediaSource.isTypeSupported&&w.default.MediaSource.isTypeSupported('video/mp4;codecs="avc1.4d400d,mp4a.40.2"')},e=function(n){var p=s.default.mergeOptions(i,n);if(this.MediaSource={open:c,supportsNativeMediaSources:t},p.mode==="html5"||p.mode==="auto"&&t())return new l.default;if(s.default.getTech("Flash"))return new b.default;throw new Error("Cannot use Flash or Html5 to create a MediaSource for this video")};U.MediaSource=e,e.open=c,e.supportsNativeMediaSources=t;var r={createObjectURL:function(n){var p=void 0;return n instanceof l.default?(p=w.default.URL.createObjectURL(n.nativeMediaSource_),n.url_=p,p):n instanceof b.default?(p="blob:vjs-media-source/"+u,u++,s.default.mediaSources[p]=n,p):(p=w.default.URL.createObjectURL(n),n.url_=p,p)}};U.URL=r,s.default.MediaSource=e,s.default.URL=r}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],74:[function(C,B,U){(function(O){"use strict";function A(h){return h&&h.__esModule?h:{default:h}}function k(h,f){if(!(h instanceof f))throw new TypeError("Cannot call a class as a function")}function w(h,f){if(typeof f!="function"&&f!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof f);h.prototype=Object.create(f&&f.prototype,{constructor:{value:h,enumerable:!1,writable:!0,configurable:!0}}),f&&(Object.setPrototypeOf?Object.setPrototypeOf(h,f):h.__proto__=f)}Object.defineProperty(U,"__esModule",{value:!0});var S=function(){function h(f,o){for(var v=0;v<o.length;v++){var T=o[v];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(f,T.key,T)}}return function(f,o,v){return o&&h(f.prototype,o),v&&h(f,v),f}}(),b=function(h,f,o){for(var v=!0;v;){var T=h,E=f,y=o;v=!1,T===null&&(T=Function.prototype);var d=Object.getOwnPropertyDescriptor(T,E);if(d!==void 0){if("value"in d)return d.value;var L=d.get;return L===void 0?void 0:L.call(y)}var I=Object.getPrototypeOf(T);if(I===null)return;h=I,f=E,o=y,v=!0,d=I=void 0}},_=typeof window!="undefined"?window.videojs:O!==void 0?O.videojs:null,l=A(_),g=C(65),s=A(g),u=C(71),i=A(u),c=C(62),t=C(75),e=A(t),r=C(72),n=A(r),p=C(64),a=function(h,f){var o=h.addSourceBuffer(f),v=Object.create(null);v.updating=!1,v.realBuffer_=o;for(var T in o)(function(E){typeof o[E]=="function"?v[E]=function(){return o[E].apply(o,arguments)}:typeof v[E]=="undefined"&&Object.defineProperty(v,E,{get:function(){return o[E]},set:function(y){return o[E]=y}})})(T);return v},m=function(h){function f(o,v){var T=this;k(this,f),b(Object.getPrototypeOf(f.prototype),"constructor",this).call(this,l.default.EventTarget),this.timestampOffset_=0,this.pendingBuffers_=[],this.bufferUpdating_=!1,this.mediaSource_=o,this.codecs_=v,this.audioCodec_=null,this.videoCodec_=null,this.audioDisabled_=!1,this.appendAudioInitSegment_=!0;var E={remux:!1};this.codecs_.forEach(function(y){(0,p.isAudioCodec)(y)?T.audioCodec_=y:(0,p.isVideoCodec)(y)&&(T.videoCodec_=y)}),this.transmuxer_=(0,e.default)(n.default),this.transmuxer_.postMessage({action:"init",options:E}),this.transmuxer_.onmessage=function(y){return y.data.action==="data"?T.data_(y):y.data.action==="done"?T.done_(y):void 0},Object.defineProperty(this,"timestampOffset",{get:function(){return this.timestampOffset_},set:function(y){typeof y=="number"&&y>=0&&(this.timestampOffset_=y,this.appendAudioInitSegment_=!0,this.transmuxer_.postMessage({action:"setTimestampOffset",timestampOffset:y}))}}),Object.defineProperty(this,"appendWindowStart",{get:function(){return(this.videoBuffer_||this.audioBuffer_).appendWindowStart},set:function(y){this.videoBuffer_&&(this.videoBuffer_.appendWindowStart=y),this.audioBuffer_&&(this.audioBuffer_.appendWindowStart=y)}}),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 y=null,d=null,L=0,I=[],M=[];if(!this.videoBuffer_&&!this.audioBuffer_)return l.default.createTimeRange();if(!this.videoBuffer_)return this.audioBuffer_.buffered;if(!this.audioBuffer_)return this.videoBuffer_.buffered;if(this.audioDisabled_)return this.videoBuffer_.buffered;if(this.videoBuffer_.buffered.length===0&&this.audioBuffer_.buffered.length===0)return l.default.createTimeRange();for(var q=this.videoBuffer_.buffered,V=this.audioBuffer_.buffered,W=q.length;W--;)I.push({time:q.start(W),type:"start"}),I.push({time:q.end(W),type:"end"});for(W=V.length;W--;)I.push({time:V.start(W),type:"start"}),I.push({time:V.end(W),type:"end"});for(I.sort(function(X,$){return X.time-$.time}),W=0;W<I.length;W++)I[W].type==="start"?++L==2&&(y=I[W].time):I[W].type==="end"&&--L==1&&(d=I[W].time),y!==null&&d!==null&&(M.push([y,d]),y=null,d=null);return l.default.createTimeRanges(M)}})}return w(f,h),S(f,[{key:"data_",value:function(o){var v=o.data.segment;v.data=new Uint8Array(v.data,o.data.byteOffset,o.data.byteLength),v.initSegment=new Uint8Array(v.initSegment.data,v.initSegment.byteOffset,v.initSegment.byteLength),(0,s.default)(this,this.mediaSource_,v),this.pendingBuffers_.push(v)}},{key:"done_",value:function(o){if(this.mediaSource_.readyState==="closed")return void(this.pendingBuffers_.length=0);this.processPendingSegments_()}},{key:"createRealSourceBuffers_",value:function(){var o=this,v=["audio","video"];v.forEach(function(T){if(o[T+"Codec_"]&&!o[T+"Buffer_"]){var E=null;if(o.mediaSource_[T+"Buffer_"])E=o.mediaSource_[T+"Buffer_"],E.updating=!1;else{var y=T+"Codec_",d=T+'/mp4;codecs="'+o[y]+'"';E=a(o.mediaSource_.nativeMediaSource_,d),o.mediaSource_[T+"Buffer_"]=E}o[T+"Buffer_"]=E,["update","updatestart","updateend"].forEach(function(L){E.addEventListener(L,function(){if(T!=="audio"||!o.audioDisabled_)return L==="updateend"&&(o[T+"Buffer_"].updating=!1),v.every(function(I){return!(I!=="audio"||!o.audioDisabled_)||T===I||!o[I+"Buffer_"]||!o[I+"Buffer_"].updating})?o.trigger(L):void 0})})}})}},{key:"appendBuffer",value:function(o){if(this.bufferUpdating_=!0,this.audioBuffer_&&this.audioBuffer_.buffered.length){var v=this.audioBuffer_.buffered;this.transmuxer_.postMessage({action:"setAudioAppendStart",appendStart:v.end(v.length-1)})}this.transmuxer_.postMessage({action:"push",data:o.buffer,byteOffset:o.byteOffset,byteLength:o.byteLength},[o.buffer]),this.transmuxer_.postMessage({action:"flush"})}},{key:"remove",value:function(o,v){this.videoBuffer_&&(this.videoBuffer_.updating=!0,this.videoBuffer_.remove(o,v)),!this.audioDisabled_&&this.audioBuffer_&&(this.audioBuffer_.updating=!0,this.audioBuffer_.remove(o,v)),(0,i.default)(o,v,this.metadataTrack_),(0,i.default)(o,v,this.inbandTextTrack_)}},{key:"processPendingSegments_",value:function(){var o={video:{segments:[],bytes:0},audio:{segments:[],bytes:0},captions:[],metadata:[]};o=this.pendingBuffers_.reduce(function(v,T){var E=T.type,y=T.data,d=T.initSegment;return v[E].segments.push(y),v[E].bytes+=y.byteLength,v[E].initSegment=d,T.captions&&(v.captions=v.captions.concat(T.captions)),T.info&&(v[E].info=T.info),T.metadata&&(v.metadata=v.metadata.concat(T.metadata)),v},o),this.videoBuffer_||this.audioBuffer_||(o.video.bytes===0&&(this.videoCodec_=null),o.audio.bytes===0&&(this.audioCodec_=null),this.createRealSourceBuffers_()),o.audio.info&&this.mediaSource_.trigger({type:"audioinfo",info:o.audio.info}),o.video.info&&this.mediaSource_.trigger({type:"videoinfo",info:o.video.info}),this.appendAudioInitSegment_&&(!this.audioDisabled_&&this.audioBuffer_&&(o.audio.segments.unshift(o.audio.initSegment),o.audio.bytes+=o.audio.initSegment.byteLength),this.appendAudioInitSegment_=!1),this.videoBuffer_&&(o.video.segments.unshift(o.video.initSegment),o.video.bytes+=o.video.initSegment.byteLength,this.concatAndAppendSegments_(o.video,this.videoBuffer_),(0,c.addTextTrackData)(this,o.captions,o.metadata)),!this.audioDisabled_&&this.audioBuffer_&&this.concatAndAppendSegments_(o.audio,this.audioBuffer_),this.pendingBuffers_.length=0,this.bufferUpdating_=!1}},{key:"concatAndAppendSegments_",value:function(o,v){var T=0,E=void 0;if(o.bytes){E=new Uint8Array(o.bytes),o.segments.forEach(function(y){E.set(y,T),T+=y.byteLength});try{v.updating=!0,v.appendBuffer(E)}catch(y){this.mediaSource_.player_&&this.mediaSource_.player_.error({code:-3,type:"APPEND_BUFFER_ERR",message:y.message,originalError:y})}}}},{key:"abort",value:function(){this.videoBuffer_&&this.videoBuffer_.abort(),!this.audioDisabled_&&this.audioBuffer_&&this.audioBuffer_.abort(),this.transmuxer_&&this.transmuxer_.postMessage({action:"reset"}),this.pendingBuffers_.length=0,this.bufferUpdating_=!1}}]),f}(l.default.EventTarget);U.default=m,B.exports=U.default}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],75:[function(C,B,U){var O=arguments[3],A=arguments[4],k=arguments[5],w=JSON.stringify;B.exports=function(S){for(var b,_=Object.keys(k),l=0,g=_.length;l<g;l++){var s=_[l];if(k[s].exports===S){b=s;break}}if(!b){b=Math.floor(Math.pow(16,8)*Math.random()).toString(16);for(var u={},l=0,g=_.length;l<g;l++){var s=_[l];u[s]=s}A[b]=[Function(["require","module","exports"],"("+S+")(self)"),u]}var i=Math.floor(Math.pow(16,8)*Math.random()).toString(16),c={};c[b]=b,A[i]=[Function(["require"],"require("+w(b)+")(self)"),c];var t="("+O+")({"+Object.keys(A).map(function(r){return w(r)+":["+A[r][0]+","+w(A[r][1])+"]"}).join(",")+"},{},["+w(i)+"])",e=window.URL||window.webkitURL||window.mozURL||window.msURL;return new Worker(e.createObjectURL(new Blob([t],{type:"text/javascript"})))}},{}],76:[function(C,B,U){(function(O){"use strict";function A(x){return x&&x.__esModule?x:{default:x}}function k(x,D){if(!(x instanceof D))throw new TypeError("Cannot call a class as a function")}function w(x,D){if(typeof D!="function"&&D!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof D);x.prototype=Object.create(D&&D.prototype,{constructor:{value:x,enumerable:!1,writable:!0,configurable:!0}}),D&&(Object.setPrototypeOf?Object.setPrototypeOf(x,D):x.__proto__=D)}var S=function(){function x(D,R){for(var j=0;j<R.length;j++){var H=R[j];H.enumerable=H.enumerable||!1,H.configurable=!0,"value"in H&&(H.writable=!0),Object.defineProperty(D,H.key,H)}}return function(D,R,j){return R&&x(D.prototype,R),j&&x(D,j),D}}(),b=function(x,D,R){for(var j=!0;j;){var H=x,Y=D,K=R;j=!1,H===null&&(H=Function.prototype);var Z=Object.getOwnPropertyDescriptor(H,Y);if(Z!==void 0){if("value"in Z)return Z.value;var ee=Z.get;return ee===void 0?void 0:ee.call(K)}var J=Object.getPrototypeOf(H);if(J===null)return;x=J,D=Y,R=K,j=!0,Z=J=void 0}},_=C(29),l=A(_),g=C(8),s=A(g),u=C(10),i=A(u),c=C(19),t=A(c),e=C(23),r=C(2),n=A(r),p=C(73),a=C(31),m=A(a),h=typeof window!="undefined"?window.videojs:O!==void 0?O.videojs:null,f=A(h),o=C(5),v=C(3),T=A(v),E=C(13),y=A(E),d=C(30),L=A(d),I=C(7),M=A(I),q=C(12),V=A(q),W=C(9),X={PlaylistLoader:s.default,Playlist:i.default,Decrypter:e.Decrypter,AsyncStream:e.AsyncStream,decrypt:e.decrypt,utils:n.default,STANDARD_PLAYLIST_SELECTOR:W.lastBandwidthSelector,comparePlaylistBandwidth:W.comparePlaylistBandwidth,comparePlaylistResolution:W.comparePlaylistResolution,xhr:(0,t.default)()};["GOAL_BUFFER_LENGTH","MAX_GOAL_BUFFER_LENGTH","GOAL_BUFFER_LENGTH_RATE","BUFFER_LOW_WATER_LINE","MAX_BUFFER_LOW_WATER_LINE","BUFFER_LOW_WATER_LINE_RATE","BANDWIDTH_VARIANCE"].forEach(function(x){Object.defineProperty(X,x,{get:function(){return f.default.log.warn("using Hls."+x+" is UNSAFE be sure you know what you are doing"),T.default[x]},set:function(D){if(f.default.log.warn("using Hls."+x+" is UNSAFE be sure you know what you are doing"),typeof D!="number"||D<0)return void f.default.log.warn("value of Hls."+x+" must be greater than or equal to 0");T.default[x]=D}})});var $=function(x,D){for(var R=D.media(),j=-1,H=0;H<x.length;H++)if(x[H].id===R.uri){j=H;break}x.selectedIndex_=j,x.trigger({selectedIndex:j,type:"change"})},Q=function(x,D){D.representations().forEach(function(R){x.addQualityLevel(R)}),$(x,D.playlists)};X.canPlaySource=function(){return f.default.log.warn("HLS is no longer a tech. Please remove it from your player's techOrder.")},X.supportsNativeHls=function(){var x=l.default.createElement("video");return!!f.default.getTech("Html5").isSupported()&&["application/vnd.apple.mpegurl","audio/mpegurl","audio/x-mpegurl","application/x-mpegurl","video/x-mpegurl","video/mpegurl","application/mpegurl"].some(function(D){return/maybe|probably/i.test(x.canPlayType(D))})}(),X.isSupported=function(){return f.default.log.warn("HLS is no longer a tech. Please remove it from your player's techOrder.")};var N=L.default.navigator&&L.default.navigator.userAgent||"";X.supportsAudioInfoChange_=function(){if(f.default.browser.IS_FIREFOX){var x=/Firefox\/([\d.]+)/i.exec(N);return parseInt(x[1],10)>=49}return!0};var z=f.default.getComponent("Component"),G=function(x){function D(R,j,H){var Y=this;if(k(this,D),b(Object.getPrototypeOf(D.prototype),"constructor",this).call(this,j,H.hls),j.options_&&j.options_.playerId){var K=(0,f.default)(j.options_.playerId);K.hasOwnProperty("hls")||Object.defineProperty(K,"hls",{get:function(){return f.default.log.warn("player.hls is deprecated. Use player.tech_.hls instead."),j.trigger({type:"usage",name:"hls-player-access"}),Y}})}if(this.tech_=j,this.source_=R,this.stats={},this.ignoreNextSeekingEvent_=!1,this.setOptions_(),this.options_.overrideNative&&(j.featuresNativeVideoTracks||j.featuresNativeAudioTracks))throw new Error("Overriding native HLS requires emulated tracks. See https://git.io/vMpjB");this.on(l.default,["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],function(Z){var ee=l.default.fullscreenElement||l.default.webkitFullscreenElement||l.default.mozFullScreenElement||l.default.msFullscreenElement;ee&&ee.contains(Y.tech_.el())&&Y.masterPlaylistController_.fastQualityChange_()}),this.on(this.tech_,"seeking",function(){if(this.ignoreNextSeekingEvent_)return void(this.ignoreNextSeekingEvent_=!1);this.setCurrentTime(this.tech_.currentTime())}),this.on(this.tech_,"error",function(){this.masterPlaylistController_&&this.masterPlaylistController_.pauseLoading()}),this.audioTrackChange_=function(){Y.masterPlaylistController_.setupAudio(),Y.tech_.trigger({type:"usage",name:"hls-audio-change"})},this.textTrackChange_=function(){Y.masterPlaylistController_.setupSubtitles()},this.on(this.tech_,"play",this.play)}return w(D,x),S(D,[{key:"setOptions_",value:function(){var R=this;this.options_.withCredentials=this.options_.withCredentials||!1,typeof this.options_.blacklistDuration!="number"&&(this.options_.blacklistDuration=300),typeof this.options_.bandwidth!="number"&&(this.options_.bandwidth=f.default.browser.IS_ANDROID?5e5:4194304),["withCredentials","bandwidth"].forEach(function(j){typeof R.source_[j]!="undefined"&&(R.options_[j]=R.source_[j])}),this.bandwidth=this.options_.bandwidth}},{key:"src",value:function(R){var j=this;R&&(this.setOptions_(),this.options_.url=this.source_.src,this.options_.tech=this.tech_,this.options_.externHls=X,this.masterPlaylistController_=new o.MasterPlaylistController(this.options_),this.playbackWatcher_=new M.default(f.default.mergeOptions(this.options_,{seekable:function(){return j.seekable()}})),this.masterPlaylistController_.on("error",function(){f.default.players[j.tech_.options_.playerId].error(j.masterPlaylistController_.error)}),this.masterPlaylistController_.selectPlaylist=this.selectPlaylist?this.selectPlaylist.bind(this):X.STANDARD_PLAYLIST_SELECTOR.bind(this),this.playlists=this.masterPlaylistController_.masterPlaylistLoader_,this.mediaSource=this.masterPlaylistController_.mediaSource,Object.defineProperties(this,{selectPlaylist:{get:function(){return this.masterPlaylistController_.selectPlaylist},set:function(H){this.masterPlaylistController_.selectPlaylist=H.bind(this)}},throughput:{get:function(){return this.masterPlaylistController_.mainSegmentLoader_.throughput.rate},set:function(H){this.masterPlaylistController_.mainSegmentLoader_.throughput.rate=H,this.masterPlaylistController_.mainSegmentLoader_.throughput.count=1}},bandwidth:{get:function(){return this.masterPlaylistController_.mainSegmentLoader_.bandwidth},set:function(H){this.masterPlaylistController_.mainSegmentLoader_.bandwidth=H,this.masterPlaylistController_.mainSegmentLoader_.throughput={rate:0,count:0}}},systemBandwidth:{get:function(){var H=1/(this.bandwidth||1),Y=void 0;return Y=this.throughput>0?1/this.throughput:0,Math.floor(1/(H+Y))},set:function(){f.default.log.error('The "systemBandwidth" property is read-only')}}}),Object.defineProperties(this.stats,{bandwidth:{get:function(){return j.bandwidth||0},enumerable:!0},mediaRequests:{get:function(){return j.masterPlaylistController_.mediaRequests_()||0},enumerable:!0},mediaRequestsAborted:{get:function(){return j.masterPlaylistController_.mediaRequestsAborted_()||0},enumerable:!0},mediaRequestsTimedout:{get:function(){return j.masterPlaylistController_.mediaRequestsTimedout_()||0},enumerable:!0},mediaRequestsErrored:{get:function(){return j.masterPlaylistController_.mediaRequestsErrored_()||0},enumerable:!0},mediaTransferDuration:{get:function(){return j.masterPlaylistController_.mediaTransferDuration_()||0},enumerable:!0},mediaBytesTransferred:{get:function(){return j.masterPlaylistController_.mediaBytesTransferred_()||0},enumerable:!0},mediaSecondsLoaded:{get:function(){return j.masterPlaylistController_.mediaSecondsLoaded_()||0},enumerable:!0}}),this.tech_.one("canplay",this.masterPlaylistController_.setupFirstPlay.bind(this.masterPlaylistController_)),this.masterPlaylistController_.on("sourceopen",function(){typeof j.tech_.audioTracks=="function"&&j.tech_.audioTracks().addEventListener("change",j.audioTrackChange_),j.tech_.remoteTextTracks().addEventListener("change",j.textTrackChange_)}),this.masterPlaylistController_.on("selectedinitialmedia",function(){(0,y.default)(j)}),this.masterPlaylistController_.on("audioupdate",function(){j.tech_.clearTracks("audio"),j.masterPlaylistController_.activeAudioGroup().forEach(function(H){j.tech_.audioTracks().addTrack(H)})}),this.on(this.masterPlaylistController_,"progress",function(){this.tech_.trigger("progress")}),this.on(this.masterPlaylistController_,"firstplay",function(){this.ignoreNextSeekingEvent_=!0}),this.tech_.ready(function(){return j.setupQualityLevels_()}),this.tech_.el()&&this.tech_.src(f.default.URL.createObjectURL(this.masterPlaylistController_.mediaSource)))}},{key:"setupQualityLevels_",value:function(){var R=this,j=f.default.players[this.tech_.options_.playerId];j&&j.qualityLevels&&(this.qualityLevels_=j.qualityLevels(),this.masterPlaylistController_.on("selectedinitialmedia",function(){Q(R.qualityLevels_,R)}),this.playlists.on("mediachange",function(){$(R.qualityLevels_,R.playlists)}))}},{key:"activeAudioGroup_",value:function(){return this.masterPlaylistController_.activeAudioGroup()}},{key:"play",value:function(){this.masterPlaylistController_.play()}},{key:"setCurrentTime",value:function(R){this.masterPlaylistController_.setCurrentTime(R)}},{key:"duration",value:function(){return this.masterPlaylistController_.duration()}},{key:"seekable",value:function(){return this.masterPlaylistController_.seekable()}},{key:"dispose",value:function(){this.playbackWatcher_&&this.playbackWatcher_.dispose(),this.masterPlaylistController_&&this.masterPlaylistController_.dispose(),this.qualityLevels_&&this.qualityLevels_.dispose(),typeof this.tech_.audioTracks=="function"&&this.tech_.audioTracks().removeEventListener("change",this.audioTrackChange_),this.tech_.remoteTextTracks().removeEventListener("change",this.textTrackChange_),b(Object.getPrototypeOf(D.prototype),"dispose",this).call(this)}}]),D}(z),F=function x(D){return{canHandleSource:function(R){var j=arguments.length<=1||arguments[1]===void 0?{}:arguments[1],H=f.default.mergeOptions(f.default.options,j);return(!H.hls||!H.hls.mode||H.hls.mode===D)&&x.canPlayType(R.type,H)},handleSource:function(R,j){var H=arguments.length<=2||arguments[2]===void 0?{}:arguments[2],Y=f.default.mergeOptions(f.default.options,H,{hls:{mode:D}});return D==="flash"&&j.setTimeout(function(){j.trigger("loadstart")},1),j.hls=new G(R,j,Y),j.hls.xhr=(0,t.default)(),j.hls.src(R.src),j.hls},canPlayType:function(R){var j=arguments.length<=1||arguments[1]===void 0?{}:arguments[1],H=f.default.mergeOptions(f.default.options,j);return x.canPlayType(R,H)?"maybe":""}}};F.canPlayType=function(x,D){if(f.default.browser.IE_VERSION&&f.default.browser.IE_VERSION<=10)return!1;var R=/^(audio|video|application)\/(x-|vnd\.apple\.)?mpegurl/i;return!(!D.hls.overrideNative&&X.supportsNativeHls)&&R.test(x)},typeof f.default.MediaSource!="undefined"&&typeof f.default.URL!="undefined"||(f.default.MediaSource=p.MediaSource,f.default.URL=p.URL);var P=f.default.getTech("Flash");p.MediaSource.supportsNativeMediaSources()&&f.default.getTech("Html5").registerSourceHandler(F("html5"),0),L.default.Uint8Array&&P&&P.registerSourceHandler(F("flash")),f.default.HlsHandler=G,f.default.HlsSourceHandler=F,f.default.Hls=X,f.default.use||f.default.registerComponent("Hls",X),f.default.m3u8=m.default,f.default.options.hls=f.default.options.hls||{},f.default.registerPlugin?f.default.registerPlugin("reloadSourceOnError",V.default):f.default.plugin("reloadSourceOnError",V.default),B.exports={Hls:X,HlsHandler:G,HlsSourceHandler:F}}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}]},{},[76]);