(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=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=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;i1&&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()=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.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)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")),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&&(et.end(t.length-1)+.1)}},{key:"fellOutOfLiveWindow_",value:function(t,e){return!!(t.length&&t.start(0)>0&&e2)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=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)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;dE){var d=[E,T];T=d[0],E=d[1]}if(T<0){for(var L=T;L0){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;dDate.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=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=m};if(r)for(p=0;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"))}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.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||$0&&L.start(0)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=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=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:",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 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;mv){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>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>>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>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-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;_-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;t0&&(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;_-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;_>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>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>>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>>2;return n*=4,n+=3&r[7]}break}}u+=10,u+=i}while(u>5,s=1024*(1+(3&w[i+6])),u=9e4*s/k[(60&w[i+2])>>>2],l=i+b,w.byteLength>>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;r0)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>>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=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>>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>>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>>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>>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=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;n3&&(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>>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>>8),D.push(255&P[F].byteLength),D=D.concat(Array.prototype.slice.call(P[F]));for(F=0;F>>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>>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>>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;_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;v45e3))){for(M=p[d.samplerate],M||(M=L[0].data),q=0;q=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=-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=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.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=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=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>>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-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;n1){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=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=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].ptsthis.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=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=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]);