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

11 lines
190 KiB
JavaScript

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