diff --git a/README.MD b/README.MD index 6af07ad1..6d8d7308 100644 --- a/README.MD +++ b/README.MD @@ -915,6 +915,8 @@ ffmpeg -ss 20 -t 10 -i ./res/xinxiaomen.mp4 \ | 更新日志 | 内容 | | ---- | ---- | +| 时间 | 2021/11/25 - 夜 | +| - | 0.修复 httpflv/ws直播 ignoreAudio配置失效问题 | | 时间 | 2021/11/23 - 夜 | | - | 0.修复 https://github.com/numberwolf/h265web.js/issues/90 | | 时间 | 2021/11/21 - 凌晨 | diff --git a/README_EN.MD b/README_EN.MD index b2b8ec24..0ff9a950 100644 --- a/README_EN.MD +++ b/README_EN.MD @@ -906,6 +906,8 @@ ffmpeg -ss 20 -t 10 -i ./res/xinxiaomen.mp4 \ | Update | Content | | ---- | ---- | +| Time | 2021/11/25 - Night | +| - | 0.Fixed httpflv/ws LIVE ignoreAudio problem | | Time | 2021/11/23 - Night | | - | 0.Fixed https://github.com/numberwolf/h265web.js/issues/90 | | Time | 2021/11/21 - In the small hours | diff --git a/dist/h265webjs-v20211123.js b/dist/h265webjs-v20211125.js similarity index 88% rename from dist/h265webjs-v20211123.js rename to dist/h265webjs-v20211125.js index e7403913..8dc7ed8a 100644 --- a/dist/h265webjs-v20211123.js +++ b/dist/h265webjs-v20211125.js @@ -165,4 +165,4 @@ var Xr=F.default,Qr=function(e,t,i){return e&&i&&i.responseURL&&t!==i.responseUR /*! @name aes-decrypter @version 3.1.2 @license Apache-2.0 */ var a=null,s=function(){function e(e){var t,i,n;a||(a=function(){var e,t,i,n,r,a,s,o,u=[[[],[],[],[],[]],[[],[],[],[],[]]],l=u[0],d=u[1],h=l[4],c=d[4],f=[],p=[];for(e=0;e<256;e++)p[(f[e]=e<<1^283*(e>>7))^e]=e;for(t=i=0;!h[t];t^=n||1,i=p[i]||1)for(a=(a=i^i<<1^i<<2^i<<3^i<<4)>>8^255&a^99,h[t]=a,c[a]=t,o=16843009*f[r=f[n=f[t]]]^65537*r^257*n^16843008*t,s=257*f[a]^16843008*a,e=0;e<4;e++)l[e][t]=s=s<<24^s>>>8,d[e][a]=o=o<<24^o>>>8;for(e=0;e<5;e++)l[e]=l[e].slice(0),d[e]=d[e].slice(0);return u}()),this._tables=[[a[0][0].slice(),a[0][1].slice(),a[0][2].slice(),a[0][3].slice(),a[0][4].slice()],[a[1][0].slice(),a[1][1].slice(),a[1][2].slice(),a[1][3].slice(),a[1][4].slice()]];var r=this._tables[0][4],s=this._tables[1],o=e.length,u=1;if(4!==o&&6!==o&&8!==o)throw new Error("Invalid aes key size");var l=e.slice(0),d=[];for(this._key=[l,d],t=o;t<4*o+28;t++)n=l[t-1],(t%o==0||8===o&&t%o==4)&&(n=r[n>>>24]<<24^r[n>>16&255]<<16^r[n>>8&255]<<8^r[255&n],t%o==0&&(n=n<<8^n>>>24^u<<24,u=u<<1^283*(u>>7))),l[t]=l[t-o]^n;for(i=0;t;i++,t--)n=l[3&i?t:t-4],d[i]=t<=4||i<4?n:s[0][r[n>>>24]]^s[1][r[n>>16&255]]^s[2][r[n>>8&255]]^s[3][r[255&n]]}return e.prototype.decrypt=function(e,t,i,n,r,a){var s,o,u,l,d=this._key[1],h=e^d[0],c=n^d[1],f=i^d[2],p=t^d[3],m=d.length/4-2,g=4,_=this._tables[1],y=_[0],v=_[1],b=_[2],T=_[3],S=_[4];for(l=0;l>>24]^v[c>>16&255]^b[f>>8&255]^T[255&p]^d[g],o=y[c>>>24]^v[f>>16&255]^b[p>>8&255]^T[255&h]^d[g+1],u=y[f>>>24]^v[p>>16&255]^b[h>>8&255]^T[255&c]^d[g+2],p=y[p>>>24]^v[h>>16&255]^b[c>>8&255]^T[255&f]^d[g+3],g+=4,h=s,c=o,f=u;for(l=0;l<4;l++)r[(3&-l)+a]=S[h>>>24]<<24^S[c>>16&255]<<16^S[f>>8&255]<<8^S[255&p]^d[g++],s=h,h=c,c=f,f=p,p=s},e}(),o=function(e){function t(){var t;return(t=e.call(this,r)||this).jobs=[],t.delay=1,t.timeout_=null,t}n(t,e);var i=t.prototype;return i.processJob_=function(){this.jobs.shift()(),this.jobs.length?this.timeout_=setTimeout(this.processJob_.bind(this),this.delay):this.timeout_=null},i.push=function(e){this.jobs.push(e),this.timeout_||(this.timeout_=setTimeout(this.processJob_.bind(this),this.delay))},t}(r),u=function(e){return e<<24|(65280&e)<<8|(16711680&e)>>8|e>>>24},l=function(){function e(t,i,n,r){var a=e.STEP,s=new Int32Array(t.buffer),l=new Uint8Array(t.byteLength),d=0;for(this.asyncStream_=new o,this.asyncStream_.push(this.decryptChunk_(s.subarray(d,d+a),i,n,l)),d=a;d>2),m=new s(Array.prototype.slice.call(t)),g=new Uint8Array(e.byteLength),_=new Int32Array(g.buffer);for(n=i[0],r=i[1],a=i[2],o=i[3],f=0;f=0&&(t="main-desc"),t},Io=function(e,t){e.abort(),e.pause(),t&&t.activePlaylistLoader&&(t.activePlaylistLoader.pause(),t.activePlaylistLoader=null)},Po=function(e,t){t.activePlaylistLoader=e,e.load()},Lo={AUDIO:function(e,t){return function(){var i=t.segmentLoaders[e],n=t.mediaTypes[e],r=t.blacklistCurrentPlaylist;Io(i,n);var a=n.activeTrack(),s=n.activeGroup(),o=(s.filter((function(e){return e.default}))[0]||s[0]).id,u=n.tracks[o];if(a!==u){for(var l in Yr.log.warn("Problem encountered loading the alternate audio track.Switching back to default."),n.tracks)n.tracks[l].enabled=n.tracks[l]===u;n.onTrackChanged()}else r({message:"Problem encountered loading the default audio track."})}},SUBTITLES:function(e,t){return function(){var i=t.segmentLoaders[e],n=t.mediaTypes[e];Yr.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track."),Io(i,n);var r=n.activeTrack();r&&(r.mode="disabled"),n.onTrackChanged()}}},Do={AUDIO:function(e,t,i){if(t){var n=i.tech,r=i.requestOptions,a=i.segmentLoaders[e];t.on("loadedmetadata",(function(){var e=t.media();a.playlist(e,r),(!n.paused()||e.endList&&"none"!==n.preload())&&a.load()})),t.on("loadedplaylist",(function(){a.playlist(t.media(),r),n.paused()||a.load()})),t.on("error",Lo[e](e,i))}},SUBTITLES:function(e,t,i){var n=i.tech,r=i.requestOptions,a=i.segmentLoaders[e],s=i.mediaTypes[e];t.on("loadedmetadata",(function(){var e=t.media();a.playlist(e,r),a.track(s.activeTrack()),(!n.paused()||e.endList&&"none"!==n.preload())&&a.load()})),t.on("loadedplaylist",(function(){a.playlist(t.media(),r),n.paused()||a.load()})),t.on("error",Lo[e](e,i))}},Uo={AUDIO:function(e,t){var i=t.vhs,n=t.sourceType,r=t.segmentLoaders[e],a=t.requestOptions,s=t.master.mediaGroups,o=t.mediaTypes[e],u=o.groups,l=o.tracks,d=o.logger_,h=t.masterPlaylistLoader,c=ba(h.master);for(var f in s[e]&&0!==Object.keys(s[e]).length||(s[e]={main:{default:{default:!0}}},c&&(s[e].main.default.playlists=h.master.playlists)),s[e])for(var p in u[f]||(u[f]=[]),s[e][f]){var m=s[e][f][p],g=void 0;if(c?(d("AUDIO group '"+f+"' label '"+p+"' is a master playlist"),m.isMasterPlaylist=!0,g=null):g="vhs-json"===n&&m.playlists?new Oa(m.playlists[0],i,a):m.resolvedUri?new Oa(m.resolvedUri,i,a):m.playlists&&"dash"===n?new is(m.playlists[0],i,a,h):null,m=Yr.mergeOptions({id:p,playlistLoader:g},m),Do[e](e,m.playlistLoader,t),u[f].push(m),void 0===l[p]){var _=new Yr.AudioTrack({id:p,kind:xo(m),enabled:!1,language:m.language,default:m.default,label:p});l[p]=_}}r.on("error",Lo[e](e,t))},SUBTITLES:function(e,t){var i=t.tech,n=t.vhs,r=t.sourceType,a=t.segmentLoaders[e],s=t.requestOptions,o=t.master.mediaGroups,u=t.mediaTypes[e],l=u.groups,d=u.tracks,h=t.masterPlaylistLoader;for(var c in o[e])for(var f in l[c]||(l[c]=[]),o[e][c])if(!o[e][c][f].forced){var p=o[e][c][f],m=void 0;if("hls"===r)m=new Oa(p.resolvedUri,n,s);else if("dash"===r){if(!p.playlists.filter((function(e){return e.excludeUntil!==1/0})).length)return;m=new is(p.playlists[0],n,s,h)}else"vhs-json"===r&&(m=new Oa(p.playlists?p.playlists[0]:p.resolvedUri,n,s));if(p=Yr.mergeOptions({id:f,playlistLoader:m},p),Do[e](e,p.playlistLoader,t),l[c].push(p),void 0===d[f]){var g=i.addRemoteTextTrack({id:f,kind:"subtitles",default:p.default&&p.autoselect,language:p.language,label:f},!1).track;d[f]=g}}a.on("error",Lo[e](e,t))},"CLOSED-CAPTIONS":function(e,t){var i=t.tech,n=t.master.mediaGroups,r=t.mediaTypes[e],a=r.groups,s=r.tracks;for(var o in n[e])for(var u in a[o]||(a[o]=[]),n[e][o]){var l=n[e][o][u];if(/^(?:CC|SERVICE)/.test(l.instreamId)){var d=i.options_.vhs&&i.options_.vhs.captionServices||{},h={label:u,language:l.language,instreamId:l.instreamId,default:l.default&&l.autoselect};if(d[h.instreamId]&&(h=Yr.mergeOptions(h,d[h.instreamId])),void 0===h.default&&delete h.default,a[o].push(Yr.mergeOptions({id:u},l)),void 0===s[u]){var c=i.addRemoteTextTrack({id:h.instreamId,kind:"captions",default:h.default,language:h.language,label:h.label},!1).track;s[u]=c}}}}},Ro=function e(t,i){for(var n=0;n1&&ba(t.master))for(var u=0;u "+a+" from "+t),this.tech_.trigger({type:"usage",name:"vhs-rendition-change-"+t})),this.masterPlaylistLoader_.media(e,i)},i.startABRTimer_=function(){var e=this;this.stopABRTimer_(),this.abrTimer_=A.default.setInterval((function(){return e.checkABR_()}),250)},i.stopABRTimer_=function(){this.tech_.scrubbing&&this.tech_.scrubbing()||(A.default.clearInterval(this.abrTimer_),this.abrTimer_=null)},i.getAudioTrackPlaylists_=function(){var e=this.master(),t=e&&e.playlists||[];if(!e||!e.mediaGroups||!e.mediaGroups.AUDIO)return t;var i,n=e.mediaGroups.AUDIO,r=Object.keys(n);if(Object.keys(this.mediaTypes_.AUDIO.groups).length)i=this.mediaTypes_.AUDIO.activeTrack();else{var a=n.main||r.length&&n[r[0]];for(var s in a)if(a[s].default){i={label:s};break}}if(!i)return t;var o=[];for(var u in n)if(n[u][i.label]){var l=n[u][i.label];if(l.playlists&&l.playlists.length)o.push.apply(o,l.playlists);else if(l.uri)o.push(l);else if(e.playlists.length)for(var d=0;d1&&(this.tech_.trigger({type:"usage",name:"vhs-alternate-audio"}),this.tech_.trigger({type:"usage",name:"hls-alternate-audio"})),this.useCueTags_&&(this.tech_.trigger({type:"usage",name:"vhs-playlist-cue-tags"}),this.tech_.trigger({type:"usage",name:"hls-playlist-cue-tags"}))},i.shouldSwitchToMedia_=function(e){var t=this.masterPlaylistLoader_.media(),i=this.tech_.buffered();return function(e){var t=e.currentPlaylist,i=e.nextPlaylist,n=e.forwardBuffer,r=e.bufferLowWaterLine,a=e.bufferHighWaterLine,s=e.duration,o=e.experimentalBufferBasedABR,u=e.log;if(!i)return Yr.log.warn("We received no playlist to switch to. Please check your stream."),!1;var l="allowing switch "+(t&&t.id||"null")+" -> "+i.id;if(!t)return u(l+" as current playlist is not set"),!0;if(i.id===t.id)return!1;if(!t.endList)return u(l+" as current playlist is live"),!0;var d=o?ns.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:ns.MAX_BUFFER_LOW_WATER_LINE;if(sc)&&n>=r){var p=l+" as forwardBuffer >= bufferLowWaterLine ("+n+" >= "+r+")";return o&&(p+=" and next bandwidth > current bandwidth ("+h+" > "+c+")"),u(p),!0}return u("not "+l+" as no switching criteria met"),!1}({currentPlaylist:t,nextPlaylist:e,forwardBuffer:i.length?i.end(i.length-1)-this.tech_.currentTime():0,bufferLowWaterLine:this.bufferLowWaterLine(),bufferHighWaterLine:this.bufferHighWaterLine(),duration:this.duration(),experimentalBufferBasedABR:this.experimentalBufferBasedABR,log:this.logger_})},i.setupSegmentLoaderListeners_=function(){var e=this;this.experimentalBufferBasedABR||(this.mainSegmentLoader_.on("bandwidthupdate",(function(){var t=e.selectPlaylist();e.shouldSwitchToMedia_(t)&&e.switchMedia_(t,"bandwidthupdate"),e.tech_.trigger("bandwidthupdate")})),this.mainSegmentLoader_.on("progress",(function(){e.trigger("progress")}))),this.mainSegmentLoader_.on("error",(function(){e.blacklistCurrentPlaylist(e.mainSegmentLoader_.error())})),this.mainSegmentLoader_.on("appenderror",(function(){e.error=e.mainSegmentLoader_.error_,e.trigger("error")})),this.mainSegmentLoader_.on("syncinfoupdate",(function(){e.onSyncInfoUpdate_()})),this.mainSegmentLoader_.on("timestampoffset",(function(){e.tech_.trigger({type:"usage",name:"vhs-timestamp-offset"}),e.tech_.trigger({type:"usage",name:"hls-timestamp-offset"})})),this.audioSegmentLoader_.on("syncinfoupdate",(function(){e.onSyncInfoUpdate_()})),this.audioSegmentLoader_.on("appenderror",(function(){e.error=e.audioSegmentLoader_.error_,e.trigger("error")})),this.mainSegmentLoader_.on("ended",(function(){e.logger_("main segment loader ended"),e.onEndOfStream()})),this.mainSegmentLoader_.on("earlyabort",(function(t){e.experimentalBufferBasedABR||(e.delegateLoaders_("all",["abort"]),e.blacklistCurrentPlaylist({message:"Aborted early because there isn't enough bandwidth to complete the request without rebuffering."},120))}));var t=function(){if(!e.sourceUpdater_.hasCreatedSourceBuffers())return e.tryToCreateSourceBuffers_();var t=e.getCodecsOrExclude_();t&&e.sourceUpdater_.addOrChangeSourceBuffers(t)};this.mainSegmentLoader_.on("trackinfo",t),this.audioSegmentLoader_.on("trackinfo",t),this.mainSegmentLoader_.on("fmp4",(function(){e.triggeredFmp4Usage||(e.tech_.trigger({type:"usage",name:"vhs-fmp4"}),e.tech_.trigger({type:"usage",name:"hls-fmp4"}),e.triggeredFmp4Usage=!0)})),this.audioSegmentLoader_.on("fmp4",(function(){e.triggeredFmp4Usage||(e.tech_.trigger({type:"usage",name:"vhs-fmp4"}),e.tech_.trigger({type:"usage",name:"hls-fmp4"}),e.triggeredFmp4Usage=!0)})),this.audioSegmentLoader_.on("ended",(function(){e.logger_("audioSegmentLoader ended"),e.onEndOfStream()}))},i.mediaSecondsLoaded_=function(){return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded+this.mainSegmentLoader_.mediaSecondsLoaded)},i.load=function(){this.mainSegmentLoader_.load(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.load(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.load()},i.smoothQualityChange_=function(e){void 0===e&&(e=this.selectPlaylist()),this.fastQualityChange_(e)},i.fastQualityChange_=function(e){var t=this;void 0===e&&(e=this.selectPlaylist()),e!==this.masterPlaylistLoader_.media()?(this.switchMedia_(e,"fast-quality"),this.mainSegmentLoader_.resetEverything((function(){Yr.browser.IE_VERSION||Yr.browser.IS_EDGE?t.tech_.setCurrentTime(t.tech_.currentTime()+.04):t.tech_.setCurrentTime(t.tech_.currentTime())}))):this.logger_("skipping fastQualityChange because new media is same as old")},i.play=function(){if(!this.setupFirstPlay()){this.tech_.ended()&&this.tech_.setCurrentTime(0),this.hasPlayed_&&this.load();var e=this.tech_.seekable();return this.tech_.duration()===1/0&&this.tech_.currentTime()this.maxPlaylistRetries?1/0:Date.now()+1e3*t,i.excludeUntil=n,e.reason&&(i.lastExcludeReason_=e.reason),this.tech_.trigger("blacklistplaylist"),this.tech_.trigger({type:"usage",name:"vhs-rendition-blacklisted"}),this.tech_.trigger({type:"usage",name:"hls-rendition-blacklisted"});var u=this.selectPlaylist();if(!u)return this.error="Playback cannot continue. No available working or supported playlists.",void this.trigger("error");var l=e.internal?this.logger_:Yr.log.warn,d=e.message?" "+e.message:"";l((e.internal?"Internal problem":"Problem")+" encountered with playlist "+i.id+"."+d+" Switching to playlist "+u.id+"."),u.attributes.AUDIO!==i.attributes.AUDIO&&this.delegateLoaders_("audio",["abort","pause"]),u.attributes.SUBTITLES!==i.attributes.SUBTITLES&&this.delegateLoaders_("subtitle",["abort","pause"]),this.delegateLoaders_("main",["abort","pause"]);var h=u.targetDuration/2*1e3||5e3,c="number"==typeof u.lastRequest&&Date.now()-u.lastRequest<=h;return this.switchMedia_(u,"exclude",s||c)},i.pauseLoading=function(){this.delegateLoaders_("all",["abort","pause"]),this.stopABRTimer_()},i.delegateLoaders_=function(e,t){var i=this,n=[],r="all"===e;(r||"main"===e)&&n.push(this.masterPlaylistLoader_);var a=[];(r||"audio"===e)&&a.push("AUDIO"),(r||"subtitle"===e)&&(a.push("CLOSED-CAPTIONS"),a.push("SUBTITLES")),a.forEach((function(e){var t=i.mediaTypes_[e]&&i.mediaTypes_[e].activePlaylistLoader;t&&n.push(t)})),["main","audio","subtitle"].forEach((function(t){var r=i[t+"SegmentLoader_"];!r||e!==t&&"all"!==e||n.push(r)})),n.forEach((function(e){return t.forEach((function(t){"function"==typeof e[t]&&e[t]()}))}))},i.setCurrentTime=function(e){var t=Zr(this.tech_.buffered(),e);return this.masterPlaylistLoader_&&this.masterPlaylistLoader_.media()&&this.masterPlaylistLoader_.media().segments?t&&t.length?e:(this.mainSegmentLoader_.resetEverything(),this.mainSegmentLoader_.abort(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.resetEverything(),this.audioSegmentLoader_.abort()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.resetEverything(),this.subtitleSegmentLoader_.abort()),void this.load()):0},i.duration=function(){if(!this.masterPlaylistLoader_)return 0;var e=this.masterPlaylistLoader_.media();return e?e.endList?this.mediaSource?this.mediaSource.duration:Zs.Playlist.duration(e):1/0:0},i.seekable=function(){return this.seekable_},i.onSyncInfoUpdate_=function(){var e;if(this.masterPlaylistLoader_){var t=this.masterPlaylistLoader_.media();if(t){var i=this.syncController_.getExpiredTime(t,this.duration());if(null!==i){var n=this.masterPlaylistLoader_.master,r=Zs.Playlist.seekable(t,i,Zs.Playlist.liveEdgeDelay(n,t));if(0!==r.length){if(this.mediaTypes_.AUDIO.activePlaylistLoader){if(t=this.mediaTypes_.AUDIO.activePlaylistLoader.media(),null===(i=this.syncController_.getExpiredTime(t,this.duration())))return;if(0===(e=Zs.Playlist.seekable(t,i,Zs.Playlist.liveEdgeDelay(n,t))).length)return}var a,s;this.seekable_&&this.seekable_.length&&(a=this.seekable_.end(0),s=this.seekable_.start(0)),e?e.start(0)>r.end(0)||r.start(0)>e.end(0)?this.seekable_=r:this.seekable_=Yr.createTimeRanges([[e.start(0)>r.start(0)?e.start(0):r.start(0),e.end(0)0&&(n=Math.max(n,i.end(i.length-1))),this.mediaSource.duration!==n&&this.sourceUpdater_.setDuration(n)}},i.dispose=function(){var e=this;this.trigger("dispose"),this.decrypter_.terminate(),this.masterPlaylistLoader_.dispose(),this.mainSegmentLoader_.dispose(),this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_),["AUDIO","SUBTITLES"].forEach((function(t){var i=e.mediaTypes_[t].groups;for(var n in i)i[n].forEach((function(e){e.playlistLoader&&e.playlistLoader.dispose()}))})),this.audioSegmentLoader_.dispose(),this.subtitleSegmentLoader_.dispose(),this.sourceUpdater_.dispose(),this.timelineChangeController_.dispose(),this.stopABRTimer_(),this.updateDuration_&&this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.mediaSource.removeEventListener("durationchange",this.handleDurationChange_),this.mediaSource.removeEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.removeEventListener("sourceended",this.handleSourceEnded_),this.off()},i.master=function(){return this.masterPlaylistLoader_.master},i.media=function(){return this.masterPlaylistLoader_.media()||this.initialMedia_},i.areMediaTypesKnown_=function(){var e=!!this.mediaTypes_.AUDIO.activePlaylistLoader,t=!!this.mainSegmentLoader_.getCurrentMediaInfo_(),i=!e||!!this.audioSegmentLoader_.getCurrentMediaInfo_();return!(!t||!i)},i.getCodecsOrExclude_=function(){var e=this,t={main:this.mainSegmentLoader_.getCurrentMediaInfo_()||{},audio:this.audioSegmentLoader_.getCurrentMediaInfo_()||{}};t.video=t.main;var i=Os(this.master(),this.media()),n={},r=!!this.mediaTypes_.AUDIO.activePlaylistLoader;if(t.main.hasVideo&&(n.video=i.video||t.main.videoCodec||g.DEFAULT_VIDEO_CODEC),t.main.isMuxed&&(n.video+=","+(i.audio||t.main.audioCodec||g.DEFAULT_AUDIO_CODEC)),(t.main.hasAudio&&!t.main.isMuxed||t.audio.hasAudio||r)&&(n.audio=i.audio||t.main.audioCodec||t.audio.audioCodec||g.DEFAULT_AUDIO_CODEC,t.audio.isFmp4=t.main.hasAudio&&!t.main.isMuxed?t.main.isFmp4:t.audio.isFmp4),n.audio||n.video){var a,s={};if(["video","audio"].forEach((function(e){if(n.hasOwnProperty(e)&&(r=t[e].isFmp4,o=n[e],!(r?g.browserSupportsCodec(o):g.muxerSupportsCodec(o)))){var i=t[e].isFmp4?"browser":"muxer";s[i]=s[i]||[],s[i].push(n[e]),"audio"===e&&(a=i)}var r,o})),r&&a&&this.media().attributes.AUDIO){var o=this.media().attributes.AUDIO;this.master().playlists.forEach((function(t){(t.attributes&&t.attributes.AUDIO)===o&&t!==e.media()&&(t.excludeUntil=1/0)})),this.logger_("excluding audio group "+o+" as "+a+' does not support codec(s): "'+n.audio+'"')}if(!Object.keys(s).length){if(this.sourceUpdater_.hasCreatedSourceBuffers()&&!this.sourceUpdater_.canChangeType()){var u=[];if(["video","audio"].forEach((function(t){var i=(g.parseCodecs(e.sourceUpdater_.codecs[t]||"")[0]||{}).type,r=(g.parseCodecs(n[t]||"")[0]||{}).type;i&&r&&i.toLowerCase()!==r.toLowerCase()&&u.push('"'+e.sourceUpdater_.codecs[t]+'" -> "'+n[t]+'"')})),u.length)return void this.blacklistCurrentPlaylist({playlist:this.media(),message:"Codec switching not supported: "+u.join(", ")+".",blacklistDuration:1/0,internal:!0})}return n}var l=Object.keys(s).reduce((function(e,t){return e&&(e+=", "),e+=t+' does not support codec(s): "'+s[t].join(",")+'"'}),"")+".";this.blacklistCurrentPlaylist({playlist:this.media(),internal:!0,message:l,blacklistDuration:1/0})}else this.blacklistCurrentPlaylist({playlist:this.media(),message:"Could not determine codecs for playlist.",blacklistDuration:1/0})},i.tryToCreateSourceBuffers_=function(){if("open"===this.mediaSource.readyState&&!this.sourceUpdater_.hasCreatedSourceBuffers()&&this.areMediaTypesKnown_()){var e=this.getCodecsOrExclude_();if(e){this.sourceUpdater_.createSourceBuffers(e);var t=[e.video,e.audio].filter(Boolean).join(",");this.excludeIncompatibleVariants_(t)}}},i.excludeUnsupportedVariants_=function(){var e=this,t=this.master().playlists,i=[];Object.keys(t).forEach((function(n){var r=t[n];if(-1===i.indexOf(r.id)){i.push(r.id);var a=Os(e.master,r),s=[];!a.audio||g.muxerSupportsCodec(a.audio)||g.browserSupportsCodec(a.audio)||s.push("audio codec "+a.audio),!a.video||g.muxerSupportsCodec(a.video)||g.browserSupportsCodec(a.video)||s.push("video codec "+a.video),a.text&&"stpp.ttml.im1t"===a.text&&s.push("text codec "+a.text),s.length&&(r.excludeUntil=1/0,e.logger_("excluding "+r.id+" for unsupported: "+s.join(", ")))}}))},i.excludeIncompatibleVariants_=function(e){var t=this,i=[],n=this.master().playlists,r=Us(g.parseCodecs(e)),a=Rs(r),s=r.video&&g.parseCodecs(r.video)[0]||null,o=r.audio&&g.parseCodecs(r.audio)[0]||null;Object.keys(n).forEach((function(e){var r=n[e];if(-1===i.indexOf(r.id)&&r.excludeUntil!==1/0){i.push(r.id);var u=[],l=Os(t.masterPlaylistLoader_.master,r),d=Rs(l);if(l.audio||l.video){if(d!==a&&u.push('codec count "'+d+'" !== "'+a+'"'),!t.sourceUpdater_.canChangeType()){var h=l.video&&g.parseCodecs(l.video)[0]||null,c=l.audio&&g.parseCodecs(l.audio)[0]||null;h&&s&&h.type.toLowerCase()!==s.type.toLowerCase()&&u.push('video codec "'+h.type+'" !== "'+s.type+'"'),c&&o&&c.type.toLowerCase()!==o.type.toLowerCase()&&u.push('audio codec "'+c.type+'" !== "'+o.type+'"')}u.length&&(r.excludeUntil=1/0,t.logger_("blacklisting "+r.id+": "+u.join(" && ")))}}}))},i.updateAdCues_=function(e){var t=0,i=this.seekable();i.length&&(t=i.start(0)),function(e,t,i){if(void 0===i&&(i=0),e.segments)for(var n,r=i,a=0;a0&&this.logger_("resetting possible stalled download count for "+e+" loader"),this[e+"StalledDownloads_"]=0,this[e+"Buffered_"]=t.buffered_()},t.checkSegmentDownloads_=function(e){var t=this.masterPlaylistController_,i=t[e+"SegmentLoader_"],n=i.buffered_(),r=function(e,t){if(e===t)return!1;if(!e&&t||!t&&e)return!0;if(e.length!==t.length)return!0;for(var i=0;i=t.end(t.length-1)))return this.techWaiting_();this.consecutiveUpdates>=5&&e===this.lastRecordedTime?(this.consecutiveUpdates++,this.waiting_()):e===this.lastRecordedTime?this.consecutiveUpdates++:(this.consecutiveUpdates=0,this.lastRecordedTime=e)}},t.cancelTimer_=function(){this.consecutiveUpdates=0,this.timer_&&(this.logger_("cancelTimer_"),clearTimeout(this.timer_)),this.timer_=null},t.fixesBadSeeks_=function(){if(!this.tech_.seeking())return!1;var e,t=this.seekable(),i=this.tech_.currentTime();this.afterSeekableWindow_(t,i,this.media(),this.allowSeeksWithinUnsafeLiveWindow)&&(e=t.end(t.length-1));if(this.beforeSeekableWindow_(t,i)){var n=t.start(0);e=n+(n===t.end(0)?0:.1)}if(void 0!==e)return this.logger_("Trying to seek outside of seekable at time "+i+" with seekable range "+ta(t)+". Seeking to "+e+"."),this.tech_.setCurrentTime(e),!0;var r=this.tech_.buffered();return!!function(e){var t=e.buffered,i=e.targetDuration,n=e.currentTime;return!!t.length&&(!(t.end(0)-t.start(0)<2*i)&&(!(n>t.start(0))&&t.start(0)-n "+i.end(0)+"]. Attempting to resume playback by seeking to the current time."),this.tech_.trigger({type:"usage",name:"vhs-unknown-waiting"}),void this.tech_.trigger({type:"usage",name:"hls-unknown-waiting"})):void 0}},t.techWaiting_=function(){var e=this.seekable(),t=this.tech_.currentTime();if(this.tech_.seeking()&&this.fixesBadSeeks_())return!0;if(this.tech_.seeking()||null!==this.timer_)return!0;if(this.beforeSeekableWindow_(e,t)){var i=e.end(e.length-1);return this.logger_("Fell out of live window at time "+t+". Seeking to live point (seekable end) "+i),this.cancelTimer_(),this.tech_.setCurrentTime(i),this.tech_.trigger({type:"usage",name:"vhs-live-resync"}),this.tech_.trigger({type:"usage",name:"hls-live-resync"}),!0}var n=this.tech_.vhs.masterPlaylistController_.sourceUpdater_,r=this.tech_.buffered();if(this.videoUnderflow_({audioBuffered:n.audioBuffered(),videoBuffered:n.videoBuffered(),currentTime:t}))return this.cancelTimer_(),this.tech_.setCurrentTime(t),this.tech_.trigger({type:"usage",name:"vhs-video-underflow"}),this.tech_.trigger({type:"usage",name:"hls-video-underflow"}),!0;var a=ea(r,t);if(a.length>0){var s=a.start(0)-t;return this.logger_("Stopped at "+t+", setting timer for "+s+", seeking to "+a.start(0)),this.cancelTimer_(),this.timer_=setTimeout(this.skipTheGap_.bind(this),1e3*s,t),!0}return!1},t.afterSeekableWindow_=function(e,t,i,n){if(void 0===n&&(n=!1),!e.length)return!1;var r=e.end(e.length-1)+.1;return!i.endList&&n&&(r=e.end(e.length-1)+3*i.targetDuration),t>r},t.beforeSeekableWindow_=function(e,t){return!!(e.length&&e.start(0)>0&&t2)return{start:r,end:a}}return null},e}(),zo={errorInterval:30,getSource:function(e){return e(this.tech({IWillNotUseThisInPlugins:!0}).currentSource_||this.currentSource())}},Go=function(e){!function e(t,i){var n=0,r=0,a=Yr.mergeOptions(zo,i);t.ready((function(){t.trigger({type:"usage",name:"vhs-error-reload-initialized"}),t.trigger({type:"usage",name:"hls-error-reload-initialized"})}));var s=function(){r&&t.currentTime(r)},o=function(e){null!=e&&(r=t.duration()!==1/0&&t.currentTime()||0,t.one("loadedmetadata",s),t.src(e),t.trigger({type:"usage",name:"vhs-error-reload"}),t.trigger({type:"usage",name:"hls-error-reload"}),t.play())},u=function(){return Date.now()-n<1e3*a.errorInterval?(t.trigger({type:"usage",name:"vhs-error-reload-canceled"}),void t.trigger({type:"usage",name:"hls-error-reload-canceled"})):a.getSource&&"function"==typeof a.getSource?(n=Date.now(),a.getSource.call(t,o)):void Yr.log.error("ERROR: reloadSourceOnError - The option getSource must be a function!")},l=function e(){t.off("loadedmetadata",s),t.off("error",u),t.off("dispose",e)};t.on("error",u),t.on("dispose",l),t.reloadSourceOnError=function(i){l(),e(t,i)}}(this,e)},Wo={PlaylistLoader:Oa,Playlist:Ta,utils:Ka,STANDARD_PLAYLIST_SELECTOR:Hs,INITIAL_PLAYLIST_SELECTOR:function(){var e=this,t=this.playlists.master.playlists.filter(Ta.isEnabled);return Ns(t,(function(e,t){return js(e,t)})),t.filter((function(t){return!!Os(e.playlists.master,t).video}))[0]||null},lastBandwidthSelector:Hs,movingAverageBandwidthSelector:function(e){var t=-1,i=-1;if(e<0||e>1)throw new Error("Moving average bandwidth decay must be between 0 and 1.");return function(){var n=this.useDevicePixelRatio&&A.default.devicePixelRatio||1;return t<0&&(t=this.systemBandwidth,i=this.systemBandwidth),this.systemBandwidth>0&&this.systemBandwidth!==i&&(t=e*this.systemBandwidth+(1-e)*t,i=this.systemBandwidth),Vs(this.playlists.master,t,parseInt(Bs(this.tech_.el(),"width"),10)*n,parseInt(Bs(this.tech_.el(),"height"),10)*n,this.limitRenditionByPlayerDimensions,this.masterPlaylistController_)}},comparePlaylistBandwidth:js,comparePlaylistResolution:function(e,t){var i,n;return e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width&&(i=e.attributes.RESOLUTION.width),i=i||A.default.Number.MAX_VALUE,t.attributes.RESOLUTION&&t.attributes.RESOLUTION.width&&(n=t.attributes.RESOLUTION.width),i===(n=n||A.default.Number.MAX_VALUE)&&e.attributes.BANDWIDTH&&t.attributes.BANDWIDTH?e.attributes.BANDWIDTH-t.attributes.BANDWIDTH:i-n},xhr:Na()};Object.keys(ns).forEach((function(e){Object.defineProperty(Wo,e,{get:function(){return Yr.log.warn("using Vhs."+e+" is UNSAFE be sure you know what you are doing"),ns[e]},set:function(t){Yr.log.warn("using Vhs."+e+" is UNSAFE be sure you know what you are doing"),"number"!=typeof t||t<0?Yr.log.warn("value of Vhs."+e+" must be greater than or equal to 0"):ns[e]=t}})}));var Yo=function(e,t){for(var i=t.media(),n=-1,r=0;r0?1/this.throughput:0,Math.floor(1/(t+e))},set:function(){Yr.log.error('The "systemBandwidth" property is read-only')}}}),this.options_.bandwidth&&(this.bandwidth=this.options_.bandwidth),this.options_.throughput&&(this.throughput=this.options_.throughput),Object.defineProperties(this.stats,{bandwidth:{get:function(){return i.bandwidth||0},enumerable:!0},mediaRequests:{get:function(){return i.masterPlaylistController_.mediaRequests_()||0},enumerable:!0},mediaRequestsAborted:{get:function(){return i.masterPlaylistController_.mediaRequestsAborted_()||0},enumerable:!0},mediaRequestsTimedout:{get:function(){return i.masterPlaylistController_.mediaRequestsTimedout_()||0},enumerable:!0},mediaRequestsErrored:{get:function(){return i.masterPlaylistController_.mediaRequestsErrored_()||0},enumerable:!0},mediaTransferDuration:{get:function(){return i.masterPlaylistController_.mediaTransferDuration_()||0},enumerable:!0},mediaBytesTransferred:{get:function(){return i.masterPlaylistController_.mediaBytesTransferred_()||0},enumerable:!0},mediaSecondsLoaded:{get:function(){return i.masterPlaylistController_.mediaSecondsLoaded_()||0},enumerable:!0},mediaAppends:{get:function(){return i.masterPlaylistController_.mediaAppends_()||0},enumerable:!0},mainAppendsToLoadedData:{get:function(){return i.masterPlaylistController_.mainAppendsToLoadedData_()||0},enumerable:!0},audioAppendsToLoadedData:{get:function(){return i.masterPlaylistController_.audioAppendsToLoadedData_()||0},enumerable:!0},appendsToLoadedData:{get:function(){return i.masterPlaylistController_.appendsToLoadedData_()||0},enumerable:!0},timeToLoadedData:{get:function(){return i.masterPlaylistController_.timeToLoadedData_()||0},enumerable:!0},buffered:{get:function(){return ia(i.tech_.buffered())},enumerable:!0},currentTime:{get:function(){return i.tech_.currentTime()},enumerable:!0},currentSource:{get:function(){return i.tech_.currentSource_},enumerable:!0},currentTech:{get:function(){return i.tech_.name_},enumerable:!0},duration:{get:function(){return i.tech_.duration()},enumerable:!0},master:{get:function(){return i.playlists.master},enumerable:!0},playerDimensions:{get:function(){return i.tech_.currentDimensions()},enumerable:!0},seekable:{get:function(){return ia(i.tech_.seekable())},enumerable:!0},timestamp:{get:function(){return Date.now()},enumerable:!0},videoPlaybackQuality:{get:function(){return i.tech_.getVideoPlaybackQuality()},enumerable:!0}}),this.tech_.one("canplay",this.masterPlaylistController_.setupFirstPlay.bind(this.masterPlaylistController_)),this.tech_.on("bandwidthupdate",(function(){i.options_.useBandwidthFromLocalStorage&&function(e){if(!A.default.localStorage)return!1;var t=Xo();t=t?Yr.mergeOptions(t,e):e;try{A.default.localStorage.setItem("videojs-vhs",JSON.stringify(t))}catch(e){return!1}}({bandwidth:i.bandwidth,throughput:Math.round(i.throughput)})})),this.masterPlaylistController_.on("selectedinitialmedia",(function(){var e;(e=i).representations=function(){var t=e.masterPlaylistController_.master(),i=ba(t)?e.masterPlaylistController_.getAudioTrackPlaylists_():t.playlists;return i?i.filter((function(e){return!pa(e)})).map((function(t,i){return new jo(e,t,t.id)})):[]}})),this.masterPlaylistController_.sourceUpdater_.on("createdsourcebuffers",(function(){i.setupEme_()})),this.on(this.masterPlaylistController_,"progress",(function(){this.tech_.trigger("progress")})),this.on(this.masterPlaylistController_,"firstplay",(function(){this.ignoreNextSeekingEvent_=!0})),this.setupQualityLevels_(),this.tech_.el()&&(this.mediaSourceUrl_=A.default.URL.createObjectURL(this.masterPlaylistController_.mediaSource),this.tech_.src(this.mediaSourceUrl_))}},i.setupEme_=function(){var e=this,t=this.masterPlaylistController_.mediaTypes_.AUDIO.activePlaylistLoader,i=Ko({player:this.player_,sourceKeySystems:this.source_.keySystems,media:this.playlists.media(),audioMedia:t&&t.media()});this.player_.tech_.on("keystatuschange",(function(t){"output-restricted"===t.status&&e.masterPlaylistController_.blacklistCurrentPlaylist({playlist:e.masterPlaylistController_.media(),message:"DRM keystatus changed to "+t.status+". Playlist will fail to play. Check for HDCP content.",blacklistDuration:1/0})})),11!==Yr.browser.IE_VERSION&&i?(this.logger_("waiting for EME key session creation"),qo({player:this.player_,sourceKeySystems:this.source_.keySystems,audioMedia:t&&t.media(),mainPlaylists:this.playlists.master.playlists}).then((function(){e.logger_("created EME key session"),e.masterPlaylistController_.sourceUpdater_.initializedEme()})).catch((function(t){e.logger_("error while creating EME key session",t),e.player_.error({message:"Failed to initialize media keys for EME",code:3})}))):this.masterPlaylistController_.sourceUpdater_.initializedEme()},i.setupQualityLevels_=function(){var e=this,t=Yr.players[this.tech_.options_.playerId];t&&t.qualityLevels&&!this.qualityLevels_&&(this.qualityLevels_=t.qualityLevels(),this.masterPlaylistController_.on("selectedinitialmedia",(function(){var t,i;t=e.qualityLevels_,(i=e).representations().forEach((function(e){t.addQualityLevel(e)})),Yo(t,i.playlists)})),this.playlists.on("mediachange",(function(){Yo(e.qualityLevels_,e.playlists)})))},t.version=function(){return{"@videojs/http-streaming":"2.10.2","mux.js":"5.13.0","mpd-parser":"0.19.0","m3u8-parser":"4.7.0","aes-decrypter":"3.1.2"}},i.version=function(){return this.constructor.version()},i.canChangeType=function(){return vo.canChangeType()},i.play=function(){this.masterPlaylistController_.play()},i.setCurrentTime=function(e){this.masterPlaylistController_.setCurrentTime(e)},i.duration=function(){return this.masterPlaylistController_.duration()},i.seekable=function(){return this.masterPlaylistController_.seekable()},i.dispose=function(){this.playbackWatcher_&&this.playbackWatcher_.dispose(),this.masterPlaylistController_&&this.masterPlaylistController_.dispose(),this.qualityLevels_&&this.qualityLevels_.dispose(),this.player_&&(delete this.player_.vhs,delete this.player_.dash,delete this.player_.hls),this.tech_&&this.tech_.vhs&&delete this.tech_.vhs,this.tech_&&delete this.tech_.hls,this.mediaSourceUrl_&&A.default.URL.revokeObjectURL&&(A.default.URL.revokeObjectURL(this.mediaSourceUrl_),this.mediaSourceUrl_=null),e.prototype.dispose.call(this)},i.convertToProgramTime=function(e,t){return Xa({playlist:this.masterPlaylistController_.media(),time:e,callback:t})},i.seekToProgramTime=function(e,t,i,n){return void 0===i&&(i=!0),void 0===n&&(n=2),Qa({programTime:e,playlist:this.masterPlaylistController_.media(),retryCount:n,pauseAfterSeek:i,seekTo:this.options_.seekTo,tech:this.options_.tech,callback:t})},t}(Yr.getComponent("Component")),$o={name:"videojs-http-streaming",VERSION:"2.10.2",canHandleSource:function(e,t){void 0===t&&(t={});var i=Yr.mergeOptions(Yr.options,t);return $o.canPlayType(e.type,i)},handleSource:function(e,t,i){void 0===i&&(i={});var n=Yr.mergeOptions(Yr.options,i);return t.vhs=new Qo(e,t,n),Yr.hasOwnProperty("hls")||Object.defineProperty(t,"hls",{get:function(){return Yr.log.warn("player.tech().hls is deprecated. Use player.tech().vhs instead."),t.vhs},configurable:!0}),t.vhs.xhr=Na(),t.vhs.src(e.src,e.type),t.vhs},canPlayType:function(e,t){void 0===t&&(t={});var i=Yr.mergeOptions(Yr.options,t).vhs.overrideNative,n=void 0===i?!Yr.browser.IS_ANY_SAFARI:i,r=_.simpleTypeFromSourceType(e);return r&&(!Wo.supportsTypeNatively(r)||n)?"maybe":""}};g.browserSupportsCodec("avc1.4d400d,mp4a.40.2")&&Yr.getTech("Html5").registerSourceHandler($o,0),Yr.VhsHandler=Qo,Object.defineProperty(Yr,"HlsHandler",{get:function(){return Yr.log.warn("videojs.HlsHandler is deprecated. Use videojs.VhsHandler instead."),Qo},configurable:!0}),Yr.VhsSourceHandler=$o,Object.defineProperty(Yr,"HlsSourceHandler",{get:function(){return Yr.log.warn("videojs.HlsSourceHandler is deprecated. Use videojs.VhsSourceHandler instead."),$o},configurable:!0}),Yr.Vhs=Wo,Object.defineProperty(Yr,"Hls",{get:function(){return Yr.log.warn("videojs.Hls is deprecated. Use videojs.Vhs instead."),Wo},configurable:!0}),Yr.use||(Yr.registerComponent("Hls",Wo),Yr.registerComponent("Vhs",Wo)),Yr.options.vhs=Yr.options.vhs||{},Yr.options.hls=Yr.options.hls||{},Yr.registerPlugin?Yr.registerPlugin("reloadSourceOnError",Go):Yr.plugin("reloadSourceOnError",Go),t.exports=Yr},{"@babel/runtime/helpers/assertThisInitialized":1,"@babel/runtime/helpers/construct":2,"@babel/runtime/helpers/extends":3,"@babel/runtime/helpers/inherits":4,"@babel/runtime/helpers/inheritsLoose":5,"@videojs/vhs-utils/cjs/byte-helpers":9,"@videojs/vhs-utils/cjs/codecs.js":11,"@videojs/vhs-utils/cjs/containers":12,"@videojs/vhs-utils/cjs/id3-helpers":15,"@videojs/vhs-utils/cjs/media-types.js":16,"@videojs/vhs-utils/cjs/resolve-url.js":20,"@videojs/xhr":23,"global/document":34,"global/window":35,keycode:38,"m3u8-parser":39,"mpd-parser":41,"mux.js/lib/tools/parse-sidx":42,"mux.js/lib/utils/clock":43,"safe-json-parse/tuple":45,"videojs-vtt.js":48}],48:[function(e,t,i){var n=e("global/window"),r=t.exports={WebVTT:e("./vtt.js"),VTTCue:e("./vttcue.js"),VTTRegion:e("./vttregion.js")};n.vttjs=r,n.WebVTT=r.WebVTT;var a=r.VTTCue,s=r.VTTRegion,o=n.VTTCue,u=n.VTTRegion;r.shim=function(){n.VTTCue=a,n.VTTRegion=s},r.restore=function(){n.VTTCue=o,n.VTTRegion=u},n.VTTCue||r.shim()},{"./vtt.js":49,"./vttcue.js":50,"./vttregion.js":51,"global/window":35}],49:[function(e,t,i){var n=e("global/document"),r=Object.create||function(){function e(){}return function(t){if(1!==arguments.length)throw new Error("Object.create shim only accepts one parameter.");return e.prototype=t,new e}}();function a(e,t){this.name="ParsingError",this.code=e.code,this.message=t||e.message}function s(e){function t(e,t,i,n){return 3600*(0|e)+60*(0|t)+(0|i)+(0|n)/1e3}var i=e.match(/^(\d+):(\d{1,2})(:\d{1,2})?\.(\d{3})/);return i?i[3]?t(i[1],i[2],i[3].replace(":",""),i[4]):i[1]>59?t(i[1],i[2],0,i[4]):t(0,i[1],i[2],i[4]):null}function o(){this.values=r(null)}function u(e,t,i,n){var r=n?e.split(n):[e];for(var a in r)if("string"==typeof r[a]){var s=r[a].split(i);if(2===s.length)t(s[0],s[1])}}function l(e,t,i){var n=e;function r(){var t=s(e);if(null===t)throw new a(a.Errors.BadTimeStamp,"Malformed timestamp: "+n);return e=e.replace(/^[^\sa-zA-Z-]+/,""),t}function l(){e=e.replace(/^\s+/,"")}if(l(),t.startTime=r(),l(),"--\x3e"!==e.substr(0,3))throw new a(a.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '--\x3e'): "+n);e=e.substr(3),l(),t.endTime=r(),l(),function(e,t){var n=new o;u(e,(function(e,t){switch(e){case"region":for(var r=i.length-1;r>=0;r--)if(i[r].id===t){n.set(e,i[r].region);break}break;case"vertical":n.alt(e,t,["rl","lr"]);break;case"line":var a=t.split(","),s=a[0];n.integer(e,s),n.percent(e,s)&&n.set("snapToLines",!1),n.alt(e,s,["auto"]),2===a.length&&n.alt("lineAlign",a[1],["start","center","end"]);break;case"position":a=t.split(","),n.percent(e,a[0]),2===a.length&&n.alt("positionAlign",a[1],["start","center","end"]);break;case"size":n.percent(e,t);break;case"align":n.alt(e,t,["start","center","end","left","right"])}}),/:/,/\s/),t.region=n.get("region",null),t.vertical=n.get("vertical","");try{t.line=n.get("line","auto")}catch(e){}t.lineAlign=n.get("lineAlign","start"),t.snapToLines=n.get("snapToLines",!0),t.size=n.get("size",100);try{t.align=n.get("align","center")}catch(e){t.align=n.get("align","middle")}try{t.position=n.get("position","auto")}catch(e){t.position=n.get("position",{start:0,left:0,center:50,middle:50,end:100,right:100},t.align)}t.positionAlign=n.get("positionAlign",{start:"start",left:"start",center:"center",middle:"center",end:"end",right:"end"},t.align)}(e,t)}a.prototype=r(Error.prototype),a.prototype.constructor=a,a.Errors={BadSignature:{code:0,message:"Malformed WebVTT signature."},BadTimeStamp:{code:1,message:"Malformed time stamp."}},o.prototype={set:function(e,t){this.get(e)||""===t||(this.values[e]=t)},get:function(e,t,i){return i?this.has(e)?this.values[e]:t[i]:this.has(e)?this.values[e]:t},has:function(e){return e in this.values},alt:function(e,t,i){for(var n=0;n=0&&t<=100)&&(this.set(e,t),!0)}};var d=n.createElement&&n.createElement("textarea"),h={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"},c={white:"rgba(255,255,255,1)",lime:"rgba(0,255,0,1)",cyan:"rgba(0,255,255,1)",red:"rgba(255,0,0,1)",yellow:"rgba(255,255,0,1)",magenta:"rgba(255,0,255,1)",blue:"rgba(0,0,255,1)",black:"rgba(0,0,0,1)"},f={v:"title",lang:"lang"},p={rt:"ruby"};function m(e,t){function i(){if(!t)return null;var e,i=t.match(/^([^<]*)(<[^>]*>?)?/);return e=i[1]?i[1]:i[2],t=t.substr(e.length),e}function n(e,t){return!p[t.localName]||p[t.localName]===e.localName}function r(t,i){var n=h[t];if(!n)return null;var r=e.document.createElement(n),a=f[t];return a&&i&&(r[a]=i.trim()),r}for(var a,o,u=e.document.createElement("div"),l=u,m=[];null!==(a=i());)if("<"!==a[0])l.appendChild(e.document.createTextNode((o=a,d.innerHTML=o,o=d.textContent,d.textContent="",o)));else{if("/"===a[1]){m.length&&m[m.length-1]===a.substr(2).replace(">","")&&(m.pop(),l=l.parentNode);continue}var g,_=s(a.substr(1,a.length-2));if(_){g=e.document.createProcessingInstruction("timestamp",_),l.appendChild(g);continue}var y=a.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!y)continue;if(!(g=r(y[1],y[3])))continue;if(!n(l,g))continue;if(y[2]){var v=y[2].split(".");v.forEach((function(e){var t=/^bg_/.test(e),i=t?e.slice(3):e;if(c.hasOwnProperty(i)){var n=t?"background-color":"color",r=c[i];g.style[n]=r}})),g.className=v.join(" ")}m.push(y[1]),l.appendChild(g),l=g}return u}var g=[[1470,1470],[1472,1472],[1475,1475],[1478,1478],[1488,1514],[1520,1524],[1544,1544],[1547,1547],[1549,1549],[1563,1563],[1566,1610],[1645,1647],[1649,1749],[1765,1766],[1774,1775],[1786,1805],[1807,1808],[1810,1839],[1869,1957],[1969,1969],[1984,2026],[2036,2037],[2042,2042],[2048,2069],[2074,2074],[2084,2084],[2088,2088],[2096,2110],[2112,2136],[2142,2142],[2208,2208],[2210,2220],[8207,8207],[64285,64285],[64287,64296],[64298,64310],[64312,64316],[64318,64318],[64320,64321],[64323,64324],[64326,64449],[64467,64829],[64848,64911],[64914,64967],[65008,65020],[65136,65140],[65142,65276],[67584,67589],[67592,67592],[67594,67637],[67639,67640],[67644,67644],[67647,67669],[67671,67679],[67840,67867],[67872,67897],[67903,67903],[67968,68023],[68030,68031],[68096,68096],[68112,68115],[68117,68119],[68121,68147],[68160,68167],[68176,68184],[68192,68223],[68352,68405],[68416,68437],[68440,68466],[68472,68479],[68608,68680],[126464,126467],[126469,126495],[126497,126498],[126500,126500],[126503,126503],[126505,126514],[126516,126519],[126521,126521],[126523,126523],[126530,126530],[126535,126535],[126537,126537],[126539,126539],[126541,126543],[126545,126546],[126548,126548],[126551,126551],[126553,126553],[126555,126555],[126557,126557],[126559,126559],[126561,126562],[126564,126564],[126567,126570],[126572,126578],[126580,126583],[126585,126588],[126590,126590],[126592,126601],[126603,126619],[126625,126627],[126629,126633],[126635,126651],[1114109,1114109]];function _(e){for(var t=0;t=i[0]&&e<=i[1])return!0}return!1}function y(e){var t=[],i="";if(!e||!e.childNodes)return"ltr";function n(e,t){for(var i=t.childNodes.length-1;i>=0;i--)e.push(t.childNodes[i])}function r(e){if(!e||!e.length)return null;var t=e.pop(),i=t.textContent||t.innerText;if(i){var a=i.match(/^.*(\n|\r)/);return a?(e.length=0,a[0]):i}return"ruby"===t.tagName?r(e):t.childNodes?(n(e,t),r(e)):void 0}for(n(t,e);i=r(t);)for(var a=0;a=0&&e.line<=100))return e.line;if(!e.track||!e.track.textTrackList||!e.track.textTrackList.mediaElement)return-1;for(var t=e.track,i=t.textTrackList,n=0,r=0;rh&&(d=d<0?-1:1,d*=Math.ceil(h/l)*l),s<0&&(d+=""===a.vertical?i.height:i.width,o=o.reverse()),r.move(c,d)}else{var f=r.lineHeight/i.height*100;switch(a.lineAlign){case"center":s-=f/2;break;case"end":s-=f}switch(a.vertical){case"":t.applyStyles({top:t.formatStyle(s,"%")});break;case"rl":t.applyStyles({left:t.formatStyle(s,"%")});break;case"lr":t.applyStyles({right:t.formatStyle(s,"%")})}o=["+y","-x","+x","-y"],r=new T(t)}var p=function(e,t){for(var r,a=new T(e),s=1,o=0;ou&&(r=new T(e),s=u),e=new T(a)}return r||a}(r,o);t.move(p.toCSSCompatValues(i))}function E(){}v.prototype.applyStyles=function(e,t){for(var i in t=t||this.div,e)e.hasOwnProperty(i)&&(t.style[i]=e[i])},v.prototype.formatStyle=function(e,t){return 0===e?0:e+t},b.prototype=r(v.prototype),b.prototype.constructor=b,T.prototype.move=function(e,t){switch(t=void 0!==t?t:this.lineHeight,e){case"+x":this.left+=t,this.right+=t;break;case"-x":this.left-=t,this.right-=t;break;case"+y":this.top+=t,this.bottom+=t;break;case"-y":this.top-=t,this.bottom-=t}},T.prototype.overlaps=function(e){return this.lefte.left&&this.tope.top},T.prototype.overlapsAny=function(e){for(var t=0;t=e.top&&this.bottom<=e.bottom&&this.left>=e.left&&this.right<=e.right},T.prototype.overlapsOppositeAxis=function(e,t){switch(t){case"+x":return this.lefte.right;case"+y":return this.tope.bottom}},T.prototype.intersectPercentage=function(e){return Math.max(0,Math.min(this.right,e.right)-Math.max(this.left,e.left))*Math.max(0,Math.min(this.bottom,e.bottom)-Math.max(this.top,e.top))/(this.height*this.width)},T.prototype.toCSSCompatValues=function(e){return{top:this.top-e.top,bottom:e.bottom-this.bottom,left:this.left-e.left,right:e.right-this.right,height:this.height,width:this.width}},T.getSimpleBoxPosition=function(e){var t=e.div?e.div.offsetHeight:e.tagName?e.offsetHeight:0,i=e.div?e.div.offsetWidth:e.tagName?e.offsetWidth:0,n=e.div?e.div.offsetTop:e.tagName?e.offsetTop:0;return{left:(e=e.div?e.div.getBoundingClientRect():e.tagName?e.getBoundingClientRect():e).left,right:e.right,top:e.top||n,height:e.height||t,bottom:e.bottom||n+(e.height||t),width:e.width||i}},E.StringDecoder=function(){return{decode:function(e){if(!e)return"";if("string"!=typeof e)throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(e))}}},E.convertCueToDOMTree=function(e,t){return e&&t?m(e,t):null};E.processCues=function(e,t,i){if(!e||!t||!i)return null;for(;i.firstChild;)i.removeChild(i.firstChild);var n=e.document.createElement("div");if(n.style.position="absolute",n.style.left="0",n.style.right="0",n.style.top="0",n.style.bottom="0",n.style.margin="1.5%",i.appendChild(n),function(e){for(var t=0;t100)throw new Error("Position must be between 0 and 100.");m=e,this.hasBeenReset=!0}},positionAlign:{enumerable:!0,get:function(){return g},set:function(e){var t=a(e);t&&(g=t,this.hasBeenReset=!0)}},size:{enumerable:!0,get:function(){return _},set:function(e){if(e<0||e>100)throw new Error("Size must be between 0 and 100.");_=e,this.hasBeenReset=!0}},align:{enumerable:!0,get:function(){return y},set:function(e){var t=a(e);if(!t)throw new SyntaxError("align: an invalid or illegal alignment string was specified.");y=t,this.hasBeenReset=!0}}}),this.displayState=void 0}s.prototype.getCueAsHTML=function(){return WebVTT.convertCueToDOMTree(window,this.text)},t.exports=s},{}],51:[function(e,t,i){var n={"":!0,up:!0};function r(e){return"number"==typeof e&&e>=0&&e<=100}t.exports=function(){var e=100,t=3,i=0,a=100,s=0,o=100,u="";Object.defineProperties(this,{width:{enumerable:!0,get:function(){return e},set:function(t){if(!r(t))throw new Error("Width must be between 0 and 100.");e=t}},lines:{enumerable:!0,get:function(){return t},set:function(e){if("number"!=typeof e)throw new TypeError("Lines must be set to a number.");t=e}},regionAnchorY:{enumerable:!0,get:function(){return a},set:function(e){if(!r(e))throw new Error("RegionAnchorX must be between 0 and 100.");a=e}},regionAnchorX:{enumerable:!0,get:function(){return i},set:function(e){if(!r(e))throw new Error("RegionAnchorY must be between 0 and 100.");i=e}},viewportAnchorY:{enumerable:!0,get:function(){return o},set:function(e){if(!r(e))throw new Error("ViewportAnchorY must be between 0 and 100.");o=e}},viewportAnchorX:{enumerable:!0,get:function(){return s},set:function(e){if(!r(e))throw new Error("ViewportAnchorX must be between 0 and 100.");s=e}},scroll:{enumerable:!0,get:function(){return u},set:function(e){var t=function(e){return"string"==typeof e&&(!!n[e.toLowerCase()]&&e.toLowerCase())}(e);!1===t||(u=t)}}})}},{}],52:[function(e,t,i){"use strict";t.exports={DEFAILT_WEBGL_PLAY_ID:"glplayer",PLAYER_IN_TYPE_MP4:"mp4",PLAYER_IN_TYPE_FLV:"flv",PLAYER_IN_TYPE_HTTPFLV:"httpflv",PLAYER_IN_TYPE_RAW_265:"raw265",PLAYER_IN_TYPE_TS:"ts",PLAYER_IN_TYPE_MPEGTS:"mpegts",PLAYER_IN_TYPE_M3U8:"hls",PLAYER_IN_TYPE_M3U8_VOD:"m3u8",PLAYER_IN_TYPE_M3U8_LIVE:"hls",APPEND_TYPE_STREAM:0,APPEND_TYPE_FRAME:1,APPEND_TYPE_SEQUENCE:2,DEFAULT_WIDTH:600,DEFAULT_HEIGHT:600,DEFAULT_FPS:30,DEFAULT_FRAME_DUR:40,DEFAULT_FIXED:!1,DEFAULT_SAMPLERATE:44100,DEFAULT_CHANNELS:2,DEFAULT_CONSU_SAMPLE_LEN:20,PLAYER_MODE_VOD:"vod",PLAYER_MODE_NOTIME_LIVE:"live",AUDIO_MODE_ONCE:"ONCE",AUDIO_MODE_SWAP:"SWAP",DEFAULT_STRING_LIVE:"LIVE",CODEC_H265:0,CODEC_H264:1,PLAYER_CORE_TYPE_DEFAULT:0,PLAYER_CORE_TYPE_CNATIVE:1,URI_PROTOCOL_WEBSOCKET:"ws",URI_PROTOCOL_WEBSOCKET_DESC:"websocket",URI_PROTOCOL_HTTP:"http",URI_PROTOCOL_HTTP_DESC:"http",FETCH_FIRST_MAX_TIMES:5,FETCH_HTTP_FLV_TIMEOUT_MS:7e3,V_CODEC_NAME_HEVC:265,V_CODEC_NAME_AVC:264,V_CODEC_NAME_UNKN:500,A_CODEC_NAME_AAC:112,A_CODEC_NAME_MP3:113,A_CODEC_NAME_UNKN:500,CACHE_NO_LOADCACHE:192,CACHE_WITH_PLAY_SIGN:193,CACHE_WITH_NOPLAY_SIGN:194}},{}],53:[function(e,t,i){"use strict";var n=window.AudioContext||window.webkitAudioContext,r=e("../consts"),a=e("./av-common");t.exports=function(e){var t={options:{sampleRate:e.sampleRate||r.DEFAULT_SAMPLERATE,appendType:e.appendType||r.APPEND_TYPE_STREAM,playMode:e.playMode||r.AUDIO_MODE_SWAP},sourceChannel:-1,audioCtx:new n({latencyHint:"interactive",sampleRate:e.sampleRate}),gainNode:null,sourceList:[],startStatus:!1,sampleQueue:[],nextBuffer:null,playTimestamp:0,playStartTime:0,durationMs:-1,isLIVE:!1,voice:1,onLoadCache:null,resetStartParam:function(){t.playTimestamp=0,t.playStartTime=0},setOnLoadCache:function(e){t.onLoadCache=e},setDurationMs:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1;t.durationMs=e},setVoice:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;t.voice=e,t.gainNode.gain.value=e},getAlignVPTS:function(){return t.playTimestamp+(a.GetMsTime()-t.playStartTime)/1e3},swapSource:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;if(0==t.startStatus)return null;if(e<0||e>=t.sourceList.length)return null;if(i<0||i>=t.sourceList.length)return null;try{t.sourceChannel===e&&null!==t.sourceList[e]&&(t.sourceList[e].disconnect(t.gainNode),t.sourceList[e]=null)}catch(t){console.error("[DEFINE ERROR] audioModule disconnect source Index:"+e+" error happened!",t)}t.sourceChannel=i;var n=t.decodeSample(i,e);-2==n&&t.isLIVE&&(t.getAlignVPTS()>=t.durationMs/1e3-.04?t.pause():null!==t.onLoadCache&&t.onLoadCache())},addSample:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return!(null==e||!e||null==e)&&(0==t.sampleQueue.length&&(t.seekPos=e.pts),t.sampleQueue.push(e),!0)},runNextBuffer:function(){window.setInterval((function(){if(!(null!=t.nextBuffer||t.sampleQueue.length0&&void 0!==arguments[0]?arguments[0]:-1,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;if(e<0||e>=t.sourceList.length)return-1;if(null!=t.sourceList[e]&&null!=t.sourceList[e]&&t.sourceList[e]||(t.sourceList[e]=t.audioCtx.createBufferSource(),t.sourceList[e].onended=function(){t.swapSource(e,i)}),0==t.sampleQueue.length)return t.isLIVE?(t.sourceList[e].connect(t.gainNode),t.sourceList[e].start(),t.sourceList[e].onended=function(){t.swapSource(e,i)},t.sourceList[e].stop(),0):-2;if(t.sourceList[e].buffer)return t.sourceList[e],t.sourceList[i],t.gainNode,t.swapSource(e,i),0;if(null==t.nextBuffer||t.nextBuffer.data.length<1)return t.sourceList[e].connect(t.gainNode),t.sourceList[e].start(),t.sourceList[e].startState=!0,t.sourceList[e].stop(),1;var n=t.nextBuffer.data.buffer;t.playTimestamp=t.nextBuffer.pts,t.playStartTime=a.GetMsTime();try{t.audioCtx.decodeAudioData(n,(function(i){null!==t.sourceList[e]&&(t.sourceList[e].buffer=i,t.sourceList[e].connect(t.gainNode),t.sourceList[e].start(),t.sourceList[e].startState=!0)}),(function(e){}))}catch(e){return t.nextBuffer=null,-3}return t.nextBuffer=null,0},decodeWholeSamples:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1;if(t.sourceChannel=e,e<0||e>=t.sourceList.length)return-1;if(null!=t.sourceList[e]&&null!=t.sourceList[e]&&t.sourceList[e]||(t.sourceList[e]=t.audioCtx.createBufferSource(),t.sourceList[e].onended=function(){}),0==t.sampleQueue.length)return-2;for(var i=null,n=null,a=0;a=2){var s=i.length/2;a=new Float32Array(s);for(var o=0,u=0;u0&&s()-this._start_time>=this._now_seg_dur&&(s(),this._start_time,this._now_seg_dur,this._start_time=-1,this._now_seg_dur=-1),s(),this._start_time<0)if(new Date,null!==this._pcm_array_buf&&this._pcm_array_buf.length>this._push_start_idx){this._swapStartPlay=!1;var e=this._push_start_idx+this._once_pop_len;e>this._pcm_array_buf.length&&(e=this._pcm_array_buf.length);var t=this._pcm_array_buf.slice(this._push_start_idx,e);this._push_start_idx+=t.length,this._now_seg_dur=1*t.length/this._sample_rate*1e3,t.length,this._sample_rate,this._now_seg_dur;var i=this._ctx.createBuffer(1,t.length,this._sample_rate);t.length,new Date,i.copyToChannel(t,0),this._active_node=this._ctx.createBufferSource(),this._active_node.buffer=i,this._active_node.connect(this._gain),this._start_time=s(),this._active_node.start(0)}else setTimeout(this.readingLoopWithF32,1)}}])&&n(t.prototype,i),o&&n(t,o),e}();i.AudioPcmPlayer=o},{"../consts":52}],55:[function(e,t,i){"use strict";var n=e("../consts"),r=[{format:"mp4",value:"mp4",core:n.PLAYER_CORE_TYPE_CNATIVE},{format:"mov",value:"mp4",core:n.PLAYER_CORE_TYPE_CNATIVE},{format:"flv",value:"flv",core:n.PLAYER_CORE_TYPE_CNATIVE},{format:"m3u8",value:"hls",core:n.PLAYER_CORE_TYPE_DEFAULT},{format:"m3u",value:"hls",core:n.PLAYER_CORE_TYPE_DEFAULT},{format:"ts",value:"ts",core:n.PLAYER_CORE_TYPE_DEFAULT},{format:"mpegts",value:"ts",core:n.PLAYER_CORE_TYPE_DEFAULT},{format:"hevc",value:"raw265",core:n.PLAYER_CORE_TYPE_DEFAULT},{format:"h265",value:"raw265",core:n.PLAYER_CORE_TYPE_DEFAULT}],a=[{format:n.URI_PROTOCOL_HTTP,value:n.URI_PROTOCOL_HTTP_DESC},{format:n.URI_PROTOCOL_WEBSOCKET,value:n.URI_PROTOCOL_WEBSOCKET_DESC}];t.exports={frameDataAlignCrop:function(e,t,i,n,r,a,s,o){if(0==e-n)return[a,s,o];for(var u=n*r,l=u/4,d=new Uint8Array(u),h=new Uint8Array(l),c=new Uint8Array(l),f=n,p=n/2,m=0;m=0)return i.value}return r[0].value},GetFormatPlayCore:function(e){for(var t=0;t=0)return i.value}return a[0].value},GetMsTime:function(){return(new Date).getTime()}}},{"../consts":52}],56:[function(e,t,i){"use strict";function n(e,t){for(var i=0;i0&&(t.getPackageTimeMS=a.GetMsTime()),t.pushPkg++,void 0!==t.AVGetInterval&&null!==t.AVGetInterval||(t.AVGetInterval=window.setInterval((function(){Module.cwrap("getBufferLengthApi","number",["number"])(t.AVSniffPtr)>t.config.probeSize?(Module.cwrap("getSniffHttpFlvPkg","number",["number"])(t.AVSniffPtr),t.pushPkg-=1):t.getPackageTimeMS>0&&a.GetMsTime()-t.getPackageTimeMS>=o.FETCH_HTTP_FLV_TIMEOUT_MS&&(t.getPackageTimeMS=a.GetMsTime(),t.workerFetch.postMessage({cmd:"retry",data:null,msg:"retry"}))}),5));break;case"close":t.AVGetInterval&&clearInterval(t.AVGetInterval),t.AVGetInterval=null;case"fetch-fin":break;case"fetch-error":t.onNetworkError&&t.onNetworkError(i.data)}}},{key:"_checkDisplaySize",value:function(e,t,i){var n=t-e,r=this.config.width+Math.ceil(n/2),a=t/this.config.width>i/this.config.height,s=(r/t).toFixed(2),o=(this.config.height/i).toFixed(2),u=a?s:o,l=this.config.fixed,d=l?r:parseInt(t*u),h=l?this.config.height:parseInt(i*u);if(this.CanvasObj.offsetWidth!=d||this.CanvasObj.offsetHeight!=h){var c=parseInt((this.canvasBox.offsetHeight-h)/2),f=parseInt((this.canvasBox.offsetWidth-d)/2);c=c<0?0:c,f=f<0?0:f,this.CanvasObj.style.marginTop=c+"px",this.CanvasObj.style.marginLeft=f+"px",this.CanvasObj.style.width=d+"px",this.CanvasObj.style.height=h+"px"}return this.isCheckDisplay=!0,[d,h]}},{key:"_ptsFixed2",value:function(e){return Math.ceil(100*e)/100}},{key:"_callbackProbe",value:function(e,t,i,n,r,a,u,l,d){for(var h=Module.HEAPU8.subarray(d,d+10),c=0;c100&&(f=o.DEFAULT_FPS,this.mediaInfo.noFPS=!0),this.vCodecID=l,this.config.fps=f,this.mediaInfo.fps=f,this.mediaInfo.size.width=t,this.mediaInfo.size.height=i,this.frameTime=Math.floor(1e3/(this.mediaInfo.fps+2)),this.CanvasObj.width==t&&this.CanvasObj.height==i||(this.CanvasObj.width=t,this.CanvasObj.height=i,this.isCheckDisplay)||this._checkDisplaySize(t,t,i),r>=0&&!1===this.mediaInfo.noFPS?(void 0!==this.audioWAudio&&null!==this.audioWAudio&&(this.audioWAudio.stop(),this.audioWAudio=null),this.config.sampleRate=a,this.mediaInfo.sampleRate=a,this.audioWAudio=s({sampleRate:this.mediaInfo.sampleRate,appendType:o.APPEND_TYPE_FRAME}),this.audioWAudio.isLIVE=!0):this.mediaInfo.audioNone=!0,this.onProbeFinish&&this.onProbeFinish()}},{key:"_callbackYUV",value:function(e,t,i,n,r,a,s,o,u){var l=Module.HEAPU8.subarray(e,e+n*o),d=new Uint8Array(l),h=Module.HEAPU8.subarray(t,t+r*o/2),c=new Uint8Array(h),f=Module.HEAPU8.subarray(i,i+a*o/2),p={bufY:d,bufU:c,bufV:new Uint8Array(f),line_y:n,h:o,pts:u};this.YuvBuf.push(p),this.checkCacheState(),Module._free(l),l=null,Module._free(h),h=null,Module._free(f),f=null,!1===this.readyShowDone&&(this.playYUV(),this.readyShowDone=!0,this.onReadyShowDone&&this.onReadyShowDone(),this.audioWAudio||this.play())}},{key:"_callbackNALU",value:function(e,t,i,n,r,a,s){if(!1===this.readyKeyFrame){if(i<=0)return;this.readyKeyFrame=!0}var o=Module.HEAPU8.subarray(e,e+t),u=new Uint8Array(o);this.NaluBuf.push({bufData:u,len:t,isKey:i,w:n,h:r,pts:1e3*a,dts:1e3*s}),Module._free(o),o=null}},{key:"_callbackPCM",value:function(e){}},{key:"_callbackAAC",value:function(e,t,i,n,r){var a=this._ptsFixed2(r);if(this.audioWAudio){var s=new Uint8Array(7+i),o=Module.HEAPU8.subarray(e,e+7);s.set(o,0);var u=Module.HEAPU8.subarray(t,t+i);s.set(u,7);var l={pts:a,data:s};this.audioWAudio.addSample(l),this.checkCacheState()}}},{key:"_decode",value:function(){var e=this;setTimeout((function(){if(null!==e.workerFetch){var t=e.NaluBuf.shift();if(null!=t){var i=Module._malloc(t.bufData.length);Module.HEAP8.set(t.bufData,i),Module.cwrap("decodeHttpFlvVideoFrame","number",["number","number","number","number","number"])(e.AVSniffPtr,i,t.bufData.length,t.pts,t.dts,0),Module._free(i),i=null}e._decode()}}),1)}},{key:"checkCacheState",value:function(){var e=this.YuvBuf.length>=25&&(!0===this.mediaInfo.audioNone||this.audioWAudio&&this.audioWAudio.sampleQueue.length>=50);return!1===this.cache_status&&e&&(this.playInterval&&this.audioWAudio&&this.audioWAudio.play(),this.onLoadCacheFinshed&&this.onLoadCacheFinshed(),this.cache_status=!0),e}},{key:"setVoice",value:function(e){this.audioVoice=e,this.audioWAudio&&this.audioWAudio.setVoice(e)}},{key:"_removeBindFuncPtr",value:function(){null!==this._ptr_probeCallback&&Module.removeFunction(this._ptr_probeCallback),null!==this._ptr_frameCallback&&Module.removeFunction(this._ptr_frameCallback),null!==this._ptr_naluCallback&&Module.removeFunction(this._ptr_naluCallback),null!==this._ptr_sampleCallback&&Module.removeFunction(this._ptr_sampleCallback),null!==this._ptr_aacCallback&&Module.removeFunction(this._ptr_aacCallback),this._ptr_probeCallback=null,this._ptr_frameCallback=null,this._ptr_naluCallback=null,this._ptr_sampleCallback=null,this._ptr_aacCallback=null}},{key:"release",value:function(){return this.pause(),this.NaluBuf.length=0,this.YuvBuf.length=0,void 0!==this.workerFetch&&null!==this.workerFetch&&this.workerFetch.postMessage({cmd:"stop",data:"stop",msg:"stop"}),this.workerFetch=null,this.AVGetInterval&&clearInterval(this.AVGetInterval),this.AVGetInterval=null,this._removeBindFuncPtr(),Module.cwrap("releaseHttpFLV","number",["number"])(this.AVSniffPtr),this.playInterval&&clearInterval(this.playInterval),this.playInterval=null,this.audioWAudio&&this.audioWAudio.stop(),this.audioWAudio=null,this.CanvasObj&&this.CanvasObj.remove(),this.CanvasObj=null,0}},{key:"isPlayingState",value:function(){return null!==this.playInterval&&void 0!==this.playInterval}},{key:"pause",value:function(){this.audioWAudio&&this.audioWAudio.pause(),this.playInterval&&clearInterval(this.playInterval),this.playInterval=null}},{key:"playYUV",value:function(){if(this.YuvBuf.length>0){var e=this.YuvBuf.shift();return r.renderFrame(this.AVGLObj,e.bufY,e.bufU,e.bufV,e.line_y,e.h),!0}return!1}},{key:"play",value:function(){var e=this,t=this;if(!1===this.checkCacheState())return this.onLoadCache&&this.onLoadCache(),setTimeout((function(){e.play()}),100),!1;if(void 0===this.playInterval||null===this.playInterval){var i=0,n=0,s=0;!1===this.mediaInfo.audioNone&&this.audioWAudio&&!1===this.mediaInfo.noFPS?(this.playInterval=setInterval((function(){if(n=a.GetMsTime(),t.cache_status){if(n-i>=t.frameTime-s){var e=t.YuvBuf.shift();if(null!=e&&null!==e){var o=0;null!==t.audioWAudio&&void 0!==t.audioWAudio&&(o=1e3*(e.pts-t.audioWAudio.getAlignVPTS())),s=t.audioWAudio?o<0&&-1*o<=t.frameTime||o>=0?a.GetMsTime()-n+1:t.frameTime:a.GetMsTime()-n+1,r.renderFrame(t.AVGLObj,e.bufY,e.bufU,e.bufV,e.line_y,e.h)}(t.YuvBuf.length<=0||t.audioWAudio&&t.audioWAudio.sampleQueue.length<=0)&&(t.cache_status=!1,t.onLoadCache&&t.onLoadCache(),t.audioWAudio&&t.audioWAudio.pause()),i=n}}else s=t.frameTime}),1),this.audioWAudio&&this.audioWAudio.play()):this.playInterval=setInterval((function(){var e=t.YuvBuf.shift();null!=e&&null!==e&&r.renderFrame(t.AVGLObj,e.bufY,e.bufU,e.bufV,e.line_y,e.h),t.YuvBuf.length<=0&&(t.cache_status=!1)}),t.frameTime)}}},{key:"start",value:function(e){var t,i,n,a=this;this.workerFetch=new Worker((t=function(){var e=null,t=new AbortController,i=t.signal,n=(self,function(e){var t=!1;t||(t=!0,fetch(e,{signal:i}).then((function(e){return function e(t){return t.read().then((function(i){if(!i.done){var n=i.value;return self.postMessage({cmd:"fetch-chunk",data:n,msg:"fetch-chunk"}),e(t)}self.postMessage({cmd:"fetch-fin",data:null,msg:"fetch-fin"})}))}(e.body.getReader())})).catch((function(e){if(!e.toString().includes("user aborted")){var t=" httplive request error:"+e+" start to retry";console.error(t),self.postMessage({cmd:"fetch-error",data:t,msg:"fetch-error"})}})))});self.onmessage=function(r){var a=r.data;switch(void 0===a.cmd||null===a.cmd?"":a.cmd){case"start":e=a.data,n(e),self.postMessage({cmd:"default",data:"WORKER STARTED",msg:"default"});break;case"stop":t.abort(),self.close(),self.postMessage({cmd:"close",data:"close",msg:"close"});break;case"retry":t.abort(),t=null,i=null,t=new AbortController,i=t.signal,setTimeout((function(){n(e)}),3e3)}}}.toString(),i=t.match(/^\s*function\s*\(\s*\)\s*\{(([\s\S](?!\}$))*[\s\S])/),n=[i[1]],window.URL.createObjectURL(new Blob(n,{type:"text/javascript"})))),this.workerFetch.onmessage=function(e){a._workerFetch_onmessage(e,a)},this.workerFetch,this.AVSniffPtr=Module.cwrap("AVSniffHttpFlvInit","number",["string","string"])("base64:QXV0aG9yOmNoYW5neWFubG9uZ3xudW1iZXJ3b2xmLEdpdGh1YjpodHRwczovL2dpdGh1Yi5jb20vbnVtYmVyd29sZixFbWFpbDpwb3JzY2hlZ3QyM0Bmb3htYWlsLmNvbSxRUTo1MzEzNjU4NzIsSG9tZVBhZ2U6aHR0cDovL3h2aWRlby52aWRlbyxEaXNjb3JkOm51bWJlcndvbGYjODY5NCx3ZWNoYXI6bnVtYmVyd29sZjExLEJlaWppbmcsV29ya0luOkJhaWR1","0.0.0"),this.AVSniffPtr,this._ptr_probeCallback=Module.addFunction(this._callbackProbe.bind(this)),this._ptr_yuvCallback=Module.addFunction(this._callbackYUV.bind(this)),this._ptr_naluCallback=Module.addFunction(this._callbackNALU.bind(this)),this._ptr_sampleCallback=Module.addFunction(this._callbackPCM.bind(this)),this._ptr_aacCallback=Module.addFunction(this._callbackAAC.bind(this)),Module.cwrap("initializeSniffHttpFlvModule","number",["number","number","number","number","number","number"])(this.AVSniffPtr,this._ptr_probeCallback,this._ptr_yuvCallback,this._ptr_naluCallback,this._ptr_sampleCallback,this._ptr_aacCallback),this.AVGLObj=r.setupCanvas(this.CanvasObj,{preserveDrawingBuffer:!1}),this.workerFetch.postMessage({cmd:"start",data:e,msg:"start"}),this._decode()}}])&&n(t.prototype,i),u&&n(t,u),e}();i.CHttpLiveCore=u},{"../consts":52,"../demuxer/buffer":64,"../demuxer/bufferFrame":65,"../render-engine/webgl-420p":77,"../version":80,"./audio-core":53,"./audio-native-core":54,"./av-common":55,"./cache":59,"./cacheYuv":60}],57:[function(e,t,i){"use strict";function n(e,t){for(var i=0;i0&&void 0!==arguments[0]&&arguments[0];this.showScreen=e,this.canvas&&(e?this.canvas.setAttribute("hidden",!0):this.canvas.removeAttribute("hidden"))}},{key:"getCachePTS",value:function(){return 1!==this.config.ignoreAudio&&this.audioWAudio?Math.max(this.vCachePTS,this.aCachePTS):this.vCachePTS}},{key:"getMaxPTS",value:function(){return Math.max(this.vCachePTS,this.aCachePTS)}},{key:"isPlayingState",value:function(){return this.isPlaying}},{key:"pushDone",value:function(){this.pushEOF=!0}},{key:"_clearDecInterval",value:function(){this.decVFrameInterval&&window.clearInterval(this.decVFrameInterval),this.decVFrameInterval=null}},{key:"_checkPlayFinished",value:function(){return!(this.config.playMode!==d.PLAYER_MODE_VOD||!(!0===this.bufRecvStat&&(this.playPTS>=this.bufLastVDTS||this.audioWAudio&&this.playPTS>=this.bufLastADTS)||this.duration-this.playPTS0&&(this.isPlaying=!0);var t=0,i=0,n=0;this.config.playMode===d.PLAYER_MODE_NOTIME_LIVE?this.playFrameInterval=window.setInterval((function(){if(e._videoQueue.length>0){var t=e._videoQueue.shift();t.pts,o.renderFrame(e.yuv,t.data_y,t.data_u,t.data_v,t.line1,t.height)}}),1e3*this.frameDur):this.playFrameInterval=window.setInterval((function(){if(i=u.GetMsTime(),e._videoQueue.length>0&&i-t>=e.frameTime-n){var r=e._videoQueue.shift(),a=0;if(e.isNewSeek||null===e.audioWAudio||void 0===e.audioWAudio||(a=1e3*(r.pts-e.audioWAudio.getAlignVPTS()),e.playPTS=Math.max(e.audioWAudio.getAlignVPTS(),e.playPTS)),t=i,u.GetMsTime(),e.playPTS=Math.max(r.pts,e.playPTS),e.isNewSeek&&e.seekTarget-e.frameDur>r.pts)return void(n=e.frameTime);if(e.isNewSeek&&(e.audioWAudio&&e.audioWAudio.setVoice(e.audioVoice),e.audioWAudio&&e.audioWAudio.play(),n=0,e.isNewSeek=!1,e.seekTarget=0),e.showScreen?e.onRender&&e.onRender(r.line1,r.height,r.data_y,r.data_u,r.data_v):(r.pts,o.renderFrame(e.yuv,r.data_y,r.data_u,r.data_v,r.line1,r.height)),e.onPlayingTime&&e.onPlayingTime(r.pts),!e.isNewSeek&&e.audioWAudio&&(a<0&&-1*a<=e.frameTime||a>=0)){if(e.config.playMode===d.PLAYER_MODE_VOD)if(r.pts>=e.duration)e.onLoadCacheFinshed&&e.onLoadCacheFinshed(),e.onPlayingFinish&&e.onPlayingFinish(),e._clearDecInterval(),e.pause();else if(e._checkPlayFinished())return;n=u.GetMsTime()-i}else!e.isNewSeek&&e.audioWAudio&&(a<0&&e.frameTime,n=e.frameTime)}e._checkPlayFinished()}),1)}this.isNewSeek||this.audioWAudio&&this.audioWAudio.play()}},{key:"pause",value:function(){this.isPlaying=!1,this._pause()}},{key:"_pause",value:function(){this.playFrameInterval&&window.clearInterval(this.playFrameInterval),this.playFrameInterval=null,this.audioWAudio&&this.audioWAudio.pause()}},{key:"seek",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.openFrameCall=!1,this.pause(),this._clearDecInterval(),null!==this.avFeedVideoInterval&&(window.clearInterval(this.avFeedVideoInterval),this.avFeedVideoInterval=null),null!==this.avFeedAudioInterval&&(window.clearInterval(this.avFeedAudioInterval),this.avFeedAudioInterval=null),this.yuvMaxTime=0,this.playVPipe.length=0,this._videoQueue.length=0,this.audioWAudio&&this.audioWAudio.stop(),e&&e(),this.isNewSeek=!0,this.avSeekVState=!0,this.seekTarget=i.seekTime,null!==this.audioWAudio&&void 0!==this.audioWAudio&&(this.audioWAudio.setVoice(0),this.audioWAudio.resetStartParam(),this.audioWAudio.stop()),this._avFeedData(i.seekTime),setTimeout((function(){t.yuvMaxTime=0,t._videoQueue.length=0,t.openFrameCall=!0,t.frameCallTag+=1,t._decVFrameIntervalFunc()}),1e3)}},{key:"setVoice",value:function(e){this.audioVoice=e,this.audioWAudio&&this.audioWAudio.setVoice(e)}},{key:"cacheIsFull",value:function(){return this._videoQueue.length>=50}},{key:"_checkDisplaySize",value:function(e,t,i){var n=t-e,r=this.config.width+Math.ceil(n/2),a=t/this.config.width>i/this.config.height,s=(r/t).toFixed(2),o=(this.config.height/i).toFixed(2),u=a?s:o,l=this.config.fixed,d=l?r:parseInt(t*u),h=l?this.config.height:parseInt(i*u);if(this.canvas.offsetWidth!=d||this.canvas.offsetHeight!=h){var c=parseInt((this.canvasBox.offsetHeight-h)/2),f=parseInt((this.canvasBox.offsetWidth-d)/2);c=c<0?0:c,f=f<0?0:f,this.canvas.style.marginTop=c+"px",this.canvas.style.marginLeft=f+"px",this.canvas.style.width=d+"px",this.canvas.style.height=h+"px"}return this.isCheckDisplay=!0,[d,h]}},{key:"_createYUVCanvas",value:function(){this.canvasBox=document.querySelector("#"+this.config.playerId),this.canvasBox.style.overflow="hidden",this.canvas=document.createElement("canvas"),this.canvas.style.width=this.canvasBox.clientWidth+"px",this.canvas.style.height=this.canvasBox.clientHeight+"px",this.canvas.style.top="0px",this.canvas.style.left="0px",this.canvasBox.appendChild(this.canvas),this.yuv=o.setupCanvas(this.canvas,{preserveDrawingBuffer:!1})}},{key:"_avRecvPackets",value:function(){var e=this;this.bufObject.cleanPipeline(),null!==this.avRecvInterval&&(window.clearInterval(this.avRecvInterval),this.avRecvInterval=null),!0===this.config.checkProbe?this.avRecvInterval=window.setInterval((function(){Module.cwrap("getSniffStreamPkg","number",["number"])(e.corePtr),e._avCheckRecvFinish()}),5):this.avRecvInterval=window.setInterval((function(){Module.cwrap("getSniffStreamPkgNoCheckProbe","number",["number"])(e.corePtr),e._avCheckRecvFinish()}),5),this._avFeedData(0,!1)}},{key:"_avCheckRecvFinish",value:function(){this.config.playMode===d.PLAYER_MODE_VOD&&this.duration-this.getMaxPTS()=50&&(t.onSeekFinish&&t.onSeekFinish(),t.onPlayingTime&&t.onPlayingTime(e),t.play(),window.clearInterval(i),i=null)}),10);return!0}},{key:"_afterAvFeedSeekToStartWithUnFinBuffer",value:function(e){var t=this,i=window.setInterval((function(){t._videoQueue.length,t._videoQueue.length>=50&&(t.onSeekFinish&&t.onSeekFinish(),t.onPlayingTime&&t.onPlayingTime(e),!1===t.reFull?t.play():t.reFull=!1,window.clearInterval(i),i=null)}),10);return!0}},{key:"_avFeedData",value:function(e){var t=this;if(this.playVPipe.length=0,this.audioWAudio&&this.audioWAudio.cleanQueue(),e<=0&&!1===this.bufOK){var i=0;if(this.avFeedVideoInterval=window.setInterval((function(){var n=t.bufObject.videoBuffer.length;if(n-1>i||t.duration-t.getMaxPTS()0){for(var s=0;s0&&t.playVPipe[t.playVPipe.length-1].pts>=t.bufLastVDTS&&(window.clearInterval(t.avFeedVideoInterval),t.avFeedVideoInterval=null,t.playVPipe[t.playVPipe.length-1].pts,t.bufLastVDTS,t.bufObject.videoBuffer,t.playVPipe)}else t.config.playMode===d.PLAYER_MODE_VOD&&t.playVPipe.length>0&&t.playVPipe[t.playVPipe.length-1].pts>=t.duration&&(window.clearInterval(t.avFeedVideoInterval),t.avFeedVideoInterval=null,t.playVPipe[t.playVPipe.length-1].pts,t.duration,t.bufObject.videoBuffer,t.playVPipe);t.avSeekVState&&(t.getMaxPTS(),t.duration,t.config.playMode===d.PLAYER_MODE_VOD&&(t._afterAvFeedSeekToStartWithFinishedBuffer(e),t.avSeekVState=!1))}),5),void 0!==this.audioWAudio&&null!==this.audioWAudio&&this.config.ignoreAudio<1){var n=0;this.avFeedAudioInterval=window.setInterval((function(){var e=t.bufObject.audioBuffer.length;if(e-1>n||t.duration-t.getMaxPTS()0&&t.audioWAudio.sampleQueue[t.audioWAudio.sampleQueue.length-1].pts>=t.bufLastADTS&&(window.clearInterval(t.avFeedAudioInterval),t.avFeedAudioInterval=null,t.audioWAudio.sampleQueue[t.audioWAudio.sampleQueue.length-1].pts,t.bufObject.audioBuffer)}else t.config.playMode===d.PLAYER_MODE_VOD&&t.audioWAudio.sampleQueue.length>0&&t.audioWAudio.sampleQueue[t.audioWAudio.sampleQueue.length-1].pts>=t.duration&&(window.clearInterval(t.avFeedAudioInterval),t.avFeedAudioInterval=null,t.audioWAudio.sampleQueue[t.audioWAudio.sampleQueue.length-1].pts,t.bufObject.audioBuffer)}),5)}}else{var r=this.bufObject.seekIDR(e),s=parseInt(r,10);this.playPTS=0;var o=s;if(this.avFeedVideoInterval=window.setInterval((function(){var i=t.bufObject.videoBuffer.length;if(i-1>o||t.duration-t.getMaxPTS()0){for(var r=0;r0&&t.playVPipe[t.playVPipe.length-1].pts>=t.bufLastVDTS&&(window.clearInterval(t.avFeedVideoInterval),t.avFeedVideoInterval=null)}else t.config.playMode===d.PLAYER_MODE_VOD&&t.playVPipe.length>0&&t.playVPipe[t.playVPipe.length-1].pts>=t.duration&&(window.clearInterval(t.avFeedVideoInterval),t.avFeedVideoInterval=null);t.avSeekVState&&(t.getMaxPTS(),t.duration,t.config.playMode===d.PLAYER_MODE_VOD&&(t._afterAvFeedSeekToStartWithUnFinBuffer(e),t.avSeekVState=!1))}),5),this.audioWAudio&&this.config.ignoreAudio<1){var u=parseInt(e,10);this.avFeedAudioInterval=window.setInterval((function(){var e=t.bufObject.audioBuffer.length;if(e-1>u||t.duration-t.getMaxPTS()0&&t.audioWAudio.sampleQueue[t.audioWAudio.sampleQueue.length-1].pts>=t.bufLastADTS&&(window.clearInterval(t.avFeedAudioInterval),t.avFeedAudioInterval=null)}else t.config.playMode===d.PLAYER_MODE_VOD&&t.audioWAudio.sampleQueue.length>0&&t.audioWAudio.sampleQueue[t.audioWAudio.sampleQueue.length-1].pts>=t.duration&&(window.clearInterval(t.avFeedAudioInterval),t.avFeedAudioInterval=null)}),5)}}}},{key:"_probeFinCallback",value:function(e,t,i,n,r,a,s,o,u){var h=this;this._createYUVCanvas(),d.V_CODEC_NAME_HEVC,this.config.fps=1*n,this.frameTime=1e3/this.config.fps,this.width=t,this.height=i,this.frameDur=1/this.config.fps,this.duration=e-this.frameDur,this.vCodecID=o,this.config.sampleRate=a,this.channels=s,this.audioIdx=r,this.duration<0&&(this.config.playMode=d.PLAYER_MODE_NOTIME_LIVE,this.frameTime,this.frameDur);for(var c=Module.HEAPU8.subarray(u,u+10),f=0;f=0&&this.config.ignoreAudio<1?(void 0!==this.audioWAudio&&null!==this.audioWAudio&&(this.audioWAudio.stop(),this.audioWAudio=null),this.audioWAudio=l({sampleRate:a,appendType:d.APPEND_TYPE_FRAME}),this.audioWAudio.setDurationMs(1e3*e),this.onLoadCache&&this.audioWAudio.setOnLoadCache((function(){if(h.retryAuSampleNo,h.retryAuSampleNo<=5){h.pause(),h.onLoadCache&&h.onLoadCache();var e=window.setInterval((function(){return h.retryAuSampleNo,h.audioWAudio.sampleQueue.length,h.audioWAudio.sampleQueue.length>2?(h.onLoadCacheFinshed&&h.onLoadCacheFinshed(),h.play(),h.retryAuSampleNo=0,window.clearInterval(e),void(e=null)):(h.retryAuSampleNo+=1,h.retryAuSampleNo>5?(h.play(),h.onLoadCacheFinshed&&h.onLoadCacheFinshed(),window.clearInterval(e),void(e=null)):void 0)}),1e3)}}))):this.audioNone=!0,this._avRecvPackets(),this._decVFrameIntervalFunc()),this.onProbeFinish&&this.onProbeFinish()}},{key:"_ptsFixed2",value:function(e){return Math.ceil(100*e)/100}},{key:"_naluCallback",value:function(e,t,i,n,r,a,s){var o=this._ptsFixed2(a),u=Module.HEAPU8.subarray(e,e+t),l=new Uint8Array(u);this.bufObject.appendFrameWithDts(o,s,l,!0,i),this.bufLastVDTS=Math.max(s,this.bufLastVDTS),this.vCachePTS=Math.max(o,this.vCachePTS),this.onCacheProcess&&this.onCacheProcess(this.getCachePTS())}},{key:"_samplesCallback",value:function(e,t,i,n){}},{key:"_aacFrameCallback",value:function(e,t,i,n,r){var a=this._ptsFixed2(r);if(this.audioWAudio){var s=new Uint8Array(7+i),o=Module.HEAPU8.subarray(e,e+7);s.set(o,0);var u=Module.HEAPU8.subarray(t,t+i);s.set(u,7),this.bufObject.appendFrame(a,s,!1,!0),this.bufLastADTS=Math.max(a,this.bufLastADTS),this.aCachePTS=Math.max(a,this.aCachePTS),this.onCacheProcess&&this.onCacheProcess(this.getCachePTS())}}},{key:"_decVFrameIntervalFunc",value:function(){var e=this;null==this.decVFrameInterval&&(this.decVFrameInterval=window.setInterval((function(){if(e._videoQueue.length<50&&e.playVPipe.length>0){var t=e.playVPipe.shift(),i=t.data,n=Module._malloc(i.length);Module.HEAP8.set(i,n);var r=parseInt(1e3*t.pts,10),a=parseInt(1e3*t.dts,10);e.yuvMaxTime=Math.max(t.pts,e.yuvMaxTime),Module.cwrap("decodeVideoFrame","number",["number","number","number","number","number"])(e.corePtr,n,i.length,r,a,e.frameCallTag),Module._free(n),n=null}}),10))}},{key:"_frameCallback",value:function(e,t,i,n,r,a,s,u,l,d){if(this._videoQueue.length,!(!1===this.openFrameCall||d!==this.frameCallTag||l>this.yuvMaxTime+this.frameDur||this.isNewSeek&&this.seekTarget-l>3*this.frameDur)){var h=this._videoQueue.length;if(this.canvas.width==n&&this.canvas.height==u||(this.canvas.width=n,this.canvas.height=u,this.isCheckDisplay)||this._checkDisplaySize(s,n,u),!(this.playPTS>l)){var f=Module.HEAPU8.subarray(e,e+n*u),p=Module.HEAPU8.subarray(t,t+r*u/2),m=Module.HEAPU8.subarray(i,i+a*u/2),g=new Uint8Array(f),_=new Uint8Array(p),y=new Uint8Array(m);this.config.readyShow&&(o.renderFrame(this.yuv,g,_,y,n,u),this.config.readyShow=!1,this.onReadyShowDone&&this.onReadyShowDone());var v=new c(g,_,y,n,r,a,s,u,l);if(h<=0||l>this._videoQueue[h-1].pts)this._videoQueue.push(v);else if(lthis._videoQueue[b].pts&&b+10&&(t.getPackageTimeMS=a.GetMsTime()),t.pushPkg++,void 0!==t.AVGetInterval&&null!==t.AVGetInterval||(t.AVGetInterval=window.setInterval((function(){Module.cwrap("getBufferLengthApi","number",["number"])(t.AVSniffPtr)>t.config.probeSize&&(Module.cwrap("getSniffHttpFlvPkg","number",["number"])(t.AVSniffPtr),t.pushPkg-=1)}),5));break;case"close":t.AVGetInterval&&clearInterval(t.AVGetInterval),t.AVGetInterval=null;case"fetch-fin":break;case"fetch-error":t.onNetworkError&&t.onNetworkError(i.data)}}},{key:"_checkDisplaySize",value:function(e,t,i){var n=t-e,r=this.config.width+Math.ceil(n/2),a=t/this.config.width>i/this.config.height,s=(r/t).toFixed(2),o=(this.config.height/i).toFixed(2),u=a?s:o,l=this.config.fixed,d=l?r:parseInt(t*u),h=l?this.config.height:parseInt(i*u);if(this.CanvasObj.offsetWidth!=d||this.CanvasObj.offsetHeight!=h){var c=parseInt((this.canvasBox.offsetHeight-h)/2),f=parseInt((this.canvasBox.offsetWidth-d)/2);c=c<0?0:c,f=f<0?0:f,this.CanvasObj.style.marginTop=c+"px",this.CanvasObj.style.marginLeft=f+"px",this.CanvasObj.style.width=d+"px",this.CanvasObj.style.height=h+"px"}return this.isCheckDisplay=!0,[d,h]}},{key:"_ptsFixed2",value:function(e){return Math.ceil(100*e)/100}},{key:"_callbackProbe",value:function(e,t,i,n,r,a,u,l,d){for(var h=Module.HEAPU8.subarray(d,d+10),c=0;c100&&(f=o.DEFAULT_FPS,this.mediaInfo.noFPS=!0),this.vCodecID=l,this.config.fps=f,this.mediaInfo.fps=f,this.mediaInfo.size.width=t,this.mediaInfo.size.height=i,this.frameTime=Math.floor(1e3/(this.mediaInfo.fps+2)),this.CanvasObj.width==t&&this.CanvasObj.height==i||(this.CanvasObj.width=t,this.CanvasObj.height=i,this.isCheckDisplay)||this._checkDisplaySize(t,t,i),r>=0&&!1===this.mediaInfo.noFPS?(void 0!==this.audioWAudio&&null!==this.audioWAudio&&(this.audioWAudio.stop(),this.audioWAudio=null),this.config.sampleRate=a,this.mediaInfo.sampleRate=a,this.audioWAudio=s({sampleRate:this.mediaInfo.sampleRate,appendType:o.APPEND_TYPE_FRAME}),this.audioWAudio.isLIVE=!0):this.mediaInfo.audioNone=!0,this.onProbeFinish&&this.onProbeFinish()}},{key:"_callbackYUV",value:function(e,t,i,n,r,a,s,o,u){var l=Module.HEAPU8.subarray(e,e+n*o),d=new Uint8Array(l),h=Module.HEAPU8.subarray(t,t+r*o/2),c=new Uint8Array(h),f=Module.HEAPU8.subarray(i,i+a*o/2),p={bufY:d,bufU:c,bufV:new Uint8Array(f),line_y:n,h:o,pts:u};this.YuvBuf.push(p),this.checkCacheState(),Module._free(l),l=null,Module._free(h),h=null,Module._free(f),f=null,!1===this.readyShowDone&&(this.playYUV(),this.readyShowDone=!0,this.onReadyShowDone&&this.onReadyShowDone(),this.audioWAudio||this.play())}},{key:"_callbackNALU",value:function(e,t,i,n,r,a,s){if(!1===this.readyKeyFrame){if(i<=0)return;this.readyKeyFrame=!0}var o=Module.HEAPU8.subarray(e,e+t),u=new Uint8Array(o);this.NaluBuf.push({bufData:u,len:t,isKey:i,w:n,h:r,pts:1e3*a,dts:1e3*s}),Module._free(o),o=null}},{key:"_callbackPCM",value:function(e){}},{key:"_callbackAAC",value:function(e,t,i,n,r){var a=this._ptsFixed2(r);if(this.audioWAudio){var s=new Uint8Array(7+i),o=Module.HEAPU8.subarray(e,e+7);s.set(o,0);var u=Module.HEAPU8.subarray(t,t+i);s.set(u,7);var l={pts:a,data:s};this.audioWAudio.addSample(l),this.checkCacheState()}}},{key:"_decode",value:function(){var e=this;setTimeout((function(){if(null!==e.workerFetch){var t=e.NaluBuf.shift();if(null!=t){var i=Module._malloc(t.bufData.length);Module.HEAP8.set(t.bufData,i),Module.cwrap("decodeHttpFlvVideoFrame","number",["number","number","number","number","number"])(e.AVSniffPtr,i,t.bufData.length,t.pts,t.dts,0),Module._free(i),i=null}e._decode()}}),1)}},{key:"checkCacheState",value:function(){var e=this.YuvBuf.length>=25&&(!0===this.mediaInfo.audioNone||this.audioWAudio&&this.audioWAudio.sampleQueue.length>=50);return!1===this.cache_status&&e&&(this.playInterval&&this.audioWAudio&&this.audioWAudio.play(),this.onLoadCacheFinshed&&this.onLoadCacheFinshed(),this.cache_status=!0),e}},{key:"setVoice",value:function(e){this.audioVoice=e,this.audioWAudio&&this.audioWAudio.setVoice(e)}},{key:"_removeBindFuncPtr",value:function(){null!==this._ptr_probeCallback&&Module.removeFunction(this._ptr_probeCallback),null!==this._ptr_frameCallback&&Module.removeFunction(this._ptr_frameCallback),null!==this._ptr_naluCallback&&Module.removeFunction(this._ptr_naluCallback),null!==this._ptr_sampleCallback&&Module.removeFunction(this._ptr_sampleCallback),null!==this._ptr_aacCallback&&Module.removeFunction(this._ptr_aacCallback),this._ptr_probeCallback=null,this._ptr_frameCallback=null,this._ptr_naluCallback=null,this._ptr_sampleCallback=null,this._ptr_aacCallback=null}},{key:"release",value:function(){return this.pause(),this.NaluBuf.length=0,this.YuvBuf.length=0,void 0!==this.workerFetch&&null!==this.workerFetch&&this.workerFetch.postMessage({cmd:"stop",data:"stop",msg:"stop"}),this.workerFetch=null,this.AVGetInterval&&clearInterval(this.AVGetInterval),this.AVGetInterval=null,this._removeBindFuncPtr(),Module.cwrap("releaseHttpFLV","number",["number"])(this.AVSniffPtr),this.playInterval&&clearInterval(this.playInterval),this.playInterval=null,this.audioWAudio&&this.audioWAudio.stop(),this.audioWAudio=null,this.CanvasObj&&this.CanvasObj.remove(),this.CanvasObj=null,0}},{key:"isPlayingState",value:function(){return null!==this.playInterval&&void 0!==this.playInterval}},{key:"pause",value:function(){this.audioWAudio&&this.audioWAudio.pause(),this.playInterval&&clearInterval(this.playInterval),this.playInterval=null}},{key:"playYUV",value:function(){if(this.YuvBuf.length>0){var e=this.YuvBuf.shift();return r.renderFrame(this.AVGLObj,e.bufY,e.bufU,e.bufV,e.line_y,e.h),!0}return!1}},{key:"play",value:function(){var e=this,t=this;if(!1===this.checkCacheState())return this.onLoadCache&&this.onLoadCache(),setTimeout((function(){e.play()}),100),!1;if(void 0===this.playInterval||null===this.playInterval){var i=0,n=0,s=0;!1===this.mediaInfo.audioNone&&this.audioWAudio&&!1===this.mediaInfo.noFPS?(this.playInterval=setInterval((function(){if(n=a.GetMsTime(),t.cache_status){if(n-i>=t.frameTime-s){var e=t.YuvBuf.shift();if(null!=e&&null!==e){var o=0;null!==t.audioWAudio&&void 0!==t.audioWAudio&&(o=1e3*(e.pts-t.audioWAudio.getAlignVPTS())),s=t.audioWAudio?o<0&&-1*o<=t.frameTime||o>=0?a.GetMsTime()-n+1:t.frameTime:a.GetMsTime()-n+1,r.renderFrame(t.AVGLObj,e.bufY,e.bufU,e.bufV,e.line_y,e.h)}(t.YuvBuf.length<=0||t.audioWAudio&&t.audioWAudio.sampleQueue.length<=0)&&(t.cache_status=!1,t.onLoadCache&&t.onLoadCache(),t.audioWAudio&&t.audioWAudio.pause()),i=n}}else s=t.frameTime}),1),this.audioWAudio&&this.audioWAudio.play()):this.playInterval=setInterval((function(){var e=t.YuvBuf.shift();null!=e&&null!==e&&r.renderFrame(t.AVGLObj,e.bufY,e.bufU,e.bufV,e.line_y,e.h),t.YuvBuf.length<=0&&(t.cache_status=!1)}),t.frameTime)}}},{key:"start",value:function(e){var t,i,n,a=this;this.workerFetch=new Worker((t=function(){var e=null;self,self.onmessage=function(t){var i=t.data;switch(void 0===i.cmd||null===i.cmd?"":i.cmd){case"start":var n=i.data;(e=new WebSocket(n)).binaryType="arraybuffer",e.onopen=function(t){e.send("Hello WebSockets!")},e.onmessage=function(e){if(e.data instanceof ArrayBuffer){var t=e.data;t.byteLength>0&&postMessage({cmd:"fetch-chunk",data:new Uint8Array(t),msg:"fetch-chunk"})}},e.onclose=function(e){};break;case"stop":e&&e.close(),self.close(),self.postMessage({cmd:"close",data:"close",msg:"close"})}}}.toString(),i=t.match(/^\s*function\s*\(\s*\)\s*\{(([\s\S](?!\}$))*[\s\S])/),n=[i[1]],window.URL.createObjectURL(new Blob(n,{type:"text/javascript"})))),this.workerFetch.onmessage=function(e){a._workerFetch_onmessage(e,a)},this.workerFetch,this.AVSniffPtr=Module.cwrap("AVSniffHttpFlvInit","number",["string","string"])("base64:QXV0aG9yOmNoYW5neWFubG9uZ3xudW1iZXJ3b2xmLEdpdGh1YjpodHRwczovL2dpdGh1Yi5jb20vbnVtYmVyd29sZixFbWFpbDpwb3JzY2hlZ3QyM0Bmb3htYWlsLmNvbSxRUTo1MzEzNjU4NzIsSG9tZVBhZ2U6aHR0cDovL3h2aWRlby52aWRlbyxEaXNjb3JkOm51bWJlcndvbGYjODY5NCx3ZWNoYXI6bnVtYmVyd29sZjExLEJlaWppbmcsV29ya0luOkJhaWR1","0.0.0"),this.AVSniffPtr,this._ptr_probeCallback=Module.addFunction(this._callbackProbe.bind(this)),this._ptr_yuvCallback=Module.addFunction(this._callbackYUV.bind(this)),this._ptr_naluCallback=Module.addFunction(this._callbackNALU.bind(this)),this._ptr_sampleCallback=Module.addFunction(this._callbackPCM.bind(this)),this._ptr_aacCallback=Module.addFunction(this._callbackAAC.bind(this)),Module.cwrap("initializeSniffHttpFlvModule","number",["number","number","number","number","number","number"])(this.AVSniffPtr,this._ptr_probeCallback,this._ptr_yuvCallback,this._ptr_naluCallback,this._ptr_sampleCallback,this._ptr_aacCallback),this.AVGLObj=r.setupCanvas(this.CanvasObj,{preserveDrawingBuffer:!1}),this.workerFetch.postMessage({cmd:"start",data:e,msg:"start"}),this._decode()}}])&&n(t.prototype,i),u&&n(t,u),e}();i.CWsLiveCore=u},{"../consts":52,"../demuxer/buffer":64,"../demuxer/bufferFrame":65,"../render-engine/webgl-420p":77,"../version":80,"./audio-core":53,"./audio-native-core":54,"./av-common":55,"./cache":59,"./cacheYuv":60}],59:[function(e,t,i){(function(i){"use strict";e("./cacheYuv");i.CACHE_APPEND_STATUS_CODE={FAILED:-1,OVERFLOW:-2,OK:0,NOT_FULL:1,FULL:2,NULL:3},t.exports=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:60,t={limit:e,yuvCache:[],appendCacheByCacheYuv:function(e){e.pts;return t.yuvCache.length>=t.limit?CACHE_APPEND_STATUS_CODE.OVERFLOW:(t.yuvCache.push(e),t.yuvCache.length>=t.limit?CACHE_APPEND_STATUS_CODE.FULL:CACHE_APPEND_STATUS_CODE.NOT_FULL)},getState:function(){return t.yuvCache.length<=0?CACHE_APPEND_STATUS_CODE.NULL:t.yuvCache.length>=t.limit?CACHE_APPEND_STATUS_CODE.FULL:CACHE_APPEND_STATUS_CODE.NOT_FULL},cleanPipeline:function(){t.yuvCache.length=0},vYuv:function(){return t.yuvCache.length<=0?null:t.yuvCache.shift()}};return t}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./cacheYuv":60}],60:[function(e,t,i){"use strict";function n(e,t){for(var i=0;i>1;return r.indexOf(t)},GET_NALU_TYPE:function(e){var t=(126&e)>>1;if(t>=1&&t<=9)return n.DEFINE_P_FRAME;if(t>=16&&t<=21)return n.DEFINE_KEY_FRAME;var i=r.indexOf(t);return i>=0?r[i]:n.DEFINE_OTHERS_FRAME},PACK_NALU:function(e){var t=e.nalu,i=e.vlc.vlc;null==t.vps&&(t.vps=new Uint8Array);var n=new Uint8Array(t.vps.length+t.sps.length+t.pps.length+t.sei.length+i.length);return n.set(t.vps,0),n.set(t.sps,t.vps.length),n.set(t.pps,t.vps.length+t.sps.length),n.set(t.sei,t.vps.length+t.sps.length+t.pps.length),n.set(i,t.vps.length+t.sps.length+t.pps.length+t.sei.length),n}}},{"./hevc-header":61}],63:[function(e,t,i){"use strict";function n(e){return function(e){if(Array.isArray(e)){for(var t=0,i=new Array(e.length);t0&&void 0!==arguments[0]&&arguments[0];null!=t&&(t.showScreen=e,t.canvas&&(e?t.canvas.setAttribute("hidden",!0):t.canvas.removeAttribute("hidden")))},setSize:function(e,i){t.config.width=e||l.DEFAULT_WIDTH,t.config.height=i||l.DEFAULT_HEIGHT},setFrameRate:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:25;t.config.fps=e,t.config.frameDurMs=1e3/e},setDurationMs:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1;t.durationMs=e,0==t.config.audioNone&&t.audio.setDurationMs(e)},setPlayingCall:function(e){t.onPlayingTime=e},setVoice:function(e){t.realVolume=e,0==t.config.audioNone&&t.audio.setVoice(t.realVolume)},isPlayingState:function(){return t.isPlaying||t.isCaching===l.CACHE_WITH_PLAY_SIGN},appendAACFrame:function(e){t.audio.addSample(e),t.aCachePTS=Math.max(e.pts,t.aCachePTS)},appendHevcFrame:function(e){var i;t.config.appendHevcType==l.APPEND_TYPE_STREAM?t.stream=new Uint8Array((i=n(t.stream)).concat.apply(i,n(e))):t.config.appendHevcType==l.APPEND_TYPE_FRAME&&(t.frameList.push(e),t.vCachePTS=Math.max(e.pts,t.vCachePTS))},getCachePTS:function(){return Math.max(t.vCachePTS,t.aCachePTS)},endAudio:function(){0==t.config.audioNone&&t.audio.stop()},cleanSample:function(){0==t.config.audioNone&&t.audio.cleanQueue()},cleanVideoQueue:function(){t.config.appendHevcType==l.APPEND_TYPE_STREAM?t.stream=new Uint8Array:t.config.appendHevcType==l.APPEND_TYPE_FRAME&&(t.frameList=[],t.frameList.length=0)},cleanCacheYUV:function(){t.cacheYuvBuf.cleanPipeline()},pause:function(){t.loop&&window.clearInterval(t.loop),t.loop=null,0==t.config.audioNone&&t.audio.pause(),t.isPlaying=!1,t.isCaching===l.CACHE_WITH_PLAY_SIGN&&(t.isCaching=l.CACHE_WITH_NOPLAY_SIGN)},checkFinished:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:l.PLAYER_MODE_VOD;return e==l.PLAYER_MODE_VOD&&t.cacheYuvBuf.yuvCache.length<=0&&(t.videoPTS.toFixed(1)>=(t.durationMs-t.config.frameDurMs)/1e3||t.noCacheFrame>=10)&&(null!=t.onPlayingFinish&&(l.PLAYER_MODE_VOD,t.frameList.length,t.cacheYuvBuf.yuvCache.length,t.videoPTS.toFixed(1),t.durationMs,t.config.frameDurMs,t.noCacheFrame,t.onPlayingFinish()),!0)},clearAllCache:function(){t.nowPacket=null,t.vCachePTS=0,t.aCachePTS=0,t.cleanSample(),t.cleanVideoQueue(),t.cleanCacheYUV()},seek:function(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.isPlaying;t.pause(),t.stopCacheThread(),t.clearAllCache(),e&&e(),t.isNewSeek=!0,t.flushDecoder=1,t.videoPTS=parseInt(i.seekTime);var r={seekPos:i.seekTime||-1,mode:i.mode||l.PLAYER_MODE_VOD,accurateSeek:i.accurateSeek||!0,seekEvent:i.seekEvent||!0,realPlay:n};t.cacheThread(),t.play(r)},getNalu1Packet:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],i=null,n=-1;if(t.config.appendHevcType==l.APPEND_TYPE_STREAM)i=t.nextNalu();else{if(t.config.appendHevcType!=l.APPEND_TYPE_FRAME)return null;var r=t.frameList.shift();if(!r)return null;i=r.data,n=r.pts,e&&(t.videoPTS=n)}return{nalBuf:i,pts:n}},decodeNalu1Frame:function(e,i){var n=Module._malloc(e.length);Module.HEAP8.set(e,n);var r=parseInt(1e3*i);Module.cwrap("decodeCodecContext","number",["number","number","number","number","number"])(t.vcodecerPtr,n,e.length,r,t.flushDecoder);return t.flushDecoder=0,Module._free(n),!1},cacheThread:function(){t.cacheLoop=window.setInterval((function(){if(t.cacheYuvBuf.getState()!=CACHE_APPEND_STATUS_CODE.FULL){var e=t.getNalu1Packet(!1);if(null!=e){var i=e.nalBuf,n=e.pts;t.decodeNalu1Frame(i,n,!0)}}}),10)},stopCacheThread:function(){null!==t.cacheLoop&&(window.clearInterval(t.cacheLoop),t.cacheLoop=null)},loadCache:function(){if(!(t.frameList.length<=3)){var e=t.isPlaying;if(t.cacheYuvBuf.yuvCache.length<=3){t.pause(),null!=t.onLoadCache&&t.onLoadCache(),t.isCaching=e?l.CACHE_WITH_PLAY_SIGN:l.CACHE_WITH_NOPLAY_SIGN;var i=t.frameList.length>30?30:t.frameList.length;null===t.cacheInterval&&(t.cacheInterval=window.setInterval((function(){t.cacheYuvBuf.yuvCache.length>=i&&(null!=t.onLoadCacheFinshed&&t.onLoadCacheFinshed(),window.clearInterval(t.cacheInterval),t.cacheInterval=null,t.isCaching===l.CACHE_WITH_PLAY_SIGN&&t.play(t.playParams),t.isCaching=l.CACHE_NO_LOADCACHE)}),40))}}},playFunc:function(){var e=!1;if(t.playParams.seekEvent||r.GetMsTime()-t.calcuteStartTime>=t.frameTime-t.preCostTime){e=!0;var i=!0;if(t.calcuteStartTime=r.GetMsTime(),t.config.audioNone)t.playFrameYUV(i,t.playParams.accurateSeek);else{t.fix_poc_err_skip>0&&(t.fix_poc_err_skip--,i=!1);var n=t.videoPTS-t.audio.getAlignVPTS();if(n>0)return void(t.playParams.seekEvent&&!t.config.audioNone&&t.audio.setVoice(0));if(i){if(!(i=-1*n<=1*t.frameTimeSec)){for(var a=parseInt(n/t.frameTimeSec),s=0;s=i&&(t.playFrameYUV(!0,t.playParams.accurateSeek),i+=1)}),1)}else t.videoPTS>=t.playParams.seekPos&&!t.isNewSeek||0===t.playParams.seekPos||0===t.playParams.seekPos?(t.frameTime=1e3/t.config.fps,t.frameTimeSec=t.frameTime/1e3,0==t.config.audioNone&&t.audio.play(),t.realVolume=t.config.audioNone?0:t.audio.voice,t.playParams.seekEvent&&(t.fix_poc_err_skip=10),t.loop=window.setInterval((function(){var e=r.GetMsTime();t.playFunc(),t.preCostTime=r.GetMsTime()-e}),1)):(t.loop=window.setInterval((function(){t.playFrameYUV(!1,t.playParams.accurateSeek),t.checkFinished(t.playParams.mode)?(window.clearInterval(t.loop),t.loop=null):t.videoPTS>=t.playParams.seekPos&&(window.clearInterval(t.loop),t.loop=null,t.play(t.playParams))}),1),t.isNewSeek=!1)},stop:function(){t.release(),Module.cwrap("initializeDecoder","number",["number"])(t.vcodecerPtr),t.stream=new Uint8Array},release:function(){return t.endAudio(),t.cacheLoop&&window.clearInterval(t.cacheLoop),t.cacheLoop=null,t.loop&&window.clearInterval(t.loop),t.loop=null,t.pause(),null!==t.videoCallback&&Module.removeFunction(t.videoCallback),t.videoCallback=null,Module.cwrap("release","number",["number"])(t.vcodecerPtr),t.stream=null,t.frameList.length=0,t.durationMs=-1,t.videoPTS=0,t.isPlaying=!1,!0},nextNalu:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;if(t.stream.length<=4)return!1;for(var i=-1,n=0;n=t.stream.length){if(-1==i)return!1;var r=t.stream.subarray(i);return t.stream=new Uint8Array,r}var a="0 0 1"==t.stream.slice(0,3).join(" "),s="0 0 0 1"==t.stream.slice(0,4).join(" ");if(a||s){if(-1==i)i=n;else{if(e<=1){var o=t.stream.subarray(i,n);return t.stream=t.stream.subarray(n),o}e-=1}n+=3}}return!1},decodeSendPacket:function(e){var i=Module._malloc(e.length);Module.HEAP8.set(e,i);var n=Module.cwrap("decodeSendPacket","number",["number","number","number"])(t.vcodecerPtr,i,e.length);return Module._free(i),n},decodeRecvFrame:function(){return Module.cwrap("decodeRecv","number",["number"])(t.vcodecerPtr)},playFrameYUV:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],i=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=t.cacheYuvBuf.vYuv();if(null==n)return t.noCacheFrame+=1,e&&!t.playParams.seekEvent&&t.loadCache(),!1;t.noCacheFrame=0;var r=n.pts;return t.videoPTS=r,(!e&&i||e)&&e&&t.drawImage(n.width,n.height,n.imageBufferY,n.imageBufferB,n.imageBufferR),e&&!t.playParams.seekEvent&&t.isPlaying&&t.loadCache(),!0},drawImage:function(e,i,n,r,a){if(t.canvas.width===e&&t.canvas.height==i||(t.canvas.width=e,t.canvas.height=i),t.showScreen&&null!=t.onRender)t.onRender(e,i,n,r,a);else{if(!t.isCheckDisplay)t.checkDisplaySize(e,i);var s=e*i,o=e/2*(i/2),l=new Uint8Array(s+2*o);l.set(n,0),l.set(r,s),l.set(a,s+o),u.renderFrame(t.yuv,n,r,a,e,i)}},debugYUV:function(e){t.debugYUVSwitch=!0,t.debugID=e},checkDisplaySize:function(e,i){var n=e/t.config.width>i/t.config.height,r=(t.config.width/e).toFixed(2),a=(t.config.height/i).toFixed(2),s=n?r:a,o=t.config.fixed,u=o?t.config.width:parseInt(e*s),l=o?t.config.height:parseInt(i*s);if(t.canvas.offsetWidth!=u||t.canvas.offsetHeight!=l){var d=parseInt((t.canvasBox.offsetHeight-l)/2),h=parseInt((t.canvasBox.offsetWidth-u)/2);t.canvas.style.marginTop=d+"px",t.canvas.style.marginLeft=h+"px",t.canvas.style.width=u+"px",t.canvas.style.height=l+"px"}return t.isCheckDisplay=!0,[u,l]},makeWasm:function(){if(null!=t.config.token){t.vcodecerPtr=Module.cwrap("registerPlayer","number",["string","string"])(t.config.token,d.PLAYER_VERSION),t.videoCallback=Module.addFunction((function(e,i,n,r,a,s,u,l,d){var h=Module.HEAPU8.subarray(e,e+r*l),c=Module.HEAPU8.subarray(i,i+a*l/2),f=Module.HEAPU8.subarray(n,n+s*l/2),p=new Uint8Array(h),m=new Uint8Array(c),g=new Uint8Array(f),_=1*d/1e3,y=new o.CacheYuvStruct(_,r,l,p,m,g);t.cacheYuvBuf.appendCacheByCacheYuv(y)})),Module.cwrap("setCodecType","number",["number","number","number"])(t.vcodecerPtr,t.config.videoCodec,t.videoCallback);Module.cwrap("initMissile","number",["number"])(t.vcodecerPtr);Module.cwrap("initializeDecoder","number",["number"])(t.vcodecerPtr)}},makeIt:function(){var e=document.querySelector("div#"+t.config.playerId),i=document.createElement("canvas");i.style.width=e.clientWidth+"px",i.style.height=e.clientHeight+"px",i.style.top="0px",i.style.left="0px",e.appendChild(i),t.canvasBox=e,t.canvas=i,t.yuv=u.setupCanvas(i,{preserveDrawingBuffer:!1}),0==t.config.audioNone&&(t.audio=a({sampleRate:t.config.sampleRate,appendType:t.config.appendHevcType})),t.isPlayLoadingFinish=1}};return t.makeWasm(),t.makeIt(),t.cacheThread(),t}},{"../consts":52,"../render-engine/webgl-420p":77,"../version":80,"./audio-core":53,"./av-common":55,"./cache":59,"./cacheYuv":60}],64:[function(e,t,i){"use strict";var n=e("./bufferFrame");t.exports=function(){var e={videoBuffer:[],audioBuffer:[],idrIdxBuffer:[],appendFrame:function(t,i){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],s=new n.BufferFrame(t,a,i,r),o=parseInt(t);return r?(e.videoBuffer.length-1>=o?e.videoBuffer[o].push(s):e.videoBuffer.push([s]),a&&!e.idrIdxBuffer.includes(t)&&e.idrIdxBuffer.push(t)):e.audioBuffer.length-1>=o&&null!=e.audioBuffer[o]&&null!=e.audioBuffer[o]?e.audioBuffer[o]&&e.audioBuffer[o].push(s):e.audioBuffer.push([s]),!0},appendFrameWithDts:function(t,i,r){var a=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],s=arguments.length>4&&void 0!==arguments[4]&&arguments[4],o=n.ConstructWithDts(t,i,s,r,a),u=parseInt(i);return a?(e.videoBuffer.length-1>=u?e.videoBuffer[u].push(o):e.videoBuffer.push([o]),s&&!e.idrIdxBuffer.includes(i)&&e.idrIdxBuffer.push(i)):e.audioBuffer.length-1>=u&&null!=e.audioBuffer[u]&&null!=e.audioBuffer[u]?e.audioBuffer[u]&&e.audioBuffer[u].push(o):e.audioBuffer.push([o]),!0},appendFrameByBufferFrame:function(t){var i=t.pts,n=parseInt(i);return t.video?(e.videoBuffer.length-1>=n?e.videoBuffer[n].push(t):e.videoBuffer.push([t]),isKey&&!e.idrIdxBuffer.includes(i)&&e.idrIdxBuffer.push(i)):e.audioBuffer.length-1>=n?e.audioBuffer[n].push(t):e.audioBuffer.push([t]),!0},cleanPipeline:function(){e.videoBuffer.length=0,e.audioBuffer.length=0},vFrame:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1;if(!(t<0||t>e.videoBuffer.length-1))return e.videoBuffer[t]},aFrame:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1;if(!(t<0||t>e.audioBuffer.length-1))return e.audioBuffer[t]},seekIDR:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1;if(e.idrIdxBuffer,e.videoBuffer,t<0)return null;if(e.idrIdxBuffer.includes(t))return t;for(var i=0;it||0===i&&e.idrIdxBuffer[i]>=t){for(var n=1;n>=0;n--){var r=i-n;if(r>=0)return e.idrIdxBuffer[r],e.idrIdxBuffer[r]}return e.idrIdxBuffer[i],j,e.idrIdxBuffer[i]}}};return e}},{"./bufferFrame":65}],65:[function(e,t,i){"use strict";function n(e,t){for(var i=0;i0&&i.extensionInfo.vHeight>0&&(i.size.width=i.extensionInfo.vWidth,i.size.height=i.extensionInfo.vHeight)),i.mediaInfo.duration,null!=i.onDemuxed&&i.onDemuxed(i.onReadyOBJ);for(var e=!1;void 0!==i.mpegTsObj&&null!==i.mpegTsObj;){var n=i.mpegTsObj.readPacket();if(n.size<=0)break;var r=n.dtime>0?n.dtime:n.ptime;if(!(r<0)){if(0==n.type){r<=i.vPreFramePTS&&(e=!0);var a=u.PACK_NALU(n.layer),o=1==n.keyframe,l=1==e?r+i.vStartTime:r,d=new s.BufferFrame(l,o,a,!0);i.bufObject.appendFrame(d.pts,d.data,!0,d.isKey),i.vPreFramePTS=l,null!=i.onSamples&&i.onSamples(i.onReadyOBJ,d)}else if(r<=i.aPreFramePTS&&(e=!0),"aac"==i.mediaInfo.aCodec)for(var h=n.data,c=0;c=3?(i._onTsReady(e),window.clearInterval(i.timerTsWasm),i.timerTsWasm=null):(i.mpegTsWasmRetryLoadTimes+=1,i.mpegTsObj.initDemuxer())}),3e3)}},{key:"_onTsReady",value:function(e){var t=this;t.hls.fetchM3u8(e),t.mpegTsWasmState=!0,t.timerFeed=window.setInterval((function(){if(t.tsList.length>0&&0==t.lockWait.state)try{var e=t.tsList.shift();if(null!=e){var i=e.streamURI,n=e.streamDur;t.lockWait.state=!0,t.lockWait.lockMember.dur=n,t.mpegTsObj.isLive=t.hls.isLive(),t.mpegTsObj.demuxURL(i)}else console.error("_onTsReady need wait ")}catch(e){console.error("onTsReady ERROR:",e),t.lockWait.state=!1}}),50)}},{key:"release",value:function(){this.hls&&this.hls.release(),this.hls=null,this.timerFeed&&window.clearInterval(this.timerFeed),this.timerFeed=null,this.timerTsWasm&&window.clearInterval(this.timerTsWasm),this.timerTsWasm=null}},{key:"bindReady",value:function(e){this.onReadyOBJ=e}},{key:"popBuffer",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;return t<0?null:1===e?t+1>this.bufObject.videoBuffer.length?null:this.bufObject.vFrame(t):2===e?t+1>this.bufObject.audioBuffer.length?null:this.bufObject.aFrame(t):void 0}},{key:"getVLen",value:function(){return this.bufObject.videoBuffer.length}},{key:"getALen",value:function(){return this.bufObject.audioBuffer.length}},{key:"getLastIdx",value:function(){return this.bufObject.videoBuffer.length-1}},{key:"getALastIdx",value:function(){return this.bufObject.audioBuffer.length-1}},{key:"getACodec",value:function(){return this.aCodec}},{key:"getVCodec",value:function(){return this.vCodec}},{key:"getDurationMs",value:function(){return this.durationMs}},{key:"getFPS",value:function(){return this.fps}},{key:"getSampleRate",value:function(){return this.sampleRate}},{key:"getSampleChannel",value:function(){return this.aChannel}},{key:"getSize",value:function(){return this.size}},{key:"seek",value:function(e){if(e>=0){var t=this.bufObject.seekIDR(e);this.seekPos=t}}}])&&n(t.prototype,i),d&&n(t,d),e}();i.M3u8=d},{"../consts":52,"../decoder/hevc-imp":62,"./buffer":64,"./bufferFrame":65,"./m3u8base":67,"./mpegts/mpeg.js":71}],67:[function(e,t,i){"use strict";function n(e,t){for(var i=0;i ",t),setTimeout((function(){i.fetchM3u8(e)}),500)}))}},{key:"_uriParse",value:function(e){this._preURI="";var t=e.split("//"),i=null,n=null;if(t.length<1)return!1;t.length>1?(i=t[0],n=t[1].split("/"),this._preURI=i+"//"):n=t[0].split("/");for(var r=0;rp&&(o=p);var m=n[l+=1],g=null;g=m.indexOf("http")>=0?m:this._preURI+m,this._slices.indexOf(g)<0&&(this._slices.push(g),this._slices[this._slices.length-1],null!=this.onTransportStream&&this.onTransportStream(g,p))}}}if(this._slices.length>s.hlsSliceLimit&&this._type==r.PLAYER_IN_TYPE_M3U8_LIVE&&(this._slices=this._slices.slice(-1*s.hlsSliceLimit)),null!=this.onFinished){var _={type:this._type,duration:-1};this.onFinished(_)}return o}},{key:"_readTag",value:function(e){var t=s.tagParse.exec(e);return null!==t?{key:t[1],value:t[3]}:null}}])&&n(t.prototype,i),o&&n(t,o),e}();i.M3u8Base=o},{"../consts":52}],68:[function(e,t,i){"use strict";var n=e("mp4box"),r=e("../decoder/hevc-header"),a=e("../decoder/hevc-imp"),s=e("./buffer"),o=e("../consts"),u={96e3:0,88200:1,64e3:2,48e3:3,44100:4,32e3:5,24e3:6,22050:7,16e3:8,12e3:9,11025:10,8e3:11,7350:12,Reserved:13,"frequency is written explictly":15},l=function(e){for(var t=[],i=0;i1&&void 0!==arguments[1]&&arguments[1],i=null;return t?((i=e)[0]=r.DEFINE_STARTCODE[0],i[1]=r.DEFINE_STARTCODE[1],i[2]=r.DEFINE_STARTCODE[2],i[3]=r.DEFINE_STARTCODE[3]):((i=new Uint8Array(r.DEFINE_STARTCODE.length+e.length)).set(r.DEFINE_STARTCODE,0),i.set(e,r.DEFINE_STARTCODE.length)),i},d.prototype.setAACAdts=function(e){var t=null,i=this.aacProfile,n=u[this.sampleRate],r=new Uint8Array(7),a=r.length+e.length;return r[0]=255,r[1]=241,r[2]=(i-1<<6)+(n<<2)+0,r[3]=128+(a>>11),r[4]=(2047&a)>>3,r[5]=31+((7&a)<<5),r[6]=252,(t=new Uint8Array(a)).set(r,0),t.set(e,r.length),t},d.prototype.demux=function(){var e=this;e.seekPos=-1,e.mp4boxfile=n.createFile(),e.movieInfo=null,e.videoCodec=null,e.durationMs=-1,e.fps=-1,e.sampleRate=-1,e.aacProfile=2,e.size={width:-1,height:-1},e.bufObject=s(),e.audioNone=!1,e.naluHeader={vps:null,sps:null,pps:null,sei:null},e.mp4boxfile.onError=function(e){},this.mp4boxfile.onReady=function(t){for(var i in e.movieInfo=t,t.tracks)"VideoHandler"!==t.tracks[i].name&&"video"!==t.tracks[i].type||(t.tracks[i].codec,t.tracks[i].codec.indexOf("hev")>=0||t.tracks[i].codec.indexOf("hvc")>=0?e.videoCodec=o.CODEC_H265:t.tracks[i].codec.indexOf("avc")>=0&&(e.videoCodec=o.CODEC_H264));var n=-1;if(n=t.videoTracks[0].samples_duration/t.videoTracks[0].timescale,e.durationMs=1e3*n,e.fps=t.videoTracks[0].nb_samples/n,e.seekDiffTime=1/e.fps,e.size.width=t.videoTracks[0].track_width,e.size.height=t.videoTracks[0].track_height,t.audioTracks.length>0){e.sampleRate=t.audioTracks[0].audio.sample_rate;var r=t.audioTracks[0].codec.split(".");e.aacProfile=r[r.length-1]}else e.audioNone=!0;null!=e.onMp4BoxReady&&e.onMp4BoxReady(e.videoCodec),e.videoCodec===o.CODEC_H265?(e.initializeAllSourceBuffers(),e.mp4boxfile.start()):(e.videoCodec,o.CODEC_H264)},e.mp4boxfile.onSamples=function(t,i,n){var s=window.setInterval((function(){for(var i=0;i3?e.naluHeader.sei=e.setStartCode(g[3][0].data,!1):e.naluHeader.sei=new Uint8Array,e.naluHeader}else e.videoCodec==o.CODEC_H264&&(e.naluHeader.vps=new Uint8Array,e.naluHeader.sps=e.setStartCode(f.SPS[0].nalu,!1),e.naluHeader.pps=e.setStartCode(f.PPS[0].nalu,!1),e.naluHeader.sei=new Uint8Array);d[4].toString(16),e.naluHeader.vps[4].toString(16),l(e.naluHeader.vps),l(d);var _=e.setStartCode(d.subarray(0,e.naluHeader.vps.length),!0);if(l(_),d[4]===e.naluHeader.vps[4]){var y=e.naluHeader.vps.length+4,v=e.naluHeader.vps.length+e.naluHeader.sps.length+4,b=e.naluHeader.vps.length+e.naluHeader.sps.length+e.naluHeader.pps.length+4;if(e.naluHeader.sei.length<=0&&e.naluHeader.sps.length>0&&d[y]===e.naluHeader.sps[4]&&e.naluHeader.pps.length>0&&d[v]===e.naluHeader.pps[4]&&78===d[b]){d[e.naluHeader.vps.length+4],e.naluHeader.sps[4],d[e.naluHeader.vps.length+e.naluHeader.sps.length+4],e.naluHeader.pps[4],d[e.naluHeader.vps.length+e.naluHeader.sps.length+e.naluHeader.pps.length+4];for(var T=0,S=0;S4&&d[4]===e.naluHeader.sei[4]){var E=d.subarray(0,10),w=new Uint8Array(e.naluHeader.vps.length+E.length);w.set(E,0),w.set(e.naluHeader.vps,E.length),w[3]=1,e.naluHeader.vps=null,e.naluHeader.vps=new Uint8Array(w),w=null,E=null,(d=d.subarray(10))[4],e.naluHeader.vps[4],e.naluHeader.vps}else if(0===e.naluHeader.sei.length&&78===d[4]){d=e.setStartCode(d,!0);for(var C=0,A=0;A1&&void 0!==arguments[1]?arguments[1]:0;return e.fileStart=t,this.mp4boxfile.appendBuffer(e)},d.prototype.finishBuffer=function(){this.mp4boxfile.flush()},d.prototype.play=function(){},d.prototype.getVideoCoder=function(){return this.videoCodec},d.prototype.getDurationMs=function(){return this.durationMs},d.prototype.getFPS=function(){return this.fps},d.prototype.getSampleRate=function(){return this.sampleRate},d.prototype.getSize=function(){return this.size},d.prototype.seek=function(e){if(e>=0){var t=this.bufObject.seekIDR(e);this.seekPos=t}},d.prototype.popBuffer=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;return t<0?null:1==e?this.bufObject.vFrame(t):2==e?this.bufObject.aFrame(t):void 0},d.prototype.addBuffer=function(e){var t=e.id;this.mp4boxfile.setExtractionOptions(t)},d.prototype.initializeAllSourceBuffers=function(){if(this.movieInfo){for(var e=this.movieInfo,t=0;t>5)}},{key:"sliceAACFrames",value:function(e,t){for(var i=[],n=e,r=0;r>4==15){var a=this._getPktLen(t[r+3],t[r+4],t[r+5]);if(a<=0)continue;var s=t.subarray(r,r+a),o=new Uint8Array(a);o.set(s,0),i.push({ptime:n,data:o}),n+=this.frameDurSec,r+=a}else r+=1;return i}}])&&n(t.prototype,i),r&&n(t,r),e}();i.AACDecoder=r},{}],71:[function(e,t,i){(function(t){"use strict";function n(e,t){for(var i=0;i ",e),n=null})).catch((function(i){console.error("demuxerTsInit ERROR fetch ERROR ==> ",i),t._releaseOffset(),t.onDemuxedFailed&&t.onDemuxedFailed(i,e)}))}},{key:"_releaseOffset",value:function(){void 0!==this.offsetDemux&&null!==this.offsetDemux&&(Module._free(this.offsetDemux),this.offsetDemux=null)}},{key:"_demuxCore",value:function(e){if(this._releaseOffset(),this._refreshDemuxer(),!(e.length<=0)){this.offsetDemux=Module._malloc(e.length),Module.HEAP8.set(e,this.offsetDemux);var t=Module.cwrap("demuxBox","number",["number","number","number"])(this.offsetDemux,e.length,this.isLive);Module._free(this.offsetDemux),this.offsetDemux=null,t>=0&&(this._setMediaInfo(),this._setExtensionInfo(),null!=this.onDemuxed&&this.onDemuxed())}}},{key:"_setMediaInfo",value:function(){var e=Module.cwrap("getMediaInfo","number",[])(),t=Module.HEAPU32[e/4],i=Module.HEAPU32[e/4+1],n=Module.HEAPF64[e/8+1],s=Module.HEAPF64[e/8+1+1],o=Module.HEAPF64[e/8+1+1+1],u=Module.HEAPF64[e/8+1+1+1+1],l=Module.HEAPU32[e/4+2+2+2+2+2];this.mediaAttr.vFps=n,this.mediaAttr.vGop=l,this.mediaAttr.vDuration=s,this.mediaAttr.aDuration=o,this.mediaAttr.duration=u;var d=Module.cwrap("getAudioCodecID","number",[])();d>=0?(this.mediaAttr.aCodec=a.CODEC_OFFSET_TABLE[d],this.mediaAttr.sampleRate=t>0?t:a.DEFAULT_SAMPLERATE,this.mediaAttr.sampleChannel=i>=0?i:a.DEFAULT_CHANNEL):(this.mediaAttr.sampleRate=0,this.mediaAttr.sampleChannel=0,this.mediaAttr.audioNone=!0);var h=Module.cwrap("getVideoCodecID","number",[])();h>=0&&(this.mediaAttr.vCodec=a.CODEC_OFFSET_TABLE[h]),null==this.aacDec?this.aacDec=new r.AACDecoder(this.mediaAttr):this.aacDec.updateConfig(this.mediaAttr)}},{key:"_setExtensionInfo",value:function(){var e=Module.cwrap("getExtensionInfo","number",[])(),t=Module.HEAPU32[e/4],i=Module.HEAPU32[e/4+1];this.extensionInfo.vWidth=t,this.extensionInfo.vHeight=i}},{key:"readMediaInfo",value:function(){return this.mediaAttr}},{key:"readExtensionInfo",value:function(){return this.extensionInfo}},{key:"readAudioNone",value:function(){return this.mediaAttr.audioNone}},{key:"_readLayer",value:function(){var e={vps:null,sps:null,pps:null,sei:null},t={vlc:null},i=Module.cwrap("getSPSLen","number",[])(),n=Module.cwrap("getSPS","number",[])();if(!(i<0)){e.sps=new Uint8Array(i),e.sps.set(Module.HEAPU8.subarray(n,n+i),0);var r=Module.cwrap("getPPSLen","number",[])(),s=Module.cwrap("getPPS","number",[])();e.pps=new Uint8Array(r),e.pps.set(Module.HEAPU8.subarray(s,s+r),0);var o=Module.cwrap("getSEILen","number",[])(),u=Module.cwrap("getSEI","number",[])();e.sei=new Uint8Array(o),e.sei.set(Module.HEAPU8.subarray(u,u+o),0);var l=Module.cwrap("getVLCLen","number",[])(),d=Module.cwrap("getVLC","number",[])();if(t.vlc=new Uint8Array(l),t.vlc.set(Module.HEAPU8.subarray(d,d+l),0),this.mediaAttr.vCodec==a.DEF_HEVC||this.mediaAttr.vCodec==a.DEF_H265){var h=Module.cwrap("getVPSLen","number",[])(),c=Module.cwrap("getVPS","number",[])();e.vps=new Uint8Array(h),e.vps.set(Module.HEAPU8.subarray(c,c+h),0)}else this.mediaAttr.vCodec==a.DEF_AVC||(this.mediaAttr.vCodec,a.DEF_H264);return{nalu:e,vlc:t}}}},{key:"isHEVC",value:function(){return this.mediaAttr.vCodec==a.DEF_HEVC||this.mediaAttr.vCodec==a.DEF_H265}},{key:"readPacket",value:function(){var e=Module.cwrap("getPacket","number",[])(),t=Module.HEAPU32[e/4],i=Module.HEAPU32[e/4+1],n=Module.HEAPF64[e/8+1],r=Module.HEAPF64[e/8+1+1],s=Module.HEAPU32[e/4+1+1+2+2],o=Module.HEAPU32[e/4+1+1+2+2+1],u=Module.HEAPU8.subarray(o,o+i),l=this._readLayer();return{type:t,size:i,ptime:n,dtime:r,keyframe:s,src:u,data:1==t&&this.mediaAttr.aCodec==a.DEF_AAC?this.aacDec.sliceAACFrames(n,u):u,layer:l}}},{key:"_refreshDemuxer",value:function(){this.releaseTsDemuxer(),this._initDemuxer()}},{key:"_initDemuxer",value:function(){Module.cwrap("initTsMissile","number",[])(),Module.cwrap("initializeDemuxer","number",[])()}},{key:"releaseTsDemuxer",value:function(){Module.cwrap("exitTsMissile","number",[])()}}])&&n(i.prototype,s),o&&n(i,o),e}();i.MPEG_JS=s}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./consts":69,"./decoder/aac":70}],72:[function(e,t,i){"use strict";function n(e,t){for(var i=0;i0&&e.extensionInfo.vHeight>0&&(e.size.width=e.extensionInfo.vWidth,e.size.height=e.extensionInfo.vHeight);for(var t=null;!((t=e.mpegTsObj.readPacket()).size<=0);){var i=t.dtime;if(0==t.type){var n=s.PACK_NALU(t.layer),r=1==t.keyframe;e.bufObject.appendFrame(i,n,!0,r)}else if("aac"==e.mediaInfo.aCodec)for(var a=t.data,o=0;o0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;return t<0?null:1==e?this.bufObject.vFrame(t):2==e?this.bufObject.aFrame(t):void 0}},{key:"isHEVC",value:function(){return this.mpegTsObj.isHEVC()}},{key:"getACodec",value:function(){return this.aCodec}},{key:"getVCodec",value:function(){return this.vCodec}},{key:"getAudioNone",value:function(){return this.mpegTsObj.mediaAttr.audioNone}},{key:"getDurationMs",value:function(){return this.durationMs}},{key:"getFPS",value:function(){return this.fps}},{key:"getSampleRate",value:function(){return this.sampleRate}},{key:"getSize",value:function(){return this.size}},{key:"seek",value:function(e){if(e>=0){var t=this.bufObject.seekIDR(e);this.seekPos=t}}}])&&n(t.prototype,i),o&&n(t,o),e}();i.MpegTs=o},{"../decoder/hevc-imp":62,"./buffer":64,"./mpegts/mpeg.js":71}],73:[function(e,t,i){(function(t){"use strict";function n(e,t){for(var i=0;i0&&void 0!==arguments[0]&&arguments[0];return void 0!==this.player&&null!==this.player&&(this.player.setScreen(e),!0)}},{key:"play",value:function(){if(void 0===this.player||null===this.player)return!1;if(this.playParam.videoCodec===m.CODEC_H265){var e={seekPos:this._getSeekTarget(),mode:this.playMode,accurateSeek:this.configFormat.accurateSeek,seekEvent:!1,realPlay:!0};this.player.play(e)}else this.player.play();return!0}},{key:"pause",value:function(){return void 0!==this.player&&null!==this.player&&(this.player.pause(),!0)}},{key:"isPlaying",value:function(){return void 0!==this.player&&null!==this.player&&this.player.isPlayingState()}},{key:"setVoice",value:function(e){return!(e<0||void 0===this.player||null===this.player||(this.volume=e,this.player&&this.player.setVoice(e),0))}},{key:"getVolume",value:function(){return this.volume}},{key:"mediaInfo",value:function(){var e={meta:this.playParam,videoType:this.playMode};return e.meta.isHEVC=0===this.playParam.videoCodec,e}},{key:"_seekHLS",value:function(e,t,i){if(void 0===this.player||null===this.player)return!1;setTimeout((function(){t.player.getCachePTS(),t.player.getCachePTS()>e?i():t._seekHLS(e,t,i)}),100)}},{key:"seek",value:function(e){if(void 0===this.player||null===this.player)return!1;var t=this;this.seekTarget=e,this.onSeekStart&&this.onSeekStart(e),this.timerFeed&&(window.clearInterval(this.timerFeed),this.timerFeed=null);var i=this._getSeekTarget();return this.playParam.videoCodec===m.CODEC_H264?(this.player.seek(e),this.onSeekFinish&&this.onSeekFinish()):this.configFormat.extInfo.core===m.PLAYER_CORE_TYPE_CNATIVE?(this.pause(),this._seekHLS(e,this,(function(){t.player.seek((function(){}),{seekTime:i,mode:t.playMode,accurateSeek:t.configFormat.accurateSeek})}))):this._seekHLS(e,this,(function(){t.player.seek((function(){t.configFormat.type==m.PLAYER_IN_TYPE_MP4?t.mp4Obj.seek(e):t.configFormat.type==m.PLAYER_IN_TYPE_TS||t.configFormat.type==m.PLAYER_IN_TYPE_MPEGTS?t.mpegTsObj.seek(e):t.configFormat.type==m.PLAYER_IN_TYPE_M3U8&&(t.hlsObj.onSamples=null,t.hlsObj.seek(e));var i,n=(i=0,i=t.configFormat.accurateSeek?e:t._getBoxBufSeekIDR(),parseInt(i)),r=parseInt(t._getBoxBufSeekIDR())||0;t._avFeedMP4Data(r,n)}),{seekTime:i,mode:t.playMode,accurateSeek:t.configFormat.accurateSeek})})),!0}},{key:"fullScreen",value:function(){if(this.autoScreenClose=!0,this.player.vCodecID===m.V_CODEC_NAME_HEVC){var e=document.querySelector("#"+this.configFormat.playerId),t=e.getElementsByTagName("canvas")[0];e.style.width=this.screenW+"px",e.style.height=this.screenH+"px";var i=this._checkScreenDisplaySize(this.screenW,this.screenH,this.playParam.size.width,this.playParam.size.height);t.style.marginTop=i[0]+"px",t.style.marginLeft=i[1]+"px",t.style.width=i[2]+"px",t.style.height=i[3]+"px",this._requestFullScreen(e)}else this._requestFullScreen(this.player.videoTag)}},{key:"closeFullScreen",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!1===e&&(this.autoScreenClose=!1,this._exitFull()),this.player.vCodecID===m.V_CODEC_NAME_HEVC){var t=document.querySelector("#"+this.configFormat.playerId),i=t.getElementsByTagName("canvas")[0];t.style.width=this.configFormat.playerW+"px",t.style.height=this.configFormat.playerH+"px";var n=this._checkScreenDisplaySize(this.configFormat.playerW,this.configFormat.playerH,this.playParam.size.width,this.playParam.size.height);i.style.marginTop=n[0]+"px",i.style.marginLeft=n[1]+"px",i.style.width=n[2]+"px",i.style.height=n[3]+"px"}}},{key:"_checkScreenDisplaySize",value:function(e,t,i,n){var r=i/e>n/t,a=(e/i).toFixed(2),s=(t/n).toFixed(2),o=r?a:s,u=this.fixed?e:parseInt(i*o),l=this.fixed?t:parseInt(n*o);return[parseInt((t-l)/2),parseInt((e-u)/2),u,l]}},{key:"_isFullScreen",value:function(){var e=document.fullscreenElement||document.mozFullscreenElement||document.webkitFullscreenElement;return document.fullscreenEnabled||document.mozFullscreenEnabled||document.webkitFullscreenEnabled,null!=e}},{key:"_requestFullScreen",value:function(e){e.requestFullscreen?e.requestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.msRequestFullscreen?e.msRequestFullscreen():e.webkitRequestFullscreen&&e.webkitRequestFullScreen()}},{key:"_exitFull",value:function(){document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.msExitFullscreen&&document.msExitFullscreen()}},{key:"_durationText",value:function(e){if(e<0)return"Play";var t=Math.round(e);return Math.floor(t/3600)+":"+Math.floor(t%3600/60)+":"+Math.floor(t%60)}},{key:"_getSeekTarget",value:function(){return this.configFormat.accurateSeek?this.seekTarget:this._getBoxBufSeekIDR()}},{key:"_getBoxBufSeekIDR",value:function(){return this.configFormat.type==m.PLAYER_IN_TYPE_MP4?this.mp4Obj.seekPos:this.configFormat.type==m.PLAYER_IN_TYPE_TS||this.configFormat.type==m.PLAYER_IN_TYPE_MPEGTS?this.mpegTsObj.seekPos:this.configFormat.type==m.PLAYER_IN_TYPE_M3U8?this.hlsObj.seekPos:void 0}},{key:"_playControl",value:function(){this.isPlaying()?this.pause():this.play()}},{key:"_avFeedMP4Data",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(void 0===this.player||null===this.player)return!1;var r=parseInt(this.playParam.durationMs/1e3);this.player.clearAllCache(),this.timerFeed=window.setInterval((function(){var a=null,s=null,o=!0,u=!0;if(e.configFormat.type==m.PLAYER_IN_TYPE_MP4?(a=e.mp4Obj.popBuffer(1,t),s=e.mp4Obj.audioNone?null:e.mp4Obj.popBuffer(2,i)):e.configFormat.type==m.PLAYER_IN_TYPE_TS||e.configFormat.type==m.PLAYER_IN_TYPE_MPEGTS?(a=e.mpegTsObj.popBuffer(1,t),s=e.mpegTsObj.getAudioNone()?null:e.mpegTsObj.popBuffer(2,i)):e.configFormat.type==m.PLAYER_IN_TYPE_M3U8&&(a=e.hlsObj.popBuffer(1,t),s=e.hlsObj.audioNone?null:e.hlsObj.popBuffer(2,i),t=e.hlsObj.getLastIdx()&&(o=!1),i=e.hlsObj.getALastIdx()&&(u=!1)),!0===o&&null!=a)for(var l=0;lr)return window.clearInterval(e.timerFeed),e.timerFeed=null,e.player.vCachePTS,e.player.aCachePTS,void(null!=n&&n())}),5)}},{key:"_makeMP4Player",value:function(){return this.mediaExtProtocol===m.URI_PROTOCOL_WEBSOCKET_DESC?(this._cWsFLVDecoderEntry(),0):(null!=this.configFormat.extInfo.core&&null!==this.configFormat.extInfo.core&&this.configFormat.extInfo.core===m.PLAYER_CORE_TYPE_CNATIVE?this._cDemuxDecoderEntry():this.configFormat.type==m.PLAYER_IN_TYPE_MP4?this.configFormat.extInfo.moovStartFlag?this._mp4EntryVodStream():this._mp4Entry():this.configFormat.type==m.PLAYER_IN_TYPE_TS||this.configFormat.type==m.PLAYER_IN_TYPE_MPEGTS?this._mpegTsEntry():this.configFormat.type==m.PLAYER_IN_TYPE_M3U8?this._m3u8Entry():this.configFormat.type===m.PLAYER_IN_TYPE_RAW_265&&this._raw265Entry(),0)}},{key:"_makeMP4PlayerViewEvent",value:function(e,t,i,n){var a=this,s=arguments.length>4&&void 0!==arguments[4]&&arguments[4],o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null,u=this;if(this.playParam.durationMs=e,this.playParam.fps=t,this.playParam.sampleRate=i,this.playParam.size=n,this.playParam.audioNone=s,this.playParam.videoCodec=o||m.CODEC_H265,this.playParam,(this.configFormat.type==m.PLAYER_IN_TYPE_M3U8&&this.hlsConf.hlsType==m.PLAYER_IN_TYPE_M3U8_LIVE||this.configFormat.type==m.PLAYER_IN_TYPE_RAW_265)&&(this.playMode=m.PLAYER_MODE_NOTIME_LIVE),u.configFormat.extInfo.autoCrop){var l=document.querySelector("#"+this.configFormat.playerId),d=n.width/n.height,h=this.configFormat.playerW/this.configFormat.playerH;d>h?l.style.height=this.configFormat.playerW/d+"px":d=m.FETCH_FIRST_MAX_TIMES)return;i=new AbortController,n=i.signal,e(s+1)}}),m.FETCH_HTTP_FLV_TIMEOUT_MS),fetch(t.videoURL,{signal:n}).then((function(e){if(a=!0,e.headers.has("Content-Length"))o=e.headers.get("Content-Length"),t.player&&t.player.setProbeSize(o*t.configFormat.extInfo.coreProbePart);else{if(t.mediaExtFormat===m.PLAYER_IN_TYPE_FLV)return i.abort(),t.player.release(),t.player=null,t._cLiveFLVDecoderEntry(r),!0;t.player&&t.player.setProbeSize(4096)}return e.headers.get("Content-Length"),t.configFormat.type,t.mediaExtFormat,function e(i){return i.read().then((function(n){if(!n.done){n.value.buffer;var r=new Uint8Array(n.value.buffer);return t.player&&t.player.pushBuffer(r)<0?(t.player.release(),t.player=null,t._mp4EntryVodStream(),!1):e(i)}t.player&&t.player.pushDone()}))}(e.body.getReader())})).catch((function(e){e.toString().includes("user aborted")||console.error("cdemuxdecoder error",e)}))}(0)}},{key:"_cLiveFLVDecoderEntry",value:function(e){var t=this,i=this;e.probeSize=this.configFormat.extInfo.probeSize,this.player=new o.CHttpLiveCore(e),e.probeSize,this.player.onProbeFinish=function(){i.playParam.fps=i.player.mediaInfo.fps,i.playParam.durationMs=-1,i.playMode=m.PLAYER_MODE_NOTIME_LIVE,i.playParam.sampleRate=i.player.mediaInfo.sampleRate,i.playParam.size={width:i.player.mediaInfo.width,height:i.player.mediaInfo.height},i.playParam.audioNone=i.player.mediaInfo.audioNone,i.player.mediaInfo,i.player.vCodecID===m.V_CODEC_NAME_HEVC?(i.playParam.audioIdx<0&&(i.playParam.audioNone=!0),i.playParam.videoCodec=m.CODEC_H265,i.onLoadFinish&&i.onLoadFinish()):(i.playParam.videoCodec=m.CODEC_H264,i.player.release(),i.player=null,i._flvJsPlayer())},this.player.onNetworkError=function(e){i.onNetworkError&&i.onNetworkError(e)},this.player.onReadyShowDone=function(){i.configFormat.extInfo.readyShow=!1,i.onReadyShowDone&&i.onReadyShowDone()},this.player.onLoadCache=function(){null!=t.onLoadCache&&t.onLoadCache()},this.player.onLoadCacheFinshed=function(){null!=t.onLoadCacheFinshed&&t.onLoadCacheFinshed()},this.player.start(this.videoURL)}},{key:"_cWsFLVDecoderEntry",value:function(){var e=this,t=this,i={width:this.configFormat.playerW,height:this.configFormat.playerH,playerId:this.configFormat.playerId,token:this.configFormat.token,readyShow:this.configFormat.extInfo.readyShow,checkProbe:this.configFormat.extInfo.checkProbe,ignoreAudio:this.configFormat.extInfo.ignoreAudio,playMode:this.playMode};i.probeSize=this.configFormat.extInfo.probeSize,this.player=new u.CWsLiveCore(i),i.probeSize,this.player.onProbeFinish=function(){t.playParam.fps=t.player.mediaInfo.fps,t.playParam.durationMs=-1,t.playMode=m.PLAYER_MODE_NOTIME_LIVE,t.playParam.sampleRate=t.player.mediaInfo.sampleRate,t.playParam.size={width:t.player.mediaInfo.width,height:t.player.mediaInfo.height},t.playParam.audioNone=t.player.mediaInfo.audioNone,t.player.mediaInfo,t.player.vCodecID===m.V_CODEC_NAME_HEVC?(t.playParam.audioIdx<0&&(t.playParam.audioNone=!0),t.playParam.videoCodec=m.CODEC_H265,t.onLoadFinish&&t.onLoadFinish()):(t.playParam.videoCodec=m.CODEC_H264,t.player.release(),t.player=null,t._flvJsPlayer())},this.player.onNetworkError=function(e){t.onNetworkError&&t.onNetworkError(e)},this.player.onReadyShowDone=function(){t.configFormat.extInfo.readyShow=!1,t.onReadyShowDone&&t.onReadyShowDone()},this.player.onLoadCache=function(){null!=e.onLoadCache&&e.onLoadCache()},this.player.onLoadCacheFinshed=function(){null!=e.onLoadCacheFinshed&&e.onLoadCacheFinshed()},this.player.start(this.videoURL)}},{key:"_mpegTsEntry",value:function(){var e=this,t=new AbortController,i=t.signal;this.timerFeed=null,this.mpegTsObj=new f.MpegTs,this.mpegTsObj.bindReady(e),this.mpegTsObj.onDemuxed=this._mpegTsEntryReady.bind(this),this.mpegTsObj.onReady=function(){var n=null;fetch(e.videoURL,{signal:i}).then((function(r){if(r.headers.has("Content-Length"))return function t(i){return i.read().then((function(r){if(!r.done){var a=r.value;if(null===n)n=a;else{var s=a,o=n.length+s.length,u=new Uint8Array(o);u.set(n),u.set(s,n.length),n=new Uint8Array(u),s=null,u=null}return t(i)}e.mpegTsObj.demux(n)}))}(r.body.getReader());t.abort(),i=null,t=null;var a={width:e.configFormat.playerW,height:e.configFormat.playerH,playerId:e.configFormat.playerId,token:e.configFormat.token,readyShow:e.configFormat.extInfo.readyShow,checkProbe:e.configFormat.extInfo.checkProbe,ignoreAudio:e.configFormat.extInfo.ignoreAudio,playMode:e.playMode};e._cLiveFLVDecoderEntry(a)})).catch((function(e){if(!e.toString().includes("user aborted")){var t=" mpegts request error:"+e;console.error(t)}}))},this.mpegTsObj.initMPEG()}},{key:"_mpegTsEntryReady",value:function(e){var t=e,i=(t.mpegTsObj.getVCodec(),t.mpegTsObj.getACodec()),n=t.mpegTsObj.getDurationMs(),r=t.mpegTsObj.getFPS(),a=t.mpegTsObj.getSampleRate(),s=t.mpegTsObj.getSize(),o=this.mpegTsObj.isHEVC();if(!o)return this.mpegTsObj.releaseTsDemuxer(),this.mpegTsObj=null,this.playParam.durationMs=n,this.playParam.fps=r,this.playParam.sampleRate=a,this.playParam.size=s,this.playParam.audioNone=""==i,this.playParam.videoCodec=o?0:1,this.playParam,void(this.onLoadFinish&&this.onLoadFinish());t._makeMP4PlayerViewEvent(n,r,a,s,""==i),parseInt(n/1e3),t._avFeedMP4Data(0,0)}},{key:"_m3u8Entry",value:function(){var e=this,t=this,i=!1,n=0;this.hlsObj=new p.M3u8,this.hlsObj.bindReady(t),this.hlsObj.onFinished=function(e,r){0==i&&(n=t.hlsObj.getDurationMs(),t.hlsConf.hlsType=r.type,i=!0)},this.hlsObj.onCacheProcess=function(t){e.playMode!==m.PLAYER_MODE_NOTIME_LIVE&&e.onCacheProcess&&e.onCacheProcess(t)},this.hlsObj.onDemuxed=function(e){if(null==t.player){var i=t.hlsObj.isHevcParam,r=(t.hlsObj.getVCodec(),t.hlsObj.getACodec()),a=t.hlsObj.getFPS(),s=t.hlsObj.getSampleRate(),o=t.hlsObj.getSize(),u=!1;if(u=t.hlsObj.getSampleChannel()<=0||""===r,!i)return t.hlsObj.release(),t.hlsObj.mpegTsObj&&t.hlsObj.mpegTsObj.releaseTsDemuxer(),t.hlsObj=null,t.playParam.durationMs=-1,t.playParam.fps=a,t.playParam.sampleRate=s,t.playParam.size=o,t.playParam.audioNone=""==r,t.playParam.videoCodec=i?0:1,t.playParam,void t._videoJsPlayer();t._makeMP4PlayerViewEvent(n,a,s,o,u)}},this.hlsObj.onSamples=this._hlsOnSamples.bind(this),this.hlsObj.demux(this.videoURL)}},{key:"_hlsOnSamples",value:function(e,t){1==t.video?this.player.appendHevcFrame(t):!1===this.hlsObj.audioNone&&this.player.appendAACFrame(t)}},{key:"_videoJsPlayer",value:function(){var e=this,t={width:this.configFormat.playerW,height:this.configFormat.playerH,playerId:this.configFormat.playerId,ignoreAudio:this.configFormat.extInfo.ignoreAudio};this.player=new l.NvVideojsCore(t),this.player.onMakeItReady=function(){e.onMakeItReady&&e.onMakeItReady()},this.player.onLoadFinish=function(){e.playParam.size=e.player.getSize(),e.player.duration===1/0||e.player.duration<0?(e.playParam.durationMs=-1,e.playMode=m.PLAYER_MODE_NOTIME_LIVE):(e.playParam.durationMs=1e3*e.player.duration,e.playMode=m.PLAYER_MODE_VOD),e.onLoadFinish&&e.onLoadFinish()},this.player.onReadyShowDone=function(){e.onReadyShowDone&&e.onReadyShowDone()},this.player.onPlayingFinish=function(){e.pause(),e.seek(0),null!=e.onPlayFinish&&e.onPlayFinish()},this.player.onPlayingTime=function(t){e._durationText(t),e._durationText(e.player.duration),null!=e.onPlayTime&&e.onPlayTime(t)},this.player.onSeekFinish=function(){e.onSeekFinish&&e.onSeekFinish()},this.player.makeIt(this.videoURL)}},{key:"_flvJsPlayer",value:function(){var e=this,t={width:this.configFormat.playerW,height:this.configFormat.playerH,playerId:this.configFormat.playerId,ignoreAudio:this.configFormat.extInfo.ignoreAudio};this.player=new d.NvFlvjsCore(t),this.player.onLoadFinish=function(){e.playParam.size=e.player.getSize(),!e.player.duration||NaN===e.player.duration||e.player.duration===1/0||e.player.duration<0?(e.playParam.durationMs=-1,e.playMode=m.PLAYER_MODE_NOTIME_LIVE):(e.playParam.durationMs=1e3*e.player.duration,e.playMode=m.PLAYER_MODE_VOD),e.onLoadFinish&&e.onLoadFinish()},this.player.onReadyShowDone=function(){e.onReadyShowDone&&e.onReadyShowDone()},this.player.onPlayingTime=function(t){e._durationText(t),e._durationText(e.player.duration),null!=e.onPlayTime&&e.onPlayTime(t)},this.player.onPlayingFinish=function(){e.pause(),e.seek(0),null!=e.onPlayFinish&&e.onPlayFinish()},this.player.makeIt(this.videoURL)}},{key:"_raw265Entry",value:function(){this._makeMP4PlayerViewEvent(-1,this.configFormat.extInfo.rawFps,-1,{width:this.configFormat.playerW,height:this.configFormat.playerH},!0,m.CODEC_H265),this.timerFeed&&(window.clearInterval(this.timerFeed),this.timerFeed=null)}},{key:"append265NaluFrame",value:function(e){var t={data:e,pts:this.rawModePts};this.player.appendHevcFrame(t),this.configFormat.extInfo.readyShow&&this.player.cacheYuvBuf.getState()!=CACHE_APPEND_STATUS_CODE.NULL&&(this.player.playFrameYUV(!0,!0),this.configFormat.extInfo.readyShow=!1,this.onReadyShowDone&&this.onReadyShowDone()),this.rawModePts+=1/this.configFormat.extInfo.rawFps}}])&&n(i.prototype,v),b&&n(i,b),e}();i.H265webjs=v,t.new265webjs=function(e,t){return new v(e,t)}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./consts":52,"./decoder/av-common":55,"./decoder/c-httplive-core":56,"./decoder/c-native-core":57,"./decoder/c-wslive-core":58,"./decoder/cache":59,"./decoder/player-core":63,"./demuxer/m3u8":66,"./demuxer/mp4":68,"./demuxer/mpegts/mpeg.js":71,"./demuxer/ts":72,"./native/mp4-player":74,"./native/nv-flvjs-core":75,"./native/nv-videojs-core":76,"./utils/static-mem":78,"./utils/ui/ui":79}],74:[function(e,t,i){"use strict";function n(e,t){for(var i=0;i>1,a>>1,i),e.v.fill(r>>1,a>>1,n),e.drawArrays(e.TRIANGLE_STRIP,0,4)},setupCanvas:function(e,t){var i=e.getContext("webgl")||e.getContext("experimental-webgl");if(!i)return i;var r=i.createProgram(),a=["attribute highp vec4 aVertexPosition;","attribute vec2 aTextureCoord;","varying highp vec2 vTextureCoord;","void main(void) {"," gl_Position = aVertexPosition;"," vTextureCoord = aTextureCoord;","}"].join("\n"),s=i.createShader(i.VERTEX_SHADER);i.shaderSource(s,a),i.compileShader(s);var o=["precision highp float;","varying lowp vec2 vTextureCoord;","uniform sampler2D YTexture;","uniform sampler2D UTexture;","uniform sampler2D VTexture;","const mat4 YUV2RGB = mat4","("," 1.1643828125, 0, 1.59602734375, -.87078515625,"," 1.1643828125, -.39176171875, -.81296875, .52959375,"," 1.1643828125, 2.017234375, 0, -1.081390625,"," 0, 0, 0, 1",");","void main(void) {"," gl_FragColor = vec4( texture2D(YTexture, vTextureCoord).x, texture2D(UTexture, vTextureCoord).x, texture2D(VTexture, vTextureCoord).x, 1) * YUV2RGB;","}"].join("\n"),u=i.createShader(i.FRAGMENT_SHADER);i.shaderSource(u,o),i.compileShader(u),i.attachShader(r,s),i.attachShader(r,u),i.linkProgram(r),i.useProgram(r),i.getProgramParameter(r,i.LINK_STATUS);var l=i.getAttribLocation(r,"aVertexPosition");i.enableVertexAttribArray(l);var d=i.getAttribLocation(r,"aTextureCoord");i.enableVertexAttribArray(d);var h=i.createBuffer();i.bindBuffer(i.ARRAY_BUFFER,h),i.bufferData(i.ARRAY_BUFFER,new Float32Array([1,1,0,-1,1,0,1,-1,0,-1,-1,0]),i.STATIC_DRAW),i.vertexAttribPointer(l,3,i.FLOAT,!1,0,0);var c=i.createBuffer();return i.bindBuffer(i.ARRAY_BUFFER,c),i.bufferData(i.ARRAY_BUFFER,new Float32Array([1,0,0,0,1,1,0,1]),i.STATIC_DRAW),i.vertexAttribPointer(d,2,i.FLOAT,!1,0,0),i.y=new n(i),i.u=new n(i),i.v=new n(i),i.y.bind(0,r,"YTexture"),i.u.bind(1,r,"UTexture"),i.v.bind(2,r,"VTexture"),i}}},{}],78:[function(e,t,i){(function(e){"use strict";e.STATIC_MEM_wasmDecoderState=-1,e.STATICE_MEM_playerCount=-1,e.STATICE_MEM_playerIndexPtr=0}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],79:[function(e,t,i){"use strict";function n(e,t){for(var i=0;i>2),m=new s(Array.prototype.slice.call(t)),g=new Uint8Array(e.byteLength),_=new Int32Array(g.buffer);for(n=i[0],r=i[1],a=i[2],o=i[3],f=0;f=0&&(t="main-desc"),t},Io=function(e,t){e.abort(),e.pause(),t&&t.activePlaylistLoader&&(t.activePlaylistLoader.pause(),t.activePlaylistLoader=null)},Po=function(e,t){t.activePlaylistLoader=e,e.load()},Lo={AUDIO:function(e,t){return function(){var i=t.segmentLoaders[e],n=t.mediaTypes[e],r=t.blacklistCurrentPlaylist;Io(i,n);var a=n.activeTrack(),s=n.activeGroup(),o=(s.filter((function(e){return e.default}))[0]||s[0]).id,u=n.tracks[o];if(a!==u){for(var l in Yr.log.warn("Problem encountered loading the alternate audio track.Switching back to default."),n.tracks)n.tracks[l].enabled=n.tracks[l]===u;n.onTrackChanged()}else r({message:"Problem encountered loading the default audio track."})}},SUBTITLES:function(e,t){return function(){var i=t.segmentLoaders[e],n=t.mediaTypes[e];Yr.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track."),Io(i,n);var r=n.activeTrack();r&&(r.mode="disabled"),n.onTrackChanged()}}},Do={AUDIO:function(e,t,i){if(t){var n=i.tech,r=i.requestOptions,a=i.segmentLoaders[e];t.on("loadedmetadata",(function(){var e=t.media();a.playlist(e,r),(!n.paused()||e.endList&&"none"!==n.preload())&&a.load()})),t.on("loadedplaylist",(function(){a.playlist(t.media(),r),n.paused()||a.load()})),t.on("error",Lo[e](e,i))}},SUBTITLES:function(e,t,i){var n=i.tech,r=i.requestOptions,a=i.segmentLoaders[e],s=i.mediaTypes[e];t.on("loadedmetadata",(function(){var e=t.media();a.playlist(e,r),a.track(s.activeTrack()),(!n.paused()||e.endList&&"none"!==n.preload())&&a.load()})),t.on("loadedplaylist",(function(){a.playlist(t.media(),r),n.paused()||a.load()})),t.on("error",Lo[e](e,i))}},Uo={AUDIO:function(e,t){var i=t.vhs,n=t.sourceType,r=t.segmentLoaders[e],a=t.requestOptions,s=t.master.mediaGroups,o=t.mediaTypes[e],u=o.groups,l=o.tracks,d=o.logger_,h=t.masterPlaylistLoader,c=ba(h.master);for(var f in s[e]&&0!==Object.keys(s[e]).length||(s[e]={main:{default:{default:!0}}},c&&(s[e].main.default.playlists=h.master.playlists)),s[e])for(var p in u[f]||(u[f]=[]),s[e][f]){var m=s[e][f][p],g=void 0;if(c?(d("AUDIO group '"+f+"' label '"+p+"' is a master playlist"),m.isMasterPlaylist=!0,g=null):g="vhs-json"===n&&m.playlists?new Oa(m.playlists[0],i,a):m.resolvedUri?new Oa(m.resolvedUri,i,a):m.playlists&&"dash"===n?new is(m.playlists[0],i,a,h):null,m=Yr.mergeOptions({id:p,playlistLoader:g},m),Do[e](e,m.playlistLoader,t),u[f].push(m),void 0===l[p]){var _=new Yr.AudioTrack({id:p,kind:xo(m),enabled:!1,language:m.language,default:m.default,label:p});l[p]=_}}r.on("error",Lo[e](e,t))},SUBTITLES:function(e,t){var i=t.tech,n=t.vhs,r=t.sourceType,a=t.segmentLoaders[e],s=t.requestOptions,o=t.master.mediaGroups,u=t.mediaTypes[e],l=u.groups,d=u.tracks,h=t.masterPlaylistLoader;for(var c in o[e])for(var f in l[c]||(l[c]=[]),o[e][c])if(!o[e][c][f].forced){var p=o[e][c][f],m=void 0;if("hls"===r)m=new Oa(p.resolvedUri,n,s);else if("dash"===r){if(!p.playlists.filter((function(e){return e.excludeUntil!==1/0})).length)return;m=new is(p.playlists[0],n,s,h)}else"vhs-json"===r&&(m=new Oa(p.playlists?p.playlists[0]:p.resolvedUri,n,s));if(p=Yr.mergeOptions({id:f,playlistLoader:m},p),Do[e](e,p.playlistLoader,t),l[c].push(p),void 0===d[f]){var g=i.addRemoteTextTrack({id:f,kind:"subtitles",default:p.default&&p.autoselect,language:p.language,label:f},!1).track;d[f]=g}}a.on("error",Lo[e](e,t))},"CLOSED-CAPTIONS":function(e,t){var i=t.tech,n=t.master.mediaGroups,r=t.mediaTypes[e],a=r.groups,s=r.tracks;for(var o in n[e])for(var u in a[o]||(a[o]=[]),n[e][o]){var l=n[e][o][u];if(/^(?:CC|SERVICE)/.test(l.instreamId)){var d=i.options_.vhs&&i.options_.vhs.captionServices||{},h={label:u,language:l.language,instreamId:l.instreamId,default:l.default&&l.autoselect};if(d[h.instreamId]&&(h=Yr.mergeOptions(h,d[h.instreamId])),void 0===h.default&&delete h.default,a[o].push(Yr.mergeOptions({id:u},l)),void 0===s[u]){var c=i.addRemoteTextTrack({id:h.instreamId,kind:"captions",default:h.default,language:h.language,label:h.label},!1).track;s[u]=c}}}}},Ro=function e(t,i){for(var n=0;n1&&ba(t.master))for(var u=0;u "+a+" from "+t),this.tech_.trigger({type:"usage",name:"vhs-rendition-change-"+t})),this.masterPlaylistLoader_.media(e,i)},i.startABRTimer_=function(){var e=this;this.stopABRTimer_(),this.abrTimer_=A.default.setInterval((function(){return e.checkABR_()}),250)},i.stopABRTimer_=function(){this.tech_.scrubbing&&this.tech_.scrubbing()||(A.default.clearInterval(this.abrTimer_),this.abrTimer_=null)},i.getAudioTrackPlaylists_=function(){var e=this.master(),t=e&&e.playlists||[];if(!e||!e.mediaGroups||!e.mediaGroups.AUDIO)return t;var i,n=e.mediaGroups.AUDIO,r=Object.keys(n);if(Object.keys(this.mediaTypes_.AUDIO.groups).length)i=this.mediaTypes_.AUDIO.activeTrack();else{var a=n.main||r.length&&n[r[0]];for(var s in a)if(a[s].default){i={label:s};break}}if(!i)return t;var o=[];for(var u in n)if(n[u][i.label]){var l=n[u][i.label];if(l.playlists&&l.playlists.length)o.push.apply(o,l.playlists);else if(l.uri)o.push(l);else if(e.playlists.length)for(var d=0;d1&&(this.tech_.trigger({type:"usage",name:"vhs-alternate-audio"}),this.tech_.trigger({type:"usage",name:"hls-alternate-audio"})),this.useCueTags_&&(this.tech_.trigger({type:"usage",name:"vhs-playlist-cue-tags"}),this.tech_.trigger({type:"usage",name:"hls-playlist-cue-tags"}))},i.shouldSwitchToMedia_=function(e){var t=this.masterPlaylistLoader_.media(),i=this.tech_.buffered();return function(e){var t=e.currentPlaylist,i=e.nextPlaylist,n=e.forwardBuffer,r=e.bufferLowWaterLine,a=e.bufferHighWaterLine,s=e.duration,o=e.experimentalBufferBasedABR,u=e.log;if(!i)return Yr.log.warn("We received no playlist to switch to. Please check your stream."),!1;var l="allowing switch "+(t&&t.id||"null")+" -> "+i.id;if(!t)return u(l+" as current playlist is not set"),!0;if(i.id===t.id)return!1;if(!t.endList)return u(l+" as current playlist is live"),!0;var d=o?ns.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:ns.MAX_BUFFER_LOW_WATER_LINE;if(sc)&&n>=r){var p=l+" as forwardBuffer >= bufferLowWaterLine ("+n+" >= "+r+")";return o&&(p+=" and next bandwidth > current bandwidth ("+h+" > "+c+")"),u(p),!0}return u("not "+l+" as no switching criteria met"),!1}({currentPlaylist:t,nextPlaylist:e,forwardBuffer:i.length?i.end(i.length-1)-this.tech_.currentTime():0,bufferLowWaterLine:this.bufferLowWaterLine(),bufferHighWaterLine:this.bufferHighWaterLine(),duration:this.duration(),experimentalBufferBasedABR:this.experimentalBufferBasedABR,log:this.logger_})},i.setupSegmentLoaderListeners_=function(){var e=this;this.experimentalBufferBasedABR||(this.mainSegmentLoader_.on("bandwidthupdate",(function(){var t=e.selectPlaylist();e.shouldSwitchToMedia_(t)&&e.switchMedia_(t,"bandwidthupdate"),e.tech_.trigger("bandwidthupdate")})),this.mainSegmentLoader_.on("progress",(function(){e.trigger("progress")}))),this.mainSegmentLoader_.on("error",(function(){e.blacklistCurrentPlaylist(e.mainSegmentLoader_.error())})),this.mainSegmentLoader_.on("appenderror",(function(){e.error=e.mainSegmentLoader_.error_,e.trigger("error")})),this.mainSegmentLoader_.on("syncinfoupdate",(function(){e.onSyncInfoUpdate_()})),this.mainSegmentLoader_.on("timestampoffset",(function(){e.tech_.trigger({type:"usage",name:"vhs-timestamp-offset"}),e.tech_.trigger({type:"usage",name:"hls-timestamp-offset"})})),this.audioSegmentLoader_.on("syncinfoupdate",(function(){e.onSyncInfoUpdate_()})),this.audioSegmentLoader_.on("appenderror",(function(){e.error=e.audioSegmentLoader_.error_,e.trigger("error")})),this.mainSegmentLoader_.on("ended",(function(){e.logger_("main segment loader ended"),e.onEndOfStream()})),this.mainSegmentLoader_.on("earlyabort",(function(t){e.experimentalBufferBasedABR||(e.delegateLoaders_("all",["abort"]),e.blacklistCurrentPlaylist({message:"Aborted early because there isn't enough bandwidth to complete the request without rebuffering."},120))}));var t=function(){if(!e.sourceUpdater_.hasCreatedSourceBuffers())return e.tryToCreateSourceBuffers_();var t=e.getCodecsOrExclude_();t&&e.sourceUpdater_.addOrChangeSourceBuffers(t)};this.mainSegmentLoader_.on("trackinfo",t),this.audioSegmentLoader_.on("trackinfo",t),this.mainSegmentLoader_.on("fmp4",(function(){e.triggeredFmp4Usage||(e.tech_.trigger({type:"usage",name:"vhs-fmp4"}),e.tech_.trigger({type:"usage",name:"hls-fmp4"}),e.triggeredFmp4Usage=!0)})),this.audioSegmentLoader_.on("fmp4",(function(){e.triggeredFmp4Usage||(e.tech_.trigger({type:"usage",name:"vhs-fmp4"}),e.tech_.trigger({type:"usage",name:"hls-fmp4"}),e.triggeredFmp4Usage=!0)})),this.audioSegmentLoader_.on("ended",(function(){e.logger_("audioSegmentLoader ended"),e.onEndOfStream()}))},i.mediaSecondsLoaded_=function(){return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded+this.mainSegmentLoader_.mediaSecondsLoaded)},i.load=function(){this.mainSegmentLoader_.load(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.load(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.load()},i.smoothQualityChange_=function(e){void 0===e&&(e=this.selectPlaylist()),this.fastQualityChange_(e)},i.fastQualityChange_=function(e){var t=this;void 0===e&&(e=this.selectPlaylist()),e!==this.masterPlaylistLoader_.media()?(this.switchMedia_(e,"fast-quality"),this.mainSegmentLoader_.resetEverything((function(){Yr.browser.IE_VERSION||Yr.browser.IS_EDGE?t.tech_.setCurrentTime(t.tech_.currentTime()+.04):t.tech_.setCurrentTime(t.tech_.currentTime())}))):this.logger_("skipping fastQualityChange because new media is same as old")},i.play=function(){if(!this.setupFirstPlay()){this.tech_.ended()&&this.tech_.setCurrentTime(0),this.hasPlayed_&&this.load();var e=this.tech_.seekable();return this.tech_.duration()===1/0&&this.tech_.currentTime()this.maxPlaylistRetries?1/0:Date.now()+1e3*t,i.excludeUntil=n,e.reason&&(i.lastExcludeReason_=e.reason),this.tech_.trigger("blacklistplaylist"),this.tech_.trigger({type:"usage",name:"vhs-rendition-blacklisted"}),this.tech_.trigger({type:"usage",name:"hls-rendition-blacklisted"});var u=this.selectPlaylist();if(!u)return this.error="Playback cannot continue. No available working or supported playlists.",void this.trigger("error");var l=e.internal?this.logger_:Yr.log.warn,d=e.message?" "+e.message:"";l((e.internal?"Internal problem":"Problem")+" encountered with playlist "+i.id+"."+d+" Switching to playlist "+u.id+"."),u.attributes.AUDIO!==i.attributes.AUDIO&&this.delegateLoaders_("audio",["abort","pause"]),u.attributes.SUBTITLES!==i.attributes.SUBTITLES&&this.delegateLoaders_("subtitle",["abort","pause"]),this.delegateLoaders_("main",["abort","pause"]);var h=u.targetDuration/2*1e3||5e3,c="number"==typeof u.lastRequest&&Date.now()-u.lastRequest<=h;return this.switchMedia_(u,"exclude",s||c)},i.pauseLoading=function(){this.delegateLoaders_("all",["abort","pause"]),this.stopABRTimer_()},i.delegateLoaders_=function(e,t){var i=this,n=[],r="all"===e;(r||"main"===e)&&n.push(this.masterPlaylistLoader_);var a=[];(r||"audio"===e)&&a.push("AUDIO"),(r||"subtitle"===e)&&(a.push("CLOSED-CAPTIONS"),a.push("SUBTITLES")),a.forEach((function(e){var t=i.mediaTypes_[e]&&i.mediaTypes_[e].activePlaylistLoader;t&&n.push(t)})),["main","audio","subtitle"].forEach((function(t){var r=i[t+"SegmentLoader_"];!r||e!==t&&"all"!==e||n.push(r)})),n.forEach((function(e){return t.forEach((function(t){"function"==typeof e[t]&&e[t]()}))}))},i.setCurrentTime=function(e){var t=Zr(this.tech_.buffered(),e);return this.masterPlaylistLoader_&&this.masterPlaylistLoader_.media()&&this.masterPlaylistLoader_.media().segments?t&&t.length?e:(this.mainSegmentLoader_.resetEverything(),this.mainSegmentLoader_.abort(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.resetEverything(),this.audioSegmentLoader_.abort()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.resetEverything(),this.subtitleSegmentLoader_.abort()),void this.load()):0},i.duration=function(){if(!this.masterPlaylistLoader_)return 0;var e=this.masterPlaylistLoader_.media();return e?e.endList?this.mediaSource?this.mediaSource.duration:Zs.Playlist.duration(e):1/0:0},i.seekable=function(){return this.seekable_},i.onSyncInfoUpdate_=function(){var e;if(this.masterPlaylistLoader_){var t=this.masterPlaylistLoader_.media();if(t){var i=this.syncController_.getExpiredTime(t,this.duration());if(null!==i){var n=this.masterPlaylistLoader_.master,r=Zs.Playlist.seekable(t,i,Zs.Playlist.liveEdgeDelay(n,t));if(0!==r.length){if(this.mediaTypes_.AUDIO.activePlaylistLoader){if(t=this.mediaTypes_.AUDIO.activePlaylistLoader.media(),null===(i=this.syncController_.getExpiredTime(t,this.duration())))return;if(0===(e=Zs.Playlist.seekable(t,i,Zs.Playlist.liveEdgeDelay(n,t))).length)return}var a,s;this.seekable_&&this.seekable_.length&&(a=this.seekable_.end(0),s=this.seekable_.start(0)),e?e.start(0)>r.end(0)||r.start(0)>e.end(0)?this.seekable_=r:this.seekable_=Yr.createTimeRanges([[e.start(0)>r.start(0)?e.start(0):r.start(0),e.end(0)0&&(n=Math.max(n,i.end(i.length-1))),this.mediaSource.duration!==n&&this.sourceUpdater_.setDuration(n)}},i.dispose=function(){var e=this;this.trigger("dispose"),this.decrypter_.terminate(),this.masterPlaylistLoader_.dispose(),this.mainSegmentLoader_.dispose(),this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_),["AUDIO","SUBTITLES"].forEach((function(t){var i=e.mediaTypes_[t].groups;for(var n in i)i[n].forEach((function(e){e.playlistLoader&&e.playlistLoader.dispose()}))})),this.audioSegmentLoader_.dispose(),this.subtitleSegmentLoader_.dispose(),this.sourceUpdater_.dispose(),this.timelineChangeController_.dispose(),this.stopABRTimer_(),this.updateDuration_&&this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.mediaSource.removeEventListener("durationchange",this.handleDurationChange_),this.mediaSource.removeEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.removeEventListener("sourceended",this.handleSourceEnded_),this.off()},i.master=function(){return this.masterPlaylistLoader_.master},i.media=function(){return this.masterPlaylistLoader_.media()||this.initialMedia_},i.areMediaTypesKnown_=function(){var e=!!this.mediaTypes_.AUDIO.activePlaylistLoader,t=!!this.mainSegmentLoader_.getCurrentMediaInfo_(),i=!e||!!this.audioSegmentLoader_.getCurrentMediaInfo_();return!(!t||!i)},i.getCodecsOrExclude_=function(){var e=this,t={main:this.mainSegmentLoader_.getCurrentMediaInfo_()||{},audio:this.audioSegmentLoader_.getCurrentMediaInfo_()||{}};t.video=t.main;var i=Os(this.master(),this.media()),n={},r=!!this.mediaTypes_.AUDIO.activePlaylistLoader;if(t.main.hasVideo&&(n.video=i.video||t.main.videoCodec||g.DEFAULT_VIDEO_CODEC),t.main.isMuxed&&(n.video+=","+(i.audio||t.main.audioCodec||g.DEFAULT_AUDIO_CODEC)),(t.main.hasAudio&&!t.main.isMuxed||t.audio.hasAudio||r)&&(n.audio=i.audio||t.main.audioCodec||t.audio.audioCodec||g.DEFAULT_AUDIO_CODEC,t.audio.isFmp4=t.main.hasAudio&&!t.main.isMuxed?t.main.isFmp4:t.audio.isFmp4),n.audio||n.video){var a,s={};if(["video","audio"].forEach((function(e){if(n.hasOwnProperty(e)&&(r=t[e].isFmp4,o=n[e],!(r?g.browserSupportsCodec(o):g.muxerSupportsCodec(o)))){var i=t[e].isFmp4?"browser":"muxer";s[i]=s[i]||[],s[i].push(n[e]),"audio"===e&&(a=i)}var r,o})),r&&a&&this.media().attributes.AUDIO){var o=this.media().attributes.AUDIO;this.master().playlists.forEach((function(t){(t.attributes&&t.attributes.AUDIO)===o&&t!==e.media()&&(t.excludeUntil=1/0)})),this.logger_("excluding audio group "+o+" as "+a+' does not support codec(s): "'+n.audio+'"')}if(!Object.keys(s).length){if(this.sourceUpdater_.hasCreatedSourceBuffers()&&!this.sourceUpdater_.canChangeType()){var u=[];if(["video","audio"].forEach((function(t){var i=(g.parseCodecs(e.sourceUpdater_.codecs[t]||"")[0]||{}).type,r=(g.parseCodecs(n[t]||"")[0]||{}).type;i&&r&&i.toLowerCase()!==r.toLowerCase()&&u.push('"'+e.sourceUpdater_.codecs[t]+'" -> "'+n[t]+'"')})),u.length)return void this.blacklistCurrentPlaylist({playlist:this.media(),message:"Codec switching not supported: "+u.join(", ")+".",blacklistDuration:1/0,internal:!0})}return n}var l=Object.keys(s).reduce((function(e,t){return e&&(e+=", "),e+=t+' does not support codec(s): "'+s[t].join(",")+'"'}),"")+".";this.blacklistCurrentPlaylist({playlist:this.media(),internal:!0,message:l,blacklistDuration:1/0})}else this.blacklistCurrentPlaylist({playlist:this.media(),message:"Could not determine codecs for playlist.",blacklistDuration:1/0})},i.tryToCreateSourceBuffers_=function(){if("open"===this.mediaSource.readyState&&!this.sourceUpdater_.hasCreatedSourceBuffers()&&this.areMediaTypesKnown_()){var e=this.getCodecsOrExclude_();if(e){this.sourceUpdater_.createSourceBuffers(e);var t=[e.video,e.audio].filter(Boolean).join(",");this.excludeIncompatibleVariants_(t)}}},i.excludeUnsupportedVariants_=function(){var e=this,t=this.master().playlists,i=[];Object.keys(t).forEach((function(n){var r=t[n];if(-1===i.indexOf(r.id)){i.push(r.id);var a=Os(e.master,r),s=[];!a.audio||g.muxerSupportsCodec(a.audio)||g.browserSupportsCodec(a.audio)||s.push("audio codec "+a.audio),!a.video||g.muxerSupportsCodec(a.video)||g.browserSupportsCodec(a.video)||s.push("video codec "+a.video),a.text&&"stpp.ttml.im1t"===a.text&&s.push("text codec "+a.text),s.length&&(r.excludeUntil=1/0,e.logger_("excluding "+r.id+" for unsupported: "+s.join(", ")))}}))},i.excludeIncompatibleVariants_=function(e){var t=this,i=[],n=this.master().playlists,r=Us(g.parseCodecs(e)),a=Rs(r),s=r.video&&g.parseCodecs(r.video)[0]||null,o=r.audio&&g.parseCodecs(r.audio)[0]||null;Object.keys(n).forEach((function(e){var r=n[e];if(-1===i.indexOf(r.id)&&r.excludeUntil!==1/0){i.push(r.id);var u=[],l=Os(t.masterPlaylistLoader_.master,r),d=Rs(l);if(l.audio||l.video){if(d!==a&&u.push('codec count "'+d+'" !== "'+a+'"'),!t.sourceUpdater_.canChangeType()){var h=l.video&&g.parseCodecs(l.video)[0]||null,c=l.audio&&g.parseCodecs(l.audio)[0]||null;h&&s&&h.type.toLowerCase()!==s.type.toLowerCase()&&u.push('video codec "'+h.type+'" !== "'+s.type+'"'),c&&o&&c.type.toLowerCase()!==o.type.toLowerCase()&&u.push('audio codec "'+c.type+'" !== "'+o.type+'"')}u.length&&(r.excludeUntil=1/0,t.logger_("blacklisting "+r.id+": "+u.join(" && ")))}}}))},i.updateAdCues_=function(e){var t=0,i=this.seekable();i.length&&(t=i.start(0)),function(e,t,i){if(void 0===i&&(i=0),e.segments)for(var n,r=i,a=0;a0&&this.logger_("resetting possible stalled download count for "+e+" loader"),this[e+"StalledDownloads_"]=0,this[e+"Buffered_"]=t.buffered_()},t.checkSegmentDownloads_=function(e){var t=this.masterPlaylistController_,i=t[e+"SegmentLoader_"],n=i.buffered_(),r=function(e,t){if(e===t)return!1;if(!e&&t||!t&&e)return!0;if(e.length!==t.length)return!0;for(var i=0;i=t.end(t.length-1)))return this.techWaiting_();this.consecutiveUpdates>=5&&e===this.lastRecordedTime?(this.consecutiveUpdates++,this.waiting_()):e===this.lastRecordedTime?this.consecutiveUpdates++:(this.consecutiveUpdates=0,this.lastRecordedTime=e)}},t.cancelTimer_=function(){this.consecutiveUpdates=0,this.timer_&&(this.logger_("cancelTimer_"),clearTimeout(this.timer_)),this.timer_=null},t.fixesBadSeeks_=function(){if(!this.tech_.seeking())return!1;var e,t=this.seekable(),i=this.tech_.currentTime();this.afterSeekableWindow_(t,i,this.media(),this.allowSeeksWithinUnsafeLiveWindow)&&(e=t.end(t.length-1));if(this.beforeSeekableWindow_(t,i)){var n=t.start(0);e=n+(n===t.end(0)?0:.1)}if(void 0!==e)return this.logger_("Trying to seek outside of seekable at time "+i+" with seekable range "+ta(t)+". Seeking to "+e+"."),this.tech_.setCurrentTime(e),!0;var r=this.tech_.buffered();return!!function(e){var t=e.buffered,i=e.targetDuration,n=e.currentTime;return!!t.length&&(!(t.end(0)-t.start(0)<2*i)&&(!(n>t.start(0))&&t.start(0)-n "+i.end(0)+"]. Attempting to resume playback by seeking to the current time."),this.tech_.trigger({type:"usage",name:"vhs-unknown-waiting"}),void this.tech_.trigger({type:"usage",name:"hls-unknown-waiting"})):void 0}},t.techWaiting_=function(){var e=this.seekable(),t=this.tech_.currentTime();if(this.tech_.seeking()&&this.fixesBadSeeks_())return!0;if(this.tech_.seeking()||null!==this.timer_)return!0;if(this.beforeSeekableWindow_(e,t)){var i=e.end(e.length-1);return this.logger_("Fell out of live window at time "+t+". Seeking to live point (seekable end) "+i),this.cancelTimer_(),this.tech_.setCurrentTime(i),this.tech_.trigger({type:"usage",name:"vhs-live-resync"}),this.tech_.trigger({type:"usage",name:"hls-live-resync"}),!0}var n=this.tech_.vhs.masterPlaylistController_.sourceUpdater_,r=this.tech_.buffered();if(this.videoUnderflow_({audioBuffered:n.audioBuffered(),videoBuffered:n.videoBuffered(),currentTime:t}))return this.cancelTimer_(),this.tech_.setCurrentTime(t),this.tech_.trigger({type:"usage",name:"vhs-video-underflow"}),this.tech_.trigger({type:"usage",name:"hls-video-underflow"}),!0;var a=ea(r,t);if(a.length>0){var s=a.start(0)-t;return this.logger_("Stopped at "+t+", setting timer for "+s+", seeking to "+a.start(0)),this.cancelTimer_(),this.timer_=setTimeout(this.skipTheGap_.bind(this),1e3*s,t),!0}return!1},t.afterSeekableWindow_=function(e,t,i,n){if(void 0===n&&(n=!1),!e.length)return!1;var r=e.end(e.length-1)+.1;return!i.endList&&n&&(r=e.end(e.length-1)+3*i.targetDuration),t>r},t.beforeSeekableWindow_=function(e,t){return!!(e.length&&e.start(0)>0&&t2)return{start:r,end:a}}return null},e}(),zo={errorInterval:30,getSource:function(e){return e(this.tech({IWillNotUseThisInPlugins:!0}).currentSource_||this.currentSource())}},Go=function(e){!function e(t,i){var n=0,r=0,a=Yr.mergeOptions(zo,i);t.ready((function(){t.trigger({type:"usage",name:"vhs-error-reload-initialized"}),t.trigger({type:"usage",name:"hls-error-reload-initialized"})}));var s=function(){r&&t.currentTime(r)},o=function(e){null!=e&&(r=t.duration()!==1/0&&t.currentTime()||0,t.one("loadedmetadata",s),t.src(e),t.trigger({type:"usage",name:"vhs-error-reload"}),t.trigger({type:"usage",name:"hls-error-reload"}),t.play())},u=function(){return Date.now()-n<1e3*a.errorInterval?(t.trigger({type:"usage",name:"vhs-error-reload-canceled"}),void t.trigger({type:"usage",name:"hls-error-reload-canceled"})):a.getSource&&"function"==typeof a.getSource?(n=Date.now(),a.getSource.call(t,o)):void Yr.log.error("ERROR: reloadSourceOnError - The option getSource must be a function!")},l=function e(){t.off("loadedmetadata",s),t.off("error",u),t.off("dispose",e)};t.on("error",u),t.on("dispose",l),t.reloadSourceOnError=function(i){l(),e(t,i)}}(this,e)},Wo={PlaylistLoader:Oa,Playlist:Ta,utils:Ka,STANDARD_PLAYLIST_SELECTOR:Hs,INITIAL_PLAYLIST_SELECTOR:function(){var e=this,t=this.playlists.master.playlists.filter(Ta.isEnabled);return Ns(t,(function(e,t){return js(e,t)})),t.filter((function(t){return!!Os(e.playlists.master,t).video}))[0]||null},lastBandwidthSelector:Hs,movingAverageBandwidthSelector:function(e){var t=-1,i=-1;if(e<0||e>1)throw new Error("Moving average bandwidth decay must be between 0 and 1.");return function(){var n=this.useDevicePixelRatio&&A.default.devicePixelRatio||1;return t<0&&(t=this.systemBandwidth,i=this.systemBandwidth),this.systemBandwidth>0&&this.systemBandwidth!==i&&(t=e*this.systemBandwidth+(1-e)*t,i=this.systemBandwidth),Vs(this.playlists.master,t,parseInt(Bs(this.tech_.el(),"width"),10)*n,parseInt(Bs(this.tech_.el(),"height"),10)*n,this.limitRenditionByPlayerDimensions,this.masterPlaylistController_)}},comparePlaylistBandwidth:js,comparePlaylistResolution:function(e,t){var i,n;return e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width&&(i=e.attributes.RESOLUTION.width),i=i||A.default.Number.MAX_VALUE,t.attributes.RESOLUTION&&t.attributes.RESOLUTION.width&&(n=t.attributes.RESOLUTION.width),i===(n=n||A.default.Number.MAX_VALUE)&&e.attributes.BANDWIDTH&&t.attributes.BANDWIDTH?e.attributes.BANDWIDTH-t.attributes.BANDWIDTH:i-n},xhr:Na()};Object.keys(ns).forEach((function(e){Object.defineProperty(Wo,e,{get:function(){return Yr.log.warn("using Vhs."+e+" is UNSAFE be sure you know what you are doing"),ns[e]},set:function(t){Yr.log.warn("using Vhs."+e+" is UNSAFE be sure you know what you are doing"),"number"!=typeof t||t<0?Yr.log.warn("value of Vhs."+e+" must be greater than or equal to 0"):ns[e]=t}})}));var Yo=function(e,t){for(var i=t.media(),n=-1,r=0;r0?1/this.throughput:0,Math.floor(1/(t+e))},set:function(){Yr.log.error('The "systemBandwidth" property is read-only')}}}),this.options_.bandwidth&&(this.bandwidth=this.options_.bandwidth),this.options_.throughput&&(this.throughput=this.options_.throughput),Object.defineProperties(this.stats,{bandwidth:{get:function(){return i.bandwidth||0},enumerable:!0},mediaRequests:{get:function(){return i.masterPlaylistController_.mediaRequests_()||0},enumerable:!0},mediaRequestsAborted:{get:function(){return i.masterPlaylistController_.mediaRequestsAborted_()||0},enumerable:!0},mediaRequestsTimedout:{get:function(){return i.masterPlaylistController_.mediaRequestsTimedout_()||0},enumerable:!0},mediaRequestsErrored:{get:function(){return i.masterPlaylistController_.mediaRequestsErrored_()||0},enumerable:!0},mediaTransferDuration:{get:function(){return i.masterPlaylistController_.mediaTransferDuration_()||0},enumerable:!0},mediaBytesTransferred:{get:function(){return i.masterPlaylistController_.mediaBytesTransferred_()||0},enumerable:!0},mediaSecondsLoaded:{get:function(){return i.masterPlaylistController_.mediaSecondsLoaded_()||0},enumerable:!0},mediaAppends:{get:function(){return i.masterPlaylistController_.mediaAppends_()||0},enumerable:!0},mainAppendsToLoadedData:{get:function(){return i.masterPlaylistController_.mainAppendsToLoadedData_()||0},enumerable:!0},audioAppendsToLoadedData:{get:function(){return i.masterPlaylistController_.audioAppendsToLoadedData_()||0},enumerable:!0},appendsToLoadedData:{get:function(){return i.masterPlaylistController_.appendsToLoadedData_()||0},enumerable:!0},timeToLoadedData:{get:function(){return i.masterPlaylistController_.timeToLoadedData_()||0},enumerable:!0},buffered:{get:function(){return ia(i.tech_.buffered())},enumerable:!0},currentTime:{get:function(){return i.tech_.currentTime()},enumerable:!0},currentSource:{get:function(){return i.tech_.currentSource_},enumerable:!0},currentTech:{get:function(){return i.tech_.name_},enumerable:!0},duration:{get:function(){return i.tech_.duration()},enumerable:!0},master:{get:function(){return i.playlists.master},enumerable:!0},playerDimensions:{get:function(){return i.tech_.currentDimensions()},enumerable:!0},seekable:{get:function(){return ia(i.tech_.seekable())},enumerable:!0},timestamp:{get:function(){return Date.now()},enumerable:!0},videoPlaybackQuality:{get:function(){return i.tech_.getVideoPlaybackQuality()},enumerable:!0}}),this.tech_.one("canplay",this.masterPlaylistController_.setupFirstPlay.bind(this.masterPlaylistController_)),this.tech_.on("bandwidthupdate",(function(){i.options_.useBandwidthFromLocalStorage&&function(e){if(!A.default.localStorage)return!1;var t=Xo();t=t?Yr.mergeOptions(t,e):e;try{A.default.localStorage.setItem("videojs-vhs",JSON.stringify(t))}catch(e){return!1}}({bandwidth:i.bandwidth,throughput:Math.round(i.throughput)})})),this.masterPlaylistController_.on("selectedinitialmedia",(function(){var e;(e=i).representations=function(){var t=e.masterPlaylistController_.master(),i=ba(t)?e.masterPlaylistController_.getAudioTrackPlaylists_():t.playlists;return i?i.filter((function(e){return!pa(e)})).map((function(t,i){return new jo(e,t,t.id)})):[]}})),this.masterPlaylistController_.sourceUpdater_.on("createdsourcebuffers",(function(){i.setupEme_()})),this.on(this.masterPlaylistController_,"progress",(function(){this.tech_.trigger("progress")})),this.on(this.masterPlaylistController_,"firstplay",(function(){this.ignoreNextSeekingEvent_=!0})),this.setupQualityLevels_(),this.tech_.el()&&(this.mediaSourceUrl_=A.default.URL.createObjectURL(this.masterPlaylistController_.mediaSource),this.tech_.src(this.mediaSourceUrl_))}},i.setupEme_=function(){var e=this,t=this.masterPlaylistController_.mediaTypes_.AUDIO.activePlaylistLoader,i=Ko({player:this.player_,sourceKeySystems:this.source_.keySystems,media:this.playlists.media(),audioMedia:t&&t.media()});this.player_.tech_.on("keystatuschange",(function(t){"output-restricted"===t.status&&e.masterPlaylistController_.blacklistCurrentPlaylist({playlist:e.masterPlaylistController_.media(),message:"DRM keystatus changed to "+t.status+". Playlist will fail to play. Check for HDCP content.",blacklistDuration:1/0})})),11!==Yr.browser.IE_VERSION&&i?(this.logger_("waiting for EME key session creation"),qo({player:this.player_,sourceKeySystems:this.source_.keySystems,audioMedia:t&&t.media(),mainPlaylists:this.playlists.master.playlists}).then((function(){e.logger_("created EME key session"),e.masterPlaylistController_.sourceUpdater_.initializedEme()})).catch((function(t){e.logger_("error while creating EME key session",t),e.player_.error({message:"Failed to initialize media keys for EME",code:3})}))):this.masterPlaylistController_.sourceUpdater_.initializedEme()},i.setupQualityLevels_=function(){var e=this,t=Yr.players[this.tech_.options_.playerId];t&&t.qualityLevels&&!this.qualityLevels_&&(this.qualityLevels_=t.qualityLevels(),this.masterPlaylistController_.on("selectedinitialmedia",(function(){var t,i;t=e.qualityLevels_,(i=e).representations().forEach((function(e){t.addQualityLevel(e)})),Yo(t,i.playlists)})),this.playlists.on("mediachange",(function(){Yo(e.qualityLevels_,e.playlists)})))},t.version=function(){return{"@videojs/http-streaming":"2.10.2","mux.js":"5.13.0","mpd-parser":"0.19.0","m3u8-parser":"4.7.0","aes-decrypter":"3.1.2"}},i.version=function(){return this.constructor.version()},i.canChangeType=function(){return vo.canChangeType()},i.play=function(){this.masterPlaylistController_.play()},i.setCurrentTime=function(e){this.masterPlaylistController_.setCurrentTime(e)},i.duration=function(){return this.masterPlaylistController_.duration()},i.seekable=function(){return this.masterPlaylistController_.seekable()},i.dispose=function(){this.playbackWatcher_&&this.playbackWatcher_.dispose(),this.masterPlaylistController_&&this.masterPlaylistController_.dispose(),this.qualityLevels_&&this.qualityLevels_.dispose(),this.player_&&(delete this.player_.vhs,delete this.player_.dash,delete this.player_.hls),this.tech_&&this.tech_.vhs&&delete this.tech_.vhs,this.tech_&&delete this.tech_.hls,this.mediaSourceUrl_&&A.default.URL.revokeObjectURL&&(A.default.URL.revokeObjectURL(this.mediaSourceUrl_),this.mediaSourceUrl_=null),e.prototype.dispose.call(this)},i.convertToProgramTime=function(e,t){return Xa({playlist:this.masterPlaylistController_.media(),time:e,callback:t})},i.seekToProgramTime=function(e,t,i,n){return void 0===i&&(i=!0),void 0===n&&(n=2),Qa({programTime:e,playlist:this.masterPlaylistController_.media(),retryCount:n,pauseAfterSeek:i,seekTo:this.options_.seekTo,tech:this.options_.tech,callback:t})},t}(Yr.getComponent("Component")),$o={name:"videojs-http-streaming",VERSION:"2.10.2",canHandleSource:function(e,t){void 0===t&&(t={});var i=Yr.mergeOptions(Yr.options,t);return $o.canPlayType(e.type,i)},handleSource:function(e,t,i){void 0===i&&(i={});var n=Yr.mergeOptions(Yr.options,i);return t.vhs=new Qo(e,t,n),Yr.hasOwnProperty("hls")||Object.defineProperty(t,"hls",{get:function(){return Yr.log.warn("player.tech().hls is deprecated. Use player.tech().vhs instead."),t.vhs},configurable:!0}),t.vhs.xhr=Na(),t.vhs.src(e.src,e.type),t.vhs},canPlayType:function(e,t){void 0===t&&(t={});var i=Yr.mergeOptions(Yr.options,t).vhs.overrideNative,n=void 0===i?!Yr.browser.IS_ANY_SAFARI:i,r=_.simpleTypeFromSourceType(e);return r&&(!Wo.supportsTypeNatively(r)||n)?"maybe":""}};g.browserSupportsCodec("avc1.4d400d,mp4a.40.2")&&Yr.getTech("Html5").registerSourceHandler($o,0),Yr.VhsHandler=Qo,Object.defineProperty(Yr,"HlsHandler",{get:function(){return Yr.log.warn("videojs.HlsHandler is deprecated. Use videojs.VhsHandler instead."),Qo},configurable:!0}),Yr.VhsSourceHandler=$o,Object.defineProperty(Yr,"HlsSourceHandler",{get:function(){return Yr.log.warn("videojs.HlsSourceHandler is deprecated. Use videojs.VhsSourceHandler instead."),$o},configurable:!0}),Yr.Vhs=Wo,Object.defineProperty(Yr,"Hls",{get:function(){return Yr.log.warn("videojs.Hls is deprecated. Use videojs.Vhs instead."),Wo},configurable:!0}),Yr.use||(Yr.registerComponent("Hls",Wo),Yr.registerComponent("Vhs",Wo)),Yr.options.vhs=Yr.options.vhs||{},Yr.options.hls=Yr.options.hls||{},Yr.registerPlugin?Yr.registerPlugin("reloadSourceOnError",Go):Yr.plugin("reloadSourceOnError",Go),t.exports=Yr},{"@babel/runtime/helpers/assertThisInitialized":1,"@babel/runtime/helpers/construct":2,"@babel/runtime/helpers/extends":3,"@babel/runtime/helpers/inherits":4,"@babel/runtime/helpers/inheritsLoose":5,"@videojs/vhs-utils/cjs/byte-helpers":9,"@videojs/vhs-utils/cjs/codecs.js":11,"@videojs/vhs-utils/cjs/containers":12,"@videojs/vhs-utils/cjs/id3-helpers":15,"@videojs/vhs-utils/cjs/media-types.js":16,"@videojs/vhs-utils/cjs/resolve-url.js":20,"@videojs/xhr":23,"global/document":34,"global/window":35,keycode:38,"m3u8-parser":39,"mpd-parser":41,"mux.js/lib/tools/parse-sidx":42,"mux.js/lib/utils/clock":43,"safe-json-parse/tuple":45,"videojs-vtt.js":48}],48:[function(e,t,i){var n=e("global/window"),r=t.exports={WebVTT:e("./vtt.js"),VTTCue:e("./vttcue.js"),VTTRegion:e("./vttregion.js")};n.vttjs=r,n.WebVTT=r.WebVTT;var a=r.VTTCue,s=r.VTTRegion,o=n.VTTCue,u=n.VTTRegion;r.shim=function(){n.VTTCue=a,n.VTTRegion=s},r.restore=function(){n.VTTCue=o,n.VTTRegion=u},n.VTTCue||r.shim()},{"./vtt.js":49,"./vttcue.js":50,"./vttregion.js":51,"global/window":35}],49:[function(e,t,i){var n=e("global/document"),r=Object.create||function(){function e(){}return function(t){if(1!==arguments.length)throw new Error("Object.create shim only accepts one parameter.");return e.prototype=t,new e}}();function a(e,t){this.name="ParsingError",this.code=e.code,this.message=t||e.message}function s(e){function t(e,t,i,n){return 3600*(0|e)+60*(0|t)+(0|i)+(0|n)/1e3}var i=e.match(/^(\d+):(\d{1,2})(:\d{1,2})?\.(\d{3})/);return i?i[3]?t(i[1],i[2],i[3].replace(":",""),i[4]):i[1]>59?t(i[1],i[2],0,i[4]):t(0,i[1],i[2],i[4]):null}function o(){this.values=r(null)}function u(e,t,i,n){var r=n?e.split(n):[e];for(var a in r)if("string"==typeof r[a]){var s=r[a].split(i);if(2===s.length)t(s[0],s[1])}}function l(e,t,i){var n=e;function r(){var t=s(e);if(null===t)throw new a(a.Errors.BadTimeStamp,"Malformed timestamp: "+n);return e=e.replace(/^[^\sa-zA-Z-]+/,""),t}function l(){e=e.replace(/^\s+/,"")}if(l(),t.startTime=r(),l(),"--\x3e"!==e.substr(0,3))throw new a(a.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '--\x3e'): "+n);e=e.substr(3),l(),t.endTime=r(),l(),function(e,t){var n=new o;u(e,(function(e,t){switch(e){case"region":for(var r=i.length-1;r>=0;r--)if(i[r].id===t){n.set(e,i[r].region);break}break;case"vertical":n.alt(e,t,["rl","lr"]);break;case"line":var a=t.split(","),s=a[0];n.integer(e,s),n.percent(e,s)&&n.set("snapToLines",!1),n.alt(e,s,["auto"]),2===a.length&&n.alt("lineAlign",a[1],["start","center","end"]);break;case"position":a=t.split(","),n.percent(e,a[0]),2===a.length&&n.alt("positionAlign",a[1],["start","center","end"]);break;case"size":n.percent(e,t);break;case"align":n.alt(e,t,["start","center","end","left","right"])}}),/:/,/\s/),t.region=n.get("region",null),t.vertical=n.get("vertical","");try{t.line=n.get("line","auto")}catch(e){}t.lineAlign=n.get("lineAlign","start"),t.snapToLines=n.get("snapToLines",!0),t.size=n.get("size",100);try{t.align=n.get("align","center")}catch(e){t.align=n.get("align","middle")}try{t.position=n.get("position","auto")}catch(e){t.position=n.get("position",{start:0,left:0,center:50,middle:50,end:100,right:100},t.align)}t.positionAlign=n.get("positionAlign",{start:"start",left:"start",center:"center",middle:"center",end:"end",right:"end"},t.align)}(e,t)}a.prototype=r(Error.prototype),a.prototype.constructor=a,a.Errors={BadSignature:{code:0,message:"Malformed WebVTT signature."},BadTimeStamp:{code:1,message:"Malformed time stamp."}},o.prototype={set:function(e,t){this.get(e)||""===t||(this.values[e]=t)},get:function(e,t,i){return i?this.has(e)?this.values[e]:t[i]:this.has(e)?this.values[e]:t},has:function(e){return e in this.values},alt:function(e,t,i){for(var n=0;n=0&&t<=100)&&(this.set(e,t),!0)}};var d=n.createElement&&n.createElement("textarea"),h={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"},c={white:"rgba(255,255,255,1)",lime:"rgba(0,255,0,1)",cyan:"rgba(0,255,255,1)",red:"rgba(255,0,0,1)",yellow:"rgba(255,255,0,1)",magenta:"rgba(255,0,255,1)",blue:"rgba(0,0,255,1)",black:"rgba(0,0,0,1)"},f={v:"title",lang:"lang"},p={rt:"ruby"};function m(e,t){function i(){if(!t)return null;var e,i=t.match(/^([^<]*)(<[^>]*>?)?/);return e=i[1]?i[1]:i[2],t=t.substr(e.length),e}function n(e,t){return!p[t.localName]||p[t.localName]===e.localName}function r(t,i){var n=h[t];if(!n)return null;var r=e.document.createElement(n),a=f[t];return a&&i&&(r[a]=i.trim()),r}for(var a,o,u=e.document.createElement("div"),l=u,m=[];null!==(a=i());)if("<"!==a[0])l.appendChild(e.document.createTextNode((o=a,d.innerHTML=o,o=d.textContent,d.textContent="",o)));else{if("/"===a[1]){m.length&&m[m.length-1]===a.substr(2).replace(">","")&&(m.pop(),l=l.parentNode);continue}var g,_=s(a.substr(1,a.length-2));if(_){g=e.document.createProcessingInstruction("timestamp",_),l.appendChild(g);continue}var y=a.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!y)continue;if(!(g=r(y[1],y[3])))continue;if(!n(l,g))continue;if(y[2]){var v=y[2].split(".");v.forEach((function(e){var t=/^bg_/.test(e),i=t?e.slice(3):e;if(c.hasOwnProperty(i)){var n=t?"background-color":"color",r=c[i];g.style[n]=r}})),g.className=v.join(" ")}m.push(y[1]),l.appendChild(g),l=g}return u}var g=[[1470,1470],[1472,1472],[1475,1475],[1478,1478],[1488,1514],[1520,1524],[1544,1544],[1547,1547],[1549,1549],[1563,1563],[1566,1610],[1645,1647],[1649,1749],[1765,1766],[1774,1775],[1786,1805],[1807,1808],[1810,1839],[1869,1957],[1969,1969],[1984,2026],[2036,2037],[2042,2042],[2048,2069],[2074,2074],[2084,2084],[2088,2088],[2096,2110],[2112,2136],[2142,2142],[2208,2208],[2210,2220],[8207,8207],[64285,64285],[64287,64296],[64298,64310],[64312,64316],[64318,64318],[64320,64321],[64323,64324],[64326,64449],[64467,64829],[64848,64911],[64914,64967],[65008,65020],[65136,65140],[65142,65276],[67584,67589],[67592,67592],[67594,67637],[67639,67640],[67644,67644],[67647,67669],[67671,67679],[67840,67867],[67872,67897],[67903,67903],[67968,68023],[68030,68031],[68096,68096],[68112,68115],[68117,68119],[68121,68147],[68160,68167],[68176,68184],[68192,68223],[68352,68405],[68416,68437],[68440,68466],[68472,68479],[68608,68680],[126464,126467],[126469,126495],[126497,126498],[126500,126500],[126503,126503],[126505,126514],[126516,126519],[126521,126521],[126523,126523],[126530,126530],[126535,126535],[126537,126537],[126539,126539],[126541,126543],[126545,126546],[126548,126548],[126551,126551],[126553,126553],[126555,126555],[126557,126557],[126559,126559],[126561,126562],[126564,126564],[126567,126570],[126572,126578],[126580,126583],[126585,126588],[126590,126590],[126592,126601],[126603,126619],[126625,126627],[126629,126633],[126635,126651],[1114109,1114109]];function _(e){for(var t=0;t=i[0]&&e<=i[1])return!0}return!1}function y(e){var t=[],i="";if(!e||!e.childNodes)return"ltr";function n(e,t){for(var i=t.childNodes.length-1;i>=0;i--)e.push(t.childNodes[i])}function r(e){if(!e||!e.length)return null;var t=e.pop(),i=t.textContent||t.innerText;if(i){var a=i.match(/^.*(\n|\r)/);return a?(e.length=0,a[0]):i}return"ruby"===t.tagName?r(e):t.childNodes?(n(e,t),r(e)):void 0}for(n(t,e);i=r(t);)for(var a=0;a=0&&e.line<=100))return e.line;if(!e.track||!e.track.textTrackList||!e.track.textTrackList.mediaElement)return-1;for(var t=e.track,i=t.textTrackList,n=0,r=0;rh&&(d=d<0?-1:1,d*=Math.ceil(h/l)*l),s<0&&(d+=""===a.vertical?i.height:i.width,o=o.reverse()),r.move(c,d)}else{var f=r.lineHeight/i.height*100;switch(a.lineAlign){case"center":s-=f/2;break;case"end":s-=f}switch(a.vertical){case"":t.applyStyles({top:t.formatStyle(s,"%")});break;case"rl":t.applyStyles({left:t.formatStyle(s,"%")});break;case"lr":t.applyStyles({right:t.formatStyle(s,"%")})}o=["+y","-x","+x","-y"],r=new T(t)}var p=function(e,t){for(var r,a=new T(e),s=1,o=0;ou&&(r=new T(e),s=u),e=new T(a)}return r||a}(r,o);t.move(p.toCSSCompatValues(i))}function E(){}v.prototype.applyStyles=function(e,t){for(var i in t=t||this.div,e)e.hasOwnProperty(i)&&(t.style[i]=e[i])},v.prototype.formatStyle=function(e,t){return 0===e?0:e+t},b.prototype=r(v.prototype),b.prototype.constructor=b,T.prototype.move=function(e,t){switch(t=void 0!==t?t:this.lineHeight,e){case"+x":this.left+=t,this.right+=t;break;case"-x":this.left-=t,this.right-=t;break;case"+y":this.top+=t,this.bottom+=t;break;case"-y":this.top-=t,this.bottom-=t}},T.prototype.overlaps=function(e){return this.lefte.left&&this.tope.top},T.prototype.overlapsAny=function(e){for(var t=0;t=e.top&&this.bottom<=e.bottom&&this.left>=e.left&&this.right<=e.right},T.prototype.overlapsOppositeAxis=function(e,t){switch(t){case"+x":return this.lefte.right;case"+y":return this.tope.bottom}},T.prototype.intersectPercentage=function(e){return Math.max(0,Math.min(this.right,e.right)-Math.max(this.left,e.left))*Math.max(0,Math.min(this.bottom,e.bottom)-Math.max(this.top,e.top))/(this.height*this.width)},T.prototype.toCSSCompatValues=function(e){return{top:this.top-e.top,bottom:e.bottom-this.bottom,left:this.left-e.left,right:e.right-this.right,height:this.height,width:this.width}},T.getSimpleBoxPosition=function(e){var t=e.div?e.div.offsetHeight:e.tagName?e.offsetHeight:0,i=e.div?e.div.offsetWidth:e.tagName?e.offsetWidth:0,n=e.div?e.div.offsetTop:e.tagName?e.offsetTop:0;return{left:(e=e.div?e.div.getBoundingClientRect():e.tagName?e.getBoundingClientRect():e).left,right:e.right,top:e.top||n,height:e.height||t,bottom:e.bottom||n+(e.height||t),width:e.width||i}},E.StringDecoder=function(){return{decode:function(e){if(!e)return"";if("string"!=typeof e)throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(e))}}},E.convertCueToDOMTree=function(e,t){return e&&t?m(e,t):null};E.processCues=function(e,t,i){if(!e||!t||!i)return null;for(;i.firstChild;)i.removeChild(i.firstChild);var n=e.document.createElement("div");if(n.style.position="absolute",n.style.left="0",n.style.right="0",n.style.top="0",n.style.bottom="0",n.style.margin="1.5%",i.appendChild(n),function(e){for(var t=0;t100)throw new Error("Position must be between 0 and 100.");m=e,this.hasBeenReset=!0}},positionAlign:{enumerable:!0,get:function(){return g},set:function(e){var t=a(e);t&&(g=t,this.hasBeenReset=!0)}},size:{enumerable:!0,get:function(){return _},set:function(e){if(e<0||e>100)throw new Error("Size must be between 0 and 100.");_=e,this.hasBeenReset=!0}},align:{enumerable:!0,get:function(){return y},set:function(e){var t=a(e);if(!t)throw new SyntaxError("align: an invalid or illegal alignment string was specified.");y=t,this.hasBeenReset=!0}}}),this.displayState=void 0}s.prototype.getCueAsHTML=function(){return WebVTT.convertCueToDOMTree(window,this.text)},t.exports=s},{}],51:[function(e,t,i){var n={"":!0,up:!0};function r(e){return"number"==typeof e&&e>=0&&e<=100}t.exports=function(){var e=100,t=3,i=0,a=100,s=0,o=100,u="";Object.defineProperties(this,{width:{enumerable:!0,get:function(){return e},set:function(t){if(!r(t))throw new Error("Width must be between 0 and 100.");e=t}},lines:{enumerable:!0,get:function(){return t},set:function(e){if("number"!=typeof e)throw new TypeError("Lines must be set to a number.");t=e}},regionAnchorY:{enumerable:!0,get:function(){return a},set:function(e){if(!r(e))throw new Error("RegionAnchorX must be between 0 and 100.");a=e}},regionAnchorX:{enumerable:!0,get:function(){return i},set:function(e){if(!r(e))throw new Error("RegionAnchorY must be between 0 and 100.");i=e}},viewportAnchorY:{enumerable:!0,get:function(){return o},set:function(e){if(!r(e))throw new Error("ViewportAnchorY must be between 0 and 100.");o=e}},viewportAnchorX:{enumerable:!0,get:function(){return s},set:function(e){if(!r(e))throw new Error("ViewportAnchorX must be between 0 and 100.");s=e}},scroll:{enumerable:!0,get:function(){return u},set:function(e){var t=function(e){return"string"==typeof e&&(!!n[e.toLowerCase()]&&e.toLowerCase())}(e);!1===t||(u=t)}}})}},{}],52:[function(e,t,i){"use strict";t.exports={DEFAILT_WEBGL_PLAY_ID:"glplayer",PLAYER_IN_TYPE_MP4:"mp4",PLAYER_IN_TYPE_FLV:"flv",PLAYER_IN_TYPE_HTTPFLV:"httpflv",PLAYER_IN_TYPE_RAW_265:"raw265",PLAYER_IN_TYPE_TS:"ts",PLAYER_IN_TYPE_MPEGTS:"mpegts",PLAYER_IN_TYPE_M3U8:"hls",PLAYER_IN_TYPE_M3U8_VOD:"m3u8",PLAYER_IN_TYPE_M3U8_LIVE:"hls",APPEND_TYPE_STREAM:0,APPEND_TYPE_FRAME:1,APPEND_TYPE_SEQUENCE:2,DEFAULT_WIDTH:600,DEFAULT_HEIGHT:600,DEFAULT_FPS:30,DEFAULT_FRAME_DUR:40,DEFAULT_FIXED:!1,DEFAULT_SAMPLERATE:44100,DEFAULT_CHANNELS:2,DEFAULT_CONSU_SAMPLE_LEN:20,PLAYER_MODE_VOD:"vod",PLAYER_MODE_NOTIME_LIVE:"live",AUDIO_MODE_ONCE:"ONCE",AUDIO_MODE_SWAP:"SWAP",DEFAULT_STRING_LIVE:"LIVE",CODEC_H265:0,CODEC_H264:1,PLAYER_CORE_TYPE_DEFAULT:0,PLAYER_CORE_TYPE_CNATIVE:1,URI_PROTOCOL_WEBSOCKET:"ws",URI_PROTOCOL_WEBSOCKET_DESC:"websocket",URI_PROTOCOL_HTTP:"http",URI_PROTOCOL_HTTP_DESC:"http",FETCH_FIRST_MAX_TIMES:5,FETCH_HTTP_FLV_TIMEOUT_MS:7e3,V_CODEC_NAME_HEVC:265,V_CODEC_NAME_AVC:264,V_CODEC_NAME_UNKN:500,A_CODEC_NAME_AAC:112,A_CODEC_NAME_MP3:113,A_CODEC_NAME_UNKN:500,CACHE_NO_LOADCACHE:192,CACHE_WITH_PLAY_SIGN:193,CACHE_WITH_NOPLAY_SIGN:194}},{}],53:[function(e,t,i){"use strict";var n=window.AudioContext||window.webkitAudioContext,r=e("../consts"),a=e("./av-common");t.exports=function(e){var t={options:{sampleRate:e.sampleRate||r.DEFAULT_SAMPLERATE,appendType:e.appendType||r.APPEND_TYPE_STREAM,playMode:e.playMode||r.AUDIO_MODE_SWAP},sourceChannel:-1,audioCtx:new n({latencyHint:"interactive",sampleRate:e.sampleRate}),gainNode:null,sourceList:[],startStatus:!1,sampleQueue:[],nextBuffer:null,playTimestamp:0,playStartTime:0,durationMs:-1,isLIVE:!1,voice:1,onLoadCache:null,resetStartParam:function(){t.playTimestamp=0,t.playStartTime=0},setOnLoadCache:function(e){t.onLoadCache=e},setDurationMs:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1;t.durationMs=e},setVoice:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;t.voice=e,t.gainNode.gain.value=e},getAlignVPTS:function(){return t.playTimestamp+(a.GetMsTime()-t.playStartTime)/1e3},swapSource:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;if(0==t.startStatus)return null;if(e<0||e>=t.sourceList.length)return null;if(i<0||i>=t.sourceList.length)return null;try{t.sourceChannel===e&&null!==t.sourceList[e]&&(t.sourceList[e].disconnect(t.gainNode),t.sourceList[e]=null)}catch(t){console.error("[DEFINE ERROR] audioModule disconnect source Index:"+e+" error happened!",t)}t.sourceChannel=i;var n=t.decodeSample(i,e);-2==n&&t.isLIVE&&(t.getAlignVPTS()>=t.durationMs/1e3-.04?t.pause():null!==t.onLoadCache&&t.onLoadCache())},addSample:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return!(null==e||!e||null==e)&&(0==t.sampleQueue.length&&(t.seekPos=e.pts),t.sampleQueue.push(e),!0)},runNextBuffer:function(){window.setInterval((function(){if(!(null!=t.nextBuffer||t.sampleQueue.length0&&void 0!==arguments[0]?arguments[0]:-1,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;if(e<0||e>=t.sourceList.length)return-1;if(null!=t.sourceList[e]&&null!=t.sourceList[e]&&t.sourceList[e]||(t.sourceList[e]=t.audioCtx.createBufferSource(),t.sourceList[e].onended=function(){t.swapSource(e,i)}),0==t.sampleQueue.length)return t.isLIVE?(t.sourceList[e].connect(t.gainNode),t.sourceList[e].start(),t.sourceList[e].onended=function(){t.swapSource(e,i)},t.sourceList[e].stop(),0):-2;if(t.sourceList[e].buffer)return t.sourceList[e],t.sourceList[i],t.gainNode,t.swapSource(e,i),0;if(null==t.nextBuffer||t.nextBuffer.data.length<1)return t.sourceList[e].connect(t.gainNode),t.sourceList[e].start(),t.sourceList[e].startState=!0,t.sourceList[e].stop(),1;var n=t.nextBuffer.data.buffer;t.playTimestamp=t.nextBuffer.pts,t.playStartTime=a.GetMsTime();try{t.audioCtx.decodeAudioData(n,(function(i){null!==t.sourceList[e]&&(t.sourceList[e].buffer=i,t.sourceList[e].connect(t.gainNode),t.sourceList[e].start(),t.sourceList[e].startState=!0)}),(function(e){}))}catch(e){return t.nextBuffer=null,-3}return t.nextBuffer=null,0},decodeWholeSamples:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1;if(t.sourceChannel=e,e<0||e>=t.sourceList.length)return-1;if(null!=t.sourceList[e]&&null!=t.sourceList[e]&&t.sourceList[e]||(t.sourceList[e]=t.audioCtx.createBufferSource(),t.sourceList[e].onended=function(){}),0==t.sampleQueue.length)return-2;for(var i=null,n=null,a=0;a=2){var s=i.length/2;a=new Float32Array(s);for(var o=0,u=0;u0&&s()-this._start_time>=this._now_seg_dur&&(s(),this._start_time,this._now_seg_dur,this._start_time=-1,this._now_seg_dur=-1),s(),this._start_time<0)if(new Date,null!==this._pcm_array_buf&&this._pcm_array_buf.length>this._push_start_idx){this._swapStartPlay=!1;var e=this._push_start_idx+this._once_pop_len;e>this._pcm_array_buf.length&&(e=this._pcm_array_buf.length);var t=this._pcm_array_buf.slice(this._push_start_idx,e);this._push_start_idx+=t.length,this._now_seg_dur=1*t.length/this._sample_rate*1e3,t.length,this._sample_rate,this._now_seg_dur;var i=this._ctx.createBuffer(1,t.length,this._sample_rate);t.length,new Date,i.copyToChannel(t,0),this._active_node=this._ctx.createBufferSource(),this._active_node.buffer=i,this._active_node.connect(this._gain),this._start_time=s(),this._active_node.start(0)}else setTimeout(this.readingLoopWithF32,1)}}])&&n(t.prototype,i),o&&n(t,o),e}();i.AudioPcmPlayer=o},{"../consts":52}],55:[function(e,t,i){"use strict";var n=e("../consts"),r=[{format:"mp4",value:"mp4",core:n.PLAYER_CORE_TYPE_CNATIVE},{format:"mov",value:"mp4",core:n.PLAYER_CORE_TYPE_CNATIVE},{format:"flv",value:"flv",core:n.PLAYER_CORE_TYPE_CNATIVE},{format:"m3u8",value:"hls",core:n.PLAYER_CORE_TYPE_DEFAULT},{format:"m3u",value:"hls",core:n.PLAYER_CORE_TYPE_DEFAULT},{format:"ts",value:"ts",core:n.PLAYER_CORE_TYPE_DEFAULT},{format:"mpegts",value:"ts",core:n.PLAYER_CORE_TYPE_DEFAULT},{format:"hevc",value:"raw265",core:n.PLAYER_CORE_TYPE_DEFAULT},{format:"h265",value:"raw265",core:n.PLAYER_CORE_TYPE_DEFAULT}],a=[{format:n.URI_PROTOCOL_HTTP,value:n.URI_PROTOCOL_HTTP_DESC},{format:n.URI_PROTOCOL_WEBSOCKET,value:n.URI_PROTOCOL_WEBSOCKET_DESC}];t.exports={frameDataAlignCrop:function(e,t,i,n,r,a,s,o){if(0==e-n)return[a,s,o];for(var u=n*r,l=u/4,d=new Uint8Array(u),h=new Uint8Array(l),c=new Uint8Array(l),f=n,p=n/2,m=0;m=0)return i.value}return r[0].value},GetFormatPlayCore:function(e){for(var t=0;t=0)return i.value}return a[0].value},GetMsTime:function(){return(new Date).getTime()}}},{"../consts":52}],56:[function(e,t,i){"use strict";function n(e,t){for(var i=0;i0&&(t.getPackageTimeMS=a.GetMsTime()),t.pushPkg++,void 0!==t.AVGetInterval&&null!==t.AVGetInterval||(t.AVGetInterval=window.setInterval((function(){Module.cwrap("getBufferLengthApi","number",["number"])(t.AVSniffPtr)>t.config.probeSize?(Module.cwrap("getSniffHttpFlvPkg","number",["number"])(t.AVSniffPtr),t.pushPkg-=1):t.getPackageTimeMS>0&&a.GetMsTime()-t.getPackageTimeMS>=o.FETCH_HTTP_FLV_TIMEOUT_MS&&(t.getPackageTimeMS=a.GetMsTime(),t.workerFetch.postMessage({cmd:"retry",data:null,msg:"retry"}))}),5));break;case"close":t.AVGetInterval&&clearInterval(t.AVGetInterval),t.AVGetInterval=null;case"fetch-fin":break;case"fetch-error":t.onNetworkError&&t.onNetworkError(i.data)}}},{key:"_checkDisplaySize",value:function(e,t,i){var n=t-e,r=this.config.width+Math.ceil(n/2),a=t/this.config.width>i/this.config.height,s=(r/t).toFixed(2),o=(this.config.height/i).toFixed(2),u=a?s:o,l=this.config.fixed,d=l?r:parseInt(t*u),h=l?this.config.height:parseInt(i*u);if(this.CanvasObj.offsetWidth!=d||this.CanvasObj.offsetHeight!=h){var c=parseInt((this.canvasBox.offsetHeight-h)/2),f=parseInt((this.canvasBox.offsetWidth-d)/2);c=c<0?0:c,f=f<0?0:f,this.CanvasObj.style.marginTop=c+"px",this.CanvasObj.style.marginLeft=f+"px",this.CanvasObj.style.width=d+"px",this.CanvasObj.style.height=h+"px"}return this.isCheckDisplay=!0,[d,h]}},{key:"_ptsFixed2",value:function(e){return Math.ceil(100*e)/100}},{key:"_callbackProbe",value:function(e,t,i,n,r,a,u,l,d){for(var h=Module.HEAPU8.subarray(d,d+10),c=0;c100&&(f=o.DEFAULT_FPS,this.mediaInfo.noFPS=!0),this.vCodecID=l,this.config.fps=f,this.mediaInfo.fps=f,this.mediaInfo.size.width=t,this.mediaInfo.size.height=i,this.frameTime=Math.floor(1e3/(this.mediaInfo.fps+2)),this.CanvasObj.width==t&&this.CanvasObj.height==i||(this.CanvasObj.width=t,this.CanvasObj.height=i,this.isCheckDisplay)||this._checkDisplaySize(t,t,i),r>=0&&!1===this.mediaInfo.noFPS&&this.config.ignoreAudio<1?(void 0!==this.audioWAudio&&null!==this.audioWAudio&&(this.audioWAudio.stop(),this.audioWAudio=null),this.config.sampleRate=a,this.mediaInfo.sampleRate=a,this.audioWAudio=s({sampleRate:this.mediaInfo.sampleRate,appendType:o.APPEND_TYPE_FRAME}),this.audioWAudio.isLIVE=!0):this.mediaInfo.audioNone=!0,this.onProbeFinish&&this.onProbeFinish()}},{key:"_callbackYUV",value:function(e,t,i,n,r,a,s,o,u){var l=Module.HEAPU8.subarray(e,e+n*o),d=new Uint8Array(l),h=Module.HEAPU8.subarray(t,t+r*o/2),c=new Uint8Array(h),f=Module.HEAPU8.subarray(i,i+a*o/2),p={bufY:d,bufU:c,bufV:new Uint8Array(f),line_y:n,h:o,pts:u};this.YuvBuf.push(p),this.checkCacheState(),Module._free(l),l=null,Module._free(h),h=null,Module._free(f),f=null,!1===this.readyShowDone&&(this.playYUV(),this.readyShowDone=!0,this.onReadyShowDone&&this.onReadyShowDone(),this.audioWAudio||this.play())}},{key:"_callbackNALU",value:function(e,t,i,n,r,a,s){if(!1===this.readyKeyFrame){if(i<=0)return;this.readyKeyFrame=!0}var o=Module.HEAPU8.subarray(e,e+t),u=new Uint8Array(o);this.NaluBuf.push({bufData:u,len:t,isKey:i,w:n,h:r,pts:1e3*a,dts:1e3*s}),Module._free(o),o=null}},{key:"_callbackPCM",value:function(e){}},{key:"_callbackAAC",value:function(e,t,i,n,r){var a=this._ptsFixed2(r);if(this.audioWAudio){var s=new Uint8Array(7+i),o=Module.HEAPU8.subarray(e,e+7);s.set(o,0);var u=Module.HEAPU8.subarray(t,t+i);s.set(u,7);var l={pts:a,data:s};this.audioWAudio.addSample(l),this.checkCacheState()}}},{key:"_decode",value:function(){var e=this;setTimeout((function(){if(null!==e.workerFetch){var t=e.NaluBuf.shift();if(null!=t){var i=Module._malloc(t.bufData.length);Module.HEAP8.set(t.bufData,i),Module.cwrap("decodeHttpFlvVideoFrame","number",["number","number","number","number","number"])(e.AVSniffPtr,i,t.bufData.length,t.pts,t.dts,0),Module._free(i),i=null}e._decode()}}),1)}},{key:"checkCacheState",value:function(){var e=this.YuvBuf.length>=25&&(!0===this.mediaInfo.audioNone||this.audioWAudio&&this.audioWAudio.sampleQueue.length>=50);return!1===this.cache_status&&e&&(this.playInterval&&this.audioWAudio&&this.audioWAudio.play(),this.onLoadCacheFinshed&&this.onLoadCacheFinshed(),this.cache_status=!0),e}},{key:"setVoice",value:function(e){this.audioVoice=e,this.audioWAudio&&this.audioWAudio.setVoice(e)}},{key:"_removeBindFuncPtr",value:function(){null!==this._ptr_probeCallback&&Module.removeFunction(this._ptr_probeCallback),null!==this._ptr_frameCallback&&Module.removeFunction(this._ptr_frameCallback),null!==this._ptr_naluCallback&&Module.removeFunction(this._ptr_naluCallback),null!==this._ptr_sampleCallback&&Module.removeFunction(this._ptr_sampleCallback),null!==this._ptr_aacCallback&&Module.removeFunction(this._ptr_aacCallback),this._ptr_probeCallback=null,this._ptr_frameCallback=null,this._ptr_naluCallback=null,this._ptr_sampleCallback=null,this._ptr_aacCallback=null}},{key:"release",value:function(){return this.pause(),this.NaluBuf.length=0,this.YuvBuf.length=0,void 0!==this.workerFetch&&null!==this.workerFetch&&this.workerFetch.postMessage({cmd:"stop",data:"stop",msg:"stop"}),this.workerFetch=null,this.AVGetInterval&&clearInterval(this.AVGetInterval),this.AVGetInterval=null,this._removeBindFuncPtr(),Module.cwrap("releaseHttpFLV","number",["number"])(this.AVSniffPtr),this.playInterval&&clearInterval(this.playInterval),this.playInterval=null,this.audioWAudio&&this.audioWAudio.stop(),this.audioWAudio=null,this.CanvasObj&&this.CanvasObj.remove(),this.CanvasObj=null,0}},{key:"isPlayingState",value:function(){return null!==this.playInterval&&void 0!==this.playInterval}},{key:"pause",value:function(){this.audioWAudio&&this.audioWAudio.pause(),this.playInterval&&clearInterval(this.playInterval),this.playInterval=null}},{key:"playYUV",value:function(){if(this.YuvBuf.length>0){var e=this.YuvBuf.shift();return r.renderFrame(this.AVGLObj,e.bufY,e.bufU,e.bufV,e.line_y,e.h),!0}return!1}},{key:"play",value:function(){var e=this,t=this;if(!1===this.checkCacheState())return this.onLoadCache&&this.onLoadCache(),setTimeout((function(){e.play()}),100),!1;if(void 0===this.playInterval||null===this.playInterval){var i=0,n=0,s=0;!1===this.mediaInfo.audioNone&&this.audioWAudio&&!1===this.mediaInfo.noFPS?(this.playInterval=setInterval((function(){if(n=a.GetMsTime(),t.cache_status){if(n-i>=t.frameTime-s){var e=t.YuvBuf.shift();if(null!=e&&null!==e){var o=0;null!==t.audioWAudio&&void 0!==t.audioWAudio&&(o=1e3*(e.pts-t.audioWAudio.getAlignVPTS())),s=t.audioWAudio?o<0&&-1*o<=t.frameTime||o>=0?a.GetMsTime()-n+1:t.frameTime:a.GetMsTime()-n+1,r.renderFrame(t.AVGLObj,e.bufY,e.bufU,e.bufV,e.line_y,e.h)}(t.YuvBuf.length<=0||t.audioWAudio&&t.audioWAudio.sampleQueue.length<=0)&&(t.cache_status=!1,t.onLoadCache&&t.onLoadCache(),t.audioWAudio&&t.audioWAudio.pause()),i=n}}else s=t.frameTime}),1),this.audioWAudio&&this.audioWAudio.play()):this.playInterval=setInterval((function(){var e=t.YuvBuf.shift();null!=e&&null!==e&&r.renderFrame(t.AVGLObj,e.bufY,e.bufU,e.bufV,e.line_y,e.h),t.YuvBuf.length<=0&&(t.cache_status=!1)}),t.frameTime)}}},{key:"start",value:function(e){var t,i,n,a=this;this.workerFetch=new Worker((t=function(){var e=null,t=new AbortController,i=t.signal,n=(self,function(e){var t=!1;t||(t=!0,fetch(e,{signal:i}).then((function(e){return function e(t){return t.read().then((function(i){if(!i.done){var n=i.value;return self.postMessage({cmd:"fetch-chunk",data:n,msg:"fetch-chunk"}),e(t)}self.postMessage({cmd:"fetch-fin",data:null,msg:"fetch-fin"})}))}(e.body.getReader())})).catch((function(e){if(!e.toString().includes("user aborted")){var t=" httplive request error:"+e+" start to retry";console.error(t),self.postMessage({cmd:"fetch-error",data:t,msg:"fetch-error"})}})))});self.onmessage=function(r){var a=r.data;switch(void 0===a.cmd||null===a.cmd?"":a.cmd){case"start":e=a.data,n(e),self.postMessage({cmd:"default",data:"WORKER STARTED",msg:"default"});break;case"stop":t.abort(),self.close(),self.postMessage({cmd:"close",data:"close",msg:"close"});break;case"retry":t.abort(),t=null,i=null,t=new AbortController,i=t.signal,setTimeout((function(){n(e)}),3e3)}}}.toString(),i=t.match(/^\s*function\s*\(\s*\)\s*\{(([\s\S](?!\}$))*[\s\S])/),n=[i[1]],window.URL.createObjectURL(new Blob(n,{type:"text/javascript"})))),this.workerFetch.onmessage=function(e){a._workerFetch_onmessage(e,a)},this.workerFetch,this.AVSniffPtr=Module.cwrap("AVSniffHttpFlvInit","number",["string","string"])("base64:QXV0aG9yOmNoYW5neWFubG9uZ3xudW1iZXJ3b2xmLEdpdGh1YjpodHRwczovL2dpdGh1Yi5jb20vbnVtYmVyd29sZixFbWFpbDpwb3JzY2hlZ3QyM0Bmb3htYWlsLmNvbSxRUTo1MzEzNjU4NzIsSG9tZVBhZ2U6aHR0cDovL3h2aWRlby52aWRlbyxEaXNjb3JkOm51bWJlcndvbGYjODY5NCx3ZWNoYXI6bnVtYmVyd29sZjExLEJlaWppbmcsV29ya0luOkJhaWR1","0.0.0"),this.AVSniffPtr,this._ptr_probeCallback=Module.addFunction(this._callbackProbe.bind(this)),this._ptr_yuvCallback=Module.addFunction(this._callbackYUV.bind(this)),this._ptr_naluCallback=Module.addFunction(this._callbackNALU.bind(this)),this._ptr_sampleCallback=Module.addFunction(this._callbackPCM.bind(this)),this._ptr_aacCallback=Module.addFunction(this._callbackAAC.bind(this)),Module.cwrap("initializeSniffHttpFlvModule","number",["number","number","number","number","number","number"])(this.AVSniffPtr,this._ptr_probeCallback,this._ptr_yuvCallback,this._ptr_naluCallback,this._ptr_sampleCallback,this._ptr_aacCallback),this.AVGLObj=r.setupCanvas(this.CanvasObj,{preserveDrawingBuffer:!1}),this.workerFetch.postMessage({cmd:"start",data:e,msg:"start"}),this._decode()}}])&&n(t.prototype,i),u&&n(t,u),e}();i.CHttpLiveCore=u},{"../consts":52,"../demuxer/buffer":64,"../demuxer/bufferFrame":65,"../render-engine/webgl-420p":77,"../version":80,"./audio-core":53,"./audio-native-core":54,"./av-common":55,"./cache":59,"./cacheYuv":60}],57:[function(e,t,i){"use strict";function n(e,t){for(var i=0;i0&&void 0!==arguments[0]&&arguments[0];this.showScreen=e,this.canvas&&(e?this.canvas.setAttribute("hidden",!0):this.canvas.removeAttribute("hidden"))}},{key:"getCachePTS",value:function(){return 1!==this.config.ignoreAudio&&this.audioWAudio?Math.max(this.vCachePTS,this.aCachePTS):this.vCachePTS}},{key:"getMaxPTS",value:function(){return Math.max(this.vCachePTS,this.aCachePTS)}},{key:"isPlayingState",value:function(){return this.isPlaying}},{key:"pushDone",value:function(){this.pushEOF=!0}},{key:"_clearDecInterval",value:function(){this.decVFrameInterval&&window.clearInterval(this.decVFrameInterval),this.decVFrameInterval=null}},{key:"_checkPlayFinished",value:function(){return!(this.config.playMode!==d.PLAYER_MODE_VOD||!(!0===this.bufRecvStat&&(this.playPTS>=this.bufLastVDTS||this.audioWAudio&&this.playPTS>=this.bufLastADTS)||this.duration-this.playPTS0&&(this.isPlaying=!0);var t=0,i=0,n=0;this.config.playMode===d.PLAYER_MODE_NOTIME_LIVE?this.playFrameInterval=window.setInterval((function(){if(e._videoQueue.length>0){var t=e._videoQueue.shift();t.pts,o.renderFrame(e.yuv,t.data_y,t.data_u,t.data_v,t.line1,t.height)}}),1e3*this.frameDur):this.playFrameInterval=window.setInterval((function(){if(i=u.GetMsTime(),e._videoQueue.length>0&&i-t>=e.frameTime-n){var r=e._videoQueue.shift(),a=0;if(e.isNewSeek||null===e.audioWAudio||void 0===e.audioWAudio||(a=1e3*(r.pts-e.audioWAudio.getAlignVPTS()),e.playPTS=Math.max(e.audioWAudio.getAlignVPTS(),e.playPTS)),t=i,u.GetMsTime(),e.playPTS=Math.max(r.pts,e.playPTS),e.isNewSeek&&e.seekTarget-e.frameDur>r.pts)return void(n=e.frameTime);if(e.isNewSeek&&(e.audioWAudio&&e.audioWAudio.setVoice(e.audioVoice),e.audioWAudio&&e.audioWAudio.play(),n=0,e.isNewSeek=!1,e.seekTarget=0),e.showScreen?e.onRender&&e.onRender(r.line1,r.height,r.data_y,r.data_u,r.data_v):(r.pts,o.renderFrame(e.yuv,r.data_y,r.data_u,r.data_v,r.line1,r.height)),e.onPlayingTime&&e.onPlayingTime(r.pts),!e.isNewSeek&&e.audioWAudio&&(a<0&&-1*a<=e.frameTime||a>=0)){if(e.config.playMode===d.PLAYER_MODE_VOD)if(r.pts>=e.duration)e.onLoadCacheFinshed&&e.onLoadCacheFinshed(),e.onPlayingFinish&&e.onPlayingFinish(),e._clearDecInterval(),e.pause();else if(e._checkPlayFinished())return;n=u.GetMsTime()-i}else!e.isNewSeek&&e.audioWAudio&&(a<0&&e.frameTime,n=e.frameTime)}e._checkPlayFinished()}),1)}this.isNewSeek||this.audioWAudio&&this.audioWAudio.play()}},{key:"pause",value:function(){this.isPlaying=!1,this._pause()}},{key:"_pause",value:function(){this.playFrameInterval&&window.clearInterval(this.playFrameInterval),this.playFrameInterval=null,this.audioWAudio&&this.audioWAudio.pause()}},{key:"seek",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.openFrameCall=!1,this.pause(),this._clearDecInterval(),null!==this.avFeedVideoInterval&&(window.clearInterval(this.avFeedVideoInterval),this.avFeedVideoInterval=null),null!==this.avFeedAudioInterval&&(window.clearInterval(this.avFeedAudioInterval),this.avFeedAudioInterval=null),this.yuvMaxTime=0,this.playVPipe.length=0,this._videoQueue.length=0,this.audioWAudio&&this.audioWAudio.stop(),e&&e(),this.isNewSeek=!0,this.avSeekVState=!0,this.seekTarget=i.seekTime,null!==this.audioWAudio&&void 0!==this.audioWAudio&&(this.audioWAudio.setVoice(0),this.audioWAudio.resetStartParam(),this.audioWAudio.stop()),this._avFeedData(i.seekTime),setTimeout((function(){t.yuvMaxTime=0,t._videoQueue.length=0,t.openFrameCall=!0,t.frameCallTag+=1,t._decVFrameIntervalFunc()}),1e3)}},{key:"setVoice",value:function(e){this.audioVoice=e,this.audioWAudio&&this.audioWAudio.setVoice(e)}},{key:"cacheIsFull",value:function(){return this._videoQueue.length>=50}},{key:"_checkDisplaySize",value:function(e,t,i){var n=t-e,r=this.config.width+Math.ceil(n/2),a=t/this.config.width>i/this.config.height,s=(r/t).toFixed(2),o=(this.config.height/i).toFixed(2),u=a?s:o,l=this.config.fixed,d=l?r:parseInt(t*u),h=l?this.config.height:parseInt(i*u);if(this.canvas.offsetWidth!=d||this.canvas.offsetHeight!=h){var c=parseInt((this.canvasBox.offsetHeight-h)/2),f=parseInt((this.canvasBox.offsetWidth-d)/2);c=c<0?0:c,f=f<0?0:f,this.canvas.style.marginTop=c+"px",this.canvas.style.marginLeft=f+"px",this.canvas.style.width=d+"px",this.canvas.style.height=h+"px"}return this.isCheckDisplay=!0,[d,h]}},{key:"_createYUVCanvas",value:function(){this.canvasBox=document.querySelector("#"+this.config.playerId),this.canvasBox.style.overflow="hidden",this.canvas=document.createElement("canvas"),this.canvas.style.width=this.canvasBox.clientWidth+"px",this.canvas.style.height=this.canvasBox.clientHeight+"px",this.canvas.style.top="0px",this.canvas.style.left="0px",this.canvasBox.appendChild(this.canvas),this.yuv=o.setupCanvas(this.canvas,{preserveDrawingBuffer:!1})}},{key:"_avRecvPackets",value:function(){var e=this;this.bufObject.cleanPipeline(),null!==this.avRecvInterval&&(window.clearInterval(this.avRecvInterval),this.avRecvInterval=null),!0===this.config.checkProbe?this.avRecvInterval=window.setInterval((function(){Module.cwrap("getSniffStreamPkg","number",["number"])(e.corePtr),e._avCheckRecvFinish()}),5):this.avRecvInterval=window.setInterval((function(){Module.cwrap("getSniffStreamPkgNoCheckProbe","number",["number"])(e.corePtr),e._avCheckRecvFinish()}),5),this._avFeedData(0,!1)}},{key:"_avCheckRecvFinish",value:function(){this.config.playMode===d.PLAYER_MODE_VOD&&this.duration-this.getMaxPTS()=50&&(t.onSeekFinish&&t.onSeekFinish(),t.onPlayingTime&&t.onPlayingTime(e),t.play(),window.clearInterval(i),i=null)}),10);return!0}},{key:"_afterAvFeedSeekToStartWithUnFinBuffer",value:function(e){var t=this,i=window.setInterval((function(){t._videoQueue.length,t._videoQueue.length>=50&&(t.onSeekFinish&&t.onSeekFinish(),t.onPlayingTime&&t.onPlayingTime(e),!1===t.reFull?t.play():t.reFull=!1,window.clearInterval(i),i=null)}),10);return!0}},{key:"_avFeedData",value:function(e){var t=this;if(this.playVPipe.length=0,this.audioWAudio&&this.audioWAudio.cleanQueue(),e<=0&&!1===this.bufOK){var i=0;if(this.avFeedVideoInterval=window.setInterval((function(){var n=t.bufObject.videoBuffer.length;if(n-1>i||t.duration-t.getMaxPTS()0){for(var s=0;s0&&t.playVPipe[t.playVPipe.length-1].pts>=t.bufLastVDTS&&(window.clearInterval(t.avFeedVideoInterval),t.avFeedVideoInterval=null,t.playVPipe[t.playVPipe.length-1].pts,t.bufLastVDTS,t.bufObject.videoBuffer,t.playVPipe)}else t.config.playMode===d.PLAYER_MODE_VOD&&t.playVPipe.length>0&&t.playVPipe[t.playVPipe.length-1].pts>=t.duration&&(window.clearInterval(t.avFeedVideoInterval),t.avFeedVideoInterval=null,t.playVPipe[t.playVPipe.length-1].pts,t.duration,t.bufObject.videoBuffer,t.playVPipe);t.avSeekVState&&(t.getMaxPTS(),t.duration,t.config.playMode===d.PLAYER_MODE_VOD&&(t._afterAvFeedSeekToStartWithFinishedBuffer(e),t.avSeekVState=!1))}),5),void 0!==this.audioWAudio&&null!==this.audioWAudio&&this.config.ignoreAudio<1){var n=0;this.avFeedAudioInterval=window.setInterval((function(){var e=t.bufObject.audioBuffer.length;if(e-1>n||t.duration-t.getMaxPTS()0&&t.audioWAudio.sampleQueue[t.audioWAudio.sampleQueue.length-1].pts>=t.bufLastADTS&&(window.clearInterval(t.avFeedAudioInterval),t.avFeedAudioInterval=null,t.audioWAudio.sampleQueue[t.audioWAudio.sampleQueue.length-1].pts,t.bufObject.audioBuffer)}else t.config.playMode===d.PLAYER_MODE_VOD&&t.audioWAudio.sampleQueue.length>0&&t.audioWAudio.sampleQueue[t.audioWAudio.sampleQueue.length-1].pts>=t.duration&&(window.clearInterval(t.avFeedAudioInterval),t.avFeedAudioInterval=null,t.audioWAudio.sampleQueue[t.audioWAudio.sampleQueue.length-1].pts,t.bufObject.audioBuffer)}),5)}}else{var r=this.bufObject.seekIDR(e),s=parseInt(r,10);this.playPTS=0;var o=s;if(this.avFeedVideoInterval=window.setInterval((function(){var i=t.bufObject.videoBuffer.length;if(i-1>o||t.duration-t.getMaxPTS()0){for(var r=0;r0&&t.playVPipe[t.playVPipe.length-1].pts>=t.bufLastVDTS&&(window.clearInterval(t.avFeedVideoInterval),t.avFeedVideoInterval=null)}else t.config.playMode===d.PLAYER_MODE_VOD&&t.playVPipe.length>0&&t.playVPipe[t.playVPipe.length-1].pts>=t.duration&&(window.clearInterval(t.avFeedVideoInterval),t.avFeedVideoInterval=null);t.avSeekVState&&(t.getMaxPTS(),t.duration,t.config.playMode===d.PLAYER_MODE_VOD&&(t._afterAvFeedSeekToStartWithUnFinBuffer(e),t.avSeekVState=!1))}),5),this.audioWAudio&&this.config.ignoreAudio<1){var u=parseInt(e,10);this.avFeedAudioInterval=window.setInterval((function(){var e=t.bufObject.audioBuffer.length;if(e-1>u||t.duration-t.getMaxPTS()0&&t.audioWAudio.sampleQueue[t.audioWAudio.sampleQueue.length-1].pts>=t.bufLastADTS&&(window.clearInterval(t.avFeedAudioInterval),t.avFeedAudioInterval=null)}else t.config.playMode===d.PLAYER_MODE_VOD&&t.audioWAudio.sampleQueue.length>0&&t.audioWAudio.sampleQueue[t.audioWAudio.sampleQueue.length-1].pts>=t.duration&&(window.clearInterval(t.avFeedAudioInterval),t.avFeedAudioInterval=null)}),5)}}}},{key:"_probeFinCallback",value:function(e,t,i,n,r,a,s,o,u){var h=this;this._createYUVCanvas(),d.V_CODEC_NAME_HEVC,this.config.fps=1*n,this.frameTime=1e3/this.config.fps,this.width=t,this.height=i,this.frameDur=1/this.config.fps,this.duration=e-this.frameDur,this.vCodecID=o,this.config.sampleRate=a,this.channels=s,this.audioIdx=r,this.duration<0&&(this.config.playMode=d.PLAYER_MODE_NOTIME_LIVE,this.frameTime,this.frameDur);for(var c=Module.HEAPU8.subarray(u,u+10),f=0;f=0&&this.config.ignoreAudio<1?(void 0!==this.audioWAudio&&null!==this.audioWAudio&&(this.audioWAudio.stop(),this.audioWAudio=null),this.audioWAudio=l({sampleRate:a,appendType:d.APPEND_TYPE_FRAME}),this.audioWAudio.setDurationMs(1e3*e),this.onLoadCache&&this.audioWAudio.setOnLoadCache((function(){if(h.retryAuSampleNo,h.retryAuSampleNo<=5){h.pause(),h.onLoadCache&&h.onLoadCache();var e=window.setInterval((function(){return h.retryAuSampleNo,h.audioWAudio.sampleQueue.length,h.audioWAudio.sampleQueue.length>2?(h.onLoadCacheFinshed&&h.onLoadCacheFinshed(),h.play(),h.retryAuSampleNo=0,window.clearInterval(e),void(e=null)):(h.retryAuSampleNo+=1,h.retryAuSampleNo>5?(h.play(),h.onLoadCacheFinshed&&h.onLoadCacheFinshed(),window.clearInterval(e),void(e=null)):void 0)}),1e3)}}))):this.audioNone=!0,this._avRecvPackets(),this._decVFrameIntervalFunc()),this.onProbeFinish&&this.onProbeFinish()}},{key:"_ptsFixed2",value:function(e){return Math.ceil(100*e)/100}},{key:"_naluCallback",value:function(e,t,i,n,r,a,s){var o=this._ptsFixed2(a),u=Module.HEAPU8.subarray(e,e+t),l=new Uint8Array(u);this.bufObject.appendFrameWithDts(o,s,l,!0,i),this.bufLastVDTS=Math.max(s,this.bufLastVDTS),this.vCachePTS=Math.max(o,this.vCachePTS),this.onCacheProcess&&this.onCacheProcess(this.getCachePTS())}},{key:"_samplesCallback",value:function(e,t,i,n){}},{key:"_aacFrameCallback",value:function(e,t,i,n,r){var a=this._ptsFixed2(r);if(this.audioWAudio){var s=new Uint8Array(7+i),o=Module.HEAPU8.subarray(e,e+7);s.set(o,0);var u=Module.HEAPU8.subarray(t,t+i);s.set(u,7),this.bufObject.appendFrame(a,s,!1,!0),this.bufLastADTS=Math.max(a,this.bufLastADTS),this.aCachePTS=Math.max(a,this.aCachePTS),this.onCacheProcess&&this.onCacheProcess(this.getCachePTS())}}},{key:"_decVFrameIntervalFunc",value:function(){var e=this;null==this.decVFrameInterval&&(this.decVFrameInterval=window.setInterval((function(){if(e._videoQueue.length<50&&e.playVPipe.length>0){var t=e.playVPipe.shift(),i=t.data,n=Module._malloc(i.length);Module.HEAP8.set(i,n);var r=parseInt(1e3*t.pts,10),a=parseInt(1e3*t.dts,10);e.yuvMaxTime=Math.max(t.pts,e.yuvMaxTime),Module.cwrap("decodeVideoFrame","number",["number","number","number","number","number"])(e.corePtr,n,i.length,r,a,e.frameCallTag),Module._free(n),n=null}}),10))}},{key:"_frameCallback",value:function(e,t,i,n,r,a,s,u,l,d){if(this._videoQueue.length,!(!1===this.openFrameCall||d!==this.frameCallTag||l>this.yuvMaxTime+this.frameDur||this.isNewSeek&&this.seekTarget-l>3*this.frameDur)){var h=this._videoQueue.length;if(this.canvas.width==n&&this.canvas.height==u||(this.canvas.width=n,this.canvas.height=u,this.isCheckDisplay)||this._checkDisplaySize(s,n,u),!(this.playPTS>l)){var f=Module.HEAPU8.subarray(e,e+n*u),p=Module.HEAPU8.subarray(t,t+r*u/2),m=Module.HEAPU8.subarray(i,i+a*u/2),g=new Uint8Array(f),_=new Uint8Array(p),y=new Uint8Array(m);this.config.readyShow&&(o.renderFrame(this.yuv,g,_,y,n,u),this.config.readyShow=!1,this.onReadyShowDone&&this.onReadyShowDone());var v=new c(g,_,y,n,r,a,s,u,l);if(h<=0||l>this._videoQueue[h-1].pts)this._videoQueue.push(v);else if(lthis._videoQueue[b].pts&&b+10&&(t.getPackageTimeMS=a.GetMsTime()),t.pushPkg++,void 0!==t.AVGetInterval&&null!==t.AVGetInterval||(t.AVGetInterval=window.setInterval((function(){Module.cwrap("getBufferLengthApi","number",["number"])(t.AVSniffPtr)>t.config.probeSize&&(Module.cwrap("getSniffHttpFlvPkg","number",["number"])(t.AVSniffPtr),t.pushPkg-=1)}),5));break;case"close":t.AVGetInterval&&clearInterval(t.AVGetInterval),t.AVGetInterval=null;case"fetch-fin":break;case"fetch-error":t.onNetworkError&&t.onNetworkError(i.data)}}},{key:"_checkDisplaySize",value:function(e,t,i){var n=t-e,r=this.config.width+Math.ceil(n/2),a=t/this.config.width>i/this.config.height,s=(r/t).toFixed(2),o=(this.config.height/i).toFixed(2),u=a?s:o,l=this.config.fixed,d=l?r:parseInt(t*u),h=l?this.config.height:parseInt(i*u);if(this.CanvasObj.offsetWidth!=d||this.CanvasObj.offsetHeight!=h){var c=parseInt((this.canvasBox.offsetHeight-h)/2),f=parseInt((this.canvasBox.offsetWidth-d)/2);c=c<0?0:c,f=f<0?0:f,this.CanvasObj.style.marginTop=c+"px",this.CanvasObj.style.marginLeft=f+"px",this.CanvasObj.style.width=d+"px",this.CanvasObj.style.height=h+"px"}return this.isCheckDisplay=!0,[d,h]}},{key:"_ptsFixed2",value:function(e){return Math.ceil(100*e)/100}},{key:"_callbackProbe",value:function(e,t,i,n,r,a,u,l,d){for(var h=Module.HEAPU8.subarray(d,d+10),c=0;c100&&(f=o.DEFAULT_FPS,this.mediaInfo.noFPS=!0),this.vCodecID=l,this.config.fps=f,this.mediaInfo.fps=f,this.mediaInfo.size.width=t,this.mediaInfo.size.height=i,this.frameTime=Math.floor(1e3/(this.mediaInfo.fps+2)),this.CanvasObj.width==t&&this.CanvasObj.height==i||(this.CanvasObj.width=t,this.CanvasObj.height=i,this.isCheckDisplay)||this._checkDisplaySize(t,t,i),r>=0&&!1===this.mediaInfo.noFPS&&this.config.ignoreAudio<1?(void 0!==this.audioWAudio&&null!==this.audioWAudio&&(this.audioWAudio.stop(),this.audioWAudio=null),this.config.sampleRate=a,this.mediaInfo.sampleRate=a,this.audioWAudio=s({sampleRate:this.mediaInfo.sampleRate,appendType:o.APPEND_TYPE_FRAME}),this.audioWAudio.isLIVE=!0):this.mediaInfo.audioNone=!0,this.onProbeFinish&&this.onProbeFinish()}},{key:"_callbackYUV",value:function(e,t,i,n,r,a,s,o,u){var l=Module.HEAPU8.subarray(e,e+n*o),d=new Uint8Array(l),h=Module.HEAPU8.subarray(t,t+r*o/2),c=new Uint8Array(h),f=Module.HEAPU8.subarray(i,i+a*o/2),p={bufY:d,bufU:c,bufV:new Uint8Array(f),line_y:n,h:o,pts:u};this.YuvBuf.push(p),this.checkCacheState(),Module._free(l),l=null,Module._free(h),h=null,Module._free(f),f=null,!1===this.readyShowDone&&(this.playYUV(),this.readyShowDone=!0,this.onReadyShowDone&&this.onReadyShowDone(),this.audioWAudio||this.play())}},{key:"_callbackNALU",value:function(e,t,i,n,r,a,s){if(!1===this.readyKeyFrame){if(i<=0)return;this.readyKeyFrame=!0}var o=Module.HEAPU8.subarray(e,e+t),u=new Uint8Array(o);this.NaluBuf.push({bufData:u,len:t,isKey:i,w:n,h:r,pts:1e3*a,dts:1e3*s}),Module._free(o),o=null}},{key:"_callbackPCM",value:function(e){}},{key:"_callbackAAC",value:function(e,t,i,n,r){var a=this._ptsFixed2(r);if(this.audioWAudio){var s=new Uint8Array(7+i),o=Module.HEAPU8.subarray(e,e+7);s.set(o,0);var u=Module.HEAPU8.subarray(t,t+i);s.set(u,7);var l={pts:a,data:s};this.audioWAudio.addSample(l),this.checkCacheState()}}},{key:"_decode",value:function(){var e=this;setTimeout((function(){if(null!==e.workerFetch){var t=e.NaluBuf.shift();if(null!=t){var i=Module._malloc(t.bufData.length);Module.HEAP8.set(t.bufData,i),Module.cwrap("decodeHttpFlvVideoFrame","number",["number","number","number","number","number"])(e.AVSniffPtr,i,t.bufData.length,t.pts,t.dts,0),Module._free(i),i=null}e._decode()}}),1)}},{key:"checkCacheState",value:function(){var e=this.YuvBuf.length>=25&&(!0===this.mediaInfo.audioNone||this.audioWAudio&&this.audioWAudio.sampleQueue.length>=50);return!1===this.cache_status&&e&&(this.playInterval&&this.audioWAudio&&this.audioWAudio.play(),this.onLoadCacheFinshed&&this.onLoadCacheFinshed(),this.cache_status=!0),e}},{key:"setVoice",value:function(e){this.audioVoice=e,this.audioWAudio&&this.audioWAudio.setVoice(e)}},{key:"_removeBindFuncPtr",value:function(){null!==this._ptr_probeCallback&&Module.removeFunction(this._ptr_probeCallback),null!==this._ptr_frameCallback&&Module.removeFunction(this._ptr_frameCallback),null!==this._ptr_naluCallback&&Module.removeFunction(this._ptr_naluCallback),null!==this._ptr_sampleCallback&&Module.removeFunction(this._ptr_sampleCallback),null!==this._ptr_aacCallback&&Module.removeFunction(this._ptr_aacCallback),this._ptr_probeCallback=null,this._ptr_frameCallback=null,this._ptr_naluCallback=null,this._ptr_sampleCallback=null,this._ptr_aacCallback=null}},{key:"release",value:function(){return this.pause(),this.NaluBuf.length=0,this.YuvBuf.length=0,void 0!==this.workerFetch&&null!==this.workerFetch&&this.workerFetch.postMessage({cmd:"stop",data:"stop",msg:"stop"}),this.workerFetch=null,this.AVGetInterval&&clearInterval(this.AVGetInterval),this.AVGetInterval=null,this._removeBindFuncPtr(),Module.cwrap("releaseHttpFLV","number",["number"])(this.AVSniffPtr),this.playInterval&&clearInterval(this.playInterval),this.playInterval=null,this.audioWAudio&&this.audioWAudio.stop(),this.audioWAudio=null,this.CanvasObj&&this.CanvasObj.remove(),this.CanvasObj=null,0}},{key:"isPlayingState",value:function(){return null!==this.playInterval&&void 0!==this.playInterval}},{key:"pause",value:function(){this.audioWAudio&&this.audioWAudio.pause(),this.playInterval&&clearInterval(this.playInterval),this.playInterval=null}},{key:"playYUV",value:function(){if(this.YuvBuf.length>0){var e=this.YuvBuf.shift();return r.renderFrame(this.AVGLObj,e.bufY,e.bufU,e.bufV,e.line_y,e.h),!0}return!1}},{key:"play",value:function(){var e=this,t=this;if(!1===this.checkCacheState())return this.onLoadCache&&this.onLoadCache(),setTimeout((function(){e.play()}),100),!1;if(void 0===this.playInterval||null===this.playInterval){var i=0,n=0,s=0;!1===this.mediaInfo.audioNone&&this.audioWAudio&&!1===this.mediaInfo.noFPS?(this.playInterval=setInterval((function(){if(n=a.GetMsTime(),t.cache_status){if(n-i>=t.frameTime-s){var e=t.YuvBuf.shift();if(null!=e&&null!==e){var o=0;null!==t.audioWAudio&&void 0!==t.audioWAudio&&(o=1e3*(e.pts-t.audioWAudio.getAlignVPTS())),s=t.audioWAudio?o<0&&-1*o<=t.frameTime||o>=0?a.GetMsTime()-n+1:t.frameTime:a.GetMsTime()-n+1,r.renderFrame(t.AVGLObj,e.bufY,e.bufU,e.bufV,e.line_y,e.h)}(t.YuvBuf.length<=0||t.audioWAudio&&t.audioWAudio.sampleQueue.length<=0)&&(t.cache_status=!1,t.onLoadCache&&t.onLoadCache(),t.audioWAudio&&t.audioWAudio.pause()),i=n}}else s=t.frameTime}),1),this.audioWAudio&&this.audioWAudio.play()):this.playInterval=setInterval((function(){var e=t.YuvBuf.shift();null!=e&&null!==e&&r.renderFrame(t.AVGLObj,e.bufY,e.bufU,e.bufV,e.line_y,e.h),t.YuvBuf.length<=0&&(t.cache_status=!1)}),t.frameTime)}}},{key:"start",value:function(e){var t,i,n,a=this;this.workerFetch=new Worker((t=function(){var e=null;self,self.onmessage=function(t){var i=t.data;switch(void 0===i.cmd||null===i.cmd?"":i.cmd){case"start":var n=i.data;(e=new WebSocket(n)).binaryType="arraybuffer",e.onopen=function(t){e.send("Hello WebSockets!")},e.onmessage=function(e){if(e.data instanceof ArrayBuffer){var t=e.data;t.byteLength>0&&postMessage({cmd:"fetch-chunk",data:new Uint8Array(t),msg:"fetch-chunk"})}},e.onclose=function(e){};break;case"stop":e&&e.close(),self.close(),self.postMessage({cmd:"close",data:"close",msg:"close"})}}}.toString(),i=t.match(/^\s*function\s*\(\s*\)\s*\{(([\s\S](?!\}$))*[\s\S])/),n=[i[1]],window.URL.createObjectURL(new Blob(n,{type:"text/javascript"})))),this.workerFetch.onmessage=function(e){a._workerFetch_onmessage(e,a)},this.workerFetch,this.AVSniffPtr=Module.cwrap("AVSniffHttpFlvInit","number",["string","string"])("base64:QXV0aG9yOmNoYW5neWFubG9uZ3xudW1iZXJ3b2xmLEdpdGh1YjpodHRwczovL2dpdGh1Yi5jb20vbnVtYmVyd29sZixFbWFpbDpwb3JzY2hlZ3QyM0Bmb3htYWlsLmNvbSxRUTo1MzEzNjU4NzIsSG9tZVBhZ2U6aHR0cDovL3h2aWRlby52aWRlbyxEaXNjb3JkOm51bWJlcndvbGYjODY5NCx3ZWNoYXI6bnVtYmVyd29sZjExLEJlaWppbmcsV29ya0luOkJhaWR1","0.0.0"),this.AVSniffPtr,this._ptr_probeCallback=Module.addFunction(this._callbackProbe.bind(this)),this._ptr_yuvCallback=Module.addFunction(this._callbackYUV.bind(this)),this._ptr_naluCallback=Module.addFunction(this._callbackNALU.bind(this)),this._ptr_sampleCallback=Module.addFunction(this._callbackPCM.bind(this)),this._ptr_aacCallback=Module.addFunction(this._callbackAAC.bind(this)),Module.cwrap("initializeSniffHttpFlvModule","number",["number","number","number","number","number","number"])(this.AVSniffPtr,this._ptr_probeCallback,this._ptr_yuvCallback,this._ptr_naluCallback,this._ptr_sampleCallback,this._ptr_aacCallback),this.AVGLObj=r.setupCanvas(this.CanvasObj,{preserveDrawingBuffer:!1}),this.workerFetch.postMessage({cmd:"start",data:e,msg:"start"}),this._decode()}}])&&n(t.prototype,i),u&&n(t,u),e}();i.CWsLiveCore=u},{"../consts":52,"../demuxer/buffer":64,"../demuxer/bufferFrame":65,"../render-engine/webgl-420p":77,"../version":80,"./audio-core":53,"./audio-native-core":54,"./av-common":55,"./cache":59,"./cacheYuv":60}],59:[function(e,t,i){(function(i){"use strict";e("./cacheYuv");i.CACHE_APPEND_STATUS_CODE={FAILED:-1,OVERFLOW:-2,OK:0,NOT_FULL:1,FULL:2,NULL:3},t.exports=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:60,t={limit:e,yuvCache:[],appendCacheByCacheYuv:function(e){e.pts;return t.yuvCache.length>=t.limit?CACHE_APPEND_STATUS_CODE.OVERFLOW:(t.yuvCache.push(e),t.yuvCache.length>=t.limit?CACHE_APPEND_STATUS_CODE.FULL:CACHE_APPEND_STATUS_CODE.NOT_FULL)},getState:function(){return t.yuvCache.length<=0?CACHE_APPEND_STATUS_CODE.NULL:t.yuvCache.length>=t.limit?CACHE_APPEND_STATUS_CODE.FULL:CACHE_APPEND_STATUS_CODE.NOT_FULL},cleanPipeline:function(){t.yuvCache.length=0},vYuv:function(){return t.yuvCache.length<=0?null:t.yuvCache.shift()}};return t}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./cacheYuv":60}],60:[function(e,t,i){"use strict";function n(e,t){for(var i=0;i>1;return r.indexOf(t)},GET_NALU_TYPE:function(e){var t=(126&e)>>1;if(t>=1&&t<=9)return n.DEFINE_P_FRAME;if(t>=16&&t<=21)return n.DEFINE_KEY_FRAME;var i=r.indexOf(t);return i>=0?r[i]:n.DEFINE_OTHERS_FRAME},PACK_NALU:function(e){var t=e.nalu,i=e.vlc.vlc;null==t.vps&&(t.vps=new Uint8Array);var n=new Uint8Array(t.vps.length+t.sps.length+t.pps.length+t.sei.length+i.length);return n.set(t.vps,0),n.set(t.sps,t.vps.length),n.set(t.pps,t.vps.length+t.sps.length),n.set(t.sei,t.vps.length+t.sps.length+t.pps.length),n.set(i,t.vps.length+t.sps.length+t.pps.length+t.sei.length),n}}},{"./hevc-header":61}],63:[function(e,t,i){"use strict";function n(e){return function(e){if(Array.isArray(e)){for(var t=0,i=new Array(e.length);t0&&void 0!==arguments[0]&&arguments[0];null!=t&&(t.showScreen=e,t.canvas&&(e?t.canvas.setAttribute("hidden",!0):t.canvas.removeAttribute("hidden")))},setSize:function(e,i){t.config.width=e||l.DEFAULT_WIDTH,t.config.height=i||l.DEFAULT_HEIGHT},setFrameRate:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:25;t.config.fps=e,t.config.frameDurMs=1e3/e},setDurationMs:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1;t.durationMs=e,0==t.config.audioNone&&t.audio.setDurationMs(e)},setPlayingCall:function(e){t.onPlayingTime=e},setVoice:function(e){t.realVolume=e,0==t.config.audioNone&&t.audio.setVoice(t.realVolume)},isPlayingState:function(){return t.isPlaying||t.isCaching===l.CACHE_WITH_PLAY_SIGN},appendAACFrame:function(e){t.audio.addSample(e),t.aCachePTS=Math.max(e.pts,t.aCachePTS)},appendHevcFrame:function(e){var i;t.config.appendHevcType==l.APPEND_TYPE_STREAM?t.stream=new Uint8Array((i=n(t.stream)).concat.apply(i,n(e))):t.config.appendHevcType==l.APPEND_TYPE_FRAME&&(t.frameList.push(e),t.vCachePTS=Math.max(e.pts,t.vCachePTS))},getCachePTS:function(){return Math.max(t.vCachePTS,t.aCachePTS)},endAudio:function(){0==t.config.audioNone&&t.audio.stop()},cleanSample:function(){0==t.config.audioNone&&t.audio.cleanQueue()},cleanVideoQueue:function(){t.config.appendHevcType==l.APPEND_TYPE_STREAM?t.stream=new Uint8Array:t.config.appendHevcType==l.APPEND_TYPE_FRAME&&(t.frameList=[],t.frameList.length=0)},cleanCacheYUV:function(){t.cacheYuvBuf.cleanPipeline()},pause:function(){t.loop&&window.clearInterval(t.loop),t.loop=null,0==t.config.audioNone&&t.audio.pause(),t.isPlaying=!1,t.isCaching===l.CACHE_WITH_PLAY_SIGN&&(t.isCaching=l.CACHE_WITH_NOPLAY_SIGN)},checkFinished:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:l.PLAYER_MODE_VOD;return e==l.PLAYER_MODE_VOD&&t.cacheYuvBuf.yuvCache.length<=0&&(t.videoPTS.toFixed(1)>=(t.durationMs-t.config.frameDurMs)/1e3||t.noCacheFrame>=10)&&(null!=t.onPlayingFinish&&(l.PLAYER_MODE_VOD,t.frameList.length,t.cacheYuvBuf.yuvCache.length,t.videoPTS.toFixed(1),t.durationMs,t.config.frameDurMs,t.noCacheFrame,t.onPlayingFinish()),!0)},clearAllCache:function(){t.nowPacket=null,t.vCachePTS=0,t.aCachePTS=0,t.cleanSample(),t.cleanVideoQueue(),t.cleanCacheYUV()},seek:function(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.isPlaying;t.pause(),t.stopCacheThread(),t.clearAllCache(),e&&e(),t.isNewSeek=!0,t.flushDecoder=1,t.videoPTS=parseInt(i.seekTime);var r={seekPos:i.seekTime||-1,mode:i.mode||l.PLAYER_MODE_VOD,accurateSeek:i.accurateSeek||!0,seekEvent:i.seekEvent||!0,realPlay:n};t.cacheThread(),t.play(r)},getNalu1Packet:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],i=null,n=-1;if(t.config.appendHevcType==l.APPEND_TYPE_STREAM)i=t.nextNalu();else{if(t.config.appendHevcType!=l.APPEND_TYPE_FRAME)return null;var r=t.frameList.shift();if(!r)return null;i=r.data,n=r.pts,e&&(t.videoPTS=n)}return{nalBuf:i,pts:n}},decodeNalu1Frame:function(e,i){var n=Module._malloc(e.length);Module.HEAP8.set(e,n);var r=parseInt(1e3*i);Module.cwrap("decodeCodecContext","number",["number","number","number","number","number"])(t.vcodecerPtr,n,e.length,r,t.flushDecoder);return t.flushDecoder=0,Module._free(n),!1},cacheThread:function(){t.cacheLoop=window.setInterval((function(){if(t.cacheYuvBuf.getState()!=CACHE_APPEND_STATUS_CODE.FULL){var e=t.getNalu1Packet(!1);if(null!=e){var i=e.nalBuf,n=e.pts;t.decodeNalu1Frame(i,n,!0)}}}),10)},stopCacheThread:function(){null!==t.cacheLoop&&(window.clearInterval(t.cacheLoop),t.cacheLoop=null)},loadCache:function(){if(!(t.frameList.length<=3)){var e=t.isPlaying;if(t.cacheYuvBuf.yuvCache.length<=3){t.pause(),null!=t.onLoadCache&&t.onLoadCache(),t.isCaching=e?l.CACHE_WITH_PLAY_SIGN:l.CACHE_WITH_NOPLAY_SIGN;var i=t.frameList.length>30?30:t.frameList.length;null===t.cacheInterval&&(t.cacheInterval=window.setInterval((function(){t.cacheYuvBuf.yuvCache.length>=i&&(null!=t.onLoadCacheFinshed&&t.onLoadCacheFinshed(),window.clearInterval(t.cacheInterval),t.cacheInterval=null,t.isCaching===l.CACHE_WITH_PLAY_SIGN&&t.play(t.playParams),t.isCaching=l.CACHE_NO_LOADCACHE)}),40))}}},playFunc:function(){var e=!1;if(t.playParams.seekEvent||r.GetMsTime()-t.calcuteStartTime>=t.frameTime-t.preCostTime){e=!0;var i=!0;if(t.calcuteStartTime=r.GetMsTime(),t.config.audioNone)t.playFrameYUV(i,t.playParams.accurateSeek);else{t.fix_poc_err_skip>0&&(t.fix_poc_err_skip--,i=!1);var n=t.videoPTS-t.audio.getAlignVPTS();if(n>0)return void(t.playParams.seekEvent&&!t.config.audioNone&&t.audio.setVoice(0));if(i){if(!(i=-1*n<=1*t.frameTimeSec)){for(var a=parseInt(n/t.frameTimeSec),s=0;s=i&&(t.playFrameYUV(!0,t.playParams.accurateSeek),i+=1)}),1)}else t.videoPTS>=t.playParams.seekPos&&!t.isNewSeek||0===t.playParams.seekPos||0===t.playParams.seekPos?(t.frameTime=1e3/t.config.fps,t.frameTimeSec=t.frameTime/1e3,0==t.config.audioNone&&t.audio.play(),t.realVolume=t.config.audioNone?0:t.audio.voice,t.playParams.seekEvent&&(t.fix_poc_err_skip=10),t.loop=window.setInterval((function(){var e=r.GetMsTime();t.playFunc(),t.preCostTime=r.GetMsTime()-e}),1)):(t.loop=window.setInterval((function(){t.playFrameYUV(!1,t.playParams.accurateSeek),t.checkFinished(t.playParams.mode)?(window.clearInterval(t.loop),t.loop=null):t.videoPTS>=t.playParams.seekPos&&(window.clearInterval(t.loop),t.loop=null,t.play(t.playParams))}),1),t.isNewSeek=!1)},stop:function(){t.release(),Module.cwrap("initializeDecoder","number",["number"])(t.vcodecerPtr),t.stream=new Uint8Array},release:function(){return t.endAudio(),t.cacheLoop&&window.clearInterval(t.cacheLoop),t.cacheLoop=null,t.loop&&window.clearInterval(t.loop),t.loop=null,t.pause(),null!==t.videoCallback&&Module.removeFunction(t.videoCallback),t.videoCallback=null,Module.cwrap("release","number",["number"])(t.vcodecerPtr),t.stream=null,t.frameList.length=0,t.durationMs=-1,t.videoPTS=0,t.isPlaying=!1,!0},nextNalu:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;if(t.stream.length<=4)return!1;for(var i=-1,n=0;n=t.stream.length){if(-1==i)return!1;var r=t.stream.subarray(i);return t.stream=new Uint8Array,r}var a="0 0 1"==t.stream.slice(0,3).join(" "),s="0 0 0 1"==t.stream.slice(0,4).join(" ");if(a||s){if(-1==i)i=n;else{if(e<=1){var o=t.stream.subarray(i,n);return t.stream=t.stream.subarray(n),o}e-=1}n+=3}}return!1},decodeSendPacket:function(e){var i=Module._malloc(e.length);Module.HEAP8.set(e,i);var n=Module.cwrap("decodeSendPacket","number",["number","number","number"])(t.vcodecerPtr,i,e.length);return Module._free(i),n},decodeRecvFrame:function(){return Module.cwrap("decodeRecv","number",["number"])(t.vcodecerPtr)},playFrameYUV:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],i=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=t.cacheYuvBuf.vYuv();if(null==n)return t.noCacheFrame+=1,e&&!t.playParams.seekEvent&&t.loadCache(),!1;t.noCacheFrame=0;var r=n.pts;return t.videoPTS=r,(!e&&i||e)&&e&&t.drawImage(n.width,n.height,n.imageBufferY,n.imageBufferB,n.imageBufferR),e&&!t.playParams.seekEvent&&t.isPlaying&&t.loadCache(),!0},drawImage:function(e,i,n,r,a){if(t.canvas.width===e&&t.canvas.height==i||(t.canvas.width=e,t.canvas.height=i),t.showScreen&&null!=t.onRender)t.onRender(e,i,n,r,a);else{if(!t.isCheckDisplay)t.checkDisplaySize(e,i);var s=e*i,o=e/2*(i/2),l=new Uint8Array(s+2*o);l.set(n,0),l.set(r,s),l.set(a,s+o),u.renderFrame(t.yuv,n,r,a,e,i)}},debugYUV:function(e){t.debugYUVSwitch=!0,t.debugID=e},checkDisplaySize:function(e,i){var n=e/t.config.width>i/t.config.height,r=(t.config.width/e).toFixed(2),a=(t.config.height/i).toFixed(2),s=n?r:a,o=t.config.fixed,u=o?t.config.width:parseInt(e*s),l=o?t.config.height:parseInt(i*s);if(t.canvas.offsetWidth!=u||t.canvas.offsetHeight!=l){var d=parseInt((t.canvasBox.offsetHeight-l)/2),h=parseInt((t.canvasBox.offsetWidth-u)/2);t.canvas.style.marginTop=d+"px",t.canvas.style.marginLeft=h+"px",t.canvas.style.width=u+"px",t.canvas.style.height=l+"px"}return t.isCheckDisplay=!0,[u,l]},makeWasm:function(){if(null!=t.config.token){t.vcodecerPtr=Module.cwrap("registerPlayer","number",["string","string"])(t.config.token,d.PLAYER_VERSION),t.videoCallback=Module.addFunction((function(e,i,n,r,a,s,u,l,d){var h=Module.HEAPU8.subarray(e,e+r*l),c=Module.HEAPU8.subarray(i,i+a*l/2),f=Module.HEAPU8.subarray(n,n+s*l/2),p=new Uint8Array(h),m=new Uint8Array(c),g=new Uint8Array(f),_=1*d/1e3,y=new o.CacheYuvStruct(_,r,l,p,m,g);t.cacheYuvBuf.appendCacheByCacheYuv(y)})),Module.cwrap("setCodecType","number",["number","number","number"])(t.vcodecerPtr,t.config.videoCodec,t.videoCallback);Module.cwrap("initMissile","number",["number"])(t.vcodecerPtr);Module.cwrap("initializeDecoder","number",["number"])(t.vcodecerPtr)}},makeIt:function(){var e=document.querySelector("div#"+t.config.playerId),i=document.createElement("canvas");i.style.width=e.clientWidth+"px",i.style.height=e.clientHeight+"px",i.style.top="0px",i.style.left="0px",e.appendChild(i),t.canvasBox=e,t.canvas=i,t.yuv=u.setupCanvas(i,{preserveDrawingBuffer:!1}),0==t.config.audioNone&&(t.audio=a({sampleRate:t.config.sampleRate,appendType:t.config.appendHevcType})),t.isPlayLoadingFinish=1}};return t.makeWasm(),t.makeIt(),t.cacheThread(),t}},{"../consts":52,"../render-engine/webgl-420p":77,"../version":80,"./audio-core":53,"./av-common":55,"./cache":59,"./cacheYuv":60}],64:[function(e,t,i){"use strict";var n=e("./bufferFrame");t.exports=function(){var e={videoBuffer:[],audioBuffer:[],idrIdxBuffer:[],appendFrame:function(t,i){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],s=new n.BufferFrame(t,a,i,r),o=parseInt(t);return r?(e.videoBuffer.length-1>=o?e.videoBuffer[o].push(s):e.videoBuffer.push([s]),a&&!e.idrIdxBuffer.includes(t)&&e.idrIdxBuffer.push(t)):e.audioBuffer.length-1>=o&&null!=e.audioBuffer[o]&&null!=e.audioBuffer[o]?e.audioBuffer[o]&&e.audioBuffer[o].push(s):e.audioBuffer.push([s]),!0},appendFrameWithDts:function(t,i,r){var a=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],s=arguments.length>4&&void 0!==arguments[4]&&arguments[4],o=n.ConstructWithDts(t,i,s,r,a),u=parseInt(i);return a?(e.videoBuffer.length-1>=u?e.videoBuffer[u].push(o):e.videoBuffer.push([o]),s&&!e.idrIdxBuffer.includes(i)&&e.idrIdxBuffer.push(i)):e.audioBuffer.length-1>=u&&null!=e.audioBuffer[u]&&null!=e.audioBuffer[u]?e.audioBuffer[u]&&e.audioBuffer[u].push(o):e.audioBuffer.push([o]),!0},appendFrameByBufferFrame:function(t){var i=t.pts,n=parseInt(i);return t.video?(e.videoBuffer.length-1>=n?e.videoBuffer[n].push(t):e.videoBuffer.push([t]),isKey&&!e.idrIdxBuffer.includes(i)&&e.idrIdxBuffer.push(i)):e.audioBuffer.length-1>=n?e.audioBuffer[n].push(t):e.audioBuffer.push([t]),!0},cleanPipeline:function(){e.videoBuffer.length=0,e.audioBuffer.length=0},vFrame:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1;if(!(t<0||t>e.videoBuffer.length-1))return e.videoBuffer[t]},aFrame:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1;if(!(t<0||t>e.audioBuffer.length-1))return e.audioBuffer[t]},seekIDR:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1;if(e.idrIdxBuffer,e.videoBuffer,t<0)return null;if(e.idrIdxBuffer.includes(t))return t;for(var i=0;it||0===i&&e.idrIdxBuffer[i]>=t){for(var n=1;n>=0;n--){var r=i-n;if(r>=0)return e.idrIdxBuffer[r],e.idrIdxBuffer[r]}return e.idrIdxBuffer[i],j,e.idrIdxBuffer[i]}}};return e}},{"./bufferFrame":65}],65:[function(e,t,i){"use strict";function n(e,t){for(var i=0;i0&&i.extensionInfo.vHeight>0&&(i.size.width=i.extensionInfo.vWidth,i.size.height=i.extensionInfo.vHeight)),i.mediaInfo.duration,null!=i.onDemuxed&&i.onDemuxed(i.onReadyOBJ);for(var e=!1;void 0!==i.mpegTsObj&&null!==i.mpegTsObj;){var n=i.mpegTsObj.readPacket();if(n.size<=0)break;var r=n.dtime>0?n.dtime:n.ptime;if(!(r<0)){if(0==n.type){r<=i.vPreFramePTS&&(e=!0);var a=u.PACK_NALU(n.layer),o=1==n.keyframe,l=1==e?r+i.vStartTime:r,d=new s.BufferFrame(l,o,a,!0);i.bufObject.appendFrame(d.pts,d.data,!0,d.isKey),i.vPreFramePTS=l,null!=i.onSamples&&i.onSamples(i.onReadyOBJ,d)}else if(r<=i.aPreFramePTS&&(e=!0),"aac"==i.mediaInfo.aCodec)for(var h=n.data,c=0;c=3?(i._onTsReady(e),window.clearInterval(i.timerTsWasm),i.timerTsWasm=null):(i.mpegTsWasmRetryLoadTimes+=1,i.mpegTsObj.initDemuxer())}),3e3)}},{key:"_onTsReady",value:function(e){var t=this;t.hls.fetchM3u8(e),t.mpegTsWasmState=!0,t.timerFeed=window.setInterval((function(){if(t.tsList.length>0&&0==t.lockWait.state)try{var e=t.tsList.shift();if(null!=e){var i=e.streamURI,n=e.streamDur;t.lockWait.state=!0,t.lockWait.lockMember.dur=n,t.mpegTsObj.isLive=t.hls.isLive(),t.mpegTsObj.demuxURL(i)}else console.error("_onTsReady need wait ")}catch(e){console.error("onTsReady ERROR:",e),t.lockWait.state=!1}}),50)}},{key:"release",value:function(){this.hls&&this.hls.release(),this.hls=null,this.timerFeed&&window.clearInterval(this.timerFeed),this.timerFeed=null,this.timerTsWasm&&window.clearInterval(this.timerTsWasm),this.timerTsWasm=null}},{key:"bindReady",value:function(e){this.onReadyOBJ=e}},{key:"popBuffer",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;return t<0?null:1===e?t+1>this.bufObject.videoBuffer.length?null:this.bufObject.vFrame(t):2===e?t+1>this.bufObject.audioBuffer.length?null:this.bufObject.aFrame(t):void 0}},{key:"getVLen",value:function(){return this.bufObject.videoBuffer.length}},{key:"getALen",value:function(){return this.bufObject.audioBuffer.length}},{key:"getLastIdx",value:function(){return this.bufObject.videoBuffer.length-1}},{key:"getALastIdx",value:function(){return this.bufObject.audioBuffer.length-1}},{key:"getACodec",value:function(){return this.aCodec}},{key:"getVCodec",value:function(){return this.vCodec}},{key:"getDurationMs",value:function(){return this.durationMs}},{key:"getFPS",value:function(){return this.fps}},{key:"getSampleRate",value:function(){return this.sampleRate}},{key:"getSampleChannel",value:function(){return this.aChannel}},{key:"getSize",value:function(){return this.size}},{key:"seek",value:function(e){if(e>=0){var t=this.bufObject.seekIDR(e);this.seekPos=t}}}])&&n(t.prototype,i),d&&n(t,d),e}();i.M3u8=d},{"../consts":52,"../decoder/hevc-imp":62,"./buffer":64,"./bufferFrame":65,"./m3u8base":67,"./mpegts/mpeg.js":71}],67:[function(e,t,i){"use strict";function n(e,t){for(var i=0;i ",t),setTimeout((function(){i.fetchM3u8(e)}),500)}))}},{key:"_uriParse",value:function(e){this._preURI="";var t=e.split("//"),i=null,n=null;if(t.length<1)return!1;t.length>1?(i=t[0],n=t[1].split("/"),this._preURI=i+"//"):n=t[0].split("/");for(var r=0;rp&&(o=p);var m=n[l+=1],g=null;g=m.indexOf("http")>=0?m:this._preURI+m,this._slices.indexOf(g)<0&&(this._slices.push(g),this._slices[this._slices.length-1],null!=this.onTransportStream&&this.onTransportStream(g,p))}}}if(this._slices.length>s.hlsSliceLimit&&this._type==r.PLAYER_IN_TYPE_M3U8_LIVE&&(this._slices=this._slices.slice(-1*s.hlsSliceLimit)),null!=this.onFinished){var _={type:this._type,duration:-1};this.onFinished(_)}return o}},{key:"_readTag",value:function(e){var t=s.tagParse.exec(e);return null!==t?{key:t[1],value:t[3]}:null}}])&&n(t.prototype,i),o&&n(t,o),e}();i.M3u8Base=o},{"../consts":52}],68:[function(e,t,i){"use strict";var n=e("mp4box"),r=e("../decoder/hevc-header"),a=e("../decoder/hevc-imp"),s=e("./buffer"),o=e("../consts"),u={96e3:0,88200:1,64e3:2,48e3:3,44100:4,32e3:5,24e3:6,22050:7,16e3:8,12e3:9,11025:10,8e3:11,7350:12,Reserved:13,"frequency is written explictly":15},l=function(e){for(var t=[],i=0;i1&&void 0!==arguments[1]&&arguments[1],i=null;return t?((i=e)[0]=r.DEFINE_STARTCODE[0],i[1]=r.DEFINE_STARTCODE[1],i[2]=r.DEFINE_STARTCODE[2],i[3]=r.DEFINE_STARTCODE[3]):((i=new Uint8Array(r.DEFINE_STARTCODE.length+e.length)).set(r.DEFINE_STARTCODE,0),i.set(e,r.DEFINE_STARTCODE.length)),i},d.prototype.setAACAdts=function(e){var t=null,i=this.aacProfile,n=u[this.sampleRate],r=new Uint8Array(7),a=r.length+e.length;return r[0]=255,r[1]=241,r[2]=(i-1<<6)+(n<<2)+0,r[3]=128+(a>>11),r[4]=(2047&a)>>3,r[5]=31+((7&a)<<5),r[6]=252,(t=new Uint8Array(a)).set(r,0),t.set(e,r.length),t},d.prototype.demux=function(){var e=this;e.seekPos=-1,e.mp4boxfile=n.createFile(),e.movieInfo=null,e.videoCodec=null,e.durationMs=-1,e.fps=-1,e.sampleRate=-1,e.aacProfile=2,e.size={width:-1,height:-1},e.bufObject=s(),e.audioNone=!1,e.naluHeader={vps:null,sps:null,pps:null,sei:null},e.mp4boxfile.onError=function(e){},this.mp4boxfile.onReady=function(t){for(var i in e.movieInfo=t,t.tracks)"VideoHandler"!==t.tracks[i].name&&"video"!==t.tracks[i].type||(t.tracks[i].codec,t.tracks[i].codec.indexOf("hev")>=0||t.tracks[i].codec.indexOf("hvc")>=0?e.videoCodec=o.CODEC_H265:t.tracks[i].codec.indexOf("avc")>=0&&(e.videoCodec=o.CODEC_H264));var n=-1;if(n=t.videoTracks[0].samples_duration/t.videoTracks[0].timescale,e.durationMs=1e3*n,e.fps=t.videoTracks[0].nb_samples/n,e.seekDiffTime=1/e.fps,e.size.width=t.videoTracks[0].track_width,e.size.height=t.videoTracks[0].track_height,t.audioTracks.length>0){e.sampleRate=t.audioTracks[0].audio.sample_rate;var r=t.audioTracks[0].codec.split(".");e.aacProfile=r[r.length-1]}else e.audioNone=!0;null!=e.onMp4BoxReady&&e.onMp4BoxReady(e.videoCodec),e.videoCodec===o.CODEC_H265?(e.initializeAllSourceBuffers(),e.mp4boxfile.start()):(e.videoCodec,o.CODEC_H264)},e.mp4boxfile.onSamples=function(t,i,n){var s=window.setInterval((function(){for(var i=0;i3?e.naluHeader.sei=e.setStartCode(g[3][0].data,!1):e.naluHeader.sei=new Uint8Array,e.naluHeader}else e.videoCodec==o.CODEC_H264&&(e.naluHeader.vps=new Uint8Array,e.naluHeader.sps=e.setStartCode(f.SPS[0].nalu,!1),e.naluHeader.pps=e.setStartCode(f.PPS[0].nalu,!1),e.naluHeader.sei=new Uint8Array);d[4].toString(16),e.naluHeader.vps[4].toString(16),l(e.naluHeader.vps),l(d);var _=e.setStartCode(d.subarray(0,e.naluHeader.vps.length),!0);if(l(_),d[4]===e.naluHeader.vps[4]){var y=e.naluHeader.vps.length+4,v=e.naluHeader.vps.length+e.naluHeader.sps.length+4,b=e.naluHeader.vps.length+e.naluHeader.sps.length+e.naluHeader.pps.length+4;if(e.naluHeader.sei.length<=0&&e.naluHeader.sps.length>0&&d[y]===e.naluHeader.sps[4]&&e.naluHeader.pps.length>0&&d[v]===e.naluHeader.pps[4]&&78===d[b]){d[e.naluHeader.vps.length+4],e.naluHeader.sps[4],d[e.naluHeader.vps.length+e.naluHeader.sps.length+4],e.naluHeader.pps[4],d[e.naluHeader.vps.length+e.naluHeader.sps.length+e.naluHeader.pps.length+4];for(var T=0,S=0;S4&&d[4]===e.naluHeader.sei[4]){var E=d.subarray(0,10),w=new Uint8Array(e.naluHeader.vps.length+E.length);w.set(E,0),w.set(e.naluHeader.vps,E.length),w[3]=1,e.naluHeader.vps=null,e.naluHeader.vps=new Uint8Array(w),w=null,E=null,(d=d.subarray(10))[4],e.naluHeader.vps[4],e.naluHeader.vps}else if(0===e.naluHeader.sei.length&&78===d[4]){d=e.setStartCode(d,!0);for(var C=0,A=0;A1&&void 0!==arguments[1]?arguments[1]:0;return e.fileStart=t,this.mp4boxfile.appendBuffer(e)},d.prototype.finishBuffer=function(){this.mp4boxfile.flush()},d.prototype.play=function(){},d.prototype.getVideoCoder=function(){return this.videoCodec},d.prototype.getDurationMs=function(){return this.durationMs},d.prototype.getFPS=function(){return this.fps},d.prototype.getSampleRate=function(){return this.sampleRate},d.prototype.getSize=function(){return this.size},d.prototype.seek=function(e){if(e>=0){var t=this.bufObject.seekIDR(e);this.seekPos=t}},d.prototype.popBuffer=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;return t<0?null:1==e?this.bufObject.vFrame(t):2==e?this.bufObject.aFrame(t):void 0},d.prototype.addBuffer=function(e){var t=e.id;this.mp4boxfile.setExtractionOptions(t)},d.prototype.initializeAllSourceBuffers=function(){if(this.movieInfo){for(var e=this.movieInfo,t=0;t>5)}},{key:"sliceAACFrames",value:function(e,t){for(var i=[],n=e,r=0;r>4==15){var a=this._getPktLen(t[r+3],t[r+4],t[r+5]);if(a<=0)continue;var s=t.subarray(r,r+a),o=new Uint8Array(a);o.set(s,0),i.push({ptime:n,data:o}),n+=this.frameDurSec,r+=a}else r+=1;return i}}])&&n(t.prototype,i),r&&n(t,r),e}();i.AACDecoder=r},{}],71:[function(e,t,i){(function(t){"use strict";function n(e,t){for(var i=0;i ",e),n=null})).catch((function(i){console.error("demuxerTsInit ERROR fetch ERROR ==> ",i),t._releaseOffset(),t.onDemuxedFailed&&t.onDemuxedFailed(i,e)}))}},{key:"_releaseOffset",value:function(){void 0!==this.offsetDemux&&null!==this.offsetDemux&&(Module._free(this.offsetDemux),this.offsetDemux=null)}},{key:"_demuxCore",value:function(e){if(this._releaseOffset(),this._refreshDemuxer(),!(e.length<=0)){this.offsetDemux=Module._malloc(e.length),Module.HEAP8.set(e,this.offsetDemux);var t=Module.cwrap("demuxBox","number",["number","number","number"])(this.offsetDemux,e.length,this.isLive);Module._free(this.offsetDemux),this.offsetDemux=null,t>=0&&(this._setMediaInfo(),this._setExtensionInfo(),null!=this.onDemuxed&&this.onDemuxed())}}},{key:"_setMediaInfo",value:function(){var e=Module.cwrap("getMediaInfo","number",[])(),t=Module.HEAPU32[e/4],i=Module.HEAPU32[e/4+1],n=Module.HEAPF64[e/8+1],s=Module.HEAPF64[e/8+1+1],o=Module.HEAPF64[e/8+1+1+1],u=Module.HEAPF64[e/8+1+1+1+1],l=Module.HEAPU32[e/4+2+2+2+2+2];this.mediaAttr.vFps=n,this.mediaAttr.vGop=l,this.mediaAttr.vDuration=s,this.mediaAttr.aDuration=o,this.mediaAttr.duration=u;var d=Module.cwrap("getAudioCodecID","number",[])();d>=0?(this.mediaAttr.aCodec=a.CODEC_OFFSET_TABLE[d],this.mediaAttr.sampleRate=t>0?t:a.DEFAULT_SAMPLERATE,this.mediaAttr.sampleChannel=i>=0?i:a.DEFAULT_CHANNEL):(this.mediaAttr.sampleRate=0,this.mediaAttr.sampleChannel=0,this.mediaAttr.audioNone=!0);var h=Module.cwrap("getVideoCodecID","number",[])();h>=0&&(this.mediaAttr.vCodec=a.CODEC_OFFSET_TABLE[h]),null==this.aacDec?this.aacDec=new r.AACDecoder(this.mediaAttr):this.aacDec.updateConfig(this.mediaAttr)}},{key:"_setExtensionInfo",value:function(){var e=Module.cwrap("getExtensionInfo","number",[])(),t=Module.HEAPU32[e/4],i=Module.HEAPU32[e/4+1];this.extensionInfo.vWidth=t,this.extensionInfo.vHeight=i}},{key:"readMediaInfo",value:function(){return this.mediaAttr}},{key:"readExtensionInfo",value:function(){return this.extensionInfo}},{key:"readAudioNone",value:function(){return this.mediaAttr.audioNone}},{key:"_readLayer",value:function(){var e={vps:null,sps:null,pps:null,sei:null},t={vlc:null},i=Module.cwrap("getSPSLen","number",[])(),n=Module.cwrap("getSPS","number",[])();if(!(i<0)){e.sps=new Uint8Array(i),e.sps.set(Module.HEAPU8.subarray(n,n+i),0);var r=Module.cwrap("getPPSLen","number",[])(),s=Module.cwrap("getPPS","number",[])();e.pps=new Uint8Array(r),e.pps.set(Module.HEAPU8.subarray(s,s+r),0);var o=Module.cwrap("getSEILen","number",[])(),u=Module.cwrap("getSEI","number",[])();e.sei=new Uint8Array(o),e.sei.set(Module.HEAPU8.subarray(u,u+o),0);var l=Module.cwrap("getVLCLen","number",[])(),d=Module.cwrap("getVLC","number",[])();if(t.vlc=new Uint8Array(l),t.vlc.set(Module.HEAPU8.subarray(d,d+l),0),this.mediaAttr.vCodec==a.DEF_HEVC||this.mediaAttr.vCodec==a.DEF_H265){var h=Module.cwrap("getVPSLen","number",[])(),c=Module.cwrap("getVPS","number",[])();e.vps=new Uint8Array(h),e.vps.set(Module.HEAPU8.subarray(c,c+h),0)}else this.mediaAttr.vCodec==a.DEF_AVC||(this.mediaAttr.vCodec,a.DEF_H264);return{nalu:e,vlc:t}}}},{key:"isHEVC",value:function(){return this.mediaAttr.vCodec==a.DEF_HEVC||this.mediaAttr.vCodec==a.DEF_H265}},{key:"readPacket",value:function(){var e=Module.cwrap("getPacket","number",[])(),t=Module.HEAPU32[e/4],i=Module.HEAPU32[e/4+1],n=Module.HEAPF64[e/8+1],r=Module.HEAPF64[e/8+1+1],s=Module.HEAPU32[e/4+1+1+2+2],o=Module.HEAPU32[e/4+1+1+2+2+1],u=Module.HEAPU8.subarray(o,o+i),l=this._readLayer();return{type:t,size:i,ptime:n,dtime:r,keyframe:s,src:u,data:1==t&&this.mediaAttr.aCodec==a.DEF_AAC?this.aacDec.sliceAACFrames(n,u):u,layer:l}}},{key:"_refreshDemuxer",value:function(){this.releaseTsDemuxer(),this._initDemuxer()}},{key:"_initDemuxer",value:function(){Module.cwrap("initTsMissile","number",[])(),Module.cwrap("initializeDemuxer","number",[])()}},{key:"releaseTsDemuxer",value:function(){Module.cwrap("exitTsMissile","number",[])()}}])&&n(i.prototype,s),o&&n(i,o),e}();i.MPEG_JS=s}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./consts":69,"./decoder/aac":70}],72:[function(e,t,i){"use strict";function n(e,t){for(var i=0;i0&&e.extensionInfo.vHeight>0&&(e.size.width=e.extensionInfo.vWidth,e.size.height=e.extensionInfo.vHeight);for(var t=null;!((t=e.mpegTsObj.readPacket()).size<=0);){var i=t.dtime;if(0==t.type){var n=s.PACK_NALU(t.layer),r=1==t.keyframe;e.bufObject.appendFrame(i,n,!0,r)}else if("aac"==e.mediaInfo.aCodec)for(var a=t.data,o=0;o0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;return t<0?null:1==e?this.bufObject.vFrame(t):2==e?this.bufObject.aFrame(t):void 0}},{key:"isHEVC",value:function(){return this.mpegTsObj.isHEVC()}},{key:"getACodec",value:function(){return this.aCodec}},{key:"getVCodec",value:function(){return this.vCodec}},{key:"getAudioNone",value:function(){return this.mpegTsObj.mediaAttr.audioNone}},{key:"getDurationMs",value:function(){return this.durationMs}},{key:"getFPS",value:function(){return this.fps}},{key:"getSampleRate",value:function(){return this.sampleRate}},{key:"getSize",value:function(){return this.size}},{key:"seek",value:function(e){if(e>=0){var t=this.bufObject.seekIDR(e);this.seekPos=t}}}])&&n(t.prototype,i),o&&n(t,o),e}();i.MpegTs=o},{"../decoder/hevc-imp":62,"./buffer":64,"./mpegts/mpeg.js":71}],73:[function(e,t,i){(function(t){"use strict";function n(e,t){for(var i=0;i0&&void 0!==arguments[0]&&arguments[0];return void 0!==this.player&&null!==this.player&&(this.player.setScreen(e),!0)}},{key:"play",value:function(){if(void 0===this.player||null===this.player)return!1;if(this.playParam.videoCodec===m.CODEC_H265){var e={seekPos:this._getSeekTarget(),mode:this.playMode,accurateSeek:this.configFormat.accurateSeek,seekEvent:!1,realPlay:!0};this.player.play(e)}else this.player.play();return!0}},{key:"pause",value:function(){return void 0!==this.player&&null!==this.player&&(this.player.pause(),!0)}},{key:"isPlaying",value:function(){return void 0!==this.player&&null!==this.player&&this.player.isPlayingState()}},{key:"setVoice",value:function(e){return!(e<0||void 0===this.player||null===this.player||(this.volume=e,this.player&&this.player.setVoice(e),0))}},{key:"getVolume",value:function(){return this.volume}},{key:"mediaInfo",value:function(){var e={meta:this.playParam,videoType:this.playMode};return e.meta.isHEVC=0===this.playParam.videoCodec,e}},{key:"_seekHLS",value:function(e,t,i){if(void 0===this.player||null===this.player)return!1;setTimeout((function(){t.player.getCachePTS(),t.player.getCachePTS()>e?i():t._seekHLS(e,t,i)}),100)}},{key:"seek",value:function(e){if(void 0===this.player||null===this.player)return!1;var t=this;this.seekTarget=e,this.onSeekStart&&this.onSeekStart(e),this.timerFeed&&(window.clearInterval(this.timerFeed),this.timerFeed=null);var i=this._getSeekTarget();return this.playParam.videoCodec===m.CODEC_H264?(this.player.seek(e),this.onSeekFinish&&this.onSeekFinish()):this.configFormat.extInfo.core===m.PLAYER_CORE_TYPE_CNATIVE?(this.pause(),this._seekHLS(e,this,(function(){t.player.seek((function(){}),{seekTime:i,mode:t.playMode,accurateSeek:t.configFormat.accurateSeek})}))):this._seekHLS(e,this,(function(){t.player.seek((function(){t.configFormat.type==m.PLAYER_IN_TYPE_MP4?t.mp4Obj.seek(e):t.configFormat.type==m.PLAYER_IN_TYPE_TS||t.configFormat.type==m.PLAYER_IN_TYPE_MPEGTS?t.mpegTsObj.seek(e):t.configFormat.type==m.PLAYER_IN_TYPE_M3U8&&(t.hlsObj.onSamples=null,t.hlsObj.seek(e));var i,n=(i=0,i=t.configFormat.accurateSeek?e:t._getBoxBufSeekIDR(),parseInt(i)),r=parseInt(t._getBoxBufSeekIDR())||0;t._avFeedMP4Data(r,n)}),{seekTime:i,mode:t.playMode,accurateSeek:t.configFormat.accurateSeek})})),!0}},{key:"fullScreen",value:function(){if(this.autoScreenClose=!0,this.player.vCodecID===m.V_CODEC_NAME_HEVC){var e=document.querySelector("#"+this.configFormat.playerId),t=e.getElementsByTagName("canvas")[0];e.style.width=this.screenW+"px",e.style.height=this.screenH+"px";var i=this._checkScreenDisplaySize(this.screenW,this.screenH,this.playParam.size.width,this.playParam.size.height);t.style.marginTop=i[0]+"px",t.style.marginLeft=i[1]+"px",t.style.width=i[2]+"px",t.style.height=i[3]+"px",this._requestFullScreen(e)}else this._requestFullScreen(this.player.videoTag)}},{key:"closeFullScreen",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!1===e&&(this.autoScreenClose=!1,this._exitFull()),this.player.vCodecID===m.V_CODEC_NAME_HEVC){var t=document.querySelector("#"+this.configFormat.playerId),i=t.getElementsByTagName("canvas")[0];t.style.width=this.configFormat.playerW+"px",t.style.height=this.configFormat.playerH+"px";var n=this._checkScreenDisplaySize(this.configFormat.playerW,this.configFormat.playerH,this.playParam.size.width,this.playParam.size.height);i.style.marginTop=n[0]+"px",i.style.marginLeft=n[1]+"px",i.style.width=n[2]+"px",i.style.height=n[3]+"px"}}},{key:"_checkScreenDisplaySize",value:function(e,t,i,n){var r=i/e>n/t,a=(e/i).toFixed(2),s=(t/n).toFixed(2),o=r?a:s,u=this.fixed?e:parseInt(i*o),l=this.fixed?t:parseInt(n*o);return[parseInt((t-l)/2),parseInt((e-u)/2),u,l]}},{key:"_isFullScreen",value:function(){var e=document.fullscreenElement||document.mozFullscreenElement||document.webkitFullscreenElement;return document.fullscreenEnabled||document.mozFullscreenEnabled||document.webkitFullscreenEnabled,null!=e}},{key:"_requestFullScreen",value:function(e){e.requestFullscreen?e.requestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.msRequestFullscreen?e.msRequestFullscreen():e.webkitRequestFullscreen&&e.webkitRequestFullScreen()}},{key:"_exitFull",value:function(){document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.msExitFullscreen&&document.msExitFullscreen()}},{key:"_durationText",value:function(e){if(e<0)return"Play";var t=Math.round(e);return Math.floor(t/3600)+":"+Math.floor(t%3600/60)+":"+Math.floor(t%60)}},{key:"_getSeekTarget",value:function(){return this.configFormat.accurateSeek?this.seekTarget:this._getBoxBufSeekIDR()}},{key:"_getBoxBufSeekIDR",value:function(){return this.configFormat.type==m.PLAYER_IN_TYPE_MP4?this.mp4Obj.seekPos:this.configFormat.type==m.PLAYER_IN_TYPE_TS||this.configFormat.type==m.PLAYER_IN_TYPE_MPEGTS?this.mpegTsObj.seekPos:this.configFormat.type==m.PLAYER_IN_TYPE_M3U8?this.hlsObj.seekPos:void 0}},{key:"_playControl",value:function(){this.isPlaying()?this.pause():this.play()}},{key:"_avFeedMP4Data",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(void 0===this.player||null===this.player)return!1;var r=parseInt(this.playParam.durationMs/1e3);this.player.clearAllCache(),this.timerFeed=window.setInterval((function(){var a=null,s=null,o=!0,u=!0;if(e.configFormat.type==m.PLAYER_IN_TYPE_MP4?(a=e.mp4Obj.popBuffer(1,t),s=e.mp4Obj.audioNone?null:e.mp4Obj.popBuffer(2,i)):e.configFormat.type==m.PLAYER_IN_TYPE_TS||e.configFormat.type==m.PLAYER_IN_TYPE_MPEGTS?(a=e.mpegTsObj.popBuffer(1,t),s=e.mpegTsObj.getAudioNone()?null:e.mpegTsObj.popBuffer(2,i)):e.configFormat.type==m.PLAYER_IN_TYPE_M3U8&&(a=e.hlsObj.popBuffer(1,t),s=e.hlsObj.audioNone?null:e.hlsObj.popBuffer(2,i),t=e.hlsObj.getLastIdx()&&(o=!1),i=e.hlsObj.getALastIdx()&&(u=!1)),!0===o&&null!=a)for(var l=0;lr)return window.clearInterval(e.timerFeed),e.timerFeed=null,e.player.vCachePTS,e.player.aCachePTS,void(null!=n&&n())}),5)}},{key:"_makeMP4Player",value:function(){return this.mediaExtProtocol===m.URI_PROTOCOL_WEBSOCKET_DESC?(this._cWsFLVDecoderEntry(),0):(null!=this.configFormat.extInfo.core&&null!==this.configFormat.extInfo.core&&this.configFormat.extInfo.core===m.PLAYER_CORE_TYPE_CNATIVE?this._cDemuxDecoderEntry():this.configFormat.type==m.PLAYER_IN_TYPE_MP4?this.configFormat.extInfo.moovStartFlag?this._mp4EntryVodStream():this._mp4Entry():this.configFormat.type==m.PLAYER_IN_TYPE_TS||this.configFormat.type==m.PLAYER_IN_TYPE_MPEGTS?this._mpegTsEntry():this.configFormat.type==m.PLAYER_IN_TYPE_M3U8?this._m3u8Entry():this.configFormat.type===m.PLAYER_IN_TYPE_RAW_265&&this._raw265Entry(),0)}},{key:"_makeMP4PlayerViewEvent",value:function(e,t,i,n){var a=this,s=arguments.length>4&&void 0!==arguments[4]&&arguments[4],o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null,u=this;if(this.playParam.durationMs=e,this.playParam.fps=t,this.playParam.sampleRate=i,this.playParam.size=n,this.playParam.audioNone=s,this.playParam.videoCodec=o||m.CODEC_H265,this.playParam,(this.configFormat.type==m.PLAYER_IN_TYPE_M3U8&&this.hlsConf.hlsType==m.PLAYER_IN_TYPE_M3U8_LIVE||this.configFormat.type==m.PLAYER_IN_TYPE_RAW_265)&&(this.playMode=m.PLAYER_MODE_NOTIME_LIVE),u.configFormat.extInfo.autoCrop){var l=document.querySelector("#"+this.configFormat.playerId),d=n.width/n.height,h=this.configFormat.playerW/this.configFormat.playerH;d>h?l.style.height=this.configFormat.playerW/d+"px":d=m.FETCH_FIRST_MAX_TIMES)return;i=new AbortController,n=i.signal,e(s+1)}}),m.FETCH_HTTP_FLV_TIMEOUT_MS),fetch(t.videoURL,{signal:n}).then((function(e){if(a=!0,e.headers.has("Content-Length"))o=e.headers.get("Content-Length"),t.player&&t.player.setProbeSize(o*t.configFormat.extInfo.coreProbePart);else{if(t.mediaExtFormat===m.PLAYER_IN_TYPE_FLV)return i.abort(),t.player.release(),t.player=null,t._cLiveFLVDecoderEntry(r),!0;t.player&&t.player.setProbeSize(4096)}return e.headers.get("Content-Length"),t.configFormat.type,t.mediaExtFormat,function e(i){return i.read().then((function(n){if(!n.done){n.value.buffer;var r=new Uint8Array(n.value.buffer);return t.player&&t.player.pushBuffer(r)<0?(t.player.release(),t.player=null,t._mp4EntryVodStream(),!1):e(i)}t.player&&t.player.pushDone()}))}(e.body.getReader())})).catch((function(e){e.toString().includes("user aborted")||console.error("cdemuxdecoder error",e)}))}(0)}},{key:"_cLiveFLVDecoderEntry",value:function(e){var t=this,i=this;e.probeSize=this.configFormat.extInfo.probeSize,this.player=new o.CHttpLiveCore(e),e.probeSize,this.player.onProbeFinish=function(){i.playParam.fps=i.player.mediaInfo.fps,i.playParam.durationMs=-1,i.playMode=m.PLAYER_MODE_NOTIME_LIVE,i.playParam.sampleRate=i.player.mediaInfo.sampleRate,i.playParam.size={width:i.player.mediaInfo.width,height:i.player.mediaInfo.height},i.playParam.audioNone=i.player.mediaInfo.audioNone,i.player.mediaInfo,i.player.vCodecID===m.V_CODEC_NAME_HEVC?(i.playParam.audioIdx<0&&(i.playParam.audioNone=!0),i.playParam.videoCodec=m.CODEC_H265,i.onLoadFinish&&i.onLoadFinish()):(i.playParam.videoCodec=m.CODEC_H264,i.player.release(),i.player=null,i._flvJsPlayer())},this.player.onNetworkError=function(e){i.onNetworkError&&i.onNetworkError(e)},this.player.onReadyShowDone=function(){i.configFormat.extInfo.readyShow=!1,i.onReadyShowDone&&i.onReadyShowDone()},this.player.onLoadCache=function(){null!=t.onLoadCache&&t.onLoadCache()},this.player.onLoadCacheFinshed=function(){null!=t.onLoadCacheFinshed&&t.onLoadCacheFinshed()},this.player.start(this.videoURL)}},{key:"_cWsFLVDecoderEntry",value:function(){var e=this,t=this,i={width:this.configFormat.playerW,height:this.configFormat.playerH,playerId:this.configFormat.playerId,token:this.configFormat.token,readyShow:this.configFormat.extInfo.readyShow,checkProbe:this.configFormat.extInfo.checkProbe,ignoreAudio:this.configFormat.extInfo.ignoreAudio,playMode:this.playMode};i.probeSize=this.configFormat.extInfo.probeSize,this.player=new u.CWsLiveCore(i),i.probeSize,this.player.onProbeFinish=function(){t.playParam.fps=t.player.mediaInfo.fps,t.playParam.durationMs=-1,t.playMode=m.PLAYER_MODE_NOTIME_LIVE,t.playParam.sampleRate=t.player.mediaInfo.sampleRate,t.playParam.size={width:t.player.mediaInfo.width,height:t.player.mediaInfo.height},t.playParam.audioNone=t.player.mediaInfo.audioNone,t.player.mediaInfo,t.player.vCodecID===m.V_CODEC_NAME_HEVC?(t.playParam.audioIdx<0&&(t.playParam.audioNone=!0),t.playParam.videoCodec=m.CODEC_H265,t.onLoadFinish&&t.onLoadFinish()):(t.playParam.videoCodec=m.CODEC_H264,t.player.release(),t.player=null,t._flvJsPlayer())},this.player.onNetworkError=function(e){t.onNetworkError&&t.onNetworkError(e)},this.player.onReadyShowDone=function(){t.configFormat.extInfo.readyShow=!1,t.onReadyShowDone&&t.onReadyShowDone()},this.player.onLoadCache=function(){null!=e.onLoadCache&&e.onLoadCache()},this.player.onLoadCacheFinshed=function(){null!=e.onLoadCacheFinshed&&e.onLoadCacheFinshed()},this.player.start(this.videoURL)}},{key:"_mpegTsEntry",value:function(){var e=this,t=new AbortController,i=t.signal;this.timerFeed=null,this.mpegTsObj=new f.MpegTs,this.mpegTsObj.bindReady(e),this.mpegTsObj.onDemuxed=this._mpegTsEntryReady.bind(this),this.mpegTsObj.onReady=function(){var n=null;fetch(e.videoURL,{signal:i}).then((function(r){if(r.headers.has("Content-Length"))return function t(i){return i.read().then((function(r){if(!r.done){var a=r.value;if(null===n)n=a;else{var s=a,o=n.length+s.length,u=new Uint8Array(o);u.set(n),u.set(s,n.length),n=new Uint8Array(u),s=null,u=null}return t(i)}e.mpegTsObj.demux(n)}))}(r.body.getReader());t.abort(),i=null,t=null;var a={width:e.configFormat.playerW,height:e.configFormat.playerH,playerId:e.configFormat.playerId,token:e.configFormat.token,readyShow:e.configFormat.extInfo.readyShow,checkProbe:e.configFormat.extInfo.checkProbe,ignoreAudio:e.configFormat.extInfo.ignoreAudio,playMode:e.playMode};e._cLiveFLVDecoderEntry(a)})).catch((function(e){if(!e.toString().includes("user aborted")){var t=" mpegts request error:"+e;console.error(t)}}))},this.mpegTsObj.initMPEG()}},{key:"_mpegTsEntryReady",value:function(e){var t=e,i=(t.mpegTsObj.getVCodec(),t.mpegTsObj.getACodec()),n=t.mpegTsObj.getDurationMs(),r=t.mpegTsObj.getFPS(),a=t.mpegTsObj.getSampleRate(),s=t.mpegTsObj.getSize(),o=this.mpegTsObj.isHEVC();if(!o)return this.mpegTsObj.releaseTsDemuxer(),this.mpegTsObj=null,this.playParam.durationMs=n,this.playParam.fps=r,this.playParam.sampleRate=a,this.playParam.size=s,this.playParam.audioNone=""==i,this.playParam.videoCodec=o?0:1,this.playParam,void(this.onLoadFinish&&this.onLoadFinish());t._makeMP4PlayerViewEvent(n,r,a,s,""==i),parseInt(n/1e3),t._avFeedMP4Data(0,0)}},{key:"_m3u8Entry",value:function(){var e=this,t=this,i=!1,n=0;this.hlsObj=new p.M3u8,this.hlsObj.bindReady(t),this.hlsObj.onFinished=function(e,r){0==i&&(n=t.hlsObj.getDurationMs(),t.hlsConf.hlsType=r.type,i=!0)},this.hlsObj.onCacheProcess=function(t){e.playMode!==m.PLAYER_MODE_NOTIME_LIVE&&e.onCacheProcess&&e.onCacheProcess(t)},this.hlsObj.onDemuxed=function(e){if(null==t.player){var i=t.hlsObj.isHevcParam,r=(t.hlsObj.getVCodec(),t.hlsObj.getACodec()),a=t.hlsObj.getFPS(),s=t.hlsObj.getSampleRate(),o=t.hlsObj.getSize(),u=!1;if(u=t.hlsObj.getSampleChannel()<=0||""===r,!i)return t.hlsObj.release(),t.hlsObj.mpegTsObj&&t.hlsObj.mpegTsObj.releaseTsDemuxer(),t.hlsObj=null,t.playParam.durationMs=-1,t.playParam.fps=a,t.playParam.sampleRate=s,t.playParam.size=o,t.playParam.audioNone=""==r,t.playParam.videoCodec=i?0:1,t.playParam,void t._videoJsPlayer();t._makeMP4PlayerViewEvent(n,a,s,o,u)}},this.hlsObj.onSamples=this._hlsOnSamples.bind(this),this.hlsObj.demux(this.videoURL)}},{key:"_hlsOnSamples",value:function(e,t){1==t.video?this.player.appendHevcFrame(t):!1===this.hlsObj.audioNone&&this.player.appendAACFrame(t)}},{key:"_videoJsPlayer",value:function(){var e=this,t={width:this.configFormat.playerW,height:this.configFormat.playerH,playerId:this.configFormat.playerId,ignoreAudio:this.configFormat.extInfo.ignoreAudio};this.player=new l.NvVideojsCore(t),this.player.onMakeItReady=function(){e.onMakeItReady&&e.onMakeItReady()},this.player.onLoadFinish=function(){e.playParam.size=e.player.getSize(),e.player.duration===1/0||e.player.duration<0?(e.playParam.durationMs=-1,e.playMode=m.PLAYER_MODE_NOTIME_LIVE):(e.playParam.durationMs=1e3*e.player.duration,e.playMode=m.PLAYER_MODE_VOD),e.onLoadFinish&&e.onLoadFinish()},this.player.onReadyShowDone=function(){e.onReadyShowDone&&e.onReadyShowDone()},this.player.onPlayingFinish=function(){e.pause(),e.seek(0),null!=e.onPlayFinish&&e.onPlayFinish()},this.player.onPlayingTime=function(t){e._durationText(t),e._durationText(e.player.duration),null!=e.onPlayTime&&e.onPlayTime(t)},this.player.onSeekFinish=function(){e.onSeekFinish&&e.onSeekFinish()},this.player.makeIt(this.videoURL)}},{key:"_flvJsPlayer",value:function(){var e=this,t={width:this.configFormat.playerW,height:this.configFormat.playerH,playerId:this.configFormat.playerId,ignoreAudio:this.configFormat.extInfo.ignoreAudio};this.player=new d.NvFlvjsCore(t),this.player.onLoadFinish=function(){e.playParam.size=e.player.getSize(),!e.player.duration||NaN===e.player.duration||e.player.duration===1/0||e.player.duration<0?(e.playParam.durationMs=-1,e.playMode=m.PLAYER_MODE_NOTIME_LIVE):(e.playParam.durationMs=1e3*e.player.duration,e.playMode=m.PLAYER_MODE_VOD),e.onLoadFinish&&e.onLoadFinish()},this.player.onReadyShowDone=function(){e.onReadyShowDone&&e.onReadyShowDone()},this.player.onPlayingTime=function(t){e._durationText(t),e._durationText(e.player.duration),null!=e.onPlayTime&&e.onPlayTime(t)},this.player.onPlayingFinish=function(){e.pause(),e.seek(0),null!=e.onPlayFinish&&e.onPlayFinish()},this.player.makeIt(this.videoURL)}},{key:"_raw265Entry",value:function(){this._makeMP4PlayerViewEvent(-1,this.configFormat.extInfo.rawFps,-1,{width:this.configFormat.playerW,height:this.configFormat.playerH},!0,m.CODEC_H265),this.timerFeed&&(window.clearInterval(this.timerFeed),this.timerFeed=null)}},{key:"append265NaluFrame",value:function(e){var t={data:e,pts:this.rawModePts};this.player.appendHevcFrame(t),this.configFormat.extInfo.readyShow&&this.player.cacheYuvBuf.getState()!=CACHE_APPEND_STATUS_CODE.NULL&&(this.player.playFrameYUV(!0,!0),this.configFormat.extInfo.readyShow=!1,this.onReadyShowDone&&this.onReadyShowDone()),this.rawModePts+=1/this.configFormat.extInfo.rawFps}}])&&n(i.prototype,v),b&&n(i,b),e}();i.H265webjs=v,t.new265webjs=function(e,t){return new v(e,t)}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./consts":52,"./decoder/av-common":55,"./decoder/c-httplive-core":56,"./decoder/c-native-core":57,"./decoder/c-wslive-core":58,"./decoder/cache":59,"./decoder/player-core":63,"./demuxer/m3u8":66,"./demuxer/mp4":68,"./demuxer/mpegts/mpeg.js":71,"./demuxer/ts":72,"./native/mp4-player":74,"./native/nv-flvjs-core":75,"./native/nv-videojs-core":76,"./utils/static-mem":78,"./utils/ui/ui":79}],74:[function(e,t,i){"use strict";function n(e,t){for(var i=0;i>1,a>>1,i),e.v.fill(r>>1,a>>1,n),e.drawArrays(e.TRIANGLE_STRIP,0,4)},setupCanvas:function(e,t){var i=e.getContext("webgl")||e.getContext("experimental-webgl");if(!i)return i;var r=i.createProgram(),a=["attribute highp vec4 aVertexPosition;","attribute vec2 aTextureCoord;","varying highp vec2 vTextureCoord;","void main(void) {"," gl_Position = aVertexPosition;"," vTextureCoord = aTextureCoord;","}"].join("\n"),s=i.createShader(i.VERTEX_SHADER);i.shaderSource(s,a),i.compileShader(s);var o=["precision highp float;","varying lowp vec2 vTextureCoord;","uniform sampler2D YTexture;","uniform sampler2D UTexture;","uniform sampler2D VTexture;","const mat4 YUV2RGB = mat4","("," 1.1643828125, 0, 1.59602734375, -.87078515625,"," 1.1643828125, -.39176171875, -.81296875, .52959375,"," 1.1643828125, 2.017234375, 0, -1.081390625,"," 0, 0, 0, 1",");","void main(void) {"," gl_FragColor = vec4( texture2D(YTexture, vTextureCoord).x, texture2D(UTexture, vTextureCoord).x, texture2D(VTexture, vTextureCoord).x, 1) * YUV2RGB;","}"].join("\n"),u=i.createShader(i.FRAGMENT_SHADER);i.shaderSource(u,o),i.compileShader(u),i.attachShader(r,s),i.attachShader(r,u),i.linkProgram(r),i.useProgram(r),i.getProgramParameter(r,i.LINK_STATUS);var l=i.getAttribLocation(r,"aVertexPosition");i.enableVertexAttribArray(l);var d=i.getAttribLocation(r,"aTextureCoord");i.enableVertexAttribArray(d);var h=i.createBuffer();i.bindBuffer(i.ARRAY_BUFFER,h),i.bufferData(i.ARRAY_BUFFER,new Float32Array([1,1,0,-1,1,0,1,-1,0,-1,-1,0]),i.STATIC_DRAW),i.vertexAttribPointer(l,3,i.FLOAT,!1,0,0);var c=i.createBuffer();return i.bindBuffer(i.ARRAY_BUFFER,c),i.bufferData(i.ARRAY_BUFFER,new Float32Array([1,0,0,0,1,1,0,1]),i.STATIC_DRAW),i.vertexAttribPointer(d,2,i.FLOAT,!1,0,0),i.y=new n(i),i.u=new n(i),i.v=new n(i),i.y.bind(0,r,"YTexture"),i.u.bind(1,r,"UTexture"),i.v.bind(2,r,"VTexture"),i}}},{}],78:[function(e,t,i){(function(e){"use strict";e.STATIC_MEM_wasmDecoderState=-1,e.STATICE_MEM_playerCount=-1,e.STATICE_MEM_playerIndexPtr=0}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],79:[function(e,t,i){"use strict";function n(e,t){for(var i=0;i * Available under Apache License Version 2.0 * - */"use strict";var n=e("global/window"),r=e("global/document"),a=e("@babel/runtime/helpers/extends"),s=e("@babel/runtime/helpers/assertThisInitialized"),o=e("@babel/runtime/helpers/inheritsLoose"),u=e("safe-json-parse/tuple"),l=e("keycode"),d=e("@videojs/xhr"),h=e("videojs-vtt.js"),c=e("@babel/runtime/helpers/construct"),f=e("@babel/runtime/helpers/inherits"),p=e("@videojs/vhs-utils/cjs/resolve-url.js"),m=e("m3u8-parser"),g=e("@videojs/vhs-utils/cjs/codecs.js"),_=e("@videojs/vhs-utils/cjs/media-types.js"),y=e("mpd-parser"),v=e("mux.js/lib/tools/parse-sidx"),b=e("@videojs/vhs-utils/cjs/id3-helpers"),T=e("@videojs/vhs-utils/cjs/containers"),S=e("@videojs/vhs-utils/cjs/byte-helpers"),E=e("mux.js/lib/utils/clock");function w(e){return e&&"object"==_typeof(e)&&"default"in e?e:{"default":e};}for(var C,A=w(n),k=w(r),x=w(a),I=w(s),P=w(o),L=w(u),D=w(l),U=w(d),R=w(h),O=w(c),M=w(f),F=w(p),B=w(v),N={},j=function j(e,t){return N[e]=N[e]||[],t&&(N[e]=N[e].concat(t)),N[e];},V=function V(e,t){var i=j(e).indexOf(t);return!(i<=-1)&&(N[e]=N[e].slice(),N[e].splice(i,1),!0);},H={prefixed:!0},z=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror","fullscreen"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror","-webkit-full-screen"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror","-moz-full-screen"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError","-ms-fullscreen"]],G=z[0],W=0;W0?o:0);}if(A["default"].console){var u=A["default"].console[i];u||"debug"!==i||(u=A["default"].console.info||A["default"].console.log),u&&a&&s.test(i)&&u[Array.isArray(r)?"apply":"call"](A["default"].console,r);}};}(t,r),r.createLogger=function(i){return e(t+": "+i);},r.levels={all:"debug|log|warn|error",off:"",debug:"debug|log|warn|error",info:"log|warn|error",warn:"warn|error",error:"error",DEFAULT:n},r.level=function(e){if("string"==typeof e){if(!r.levels.hasOwnProperty(e))throw new Error('"'+e+'" in not a valid log level');n=e;}return n;},(r.history=function(){return q?[].concat(q):[];}).filter=function(e){return(q||[]).filter(function(t){return new RegExp(".*"+e+".*").test(t[0]);});},r.history.clear=function(){q&&(q.length=0);},r.history.disable=function(){null!==q&&(q.length=0,q=null);},r.history.enable=function(){null===q&&(q=[]);},r.error=function(){for(var e=arguments.length,t=new Array(e),r=0;r1?t-1:0),n=1;n=0)throw new Error("class has illegal whitespace characters");}function ke(){return k["default"]===A["default"].document;}function xe(e){return ee(e)&&1===e.nodeType;}function Ie(){try{return A["default"].parent!==A["default"].self;}catch(e){return!0;}}function Pe(e){return function(t,i){if(!Ce(t))return k["default"][e](null);Ce(i)&&(i=k["default"].querySelector(i));var n=xe(i)?i:k["default"];return n[e]&&n[e](t);};}function Le(e,t,i,n){void 0===e&&(e="div"),void 0===t&&(t={}),void 0===i&&(i={});var r=k["default"].createElement(e);return Object.getOwnPropertyNames(t).forEach(function(e){var i=t[e];-1!==e.indexOf("aria-")||"role"===e||"type"===e?(K.warn("Setting attributes in the second argument of createEl()\nhas been deprecated. Use the third argument instead.\ncreateEl(type, properties, attributes). Attempting to set "+e+" to "+i+"."),r.setAttribute(e,i)):"textContent"===e?De(r,i):r[e]===i&&"tabIndex"!==e||(r[e]=i);}),Object.getOwnPropertyNames(i).forEach(function(e){r.setAttribute(e,i[e]);}),n&&$e(r,n),r;}function De(e,t){return void 0===e.textContent?e.innerText=t:e.textContent=t,e;}function Ue(e,t){t.firstChild?t.insertBefore(e,t.firstChild):t.appendChild(e);}function Re(e,t){return Ae(t),e.classList?e.classList.contains(t):(i=t,new RegExp("(^|\\s)"+i+"($|\\s)")).test(e.className);var i;}function Oe(e,t){return e.classList?e.classList.add(t):Re(e,t)||(e.className=(e.className+" "+t).trim()),e;}function Me(e,t){return e?(e.classList?e.classList.remove(t):(Ae(t),e.className=e.className.split(/\s+/).filter(function(e){return e!==t;}).join(" ")),e):(K.warn("removeClass was called with an element that doesn't exist"),null);}function Fe(e,t,i){var n=Re(e,t);if("function"==typeof i&&(i=i(e,t)),"boolean"!=typeof i&&(i=!n),i!==n)return i?Oe(e,t):Me(e,t),e;}function Be(e,t){Object.getOwnPropertyNames(t).forEach(function(i){var n=t[i];null==n||!1===n?e.removeAttribute(i):e.setAttribute(i,!0===n?"":n);});}function Ne(e){var t={},i=",autoplay,controls,playsinline,loop,muted,default,defaultMuted,";if(e&&e.attributes&&e.attributes.length>0)for(var n=e.attributes,r=n.length-1;r>=0;r--){var a=n[r].name,s=n[r].value;"boolean"!=typeof e[a]&&-1===i.indexOf(","+a+",")||(s=null!==s),t[a]=s;}return t;}function je(e,t){return e.getAttribute(t);}function Ve(e,t,i){e.setAttribute(t,i);}function He(e,t){e.removeAttribute(t);}function ze(){k["default"].body.focus(),k["default"].onselectstart=function(){return!1;};}function Ge(){k["default"].onselectstart=function(){return!0;};}function We(e){if(e&&e.getBoundingClientRect&&e.parentNode){var t=e.getBoundingClientRect(),i={};return["bottom","height","left","right","top","width"].forEach(function(e){void 0!==t[e]&&(i[e]=t[e]);}),i.height||(i.height=parseFloat(ie(e,"height"))),i.width||(i.width=parseFloat(ie(e,"width"))),i;}}function Ye(e){if(!e||e&&!e.offsetParent)return{left:0,top:0,width:0,height:0};for(var t=e.offsetWidth,i=e.offsetHeight,n=0,r=0;e.offsetParent&&e!==k["default"][H.fullscreenElement];){n+=e.offsetLeft,r+=e.offsetTop,e=e.offsetParent;}return{left:n,top:r,width:t,height:i};}function qe(e,t){var i={x:0,y:0};if(Se)for(var n=e;n&&"html"!==n.nodeName.toLowerCase();){var r=ie(n,"transform");if(/^matrix/.test(r)){var a=r.slice(7,-1).split(/,\s/).map(Number);i.x+=a[4],i.y+=a[5];}else if(/^matrix3d/.test(r)){var s=r.slice(9,-1).split(/,\s/).map(Number);i.x+=s[12],i.y+=s[13];}n=n.parentNode;}var o={},u=Ye(t.target),l=Ye(e),d=l.width,h=l.height,c=t.offsetY-(l.top-u.top),f=t.offsetX-(l.left-u.left);return t.changedTouches&&(f=t.changedTouches[0].pageX-l.left,c=t.changedTouches[0].pageY+l.top,Se&&(f-=i.x,c-=i.y)),o.y=1-Math.max(0,Math.min(1,c/h)),o.x=Math.max(0,Math.min(1,f/d)),o;}function Ke(e){return ee(e)&&3===e.nodeType;}function Xe(e){for(;e.firstChild;){e.removeChild(e.firstChild);}return e;}function Qe(e){return"function"==typeof e&&(e=e()),(Array.isArray(e)?e:[e]).map(function(e){return"function"==typeof e&&(e=e()),xe(e)||Ke(e)?e:"string"==typeof e&&/\S/.test(e)?k["default"].createTextNode(e):void 0;}).filter(function(e){return e;});}function $e(e,t){return Qe(t).forEach(function(t){return e.appendChild(t);}),e;}function Je(e,t){return $e(Xe(e),t);}function Ze(e){return void 0===e.button&&void 0===e.buttons||0===e.button&&void 0===e.buttons||"mouseup"===e.type&&0===e.button&&0===e.buttons||0===e.button&&1===e.buttons;}var et,tt=Pe("querySelector"),it=Pe("querySelectorAll"),nt=Object.freeze({__proto__:null,isReal:ke,isEl:xe,isInFrame:Ie,createEl:Le,textContent:De,prependTo:Ue,hasClass:Re,addClass:Oe,removeClass:Me,toggleClass:Fe,setAttributes:Be,getAttributes:Ne,getAttribute:je,setAttribute:Ve,removeAttribute:He,blockTextSelection:ze,unblockTextSelection:Ge,getBoundingClientRect:We,findPosition:Ye,getPointerPosition:qe,isTextNode:Ke,emptyEl:Xe,normalizeContent:Qe,appendContent:$e,insertContent:Je,isSingleLeftClick:Ze,$:tt,$$:it}),rt=!1,at=function at(){if(!1!==et.options.autoSetup){var e=Array.prototype.slice.call(k["default"].getElementsByTagName("video")),t=Array.prototype.slice.call(k["default"].getElementsByTagName("audio")),i=Array.prototype.slice.call(k["default"].getElementsByTagName("video-js")),n=e.concat(t,i);if(n&&n.length>0)for(var r=0,a=n.length;r-1&&(r={passive:!0}),e.addEventListener(t,n.dispatcher,r);}else e.attachEvent&&e.attachEvent("on"+t,n.dispatcher);}function bt(e,t,i){if(pt.has(e)){var n=pt.get(e);if(n.handlers){if(Array.isArray(t))return gt(bt,e,t,i);var r=function r(e,t){n.handlers[t]=[],mt(e,t);};if(void 0!==t){var a=n.handlers[t];if(a)if(i){if(i.guid)for(var s=0;s=t&&(e.apply(void 0,arguments),i=n);};},xt=function xt(){};xt.prototype.allowedEvents_={},xt.prototype.on=function(e,t){var i=this.addEventListener;this.addEventListener=function(){},vt(this,e,t),this.addEventListener=i;},xt.prototype.addEventListener=xt.prototype.on,xt.prototype.off=function(e,t){bt(this,e,t);},xt.prototype.removeEventListener=xt.prototype.off,xt.prototype.one=function(e,t){var i=this.addEventListener;this.addEventListener=function(){},St(this,e,t),this.addEventListener=i;},xt.prototype.any=function(e,t){var i=this.addEventListener;this.addEventListener=function(){},Et(this,e,t),this.addEventListener=i;},xt.prototype.trigger=function(e){var t=e.type||e;"string"==typeof e&&(e={type:t}),e=_t(e),this.allowedEvents_[t]&&this["on"+t]&&this["on"+t](e),Tt(this,e);},xt.prototype.dispatchEvent=xt.prototype.trigger,xt.prototype.queueTrigger=function(e){var t=this;wt||(wt=new Map());var i=e.type||e,n=wt.get(this);n||(n=new Map(),wt.set(this,n));var r=n.get(i);n["delete"](i),A["default"].clearTimeout(r);var a=A["default"].setTimeout(function(){0===n.size&&(n=null,wt["delete"](t)),t.trigger(e);},0);n.set(i,a);};var It=function It(e){return"function"==typeof e.name?e.name():"string"==typeof e.name?e.name:e.name_?e.name_:e.constructor&&e.constructor.name?e.constructor.name:_typeof(e);},Pt=function Pt(e){return e instanceof xt||!!e.eventBusEl_&&["on","one","off","trigger"].every(function(t){return"function"==typeof e[t];});},Lt=function Lt(e){return"string"==typeof e&&/\S/.test(e)||Array.isArray(e)&&!!e.length;},Dt=function Dt(e,t,i){if(!e||!e.nodeName&&!Pt(e))throw new Error("Invalid target for "+It(t)+"#"+i+"; must be a DOM node or evented object.");},Ut=function Ut(e,t,i){if(!Lt(e))throw new Error("Invalid event type for "+It(t)+"#"+i+"; must be a non-empty string or array.");},Rt=function Rt(e,t,i){if("function"!=typeof e)throw new Error("Invalid listener for "+It(t)+"#"+i+"; must be a function.");},Ot=function Ot(e,t,i){var n,r,a,s=t.length<3||t[0]===e||t[0]===e.eventBusEl_;return s?(n=e.eventBusEl_,t.length>=3&&t.shift(),r=t[0],a=t[1]):(n=t[0],r=t[1],a=t[2]),Dt(n,e,i),Ut(r,e,i),Rt(a,e,i),{isTargetingSelf:s,target:n,type:r,listener:a=At(e,a)};},Mt=function Mt(e,t,i,n){Dt(e,e,t),e.nodeName?Ct[t](e,i,n):e[t](i,n);},Ft={on:function on(){for(var e=this,t=arguments.length,i=new Array(t),n=0;n=0;e--){this.children_[e].dispose&&this.children_[e].dispose();}this.children_=null,this.childIndex_=null,this.childNameIndex_=null,this.parentComponent_=null,this.el_&&(this.el_.parentNode&&this.el_.parentNode.removeChild(this.el_),this.el_=null),this.player_=null;}},t.isDisposed=function(){return Boolean(this.isDisposed_);},t.player=function(){return this.player_;},t.options=function(e){return e?(this.options_=zt(this.options_,e),this.options_):this.options_;},t.el=function(){return this.el_;},t.createEl=function(e,t,i){return Le(e,t,i);},t.localize=function(e,t,i){void 0===i&&(i=e);var n=this.player_.language&&this.player_.language(),r=this.player_.languages&&this.player_.languages(),a=r&&r[n],s=n&&n.split("-")[0],o=r&&r[s],u=i;return a&&a[e]?u=a[e]:o&&o[e]&&(u=o[e]),t&&(u=u.replace(/\{(\d+)\}/g,function(e,i){var n=t[i-1],r=n;return void 0===n&&(r=e),r;})),u;},t.handleLanguagechange=function(){},t.contentEl=function(){return this.contentEl_||this.el_;},t.id=function(){return this.id_;},t.name=function(){return this.name_;},t.children=function(){return this.children_;},t.getChildById=function(e){return this.childIndex_[e];},t.getChild=function(e){if(e)return this.childNameIndex_[e];},t.getDescendant=function(){for(var e=arguments.length,t=new Array(e),i=0;i=0;i--){if(this.children_[i]===e){t=!0,this.children_.splice(i,1);break;}}if(t){e.parentComponent_=null,this.childIndex_[e.id()]=null,this.childNameIndex_[Ht(e.name())]=null,this.childNameIndex_[Vt(e.name())]=null;var n=e.el();n&&n.parentNode===this.contentEl()&&this.contentEl().removeChild(e.el());}}},t.initChildren=function(){var t=this,i=this.options_.children;if(i){var n,r=this.options_,a=e.getComponent("Tech");(n=Array.isArray(i)?i:Object.keys(i)).concat(Object.keys(this.options_).filter(function(e){return!n.some(function(t){return"string"==typeof t?e===t:e===t.name;});})).map(function(e){var n,r;return"string"==typeof e?r=i[n=e]||t.options_[n]||{}:(n=e.name,r=e),{name:n,opts:r};}).filter(function(t){var i=e.getComponent(t.opts.componentClass||Ht(t.name));return i&&!a.isTech(i);}).forEach(function(e){var i=e.name,n=e.opts;if(void 0!==r[i]&&(n=r[i]),!1!==n){!0===n&&(n={}),n.playerOptions=t.options_.playerOptions;var a=t.addChild(i,n);a&&(t[i]=a);}});}},t.buildCSSClass=function(){return"";},t.ready=function(e,t){if(void 0===t&&(t=!1),e)return this.isReady_?void(t?e.call(this):this.setTimeout(e,1)):(this.readyQueue_=this.readyQueue_||[],void this.readyQueue_.push(e));},t.triggerReady=function(){this.isReady_=!0,this.setTimeout(function(){var e=this.readyQueue_;this.readyQueue_=[],e&&e.length>0&&e.forEach(function(e){e.call(this);},this),this.trigger("ready");},1);},t.$=function(e,t){return tt(e,t||this.contentEl());},t.$$=function(e,t){return it(e,t||this.contentEl());},t.hasClass=function(e){return Re(this.el_,e);},t.addClass=function(e){Oe(this.el_,e);},t.removeClass=function(e){Me(this.el_,e);},t.toggleClass=function(e,t){Fe(this.el_,e,t);},t.show=function(){this.removeClass("vjs-hidden");},t.hide=function(){this.addClass("vjs-hidden");},t.lockShowing=function(){this.addClass("vjs-lock-showing");},t.unlockShowing=function(){this.removeClass("vjs-lock-showing");},t.getAttribute=function(e){return je(this.el_,e);},t.setAttribute=function(e,t){Ve(this.el_,e,t);},t.removeAttribute=function(e){He(this.el_,e);},t.width=function(e,t){return this.dimension("width",e,t);},t.height=function(e,t){return this.dimension("height",e,t);},t.dimensions=function(e,t){this.width(e,!0),this.height(t);},t.dimension=function(e,t,i){if(void 0!==t)return null!==t&&t==t||(t=0),-1!==(""+t).indexOf("%")||-1!==(""+t).indexOf("px")?this.el_.style[e]=t:this.el_.style[e]="auto"===t?"":t+"px",void(i||this.trigger("componentresize"));if(!this.el_)return 0;var n=this.el_.style[e],r=n.indexOf("px");return-1!==r?parseInt(n.slice(0,r),10):parseInt(this.el_["offset"+Ht(e)],10);},t.currentDimension=function(e){var t=0;if("width"!==e&&"height"!==e)throw new Error("currentDimension only accepts width or height value");if(t=ie(this.el_,e),0===(t=parseFloat(t))||isNaN(t)){var i="offset"+Ht(e);t=this.el_[i];}return t;},t.currentDimensions=function(){return{width:this.currentDimension("width"),height:this.currentDimension("height")};},t.currentWidth=function(){return this.currentDimension("width");},t.currentHeight=function(){return this.currentDimension("height");},t.focus=function(){this.el_.focus();},t.blur=function(){this.el_.blur();},t.handleKeyDown=function(e){this.player_&&(e.stopPropagation(),this.player_.handleKeyDown(e));},t.handleKeyPress=function(e){this.handleKeyDown(e);},t.emitTapEvents=function(){var e,t=0,i=null;this.on("touchstart",function(n){1===n.touches.length&&(i={pageX:n.touches[0].pageX,pageY:n.touches[0].pageY},t=A["default"].performance.now(),e=!0);}),this.on("touchmove",function(t){if(t.touches.length>1)e=!1;else if(i){var n=t.touches[0].pageX-i.pageX,r=t.touches[0].pageY-i.pageY;Math.sqrt(n*n+r*r)>10&&(e=!1);}});var n=function n(){e=!1;};this.on("touchleave",n),this.on("touchcancel",n),this.on("touchend",function(n){(i=null,!0===e)&&A["default"].performance.now()-t<200&&(n.preventDefault(),this.trigger("tap"));});},t.enableTouchActivity=function(){if(this.player()&&this.player().reportUserActivity){var e,t=At(this.player(),this.player().reportUserActivity);this.on("touchstart",function(){t(),this.clearInterval(e),e=this.setInterval(t,250);});var i=function i(_i3){t(),this.clearInterval(e);};this.on("touchmove",t),this.on("touchend",i),this.on("touchcancel",i);}},t.setTimeout=function(e,t){var i,n=this;return e=At(this,e),this.clearTimersOnDispose_(),i=A["default"].setTimeout(function(){n.setTimeoutIds_.has(i)&&n.setTimeoutIds_["delete"](i),e();},t),this.setTimeoutIds_.add(i),i;},t.clearTimeout=function(e){return this.setTimeoutIds_.has(e)&&(this.setTimeoutIds_["delete"](e),A["default"].clearTimeout(e)),e;},t.setInterval=function(e,t){e=At(this,e),this.clearTimersOnDispose_();var i=A["default"].setInterval(e,t);return this.setIntervalIds_.add(i),i;},t.clearInterval=function(e){return this.setIntervalIds_.has(e)&&(this.setIntervalIds_["delete"](e),A["default"].clearInterval(e)),e;},t.requestAnimationFrame=function(e){var t,i=this;return this.supportsRaf_?(this.clearTimersOnDispose_(),e=At(this,e),t=A["default"].requestAnimationFrame(function(){i.rafIds_.has(t)&&i.rafIds_["delete"](t),e();}),this.rafIds_.add(t),t):this.setTimeout(e,1e3/60);},t.requestNamedAnimationFrame=function(e,t){var i=this;if(!this.namedRafs_.has(e)){this.clearTimersOnDispose_(),t=At(this,t);var n=this.requestAnimationFrame(function(){t(),i.namedRafs_.has(e)&&i.namedRafs_["delete"](e);});return this.namedRafs_.set(e,n),e;}},t.cancelNamedAnimationFrame=function(e){this.namedRafs_.has(e)&&(this.cancelAnimationFrame(this.namedRafs_.get(e)),this.namedRafs_["delete"](e));},t.cancelAnimationFrame=function(e){return this.supportsRaf_?(this.rafIds_.has(e)&&(this.rafIds_["delete"](e),A["default"].cancelAnimationFrame(e)),e):this.clearTimeout(e);},t.clearTimersOnDispose_=function(){var e=this;this.clearingTimersOnDispose_||(this.clearingTimersOnDispose_=!0,this.one("dispose",function(){[["namedRafs_","cancelNamedAnimationFrame"],["rafIds_","cancelAnimationFrame"],["setTimeoutIds_","clearTimeout"],["setIntervalIds_","clearInterval"]].forEach(function(t){var i=t[0],n=t[1];e[i].forEach(function(t,i){return e[n](i);});}),e.clearingTimersOnDispose_=!1;}));},e.registerComponent=function(t,i){if("string"!=typeof t||!t)throw new Error('Illegal component name, "'+t+'"; must be a non-empty string.');var n,r=e.getComponent("Tech"),a=r&&r.isTech(i),s=e===i||e.prototype.isPrototypeOf(i.prototype);if(a||!s)throw n=a?"techs must be registered using Tech.registerTech()":"must be a Component subclass",new Error('Illegal component, "'+t+'"; '+n+".");t=Ht(t),e.components_||(e.components_={});var o=e.getComponent("Player");if("Player"===t&&o&&o.players){var u=o.players,l=Object.keys(u);if(u&&l.length>0&&l.map(function(e){return u[e];}).every(Boolean))throw new Error("Can not register Player component after player has been created.");}return e.components_[t]=i,e.components_[Vt(t)]=i,i;},e.getComponent=function(t){if(t&&e.components_)return e.components_[t];},e;}();function Xt(e,t,i,n){return function(e,t,i){if("number"!=typeof t||t<0||t>i)throw new Error("Failed to execute '"+e+"' on 'TimeRanges': The index provided ("+t+") is non-numeric or out of bounds (0-"+i+").");}(e,n,i.length-1),i[n][t];}function Qt(e){var t;return t=void 0===e||0===e.length?{length:0,start:function start(){throw new Error("This TimeRanges object is empty");},end:function end(){throw new Error("This TimeRanges object is empty");}}:{length:e.length,start:Xt.bind(null,"start",0,e),end:Xt.bind(null,"end",1,e)},A["default"].Symbol&&A["default"].Symbol.iterator&&(t[A["default"].Symbol.iterator]=function(){return(e||[]).values();}),t;}function $t(e,t){return Array.isArray(e)?Qt(e):void 0===e||void 0===t?Qt():Qt([[e,t]]);}function Jt(e,t){var i,n,r=0;if(!t)return 0;e&&e.length||(e=$t(0,0));for(var a=0;at&&(n=t),r+=n-i;}return r/t;}function Zt(e){if(e instanceof Zt)return e;"number"==typeof e?this.code=e:"string"==typeof e?this.message=e:ee(e)&&("number"==typeof e.code&&(this.code=e.code),Z(this,e)),this.message||(this.message=Zt.defaultMessages[this.code]||"");}Kt.prototype.supportsRaf_="function"==typeof A["default"].requestAnimationFrame&&"function"==typeof A["default"].cancelAnimationFrame,Kt.registerComponent("Component",Kt),Zt.prototype.code=0,Zt.prototype.message="",Zt.prototype.status=null,Zt.errorTypes=["MEDIA_ERR_CUSTOM","MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED","MEDIA_ERR_ENCRYPTED"],Zt.defaultMessages={1:"You aborted the media playback",2:"A network error caused the media download to fail part-way.",3:"The media playback was aborted due to a corruption problem or because the media used features your browser did not support.",4:"The media could not be loaded, either because the server or network failed or because the format is not supported.",5:"The media is encrypted and we do not have the keys to decrypt it."};for(var ei=0;ei=0;n--){if(t[n].enabled){li(t,t[n]);break;}}return(i=e.call(this,t)||this).changing_=!1,i;}P["default"](t,e);var i=t.prototype;return i.addTrack=function(t){var i=this;t.enabled&&li(this,t),e.prototype.addTrack.call(this,t),t.addEventListener&&(t.enabledChange_=function(){i.changing_||(i.changing_=!0,li(i,t),i.changing_=!1,i.trigger("change"));},t.addEventListener("enabledchange",t.enabledChange_));},i.removeTrack=function(t){e.prototype.removeTrack.call(this,t),t.removeEventListener&&t.enabledChange_&&(t.removeEventListener("enabledchange",t.enabledChange_),t.enabledChange_=null);},t;}(oi),hi=function hi(e,t){for(var i=0;i=0;n--){if(t[n].selected){hi(t,t[n]);break;}}return(i=e.call(this,t)||this).changing_=!1,Object.defineProperty(I["default"](i),"selectedIndex",{get:function get(){for(var e=0;e0&&(A["default"].console&&A["default"].console.groupCollapsed&&A["default"].console.groupCollapsed("Text Track parsing errors for "+t.src),n.forEach(function(e){return K.error(e);}),A["default"].console&&A["default"].console.groupEnd&&A["default"].console.groupEnd()),i.flush();},ki=function ki(e,t){var i={uri:e},n=wi(e);n&&(i.cors=n);var r="use-credentials"===t.tech_.crossOrigin();r&&(i.withCredentials=r),U["default"](i,At(this,function(e,i,n){if(e)return K.error(e,i);t.loaded_=!0,"function"!=typeof A["default"].WebVTT?t.tech_&&t.tech_.any(["vttjsloaded","vttjserror"],function(e){if("vttjserror"!==e.type)return Ai(n,t);K.error("vttjs failed to load, stopping trying to process "+t.src);}):Ai(n,t);}));},xi=function(e){function t(t){var i;if(void 0===t&&(t={}),!t.tech)throw new Error("A tech was not provided.");var n=zt(t,{kind:yi[t.kind]||"subtitles",language:t.language||t.srclang||""}),r=vi[n.mode]||"disabled",a=n["default"];"metadata"!==n.kind&&"chapters"!==n.kind||(r="hidden"),(i=e.call(this,n)||this).tech_=n.tech,i.cues_=[],i.activeCues_=[],i.preload_=!1!==i.tech_.preloadTextTracks;var s=new mi(i.cues_),o=new mi(i.activeCues_),u=!1,l=At(I["default"](i),function(){this.tech_.isReady_&&!this.tech_.isDisposed()&&(this.activeCues=this.activeCues,u&&(this.trigger("cuechange"),u=!1));});return i.tech_.one("dispose",function(){i.tech_.off("timeupdate",l);}),"disabled"!==r&&i.tech_.on("timeupdate",l),Object.defineProperties(I["default"](i),{"default":{get:function get(){return a;},set:function set(){}},mode:{get:function get(){return r;},set:function set(e){vi[e]&&r!==e&&(r=e,this.preload_||"disabled"===r||0!==this.cues.length||ki(this.src,this),this.tech_.off("timeupdate",l),"disabled"!==r&&this.tech_.on("timeupdate",l),this.trigger("modechange"));}},cues:{get:function get(){return this.loaded_?s:null;},set:function set(){}},activeCues:{get:function get(){if(!this.loaded_)return null;if(0===this.cues.length)return o;for(var e=this.tech_.currentTime(),t=[],i=0,n=this.cues.length;i=e||r.startTime===r.endTime&&r.startTime<=e&&r.startTime+.5>=e)&&t.push(r);}if(u=!1,t.length!==this.activeCues_.length)u=!0;else for(var a=0;a0)return void this.trigger("vttjsloaded");var t=k["default"].createElement("script");t.src=this.options_["vtt.js"]||"https://vjs.zencdn.net/vttjs/0.14.1/vtt.min.js",t.onload=function(){e.trigger("vttjsloaded");},t.onerror=function(){e.trigger("vttjserror");},this.on("dispose",function(){t.onload=null,t.onerror=null;}),A["default"].WebVTT=!0,this.el().parentNode.appendChild(t);}else this.ready(this.addWebVttScript_);},i.emulateTextTracks=function(){var e=this,t=this.textTracks(),i=this.remoteTextTracks(),n=function n(e){return t.addTrack(e.track);},r=function r(e){return t.removeTrack(e.track);};i.on("addtrack",n),i.on("removetrack",r),this.addWebVttScript_();var a=function a(){return e.trigger("texttrackchange");},s=function s(){a();for(var e=0;e=0;r--){var a=e[r];a[t]&&a[t](n,i);}}(e,i,o,s),o;}var Vi={buffered:1,currentTime:1,duration:1,muted:1,played:1,paused:1,seekable:1,volume:1,ended:1},Hi={setCurrentTime:1,setMuted:1,setVolume:1},zi={play:1,pause:1};function Gi(e){return function(t,i){return t===Bi?Bi:i[e]?i[e](t):t;};}var Wi={opus:"video/ogg",ogv:"video/ogg",mp4:"video/mp4",mov:"video/mp4",m4v:"video/mp4",mkv:"video/x-matroska",m4a:"audio/mp4",mp3:"audio/mpeg",aac:"audio/aac",caf:"audio/x-caf",flac:"audio/flac",oga:"audio/ogg",wav:"audio/wav",m3u8:"application/x-mpegURL",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",png:"image/png",svg:"image/svg+xml",webp:"image/webp"},Yi=function Yi(e){void 0===e&&(e="");var t=Ei(e);return Wi[t.toLowerCase()]||"";};function qi(e){if(!e.type){var t=Yi(e.src);t&&(e.type=t);}return e;}var Ki=function(e){function t(t,i,n){var r,a=zt({createEl:!1},i);if(r=e.call(this,t,a,n)||this,i.playerOptions.sources&&0!==i.playerOptions.sources.length)t.src(i.playerOptions.sources);else for(var s=0,o=i.playerOptions.techOrder;s0;!this.player_.tech(!0)||(ge||fe)&&t||this.player_.tech(!0).focus(),this.player_.paused()?ii(this.player_.play()):this.player_.pause();}},t;}(Xi);Kt.registerComponent("PosterImage",Qi);var $i={monospace:"monospace",sansSerif:"sans-serif",serif:"serif",monospaceSansSerif:'"Andale Mono", "Lucida Console", monospace',monospaceSerif:'"Courier New", monospace',proportionalSansSerif:"sans-serif",proportionalSerif:"serif",casual:'"Comic Sans MS", Impact, fantasy',script:'"Monotype Corsiva", cursive',smallcaps:'"Andale Mono", "Lucida Console", monospace, sans-serif'};function Ji(e,t){var i;if(4===e.length)i=e[1]+e[1]+e[2]+e[2]+e[3]+e[3];else{if(7!==e.length)throw new Error("Invalid color code provided, "+e+"; must be formatted as e.g. #f0e or #f604e2.");i=e.slice(1);}return"rgba("+parseInt(i.slice(0,2),16)+","+parseInt(i.slice(2,4),16)+","+parseInt(i.slice(4,6),16)+","+t+")";}function Zi(e,t,i){try{e.style[t]=i;}catch(e){return;}}var en=function(e){function t(t,i,n){var r;r=e.call(this,t,i,n)||this;var a=function a(e){return r.updateDisplay(e);};return t.on("loadstart",function(e){return r.toggleDisplay(e);}),t.on("texttrackchange",a),t.on("loadedmetadata",function(e){return r.preselectTrack(e);}),t.ready(At(I["default"](r),function(){if(t.tech_&&t.tech_.featuresNativeTextTracks)this.hide();else{t.on("fullscreenchange",a),t.on("playerresize",a),A["default"].addEventListener("orientationchange",a),t.on("dispose",function(){return A["default"].removeEventListener("orientationchange",a);});for(var e=this.options_.playerOptions.tracks||[],i=0;i0;return ii(t),void(!this.player_.tech(!0)||(ge||fe)&&i||this.player_.tech(!0).focus());}var n=this.player_.getChild("controlBar"),r=n&&n.getChild("playToggle");if(r){var a=function a(){return r.focus();};ti(t)?t.then(a,function(){}):this.setTimeout(a,1);}else this.player_.tech(!0).focus();},i.handleKeyDown=function(t){this.mouseused_=!1,e.prototype.handleKeyDown.call(this,t);},i.handleMouseDown=function(e){this.mouseused_=!0;},t;}(nn);rn.prototype.controlText_="Play Video",Kt.registerComponent("BigPlayButton",rn);var an=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).controlText(i&&i.controlText||n.localize("Close")),n;}P["default"](t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-close-button "+e.prototype.buildCSSClass.call(this);},i.handleClick=function(e){this.trigger({type:"close",bubbles:!1});},i.handleKeyDown=function(t){D["default"].isEventKey(t,"Esc")?(t.preventDefault(),t.stopPropagation(),this.trigger("click")):e.prototype.handleKeyDown.call(this,t);},t;}(nn);Kt.registerComponent("CloseButton",an);var sn=function(e){function t(t,i){var n;return void 0===i&&(i={}),n=e.call(this,t,i)||this,i.replay=void 0===i.replay||i.replay,n.on(t,"play",function(e){return n.handlePlay(e);}),n.on(t,"pause",function(e){return n.handlePause(e);}),i.replay&&n.on(t,"ended",function(e){return n.handleEnded(e);}),n;}P["default"](t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-play-control "+e.prototype.buildCSSClass.call(this);},i.handleClick=function(e){this.player_.paused()?ii(this.player_.play()):this.player_.pause();},i.handleSeeked=function(e){this.removeClass("vjs-ended"),this.player_.paused()?this.handlePause(e):this.handlePlay(e);},i.handlePlay=function(e){this.removeClass("vjs-ended"),this.removeClass("vjs-paused"),this.addClass("vjs-playing"),this.controlText("Pause");},i.handlePause=function(e){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.controlText("Play");},i.handleEnded=function(e){var t=this;this.removeClass("vjs-playing"),this.addClass("vjs-ended"),this.controlText("Replay"),this.one(this.player_,"seeked",function(e){return t.handleSeeked(e);});},t;}(nn);sn.prototype.controlText_="Play",Kt.registerComponent("PlayToggle",sn);var on=function on(e,t){e=e<0?0:e;var i=Math.floor(e%60),n=Math.floor(e/60%60),r=Math.floor(e/3600),a=Math.floor(t/60%60),s=Math.floor(t/3600);return(isNaN(e)||e===1/0)&&(r=n=i="-"),(r=r>0||s>0?r+":":"")+(n=((r||a>=10)&&n<10?"0"+n:n)+":")+(i=i<10?"0"+i:i);},un=on;function ln(e,t){return void 0===t&&(t=e),un(e,t);}var dn=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).on(t,["timeupdate","ended"],function(e){return n.updateContent(e);}),n.updateTextNode_(),n;}P["default"](t,e);var i=t.prototype;return i.createEl=function(){var t=this.buildCSSClass(),i=e.prototype.createEl.call(this,"div",{className:t+" vjs-time-control vjs-control"}),n=Le("span",{className:"vjs-control-text",textContent:this.localize(this.labelText_)+" "},{role:"presentation"});return i.appendChild(n),this.contentEl_=Le("span",{className:t+"-display"},{"aria-live":"off",role:"presentation"}),i.appendChild(this.contentEl_),i;},i.dispose=function(){this.contentEl_=null,this.textNode_=null,e.prototype.dispose.call(this);},i.updateTextNode_=function(e){var t=this;void 0===e&&(e=0),e=ln(e),this.formattedTime_!==e&&(this.formattedTime_=e,this.requestNamedAnimationFrame("TimeDisplay#updateTextNode_",function(){if(t.contentEl_){var e=t.textNode_;e&&t.contentEl_.firstChild!==e&&(e=null,K.warn("TimeDisplay#updateTextnode_: Prevented replacement of text node element since it was no longer a child of this node. Appending a new node instead.")),t.textNode_=k["default"].createTextNode(t.formattedTime_),t.textNode_&&(e?t.contentEl_.replaceChild(t.textNode_,e):t.contentEl_.appendChild(t.textNode_));}}));},i.updateContent=function(e){},t;}(Kt);dn.prototype.labelText_="Time",dn.prototype.controlText_="Time",Kt.registerComponent("TimeDisplay",dn);var hn=function(e){function t(){return e.apply(this,arguments)||this;}P["default"](t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-current-time";},i.updateContent=function(e){var t;t=this.player_.ended()?this.player_.duration():this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime(),this.updateTextNode_(t);},t;}(dn);hn.prototype.labelText_="Current Time",hn.prototype.controlText_="Current Time",Kt.registerComponent("CurrentTimeDisplay",hn);var cn=function(e){function t(t,i){var n,r=function r(e){return n.updateContent(e);};return(n=e.call(this,t,i)||this).on(t,"durationchange",r),n.on(t,"loadstart",r),n.on(t,"loadedmetadata",r),n;}P["default"](t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-duration";},i.updateContent=function(e){var t=this.player_.duration();this.updateTextNode_(t);},t;}(dn);cn.prototype.labelText_="Duration",cn.prototype.controlText_="Duration",Kt.registerComponent("DurationDisplay",cn);var fn=function(e){function t(){return e.apply(this,arguments)||this;}return P["default"](t,e),t.prototype.createEl=function(){var t=e.prototype.createEl.call(this,"div",{className:"vjs-time-control vjs-time-divider"},{"aria-hidden":!0}),i=e.prototype.createEl.call(this,"div"),n=e.prototype.createEl.call(this,"span",{textContent:"/"});return i.appendChild(n),t.appendChild(i),t;},t;}(Kt);Kt.registerComponent("TimeDivider",fn);var pn=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).on(t,"durationchange",function(e){return n.updateContent(e);}),n;}P["default"](t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-remaining-time";},i.createEl=function(){var t=e.prototype.createEl.call(this);return t.insertBefore(Le("span",{},{"aria-hidden":!0},"-"),this.contentEl_),t;},i.updateContent=function(e){var t;"number"==typeof this.player_.duration()&&(t=this.player_.ended()?0:this.player_.remainingTimeDisplay?this.player_.remainingTimeDisplay():this.player_.remainingTime(),this.updateTextNode_(t));},t;}(dn);pn.prototype.labelText_="Remaining Time",pn.prototype.controlText_="Remaining Time",Kt.registerComponent("RemainingTimeDisplay",pn);var mn=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).updateShowing(),n.on(n.player(),"durationchange",function(e){return n.updateShowing(e);}),n;}P["default"](t,e);var i=t.prototype;return i.createEl=function(){var t=e.prototype.createEl.call(this,"div",{className:"vjs-live-control vjs-control"});return this.contentEl_=Le("div",{className:"vjs-live-display"},{"aria-live":"off"}),this.contentEl_.appendChild(Le("span",{className:"vjs-control-text",textContent:this.localize("Stream Type")+" "})),this.contentEl_.appendChild(k["default"].createTextNode(this.localize("LIVE"))),t.appendChild(this.contentEl_),t;},i.dispose=function(){this.contentEl_=null,e.prototype.dispose.call(this);},i.updateShowing=function(e){this.player().duration()===1/0?this.show():this.hide();},t;}(Kt);Kt.registerComponent("LiveDisplay",mn);var gn=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).updateLiveEdgeStatus(),n.player_.liveTracker&&(n.updateLiveEdgeStatusHandler_=function(e){return n.updateLiveEdgeStatus(e);},n.on(n.player_.liveTracker,"liveedgechange",n.updateLiveEdgeStatusHandler_)),n;}P["default"](t,e);var i=t.prototype;return i.createEl=function(){var t=e.prototype.createEl.call(this,"button",{className:"vjs-seek-to-live-control vjs-control"});return this.textEl_=Le("span",{className:"vjs-seek-to-live-text",textContent:this.localize("LIVE")},{"aria-hidden":"true"}),t.appendChild(this.textEl_),t;},i.updateLiveEdgeStatus=function(){!this.player_.liveTracker||this.player_.liveTracker.atLiveEdge()?(this.setAttribute("aria-disabled",!0),this.addClass("vjs-at-live-edge"),this.controlText("Seek to live, currently playing live")):(this.setAttribute("aria-disabled",!1),this.removeClass("vjs-at-live-edge"),this.controlText("Seek to live, currently behind live"));},i.handleClick=function(){this.player_.liveTracker.seekToLiveEdge();},i.dispose=function(){this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_),this.textEl_=null,e.prototype.dispose.call(this);},t;}(nn);gn.prototype.controlText_="Seek to live, currently playing live",Kt.registerComponent("SeekToLive",gn);var _n=function _n(e,t,i){return e=Number(e),Math.min(i,Math.max(t,isNaN(e)?t:e));},yn=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).handleMouseDown_=function(e){return n.handleMouseDown(e);},n.handleMouseUp_=function(e){return n.handleMouseUp(e);},n.handleKeyDown_=function(e){return n.handleKeyDown(e);},n.handleClick_=function(e){return n.handleClick(e);},n.handleMouseMove_=function(e){return n.handleMouseMove(e);},n.update_=function(e){return n.update(e);},n.bar=n.getChild(n.options_.barName),n.vertical(!!n.options_.vertical),n.enable(),n;}P["default"](t,e);var i=t.prototype;return i.enabled=function(){return this.enabled_;},i.enable=function(){this.enabled()||(this.on("mousedown",this.handleMouseDown_),this.on("touchstart",this.handleMouseDown_),this.on("keydown",this.handleKeyDown_),this.on("click",this.handleClick_),this.on(this.player_,"controlsvisible",this.update),this.playerEvent&&this.on(this.player_,this.playerEvent,this.update),this.removeClass("disabled"),this.setAttribute("tabindex",0),this.enabled_=!0);},i.disable=function(){if(this.enabled()){var e=this.bar.el_.ownerDocument;this.off("mousedown",this.handleMouseDown_),this.off("touchstart",this.handleMouseDown_),this.off("keydown",this.handleKeyDown_),this.off("click",this.handleClick_),this.off(this.player_,"controlsvisible",this.update_),this.off(e,"mousemove",this.handleMouseMove_),this.off(e,"mouseup",this.handleMouseUp_),this.off(e,"touchmove",this.handleMouseMove_),this.off(e,"touchend",this.handleMouseUp_),this.removeAttribute("tabindex"),this.addClass("disabled"),this.playerEvent&&this.off(this.player_,this.playerEvent,this.update),this.enabled_=!1;}},i.createEl=function(t,i,n){return void 0===i&&(i={}),void 0===n&&(n={}),i.className=i.className+" vjs-slider",i=Z({tabIndex:0},i),n=Z({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100,tabIndex:0},n),e.prototype.createEl.call(this,t,i,n);},i.handleMouseDown=function(e){var t=this.bar.el_.ownerDocument;"mousedown"===e.type&&e.preventDefault(),"touchstart"!==e.type||pe||e.preventDefault(),ze(),this.addClass("vjs-sliding"),this.trigger("slideractive"),this.on(t,"mousemove",this.handleMouseMove_),this.on(t,"mouseup",this.handleMouseUp_),this.on(t,"touchmove",this.handleMouseMove_),this.on(t,"touchend",this.handleMouseUp_),this.handleMouseMove(e);},i.handleMouseMove=function(e){},i.handleMouseUp=function(){var e=this.bar.el_.ownerDocument;Ge(),this.removeClass("vjs-sliding"),this.trigger("sliderinactive"),this.off(e,"mousemove",this.handleMouseMove_),this.off(e,"mouseup",this.handleMouseUp_),this.off(e,"touchmove",this.handleMouseMove_),this.off(e,"touchend",this.handleMouseUp_),this.update();},i.update=function(){var e=this;if(this.el_&&this.bar){var t=this.getProgress();return t===this.progress_||(this.progress_=t,this.requestNamedAnimationFrame("Slider#update",function(){var i=e.vertical()?"height":"width";e.bar.el().style[i]=(100*t).toFixed(2)+"%";})),t;}},i.getProgress=function(){return Number(_n(this.getPercent(),0,1).toFixed(4));},i.calculateDistance=function(e){var t=qe(this.el_,e);return this.vertical()?t.y:t.x;},i.handleKeyDown=function(t){D["default"].isEventKey(t,"Left")||D["default"].isEventKey(t,"Down")?(t.preventDefault(),t.stopPropagation(),this.stepBack()):D["default"].isEventKey(t,"Right")||D["default"].isEventKey(t,"Up")?(t.preventDefault(),t.stopPropagation(),this.stepForward()):e.prototype.handleKeyDown.call(this,t);},i.handleClick=function(e){e.stopPropagation(),e.preventDefault();},i.vertical=function(e){if(void 0===e)return this.vertical_||!1;this.vertical_=!!e,this.vertical_?this.addClass("vjs-slider-vertical"):this.addClass("vjs-slider-horizontal");},t;}(Kt);Kt.registerComponent("Slider",yn);var vn=function vn(e,t){return _n(e/t*100,0,100).toFixed(2)+"%";},bn=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).partEls_=[],n.on(t,"progress",function(e){return n.update(e);}),n;}P["default"](t,e);var i=t.prototype;return i.createEl=function(){var t=e.prototype.createEl.call(this,"div",{className:"vjs-load-progress"}),i=Le("span",{className:"vjs-control-text"}),n=Le("span",{textContent:this.localize("Loaded")}),r=k["default"].createTextNode(": ");return this.percentageEl_=Le("span",{className:"vjs-control-text-loaded-percentage",textContent:"0%"}),t.appendChild(i),i.appendChild(n),i.appendChild(r),i.appendChild(this.percentageEl_),t;},i.dispose=function(){this.partEls_=null,this.percentageEl_=null,e.prototype.dispose.call(this);},i.update=function(e){var t=this;this.requestNamedAnimationFrame("LoadProgressBar#update",function(){var e=t.player_.liveTracker,i=t.player_.buffered(),n=e&&e.isLive()?e.seekableEnd():t.player_.duration(),r=t.player_.bufferedEnd(),a=t.partEls_,s=vn(r,n);t.percent_!==s&&(t.el_.style.width=s,De(t.percentageEl_,s),t.percent_=s);for(var o=0;oi.length;h--){t.el_.removeChild(a[h-1]);}a.length=i.length;});},t;}(Kt);Kt.registerComponent("LoadProgressBar",bn);var Tn=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).update=kt(At(I["default"](n),n.update),30),n;}P["default"](t,e);var i=t.prototype;return i.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-time-tooltip"},{"aria-hidden":"true"});},i.update=function(e,t,i){var n=Ye(this.el_),r=We(this.player_.el()),a=e.width*t;if(r&&n){var s=e.left-r.left+a,o=e.width-a+(r.right-e.right),u=n.width/2;sn.width&&(u=n.width),u=Math.round(u),this.el_.style.right="-"+u+"px",this.write(i);}},i.write=function(e){De(this.el_,e);},i.updateTime=function(e,t,i,n){var r=this;this.requestNamedAnimationFrame("TimeTooltip#updateTime",function(){var a,s=r.player_.duration();if(r.player_.liveTracker&&r.player_.liveTracker.isLive()){var o=r.player_.liveTracker.liveWindow(),u=o-t*o;a=(u<1?"":"-")+ln(u,o);}else a=ln(i,s);r.update(e,t,a),n&&n();});},t;}(Kt);Kt.registerComponent("TimeTooltip",Tn);var Sn=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).update=kt(At(I["default"](n),n.update),30),n;}P["default"](t,e);var i=t.prototype;return i.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-play-progress vjs-slider-bar"},{"aria-hidden":"true"});},i.update=function(e,t){var i=this.getChild("timeTooltip");if(i){var n=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();i.updateTime(e,t,n);}},t;}(Kt);Sn.prototype.options_={children:[]},Se||le||Sn.prototype.options_.children.push("timeTooltip"),Kt.registerComponent("PlayProgressBar",Sn);var En=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).update=kt(At(I["default"](n),n.update),30),n;}P["default"](t,e);var i=t.prototype;return i.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-mouse-display"});},i.update=function(e,t){var i=this,n=t*this.player_.duration();this.getChild("timeTooltip").updateTime(e,t,n,function(){i.el_.style.left=e.width*t+"px";});},t;}(Kt);En.prototype.options_={children:["timeTooltip"]},Kt.registerComponent("MouseTimeDisplay",En);var wn=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).setEventHandlers_(),n;}P["default"](t,e);var i=t.prototype;return i.setEventHandlers_=function(){var e=this;this.update_=At(this,this.update),this.update=kt(this.update_,30),this.on(this.player_,["ended","durationchange","timeupdate"],this.update),this.player_.liveTracker&&this.on(this.player_.liveTracker,"liveedgechange",this.update),this.updateInterval=null,this.enableIntervalHandler_=function(t){return e.enableInterval_(t);},this.disableIntervalHandler_=function(t){return e.disableInterval_(t);},this.on(this.player_,["playing"],this.enableIntervalHandler_),this.on(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in k["default"]&&"visibilityState"in k["default"]&&this.on(k["default"],"visibilitychange",this.toggleVisibility_);},i.toggleVisibility_=function(e){"hidden"===k["default"].visibilityState?(this.cancelNamedAnimationFrame("SeekBar#update"),this.cancelNamedAnimationFrame("Slider#update"),this.disableInterval_(e)):(this.player_.ended()||this.player_.paused()||this.enableInterval_(),this.update());},i.enableInterval_=function(){this.updateInterval||(this.updateInterval=this.setInterval(this.update,30));},i.disableInterval_=function(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&e&&"ended"!==e.type||this.updateInterval&&(this.clearInterval(this.updateInterval),this.updateInterval=null);},i.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-progress-holder"},{"aria-label":this.localize("Progress Bar")});},i.update=function(t){var i=this;if("hidden"!==k["default"].visibilityState){var n=e.prototype.update.call(this);return this.requestNamedAnimationFrame("SeekBar#update",function(){var e=i.player_.ended()?i.player_.duration():i.getCurrentTime_(),t=i.player_.liveTracker,r=i.player_.duration();t&&t.isLive()&&(r=i.player_.liveTracker.liveCurrentTime()),i.percent_!==n&&(i.el_.setAttribute("aria-valuenow",(100*n).toFixed(2)),i.percent_=n),i.currentTime_===e&&i.duration_===r||(i.el_.setAttribute("aria-valuetext",i.localize("progress bar timing: currentTime={1} duration={2}",[ln(e,r),ln(r,r)],"{1} of {2}")),i.currentTime_=e,i.duration_=r),i.bar&&i.bar.update(We(i.el()),i.getProgress());}),n;}},i.userSeek_=function(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&this.player_.liveTracker.nextSeekedFromUser(),this.player_.currentTime(e);},i.getCurrentTime_=function(){return this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();},i.getPercent=function(){var e,t=this.getCurrentTime_(),i=this.player_.liveTracker;return i&&i.isLive()?(e=(t-i.seekableStart())/i.liveWindow(),i.atLiveEdge()&&(e=1)):e=t/this.player_.duration(),e;},i.handleMouseDown=function(t){Ze(t)&&(t.stopPropagation(),this.player_.scrubbing(!0),this.videoWasPlaying=!this.player_.paused(),this.player_.pause(),e.prototype.handleMouseDown.call(this,t));},i.handleMouseMove=function(e){if(Ze(e)){var t,i=this.calculateDistance(e),n=this.player_.liveTracker;if(n&&n.isLive()){if(i>=.99)return void n.seekToLiveEdge();var r=n.seekableStart(),a=n.liveCurrentTime();if((t=r+i*n.liveWindow())>=a&&(t=a),t<=r&&(t=r+.1),t===1/0)return;}else(t=i*this.player_.duration())===this.player_.duration()&&(t-=.1);this.userSeek_(t);}},i.enable=function(){e.prototype.enable.call(this);var t=this.getChild("mouseTimeDisplay");t&&t.show();},i.disable=function(){e.prototype.disable.call(this);var t=this.getChild("mouseTimeDisplay");t&&t.hide();},i.handleMouseUp=function(t){e.prototype.handleMouseUp.call(this,t),t&&t.stopPropagation(),this.player_.scrubbing(!1),this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:!0}),this.videoWasPlaying?ii(this.player_.play()):this.update_();},i.stepForward=function(){this.userSeek_(this.player_.currentTime()+5);},i.stepBack=function(){this.userSeek_(this.player_.currentTime()-5);},i.handleAction=function(e){this.player_.paused()?this.player_.play():this.player_.pause();},i.handleKeyDown=function(t){var i=this.player_.liveTracker;if(D["default"].isEventKey(t,"Space")||D["default"].isEventKey(t,"Enter"))t.preventDefault(),t.stopPropagation(),this.handleAction(t);else if(D["default"].isEventKey(t,"Home"))t.preventDefault(),t.stopPropagation(),this.userSeek_(0);else if(D["default"].isEventKey(t,"End"))t.preventDefault(),t.stopPropagation(),i&&i.isLive()?this.userSeek_(i.liveCurrentTime()):this.userSeek_(this.player_.duration());else if(/^[0-9]$/.test(D["default"](t))){t.preventDefault(),t.stopPropagation();var n=10*(D["default"].codes[D["default"](t)]-D["default"].codes[0])/100;i&&i.isLive()?this.userSeek_(i.seekableStart()+i.liveWindow()*n):this.userSeek_(this.player_.duration()*n);}else D["default"].isEventKey(t,"PgDn")?(t.preventDefault(),t.stopPropagation(),this.userSeek_(this.player_.currentTime()-60)):D["default"].isEventKey(t,"PgUp")?(t.preventDefault(),t.stopPropagation(),this.userSeek_(this.player_.currentTime()+60)):e.prototype.handleKeyDown.call(this,t);},i.dispose=function(){this.disableInterval_(),this.off(this.player_,["ended","durationchange","timeupdate"],this.update),this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.update),this.off(this.player_,["playing"],this.enableIntervalHandler_),this.off(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in k["default"]&&"visibilityState"in k["default"]&&this.off(k["default"],"visibilitychange",this.toggleVisibility_),e.prototype.dispose.call(this);},t;}(yn);wn.prototype.options_={children:["loadProgressBar","playProgressBar"],barName:"playProgressBar"},Se||le||wn.prototype.options_.children.splice(1,0,"mouseTimeDisplay"),Kt.registerComponent("SeekBar",wn);var Cn=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).handleMouseMove=kt(At(I["default"](n),n.handleMouseMove),30),n.throttledHandleMouseSeek=kt(At(I["default"](n),n.handleMouseSeek),30),n.handleMouseUpHandler_=function(e){return n.handleMouseUp(e);},n.handleMouseDownHandler_=function(e){return n.handleMouseDown(e);},n.enable(),n;}P["default"](t,e);var i=t.prototype;return i.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-progress-control vjs-control"});},i.handleMouseMove=function(e){var t=this.getChild("seekBar");if(t){var i=t.getChild("playProgressBar"),n=t.getChild("mouseTimeDisplay");if(i||n){var r=t.el(),a=Ye(r),s=qe(r,e).x;s=_n(s,0,1),n&&n.update(a,s),i&&i.update(a,t.getProgress());}}},i.handleMouseSeek=function(e){var t=this.getChild("seekBar");t&&t.handleMouseMove(e);},i.enabled=function(){return this.enabled_;},i.disable=function(){if(this.children().forEach(function(e){return e.disable&&e.disable();}),this.enabled()&&(this.off(["mousedown","touchstart"],this.handleMouseDownHandler_),this.off(this.el_,"mousemove",this.handleMouseMove),this.removeListenersAddedOnMousedownAndTouchstart(),this.addClass("disabled"),this.enabled_=!1,this.player_.scrubbing())){var e=this.getChild("seekBar");this.player_.scrubbing(!1),e.videoWasPlaying&&ii(this.player_.play());}},i.enable=function(){this.children().forEach(function(e){return e.enable&&e.enable();}),this.enabled()||(this.on(["mousedown","touchstart"],this.handleMouseDownHandler_),this.on(this.el_,"mousemove",this.handleMouseMove),this.removeClass("disabled"),this.enabled_=!0);},i.removeListenersAddedOnMousedownAndTouchstart=function(){var e=this.el_.ownerDocument;this.off(e,"mousemove",this.throttledHandleMouseSeek),this.off(e,"touchmove",this.throttledHandleMouseSeek),this.off(e,"mouseup",this.handleMouseUpHandler_),this.off(e,"touchend",this.handleMouseUpHandler_);},i.handleMouseDown=function(e){var t=this.el_.ownerDocument,i=this.getChild("seekBar");i&&i.handleMouseDown(e),this.on(t,"mousemove",this.throttledHandleMouseSeek),this.on(t,"touchmove",this.throttledHandleMouseSeek),this.on(t,"mouseup",this.handleMouseUpHandler_),this.on(t,"touchend",this.handleMouseUpHandler_);},i.handleMouseUp=function(e){var t=this.getChild("seekBar");t&&t.handleMouseUp(e),this.removeListenersAddedOnMousedownAndTouchstart();},t;}(Kt);Cn.prototype.options_={children:["seekBar"]},Kt.registerComponent("ProgressControl",Cn);var An=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).on(t,["enterpictureinpicture","leavepictureinpicture"],function(e){return n.handlePictureInPictureChange(e);}),n.on(t,["disablepictureinpicturechanged","loadedmetadata"],function(e){return n.handlePictureInPictureEnabledChange(e);}),n.disable(),n;}P["default"](t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-picture-in-picture-control "+e.prototype.buildCSSClass.call(this);},i.handlePictureInPictureEnabledChange=function(){k["default"].pictureInPictureEnabled&&!1===this.player_.disablePictureInPicture()?this.enable():this.disable();},i.handlePictureInPictureChange=function(e){this.player_.isInPictureInPicture()?this.controlText("Exit Picture-in-Picture"):this.controlText("Picture-in-Picture"),this.handlePictureInPictureEnabledChange();},i.handleClick=function(e){this.player_.isInPictureInPicture()?this.player_.exitPictureInPicture():this.player_.requestPictureInPicture();},t;}(nn);An.prototype.controlText_="Picture-in-Picture",Kt.registerComponent("PictureInPictureToggle",An);var kn=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).on(t,"fullscreenchange",function(e){return n.handleFullscreenChange(e);}),!1===k["default"][t.fsApi_.fullscreenEnabled]&&n.disable(),n;}P["default"](t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-fullscreen-control "+e.prototype.buildCSSClass.call(this);},i.handleFullscreenChange=function(e){this.player_.isFullscreen()?this.controlText("Non-Fullscreen"):this.controlText("Fullscreen");},i.handleClick=function(e){this.player_.isFullscreen()?this.player_.exitFullscreen():this.player_.requestFullscreen();},t;}(nn);kn.prototype.controlText_="Fullscreen",Kt.registerComponent("FullscreenToggle",kn);var xn=function(e){function t(){return e.apply(this,arguments)||this;}return P["default"](t,e),t.prototype.createEl=function(){var t=e.prototype.createEl.call(this,"div",{className:"vjs-volume-level"});return t.appendChild(e.prototype.createEl.call(this,"span",{className:"vjs-control-text"})),t;},t;}(Kt);Kt.registerComponent("VolumeLevel",xn);var In=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).update=kt(At(I["default"](n),n.update),30),n;}P["default"](t,e);var i=t.prototype;return i.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-volume-tooltip"},{"aria-hidden":"true"});},i.update=function(e,t,i,n){if(!i){var r=We(this.el_),a=We(this.player_.el()),s=e.width*t;if(!a||!r)return;var o=e.left-a.left+s,u=e.width-s+(a.right-e.right),l=r.width/2;or.width&&(l=r.width),this.el_.style.right="-"+l+"px";}this.write(n+"%");},i.write=function(e){De(this.el_,e);},i.updateVolume=function(e,t,i,n,r){var a=this;this.requestNamedAnimationFrame("VolumeLevelTooltip#updateVolume",function(){a.update(e,t,i,n.toFixed(0)),r&&r();});},t;}(Kt);Kt.registerComponent("VolumeLevelTooltip",In);var Pn=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).update=kt(At(I["default"](n),n.update),30),n;}P["default"](t,e);var i=t.prototype;return i.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-mouse-display"});},i.update=function(e,t,i){var n=this,r=100*t;this.getChild("volumeLevelTooltip").updateVolume(e,t,i,r,function(){i?n.el_.style.bottom=e.height*t+"px":n.el_.style.left=e.width*t+"px";});},t;}(Kt);Pn.prototype.options_={children:["volumeLevelTooltip"]},Kt.registerComponent("MouseVolumeLevelDisplay",Pn);var Ln=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).on("slideractive",function(e){return n.updateLastVolume_(e);}),n.on(t,"volumechange",function(e){return n.updateARIAAttributes(e);}),t.ready(function(){return n.updateARIAAttributes();}),n;}P["default"](t,e);var i=t.prototype;return i.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-volume-bar vjs-slider-bar"},{"aria-label":this.localize("Volume Level"),"aria-live":"polite"});},i.handleMouseDown=function(t){Ze(t)&&e.prototype.handleMouseDown.call(this,t);},i.handleMouseMove=function(e){var t=this.getChild("mouseVolumeLevelDisplay");if(t){var i=this.el(),n=We(i),r=this.vertical(),a=qe(i,e);a=r?a.y:a.x,a=_n(a,0,1),t.update(n,a,r);}Ze(e)&&(this.checkMuted(),this.player_.volume(this.calculateDistance(e)));},i.checkMuted=function(){this.player_.muted()&&this.player_.muted(!1);},i.getPercent=function(){return this.player_.muted()?0:this.player_.volume();},i.stepForward=function(){this.checkMuted(),this.player_.volume(this.player_.volume()+.1);},i.stepBack=function(){this.checkMuted(),this.player_.volume(this.player_.volume()-.1);},i.updateARIAAttributes=function(e){var t=this.player_.muted()?0:this.volumeAsPercentage_();this.el_.setAttribute("aria-valuenow",t),this.el_.setAttribute("aria-valuetext",t+"%");},i.volumeAsPercentage_=function(){return Math.round(100*this.player_.volume());},i.updateLastVolume_=function(){var e=this,t=this.player_.volume();this.one("sliderinactive",function(){0===e.player_.volume()&&e.player_.lastVolume_(t);});},t;}(yn);Ln.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"},Se||le||Ln.prototype.options_.children.splice(0,0,"mouseVolumeLevelDisplay"),Ln.prototype.playerEvent="volumechange",Kt.registerComponent("VolumeBar",Ln);var Dn=function(e){function t(t,i){var n;return void 0===i&&(i={}),i.vertical=i.vertical||!1,(void 0===i.volumeBar||te(i.volumeBar))&&(i.volumeBar=i.volumeBar||{},i.volumeBar.vertical=i.vertical),n=e.call(this,t,i)||this,function(e,t){t.tech_&&!t.tech_.featuresVolumeControl&&e.addClass("vjs-hidden"),e.on(t,"loadstart",function(){t.tech_.featuresVolumeControl?e.removeClass("vjs-hidden"):e.addClass("vjs-hidden");});}(I["default"](n),t),n.throttledHandleMouseMove=kt(At(I["default"](n),n.handleMouseMove),30),n.handleMouseUpHandler_=function(e){return n.handleMouseUp(e);},n.on("mousedown",function(e){return n.handleMouseDown(e);}),n.on("touchstart",function(e){return n.handleMouseDown(e);}),n.on("mousemove",function(e){return n.handleMouseMove(e);}),n.on(n.volumeBar,["focus","slideractive"],function(){n.volumeBar.addClass("vjs-slider-active"),n.addClass("vjs-slider-active"),n.trigger("slideractive");}),n.on(n.volumeBar,["blur","sliderinactive"],function(){n.volumeBar.removeClass("vjs-slider-active"),n.removeClass("vjs-slider-active"),n.trigger("sliderinactive");}),n;}P["default"](t,e);var i=t.prototype;return i.createEl=function(){var t="vjs-volume-horizontal";return this.options_.vertical&&(t="vjs-volume-vertical"),e.prototype.createEl.call(this,"div",{className:"vjs-volume-control vjs-control "+t});},i.handleMouseDown=function(e){var t=this.el_.ownerDocument;this.on(t,"mousemove",this.throttledHandleMouseMove),this.on(t,"touchmove",this.throttledHandleMouseMove),this.on(t,"mouseup",this.handleMouseUpHandler_),this.on(t,"touchend",this.handleMouseUpHandler_);},i.handleMouseUp=function(e){var t=this.el_.ownerDocument;this.off(t,"mousemove",this.throttledHandleMouseMove),this.off(t,"touchmove",this.throttledHandleMouseMove),this.off(t,"mouseup",this.handleMouseUpHandler_),this.off(t,"touchend",this.handleMouseUpHandler_);},i.handleMouseMove=function(e){this.volumeBar.handleMouseMove(e);},t;}(Kt);Dn.prototype.options_={children:["volumeBar"]},Kt.registerComponent("VolumeControl",Dn);var Un=function(e){function t(t,i){var n;return n=e.call(this,t,i)||this,function(e,t){t.tech_&&!t.tech_.featuresMuteControl&&e.addClass("vjs-hidden"),e.on(t,"loadstart",function(){t.tech_.featuresMuteControl?e.removeClass("vjs-hidden"):e.addClass("vjs-hidden");});}(I["default"](n),t),n.on(t,["loadstart","volumechange"],function(e){return n.update(e);}),n;}P["default"](t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-mute-control "+e.prototype.buildCSSClass.call(this);},i.handleClick=function(e){var t=this.player_.volume(),i=this.player_.lastVolume_();if(0===t){var n=i<.1?.1:i;this.player_.volume(n),this.player_.muted(!1);}else this.player_.muted(!this.player_.muted());},i.update=function(e){this.updateIcon_(),this.updateControlText_();},i.updateIcon_=function(){var e=this.player_.volume(),t=3;Se&&this.player_.tech_&&this.player_.tech_.el_&&this.player_.muted(this.player_.tech_.el_.muted),0===e||this.player_.muted()?t=0:e<.33?t=1:e<.67&&(t=2);for(var i=0;i<4;i++){Me(this.el_,"vjs-vol-"+i);}Oe(this.el_,"vjs-vol-"+t);},i.updateControlText_=function(){var e=this.player_.muted()||0===this.player_.volume()?"Unmute":"Mute";this.controlText()!==e&&this.controlText(e);},t;}(nn);Un.prototype.controlText_="Mute",Kt.registerComponent("MuteToggle",Un);var Rn=function(e){function t(t,i){var n;return void 0===i&&(i={}),void 0!==i.inline?i.inline=i.inline:i.inline=!0,(void 0===i.volumeControl||te(i.volumeControl))&&(i.volumeControl=i.volumeControl||{},i.volumeControl.vertical=!i.inline),(n=e.call(this,t,i)||this).handleKeyPressHandler_=function(e){return n.handleKeyPress(e);},n.on(t,["loadstart"],function(e){return n.volumePanelState_(e);}),n.on(n.muteToggle,"keyup",function(e){return n.handleKeyPress(e);}),n.on(n.volumeControl,"keyup",function(e){return n.handleVolumeControlKeyUp(e);}),n.on("keydown",function(e){return n.handleKeyPress(e);}),n.on("mouseover",function(e){return n.handleMouseOver(e);}),n.on("mouseout",function(e){return n.handleMouseOut(e);}),n.on(n.volumeControl,["slideractive"],n.sliderActive_),n.on(n.volumeControl,["sliderinactive"],n.sliderInactive_),n;}P["default"](t,e);var i=t.prototype;return i.sliderActive_=function(){this.addClass("vjs-slider-active");},i.sliderInactive_=function(){this.removeClass("vjs-slider-active");},i.volumePanelState_=function(){this.volumeControl.hasClass("vjs-hidden")&&this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-hidden"),this.volumeControl.hasClass("vjs-hidden")&&!this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-mute-toggle-only");},i.createEl=function(){var t="vjs-volume-panel-horizontal";return this.options_.inline||(t="vjs-volume-panel-vertical"),e.prototype.createEl.call(this,"div",{className:"vjs-volume-panel vjs-control "+t});},i.dispose=function(){this.handleMouseOut(),e.prototype.dispose.call(this);},i.handleVolumeControlKeyUp=function(e){D["default"].isEventKey(e,"Esc")&&this.muteToggle.focus();},i.handleMouseOver=function(e){this.addClass("vjs-hover"),vt(k["default"],"keyup",this.handleKeyPressHandler_);},i.handleMouseOut=function(e){this.removeClass("vjs-hover"),bt(k["default"],"keyup",this.handleKeyPressHandler_);},i.handleKeyPress=function(e){D["default"].isEventKey(e,"Esc")&&this.handleMouseOut();},t;}(Kt);Rn.prototype.options_={children:["muteToggle","volumeControl"]},Kt.registerComponent("VolumePanel",Rn);var On=function(e){function t(t,i){var n;return n=e.call(this,t,i)||this,i&&(n.menuButton_=i.menuButton),n.focusedChild_=-1,n.on("keydown",function(e){return n.handleKeyDown(e);}),n.boundHandleBlur_=function(e){return n.handleBlur(e);},n.boundHandleTapClick_=function(e){return n.handleTapClick(e);},n;}P["default"](t,e);var i=t.prototype;return i.addEventListenerForItem=function(e){e instanceof Kt&&(this.on(e,"blur",this.boundHandleBlur_),this.on(e,["tap","click"],this.boundHandleTapClick_));},i.removeEventListenerForItem=function(e){e instanceof Kt&&(this.off(e,"blur",this.boundHandleBlur_),this.off(e,["tap","click"],this.boundHandleTapClick_));},i.removeChild=function(t){"string"==typeof t&&(t=this.getChild(t)),this.removeEventListenerForItem(t),e.prototype.removeChild.call(this,t);},i.addItem=function(e){var t=this.addChild(e);t&&this.addEventListenerForItem(t);},i.createEl=function(){var t=this.options_.contentElType||"ul";this.contentEl_=Le(t,{className:"vjs-menu-content"}),this.contentEl_.setAttribute("role","menu");var i=e.prototype.createEl.call(this,"div",{append:this.contentEl_,className:"vjs-menu"});return i.appendChild(this.contentEl_),vt(i,"click",function(e){e.preventDefault(),e.stopImmediatePropagation();}),i;},i.dispose=function(){this.contentEl_=null,this.boundHandleBlur_=null,this.boundHandleTapClick_=null,e.prototype.dispose.call(this);},i.handleBlur=function(e){var t=e.relatedTarget||k["default"].activeElement;if(!this.children().some(function(e){return e.el()===t;})){var i=this.menuButton_;i&&i.buttonPressed_&&t!==i.el().firstChild&&i.unpressButton();}},i.handleTapClick=function(e){if(this.menuButton_){this.menuButton_.unpressButton();var t=this.children();if(!Array.isArray(t))return;var i=t.filter(function(t){return t.el()===e.target;})[0];if(!i)return;"CaptionSettingsMenuItem"!==i.name()&&this.menuButton_.focus();}},i.handleKeyDown=function(e){D["default"].isEventKey(e,"Left")||D["default"].isEventKey(e,"Down")?(e.preventDefault(),e.stopPropagation(),this.stepForward()):(D["default"].isEventKey(e,"Right")||D["default"].isEventKey(e,"Up"))&&(e.preventDefault(),e.stopPropagation(),this.stepBack());},i.stepForward=function(){var e=0;void 0!==this.focusedChild_&&(e=this.focusedChild_+1),this.focus(e);},i.stepBack=function(){var e=0;void 0!==this.focusedChild_&&(e=this.focusedChild_-1),this.focus(e);},i.focus=function(e){void 0===e&&(e=0);var t=this.children().slice();t.length&&t[0].hasClass("vjs-menu-title")&&t.shift(),t.length>0&&(e<0?e=0:e>=t.length&&(e=t.length-1),this.focusedChild_=e,t[e].el_.focus());},t;}(Kt);Kt.registerComponent("Menu",On);var Mn=function(e){function t(t,i){var n;void 0===i&&(i={}),(n=e.call(this,t,i)||this).menuButton_=new nn(t,i),n.menuButton_.controlText(n.controlText_),n.menuButton_.el_.setAttribute("aria-haspopup","true");var r=nn.prototype.buildCSSClass();n.menuButton_.el_.className=n.buildCSSClass()+" "+r,n.menuButton_.removeClass("vjs-control"),n.addChild(n.menuButton_),n.update(),n.enabled_=!0;var a=function a(e){return n.handleClick(e);};return n.handleMenuKeyUp_=function(e){return n.handleMenuKeyUp(e);},n.on(n.menuButton_,"tap",a),n.on(n.menuButton_,"click",a),n.on(n.menuButton_,"keydown",function(e){return n.handleKeyDown(e);}),n.on(n.menuButton_,"mouseenter",function(){n.addClass("vjs-hover"),n.menu.show(),vt(k["default"],"keyup",n.handleMenuKeyUp_);}),n.on("mouseleave",function(e){return n.handleMouseLeave(e);}),n.on("keydown",function(e){return n.handleSubmenuKeyDown(e);}),n;}P["default"](t,e);var i=t.prototype;return i.update=function(){var e=this.createMenu();this.menu&&(this.menu.dispose(),this.removeChild(this.menu)),this.menu=e,this.addChild(e),this.buttonPressed_=!1,this.menuButton_.el_.setAttribute("aria-expanded","false"),this.items&&this.items.length<=this.hideThreshold_?this.hide():this.show();},i.createMenu=function(){var e=new On(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title){var t=Le("li",{className:"vjs-menu-title",textContent:Ht(this.options_.title),tabIndex:-1}),i=new Kt(this.player_,{el:t});e.addItem(i);}if(this.items=this.createItems(),this.items)for(var n=0;n-1&&"showing"===a.mode){i=!1;break;}}i!==this.isSelected_&&this.selected(i);},i.handleSelectedLanguageChange=function(e){for(var t=this.player().textTracks(),i=!0,n=0,r=t.length;n-1&&"showing"===a.mode){i=!1;break;}}i&&(this.player_.cache_.selectedLanguage={enabled:!1});},t;}(jn);Kt.registerComponent("OffTextTrackMenuItem",Vn);var Hn=function(e){function t(t,i){return void 0===i&&(i={}),i.tracks=t.textTracks(),e.call(this,t,i)||this;}return P["default"](t,e),t.prototype.createItems=function(e,t){var i;void 0===e&&(e=[]),void 0===t&&(t=jn),this.label_&&(i=this.label_+" off"),e.push(new Vn(this.player_,{kinds:this.kinds_,kind:this.kind_,label:i})),this.hideThreshold_+=1;var n=this.player_.textTracks();Array.isArray(this.kinds_)||(this.kinds_=[this.kind_]);for(var r=0;r-1){var s=new t(this.player_,{track:a,kinds:this.kinds_,kind:this.kind_,selectable:!0,multiSelectable:!1});s.addClass("vjs-"+a.kind+"-menu-item"),e.push(s);}}return e;},t;}(Fn);Kt.registerComponent("TextTrackButton",Hn);var zn=function(e){function t(t,i){var n,r=i.track,a=i.cue,s=t.currentTime();return i.selectable=!0,i.multiSelectable=!1,i.label=a.text,i.selected=a.startTime<=s&&s=0;t--){var i=e[t];if(i.kind===this.kind_)return i;}},i.getMenuCaption=function(){return this.track_&&this.track_.label?this.track_.label:this.localize(Ht(this.kind_));},i.createMenu=function(){return this.options_.title=this.getMenuCaption(),e.prototype.createMenu.call(this);},i.createItems=function(){var e=[];if(!this.track_)return e;var t=this.track_.cues;if(!t)return e;for(var i=0,n=t.length;i-1&&(n.label_="captions"),n.menuButton_.controlText(Ht(n.label_)),n;}P["default"](t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-subs-caps-button "+e.prototype.buildCSSClass.call(this);},i.buildWrapperCSSClass=function(){return"vjs-subs-caps-button "+e.prototype.buildWrapperCSSClass.call(this);},i.createItems=function(){var t=[];return this.player().tech_&&this.player().tech_.featuresNativeTextTracks||!this.player().getChild("textTrackSettings")||(t.push(new qn(this.player_,{kind:this.label_})),this.hideThreshold_+=1),t=e.prototype.createItems.call(this,t,Xn);},t;}(Hn);Qn.prototype.kinds_=["captions","subtitles"],Qn.prototype.controlText_="Subtitles",Kt.registerComponent("SubsCapsButton",Qn);var $n=function(e){function t(t,i){var n,r=i.track,a=t.audioTracks();i.label=r.label||r.language||"Unknown",i.selected=r.enabled,(n=e.call(this,t,i)||this).track=r,n.addClass("vjs-"+r.kind+"-menu-item");var s=function s(){for(var e=arguments.length,t=new Array(e),i=0;i=0;i--){t.push(new Zn(this.player(),{rate:e[i]+"x"}));}return t;},i.updateARIAAttributes=function(){this.el().setAttribute("aria-valuenow",this.player().playbackRate());},i.handleClick=function(e){for(var t=this.player().playbackRate(),i=this.playbackRates(),n=i[0],r=0;rt){n=i[r];break;}}this.player().playbackRate(n);},i.handlePlaybackRateschange=function(e){this.update();},i.playbackRates=function(){var e=this.player();return e.playbackRates&&e.playbackRates()||[];},i.playbackRateSupported=function(){return this.player().tech_&&this.player().tech_.featuresPlaybackRate&&this.playbackRates()&&this.playbackRates().length>0;},i.updateVisibility=function(e){this.playbackRateSupported()?this.removeClass("vjs-hidden"):this.addClass("vjs-hidden");},i.updateLabel=function(e){this.playbackRateSupported()&&(this.labelEl_.textContent=this.player().playbackRate()+"x");},t;}(Mn);er.prototype.controlText_="Playback Rate",Kt.registerComponent("PlaybackRateMenuButton",er);var tr=function(e){function t(){return e.apply(this,arguments)||this;}P["default"](t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-spacer "+e.prototype.buildCSSClass.call(this);},i.createEl=function(t,i,n){return void 0===t&&(t="div"),void 0===i&&(i={}),void 0===n&&(n={}),i.className||(i.className=this.buildCSSClass()),e.prototype.createEl.call(this,t,i,n);},t;}(Kt);Kt.registerComponent("Spacer",tr);var ir=function(e){function t(){return e.apply(this,arguments)||this;}P["default"](t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-custom-control-spacer "+e.prototype.buildCSSClass.call(this);},i.createEl=function(){return e.prototype.createEl.call(this,"div",{className:this.buildCSSClass(),textContent:" "});},t;}(tr);Kt.registerComponent("CustomControlSpacer",ir);var nr=function(e){function t(){return e.apply(this,arguments)||this;}return P["default"](t,e),t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-control-bar",dir:"ltr"});},t;}(Kt);nr.prototype.options_={children:["playToggle","volumePanel","currentTimeDisplay","timeDivider","durationDisplay","progressControl","liveDisplay","seekToLive","remainingTimeDisplay","customControlSpacer","playbackRateMenuButton","chaptersButton","descriptionsButton","subsCapsButton","audioTrackButton","fullscreenToggle"]},"exitPictureInPicture"in k["default"]&&nr.prototype.options_.children.splice(nr.prototype.options_.children.length-1,0,"pictureInPictureToggle"),Kt.registerComponent("ControlBar",nr);var rr=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).on(t,"error",function(e){return n.open(e);}),n;}P["default"](t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-error-display "+e.prototype.buildCSSClass.call(this);},i.content=function(){var e=this.player().error();return e?this.localize(e.message):"";},t;}(si);rr.prototype.options_=x["default"]({},si.prototype.options_,{pauseOnOpen:!1,fillAlways:!0,temporary:!1,uncloseable:!0}),Kt.registerComponent("ErrorDisplay",rr);var ar=["#000","Black"],sr=["#00F","Blue"],or=["#0FF","Cyan"],ur=["#0F0","Green"],lr=["#F0F","Magenta"],dr=["#F00","Red"],hr=["#FFF","White"],cr=["#FF0","Yellow"],fr=["1","Opaque"],pr=["0.5","Semi-Transparent"],mr=["0","Transparent"],gr={backgroundColor:{selector:".vjs-bg-color > select",id:"captions-background-color-%s",label:"Color",options:[ar,hr,dr,ur,sr,cr,lr,or]},backgroundOpacity:{selector:".vjs-bg-opacity > select",id:"captions-background-opacity-%s",label:"Transparency",options:[fr,pr,mr]},color:{selector:".vjs-fg-color > select",id:"captions-foreground-color-%s",label:"Color",options:[hr,ar,dr,ur,sr,cr,lr,or]},edgeStyle:{selector:".vjs-edge-style > select",id:"%s",label:"Text Edge Style",options:[["none","None"],["raised","Raised"],["depressed","Depressed"],["uniform","Uniform"],["dropshadow","Dropshadow"]]},fontFamily:{selector:".vjs-font-family > select",id:"captions-font-family-%s",label:"Font Family",options:[["proportionalSansSerif","Proportional Sans-Serif"],["monospaceSansSerif","Monospace Sans-Serif"],["proportionalSerif","Proportional Serif"],["monospaceSerif","Monospace Serif"],["casual","Casual"],["script","Script"],["small-caps","Small Caps"]]},fontPercent:{selector:".vjs-font-percent > select",id:"captions-font-size-%s",label:"Font Size",options:[["0.50","50%"],["0.75","75%"],["1.00","100%"],["1.25","125%"],["1.50","150%"],["1.75","175%"],["2.00","200%"],["3.00","300%"],["4.00","400%"]],"default":2,parser:function parser(e){return"1.00"===e?null:Number(e);}},textOpacity:{selector:".vjs-text-opacity > select",id:"captions-foreground-opacity-%s",label:"Transparency",options:[fr,pr]},windowColor:{selector:".vjs-window-color > select",id:"captions-window-color-%s",label:"Color"},windowOpacity:{selector:".vjs-window-opacity > select",id:"captions-window-opacity-%s",label:"Transparency",options:[mr,pr,fr]}};function _r(e,t){if(t&&(e=t(e)),e&&"none"!==e)return e;}gr.windowColor.options=gr.backgroundColor.options;var yr=function(e){function t(t,i){var n;return i.temporary=!1,(n=e.call(this,t,i)||this).updateDisplay=n.updateDisplay.bind(I["default"](n)),n.fill(),n.hasBeenOpened_=n.hasBeenFilled_=!0,n.endDialog=Le("p",{className:"vjs-control-text",textContent:n.localize("End of dialog window.")}),n.el().appendChild(n.endDialog),n.setDefaults(),void 0===i.persistTextTrackSettings&&(n.options_.persistTextTrackSettings=n.options_.playerOptions.persistTextTrackSettings),n.on(n.$(".vjs-done-button"),"click",function(){n.saveSettings(),n.close();}),n.on(n.$(".vjs-default-button"),"click",function(){n.setDefaults(),n.updateDisplay();}),J(gr,function(e){n.on(n.$(e.selector),"change",n.updateDisplay);}),n.options_.persistTextTrackSettings&&n.restoreSettings(),n;}P["default"](t,e);var i=t.prototype;return i.dispose=function(){this.endDialog=null,e.prototype.dispose.call(this);},i.createElSelect_=function(e,t,i){var n=this;void 0===t&&(t=""),void 0===i&&(i="label");var r=gr[e],a=r.id.replace("%s",this.id_),s=[t,a].join(" ").trim();return["<"+i+' id="'+a+'" class="'+("label"===i?"vjs-label":"")+'">',this.localize(r.label),"",'").join("");},i.createElFgColor_=function(){var e="captions-text-legend-"+this.id_;return['
','',this.localize("Text"),"",this.createElSelect_("color",e),'',this.createElSelect_("textOpacity",e),"","
"].join("");},i.createElBgColor_=function(){var e="captions-background-"+this.id_;return['
','',this.localize("Background"),"",this.createElSelect_("backgroundColor",e),'',this.createElSelect_("backgroundOpacity",e),"","
"].join("");},i.createElWinColor_=function(){var e="captions-window-"+this.id_;return['
','',this.localize("Window"),"",this.createElSelect_("windowColor",e),'',this.createElSelect_("windowOpacity",e),"","
"].join("");},i.createElColors_=function(){return Le("div",{className:"vjs-track-settings-colors",innerHTML:[this.createElFgColor_(),this.createElBgColor_(),this.createElWinColor_()].join("")});},i.createElFont_=function(){return Le("div",{className:"vjs-track-settings-font",innerHTML:['
',this.createElSelect_("fontPercent","","legend"),"
",'
',this.createElSelect_("edgeStyle","","legend"),"
",'
',this.createElSelect_("fontFamily","","legend"),"
"].join("")});},i.createElControls_=function(){var e=this.localize("restore all settings to the default values");return Le("div",{className:"vjs-track-settings-controls",innerHTML:['",'"].join("")});},i.content=function(){return[this.createElColors_(),this.createElFont_(),this.createElControls_()];},i.label=function(){return this.localize("Caption Settings Dialog");},i.description=function(){return this.localize("Beginning of dialog window. Escape will cancel and close the window.");},i.buildCSSClass=function(){return e.prototype.buildCSSClass.call(this)+" vjs-text-track-settings";},i.getValues=function(){var e,t,i,n=this;return t=function t(e,_t2,i){var r,a,s=(r=n.$(_t2.selector),a=_t2.parser,_r(r.options[r.options.selectedIndex].value,a));return void 0!==s&&(e[i]=s),e;},void 0===(i={})&&(i=0),$(e=gr).reduce(function(i,n){return t(i,e[n],n);},i);},i.setValues=function(e){var t=this;J(gr,function(i,n){!function(e,t,i){if(t)for(var n=0;nthis.options_.liveTolerance;this.timeupdateSeen_&&n!==1/0||(a=!1),a!==this.behindLiveEdge_&&(this.behindLiveEdge_=a,this.trigger("liveedgechange"));}},i.handleDurationchange=function(){this.toggleTracking();},i.toggleTracking=function(){this.player_.duration()===1/0&&this.liveWindow()>=this.options_.trackingThreshold?(this.player_.options_.liveui&&this.player_.addClass("vjs-liveui"),this.startTracking()):(this.player_.removeClass("vjs-liveui"),this.stopTracking());},i.startTracking=function(){this.isTracking()||(this.timeupdateSeen_||(this.timeupdateSeen_=this.player_.hasStarted()),this.trackingInterval_=this.setInterval(this.trackLiveHandler_,30),this.trackLive_(),this.on(this.player_,["play","pause"],this.trackLiveHandler_),this.timeupdateSeen_?this.on(this.player_,"seeked",this.handleSeeked_):(this.one(this.player_,"play",this.handlePlay_),this.one(this.player_,"timeupdate",this.handleFirstTimeupdate_)));},i.handleFirstTimeupdate=function(){this.timeupdateSeen_=!0,this.on(this.player_,"seeked",this.handleSeeked_);},i.handleSeeked=function(){var e=Math.abs(this.liveCurrentTime()-this.player_.currentTime());this.seekedBehindLive_=this.nextSeekedFromUser_&&e>2,this.nextSeekedFromUser_=!1,this.trackLive_();},i.handlePlay=function(){this.one(this.player_,"timeupdate",this.seekToLiveEdge_);},i.reset_=function(){this.lastTime_=-1,this.pastSeekEnd_=0,this.lastSeekEnd_=-1,this.behindLiveEdge_=!0,this.timeupdateSeen_=!1,this.seekedBehindLive_=!1,this.nextSeekedFromUser_=!1,this.clearInterval(this.trackingInterval_),this.trackingInterval_=null,this.off(this.player_,["play","pause"],this.trackLiveHandler_),this.off(this.player_,"seeked",this.handleSeeked_),this.off(this.player_,"play",this.handlePlay_),this.off(this.player_,"timeupdate",this.handleFirstTimeupdate_),this.off(this.player_,"timeupdate",this.seekToLiveEdge_);},i.nextSeekedFromUser=function(){this.nextSeekedFromUser_=!0;},i.stopTracking=function(){this.isTracking()&&(this.reset_(),this.trigger("liveedgechange"));},i.seekableEnd=function(){for(var e=this.player_.seekable(),t=[],i=e?e.length:0;i--;){t.push(e.end(i));}return t.length?t.sort()[t.length-1]:1/0;},i.seekableStart=function(){for(var e=this.player_.seekable(),t=[],i=e?e.length:0;i--;){t.push(e.start(i));}return t.length?t.sort()[0]:0;},i.liveWindow=function(){var e=this.liveCurrentTime();return e===1/0?0:e-this.seekableStart();},i.isLive=function(){return this.isTracking();},i.atLiveEdge=function(){return!this.behindLiveEdge();},i.liveCurrentTime=function(){return this.pastSeekEnd()+this.seekableEnd();},i.pastSeekEnd=function(){var e=this.seekableEnd();return-1!==this.lastSeekEnd_&&e!==this.lastSeekEnd_&&(this.pastSeekEnd_=0),this.lastSeekEnd_=e,this.pastSeekEnd_;},i.behindLiveEdge=function(){return this.behindLiveEdge_;},i.isTracking=function(){return"number"==typeof this.trackingInterval_;},i.seekToLiveEdge=function(){this.seekedBehindLive_=!1,this.atLiveEdge()||(this.nextSeekedFromUser_=!1,this.player_.currentTime(this.liveCurrentTime()));},i.dispose=function(){this.off(k["default"],"visibilitychange",this.handleVisibilityChange_),this.stopTracking(),e.prototype.dispose.call(this);},t;}(Kt);Kt.registerComponent("LiveTracker",Tr);var Sr,Er=function Er(e){var t=e.el();if(t.hasAttribute("src"))return e.triggerSourceset(t.src),!0;var i=e.$$("source"),n=[],r="";if(!i.length)return!1;for(var a=0;a=2&&r.push("loadeddata"),e.readyState>=3&&r.push("canplay"),e.readyState>=4&&r.push("canplaythrough"),this.ready(function(){r.forEach(function(e){this.trigger(e);},this);});}},i.setScrubbing=function(e){this.isScrubbing_=e;},i.scrubbing=function(){return this.isScrubbing_;},i.setCurrentTime=function(e){try{this.isScrubbing_&&this.el_.fastSeek&&Ee?this.el_.fastSeek(e):this.el_.currentTime=e;}catch(e){K(e,"Video is not ready. (Video.js)");}},i.duration=function(){var e=this;if(this.el_.duration===1/0&&le&&pe&&0===this.el_.currentTime){return this.on("timeupdate",function t(){e.el_.currentTime>0&&(e.el_.duration===1/0&&e.trigger("durationchange"),e.off("timeupdate",t));}),NaN;}return this.el_.duration||NaN;},i.width=function(){return this.el_.offsetWidth;},i.height=function(){return this.el_.offsetHeight;},i.proxyWebkitFullscreen_=function(){var e=this;if("webkitDisplayingFullscreen"in this.el_){var t=function t(){this.trigger("fullscreenchange",{isFullscreen:!1});},i=function i(){"webkitPresentationMode"in this.el_&&"picture-in-picture"!==this.el_.webkitPresentationMode&&(this.one("webkitendfullscreen",t),this.trigger("fullscreenchange",{isFullscreen:!0,nativeIOSFullscreen:!0}));};this.on("webkitbeginfullscreen",i),this.on("dispose",function(){e.off("webkitbeginfullscreen",i),e.off("webkitendfullscreen",t);});}},i.supportsFullScreen=function(){if("function"==typeof this.el_.webkitEnterFullScreen){var e=A["default"].navigator&&A["default"].navigator.userAgent||"";if(/Android/.test(e)||!/Chrome|Mac OS X 10.5/.test(e))return!0;}return!1;},i.enterFullScreen=function(){var e=this.el_;if(e.paused&&e.networkState<=e.HAVE_METADATA)ii(this.el_.play()),this.setTimeout(function(){e.pause();try{e.webkitEnterFullScreen();}catch(e){this.trigger("fullscreenerror",e);}},0);else try{e.webkitEnterFullScreen();}catch(e){this.trigger("fullscreenerror",e);}},i.exitFullScreen=function(){this.el_.webkitDisplayingFullscreen?this.el_.webkitExitFullScreen():this.trigger("fullscreenerror",new Error("The video is not fullscreen"));},i.requestPictureInPicture=function(){return this.el_.requestPictureInPicture();},i.src=function(e){if(void 0===e)return this.el_.src;this.setSrc(e);},i.reset=function(){t.resetMediaElement(this.el_);},i.currentSrc=function(){return this.currentSource_?this.currentSource_.src:this.el_.currentSrc;},i.setControls=function(e){this.el_.controls=!!e;},i.addTextTrack=function(t,i,n){return this.featuresNativeTextTracks?this.el_.addTextTrack(t,i,n):e.prototype.addTextTrack.call(this,t,i,n);},i.createRemoteTextTrack=function(t){if(!this.featuresNativeTextTracks)return e.prototype.createRemoteTextTrack.call(this,t);var i=k["default"].createElement("track");return t.kind&&(i.kind=t.kind),t.label&&(i.label=t.label),(t.language||t.srclang)&&(i.srclang=t.language||t.srclang),t["default"]&&(i["default"]=t["default"]),t.id&&(i.id=t.id),t.src&&(i.src=t.src),i;},i.addRemoteTextTrack=function(t,i){var n=e.prototype.addRemoteTextTrack.call(this,t,i);return this.featuresNativeTextTracks&&this.el().appendChild(n),n;},i.removeRemoteTextTrack=function(t){if(e.prototype.removeRemoteTextTrack.call(this,t),this.featuresNativeTextTracks)for(var i=this.$$("track"),n=i.length;n--;){t!==i[n]&&t!==i[n].track||this.el().removeChild(i[n]);}},i.getVideoPlaybackQuality=function(){if("function"==typeof this.el().getVideoPlaybackQuality)return this.el().getVideoPlaybackQuality();var e={};return void 0!==this.el().webkitDroppedFrameCount&&void 0!==this.el().webkitDecodedFrameCount&&(e.droppedVideoFrames=this.el().webkitDroppedFrameCount,e.totalVideoFrames=this.el().webkitDecodedFrameCount),A["default"].performance&&"function"==typeof A["default"].performance.now?e.creationTime=A["default"].performance.now():A["default"].performance&&A["default"].performance.timing&&"number"==typeof A["default"].performance.timing.navigationStart&&(e.creationTime=A["default"].Date.now()-A["default"].performance.timing.navigationStart),e;},t;}(Oi);Ir(Pr,"TEST_VID",function(){if(ke()){var e=k["default"].createElement("video"),t=k["default"].createElement("track");return t.kind="captions",t.srclang="en",t.label="English",e.appendChild(t),e;}}),Pr.isSupported=function(){try{Pr.TEST_VID.volume=.5;}catch(e){return!1;}return!(!Pr.TEST_VID||!Pr.TEST_VID.canPlayType);},Pr.canPlayType=function(e){return Pr.TEST_VID.canPlayType(e);},Pr.canPlaySource=function(e,t){return Pr.canPlayType(e.type);},Pr.canControlVolume=function(){try{var e=Pr.TEST_VID.volume;return Pr.TEST_VID.volume=e/2+.1,e!==Pr.TEST_VID.volume;}catch(e){return!1;}},Pr.canMuteVolume=function(){try{var e=Pr.TEST_VID.muted;return Pr.TEST_VID.muted=!e,Pr.TEST_VID.muted?Ve(Pr.TEST_VID,"muted","muted"):He(Pr.TEST_VID,"muted"),e!==Pr.TEST_VID.muted;}catch(e){return!1;}},Pr.canControlPlaybackRate=function(){if(le&&pe&&me<58)return!1;try{var e=Pr.TEST_VID.playbackRate;return Pr.TEST_VID.playbackRate=e/2+.1,e!==Pr.TEST_VID.playbackRate;}catch(e){return!1;}},Pr.canOverrideAttributes=function(){try{var e=function e(){};Object.defineProperty(k["default"].createElement("video"),"src",{get:e,set:e}),Object.defineProperty(k["default"].createElement("audio"),"src",{get:e,set:e}),Object.defineProperty(k["default"].createElement("video"),"innerHTML",{get:e,set:e}),Object.defineProperty(k["default"].createElement("audio"),"innerHTML",{get:e,set:e});}catch(e){return!1;}return!0;},Pr.supportsNativeTextTracks=function(){return Ee||Se&&pe;},Pr.supportsNativeVideoTracks=function(){return!(!Pr.TEST_VID||!Pr.TEST_VID.videoTracks);},Pr.supportsNativeAudioTracks=function(){return!(!Pr.TEST_VID||!Pr.TEST_VID.audioTracks);},Pr.Events=["loadstart","suspend","abort","error","emptied","stalled","loadedmetadata","loadeddata","canplay","canplaythrough","playing","waiting","seeking","seeked","ended","durationchange","timeupdate","progress","play","pause","ratechange","resize","volumechange"],[["featuresVolumeControl","canControlVolume"],["featuresMuteControl","canMuteVolume"],["featuresPlaybackRate","canControlPlaybackRate"],["featuresSourceset","canOverrideAttributes"],["featuresNativeTextTracks","supportsNativeTextTracks"],["featuresNativeVideoTracks","supportsNativeVideoTracks"],["featuresNativeAudioTracks","supportsNativeAudioTracks"]].forEach(function(e){var t=e[0],i=e[1];Ir(Pr.prototype,t,function(){return Pr[i]();},!0);}),Pr.prototype.movingMediaElementInDOM=!Se,Pr.prototype.featuresFullscreenResize=!0,Pr.prototype.featuresProgressEvents=!0,Pr.prototype.featuresTimeupdateEvents=!0,Pr.patchCanPlayType=function(){de>=4&&!ce&&!pe&&(Sr=Pr.TEST_VID&&Pr.TEST_VID.constructor.prototype.canPlayType,Pr.TEST_VID.constructor.prototype.canPlayType=function(e){return e&&/^application\/(?:x-|vnd\.apple\.)mpegurl/i.test(e)?"maybe":Sr.call(this,e);});},Pr.unpatchCanPlayType=function(){var e=Pr.TEST_VID.constructor.prototype.canPlayType;return Sr&&(Pr.TEST_VID.constructor.prototype.canPlayType=Sr),e;},Pr.patchCanPlayType(),Pr.disposeMediaElement=function(e){if(e){for(e.parentNode&&e.parentNode.removeChild(e);e.hasChildNodes();){e.removeChild(e.firstChild);}e.removeAttribute("src"),"function"==typeof e.load&&function(){try{e.load();}catch(e){}}();}},Pr.resetMediaElement=function(e){if(e){for(var t=e.querySelectorAll("source"),i=t.length;i--;){e.removeChild(t[i]);}e.removeAttribute("src"),"function"==typeof e.load&&function(){try{e.load();}catch(e){}}();}},["muted","defaultMuted","autoplay","controls","loop","playsinline"].forEach(function(e){Pr.prototype[e]=function(){return this.el_[e]||this.el_.hasAttribute(e);};}),["muted","defaultMuted","autoplay","loop","playsinline"].forEach(function(e){Pr.prototype["set"+Ht(e)]=function(t){this.el_[e]=t,t?this.el_.setAttribute(e,e):this.el_.removeAttribute(e);};}),["paused","currentTime","buffered","volume","poster","preload","error","seeking","seekable","ended","playbackRate","defaultPlaybackRate","disablePictureInPicture","played","networkState","readyState","videoWidth","videoHeight","crossOrigin"].forEach(function(e){Pr.prototype[e]=function(){return this.el_[e];};}),["volume","src","poster","preload","playbackRate","defaultPlaybackRate","disablePictureInPicture","crossOrigin"].forEach(function(e){Pr.prototype["set"+Ht(e)]=function(t){this.el_[e]=t;};}),["pause","load","play"].forEach(function(e){Pr.prototype[e]=function(){return this.el_[e]();};}),Oi.withSourceHandlers(Pr),Pr.nativeSourceHandler={},Pr.nativeSourceHandler.canPlayType=function(e){try{return Pr.TEST_VID.canPlayType(e);}catch(e){return"";}},Pr.nativeSourceHandler.canHandleSource=function(e,t){if(e.type)return Pr.nativeSourceHandler.canPlayType(e.type);if(e.src){var i=Ei(e.src);return Pr.nativeSourceHandler.canPlayType("video/"+i);}return"";},Pr.nativeSourceHandler.handleSource=function(e,t,i){t.setSrc(e.src);},Pr.nativeSourceHandler.dispose=function(){},Pr.registerSourceHandler(Pr.nativeSourceHandler),Oi.registerTech("Html5",Pr);var Lr=["progress","abort","suspend","emptied","stalled","loadedmetadata","loadeddata","timeupdate","resize","volumechange","texttrackchange"],Dr={canplay:"CanPlay",canplaythrough:"CanPlayThrough",playing:"Playing",seeked:"Seeked"},Ur=["tiny","xsmall","small","medium","large","xlarge","huge"],Rr={};Ur.forEach(function(e){var t="x"===e.charAt(0)?"x-"+e.substring(1):e;Rr[e]="vjs-layout-"+t;});var Or={tiny:210,xsmall:320,small:425,medium:768,large:1440,xlarge:2560,huge:1/0},Mr=function(e){function t(i,n,r){var a;if(i.id=i.id||n.id||"vjs_video_"+ct(),(n=Z(t.getTagSettings(i),n)).initChildren=!1,n.createEl=!1,n.evented=!1,n.reportTouchActivity=!1,!n.language)if("function"==typeof i.closest){var s=i.closest("[lang]");s&&s.getAttribute&&(n.language=s.getAttribute("lang"));}else for(var o=i;o&&1===o.nodeType;){if(Ne(o).hasOwnProperty("lang")){n.language=o.getAttribute("lang");break;}o=o.parentNode;}if((a=e.call(this,null,n,r)||this).boundDocumentFullscreenChange_=function(e){return a.documentFullscreenChange_(e);},a.boundFullWindowOnEscKey_=function(e){return a.fullWindowOnEscKey(e);},a.boundUpdateStyleEl_=function(e){return a.updateStyleEl_(e);},a.boundApplyInitTime_=function(e){return a.applyInitTime_(e);},a.boundUpdateCurrentBreakpoint_=function(e){return a.updateCurrentBreakpoint_(e);},a.boundHandleTechClick_=function(e){return a.handleTechClick_(e);},a.boundHandleTechDoubleClick_=function(e){return a.handleTechDoubleClick_(e);},a.boundHandleTechTouchStart_=function(e){return a.handleTechTouchStart_(e);},a.boundHandleTechTouchMove_=function(e){return a.handleTechTouchMove_(e);},a.boundHandleTechTouchEnd_=function(e){return a.handleTechTouchEnd_(e);},a.boundHandleTechTap_=function(e){return a.handleTechTap_(e);},a.isFullscreen_=!1,a.log=X(a.id_),a.fsApi_=H,a.isPosterFromTech_=!1,a.queuedCallbacks_=[],a.isReady_=!1,a.hasStarted_=!1,a.userActive_=!1,a.debugEnabled_=!1,!a.options_||!a.options_.techOrder||!a.options_.techOrder.length)throw new Error("No techOrder specified. Did you overwrite videojs.options instead of just changing the properties you want to override?");if(a.tag=i,a.tagAttributes=i&&Ne(i),a.language(a.options_.language),n.languages){var u={};Object.getOwnPropertyNames(n.languages).forEach(function(e){u[e.toLowerCase()]=n.languages[e];}),a.languages_=u;}else a.languages_=t.prototype.options_.languages;a.resetCache_(),a.poster_=n.poster||"",a.controls_=!!n.controls,i.controls=!1,i.removeAttribute("controls"),a.changingSrc_=!1,a.playCallbacks_=[],a.playTerminatedQueue_=[],i.hasAttribute("autoplay")?a.autoplay(!0):a.autoplay(a.options_.autoplay),n.plugins&&Object.keys(n.plugins).forEach(function(e){if("function"!=typeof a[e])throw new Error('plugin "'+e+'" does not exist');}),a.scrubbing_=!1,a.el_=a.createEl(),Bt(I["default"](a),{eventBusKey:"el_"}),a.fsApi_.requestFullscreen&&(vt(k["default"],a.fsApi_.fullscreenchange,a.boundDocumentFullscreenChange_),a.on(a.fsApi_.fullscreenchange,a.boundDocumentFullscreenChange_)),a.fluid_&&a.on(["playerreset","resize"],a.boundUpdateStyleEl_);var l=zt(a.options_);n.plugins&&Object.keys(n.plugins).forEach(function(e){a[e](n.plugins[e]);}),n.debug&&a.debug(!0),a.options_.playerOptions=l,a.middleware_=[],a.playbackRates(n.playbackRates),a.initChildren(),a.isAudio("audio"===i.nodeName.toLowerCase()),a.controls()?a.addClass("vjs-controls-enabled"):a.addClass("vjs-controls-disabled"),a.el_.setAttribute("role","region"),a.isAudio()?a.el_.setAttribute("aria-label",a.localize("Audio Player")):a.el_.setAttribute("aria-label",a.localize("Video Player")),a.isAudio()&&a.addClass("vjs-audio"),a.flexNotSupported_()&&a.addClass("vjs-no-flex"),ve&&a.addClass("vjs-touch-enabled"),Se||a.addClass("vjs-workinghover"),t.players[a.id_]=I["default"](a);var d="7.15.4".split(".")[0];return a.addClass("vjs-v"+d),a.userActive(!0),a.reportUserActivity(),a.one("play",function(e){return a.listenForUserActivity_(e);}),a.on("stageclick",function(e){return a.handleStageClick_(e);}),a.on("keydown",function(e){return a.handleKeyDown(e);}),a.on("languagechange",function(e){return a.handleLanguagechange(e);}),a.breakpoints(a.options_.breakpoints),a.responsive(a.options_.responsive),a;}P["default"](t,e);var i=t.prototype;return i.dispose=function(){var i=this;this.trigger("dispose"),this.off("dispose"),bt(k["default"],this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),bt(k["default"],"keydown",this.boundFullWindowOnEscKey_),this.styleEl_&&this.styleEl_.parentNode&&(this.styleEl_.parentNode.removeChild(this.styleEl_),this.styleEl_=null),t.players[this.id_]=null,this.tag&&this.tag.player&&(this.tag.player=null),this.el_&&this.el_.player&&(this.el_.player=null),this.tech_&&(this.tech_.dispose(),this.isPosterFromTech_=!1,this.poster_=""),this.playerElIngest_&&(this.playerElIngest_=null),this.tag&&(this.tag=null),Fi[this.id()]=null,Ri.names.forEach(function(e){var t=Ri[e],n=i[t.getterName]();n&&n.off&&n.off();}),e.prototype.dispose.call(this);},i.createEl=function(){var t,i=this.tag,n=this.playerElIngest_=i.parentNode&&i.parentNode.hasAttribute&&i.parentNode.hasAttribute("data-vjs-player"),r="video-js"===this.tag.tagName.toLowerCase();n?t=this.el_=i.parentNode:r||(t=this.el_=e.prototype.createEl.call(this,"div"));var a=Ne(i);if(r){for(t=this.el_=i,i=this.tag=k["default"].createElement("video");t.children.length;){i.appendChild(t.firstChild);}Re(t,"video-js")||Oe(t,"video-js"),t.appendChild(i),n=this.playerElIngest_=t,Object.keys(t).forEach(function(e){try{i[e]=t[e];}catch(e){}});}if(i.setAttribute("tabindex","-1"),a.tabindex="-1",(ge||pe&&ye)&&(i.setAttribute("role","application"),a.role="application"),i.removeAttribute("width"),i.removeAttribute("height"),"width"in a&&delete a.width,"height"in a&&delete a.height,Object.getOwnPropertyNames(a).forEach(function(e){r&&"class"===e||t.setAttribute(e,a[e]),r&&i.setAttribute(e,a[e]);}),i.playerId=i.id,i.id+="_html5_api",i.className="vjs-tech",i.player=t.player=this,this.addClass("vjs-paused"),!0!==A["default"].VIDEOJS_NO_DYNAMIC_STYLE){this.styleEl_=lt("vjs-styles-dimensions");var s=tt(".vjs-styles-defaults"),o=tt("head");o.insertBefore(this.styleEl_,s?s.nextSibling:o.firstChild);}this.fill_=!1,this.fluid_=!1,this.width(this.options_.width),this.height(this.options_.height),this.fill(this.options_.fill),this.fluid(this.options_.fluid),this.aspectRatio(this.options_.aspectRatio),this.crossOrigin(this.options_.crossOrigin||this.options_.crossorigin);for(var u=i.getElementsByTagName("a"),l=0;l0?this.videoWidth()+":"+this.videoHeight():"16:9").split(":"),r=n[1]/n[0];e=void 0!==this.width_?this.width_:void 0!==this.height_?this.height_/r:this.videoWidth()||300,t=void 0!==this.height_?this.height_:e*r,i=/^[^a-zA-Z]/.test(this.id())?"dimensions-"+this.id():this.id()+"-dimensions",this.addClass(i),dt(this.styleEl_,"\n ."+i+" {\n width: "+e+"px;\n height: "+t+"px;\n }\n\n ."+i+".vjs-fluid {\n padding-top: "+100*r+"%;\n }\n ");}else{var a="number"==typeof this.width_?this.width_:this.options_.width,s="number"==typeof this.height_?this.height_:this.options_.height,o=this.tech_&&this.tech_.el();o&&(a>=0&&(o.width=a),s>=0&&(o.height=s));}},i.loadTech_=function(e,t){var i=this;this.tech_&&this.unloadTech_();var n=Ht(e),r=e.charAt(0).toLowerCase()+e.slice(1);"Html5"!==n&&this.tag&&(Oi.getTech("Html5").disposeMediaElement(this.tag),this.tag.player=null,this.tag=null),this.techName_=n,this.isReady_=!1;var a=this.autoplay();("string"==typeof this.autoplay()||!0===this.autoplay()&&this.options_.normalizeAutoplay)&&(a=!1);var s={source:t,autoplay:a,nativeControlsForTouch:this.options_.nativeControlsForTouch,playerId:this.id(),techId:this.id()+"_"+r+"_api",playsinline:this.options_.playsinline,preload:this.options_.preload,loop:this.options_.loop,disablePictureInPicture:this.options_.disablePictureInPicture,muted:this.options_.muted,poster:this.poster(),language:this.language(),playerElIngest:this.playerElIngest_||!1,"vtt.js":this.options_["vtt.js"],canOverridePoster:!!this.options_.techCanOverridePoster,enableSourceset:this.options_.enableSourceset,Promise:this.options_.Promise};Ri.names.forEach(function(e){var t=Ri[e];s[t.getterName]=i[t.privateName];}),Z(s,this.options_[n]),Z(s,this.options_[r]),Z(s,this.options_[e.toLowerCase()]),this.tag&&(s.tag=this.tag),t&&t.src===this.cache_.src&&this.cache_.currentTime>0&&(s.startTime=this.cache_.currentTime);var o=Oi.getTech(e);if(!o)throw new Error("No Tech named '"+n+"' exists! '"+n+"' should be registered using videojs.registerTech()'");this.tech_=new o(s),this.tech_.ready(At(this,this.handleTechReady_),!0),ai(this.textTracksJson_||[],this.tech_),Lr.forEach(function(e){i.on(i.tech_,e,function(t){return i["handleTech"+Ht(e)+"_"](t);});}),Object.keys(Dr).forEach(function(e){i.on(i.tech_,e,function(t){0===i.tech_.playbackRate()&&i.tech_.seeking()?i.queuedCallbacks_.push({callback:i["handleTech"+Dr[e]+"_"].bind(i),event:t}):i["handleTech"+Dr[e]+"_"](t);});}),this.on(this.tech_,"loadstart",function(e){return i.handleTechLoadStart_(e);}),this.on(this.tech_,"sourceset",function(e){return i.handleTechSourceset_(e);}),this.on(this.tech_,"waiting",function(e){return i.handleTechWaiting_(e);}),this.on(this.tech_,"ended",function(e){return i.handleTechEnded_(e);}),this.on(this.tech_,"seeking",function(e){return i.handleTechSeeking_(e);}),this.on(this.tech_,"play",function(e){return i.handleTechPlay_(e);}),this.on(this.tech_,"firstplay",function(e){return i.handleTechFirstPlay_(e);}),this.on(this.tech_,"pause",function(e){return i.handleTechPause_(e);}),this.on(this.tech_,"durationchange",function(e){return i.handleTechDurationChange_(e);}),this.on(this.tech_,"fullscreenchange",function(e,t){return i.handleTechFullscreenChange_(e,t);}),this.on(this.tech_,"fullscreenerror",function(e,t){return i.handleTechFullscreenError_(e,t);}),this.on(this.tech_,"enterpictureinpicture",function(e){return i.handleTechEnterPictureInPicture_(e);}),this.on(this.tech_,"leavepictureinpicture",function(e){return i.handleTechLeavePictureInPicture_(e);}),this.on(this.tech_,"error",function(e){return i.handleTechError_(e);}),this.on(this.tech_,"posterchange",function(e){return i.handleTechPosterChange_(e);}),this.on(this.tech_,"textdata",function(e){return i.handleTechTextData_(e);}),this.on(this.tech_,"ratechange",function(e){return i.handleTechRateChange_(e);}),this.on(this.tech_,"loadedmetadata",this.boundUpdateStyleEl_),this.usingNativeControls(this.techGet_("controls")),this.controls()&&!this.usingNativeControls()&&this.addTechControlsListeners_(),this.tech_.el().parentNode===this.el()||"Html5"===n&&this.tag||Ue(this.tech_.el(),this.el()),this.tag&&(this.tag.player=null,this.tag=null);},i.unloadTech_=function(){var e=this;Ri.names.forEach(function(t){var i=Ri[t];e[i.privateName]=e[i.getterName]();}),this.textTracksJson_=ri(this.tech_),this.isReady_=!1,this.tech_.dispose(),this.tech_=!1,this.isPosterFromTech_&&(this.poster_="",this.trigger("posterchange")),this.isPosterFromTech_=!1;},i.tech=function(e){return void 0===e&&K.warn("Using the tech directly can be dangerous. I hope you know what you're doing.\nSee https://github.com/videojs/video.js/issues/2617 for more info.\n"),this.tech_;},i.addTechControlsListeners_=function(){this.removeTechControlsListeners_(),this.on(this.tech_,"click",this.boundHandleTechClick_),this.on(this.tech_,"dblclick",this.boundHandleTechDoubleClick_),this.on(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.on(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.on(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.on(this.tech_,"tap",this.boundHandleTechTap_);},i.removeTechControlsListeners_=function(){this.off(this.tech_,"tap",this.boundHandleTechTap_),this.off(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.off(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.off(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.off(this.tech_,"click",this.boundHandleTechClick_),this.off(this.tech_,"dblclick",this.boundHandleTechDoubleClick_);},i.handleTechReady_=function(){this.triggerReady(),this.cache_.volume&&this.techCall_("setVolume",this.cache_.volume),this.handleTechPosterChange_(),this.handleTechDurationChange_();},i.handleTechLoadStart_=function(){this.removeClass("vjs-ended"),this.removeClass("vjs-seeking"),this.error(null),this.handleTechDurationChange_(),this.paused()?(this.hasStarted(!1),this.trigger("loadstart")):(this.trigger("loadstart"),this.trigger("firstplay")),this.manualAutoplay_(!0===this.autoplay()&&this.options_.normalizeAutoplay?"play":this.autoplay());},i.manualAutoplay_=function(e){var t=this;if(this.tech_&&"string"==typeof e){var i,n=function n(){var e=t.muted();t.muted(!0);var i=function i(){t.muted(e);};t.playTerminatedQueue_.push(i);var n=t.play();if(ti(n))return n["catch"](function(e){throw i(),new Error("Rejection at manualAutoplay. Restoring muted value. "+(e||""));});};if("any"!==e||this.muted()?i="muted"!==e||this.muted()?this.play():n():ti(i=this.play())&&(i=i["catch"](n)),ti(i))return i.then(function(){t.trigger({type:"autoplay-success",autoplay:e});})["catch"](function(){t.trigger({type:"autoplay-failure",autoplay:e});});}},i.updateSourceCaches_=function(e){void 0===e&&(e="");var t=e,i="";"string"!=typeof t&&(t=e.src,i=e.type),this.cache_.source=this.cache_.source||{},this.cache_.sources=this.cache_.sources||[],t&&!i&&(i=function(e,t){if(!t)return"";if(e.cache_.source.src===t&&e.cache_.source.type)return e.cache_.source.type;var i=e.cache_.sources.filter(function(e){return e.src===t;});if(i.length)return i[0].type;for(var n=e.$$("source"),r=0;r0&&0===this.cache_.lastPlaybackRate&&(this.queuedCallbacks_.forEach(function(e){return e.callback(e.event);}),this.queuedCallbacks_=[]),this.cache_.lastPlaybackRate=this.tech_.playbackRate(),this.trigger("ratechange");},i.handleTechWaiting_=function(){var e=this;this.addClass("vjs-waiting"),this.trigger("waiting");var t=this.currentTime();this.on("timeupdate",function i(){t!==e.currentTime()&&(e.removeClass("vjs-waiting"),e.off("timeupdate",i));});},i.handleTechCanPlay_=function(){this.removeClass("vjs-waiting"),this.trigger("canplay");},i.handleTechCanPlayThrough_=function(){this.removeClass("vjs-waiting"),this.trigger("canplaythrough");},i.handleTechPlaying_=function(){this.removeClass("vjs-waiting"),this.trigger("playing");},i.handleTechSeeking_=function(){this.addClass("vjs-seeking"),this.trigger("seeking");},i.handleTechSeeked_=function(){this.removeClass("vjs-seeking"),this.removeClass("vjs-ended"),this.trigger("seeked");},i.handleTechFirstPlay_=function(){this.options_.starttime&&(K.warn("Passing the `starttime` option to the player will be deprecated in 6.0"),this.currentTime(this.options_.starttime)),this.addClass("vjs-has-started"),this.trigger("firstplay");},i.handleTechPause_=function(){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.trigger("pause");},i.handleTechEnded_=function(){this.addClass("vjs-ended"),this.removeClass("vjs-waiting"),this.options_.loop?(this.currentTime(0),this.play()):this.paused()||this.pause(),this.trigger("ended");},i.handleTechDurationChange_=function(){this.duration(this.techGet_("duration"));},i.handleTechClick_=function(e){this.controls_&&(this.paused()?ii(this.play()):this.pause());},i.handleTechDoubleClick_=function(e){this.controls_&&(Array.prototype.some.call(this.$$(".vjs-control-bar, .vjs-modal-dialog"),function(t){return t.contains(e.target);})||void 0!==this.options_&&void 0!==this.options_.userActions&&void 0!==this.options_.userActions.doubleClick&&!1===this.options_.userActions.doubleClick||(void 0!==this.options_&&void 0!==this.options_.userActions&&"function"==typeof this.options_.userActions.doubleClick?this.options_.userActions.doubleClick.call(this,e):this.isFullscreen()?this.exitFullscreen():this.requestFullscreen()));},i.handleTechTap_=function(){this.userActive(!this.userActive());},i.handleTechTouchStart_=function(){this.userWasActive=this.userActive();},i.handleTechTouchMove_=function(){this.userWasActive&&this.reportUserActivity();},i.handleTechTouchEnd_=function(e){e.cancelable&&e.preventDefault();},i.handleStageClick_=function(){this.reportUserActivity();},i.toggleFullscreenClass_=function(){this.isFullscreen()?this.addClass("vjs-fullscreen"):this.removeClass("vjs-fullscreen");},i.documentFullscreenChange_=function(e){var t=e.target.player;if(!t||t===this){var i=this.el(),n=k["default"][this.fsApi_.fullscreenElement]===i;!n&&i.matches?n=i.matches(":"+this.fsApi_.fullscreen):!n&&i.msMatchesSelector&&(n=i.msMatchesSelector(":"+this.fsApi_.fullscreen)),this.isFullscreen(n);}},i.handleTechFullscreenChange_=function(e,t){t&&(t.nativeIOSFullscreen&&this.toggleClass("vjs-ios-native-fs"),this.isFullscreen(t.isFullscreen));},i.handleTechFullscreenError_=function(e,t){this.trigger("fullscreenerror",t);},i.togglePictureInPictureClass_=function(){this.isInPictureInPicture()?this.addClass("vjs-picture-in-picture"):this.removeClass("vjs-picture-in-picture");},i.handleTechEnterPictureInPicture_=function(e){this.isInPictureInPicture(!0);},i.handleTechLeavePictureInPicture_=function(e){this.isInPictureInPicture(!1);},i.handleTechError_=function(){var e=this.tech_.error();this.error(e);},i.handleTechTextData_=function(){var e=null;arguments.length>1&&(e=arguments[1]),this.trigger("textdata",e);},i.getCache=function(){return this.cache_;},i.resetCache_=function(){this.cache_={currentTime:0,initTime:0,inactivityTimeout:this.options_.inactivityTimeout,duration:NaN,lastVolume:1,lastPlaybackRate:this.defaultPlaybackRate(),media:null,src:"",source:{},sources:[],playbackRates:[],volume:1};},i.techCall_=function(e,t){this.ready(function(){if(e in Hi)return function(e,t,i,n){return t[i](e.reduce(Gi(i),n));}(this.middleware_,this.tech_,e,t);if(e in zi)return ji(this.middleware_,this.tech_,e,t);try{this.tech_&&this.tech_[e](t);}catch(e){throw K(e),e;}},!0);},i.techGet_=function(e){if(this.tech_&&this.tech_.isReady_){if(e in Vi)return function(e,t,i){return e.reduceRight(Gi(i),t[i]());}(this.middleware_,this.tech_,e);if(e in zi)return ji(this.middleware_,this.tech_,e);try{return this.tech_[e]();}catch(t){if(void 0===this.tech_[e])throw K("Video.js: "+e+" method not defined for "+this.techName_+" playback technology.",t),t;if("TypeError"===t.name)throw K("Video.js: "+e+" unavailable on "+this.techName_+" playback technology element.",t),this.tech_.isReady_=!1,t;throw K(t),t;}}},i.play=function(){var e=this,t=this.options_.Promise||A["default"].Promise;return t?new t(function(t){e.play_(t);}):this.play_();},i.play_=function(e){var t=this;void 0===e&&(e=ii),this.playCallbacks_.push(e);var i=Boolean(!this.changingSrc_&&(this.src()||this.currentSrc()));if(this.waitToPlay_&&(this.off(["ready","loadstart"],this.waitToPlay_),this.waitToPlay_=null),!this.isReady_||!i)return this.waitToPlay_=function(e){t.play_();},this.one(["ready","loadstart"],this.waitToPlay_),void(i||!Ee&&!Se||this.load());var n=this.techGet_("play");null===n?this.runPlayTerminatedQueue_():this.runPlayCallbacks_(n);},i.runPlayTerminatedQueue_=function(){var e=this.playTerminatedQueue_.slice(0);this.playTerminatedQueue_=[],e.forEach(function(e){e();});},i.runPlayCallbacks_=function(e){var t=this.playCallbacks_.slice(0);this.playCallbacks_=[],this.playTerminatedQueue_=[],t.forEach(function(t){t(e);});},i.pause=function(){this.techCall_("pause");},i.paused=function(){return!1!==this.techGet_("paused");},i.played=function(){return this.techGet_("played")||$t(0,0);},i.scrubbing=function(e){if(void 0===e)return this.scrubbing_;this.scrubbing_=!!e,this.techCall_("setScrubbing",this.scrubbing_),e?this.addClass("vjs-scrubbing"):this.removeClass("vjs-scrubbing");},i.currentTime=function(e){return void 0!==e?(e<0&&(e=0),this.isReady_&&!this.changingSrc_&&this.tech_&&this.tech_.isReady_?(this.techCall_("setCurrentTime",e),void(this.cache_.initTime=0)):(this.cache_.initTime=e,this.off("canplay",this.boundApplyInitTime_),void this.one("canplay",this.boundApplyInitTime_))):(this.cache_.currentTime=this.techGet_("currentTime")||0,this.cache_.currentTime);},i.applyInitTime_=function(){this.currentTime(this.cache_.initTime);},i.duration=function(e){if(void 0===e)return void 0!==this.cache_.duration?this.cache_.duration:NaN;(e=parseFloat(e))<0&&(e=1/0),e!==this.cache_.duration&&(this.cache_.duration=e,e===1/0?this.addClass("vjs-live"):this.removeClass("vjs-live"),isNaN(e)||this.trigger("durationchange"));},i.remainingTime=function(){return this.duration()-this.currentTime();},i.remainingTimeDisplay=function(){return Math.floor(this.duration())-Math.floor(this.currentTime());},i.buffered=function(){var e=this.techGet_("buffered");return e&&e.length||(e=$t(0,0)),e;},i.bufferedPercent=function(){return Jt(this.buffered(),this.duration());},i.bufferedEnd=function(){var e=this.buffered(),t=this.duration(),i=e.end(e.length-1);return i>t&&(i=t),i;},i.volume=function(e){var t;return void 0!==e?(t=Math.max(0,Math.min(1,parseFloat(e))),this.cache_.volume=t,this.techCall_("setVolume",t),void(t>0&&this.lastVolume_(t))):(t=parseFloat(this.techGet_("volume")),isNaN(t)?1:t);},i.muted=function(e){if(void 0===e)return this.techGet_("muted")||!1;this.techCall_("setMuted",e);},i.defaultMuted=function(e){return void 0!==e?this.techCall_("setDefaultMuted",e):this.techGet_("defaultMuted")||!1;},i.lastVolume_=function(e){if(void 0===e||0===e)return this.cache_.lastVolume;this.cache_.lastVolume=e;},i.supportsFullScreen=function(){return this.techGet_("supportsFullScreen")||!1;},i.isFullscreen=function(e){if(void 0!==e){var t=this.isFullscreen_;return this.isFullscreen_=Boolean(e),this.isFullscreen_!==t&&this.fsApi_.prefixed&&this.trigger("fullscreenchange"),void this.toggleFullscreenClass_();}return this.isFullscreen_;},i.requestFullscreen=function(e){var t=this.options_.Promise||A["default"].Promise;if(t){var i=this;return new t(function(t,n){function r(){i.off("fullscreenerror",s),i.off("fullscreenchange",a);}function a(){r(),t();}function s(e,t){r(),n(t);}i.one("fullscreenchange",a),i.one("fullscreenerror",s);var o=i.requestFullscreenHelper_(e);o&&(o.then(r,r),o.then(t,n));});}return this.requestFullscreenHelper_();},i.requestFullscreenHelper_=function(e){var t,i=this;if(this.fsApi_.prefixed||(t=this.options_.fullscreen&&this.options_.fullscreen.options||{},void 0!==e&&(t=e)),this.fsApi_.requestFullscreen){var n=this.el_[this.fsApi_.requestFullscreen](t);return n&&n.then(function(){return i.isFullscreen(!0);},function(){return i.isFullscreen(!1);}),n;}this.tech_.supportsFullScreen()&&!0==!this.options_.preferFullWindow?this.techCall_("enterFullScreen"):this.enterFullWindow();},i.exitFullscreen=function(){var e=this.options_.Promise||A["default"].Promise;if(e){var t=this;return new e(function(e,i){function n(){t.off("fullscreenerror",a),t.off("fullscreenchange",r);}function r(){n(),e();}function a(e,t){n(),i(t);}t.one("fullscreenchange",r),t.one("fullscreenerror",a);var s=t.exitFullscreenHelper_();s&&(s.then(n,n),s.then(e,i));});}return this.exitFullscreenHelper_();},i.exitFullscreenHelper_=function(){var e=this;if(this.fsApi_.requestFullscreen){var t=k["default"][this.fsApi_.exitFullscreen]();return t&&ii(t.then(function(){return e.isFullscreen(!1);})),t;}this.tech_.supportsFullScreen()&&!0==!this.options_.preferFullWindow?this.techCall_("exitFullScreen"):this.exitFullWindow();},i.enterFullWindow=function(){this.isFullscreen(!0),this.isFullWindow=!0,this.docOrigOverflow=k["default"].documentElement.style.overflow,vt(k["default"],"keydown",this.boundFullWindowOnEscKey_),k["default"].documentElement.style.overflow="hidden",Oe(k["default"].body,"vjs-full-window"),this.trigger("enterFullWindow");},i.fullWindowOnEscKey=function(e){D["default"].isEventKey(e,"Esc")&&!0===this.isFullscreen()&&(this.isFullWindow?this.exitFullWindow():this.exitFullscreen());},i.exitFullWindow=function(){this.isFullscreen(!1),this.isFullWindow=!1,bt(k["default"],"keydown",this.boundFullWindowOnEscKey_),k["default"].documentElement.style.overflow=this.docOrigOverflow,Me(k["default"].body,"vjs-full-window"),this.trigger("exitFullWindow");},i.disablePictureInPicture=function(e){if(void 0===e)return this.techGet_("disablePictureInPicture");this.techCall_("setDisablePictureInPicture",e),this.options_.disablePictureInPicture=e,this.trigger("disablepictureinpicturechanged");},i.isInPictureInPicture=function(e){return void 0!==e?(this.isInPictureInPicture_=!!e,void this.togglePictureInPictureClass_()):!!this.isInPictureInPicture_;},i.requestPictureInPicture=function(){if("pictureInPictureEnabled"in k["default"]&&!1===this.disablePictureInPicture())return this.techGet_("requestPictureInPicture");},i.exitPictureInPicture=function(){if("pictureInPictureEnabled"in k["default"])return k["default"].exitPictureInPicture();},i.handleKeyDown=function(e){var t=this.options_.userActions;if(t&&t.hotkeys){(function(e){var t=e.tagName.toLowerCase();if(e.isContentEditable)return!0;if("input"===t)return-1===["button","checkbox","hidden","radio","reset","submit"].indexOf(e.type);return-1!==["textarea"].indexOf(t);})(this.el_.ownerDocument.activeElement)||("function"==typeof t.hotkeys?t.hotkeys.call(this,e):this.handleHotkeys(e));}},i.handleHotkeys=function(e){var t=this.options_.userActions?this.options_.userActions.hotkeys:{},i=t.fullscreenKey,n=void 0===i?function(e){return D["default"].isEventKey(e,"f");}:i,r=t.muteKey,a=void 0===r?function(e){return D["default"].isEventKey(e,"m");}:r,s=t.playPauseKey,o=void 0===s?function(e){return D["default"].isEventKey(e,"k")||D["default"].isEventKey(e,"Space");}:s;if(n.call(this,e)){e.preventDefault(),e.stopPropagation();var u=Kt.getComponent("FullscreenToggle");!1!==k["default"][this.fsApi_.fullscreenEnabled]&&u.prototype.handleClick.call(this,e);}else if(a.call(this,e)){e.preventDefault(),e.stopPropagation(),Kt.getComponent("MuteToggle").prototype.handleClick.call(this,e);}else if(o.call(this,e)){e.preventDefault(),e.stopPropagation(),Kt.getComponent("PlayToggle").prototype.handleClick.call(this,e);}},i.canPlayType=function(e){for(var t,i=0,n=this.options_.techOrder;i1?i.handleSrc_(n.slice(1)):(i.changingSrc_=!1,i.setTimeout(function(){this.error({code:4,message:this.localize(this.options_.notSupportedMessage)});},0),void i.triggerReady());a=r,s=i.tech_,a.forEach(function(e){return e.setTech&&e.setTech(s);});}),this.options_.retryOnError&&n.length>1){var r=function r(){i.error(null),i.handleSrc_(n.slice(1),!0);},a=function a(){i.off("error",r);};this.one("error",r),this.one("playing",a),this.resetRetryOnError_=function(){i.off("error",r),i.off("playing",a);};}}else this.setTimeout(function(){this.error({code:4,message:this.localize(this.options_.notSupportedMessage)});},0);},i.src=function(e){return this.handleSrc_(e,!1);},i.src_=function(e){var t,i,n=this,r=this.selectSource([e]);return!r||(t=r.tech,i=this.techName_,Ht(t)!==Ht(i)?(this.changingSrc_=!0,this.loadTech_(r.tech,r.source),this.tech_.ready(function(){n.changingSrc_=!1;}),!1):(this.ready(function(){this.tech_.constructor.prototype.hasOwnProperty("setSource")?this.techCall_("setSource",e):this.techCall_("src",e.src),this.changingSrc_=!1;},!0),!1));},i.load=function(){this.techCall_("load");},i.reset=function(){var e=this,t=this.options_.Promise||A["default"].Promise;this.paused()||!t?this.doReset_():ii(this.play().then(function(){return e.doReset_();}));},i.doReset_=function(){this.tech_&&this.tech_.clearTracks("text"),this.resetCache_(),this.poster(""),this.loadTech_(this.options_.techOrder[0],null),this.techCall_("reset"),this.resetControlBarUI_(),Pt(this)&&this.trigger("playerreset");},i.resetControlBarUI_=function(){this.resetProgressBar_(),this.resetPlaybackRate_(),this.resetVolumeBar_();},i.resetProgressBar_=function(){this.currentTime(0);var e=this.controlBar,t=e.durationDisplay,i=e.remainingTimeDisplay;t&&t.updateContent(),i&&i.updateContent();},i.resetPlaybackRate_=function(){this.playbackRate(this.defaultPlaybackRate()),this.handleTechRateChange_();},i.resetVolumeBar_=function(){this.volume(1),this.trigger("volumechange");},i.currentSources=function(){var e=this.currentSource(),t=[];return 0!==Object.keys(e).length&&t.push(e),this.cache_.sources||t;},i.currentSource=function(){return this.cache_.source||{};},i.currentSrc=function(){return this.currentSource()&&this.currentSource().src||"";},i.currentType=function(){return this.currentSource()&&this.currentSource().type||"";},i.preload=function(e){return void 0!==e?(this.techCall_("setPreload",e),void(this.options_.preload=e)):this.techGet_("preload");},i.autoplay=function(e){if(void 0===e)return this.options_.autoplay||!1;var t;"string"==typeof e&&/(any|play|muted)/.test(e)||!0===e&&this.options_.normalizeAutoplay?(this.options_.autoplay=e,this.manualAutoplay_("string"==typeof e?e:"play"),t=!1):this.options_.autoplay=!!e,t=void 0===t?this.options_.autoplay:t,this.tech_&&this.techCall_("setAutoplay",t);},i.playsinline=function(e){return void 0!==e?(this.techCall_("setPlaysinline",e),this.options_.playsinline=e,this):this.techGet_("playsinline");},i.loop=function(e){return void 0!==e?(this.techCall_("setLoop",e),void(this.options_.loop=e)):this.techGet_("loop");},i.poster=function(e){if(void 0===e)return this.poster_;e||(e=""),e!==this.poster_&&(this.poster_=e,this.techCall_("setPoster",e),this.isPosterFromTech_=!1,this.trigger("posterchange"));},i.handleTechPosterChange_=function(){if((!this.poster_||this.options_.techCanOverridePoster)&&this.tech_&&this.tech_.poster){var e=this.tech_.poster()||"";e!==this.poster_&&(this.poster_=e,this.isPosterFromTech_=!0,this.trigger("posterchange"));}},i.controls=function(e){if(void 0===e)return!!this.controls_;e=!!e,this.controls_!==e&&(this.controls_=e,this.usingNativeControls()&&this.techCall_("setControls",e),this.controls_?(this.removeClass("vjs-controls-disabled"),this.addClass("vjs-controls-enabled"),this.trigger("controlsenabled"),this.usingNativeControls()||this.addTechControlsListeners_()):(this.removeClass("vjs-controls-enabled"),this.addClass("vjs-controls-disabled"),this.trigger("controlsdisabled"),this.usingNativeControls()||this.removeTechControlsListeners_()));},i.usingNativeControls=function(e){if(void 0===e)return!!this.usingNativeControls_;e=!!e,this.usingNativeControls_!==e&&(this.usingNativeControls_=e,this.usingNativeControls_?(this.addClass("vjs-using-native-controls"),this.trigger("usingnativecontrols")):(this.removeClass("vjs-using-native-controls"),this.trigger("usingcustomcontrols")));},i.error=function(e){var t=this;if(void 0===e)return this.error_||null;if(j("beforeerror").forEach(function(i){var n=i(t,e);ee(n)&&!Array.isArray(n)||"string"==typeof n||"number"==typeof n||null===n?e=n:t.log.error("please return a value that MediaError expects in beforeerror hooks");}),this.options_.suppressNotSupportedError&&e&&4===e.code){var i=function i(){this.error(e);};return this.options_.suppressNotSupportedError=!1,this.any(["click","touchstart"],i),void this.one("loadstart",function(){this.off(["click","touchstart"],i);});}if(null===e)return this.error_=e,this.removeClass("vjs-error"),void(this.errorDisplay&&this.errorDisplay.close());this.error_=new Zt(e),this.addClass("vjs-error"),K.error("(CODE:"+this.error_.code+" "+Zt.errorTypes[this.error_.code]+")",this.error_.message,this.error_),this.trigger("error"),j("error").forEach(function(e){return e(t,t.error_);});},i.reportUserActivity=function(e){this.userActivity_=!0;},i.userActive=function(e){if(void 0===e)return this.userActive_;if((e=!!e)!==this.userActive_){if(this.userActive_=e,this.userActive_)return this.userActivity_=!0,this.removeClass("vjs-user-inactive"),this.addClass("vjs-user-active"),void this.trigger("useractive");this.tech_&&this.tech_.one("mousemove",function(e){e.stopPropagation(),e.preventDefault();}),this.userActivity_=!1,this.removeClass("vjs-user-active"),this.addClass("vjs-user-inactive"),this.trigger("userinactive");}},i.listenForUserActivity_=function(){var e,t,i,n=At(this,this.reportUserActivity),r=function r(t){n(),this.clearInterval(e);};this.on("mousedown",function(){n(),this.clearInterval(e),e=this.setInterval(n,250);}),this.on("mousemove",function(e){e.screenX===t&&e.screenY===i||(t=e.screenX,i=e.screenY,n());}),this.on("mouseup",r),this.on("mouseleave",r);var a,s=this.getChild("controlBar");!s||Se||le||(s.on("mouseenter",function(e){0!==this.player().options_.inactivityTimeout&&(this.player().cache_.inactivityTimeout=this.player().options_.inactivityTimeout),this.player().options_.inactivityTimeout=0;}),s.on("mouseleave",function(e){this.player().options_.inactivityTimeout=this.player().cache_.inactivityTimeout;})),this.on("keydown",n),this.on("keyup",n),this.setInterval(function(){if(this.userActivity_){this.userActivity_=!1,this.userActive(!0),this.clearTimeout(a);var e=this.options_.inactivityTimeout;e<=0||(a=this.setTimeout(function(){this.userActivity_||this.userActive(!1);},e));}},250);},i.playbackRate=function(e){if(void 0===e)return this.tech_&&this.tech_.featuresPlaybackRate?this.cache_.lastPlaybackRate||this.techGet_("playbackRate"):1;this.techCall_("setPlaybackRate",e);},i.defaultPlaybackRate=function(e){return void 0!==e?this.techCall_("setDefaultPlaybackRate",e):this.tech_&&this.tech_.featuresPlaybackRate?this.techGet_("defaultPlaybackRate"):1;},i.isAudio=function(e){if(void 0===e)return!!this.isAudio_;this.isAudio_=!!e;},i.addTextTrack=function(e,t,i){if(this.tech_)return this.tech_.addTextTrack(e,t,i);},i.addRemoteTextTrack=function(e,t){if(this.tech_)return this.tech_.addRemoteTextTrack(e,t);},i.removeRemoteTextTrack=function(e){void 0===e&&(e={});var t=e.track;if(t||(t=e),this.tech_)return this.tech_.removeRemoteTextTrack(t);},i.getVideoPlaybackQuality=function(){return this.techGet_("getVideoPlaybackQuality");},i.videoWidth=function(){return this.tech_&&this.tech_.videoWidth&&this.tech_.videoWidth()||0;},i.videoHeight=function(){return this.tech_&&this.tech_.videoHeight&&this.tech_.videoHeight()||0;},i.language=function(e){if(void 0===e)return this.language_;this.language_!==String(e).toLowerCase()&&(this.language_=String(e).toLowerCase(),Pt(this)&&this.trigger("languagechange"));},i.languages=function(){return zt(t.prototype.options_.languages,this.languages_);},i.toJSON=function(){var e=zt(this.options_),t=e.tracks;e.tracks=[];for(var i=0;i"):function(){};},Jr=function Jr(e,t){var i,n=[];if(e&&e.length)for(i=0;i=t;});},ea=function ea(e,t){return Jr(e,function(e){return e-1/30>=t;});},ta=function ta(e){var t=[];if(!e||!e.length)return"";for(var i=0;i "+e.end(i));}return t.join(", ");},ia=function ia(e){for(var t=[],i=0;i0;return i&&t.serverControl&&t.serverControl.partHoldBack?t.serverControl.partHoldBack:i&&t.partTargetDuration?3*t.partTargetDuration:t.serverControl&&t.serverControl.holdBack?t.serverControl.holdBack:t.targetDuration?3*t.targetDuration:0;},la=function la(e,t,i){if(void 0===t&&(t=e.mediaSequence+e.segments.length),tr){var s=[r,n];n=s[0],r=s[1];}if(n<0){for(var o=n;oDate.now();},pa=function pa(e){return e.excludeUntil&&e.excludeUntil===1/0;},ma=function ma(e){var t=fa(e);return!e.disabled&&!t;},ga=function ga(e,t){return t.attributes&&t.attributes[e];},_a=function _a(e,t){if(1===e.playlists.length)return!0;var i=t.attributes.BANDWIDTH||Number.MAX_VALUE;return 0===e.playlists.filter(function(e){return!!ma(e)&&(e.attributes.BANDWIDTH||0)0)for(var c=l-1;c>=0;c--){var f=u[c];if(o+=f.duration,s){if(o<0)continue;}else if(o+1/30<=0)continue;return{partIndex:f.partIndex,segmentIndex:f.segmentIndex,startTime:a-ha({defaultDuration:t.targetDuration,durationList:u,startIndex:l,endIndex:c})};}return{partIndex:u[0]&&u[0].partIndex||null,segmentIndex:u[0]&&u[0].segmentIndex||0,startTime:i};}if(l<0){for(var p=l;p<0;p++){if((o-=t.targetDuration)<0)return{partIndex:u[0]&&u[0].partIndex||null,segmentIndex:u[0]&&u[0].segmentIndex||0,startTime:i};}l=0;}for(var m=l;m0)continue;}else if(o-1/30>=0)continue;return{partIndex:g.partIndex,segmentIndex:g.segmentIndex,startTime:a+ha({defaultDuration:t.targetDuration,durationList:u,startIndex:l,endIndex:m})};}return{segmentIndex:u[u.length-1].segmentIndex,partIndex:u[u.length-1].partIndex,startTime:i};},isEnabled:ma,isDisabled:function isDisabled(e){return e.disabled;},isBlacklisted:fa,isIncompatible:pa,playlistEnd:ca,isAes:function isAes(e){for(var t=0;t-1&&s!==a.length-1&&i.push("_HLS_part="+s),(s>-1||a.length)&&r--;}i.unshift("_HLS_msn="+r);}return t.serverControl&&t.serverControl.canSkipUntil&&i.unshift("_HLS_skip="+(t.serverControl.canSkipDateranges?"v2":"YES")),i.forEach(function(t,i){e+=""+(0===i?"?":"&")+t;}),e;}(i,t)),this.state="HAVE_CURRENT_METADATA",this.request=this.vhs_.xhr({uri:i,withCredentials:this.withCredentials},function(t,i){if(e.request)return t?e.playlistRequestError(e.request,e.media(),"HAVE_METADATA"):void e.haveMetadata({playlistString:e.request.responseText,url:e.media().uri,id:e.media().id});});}},i.playlistRequestError=function(e,t,i){var n=t.uri,r=t.id;this.request=null,i&&(this.state=i),this.error={playlist:this.master.playlists[r],status:e.status,message:"HLS playlist request error at URL: "+n+".",responseText:e.responseText,code:e.status>=500?4:2},this.trigger("error");},i.parseManifest_=function(e){var t=this,i=e.url;return function(e){var t=e.onwarn,i=e.oninfo,n=e.manifestString,r=e.customTagParsers,a=void 0===r?[]:r,s=e.customTagMappers,o=void 0===s?[]:s,u=e.experimentalLLHLS,l=new m.Parser();t&&l.on("warn",t),i&&l.on("info",i),a.forEach(function(e){return l.addParser(e);}),o.forEach(function(e){return l.addTagMapper(e);}),l.push(n),l.end();var d=l.manifest;if(u||(["preloadSegment","skip","serverControl","renditionReports","partInf","partTargetDuration"].forEach(function(e){d.hasOwnProperty(e)&&delete d[e];}),d.segments&&d.segments.forEach(function(e){["parts","preloadHints"].forEach(function(t){e.hasOwnProperty(t)&&delete e[t];});})),!d.targetDuration){var h=10;d.segments&&d.segments.length&&(h=d.segments.reduce(function(e,t){return Math.max(e,t.duration);},0)),t&&t("manifest has no targetDuration defaulting to "+h),d.targetDuration=h;}var c=sa(d);if(c.length&&!d.partTargetDuration){var f=c.reduce(function(e,t){return Math.max(e,t.duration);},0);t&&(t("manifest has no partTargetDuration defaulting to "+f),Sa.error("LL-HLS manifest has parts but lacks required #EXT-X-PART-INF:PART-TARGET value. See https://datatracker.ietf.org/doc/html/draft-pantos-hls-rfc8216bis-09#section-4.4.3.7. Playback is not guaranteed.")),d.partTargetDuration=f;}return d;}({onwarn:function onwarn(e){var n=e.message;return t.logger_("m3u8-parser warn for "+i+": "+n);},oninfo:function oninfo(e){var n=e.message;return t.logger_("m3u8-parser info for "+i+": "+n);},manifestString:e.manifestString,customTagParsers:this.customTagParsers,customTagMappers:this.customTagMappers,experimentalLLHLS:this.experimentalLLHLS});},i.haveMetadata=function(e){var t=e.playlistString,i=e.playlistObject,n=e.url,r=e.id;this.request=null,this.state="HAVE_METADATA";var a=i||this.parseManifest_({url:n,manifestString:t});a.lastRequest=Date.now(),Ca({playlist:a,uri:n,id:r});var s=Ua(this.master,a);this.targetDuration=a.partTargetDuration||a.targetDuration,s?(this.master=s,this.media_=this.master.playlists[r]):this.trigger("playlistunchanged"),this.updateMediaUpdateTimeout_(Ra(this.media(),!!s)),this.trigger("loadedplaylist");},i.dispose=function(){this.trigger("dispose"),this.stopRequest(),A["default"].clearTimeout(this.mediaUpdateTimeout),A["default"].clearTimeout(this.finalRenditionTimeout),this.off();},i.stopRequest=function(){if(this.request){var e=this.request;this.request=null,e.onreadystatechange=null,e.abort();}},i.media=function(e,t){var i=this;if(!e)return this.media_;if("HAVE_NOTHING"===this.state)throw new Error("Cannot switch media playlist from "+this.state);if("string"==typeof e){if(!this.master.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.master.playlists[e];}if(A["default"].clearTimeout(this.finalRenditionTimeout),t){var n=(e.partTargetDuration||e.targetDuration)/2*1e3||5e3;this.finalRenditionTimeout=A["default"].setTimeout(this.media.bind(this,e,!1),n);}else{var r=this.state,a=!this.media_||e.id!==this.media_.id,s=this.master.playlists[e.id];if(s&&s.endList||e.endList&&e.segments.length)return this.request&&(this.request.onreadystatechange=null,this.request.abort(),this.request=null),this.state="HAVE_METADATA",this.media_=e,void(a&&(this.trigger("mediachanging"),"HAVE_MASTER"===r?this.trigger("loadedmetadata"):this.trigger("mediachange")));if(this.updateMediaUpdateTimeout_(Ra(e,!0)),a){if(this.state="SWITCHING_MEDIA",this.request){if(e.resolvedUri===this.request.url)return;this.request.onreadystatechange=null,this.request.abort(),this.request=null;}this.media_&&this.trigger("mediachanging"),this.request=this.vhs_.xhr({uri:e.resolvedUri,withCredentials:this.withCredentials},function(t,n){if(i.request){if(e.lastRequest=Date.now(),e.resolvedUri=Qr(i.handleManifestRedirects,e.resolvedUri,n),t)return i.playlistRequestError(i.request,e,r);i.haveMetadata({playlistString:n.responseText,url:e.uri,id:e.id}),"HAVE_MASTER"===r?i.trigger("loadedmetadata"):i.trigger("mediachange");}});}}},i.pause=function(){this.mediaUpdateTimeout&&(A["default"].clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),this.stopRequest(),"HAVE_NOTHING"===this.state&&(this.started=!1),"SWITCHING_MEDIA"===this.state?this.media_?this.state="HAVE_METADATA":this.state="HAVE_MASTER":"HAVE_CURRENT_METADATA"===this.state&&(this.state="HAVE_METADATA");},i.load=function(e){var t=this;this.mediaUpdateTimeout&&(A["default"].clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null);var i=this.media();if(e){var n=i?(i.partTargetDuration||i.targetDuration)/2*1e3:5e3;this.mediaUpdateTimeout=A["default"].setTimeout(function(){t.mediaUpdateTimeout=null,t.load();},n);}else this.started?i&&!i.endList?this.trigger("mediaupdatetimeout"):this.trigger("loadedplaylist"):this.start();},i.updateMediaUpdateTimeout_=function(e){var t=this;this.mediaUpdateTimeout&&(A["default"].clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),this.media()&&!this.media().endList&&(this.mediaUpdateTimeout=A["default"].setTimeout(function(){t.mediaUpdateTimeout=null,t.trigger("mediaupdatetimeout"),t.updateMediaUpdateTimeout_(e);},e));},i.start=function(){var e=this;if(this.started=!0,"object"==_typeof(this.src))return this.src.uri||(this.src.uri=A["default"].location.href),this.src.resolvedUri=this.src.uri,void setTimeout(function(){e.setupInitialPlaylist(e.src);},0);this.request=this.vhs_.xhr({uri:this.src,withCredentials:this.withCredentials},function(t,i){if(e.request){if(e.request=null,t)return e.error={status:i.status,message:"HLS playlist request error at URL: "+e.src+".",responseText:i.responseText,code:2},"HAVE_NOTHING"===e.state&&(e.started=!1),e.trigger("error");e.src=Qr(e.handleManifestRedirects,e.src,i);var n=e.parseManifest_({manifestString:i.responseText,url:e.src});e.setupInitialPlaylist(n);}});},i.srcUri=function(){return"string"==typeof this.src?this.src:this.src.uri;},i.setupInitialPlaylist=function(e){if(this.state="HAVE_MASTER",e.playlists)return this.master=e,Aa(this.master,this.srcUri()),e.playlists.forEach(function(e){e.segments=La(e),e.segments.forEach(function(t){Pa(t,e.resolvedUri);});}),this.trigger("loadedplaylist"),void(this.request||this.media(this.master.playlists[0]));var t=this.srcUri()||A["default"].location.href;this.master=function(e,t){var i=Ea(0,t),n={mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:A["default"].location.href,resolvedUri:A["default"].location.href,playlists:[{uri:t,id:i,resolvedUri:t,attributes:{}}]};return n.playlists[i]=n.playlists[0],n.playlists[t]=n.playlists[0],n;}(0,t),this.haveMetadata({playlistObject:e,url:t,id:this.master.playlists[0].id}),this.trigger("loadedmetadata");},t;}(xa),Ma=Yr.xhr,Fa=Yr.mergeOptions,Ba=function Ba(e,t,i,n){var r="arraybuffer"===e.responseType?e.response:e.responseText;!t&&r&&(e.responseTime=Date.now(),e.roundTripTime=e.responseTime-e.requestTime,e.bytesReceived=r.byteLength||r.length,e.bandwidth||(e.bandwidth=Math.floor(e.bytesReceived/e.roundTripTime*8*1e3))),i.headers&&(e.responseHeaders=i.headers),t&&"ETIMEDOUT"===t.code&&(e.timedout=!0),t||e.aborted||200===i.statusCode||206===i.statusCode||0===i.statusCode||(t=new Error("XHR Failed with a response of: "+(e&&(r||e.responseText)))),n(t,e);},Na=function Na(){var e=function e(t,i){t=Fa({timeout:45e3},t);var n=e.beforeRequest||Yr.Vhs.xhr.beforeRequest;if(n&&"function"==typeof n){var r=n(t);r&&(t=r);}var a=(!0===Yr.Vhs.xhr.original?Ma:Yr.Vhs.xhr)(t,function(e,t){return Ba(a,e,t,i);}),s=a.abort;return a.abort=function(){return a.aborted=!0,s.apply(a,arguments);},a.uri=t.uri,a.requestTime=Date.now(),a;};return e.original=!0,e;},ja=function ja(e){var t,i,n={};return e.byterange&&(n.Range=(t=e.byterange,i=t.offset+t.length-1,"bytes="+t.offset+"-"+i)),n;},Va=function Va(e,t){return e.start(t)+"-"+e.end(t);},Ha=function Ha(e,t){var i=e.toString(16);return"00".substring(0,2-i.length)+i+(t%2?" ":"");},za=function za(e){return e>=32&&e<126?String.fromCharCode(e):".";},Ga=function Ga(e){var t={};return Object.keys(e).forEach(function(i){var n=e[i];ArrayBuffer.isView(n)?t[i]={bytes:n.buffer,byteOffset:n.byteOffset,byteLength:n.byteLength}:t[i]=n;}),t;},Wa=function Wa(e){var t=e.byterange||{length:1/0,offset:0};return[t.length,t.offset,e.resolvedUri].join(",");},Ya=function Ya(e){return e.resolvedUri;},qa=function qa(e){for(var t=Array.prototype.slice.call(e),i="",n=0;nn){if(e>n+.25*a.duration)return null;i=a;}return{segment:i,estimatedStart:i.videoTimingInfo?i.videoTimingInfo.transmuxedPresentationStart:n-i.duration,type:i.videoTimingInfo?"accurate":"estimate"};}(n,t);if(!a)return r({message:"valid programTime was not found"});if("estimate"===a.type)return r({message:"Accurate programTime could not be determined. Please seek to e.seekTime and try again",seekTime:a.estimatedStart});var s={mediaSeconds:n},o=function(e,t){if(!t.dateTimeObject)return null;var i=t.videoTimingInfo.transmuxerPrependedSeconds,n=e-(t.videoTimingInfo.transmuxedPresentationStart+i);return new Date(t.dateTimeObject.getTime()+1e3*n);}(n,a.segment);return o&&(s.programDateTime=o.toISOString()),r(null,s);},Qa=function e(t){var i=t.programTime,n=t.playlist,r=t.retryCount,a=void 0===r?2:r,s=t.seekTo,o=t.pauseAfterSeek,u=void 0===o||o,l=t.tech,d=t.callback;if(!d)throw new Error("seekToProgramTime: callback must be provided");if(void 0===i||!n||!s)return d({message:"seekToProgramTime: programTime, seekTo and playlist must be provided"});if(!n.endList&&!l.hasStarted_)return d({message:"player must be playing a live stream to start buffering"});if(!function(e){if(!e.segments||0===e.segments.length)return!1;for(var t=0;tnew Date(o.getTime()+1e3*u)?null:(i>o&&(n=s),{segment:n,estimatedStart:n.videoTimingInfo?n.videoTimingInfo.transmuxedPresentationStart:Ta.duration(t,t.mediaSequence+t.segments.indexOf(n)),type:n.videoTimingInfo?"accurate":"estimate"});}(i,n);if(!h)return d({message:i+" was not found in the stream"});var c=h.segment,f=function(e,t){var i,n;try{i=new Date(e),n=new Date(t);}catch(e){}var r=i.getTime();return(n.getTime()-r)/1e3;}(c.dateTimeObject,i);if("estimate"===h.type)return 0===a?d({message:i+" is not buffered yet. Try again"}):(s(h.estimatedStart+f),void l.one("seeked",function(){e({programTime:i,playlist:n,retryCount:a-1,seekTo:s,pauseAfterSeek:u,tech:l,callback:d});}));var p=c.start+f;l.one("seeked",function(){return d(null,l.currentTime());}),u&&l.pause(),s(p);},$a=function $a(e,t){if(4===e.readyState)return t();},Ja=Yr.EventTarget,Za=Yr.mergeOptions,es=function es(e,t){if(!Da(e,t))return!1;if(e.sidx&&t.sidx&&(e.sidx.offset!==t.sidx.offset||e.sidx.length!==t.sidx.length))return!1;if(!e.sidx&&t.sidx||e.sidx&&!t.sidx)return!1;if(e.segments&&!t.segments||!e.segments&&t.segments)return!1;if(!e.segments&&!t.segments)return!0;for(var i=0;i=d+l)return s(t,{response:o.subarray(l,l+d),status:i.status,uri:i.uri});n.request=n.vhs_.xhr({uri:a,responseType:"arraybuffer",headers:ja({byterange:e.sidx.byterange})},s);});}else this.mediaRequest_=A["default"].setTimeout(function(){return i(!1);},0);},i.dispose=function(){this.trigger("dispose"),this.stopRequest(),this.loadedPlaylists_={},A["default"].clearTimeout(this.minimumUpdatePeriodTimeout_),A["default"].clearTimeout(this.mediaRequest_),A["default"].clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.mediaRequest_=null,this.minimumUpdatePeriodTimeout_=null,this.masterPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.masterPlaylistLoader_.createMupOnMedia_),this.masterPlaylistLoader_.createMupOnMedia_=null),this.off();},i.hasPendingRequest=function(){return this.request||this.mediaRequest_;},i.stopRequest=function(){if(this.request){var e=this.request;this.request=null,e.onreadystatechange=null,e.abort();}},i.media=function(e){var t=this;if(!e)return this.media_;if("HAVE_NOTHING"===this.state)throw new Error("Cannot switch media playlist from "+this.state);var i=this.state;if("string"==typeof e){if(!this.masterPlaylistLoader_.master.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.masterPlaylistLoader_.master.playlists[e];}var n=!this.media_||e.id!==this.media_.id;if(n&&this.loadedPlaylists_[e.id]&&this.loadedPlaylists_[e.id].endList)return this.state="HAVE_METADATA",this.media_=e,void(n&&(this.trigger("mediachanging"),this.trigger("mediachange")));n&&(this.media_&&this.trigger("mediachanging"),this.addSidxSegments_(e,i,function(n){t.haveMetadata({startingState:i,playlist:e});}));},i.haveMetadata=function(e){var t=e.startingState,i=e.playlist;this.state="HAVE_METADATA",this.loadedPlaylists_[i.id]=i,this.mediaRequest_=null,this.refreshMedia_(i.id),"HAVE_MASTER"===t?this.trigger("loadedmetadata"):this.trigger("mediachange");},i.pause=function(){this.masterPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.masterPlaylistLoader_.createMupOnMedia_),this.masterPlaylistLoader_.createMupOnMedia_=null),this.stopRequest(),A["default"].clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.isMaster_&&(A["default"].clearTimeout(this.masterPlaylistLoader_.minimumUpdatePeriodTimeout_),this.masterPlaylistLoader_.minimumUpdatePeriodTimeout_=null),"HAVE_NOTHING"===this.state&&(this.started=!1);},i.load=function(e){var t=this;A["default"].clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null;var i=this.media();if(e){var n=i?i.targetDuration/2*1e3:5e3;this.mediaUpdateTimeout=A["default"].setTimeout(function(){return t.load();},n);}else this.started?i&&!i.endList?(this.isMaster_&&!this.minimumUpdatePeriodTimeout_&&(this.trigger("minimumUpdatePeriod"),this.updateMinimumUpdatePeriodTimeout_()),this.trigger("mediaupdatetimeout")):this.trigger("loadedplaylist"):this.start();},i.start=function(){var e=this;this.started=!0,this.isMaster_?this.requestMaster_(function(t,i){e.haveMaster_(),e.hasPendingRequest()||e.media_||e.media(e.masterPlaylistLoader_.master.playlists[0]);}):this.mediaRequest_=A["default"].setTimeout(function(){return e.haveMaster_();},0);},i.requestMaster_=function(e){var t=this;this.request=this.vhs_.xhr({uri:this.masterPlaylistLoader_.srcUrl,withCredentials:this.withCredentials},function(i,n){if(!t.requestErrored_(i,n)){var r=n.responseText!==t.masterPlaylistLoader_.masterXml_;return t.masterPlaylistLoader_.masterXml_=n.responseText,n.responseHeaders&&n.responseHeaders.date?t.masterLoaded_=Date.parse(n.responseHeaders.date):t.masterLoaded_=Date.now(),t.masterPlaylistLoader_.srcUrl=Qr(t.handleManifestRedirects,t.masterPlaylistLoader_.srcUrl,n),r?(t.handleMaster_(),void t.syncClientServerClock_(function(){return e(n,r);})):e(n,r);}"HAVE_NOTHING"===t.state&&(t.started=!1);});},i.syncClientServerClock_=function(e){var t=this,i=y.parseUTCTiming(this.masterPlaylistLoader_.masterXml_);return null===i?(this.masterPlaylistLoader_.clientOffset_=this.masterLoaded_-Date.now(),e()):"DIRECT"===i.method?(this.masterPlaylistLoader_.clientOffset_=i.value-Date.now(),e()):void(this.request=this.vhs_.xhr({uri:Xr(this.masterPlaylistLoader_.srcUrl,i.value),method:i.method,withCredentials:this.withCredentials},function(n,r){if(t.request){if(n)return t.masterPlaylistLoader_.clientOffset_=t.masterLoaded_-Date.now(),e();var a;a="HEAD"===i.method?r.responseHeaders&&r.responseHeaders.date?Date.parse(r.responseHeaders.date):t.masterLoaded_:Date.parse(r.responseText),t.masterPlaylistLoader_.clientOffset_=a-Date.now(),e();}}));},i.haveMaster_=function(){this.state="HAVE_MASTER",this.isMaster_?this.trigger("loadedplaylist"):this.media_||this.media(this.childPlaylist_);},i.handleMaster_=function(){this.mediaRequest_=null;var e,t,i,n,r,a,s=(e={masterXml:this.masterPlaylistLoader_.masterXml_,srcUrl:this.masterPlaylistLoader_.srcUrl,clientOffset:this.masterPlaylistLoader_.clientOffset_,sidxMapping:this.masterPlaylistLoader_.sidxMapping_},t=e.masterXml,i=e.srcUrl,n=e.clientOffset,r=e.sidxMapping,a=y.parse(t,{manifestUri:i,clientOffset:n,sidxMapping:r}),Aa(a,i),a),o=this.masterPlaylistLoader_.master;o&&(s=function(e,t,i){for(var n=!0,r=Za(e,{duration:t.duration,minimumUpdatePeriod:t.minimumUpdatePeriod}),a=0;a-1);},this.trigger=function(t){var i,n,r,a;if(i=e[t])if(2===arguments.length)for(r=i.length,n=0;n>>1,e.samplingfrequencyindex<<7|e.channelcount<<3,6,1,2]));},m=function m(e){return t(S.hdlr,x[e]);},p=function p(e){var i=new Uint8Array([0,0,0,0,0,0,0,2,0,0,0,3,0,1,95,144,e.duration>>>24&255,e.duration>>>16&255,e.duration>>>8&255,255&e.duration,85,196,0,0]);return e.samplerate&&(i[12]=e.samplerate>>>24&255,i[13]=e.samplerate>>>16&255,i[14]=e.samplerate>>>8&255,i[15]=255&e.samplerate),t(S.mdhd,i);},f=function f(e){return t(S.mdia,p(e),m(e.type),s(e));},a=function a(e){return t(S.mfhd,new Uint8Array([0,0,0,0,(4278190080&e)>>24,(16711680&e)>>16,(65280&e)>>8,255&e]));},s=function s(e){return t(S.minf,"video"===e.type?t(S.vmhd,I):t(S.smhd,P),i(),_(e));},o=function o(e,i){for(var n=[],r=i.length;r--;){n[r]=v(i[r]);}return t.apply(null,[S.moof,a(e)].concat(n));},u=function u(e){for(var i=e.length,n=[];i--;){n[i]=h(e[i]);}return t.apply(null,[S.moov,d(4294967295)].concat(n).concat(l(e)));},l=function l(e){for(var i=e.length,n=[];i--;){n[i]=b(e[i]);}return t.apply(null,[S.mvex].concat(n));},d=function d(e){var i=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,2,0,1,95,144,(4278190080&e)>>24,(16711680&e)>>16,(65280&e)>>8,255&e,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 t(S.mvhd,i);},g=function g(e){var i,n,r=e.samples||[],a=new Uint8Array(4+r.length);for(n=0;n>>8),s.push(255&r[i].byteLength),s=s.concat(Array.prototype.slice.call(r[i]));}for(i=0;i>>8),o.push(255&a[i].byteLength),o=o.concat(Array.prototype.slice.call(a[i]));}if(n=[S.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&e.width)>>8,255&e.width,(65280&e.height)>>8,255&e.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]),t(S.avcC,new Uint8Array([1,e.profileIdc,e.profileCompatibility,e.levelIdc,255].concat([r.length],s,[a.length],o))),t(S.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192]))],e.sarRatio){var u=e.sarRatio[0],l=e.sarRatio[1];n.push(t(S.pasp,new Uint8Array([(4278190080&u)>>24,(16711680&u)>>16,(65280&u)>>8,255&u,(4278190080&l)>>24,(16711680&l)>>16,(65280&l)>>8,255&l])));}return t.apply(null,n);},F=function F(e){return t(S.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,(65280&e.channelcount)>>8,255&e.channelcount,(65280&e.samplesize)>>8,255&e.samplesize,0,0,0,0,(65280&e.samplerate)>>8,255&e.samplerate,0,0]),n(e));},c=function c(e){var i=new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,(4278190080&e.id)>>24,(16711680&e.id)>>16,(65280&e.id)>>8,255&e.id,0,0,0,0,(4278190080&e.duration)>>24,(16711680&e.duration)>>16,(65280&e.duration)>>8,255&e.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&e.width)>>8,255&e.width,0,0,(65280&e.height)>>8,255&e.height,0,0]);return t(S.tkhd,i);},v=function v(e){var i,n,r,a,s,o;return i=t(S.tfhd,new Uint8Array([0,0,0,58,(4278190080&e.id)>>24,(16711680&e.id)>>16,(65280&e.id)>>8,255&e.id,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0])),s=Math.floor(e.baseMediaDecodeTime/(H+1)),o=Math.floor(e.baseMediaDecodeTime%(H+1)),n=t(S.tfdt,new Uint8Array([1,0,0,0,s>>>24&255,s>>>16&255,s>>>8&255,255&s,o>>>24&255,o>>>16&255,o>>>8&255,255&o])),92,"audio"===e.type?(r=T(e,92),t(S.traf,i,n,r)):(a=g(e),r=T(e,a.length+92),t(S.traf,i,n,r,a));},h=function h(e){return e.duration=e.duration||4294967295,t(S.trak,c(e),f(e));},b=function b(e){var i=new Uint8Array([0,0,0,0,(4278190080&e.id)>>24,(16711680&e.id)>>16,(65280&e.id)>>8,255&e.id,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return"video"!==e.type&&(i[i.length-1]=0),t(S.trex,i);},j=function j(e,t){var i=0,n=0,r=0,a=0;return e.length&&(void 0!==e[0].duration&&(i=1),void 0!==e[0].size&&(n=2),void 0!==e[0].flags&&(r=4),void 0!==e[0].compositionTimeOffset&&(a=8)),[0,0,i|n|r|a,1,(4278190080&e.length)>>>24,(16711680&e.length)>>>16,(65280&e.length)>>>8,255&e.length,(4278190080&t)>>>24,(16711680&t)>>>16,(65280&t)>>>8,255&t];},N=function N(e,i){var n,r,a,s,o,u;for(i+=20+16*(s=e.samples||[]).length,a=j(s,i),(r=new Uint8Array(a.length+16*s.length)).set(a),n=a.length,u=0;u>>24,r[n++]=(16711680&o.duration)>>>16,r[n++]=(65280&o.duration)>>>8,r[n++]=255&o.duration,r[n++]=(4278190080&o.size)>>>24,r[n++]=(16711680&o.size)>>>16,r[n++]=(65280&o.size)>>>8,r[n++]=255&o.size,r[n++]=o.flags.isLeading<<2|o.flags.dependsOn,r[n++]=o.flags.isDependedOn<<6|o.flags.hasRedundancy<<4|o.flags.paddingValue<<1|o.flags.isNonSyncSample,r[n++]=61440&o.flags.degradationPriority,r[n++]=15&o.flags.degradationPriority,r[n++]=(4278190080&o.compositionTimeOffset)>>>24,r[n++]=(16711680&o.compositionTimeOffset)>>>16,r[n++]=(65280&o.compositionTimeOffset)>>>8,r[n++]=255&o.compositionTimeOffset;}return t(S.trun,r);},B=function B(e,i){var n,r,a,s,o,u;for(i+=20+8*(s=e.samples||[]).length,a=j(s,i),(n=new Uint8Array(a.length+8*s.length)).set(a),r=a.length,u=0;u>>24,n[r++]=(16711680&o.duration)>>>16,n[r++]=(65280&o.duration)>>>8,n[r++]=255&o.duration,n[r++]=(4278190080&o.size)>>>24,n[r++]=(16711680&o.size)>>>16,n[r++]=(65280&o.size)>>>8,n[r++]=255&o.size;}return t(S.trun,n);},T=function T(e,t){return"audio"===e.type?B(e,t):N(e,t);};r=function r(){return t(S.ftyp,E,w,E,C);};var z,G,W,Y,q,K,X,Q,$=function $(e){return t(S.mdat,e);},J=o,Z=function Z(e){var t,i=r(),n=u(e);return(t=new Uint8Array(i.byteLength+n.byteLength)).set(i),t.set(n,i.byteLength),t;},ee=function ee(e,t){var i={size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0,isNonSyncSample:1}};return i.dataOffset=t,i.compositionTimeOffset=e.pts-e.dts,i.duration=e.duration,i.size=4*e.length,i.size+=e.byteLength,e.keyFrame&&(i.flags.dependsOn=2,i.flags.isNonSyncSample=0),i;},te=function te(e){var t,i,n=[],r=[];for(r.byteLength=0,r.nalCount=0,r.duration=0,n.byteLength=0,t=0;t1&&(t=e.shift(),e.byteLength-=t.byteLength,e.nalCount-=t.nalCount,e[0][0].dts=t.dts,e[0][0].pts=t.pts,e[0][0].duration+=t.duration),e;},re=function re(e,t){var i,n,r,a,s,o=t||0,u=[];for(i=0;ide/2))){for((s=le()[e.samplerate])||(s=t[0].data),o=0;o=i?e:(t.minSegmentDts=1/0,e.filter(function(e){return e.dts>=i&&(t.minSegmentDts=Math.min(t.minSegmentDts,e.dts),t.minSegmentPts=t.minSegmentDts,!0);}));},ye=function ye(e){var t,i,n=[];for(t=0;t=this.virtualRowCount&&"function"==typeof this.beforeRowOverflow&&this.beforeRowOverflow(e),this.rows.length>0&&(this.rows.push(""),this.rowIdx++);this.rows.length>this.virtualRowCount;){this.rows.shift(),this.rowIdx--;}},De.prototype.isEmpty=function(){return 0===this.rows.length||1===this.rows.length&&""===this.rows[0];},De.prototype.addText=function(e){this.rows[this.rowIdx]+=e;},De.prototype.backspace=function(){if(!this.isEmpty()){var e=this.rows[this.rowIdx];this.rows[this.rowIdx]=e.substr(0,e.length-1);}};var Ue=function Ue(e){this.serviceNum=e,this.text="",this.currentWindow=new De(-1),this.windows=[];};Ue.prototype.init=function(e,t){this.startPts=e;for(var i=0;i<8;i++){this.windows[i]=new De(i),"function"==typeof t&&(this.windows[i].beforeRowOverflow=t);}},Ue.prototype.setCurrentWindow=function(e){this.currentWindow=this.windows[e];};var Re=function e(){e.prototype.init.call(this);var t=this;this.current708Packet=null,this.services={},this.push=function(e){3===e.type?(t.new708Packet(),t.add708Bytes(e)):(null===t.current708Packet&&t.new708Packet(),t.add708Bytes(e));};};Re.prototype=new V(),Re.prototype.new708Packet=function(){null!==this.current708Packet&&this.push708Packet(),this.current708Packet={data:[],ptsVals:[]};},Re.prototype.add708Bytes=function(e){var t=e.ccData,i=t>>>8,n=255&t;this.current708Packet.ptsVals.push(e.pts),this.current708Packet.data.push(i),this.current708Packet.data.push(n);},Re.prototype.push708Packet=function(){var e=this.current708Packet,t=e.data,i=null,n=null,r=0,a=t[r++];for(e.seq=a>>6,e.sizeCode=63&a;r>5)&&n>0&&(i=a=t[r++]),this.pushServiceBlock(i,r,n),n>0&&(r+=n-1);}},Re.prototype.pushServiceBlock=function(e,t,i){var n,r=t,a=this.current708Packet.data,s=this.services[e];for(s||(s=this.initService(e,r));r>5,a.rowLock=(16&n)>>4,a.columnLock=(8&n)>>3,a.priority=7&n,n=i[++e],a.relativePositioning=(128&n)>>7,a.anchorVertical=127&n,n=i[++e],a.anchorHorizontal=n,n=i[++e],a.anchorPoint=(240&n)>>4,a.rowCount=15&n,n=i[++e],a.columnCount=63&n,n=i[++e],a.windowStyle=(56&n)>>3,a.penStyle=7&n,a.virtualRowCount=a.rowCount+1,e;},Re.prototype.setWindowAttributes=function(e,t){var i=this.current708Packet.data,n=i[e],r=t.currentWindow.winAttr;return n=i[++e],r.fillOpacity=(192&n)>>6,r.fillRed=(48&n)>>4,r.fillGreen=(12&n)>>2,r.fillBlue=3&n,n=i[++e],r.borderType=(192&n)>>6,r.borderRed=(48&n)>>4,r.borderGreen=(12&n)>>2,r.borderBlue=3&n,n=i[++e],r.borderType+=(128&n)>>5,r.wordWrap=(64&n)>>6,r.printDirection=(48&n)>>4,r.scrollDirection=(12&n)>>2,r.justify=3&n,n=i[++e],r.effectSpeed=(240&n)>>4,r.effectDirection=(12&n)>>2,r.displayEffect=3&n,e;},Re.prototype.flushDisplayed=function(e,t){for(var i=[],n=0;n<8;n++){t.windows[n].visible&&!t.windows[n].isEmpty()&&i.push(t.windows[n].getText());}t.endPts=e,t.text=i.join("\n\n"),this.pushCaption(t),t.startPts=e;},Re.prototype.pushCaption=function(e){""!==e.text&&(this.trigger("data",{startPts:e.startPts,endPts:e.endPts,text:e.text,stream:"cc708_"+e.serviceNum}),e.text="",e.startPts=e.endPts);},Re.prototype.displayWindows=function(e,t){var i=this.current708Packet.data[++e],n=this.getPts(e);this.flushDisplayed(n,t);for(var r=0;r<8;r++){i&1<>4,r.offset=(12&n)>>2,r.penSize=3&n,n=i[++e],r.italics=(128&n)>>7,r.underline=(64&n)>>6,r.edgeType=(56&n)>>3,r.fontStyle=7&n,e;},Re.prototype.setPenColor=function(e,t){var i=this.current708Packet.data,n=i[e],r=t.currentWindow.penColor;return n=i[++e],r.fgOpacity=(192&n)>>6,r.fgRed=(48&n)>>4,r.fgGreen=(12&n)>>2,r.fgBlue=3&n,n=i[++e],r.bgOpacity=(192&n)>>6,r.bgRed=(48&n)>>4,r.bgGreen=(12&n)>>2,r.bgBlue=3&n,n=i[++e],r.edgeRed=(48&n)>>4,r.edgeGreen=(12&n)>>2,r.edgeBlue=3&n,e;},Re.prototype.setPenLocation=function(e,t){var i=this.current708Packet.data,n=i[e],r=t.currentWindow.penLoc;return t.currentWindow.pendingNewLine=!0,n=i[++e],r.row=15&n,n=i[++e],r.column=63&n,e;},Re.prototype.reset=function(e,t){var i=this.getPts(e);return this.flushDisplayed(i,t),this.initService(t.serviceNum,e);};var Oe={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,304:174,305:176,306:189,307:191,308:8482,309:162,310:163,311:9834,312:224,313:160,314:232,315:226,316:234,317:238,318:244,319:251,544:193,545:201,546:211,547:218,548:220,549:252,550:8216,551:161,552:42,553:39,554:8212,555:169,556:8480,557:8226,558:8220,559:8221,560:192,561:194,562:199,563:200,564:202,565:203,566:235,567:206,568:207,569:239,570:212,571:217,572:249,573:219,574:171,575:187,800:195,801:227,802:205,803:204,804:236,805:210,806:242,807:213,808:245,809:123,810:125,811:92,812:94,813:95,814:124,815:126,816:196,817:228,818:214,819:246,820:223,821:165,822:164,823:9474,824:197,825:229,826:216,827:248,828:9484,829:9488,830:9492,831:9496},Me=function Me(e){return null===e?"":(e=Oe[e]||e,String.fromCharCode(e));},Fe=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],Be=function Be(){for(var e=[],t=15;t--;){e.push("");}return e;},Ne=function e(t,i){e.prototype.init.call(this),this.field_=t||0,this.dataChannel_=i||0,this.name_="CC"+(1+(this.field_<<1|this.dataChannel_)),this.setConstants(),this.reset(),this.push=function(e){var t,i,n,r,a;if((t=32639&e.ccData)!==this.lastControlCode_){if(4096==(61440&t)?this.lastControlCode_=t:t!==this.PADDING_&&(this.lastControlCode_=null),n=t>>>8,r=255&t,t!==this.PADDING_)if(t===this.RESUME_CAPTION_LOADING_)this.mode_="popOn";else if(t===this.END_OF_CAPTION_)this.mode_="popOn",this.clearFormatting(e.pts),this.flushDisplayed(e.pts),i=this.displayed_,this.displayed_=this.nonDisplayed_,this.nonDisplayed_=i,this.startPts_=e.pts;else if(t===this.ROLL_UP_2_ROWS_)this.rollUpRows_=2,this.setRollUp(e.pts);else if(t===this.ROLL_UP_3_ROWS_)this.rollUpRows_=3,this.setRollUp(e.pts);else if(t===this.ROLL_UP_4_ROWS_)this.rollUpRows_=4,this.setRollUp(e.pts);else if(t===this.CARRIAGE_RETURN_)this.clearFormatting(e.pts),this.flushDisplayed(e.pts),this.shiftRowsUp_(),this.startPts_=e.pts;else if(t===this.BACKSPACE_)"popOn"===this.mode_?this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1):this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1);else if(t===this.ERASE_DISPLAYED_MEMORY_)this.flushDisplayed(e.pts),this.displayed_=Be();else if(t===this.ERASE_NON_DISPLAYED_MEMORY_)this.nonDisplayed_=Be();else if(t===this.RESUME_DIRECT_CAPTIONING_)"paintOn"!==this.mode_&&(this.flushDisplayed(e.pts),this.displayed_=Be()),this.mode_="paintOn",this.startPts_=e.pts;else if(this.isSpecialCharacter(n,r))a=Me((n=(3&n)<<8)|r),this[this.mode_](e.pts,a),this.column_++;else if(this.isExtCharacter(n,r))"popOn"===this.mode_?this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1):this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1),a=Me((n=(3&n)<<8)|r),this[this.mode_](e.pts,a),this.column_++;else if(this.isMidRowCode(n,r))this.clearFormatting(e.pts),this[this.mode_](e.pts," "),this.column_++,14==(14&r)&&this.addFormatting(e.pts,["i"]),1==(1&r)&&this.addFormatting(e.pts,["u"]);else if(this.isOffsetControlCode(n,r))this.column_+=3&r;else if(this.isPAC(n,r)){var s=Fe.indexOf(7968&t);"rollUp"===this.mode_&&(s-this.rollUpRows_+1<0&&(s=this.rollUpRows_-1),this.setRollUp(e.pts,s)),s!==this.row_&&(this.clearFormatting(e.pts),this.row_=s),1&r&&-1===this.formatting_.indexOf("u")&&this.addFormatting(e.pts,["u"]),16==(16&t)&&(this.column_=4*((14&t)>>1)),this.isColorPAC(r)&&14==(14&r)&&this.addFormatting(e.pts,["i"]);}else this.isNormalChar(n)&&(0===r&&(r=null),a=Me(n),a+=Me(r),this[this.mode_](e.pts,a),this.column_+=a.length);}else this.lastControlCode_=null;};};Ne.prototype=new V(),Ne.prototype.flushDisplayed=function(e){var t=this.displayed_.map(function(e,t){try{return e.trim();}catch(e){return this.trigger("log",{level:"warn",message:"Skipping a malformed 608 caption at index "+t+"."}),"";}},this).join("\n").replace(/^\n+|\n+$/g,"");t.length&&this.trigger("data",{startPts:this.startPts_,endPts:e,text:t,stream:this.name_});},Ne.prototype.reset=function(){this.mode_="popOn",this.topRow_=0,this.startPts_=0,this.displayed_=Be(),this.nonDisplayed_=Be(),this.lastControlCode_=null,this.column_=0,this.row_=14,this.rollUpRows_=2,this.formatting_=[];},Ne.prototype.setConstants=function(){0===this.dataChannel_?(this.BASE_=16,this.EXT_=17,this.CONTROL_=(20|this.field_)<<8,this.OFFSET_=23):1===this.dataChannel_&&(this.BASE_=24,this.EXT_=25,this.CONTROL_=(28|this.field_)<<8,this.OFFSET_=31),this.PADDING_=0,this.RESUME_CAPTION_LOADING_=32|this.CONTROL_,this.END_OF_CAPTION_=47|this.CONTROL_,this.ROLL_UP_2_ROWS_=37|this.CONTROL_,this.ROLL_UP_3_ROWS_=38|this.CONTROL_,this.ROLL_UP_4_ROWS_=39|this.CONTROL_,this.CARRIAGE_RETURN_=45|this.CONTROL_,this.RESUME_DIRECT_CAPTIONING_=41|this.CONTROL_,this.BACKSPACE_=33|this.CONTROL_,this.ERASE_DISPLAYED_MEMORY_=44|this.CONTROL_,this.ERASE_NON_DISPLAYED_MEMORY_=46|this.CONTROL_;},Ne.prototype.isSpecialCharacter=function(e,t){return e===this.EXT_&&t>=48&&t<=63;},Ne.prototype.isExtCharacter=function(e,t){return(e===this.EXT_+1||e===this.EXT_+2)&&t>=32&&t<=63;},Ne.prototype.isMidRowCode=function(e,t){return e===this.EXT_&&t>=32&&t<=47;},Ne.prototype.isOffsetControlCode=function(e,t){return e===this.OFFSET_&&t>=33&&t<=35;},Ne.prototype.isPAC=function(e,t){return e>=this.BASE_&&e=64&&t<=127;},Ne.prototype.isColorPAC=function(e){return e>=64&&e<=79||e>=96&&e<=127;},Ne.prototype.isNormalChar=function(e){return e>=32&&e<=127;},Ne.prototype.setRollUp=function(e,t){if("rollUp"!==this.mode_&&(this.row_=14,this.mode_="rollUp",this.flushDisplayed(e),this.nonDisplayed_=Be(),this.displayed_=Be()),void 0!==t&&t!==this.row_)for(var i=0;i";},"");this[this.mode_](e,i);},Ne.prototype.clearFormatting=function(e){if(this.formatting_.length){var t=this.formatting_.reverse().reduce(function(e,t){return e+"";},"");this.formatting_=[],this[this.mode_](e,t);}},Ne.prototype.popOn=function(e,t){var i=this.nonDisplayed_[this.row_];i+=t,this.nonDisplayed_[this.row_]=i;},Ne.prototype.rollUp=function(e,t){var i=this.displayed_[this.row_];i+=t,this.displayed_[this.row_]=i;},Ne.prototype.shiftRowsUp_=function(){var e;for(e=0;et&&(i=-1);Math.abs(t-e)>4294967296;){e+=8589934592*i;}return e;},ze=function e(t){var i,n;e.prototype.init.call(this),this.type_=t||"shared",this.push=function(e){"shared"!==this.type_&&e.type!==this.type_||(void 0===n&&(n=e.dts),e.dts=He(e.dts,n),e.pts=He(e.pts,n),i=e.dts,this.trigger("data",e));},this.flush=function(){n=i,this.trigger("done");},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline");},this.discontinuity=function(){n=void 0,i=void 0;},this.reset=function(){this.discontinuity(),this.trigger("reset");};};ze.prototype=new V();var _Ge,We=ze,Ye=He,qe=function qe(e,t,i){var n,r="";for(n=t;n>>2;d*=4,d+=3&l[7],o.timeStamp=d,void 0===t.pts&&void 0===t.dts&&(t.pts=o.timeStamp,t.dts=o.timeStamp),this.trigger("timestamp",o);}t.frames.push(o),i+=10,i+=s;}while(i>>4>1&&(n+=t[n]+1),0===i.pid)i.type="pat",e(t.subarray(n),i),this.trigger("data",i);else if(i.pid===this.pmtPid)for(i.type="pmt",e(t.subarray(n),i),this.trigger("data",i);this.packetsWaitingForPmt.length;){this.processPes_.apply(this,this.packetsWaitingForPmt.shift());}else void 0===this.programMapTable?this.packetsWaitingForPmt.push([t,n,i]):this.processPes_(t,n,i);},this.processPes_=function(e,t,i){i.pid===this.programMapTable.video?i.streamType=Ve.H264_STREAM_TYPE:i.pid===this.programMapTable.audio?i.streamType=Ve.ADTS_STREAM_TYPE:i.streamType=this.programMapTable["timed-metadata"][i.pid],i.type="pes",i.data=e.subarray(t),this.trigger("data",i);};}).prototype=new V(),_Je.STREAM_TYPES={h264:27,adts:15},(_Ze=function Ze(){var e,t=this,i=!1,n={data:[],size:0},r={data:[],size:0},a={data:[],size:0},s=function s(e,i,n){var r,a,s=new Uint8Array(e.size),o={type:i},u=0,l=0;if(e.data.length&&!(e.size<9)){for(o.trackId=e.data[0].pid,u=0;u>>3,h.pts*=4,h.pts+=(6&d[13])>>>1,h.dts=h.pts,64&c&&(h.dts=(14&d[14])<<27|(255&d[15])<<20|(254&d[16])<<12|(255&d[17])<<5|(254&d[18])>>>3,h.dts*=4,h.dts+=(6&d[18])>>>1)),h.data=d.subarray(9+d[8])),r="video"===i||o.packetLength<=e.size,(n||r)&&(e.size=0,e.data.length=0),r&&t.trigger("data",o);}};_Ze.prototype.init.call(this),this.push=function(o){({pat:function pat(){},pes:function pes(){var e,t;switch(o.streamType){case Ve.H264_STREAM_TYPE:e=n,t="video";break;case Ve.ADTS_STREAM_TYPE:e=r,t="audio";break;case Ve.METADATA_STREAM_TYPE:e=a,t="timed-metadata";break;default:return;}o.payloadUnitStartIndicator&&s(e,t,!0),e.data.push(o),e.size+=o.data.byteLength;},pmt:function pmt(){var n={type:"metadata",tracks:[]};null!==(e=o.programMapTable).video&&n.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+e.video,codec:"avc",type:"video"}),null!==e.audio&&n.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+e.audio,codec:"adts",type:"audio"}),i=!0,t.trigger("data",n);}})[o.type]();},this.reset=function(){n.size=0,n.data.length=0,r.size=0,r.data.length=0,this.trigger("reset");},this.flushStreams_=function(){s(n,"video"),s(r,"audio"),s(a,"timed-metadata");},this.flush=function(){if(!i&&e){var n={type:"metadata",tracks:[]};null!==e.video&&n.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+e.video,codec:"avc",type:"video"}),null!==e.audio&&n.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+e.audio,codec:"adts",type:"audio"}),t.trigger("data",n);}i=!1,this.flushStreams_(),this.trigger("done");};}).prototype=new V();var it={PAT_PID:0,MP2T_PACKET_LENGTH:188,TransportPacketStream:_$e,TransportParseStream:_Je,ElementaryStream:_Ze,TimestampRolloverStream:tt,CaptionStream:je.CaptionStream,Cea608Stream:je.Cea608Stream,Cea708Stream:je.Cea708Stream,MetadataStream:et};for(var nt in Ve){Ve.hasOwnProperty(nt)&&(it[nt]=Ve[nt]);}var _rt,at=it,st=de,ot=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];(_rt=function rt(e){var t,i=0;_rt.prototype.init.call(this),this.skipWarn_=function(e,t){this.trigger("log",{level:"warn",message:"adts skiping bytes "+e+" to "+t+" in frame "+i+" outside syncword"});},this.push=function(n){var r,a,s,o,u,l=0;if(e||(i=0),"audio"===n.type){var d;for(t&&t.length?(s=t,(t=new Uint8Array(s.byteLength+n.data.byteLength)).set(s),t.set(n.data,s.byteLength)):t=n.data;l+7>5,u=(o=1024*(1+(3&t[l+6])))*st/ot[(60&t[l+2])>>>2],t.byteLength-l>>6&3),channelcount:(1&t[l+2])<<2|(192&t[l+3])>>>6,samplerate:ot[(60&t[l+2])>>>2],samplingfrequencyindex:(60&t[l+2])>>>2,samplesize:16,data:t.subarray(l+7+a,l+r)}),i++,l+=r;}else"number"!=typeof d&&(d=l),l++;}"number"==typeof d&&(this.skipWarn_(d,l),d=null),t=t.subarray(l);}},this.flush=function(){i=0,this.trigger("done");},this.reset=function(){t=void 0,this.trigger("reset");},this.endTimeline=function(){t=void 0,this.trigger("endedtimeline");};}).prototype=new V();var _ut,_lt,dt,ht=_rt,ct=function ct(e){var t=e.byteLength,i=0,n=0;this.length=function(){return 8*t;},this.bitsAvailable=function(){return 8*t+n;},this.loadWord=function(){var r=e.byteLength-t,a=new Uint8Array(4),s=Math.min(4,t);if(0===s)throw new Error("no bytes available");a.set(e.subarray(r,r+s)),i=new DataView(a.buffer).getUint32(0),n=8*s,t-=s;},this.skipBits=function(e){var r;n>e?(i<<=e,n-=e):(e-=n,e-=8*(r=Math.floor(e/8)),t-=r,this.loadWord(),i<<=e,n-=e);},this.readBits=function(e){var r=Math.min(n,e),a=i>>>32-r;return(n-=r)>0?i<<=r:t>0&&this.loadWord(),(r=e-r)>0?a<>>e))return i<<=e,n-=e,e;}return this.loadWord(),e+this.skipLeadingZeros();},this.skipUnsignedExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros());},this.skipExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros());},this.readUnsignedExpGolomb=function(){var e=this.skipLeadingZeros();return this.readBits(e+1)-1;},this.readExpGolomb=function(){var e=this.readUnsignedExpGolomb();return 1&e?1+e>>>1:-1*(e>>>1);},this.readBoolean=function(){return 1===this.readBits(1);},this.readUnsignedByte=function(){return this.readBits(8);},this.loadWord();};(_lt=function lt(){var e,t,i=0;_lt.prototype.init.call(this),this.push=function(n){var r;t?((r=new Uint8Array(t.byteLength+n.data.byteLength)).set(t),r.set(n.data,t.byteLength),t=r):t=n.data;for(var a=t.byteLength;i3&&this.trigger("data",t.subarray(i+3)),t=null,i=0,this.trigger("done");},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline");};}).prototype=new V(),dt={100:!0,110:!0,122:!0,244:!0,44:!0,83:!0,86:!0,118:!0,128:!0,138:!0,139:!0,134:!0},(_ut=function ut(){var e,t,i,n,r,a,s,o=new _lt();_ut.prototype.init.call(this),e=this,this.push=function(e){"video"===e.type&&(t=e.trackId,i=e.pts,n=e.dts,o.push(e));},o.on("data",function(s){var o={trackId:t,pts:i,dts:n,data:s,nalUnitTypeCode:31&s[0]};switch(o.nalUnitTypeCode){case 5:o.nalUnitType="slice_layer_without_partitioning_rbsp_idr";break;case 6:o.nalUnitType="sei_rbsp",o.escapedRBSP=r(s.subarray(1));break;case 7:o.nalUnitType="seq_parameter_set_rbsp",o.escapedRBSP=r(s.subarray(1)),o.config=a(o.escapedRBSP);break;case 8:o.nalUnitType="pic_parameter_set_rbsp";break;case 9:o.nalUnitType="access_unit_delimiter_rbsp";}e.trigger("data",o);}),o.on("done",function(){e.trigger("done");}),o.on("partialdone",function(){e.trigger("partialdone");}),o.on("reset",function(){e.trigger("reset");}),o.on("endedtimeline",function(){e.trigger("endedtimeline");}),this.flush=function(){o.flush();},this.partialFlush=function(){o.partialFlush();},this.reset=function(){o.reset();},this.endTimeline=function(){o.endTimeline();},s=function s(e,t){var i,n=8,r=8;for(i=0;i=0?i:0,(16&e[t+5])>>4?i+20:i+10;},_t=function _t(e){return e[0]<<21|e[1]<<14|e[2]<<7|e[3];},yt={isLikelyAacData:function isLikelyAacData(e){var t=function e(t,i){return t.length-i<10||t[i]!=="I".charCodeAt(0)||t[i+1]!=="D".charCodeAt(0)||t[i+2]!=="3".charCodeAt(0)?i:e(t,i+=gt(t,i));}(e,0);return e.length>=t+2&&255==(255&e[t])&&240==(240&e[t+1])&&16==(22&e[t+1]);},parseId3TagSize:gt,parseAdtsSize:function parseAdtsSize(e,t){var i=(224&e[t+5])>>5,n=e[t+4]<<3;return 6144&e[t+3]|n|i;},parseType:function parseType(e,t){return e[t]==="I".charCodeAt(0)&&e[t+1]==="D".charCodeAt(0)&&e[t+2]==="3".charCodeAt(0)?"timed-metadata":!0&e[t]&&240==(240&e[t+1])?"audio":null;},parseSampleRate:function parseSampleRate(e){for(var t=0;t+5>>2];t++;}return null;},parseAacTimestamp:function parseAacTimestamp(e){var t,i,n;t=10,64&e[5]&&(t+=4,t+=_t(e.subarray(10,14)));do{if((i=_t(e.subarray(t+4,t+8)))<1)return null;if("PRIV"===String.fromCharCode(e[t],e[t+1],e[t+2],e[t+3])){n=e.subarray(t+10,t+i+10);for(var r=0;r>>2;return s*=4,s+=3&a[7];}break;}}}t+=10,t+=i;}while(t=3;){if(e[u]!=="I".charCodeAt(0)||e[u+1]!=="D".charCodeAt(0)||e[u+2]!=="3".charCodeAt(0)){if(255!=(255&e[u])||240!=(240&e[u+1]))u++;else{if(e.length-u<7)break;if(u+(o=yt.parseAdtsSize(e,u))>e.length)break;a={type:"audio",data:e.subarray(u,u+o),pts:t,dts:t},this.trigger("data",a),u+=o;}}else{if(e.length-u<10)break;if(u+(o=yt.parseId3TagSize(e,u))>e.length)break;r={type:"timed-metadata",data:e.subarray(u,u+o)},this.trigger("data",r),u+=o;}}n=e.length-u,e=n>0?e.subarray(u):new Uint8Array();},this.reset=function(){e=new Uint8Array(),this.trigger("reset");},this.endTimeline=function(){e=new Uint8Array(),this.trigger("endedtimeline");};}).prototype=new V();var _vt,_bt,_Tt,_St,Et=_ft,wt=["audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize"],Ct=["width","height","profileIdc","levelIdc","profileCompatibility","sarRatio"],At=pt.H264Stream,kt=yt.isLikelyAacData,xt=de,It=function It(e,t){var i;if(e.length!==t.length)return!1;for(i=0;i=-1e4&&i<=45e3&&(!n||o>i)&&(n=a,o=i));}return n?n.gop:null;},this.alignGopsAtStart_=function(e){var t,i,n,r,a,o,u,l;for(a=e.byteLength,o=e.nalCount,u=e.duration,t=i=0;tn.pts?t++:(i++,a-=r.byteLength,o-=r.nalCount,u-=r.duration);}return 0===i?e:i===e.length?null:((l=e.slice(i)).byteLength=a,l.duration=u,l.nalCount=o,l.pts=l[0].pts,l.dts=l[0].dts,l);},this.alignGopsAtEnd_=function(e){var t,i,n,r,a,o,u;for(t=s.length-1,i=e.length-1,a=null,o=!1;t>=0&&i>=0;){if(n=s[t],r=e[i],n.pts===r.pts){o=!0;break;}n.pts>r.pts?t--:(t===s.length-1&&(a=i),i--);}if(!o&&null===a)return null;if(0===(u=o?i:a))return e;var l=e.slice(u),d=l.reduce(function(e,t){return e.byteLength+=t.byteLength,e.duration+=t.duration,e.nalCount+=t.nalCount,e;},{byteLength:0,duration:0,nalCount:0});return l.byteLength=d.byteLength,l.duration=d.duration,l.nalCount=d.nalCount,l.pts=l[0].pts,l.dts=l[0].dts,l;},this.alignGopsWith=function(e){s=e;};}).prototype=new V(),(_St=function St(e,t){this.numberOfTracks=0,this.metadataStream=t,void 0!==(e=e||{}).remux?this.remuxTracks=!!e.remux:this.remuxTracks=!0,"boolean"==typeof e.keepOriginalTimestamps?this.keepOriginalTimestamps=e.keepOriginalTimestamps:this.keepOriginalTimestamps=!1,this.pendingTracks=[],this.videoTrack=null,this.pendingBoxes=[],this.pendingCaptions=[],this.pendingMetadata=[],this.pendingBytes=0,this.emittedTracks=0,_St.prototype.init.call(this),this.push=function(e){return e.text?this.pendingCaptions.push(e):e.frames?this.pendingMetadata.push(e):(this.pendingTracks.push(e.track),this.pendingBytes+=e.boxes.byteLength,"video"===e.track.type&&(this.videoTrack=e.track,this.pendingBoxes.push(e.boxes)),void("audio"===e.track.type&&(this.audioTrack=e.track,this.pendingBoxes.unshift(e.boxes))));};}).prototype=new V(),_St.prototype.flush=function(e){var t,i,n,r,a=0,s={captions:[],captionStreams:{},metadata:[],info:{}},o=0;if(this.pendingTracks.length=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0));}if(this.videoTrack?(o=this.videoTrack.timelineStartInfo.pts,Ct.forEach(function(e){s.info[e]=this.videoTrack[e];},this)):this.audioTrack&&(o=this.audioTrack.timelineStartInfo.pts,wt.forEach(function(e){s.info[e]=this.audioTrack[e];},this)),this.videoTrack||this.audioTrack){for(1===this.pendingTracks.length?s.type=this.pendingTracks[0].type:s.type="combined",this.emittedTracks+=this.pendingTracks.length,n=Z(this.pendingTracks),s.initSegment=new Uint8Array(n.byteLength),s.initSegment.set(n),s.data=new Uint8Array(this.pendingBytes),r=0;r=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0);},_St.prototype.setRemux=function(e){this.remuxTracks=e;},(_Tt=function Tt(e){var t,i,n=this,r=!0;_Tt.prototype.init.call(this),e=e||{},this.baseMediaDecodeTime=e.baseMediaDecodeTime||0,this.transmuxPipeline_={},this.setupAacPipeline=function(){var r={};this.transmuxPipeline_=r,r.type="aac",r.metadataStream=new at.MetadataStream(),r.aacStream=new Et(),r.audioTimestampRolloverStream=new at.TimestampRolloverStream("audio"),r.timedMetadataTimestampRolloverStream=new at.TimestampRolloverStream("timed-metadata"),r.adtsStream=new ht(),r.coalesceStream=new _St(e,r.metadataStream),r.headOfPipeline=r.aacStream,r.aacStream.pipe(r.audioTimestampRolloverStream).pipe(r.adtsStream),r.aacStream.pipe(r.timedMetadataTimestampRolloverStream).pipe(r.metadataStream).pipe(r.coalesceStream),r.metadataStream.on("timestamp",function(e){r.aacStream.setTimestamp(e.timeStamp);}),r.aacStream.on("data",function(a){"timed-metadata"!==a.type&&"audio"!==a.type||r.audioSegmentStream||(i=i||{timelineStartInfo:{baseMediaDecodeTime:n.baseMediaDecodeTime},codec:"adts",type:"audio"},r.coalesceStream.numberOfTracks++,r.audioSegmentStream=new _bt(i,e),r.audioSegmentStream.on("log",n.getLogTrigger_("audioSegmentStream")),r.audioSegmentStream.on("timingInfo",n.trigger.bind(n,"audioTimingInfo")),r.adtsStream.pipe(r.audioSegmentStream).pipe(r.coalesceStream),n.trigger("trackinfo",{hasAudio:!!i,hasVideo:!!t}));}),r.coalesceStream.on("data",this.trigger.bind(this,"data")),r.coalesceStream.on("done",this.trigger.bind(this,"done"));},this.setupTsPipeline=function(){var r={};this.transmuxPipeline_=r,r.type="ts",r.metadataStream=new at.MetadataStream(),r.packetStream=new at.TransportPacketStream(),r.parseStream=new at.TransportParseStream(),r.elementaryStream=new at.ElementaryStream(),r.timestampRolloverStream=new at.TimestampRolloverStream(),r.adtsStream=new ht(),r.h264Stream=new At(),r.captionStream=new at.CaptionStream(e),r.coalesceStream=new _St(e,r.metadataStream),r.headOfPipeline=r.packetStream,r.packetStream.pipe(r.parseStream).pipe(r.elementaryStream).pipe(r.timestampRolloverStream),r.timestampRolloverStream.pipe(r.h264Stream),r.timestampRolloverStream.pipe(r.adtsStream),r.timestampRolloverStream.pipe(r.metadataStream).pipe(r.coalesceStream),r.h264Stream.pipe(r.captionStream).pipe(r.coalesceStream),r.elementaryStream.on("data",function(a){var s;if("metadata"===a.type){for(s=a.tracks.length;s--;){t||"video"!==a.tracks[s].type?i||"audio"!==a.tracks[s].type||((i=a.tracks[s]).timelineStartInfo.baseMediaDecodeTime=n.baseMediaDecodeTime):(t=a.tracks[s]).timelineStartInfo.baseMediaDecodeTime=n.baseMediaDecodeTime;}t&&!r.videoSegmentStream&&(r.coalesceStream.numberOfTracks++,r.videoSegmentStream=new _vt(t,e),r.videoSegmentStream.on("log",n.getLogTrigger_("videoSegmentStream")),r.videoSegmentStream.on("timelineStartInfo",function(t){i&&!e.keepOriginalTimestamps&&(i.timelineStartInfo=t,r.audioSegmentStream.setEarliestDts(t.dts-n.baseMediaDecodeTime));}),r.videoSegmentStream.on("processedGopsInfo",n.trigger.bind(n,"gopInfo")),r.videoSegmentStream.on("segmentTimingInfo",n.trigger.bind(n,"videoSegmentTimingInfo")),r.videoSegmentStream.on("baseMediaDecodeTime",function(e){i&&r.audioSegmentStream.setVideoBaseMediaDecodeTime(e);}),r.videoSegmentStream.on("timingInfo",n.trigger.bind(n,"videoTimingInfo")),r.h264Stream.pipe(r.videoSegmentStream).pipe(r.coalesceStream)),i&&!r.audioSegmentStream&&(r.coalesceStream.numberOfTracks++,r.audioSegmentStream=new _bt(i,e),r.audioSegmentStream.on("log",n.getLogTrigger_("audioSegmentStream")),r.audioSegmentStream.on("timingInfo",n.trigger.bind(n,"audioTimingInfo")),r.audioSegmentStream.on("segmentTimingInfo",n.trigger.bind(n,"audioSegmentTimingInfo")),r.adtsStream.pipe(r.audioSegmentStream).pipe(r.coalesceStream)),n.trigger("trackinfo",{hasAudio:!!i,hasVideo:!!t});}}),r.coalesceStream.on("data",this.trigger.bind(this,"data")),r.coalesceStream.on("id3Frame",function(e){e.dispatchType=r.metadataStream.dispatchType,n.trigger("id3Frame",e);}),r.coalesceStream.on("caption",this.trigger.bind(this,"caption")),r.coalesceStream.on("done",this.trigger.bind(this,"done"));},this.setBaseMediaDecodeTime=function(n){var r=this.transmuxPipeline_;e.keepOriginalTimestamps||(this.baseMediaDecodeTime=n),i&&(i.timelineStartInfo.dts=void 0,i.timelineStartInfo.pts=void 0,Te(i),r.audioTimestampRolloverStream&&r.audioTimestampRolloverStream.discontinuity()),t&&(r.videoSegmentStream&&(r.videoSegmentStream.gopCache_=[]),t.timelineStartInfo.dts=void 0,t.timelineStartInfo.pts=void 0,Te(t),r.captionStream.reset()),r.timestampRolloverStream&&r.timestampRolloverStream.discontinuity();},this.setAudioAppendStart=function(e){i&&this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(e);},this.setRemux=function(t){var i=this.transmuxPipeline_;e.remux=t,i&&i.coalesceStream&&i.coalesceStream.setRemux(t);},this.alignGopsWith=function(e){t&&this.transmuxPipeline_.videoSegmentStream&&this.transmuxPipeline_.videoSegmentStream.alignGopsWith(e);},this.getLogTrigger_=function(e){var t=this;return function(i){i.stream=e,t.trigger("log",i);};},this.push=function(e){if(r){var t=kt(e);if(t&&"aac"!==this.transmuxPipeline_.type?this.setupAacPipeline():t||"ts"===this.transmuxPipeline_.type||this.setupTsPipeline(),this.transmuxPipeline_)for(var i=Object.keys(this.transmuxPipeline_),n=0;n>>0;},Mt=function Mt(e){var t="";return t+=String.fromCharCode(e[0]),t+=String.fromCharCode(e[1]),t+=String.fromCharCode(e[2]),t+=String.fromCharCode(e[3]);},Ft=Ot,Bt=function e(t,i){var n,r,a,s,o,u=[];if(!i.length)return null;for(n=0;n1?n+r:t.byteLength,a===i[0]&&(1===i.length?u.push(t.subarray(n+8,s)):(o=e(t.subarray(n+8,s),i.slice(1))).length&&(u=u.concat(o))),n=s;}return u;},Nt=Ot,jt=function jt(e){var t={version:e[0],flags:new Uint8Array(e.subarray(1,4)),baseMediaDecodeTime:Nt(e[4]<<24|e[5]<<16|e[6]<<8|e[7])};return 1===t.version&&(t.baseMediaDecodeTime*=Math.pow(2,32),t.baseMediaDecodeTime+=Nt(e[8]<<24|e[9]<<16|e[10]<<8|e[11])),t;},Vt=function Vt(e){return{isLeading:(12&e[0])>>>2,dependsOn:3&e[0],isDependedOn:(192&e[1])>>>6,hasRedundancy:(48&e[1])>>>4,paddingValue:(14&e[1])>>>1,isNonSyncSample:1&e[1],degradationPriority:e[2]<<8|e[3]};},Ht=function Ht(e){var t,i={version:e[0],flags:new Uint8Array(e.subarray(1,4)),samples:[]},n=new DataView(e.buffer,e.byteOffset,e.byteLength),r=1&i.flags[2],a=4&i.flags[2],s=1&i.flags[1],o=2&i.flags[1],u=4&i.flags[1],l=8&i.flags[1],d=n.getUint32(4),h=8;for(r&&(i.dataOffset=n.getInt32(h),h+=4),a&&d&&(t={flags:Vt(e.subarray(h,h+4))},h+=4,s&&(t.duration=n.getUint32(h),h+=4),o&&(t.size=n.getUint32(h),h+=4),l&&(1===i.version?t.compositionTimeOffset=n.getInt32(h):t.compositionTimeOffset=n.getUint32(h),h+=4),i.samples.push(t),d--);d--;){t={},s&&(t.duration=n.getUint32(h),h+=4),o&&(t.size=n.getUint32(h),h+=4),u&&(t.flags=Vt(e.subarray(h,h+4)),h+=4),l&&(1===i.version?t.compositionTimeOffset=n.getInt32(h):t.compositionTimeOffset=n.getUint32(h),h+=4),i.samples.push(t);}return i;},zt=function zt(e){var t,i=new DataView(e.buffer,e.byteOffset,e.byteLength),n={version:e[0],flags:new Uint8Array(e.subarray(1,4)),trackId:i.getUint32(4)},r=1&n.flags[2],a=2&n.flags[2],s=8&n.flags[2],o=16&n.flags[2],u=32&n.flags[2],l=65536&n.flags[0],d=131072&n.flags[0];return t=8,r&&(t+=4,n.baseDataOffset=i.getUint32(12),t+=4),a&&(n.sampleDescriptionIndex=i.getUint32(t),t+=4),s&&(n.defaultSampleDuration=i.getUint32(t),t+=4),o&&(n.defaultSampleSize=i.getUint32(t),t+=4),u&&(n.defaultSampleFlags=i.getUint32(t)),l&&(n.durationIsEmpty=!0),!r&&d&&(n.baseDataOffsetIsMoof=!0),n;},Gt=ke,Wt=je.CaptionStream,Yt=function Yt(e,t){for(var i=e,n=0;n0?jt(l[0]).baseMediaDecodeTime:0,h=Bt(a,["trun"]);t===u&&h.length>0&&(i=function(e,t,i){var n,r,a,s,o=new DataView(e.buffer,e.byteOffset,e.byteLength),u={logs:[],seiNals:[]};for(r=0;r+40;){var u=t.shift();this.parse(u,a,s);}return(o=function(e,t,i){if(null===t)return null;var n=qt(e,t)[t]||{};return{seiNals:n.seiNals,logs:n.logs,timescale:i};}(e,i,n))&&o.logs&&(r.logs=r.logs.concat(o.logs)),null!==o&&o.seiNals?(this.pushNals(o.seiNals),this.flushStream(),r):r.logs.length?{logs:r.logs,captions:[],captionStreams:[]}:null;},this.pushNals=function(t){if(!this.isInitialized()||!t||0===t.length)return null;t.forEach(function(t){e.push(t);});},this.flushStream=function(){if(!this.isInitialized())return null;a?e.partialFlush():e.flush();},this.clearParsedCaptions=function(){r.captions=[],r.captionStreams={},r.logs=[];},this.resetCaptionStream=function(){if(!this.isInitialized())return null;e.reset();},this.clearAllCaptions=function(){this.clearParsedCaptions(),this.resetCaptionStream();},this.reset=function(){t=[],i=null,n=null,r?this.clearParsedCaptions():r={captions:[],captionStreams:{},logs:[]},this.resetCaptionStream();},this.reset();},Xt=Ot,Qt=function Qt(e){return("00"+e.toString(16)).slice(-2);};Lt=function Lt(e,t){var i,n,r;return i=Bt(t,["moof","traf"]),n=[].concat.apply([],i.map(function(t){return Bt(t,["tfhd"]).map(function(i){var n,r,a;return n=Xt(i[4]<<24|i[5]<<16|i[6]<<8|i[7]),r=e[n]||9e4,(a="number"!=typeof(a=Bt(t,["tfdt"]).map(function(e){var t,i;return t=e[0],i=Xt(e[4]<<24|e[5]<<16|e[6]<<8|e[7]),1===t&&(i*=Math.pow(2,32),i+=Xt(e[8]<<24|e[9]<<16|e[10]<<8|e[11])),i;})[0])||isNaN(a)?1/0:a)/r;});})),r=Math.min.apply(null,n),isFinite(r)?r:0;},Dt=function Dt(e){var t=Bt(e,["moov","trak"]),i=[];return t.forEach(function(e){var t,n,r={},a=Bt(e,["tkhd"])[0];a&&(n=(t=new DataView(a.buffer,a.byteOffset,a.byteLength)).getUint8(0),r.id=0===n?t.getUint32(12):t.getUint32(20));var s=Bt(e,["mdia","hdlr"])[0];if(s){var o=Mt(s.subarray(8,12));r.type="vide"===o?"video":"soun"===o?"audio":o;}var u=Bt(e,["mdia","minf","stbl","stsd"])[0];if(u){var l=u.subarray(8);r.codec=Mt(l.subarray(4,8));var d,h=Bt(l,[r.codec])[0];h&&(/^[a-z]vc[1-9]$/i.test(r.codec)?(d=h.subarray(78),"avcC"===Mt(d.subarray(4,8))&&d.length>11?(r.codec+=".",r.codec+=Qt(d[9]),r.codec+=Qt(d[10]),r.codec+=Qt(d[11])):r.codec="avc1.4d400d"):/^mp4[a,v]$/i.test(r.codec)?(d=h.subarray(28),"esds"===Mt(d.subarray(4,8))&&d.length>20&&0!==d[19]?(r.codec+="."+Qt(d[19]),r.codec+="."+Qt(d[20]>>>2&63).replace(/^0/,"")):r.codec="mp4a.40.2"):r.codec=r.codec.toLowerCase());}var c=Bt(e,["mdia","mdhd"])[0];c&&(r.timescale=Ut(c)),i.push(r);}),i;};var $t=Lt,Jt=Dt,Zt=(Ut=function Ut(e){var t=0===e[0]?12:20;return Xt(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3]);},function(e){var t=31&e[1];return t<<=8,t|=e[2];}),ei=function ei(e){return!!(64&e[1]);},ti=function ti(e){var t=0;return(48&e[3])>>>4>1&&(t+=e[4]+1),t;},ii=function ii(e){switch(e){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;}},ni={parseType:function parseType(e,t){var i=Zt(e);return 0===i?"pat":i===t?"pmt":t?"pes":null;},parsePat:function parsePat(e){var t=ei(e),i=4+ti(e);return t&&(i+=e[i]+1),(31&e[i+10])<<8|e[i+11];},parsePmt:function parsePmt(e){var t={},i=ei(e),n=4+ti(e);if(i&&(n+=e[n]+1),1&e[n+5]){var r;r=3+((15&e[n+1])<<8|e[n+2])-4;for(var a=12+((15&e[n+10])<<8|e[n+11]);a=e.byteLength)return null;var i,n=null;return 192&(i=e[t+7])&&((n={}).pts=(14&e[t+9])<<27|(255&e[t+10])<<20|(254&e[t+11])<<12|(255&e[t+12])<<5|(254&e[t+13])>>>3,n.pts*=4,n.pts+=(6&e[t+13])>>>1,n.dts=n.pts,64&i&&(n.dts=(14&e[t+14])<<27|(255&e[t+15])<<20|(254&e[t+16])<<12|(255&e[t+17])<<5|(254&e[t+18])>>>3,n.dts*=4,n.dts+=(6&e[t+18])>>>1)),n;},videoPacketContainsKeyFrame:function videoPacketContainsKeyFrame(e){for(var t=4+ti(e),i=e.subarray(t),n=0,r=0,a=!1;r3&&"slice_layer_without_partitioning_rbsp_idr"===ii(31&i[r+3])&&(a=!0),a;}},ri=Ye,ai={};ai.ts=ni,ai.aac=yt;var si=de,oi=function oi(e,t,i){for(var n,r,a,s,o=0,u=188,l=!1;u<=e.byteLength;){if(71!==e[o]||71!==e[u]&&u!==e.byteLength)o++,u++;else{switch(n=e.subarray(o,u),ai.ts.parseType(n,t.pid)){case"pes":r=ai.ts.parsePesType(n,t.table),a=ai.ts.parsePayloadUnitStartIndicator(n),"audio"===r&&a&&(s=ai.ts.parsePesTime(n))&&(s.type="audio",i.audio.push(s),l=!0);}if(l)break;o+=188,u+=188;}}for(o=(u=e.byteLength)-188,l=!1;o>=0;){if(71!==e[o]||71!==e[u]&&u!==e.byteLength)o--,u--;else{switch(n=e.subarray(o,u),ai.ts.parseType(n,t.pid)){case"pes":r=ai.ts.parsePesType(n,t.table),a=ai.ts.parsePayloadUnitStartIndicator(n),"audio"===r&&a&&(s=ai.ts.parsePesTime(n))&&(s.type="audio",i.audio.push(s),l=!0);}if(l)break;o-=188,u-=188;}}},ui=function ui(e,t,i){for(var n,r,a,s,o,u,l,d=0,h=188,c=!1,f={data:[],size:0};h=0;){if(71!==e[d]||71!==e[h])d--,h--;else{switch(n=e.subarray(d,h),ai.ts.parseType(n,t.pid)){case"pes":r=ai.ts.parsePesType(n,t.table),a=ai.ts.parsePayloadUnitStartIndicator(n),"video"===r&&a&&(s=ai.ts.parsePesTime(n))&&(s.type="video",i.video.push(s),c=!0);}if(c)break;d-=188,h-=188;}}},li=function li(e){var t={pid:null,table:null},i={};for(var n in function(e,t){for(var i,n=0,r=188;r=3;){switch(ai.aac.parseType(e,o)){case"timed-metadata":if(e.length-o<10){i=!0;break;}if((s=ai.aac.parseId3TagSize(e,o))>e.length){i=!0;break;}null===a&&(t=e.subarray(o,o+s),a=ai.aac.parseAacTimestamp(t)),o+=s;break;case"audio":if(e.length-o<7){i=!0;break;}if((s=ai.aac.parseAdtsSize(e,o))>e.length){i=!0;break;}null===r&&(t=e.subarray(o,o+s),r=ai.aac.parseSampleRate(t)),n++,o+=s;break;default:o++;}if(i)return null;}if(null===r||null===a)return null;var u=si/r;return{audio:[{type:"audio",dts:a,pts:a},{type:"audio",dts:a+1024*n*u,pts:a+1024*n*u}]};}(e):li(e))&&(i.audio||i.video)?(function(e,t){if(e.audio&&e.audio.length){var i=t;(void 0===i||isNaN(i))&&(i=e.audio[0].dts),e.audio.forEach(function(e){e.dts=ri(e.dts,i),e.pts=ri(e.pts,i),e.dtsTime=e.dts/si,e.ptsTime=e.pts/si;});}if(e.video&&e.video.length){var n=t;if((void 0===n||isNaN(n))&&(n=e.video[0].dts),e.video.forEach(function(e){e.dts=ri(e.dts,n),e.pts=ri(e.pts,n),e.dtsTime=e.dts/si,e.ptsTime=e.pts/si;}),e.firstKeyFrame){var r=e.firstKeyFrame;r.dts=ri(r.dts,n),r.pts=ri(r.pts,n),r.dtsTime=r.dts/si,r.ptsTime=r.pts/si;}}}(i,t),i):null;},hi=function(){function e(e,t){this.options=t||{},this.self=e,this.init();}var t=e.prototype;return t.init=function(){this.transmuxer&&this.transmuxer.dispose(),this.transmuxer=new Rt.Transmuxer(this.options),function(e,t){t.on("data",function(t){var i=t.initSegment;t.initSegment={data:i.buffer,byteOffset:i.byteOffset,byteLength:i.byteLength};var n=t.data;t.data=n.buffer,e.postMessage({action:"data",segment:t,byteOffset:n.byteOffset,byteLength:n.byteLength},[t.data]);}),t.on("done",function(t){e.postMessage({action:"done"});}),t.on("gopInfo",function(t){e.postMessage({action:"gopInfo",gopInfo:t});}),t.on("videoSegmentTimingInfo",function(t){var i={start:{decode:ce(t.start.dts),presentation:ce(t.start.pts)},end:{decode:ce(t.end.dts),presentation:ce(t.end.pts)},baseMediaDecodeTime:ce(t.baseMediaDecodeTime)};t.prependedContentDuration&&(i.prependedContentDuration=ce(t.prependedContentDuration)),e.postMessage({action:"videoSegmentTimingInfo",videoSegmentTimingInfo:i});}),t.on("audioSegmentTimingInfo",function(t){var i={start:{decode:ce(t.start.dts),presentation:ce(t.start.pts)},end:{decode:ce(t.end.dts),presentation:ce(t.end.pts)},baseMediaDecodeTime:ce(t.baseMediaDecodeTime)};t.prependedContentDuration&&(i.prependedContentDuration=ce(t.prependedContentDuration)),e.postMessage({action:"audioSegmentTimingInfo",audioSegmentTimingInfo:i});}),t.on("id3Frame",function(t){e.postMessage({action:"id3Frame",id3Frame:t});}),t.on("caption",function(t){e.postMessage({action:"caption",caption:t});}),t.on("trackinfo",function(t){e.postMessage({action:"trackinfo",trackInfo:t});}),t.on("audioTimingInfo",function(t){e.postMessage({action:"audioTimingInfo",audioTimingInfo:{start:ce(t.start),end:ce(t.end)}});}),t.on("videoTimingInfo",function(t){e.postMessage({action:"videoTimingInfo",videoTimingInfo:{start:ce(t.start),end:ce(t.end)}});}),t.on("log",function(t){e.postMessage({action:"log",log:t});});}(this.self,this.transmuxer);},t.pushMp4Captions=function(e){this.captionParser||(this.captionParser=new Kt(),this.captionParser.init());var t=new Uint8Array(e.data,e.byteOffset,e.byteLength),i=this.captionParser.parse(t,e.trackIds,e.timescales);this.self.postMessage({action:"mp4Captions",captions:i&&i.captions||[],logs:i&&i.logs||[],data:t.buffer},[t.buffer]);},t.probeMp4StartTime=function(e){var t=e.timescales,i=e.data,n=$t(t,i);this.self.postMessage({action:"probeMp4StartTime",startTime:n,data:i},[i.buffer]);},t.probeMp4Tracks=function(e){var t=e.data,i=Jt(t);this.self.postMessage({action:"probeMp4Tracks",tracks:i,data:t},[t.buffer]);},t.probeTs=function(e){var t=e.data,i=e.baseStartTime,n="number"!=typeof i||isNaN(i)?void 0:i*de,r=di(t,n),a=null;r&&((a={hasVideo:r.video&&2===r.video.length||!1,hasAudio:r.audio&&2===r.audio.length||!1}).hasVideo&&(a.videoStart=r.video[0].ptsTime),a.hasAudio&&(a.audioStart=r.audio[0].ptsTime)),this.self.postMessage({action:"probeTs",result:a,data:t},[t.buffer]);},t.clearAllMp4Captions=function(){this.captionParser&&this.captionParser.clearAllCaptions();},t.clearParsedMp4Captions=function(){this.captionParser&&this.captionParser.clearParsedCaptions();},t.push=function(e){var t=new Uint8Array(e.data,e.byteOffset,e.byteLength);this.transmuxer.push(t);},t.reset=function(){this.transmuxer.reset();},t.setTimestampOffset=function(e){var t=e.timestampOffset||0;this.transmuxer.setBaseMediaDecodeTime(Math.round(he(t)));},t.setAudioAppendStart=function(e){this.transmuxer.setAudioAppendStart(Math.ceil(he(e.appendStart)));},t.setRemux=function(e){this.transmuxer.setRemux(e.remux);},t.flush=function(e){this.transmuxer.flush(),self.postMessage({action:"done",type:"transmuxed"});},t.endTimeline=function(){this.transmuxer.endTimeline(),self.postMessage({action:"endedtimeline",type:"transmuxed"});},t.alignGopsWith=function(e){this.transmuxer.alignGopsWith(e.gopsToAlignWith.slice());},e;}();self.onmessage=function(e){"init"===e.data.action&&e.data.options?this.messageHandlers=new hi(self,e.data.options):(this.messageHandlers||(this.messageHandlers=new hi(self)),e.data&&e.data.action&&"init"!==e.data.action&&this.messageHandlers[e.data.action]&&this.messageHandlers[e.data.action](e.data));};}))),ls=function ls(e){var t=e.transmuxer,i=e.bytes,n=e.audioAppendStart,r=e.gopsToAlignWith,a=e.remux,s=e.onData,o=e.onTrackInfo,u=e.onAudioTimingInfo,l=e.onVideoTimingInfo,d=e.onVideoSegmentTimingInfo,h=e.onAudioSegmentTimingInfo,c=e.onId3,f=e.onCaptions,p=e.onDone,m=e.onEndedTimeline,g=e.onTransmuxerLog,_=e.isEndOfTimeline,y={buffer:[]},v=_;if(t.onmessage=function(i){t.currentTransmux===e&&("data"===i.data.action&&function(e,t,i){var n=e.data.segment,r=n.type,a=n.initSegment,s=n.captions,o=n.captionStreams,u=n.metadata,l=n.videoFrameDtsTime,d=n.videoFramePtsTime;t.buffer.push({captions:s,captionStreams:o,metadata:u});var h=e.data.segment.boxes||{data:e.data.segment.data},c={type:r,data:new Uint8Array(h.data,h.data.byteOffset,h.data.byteLength),initSegment:new Uint8Array(a.data,a.byteOffset,a.byteLength)};void 0!==l&&(c.videoFrameDtsTime=l),void 0!==d&&(c.videoFramePtsTime=d),i(c);}(i,y,s),"trackinfo"===i.data.action&&o(i.data.trackInfo),"gopInfo"===i.data.action&&function(e,t){t.gopInfo=e.data.gopInfo;}(i,y),"audioTimingInfo"===i.data.action&&u(i.data.audioTimingInfo),"videoTimingInfo"===i.data.action&&l(i.data.videoTimingInfo),"videoSegmentTimingInfo"===i.data.action&&d(i.data.videoSegmentTimingInfo),"audioSegmentTimingInfo"===i.data.action&&h(i.data.audioSegmentTimingInfo),"id3Frame"===i.data.action&&c([i.data.id3Frame],i.data.id3Frame.dispatchType),"caption"===i.data.action&&f(i.data.caption),"endedtimeline"===i.data.action&&(v=!1,m()),"log"===i.data.action&&g(i.data.log),"transmuxed"===i.data.type&&(v||(t.onmessage=null,function(e){var t=e.transmuxedData,i=e.callback;t.buffer=[],i(t);}({transmuxedData:y,callback:p}),ds(t))));},n&&t.postMessage({action:"setAudioAppendStart",appendStart:n}),Array.isArray(r)&&t.postMessage({action:"alignGopsWith",gopsToAlignWith:r}),void 0!==a&&t.postMessage({action:"setRemux",remux:a}),i.byteLength){var b=i instanceof ArrayBuffer?i:i.buffer,T=i instanceof ArrayBuffer?0:i.byteOffset;t.postMessage({action:"push",data:b,byteOffset:T,byteLength:i.byteLength},[b]);}_&&t.postMessage({action:"endTimeline"}),t.postMessage({action:"flush"});},ds=function ds(e){e.currentTransmux=null,e.transmuxQueue.length&&(e.currentTransmux=e.transmuxQueue.shift(),"function"==typeof e.currentTransmux?e.currentTransmux():ls(e.currentTransmux));},hs=function hs(e,t){e.postMessage({action:t}),ds(e);},cs=function cs(e,t){if(!t.currentTransmux)return t.currentTransmux=e,void hs(t,e);t.transmuxQueue.push(hs.bind(null,t,e));},fs=function fs(e){if(!e.transmuxer.currentTransmux)return e.transmuxer.currentTransmux=e,void ls(e);e.transmuxer.transmuxQueue.push(e);},ps=function ps(e){cs("reset",e);},ms=function ms(e){var t=new us();t.currentTransmux=null,t.transmuxQueue=[];var i=t.terminate;return t.terminate=function(){return t.currentTransmux=null,t.transmuxQueue.length=0,i.call(t);},t.postMessage({action:"init",options:e}),t;},gs=function gs(e){var t=e.transmuxer,i=e.endAction||e.action,n=e.callback,r=x["default"]({},e,{endAction:null,transmuxer:null,callback:null});if(t.addEventListener("message",function r(a){a.data.action===i&&(t.removeEventListener("message",r),a.data.data&&(a.data.data=new Uint8Array(a.data.data,e.byteOffset||0,e.byteLength||a.data.data.byteLength),e.data&&(e.data=a.data.data)),n(a.data));}),e.data){var a=e.data instanceof ArrayBuffer;r.byteOffset=a?0:e.data.byteOffset,r.byteLength=e.data.byteLength;var s=[a?e.data:e.data.buffer];t.postMessage(r,s);}else t.postMessage(r);},_s=2,ys=-101,vs=-102,bs=function bs(e){e.forEach(function(e){e.abort();});},Ts=function Ts(e,t){return t.timedout?{status:t.status,message:"HLS request timed-out at URL: "+t.uri,code:ys,xhr:t}:t.aborted?{status:t.status,message:"HLS request aborted at URL: "+t.uri,code:vs,xhr:t}:e?{status:t.status,message:"HLS request errored at URL: "+t.uri,code:_s,xhr:t}:"arraybuffer"===t.responseType&&0===t.response.byteLength?{status:t.status,message:"Empty HLS response at URL: "+t.uri,code:_s,xhr:t}:null;},Ss=function Ss(e,t,i){return function(n,r){var a=r.response,s=Ts(n,r);if(s)return i(s,e);if(16!==a.byteLength)return i({status:r.status,message:"Invalid HLS key at URL: "+r.uri,code:_s,xhr:r},e);for(var o=new DataView(a),u=new Uint32Array([o.getUint32(0),o.getUint32(4),o.getUint32(8),o.getUint32(12)]),l=0;l1)return Ls("multiple "+e+" codecs found as attributes: "+t[e].join(", ")+". Setting playlist codecs to null so that we wait for mux.js to probe segments for real codecs."),void(t[e]=null);t[e]=t[e][0];}),t;},Rs=function Rs(e){var t=0;return e.audio&&t++,e.video&&t++,t;},Os=function Os(e,t){var i=t.attributes||{},n=Us(function(e){var t=e.attributes||{};if(t.CODECS)return g.parseCodecs(t.CODECS);}(t)||[]);if(Ds(e,t)&&!n.audio&&!function(e,t){if(!Ds(e,t))return!0;var i=t.attributes||{},n=e.mediaGroups.AUDIO[i.AUDIO];for(var r in n){if(!n[r].uri&&!n[r].playlists)return!0;}return!1;}(e,t)){var r=Us(g.codecsFromDefault(e,i.AUDIO)||[]);r.audio&&(n.audio=r.audio);}return n;},Ms=$r("PlaylistSelector"),Fs=function Fs(e){if(e&&e.playlist){var t=e.playlist;return JSON.stringify({id:t.id,bandwidth:e.bandwidth,width:e.width,height:e.height,codecs:t.attributes&&t.attributes.CODECS||""});}},Bs=function Bs(e,t){if(!e)return"";var i=A["default"].getComputedStyle(e);return i?i[t]:"";},Ns=function Ns(e,t){var i=e.slice();e.sort(function(e,n){var r=t(e,n);return 0===r?i.indexOf(e)-i.indexOf(n):r;});},js=function js(e,t){var i,n;return e.attributes.BANDWIDTH&&(i=e.attributes.BANDWIDTH),i=i||A["default"].Number.MAX_VALUE,t.attributes.BANDWIDTH&&(n=t.attributes.BANDWIDTH),i-(n=n||A["default"].Number.MAX_VALUE);},Vs=function Vs(e,t,i,n,r,a){if(e){var s={bandwidth:t,width:i,height:n,limitRenditionByPlayerDimensions:r},o=e.playlists;Ta.isAudioOnly(e)&&(o=a.getAudioTrackPlaylists_(),s.audioOnly=!0);var u=o.map(function(e){var t=e.attributes&&e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width,i=e.attributes&&e.attributes.RESOLUTION&&e.attributes.RESOLUTION.height;return{bandwidth:e.attributes&&e.attributes.BANDWIDTH||A["default"].Number.MAX_VALUE,width:t,height:i,playlist:e};});Ns(u,function(e,t){return e.bandwidth-t.bandwidth;});var l=(u=u.filter(function(e){return!Ta.isIncompatible(e.playlist);})).filter(function(e){return Ta.isEnabled(e.playlist);});l.length||(l=u.filter(function(e){return!Ta.isDisabled(e.playlist);}));var d=l.filter(function(e){return e.bandwidth*ns.BANDWIDTH_VARIANCEi||e.height>n;})).filter(function(e){return e.width===_[0].width&&e.height===_[0].height;}),h=y[y.length-1],v=y.filter(function(e){return e.bandwidth===h.bandwidth;})[0]),a.experimentalLeastPixelDiffSelector){var S=m.map(function(e){return e.pixelDiff=Math.abs(e.width-i)+Math.abs(e.height-n),e;});Ns(S,function(e,t){return e.pixelDiff===t.pixelDiff?t.bandwidth-e.bandwidth:e.pixelDiff-t.pixelDiff;}),b=S[0];}var E=b||v||T||c||l[0]||u[0];if(E&&E.playlist){var w="sortedPlaylistReps";return b?w="leastPixelDiffRep":v?w="resolutionPlusOneRep":T?w="resolutionBestRep":c?w="bandwidthBestRep":l[0]&&(w="enabledPlaylistReps"),Ms("choosing "+Fs(E)+" using "+w+" with options",s),E.playlist;}return Ms("could not choose a playlist with options",s),null;}},Hs=function Hs(){var e=this.useDevicePixelRatio&&A["default"].devicePixelRatio||1;return Vs(this.playlists.master,this.systemBandwidth,parseInt(Bs(this.tech_.el(),"width"),10)*e,parseInt(Bs(this.tech_.el(),"height"),10)*e,this.limitRenditionByPlayerDimensions,this.masterPlaylistController_);},zs=function zs(e){var t=e.inbandTextTracks,i=e.metadataArray,n=e.timestampOffset,r=e.videoDuration;if(i){var a=A["default"].WebKitDataCue||A["default"].VTTCue,s=t.metadataTrack_;if(s&&(i.forEach(function(e){var t=e.cueTime+n;!("number"!=typeof t||A["default"].isNaN(t)||t<0)&&t<1/0&&e.frames.forEach(function(e){var i=new a(t,t,e.value||e.url||e.data||"");i.frame=e,i.value=e,function(e){Object.defineProperties(e.frame,{id:{get:function get(){return Yr.log.warn("cue.frame.id is deprecated. Use cue.value.key instead."),e.value.key;}},value:{get:function get(){return Yr.log.warn("cue.frame.value is deprecated. Use cue.value.data instead."),e.value.data;}},privateData:{get:function get(){return Yr.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead."),e.value.data;}}});}(i),s.addCue(i);});}),s.cues&&s.cues.length)){for(var o=s.cues,u=[],l=0;l=e&&r.endTime<=t&&i.removeCue(r);}},Ws=function Ws(e){return"number"==typeof e&&isFinite(e);},Ys=function Ys(e){var t=e.startOfSegment,i=e.duration,n=e.segment,r=e.part,a=e.playlist,s=a.mediaSequence,o=a.id,u=a.segments,l=void 0===u?[]:u,d=e.mediaIndex,h=e.partIndex,c=e.timeline,f=l.length-1,p="mediaIndex/partIndex increment";e.getMediaInfoForTime?p="getMediaInfoForTime ("+e.getMediaInfoForTime+")":e.isSyncRequest&&(p="getSyncSegmentCandidate (isSyncRequest)");var m="number"==typeof h,g=e.segment.uri?"segment":"pre-segment",_=m?oa({preloadSegment:n})-1:0;return g+" ["+(s+d)+"/"+(s+f)+"]"+(m?" part ["+h+"/"+_+"]":"")+" segment start/end ["+n.start+" => "+n.end+"]"+(m?" part start/end ["+r.start+" => "+r.end+"]":"")+" startOfSegment ["+t+"] duration ["+i+"] timeline ["+c+"] selected by ["+p+"] playlist ["+o+"]";},qs=function qs(e){return e+"TimingInfo";},Ks=function Ks(e){var t=e.timelineChangeController,i=e.currentTimeline,n=e.segmentTimeline,r=e.loaderType,a=e.audioDisabled;if(i===n)return!1;if("audio"===r){var s=t.lastTimelineChange({type:"main"});return!s||s.to!==n;}if("main"===r&&a){var o=t.pendingTimelineChange({type:"audio"});return!o||o.to!==n;}return!1;},Xs=function Xs(e){var t=e.segmentDuration,i=e.maxDuration;return!!t&&Math.round(t)>i+1/30;},Qs=function Qs(e,t){if("hls"!==t)return null;var i,n,r,a,s=(i=e.audioTimingInfo,n=e.videoTimingInfo,r=i&&"number"==typeof i.start&&"number"==typeof i.end?i.end-i.start:0,a=n&&"number"==typeof n.start&&"number"==typeof n.end?n.end-n.start:0,Math.max(r,a));if(!s)return null;var o=e.playlist.targetDuration,u=Xs({segmentDuration:s,maxDuration:2*o}),l=Xs({segmentDuration:s,maxDuration:o}),d="Segment with index "+e.mediaIndex+" from playlist "+e.playlist.id+" has a duration of "+s+" when the reported duration is "+e.duration+" and the target duration is "+o+". For HLS content, a duration in excess of the target duration may result in playback issues. See the HLS specification section on EXT-X-TARGETDURATION for more details: https://tools.ietf.org/html/draft-pantos-http-live-streaming-23#section-4.3.3.1";return u||l?{severity:u?"warn":"info",message:d}:null;},$s=function(e){function t(t,i){var n;if(n=e.call(this)||this,!t)throw new TypeError("Initialization settings are required");if("function"!=typeof t.currentTime)throw new TypeError("No currentTime getter specified");if(!t.mediaSource)throw new TypeError("No MediaSource specified");return n.bandwidth=t.bandwidth,n.throughput={rate:0,count:0},n.roundTrip=NaN,n.resetStats_(),n.mediaIndex=null,n.partIndex=null,n.hasPlayed_=t.hasPlayed,n.currentTime_=t.currentTime,n.seekable_=t.seekable,n.seeking_=t.seeking,n.duration_=t.duration,n.mediaSource_=t.mediaSource,n.vhs_=t.vhs,n.loaderType_=t.loaderType,n.currentMediaInfo_=void 0,n.startingMediaInfo_=void 0,n.segmentMetadataTrack_=t.segmentMetadataTrack,n.goalBufferLength_=t.goalBufferLength,n.sourceType_=t.sourceType,n.sourceUpdater_=t.sourceUpdater,n.inbandTextTracks_=t.inbandTextTracks,n.state_="INIT",n.timelineChangeController_=t.timelineChangeController,n.shouldSaveSegmentTimingInfo_=!0,n.parse708captions_=t.parse708captions,n.experimentalExactManifestTimings=t.experimentalExactManifestTimings,n.checkBufferTimeout_=null,n.error_=void 0,n.currentTimeline_=-1,n.pendingSegment_=null,n.xhrOptions_=null,n.pendingSegments_=[],n.audioDisabled_=!1,n.isPendingTimestampOffset_=!1,n.gopBuffer_=[],n.timeMapping_=0,n.safeAppend_=Yr.browser.IE_VERSION>=11,n.appendInitSegment_={audio:!0,video:!0},n.playlistOfLastInitSegment_={audio:null,video:null},n.callQueue_=[],n.loadQueue_=[],n.metadataQueue_={id3:[],caption:[]},n.waitingOnRemove_=!1,n.quotaExceededErrorRetryTimeout_=null,n.activeInitSegmentId_=null,n.initSegments_={},n.cacheEncryptionKeys_=t.cacheEncryptionKeys,n.keyCache_={},n.decrypter_=t.decrypter,n.syncController_=t.syncController,n.syncPoint_={segmentIndex:0,time:0},n.transmuxer_=n.createTransmuxer_(),n.triggerSyncInfoUpdate_=function(){return n.trigger("syncinfoupdate");},n.syncController_.on("syncinfoupdate",n.triggerSyncInfoUpdate_),n.mediaSource_.addEventListener("sourceopen",function(){n.isEndOfStream_()||(n.ended_=!1);}),n.fetchAtBuffer_=!1,n.logger_=$r("SegmentLoader["+n.loaderType_+"]"),Object.defineProperty(I["default"](n),"state",{get:function get(){return this.state_;},set:function set(e){e!==this.state_&&(this.logger_(this.state_+" -> "+e),this.state_=e,this.trigger("statechange"));}}),n.sourceUpdater_.on("ready",function(){n.hasEnoughInfoToAppend_()&&n.processCallQueue_();}),"main"===n.loaderType_&&n.timelineChangeController_.on("pendingtimelinechange",function(){n.hasEnoughInfoToAppend_()&&n.processCallQueue_();}),"audio"===n.loaderType_&&n.timelineChangeController_.on("timelinechange",function(){n.hasEnoughInfoToLoad_()&&n.processLoadQueue_(),n.hasEnoughInfoToAppend_()&&n.processCallQueue_();}),n;}P["default"](t,e);var i=t.prototype;return i.createTransmuxer_=function(){return ms({remux:!1,alignGopsAtEnd:this.safeAppend_,keepOriginalTimestamps:!0,parse708captions:this.parse708captions_});},i.resetStats_=function(){this.mediaBytesTransferred=0,this.mediaRequests=0,this.mediaRequestsAborted=0,this.mediaRequestsTimedout=0,this.mediaRequestsErrored=0,this.mediaTransferDuration=0,this.mediaSecondsLoaded=0,this.mediaAppends=0;},i.dispose=function(){this.trigger("dispose"),this.state="DISPOSED",this.pause(),this.abort_(),this.transmuxer_&&this.transmuxer_.terminate(),this.resetStats_(),this.checkBufferTimeout_&&A["default"].clearTimeout(this.checkBufferTimeout_),this.syncController_&&this.triggerSyncInfoUpdate_&&this.syncController_.off("syncinfoupdate",this.triggerSyncInfoUpdate_),this.off();},i.setAudio=function(e){this.audioDisabled_=!e,e?this.appendInitSegment_.audio=!0:this.sourceUpdater_.removeAudio(0,this.duration_());},i.abort=function(){"WAITING"===this.state?(this.abort_(),this.state="READY",this.paused()||this.monitorBuffer_()):this.pendingSegment_&&(this.pendingSegment_=null);},i.abort_=function(){this.pendingSegment_&&this.pendingSegment_.abortRequests&&this.pendingSegment_.abortRequests(),this.pendingSegment_=null,this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.timelineChangeController_.clearPendingTimelineChange(this.loaderType_),this.waitingOnRemove_=!1,A["default"].clearTimeout(this.quotaExceededErrorRetryTimeout_),this.quotaExceededErrorRetryTimeout_=null;},i.checkForAbort_=function(e){return"APPENDING"!==this.state||this.pendingSegment_?!this.pendingSegment_||this.pendingSegment_.requestId!==e:(this.state="READY",!0);},i.error=function(e){return void 0!==e&&(this.logger_("error occurred:",e),this.error_=e),this.pendingSegment_=null,this.error_;},i.endOfStream=function(){this.ended_=!0,this.transmuxer_&&ps(this.transmuxer_),this.gopBuffer_.length=0,this.pause(),this.trigger("ended");},i.buffered_=function(){var e=this.getMediaInfo_();if(!this.sourceUpdater_||!e)return Yr.createTimeRanges();if("main"===this.loaderType_){var t=e.hasAudio,i=e.hasVideo,n=e.isMuxed;if(i&&t&&!this.audioDisabled_&&!n)return this.sourceUpdater_.buffered();if(i)return this.sourceUpdater_.videoBuffered();}return this.sourceUpdater_.audioBuffered();},i.initSegmentForMap=function(e,t){if(void 0===t&&(t=!1),!e)return null;var i=Wa(e),n=this.initSegments_[i];return t&&!n&&e.bytes&&(this.initSegments_[i]=n={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:e.bytes,tracks:e.tracks,timescales:e.timescales}),n||e;},i.segmentKey=function(e,t){if(void 0===t&&(t=!1),!e)return null;var i=Ya(e),n=this.keyCache_[i];this.cacheEncryptionKeys_&&t&&!n&&e.bytes&&(this.keyCache_[i]=n={resolvedUri:e.resolvedUri,bytes:e.bytes});var r={resolvedUri:(n||e).resolvedUri};return n&&(r.bytes=n.bytes),r;},i.couldBeginLoading_=function(){return this.playlist_&&!this.paused();},i.load=function(){if(this.monitorBuffer_(),this.playlist_)return"INIT"===this.state&&this.couldBeginLoading_()?this.init_():void(!this.couldBeginLoading_()||"READY"!==this.state&&"INIT"!==this.state||(this.state="READY"));},i.init_=function(){return this.state="READY",this.resetEverything(),this.monitorBuffer_();},i.playlist=function(e,t){if(void 0===t&&(t={}),e){var i=this.playlist_,n=this.pendingSegment_;this.playlist_=e,this.xhrOptions_=t,"INIT"===this.state&&(e.syncInfo={mediaSequence:e.mediaSequence,time:0},"main"===this.loaderType_&&this.syncController_.setDateTimeMappingForStart(e));var r=null;if(i&&(i.id?r=i.id:i.uri&&(r=i.uri)),this.logger_("playlist update ["+r+" => "+(e.id||e.uri)+"]"),this.trigger("syncinfoupdate"),"INIT"===this.state&&this.couldBeginLoading_())return this.init_();if(!i||i.uri!==e.uri)return null!==this.mediaIndex&&this.resyncLoader(),this.currentMediaInfo_=void 0,void this.trigger("playlistupdate");var a=e.mediaSequence-i.mediaSequence;if(this.logger_("live window shift ["+a+"]"),null!==this.mediaIndex)if(this.mediaIndex-=a,this.mediaIndex<0)this.mediaIndex=null,this.partIndex=null;else{var s=this.playlist_.segments[this.mediaIndex];if(this.partIndex&&(!s.parts||!s.parts.length||!s.parts[this.partIndex])){var o=this.mediaIndex;this.logger_("currently processing part (index "+this.partIndex+") no longer exists."),this.resetLoader(),this.mediaIndex=o;}}n&&(n.mediaIndex-=a,n.mediaIndex<0?(n.mediaIndex=null,n.partIndex=null):(n.mediaIndex>=0&&(n.segment=e.segments[n.mediaIndex]),n.partIndex>=0&&n.segment.parts&&(n.part=n.segment.parts[n.partIndex]))),this.syncController_.saveExpiredSegmentInfo(i,e);}},i.pause=function(){this.checkBufferTimeout_&&(A["default"].clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=null);},i.paused=function(){return null===this.checkBufferTimeout_;},i.resetEverything=function(e){this.ended_=!1,this.appendInitSegment_={audio:!0,video:!0},this.resetLoader(),this.remove(0,1/0,e),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearAllMp4Captions"});},i.resetLoader=function(){this.fetchAtBuffer_=!1,this.resyncLoader();},i.resyncLoader=function(){this.transmuxer_&&ps(this.transmuxer_),this.mediaIndex=null,this.partIndex=null,this.syncPoint_=null,this.isPendingTimestampOffset_=!1,this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.abort(),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"});},i.remove=function(e,t,i,n){if(void 0===i&&(i=function i(){}),void 0===n&&(n=!1),t===1/0&&(t=this.duration_()),t<=e)this.logger_("skipping remove because end ${end} is <= start ${start}");else if(this.sourceUpdater_&&this.getMediaInfo_()){var r=1,a=function a(){0===--r&&i();};for(var s in!n&&this.audioDisabled_||(r++,this.sourceUpdater_.removeAudio(e,t,a)),(n||"main"===this.loaderType_)&&(this.gopBuffer_=function(e,t,i,n){for(var r=Math.ceil((t-n)*E.ONE_SECOND_IN_TS),a=Math.ceil((i-n)*E.ONE_SECOND_IN_TS),s=e.slice(),o=e.length;o--&&!(e[o].pts<=a);){;}if(-1===o)return s;for(var u=o+1;u--&&!(e[u].pts<=r);){;}return u=Math.max(u,0),s.splice(u,o-u+1),s;}(this.gopBuffer_,e,t,this.timeMapping_),r++,this.sourceUpdater_.removeVideo(e,t,a)),this.inbandTextTracks_){Gs(e,t,this.inbandTextTracks_[s]);}Gs(e,t,this.segmentMetadataTrack_),a();}else this.logger_("skipping remove because no source updater or starting media info");},i.monitorBuffer_=function(){this.checkBufferTimeout_&&A["default"].clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=A["default"].setTimeout(this.monitorBufferTick_.bind(this),1);},i.monitorBufferTick_=function(){"READY"===this.state&&this.fillBuffer_(),this.checkBufferTimeout_&&A["default"].clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=A["default"].setTimeout(this.monitorBufferTick_.bind(this),500);},i.fillBuffer_=function(){if(!this.sourceUpdater_.updating()){var e=this.chooseNextRequest_();e&&("number"==typeof e.timestampOffset&&(this.isPendingTimestampOffset_=!1,this.timelineChangeController_.pendingTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline})),this.loadSegment_(e));}},i.isEndOfStream_=function(e,t,i){if(void 0===e&&(e=this.mediaIndex),void 0===t&&(t=this.playlist_),void 0===i&&(i=this.partIndex),!t||!this.mediaSource_)return!1;var n="number"==typeof e&&t.segments[e],r=e+1===t.segments.length,a=!n||!n.parts||i+1===n.parts.length;return t.endList&&"open"===this.mediaSource_.readyState&&r&&a;},i.chooseNextRequest_=function(){var e=na(this.buffered_())||0,t=Math.max(0,e-this.currentTime_()),i=!this.hasPlayed_()&&t>=1,n=t>=this.goalBufferLength_(),r=this.playlist_.segments;if(!r.length||i||n)return null;this.syncPoint_=this.syncPoint_||this.syncController_.getSyncPoint(this.playlist_,this.duration_(),this.currentTimeline_,this.currentTime_());var a={partIndex:null,mediaIndex:null,startOfSegment:null,playlist:this.playlist_,isSyncRequest:Boolean(!this.syncPoint_)};if(a.isSyncRequest)a.mediaIndex=function(e,t,i){t=t||[];for(var n=[],r=0,a=0;ai))return a;}return 0===n.length?0:n[n.length-1];}(this.currentTimeline_,r,e);else if(null!==this.mediaIndex){var s=r[this.mediaIndex],o="number"==typeof this.partIndex?this.partIndex:-1;a.startOfSegment=s.end?s.end:e,s.parts&&s.parts[o+1]?(a.mediaIndex=this.mediaIndex,a.partIndex=o+1):a.mediaIndex=this.mediaIndex+1;}else{var u=Ta.getMediaInfoForTime({experimentalExactManifestTimings:this.experimentalExactManifestTimings,playlist:this.playlist_,currentTime:this.fetchAtBuffer_?e:this.currentTime_(),startingPartIndex:this.syncPoint_.partIndex,startingSegmentIndex:this.syncPoint_.segmentIndex,startTime:this.syncPoint_.time}),l=u.segmentIndex,d=u.startTime,h=u.partIndex;a.getMediaInfoForTime=this.fetchAtBuffer_?"bufferedEnd":"currentTime",a.mediaIndex=l,a.startOfSegment=d,a.partIndex=h;}var c=r[a.mediaIndex],f=c&&"number"==typeof a.partIndex&&c.parts&&c.parts[a.partIndex];if(!c||"number"==typeof a.partIndex&&!f)return null;"number"!=typeof a.partIndex&&c.parts&&(a.partIndex=0);var p=this.mediaSource_&&"ended"===this.mediaSource_.readyState;return a.mediaIndex>=r.length-1&&p&&!this.seeking_()?null:this.generateSegmentInfo_(a);},i.generateSegmentInfo_=function(e){var t=e.playlist,i=e.mediaIndex,n=e.startOfSegment,r=e.isSyncRequest,a=e.partIndex,s=e.forceTimestampOffset,o=e.getMediaInfoForTime,u=t.segments[i],l="number"==typeof a&&u.parts[a],d={requestId:"segment-loader-"+Math.random(),uri:l&&l.resolvedUri||u.resolvedUri,mediaIndex:i,partIndex:l?a:null,isSyncRequest:r,startOfSegment:n,playlist:t,bytes:null,encryptedBytes:null,timestampOffset:null,timeline:u.timeline,duration:l&&l.duration||u.duration,segment:u,part:l,byteLength:0,transmuxer:this.transmuxer_,getMediaInfoForTime:o},h=void 0!==s?s:this.isPendingTimestampOffset_;d.timestampOffset=this.timestampOffsetForSegment_({segmentTimeline:u.timeline,currentTimeline:this.currentTimeline_,startOfSegment:n,buffered:this.buffered_(),overrideCheck:h});var c=na(this.sourceUpdater_.audioBuffered());return"number"==typeof c&&(d.audioAppendStart=c-this.sourceUpdater_.audioTimestampOffset()),this.sourceUpdater_.videoBuffered().length&&(d.gopsToAlignWith=function(e,t,i){if(null==t||!e.length)return[];var n,r=Math.ceil((t-i+3)*E.ONE_SECOND_IN_TS);for(n=0;nr);n++){;}return e.slice(n);}(this.gopBuffer_,this.currentTime_()-this.sourceUpdater_.videoTimestampOffset(),this.timeMapping_)),d;},i.timestampOffsetForSegment_=function(e){return i=(t=e).segmentTimeline,n=t.currentTimeline,r=t.startOfSegment,a=t.buffered,t.overrideCheck||i!==n?i "+s+" for "+e),function(e,t,i){if(!e[i]){t.trigger({type:"usage",name:"vhs-608"}),t.trigger({type:"usage",name:"hls-608"});var n=i;/^cc708_/.test(i)&&(n="SERVICE"+i.split("_")[1]);var r=t.textTracks().getTrackById(n);if(r)e[i]=r;else{var a=i,s=i,o=!1,u=(t.options_.vhs&&t.options_.vhs.captionServices||{})[n];u&&(a=u.label,s=u.language,o=u["default"]),e[i]=t.addRemoteTextTrack({kind:"captions",id:n,"default":o,label:a,language:s},!1).track;}}}(u,i.vhs_.tech_,e),Gs(a,s,u[e]),function(e){var t=e.inbandTextTracks,i=e.captionArray,n=e.timestampOffset;if(i){var r=A["default"].WebKitDataCue||A["default"].VTTCue;i.forEach(function(e){var i=e.stream;t[i].addCue(new r(e.startTime+n,e.endTime+n,e.text));});}}({captionArray:o,inbandTextTracks:u,timestampOffset:n});}),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"});}else this.metadataQueue_.caption.push(this.handleCaptions_.bind(this,e,t));}else this.logger_("SegmentLoader received no captions from a caption event");},i.handleId3_=function(e,t,i){if(this.earlyAbortWhenNeeded_(e.stats),!this.checkForAbort_(e.requestId))if(this.pendingSegment_.hasAppendedData_){var n=null===this.sourceUpdater_.videoTimestampOffset()?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset();!function(e,t,i){e.metadataTrack_||(e.metadataTrack_=i.addRemoteTextTrack({kind:"metadata",label:"Timed Metadata"},!1).track,e.metadataTrack_.inBandMetadataTrackDispatchType=t);}(this.inbandTextTracks_,i,this.vhs_.tech_),zs({inbandTextTracks:this.inbandTextTracks_,metadataArray:t,timestampOffset:n,videoDuration:this.duration_()});}else this.metadataQueue_.id3.push(this.handleId3_.bind(this,e,t,i));},i.processMetadataQueue_=function(){this.metadataQueue_.id3.forEach(function(e){return e();}),this.metadataQueue_.caption.forEach(function(e){return e();}),this.metadataQueue_.id3=[],this.metadataQueue_.caption=[];},i.processCallQueue_=function(){var e=this.callQueue_;this.callQueue_=[],e.forEach(function(e){return e();});},i.processLoadQueue_=function(){var e=this.loadQueue_;this.loadQueue_=[],e.forEach(function(e){return e();});},i.hasEnoughInfoToLoad_=function(){if("audio"!==this.loaderType_)return!0;var e=this.pendingSegment_;return!!e&&(!this.getCurrentMediaInfo_()||!Ks({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}));},i.getCurrentMediaInfo_=function(e){return void 0===e&&(e=this.pendingSegment_),e&&e.trackInfo||this.currentMediaInfo_;},i.getMediaInfo_=function(e){return void 0===e&&(e=this.pendingSegment_),this.getCurrentMediaInfo_(e)||this.startingMediaInfo_;},i.hasEnoughInfoToAppend_=function(){if(!this.sourceUpdater_.ready())return!1;if(this.waitingOnRemove_||this.quotaExceededErrorRetryTimeout_)return!1;var e=this.pendingSegment_,t=this.getCurrentMediaInfo_();if(!e||!t)return!1;var i=t.hasAudio,n=t.hasVideo,r=t.isMuxed;return!(n&&!e.videoTimingInfo)&&!(i&&!this.audioDisabled_&&!r&&!e.audioTimingInfo)&&!Ks({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_});},i.handleData_=function(e,t){if(this.earlyAbortWhenNeeded_(e.stats),!this.checkForAbort_(e.requestId))if(!this.callQueue_.length&&this.hasEnoughInfoToAppend_()){var i=this.pendingSegment_;if(this.setTimeMapping_(i.timeline),this.updateMediaSecondsLoaded_(i.segment),"closed"!==this.mediaSource_.readyState){if(e.map&&(e.map=this.initSegmentForMap(e.map,!0),i.segment.map=e.map),e.key&&this.segmentKey(e.key,!0),i.isFmp4=e.isFmp4,i.timingInfo=i.timingInfo||{},i.isFmp4)this.trigger("fmp4"),i.timingInfo.start=i[qs(t.type)].start;else{var n,r=this.getCurrentMediaInfo_(),a="main"===this.loaderType_&&r&&r.hasVideo;a&&(n=i.videoTimingInfo.start),i.timingInfo.start=this.trueSegmentStart_({currentStart:i.timingInfo.start,playlist:i.playlist,mediaIndex:i.mediaIndex,currentVideoTimestampOffset:this.sourceUpdater_.videoTimestampOffset(),useVideoTimingInfo:a,firstVideoFrameTimeForData:n,videoTimingInfo:i.videoTimingInfo,audioTimingInfo:i.audioTimingInfo});}if(this.updateAppendInitSegmentStatus(i,t.type),this.updateSourceBufferTimestampOffset_(i),i.isSyncRequest){this.updateTimingInfoEnd_(i),this.syncController_.saveSegmentTimingInfo({segmentInfo:i,shouldSaveTimelineMapping:"main"===this.loaderType_});var s=this.chooseNextRequest_();if(s.mediaIndex!==i.mediaIndex||s.partIndex!==i.partIndex)return void this.logger_("sync segment was incorrect, not appending");this.logger_("sync segment was correct, appending");}i.hasAppendedData_=!0,this.processMetadataQueue_(),this.appendData_(i,t);}}else this.callQueue_.push(this.handleData_.bind(this,e,t));},i.updateAppendInitSegmentStatus=function(e,t){"main"!==this.loaderType_||"number"!=typeof e.timestampOffset||e.changedTimestampOffset||(this.appendInitSegment_={audio:!0,video:!0}),this.playlistOfLastInitSegment_[t]!==e.playlist&&(this.appendInitSegment_[t]=!0);},i.getInitSegmentAndUpdateState_=function(e){var t=e.type,i=e.initSegment,n=e.map,r=e.playlist;if(n){var a=Wa(n);if(this.activeInitSegmentId_===a)return null;i=this.initSegmentForMap(n,!0).bytes,this.activeInitSegmentId_=a;}return i&&this.appendInitSegment_[t]?(this.playlistOfLastInitSegment_[t]=r,this.appendInitSegment_[t]=!1,this.activeInitSegmentId_=null,i):null;},i.handleQuotaExceededError_=function(e,t){var i=this,n=e.segmentInfo,r=e.type,a=e.bytes,s=this.sourceUpdater_.audioBuffered(),o=this.sourceUpdater_.videoBuffered();s.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the audio buffer: "+ia(s).join(", ")),o.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the video buffer: "+ia(o).join(", "));var u=s.length?s.start(0):0,l=s.length?s.end(s.length-1):0,d=o.length?o.start(0):0,h=o.length?o.end(o.length-1):0;if(l-u<=1&&h-d<=1)return this.logger_("On QUOTA_EXCEEDED_ERR, single segment too large to append to buffer, triggering an error. Appended byte length: "+a.byteLength+", audio buffer: "+ia(s).join(", ")+", video buffer: "+ia(o).join(", ")+", "),this.error({message:"Quota exceeded error with append of a single segment of content",excludeUntil:1/0}),void this.trigger("error");this.waitingOnRemove_=!0,this.callQueue_.push(this.appendToSourceBuffer_.bind(this,{segmentInfo:n,type:r,bytes:a}));var c=this.currentTime_()-1;this.logger_("On QUOTA_EXCEEDED_ERR, removing audio/video from 0 to "+c),this.remove(0,c,function(){i.logger_("On QUOTA_EXCEEDED_ERR, retrying append in 1s"),i.waitingOnRemove_=!1,i.quotaExceededErrorRetryTimeout_=A["default"].setTimeout(function(){i.logger_("On QUOTA_EXCEEDED_ERR, re-processing call queue"),i.quotaExceededErrorRetryTimeout_=null,i.processCallQueue_();},1e3);},!0);},i.handleAppendError_=function(e,t){var i=e.segmentInfo,n=e.type,r=e.bytes;t&&(22!==t.code?(this.logger_("Received non QUOTA_EXCEEDED_ERR on append",t),this.error(n+" append of "+r.length+"b failed for segment #"+i.mediaIndex+" in playlist "+i.playlist.id),this.trigger("appenderror")):this.handleQuotaExceededError_({segmentInfo:i,type:n,bytes:r}));},i.appendToSourceBuffer_=function(e){var t,i,n,r=e.segmentInfo,a=e.type,s=e.initSegment,o=e.data,u=e.bytes;if(!u){var l=[o],d=o.byteLength;s&&(l.unshift(s),d+=s.byteLength),n=0,(t={bytes:d,segments:l}).bytes&&(i=new Uint8Array(t.bytes),t.segments.forEach(function(e){i.set(e,n),n+=e.byteLength;})),u=i;}this.sourceUpdater_.appendBuffer({segmentInfo:r,type:a,bytes:u},this.handleAppendError_.bind(this,{segmentInfo:r,type:a,bytes:u}));},i.handleSegmentTimingInfo_=function(e,t,i){if(this.pendingSegment_&&t===this.pendingSegment_.requestId){var n=this.pendingSegment_.segment,r=e+"TimingInfo";n[r]||(n[r]={}),n[r].transmuxerPrependedSeconds=i.prependedContentDuration||0,n[r].transmuxedPresentationStart=i.start.presentation,n[r].transmuxedDecodeStart=i.start.decode,n[r].transmuxedPresentationEnd=i.end.presentation,n[r].transmuxedDecodeEnd=i.end.decode,n[r].baseMediaDecodeTime=i.baseMediaDecodeTime;}},i.appendData_=function(e,t){var i=t.type,n=t.data;if(n&&n.byteLength&&("audio"!==i||!this.audioDisabled_)){var r=this.getInitSegmentAndUpdateState_({type:i,initSegment:t.initSegment,playlist:e.playlist,map:e.isFmp4?e.segment.map:null});this.appendToSourceBuffer_({segmentInfo:e,type:i,initSegment:r,data:n});}},i.loadSegment_=function(e){var t=this;this.state="WAITING",this.pendingSegment_=e,this.trimBackBuffer_(e),"number"==typeof e.timestampOffset&&this.transmuxer_&&this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),this.hasEnoughInfoToLoad_()?this.updateTransmuxerAndRequestSegment_(e):this.loadQueue_.push(function(){var i=x["default"]({},e,{forceTimestampOffset:!0});x["default"](e,t.generateSegmentInfo_(i)),t.isPendingTimestampOffset_=!1,t.updateTransmuxerAndRequestSegment_(e);});},i.updateTransmuxerAndRequestSegment_=function(e){var t=this;this.shouldUpdateTransmuxerTimestampOffset_(e.timestampOffset)&&(this.gopBuffer_.length=0,e.gopsToAlignWith=[],this.timeMapping_=0,this.transmuxer_.postMessage({action:"reset"}),this.transmuxer_.postMessage({action:"setTimestampOffset",timestampOffset:e.timestampOffset}));var i=this.createSimplifiedSegmentObj_(e),n=this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex),r=null!==this.mediaIndex,a=e.timeline!==this.currentTimeline_&&e.timeline>0,s=n||r&&a;this.logger_("Requesting "+Ys(e)),i.map&&!i.map.bytes&&(this.logger_("going to request init segment."),this.appendInitSegment_={video:!0,audio:!0}),e.abortRequests=Ps({xhr:this.vhs_.xhr,xhrOptions:this.xhrOptions_,decryptionWorker:this.decrypter_,segment:i,abortFn:this.handleAbort_.bind(this,e),progressFn:this.handleProgress_.bind(this),trackInfoFn:this.handleTrackInfo_.bind(this),timingInfoFn:this.handleTimingInfo_.bind(this),videoSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"video",e.requestId),audioSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"audio",e.requestId),captionsFn:this.handleCaptions_.bind(this),isEndOfTimeline:s,endedTimelineFn:function endedTimelineFn(){t.logger_("received endedtimeline callback");},id3Fn:this.handleId3_.bind(this),dataFn:this.handleData_.bind(this),doneFn:this.segmentRequestFinished_.bind(this),onTransmuxerLog:function onTransmuxerLog(i){var n=i.message,r=i.level,a=i.stream;t.logger_(Ys(e)+" logged from transmuxer stream "+a+" as a "+r+": "+n);}});},i.trimBackBuffer_=function(e){var t=function(e,t,i){var n=t-ns.BACK_BUFFER_LENGTH;e.length&&(n=Math.max(n,e.start(0)));var r=t-i;return Math.min(r,n);}(this.seekable_(),this.currentTime_(),this.playlist_.targetDuration||10);t>0&&this.remove(0,t);},i.createSimplifiedSegmentObj_=function(e){var t=e.segment,i=e.part,n={resolvedUri:i?i.resolvedUri:t.resolvedUri,byterange:i?i.byterange:t.byterange,requestId:e.requestId,transmuxer:e.transmuxer,audioAppendStart:e.audioAppendStart,gopsToAlignWith:e.gopsToAlignWith,part:e.part},r=e.playlist.segments[e.mediaIndex-1];if(r&&r.timeline===t.timeline&&(r.videoTimingInfo?n.baseStartTime=r.videoTimingInfo.transmuxedDecodeEnd:r.audioTimingInfo&&(n.baseStartTime=r.audioTimingInfo.transmuxedDecodeEnd)),t.key){var a=t.key.iv||new Uint32Array([0,0,0,e.mediaIndex+e.playlist.mediaSequence]);n.key=this.segmentKey(t.key),n.key.iv=a;}return t.map&&(n.map=this.initSegmentForMap(t.map)),n;},i.saveTransferStats_=function(e){this.mediaRequests+=1,e&&(this.mediaBytesTransferred+=e.bytesReceived,this.mediaTransferDuration+=e.roundTripTime);},i.saveBandwidthRelatedStats_=function(e,t){this.pendingSegment_.byteLength=t.bytesReceived,e<1/60?this.logger_("Ignoring segment's bandwidth because its duration of "+e+" is less than the min to record "+1/60):(this.bandwidth=t.bandwidth,this.roundTrip=t.roundTripTime);},i.handleTimeout_=function(){this.mediaRequestsTimedout+=1,this.bandwidth=1,this.roundTrip=NaN,this.trigger("bandwidthupdate");},i.segmentRequestFinished_=function(e,t,i){if(this.callQueue_.length)this.callQueue_.push(this.segmentRequestFinished_.bind(this,e,t,i));else if(this.saveTransferStats_(t.stats),this.pendingSegment_&&t.requestId===this.pendingSegment_.requestId){if(e){if(this.pendingSegment_=null,this.state="READY",e.code===vs)return;return this.pause(),e.code===ys?void this.handleTimeout_():(this.mediaRequestsErrored+=1,this.error(e),void this.trigger("error"));}var n=this.pendingSegment_;this.saveBandwidthRelatedStats_(n.duration,t.stats),n.endOfAllRequests=t.endOfAllRequests,i.gopInfo&&(this.gopBuffer_=function(e,t,i){if(!t.length)return e;if(i)return t.slice();for(var n=t[0].pts,r=0;r=n);r++){;}return e.slice(0,r).concat(t);}(this.gopBuffer_,i.gopInfo,this.safeAppend_)),this.state="APPENDING",this.trigger("appending"),this.waitForAppendsToComplete_(n);}},i.setTimeMapping_=function(e){var t=this.syncController_.mappingForTimeline(e);null!==t&&(this.timeMapping_=t);},i.updateMediaSecondsLoaded_=function(e){"number"==typeof e.start&&"number"==typeof e.end?this.mediaSecondsLoaded+=e.end-e.start:this.mediaSecondsLoaded+=e.duration;},i.shouldUpdateTransmuxerTimestampOffset_=function(e){return null!==e&&("main"===this.loaderType_&&e!==this.sourceUpdater_.videoTimestampOffset()||!this.audioDisabled_&&e!==this.sourceUpdater_.audioTimestampOffset());},i.trueSegmentStart_=function(e){var t=e.currentStart,i=e.playlist,n=e.mediaIndex,r=e.firstVideoFrameTimeForData,a=e.currentVideoTimestampOffset,s=e.useVideoTimingInfo,o=e.videoTimingInfo,u=e.audioTimingInfo;if(void 0!==t)return t;if(!s)return u.start;var l=i.segments[n-1];return 0!==n&&l&&void 0!==l.start&&l.end===r+a?o.start:r;},i.waitForAppendsToComplete_=function(e){var t=this.getCurrentMediaInfo_(e);if(!t)return this.error({message:"No starting media returned, likely due to an unsupported media format.",blacklistDuration:1/0}),void this.trigger("error");var i=t.hasAudio,n=t.hasVideo,r=t.isMuxed,a="main"===this.loaderType_&&n,s=!this.audioDisabled_&&i&&!r;if(e.waitingOnAppends=0,!e.hasAppendedData_)return e.timingInfo||"number"!=typeof e.timestampOffset||(this.isPendingTimestampOffset_=!0),e.timingInfo={start:0},e.waitingOnAppends++,this.isPendingTimestampOffset_||(this.updateSourceBufferTimestampOffset_(e),this.processMetadataQueue_()),void this.checkAppendsDone_(e);a&&e.waitingOnAppends++,s&&e.waitingOnAppends++,a&&this.sourceUpdater_.videoQueueCallback(this.checkAppendsDone_.bind(this,e)),s&&this.sourceUpdater_.audioQueueCallback(this.checkAppendsDone_.bind(this,e));},i.checkAppendsDone_=function(e){this.checkForAbort_(e.requestId)||(e.waitingOnAppends--,0===e.waitingOnAppends&&this.handleAppendsDone_());},i.checkForIllegalMediaSwitch=function(e){var t=function(e,t,i){return"main"===e&&t&&i?i.hasAudio||i.hasVideo?t.hasVideo&&!i.hasVideo?"Only audio found in segment when we expected video. We can't switch to audio only from a stream that had video. To get rid of this message, please add codec information to the manifest.":!t.hasVideo&&i.hasVideo?"Video found in segment when we expected only audio. We can't switch to a stream with video from an audio only stream. To get rid of this message, please add codec information to the manifest.":null:"Neither audio nor video found in segment.":null;}(this.loaderType_,this.getCurrentMediaInfo_(),e);return!!t&&(this.error({message:t,blacklistDuration:1/0}),this.trigger("error"),!0);},i.updateSourceBufferTimestampOffset_=function(e){if(null!==e.timestampOffset&&"number"==typeof e.timingInfo.start&&!e.changedTimestampOffset&&"main"===this.loaderType_){var t=!1;e.timestampOffset-=e.timingInfo.start,e.changedTimestampOffset=!0,e.timestampOffset!==this.sourceUpdater_.videoTimestampOffset()&&(this.sourceUpdater_.videoTimestampOffset(e.timestampOffset),t=!0),e.timestampOffset!==this.sourceUpdater_.audioTimestampOffset()&&(this.sourceUpdater_.audioTimestampOffset(e.timestampOffset),t=!0),t&&this.trigger("timestampoffset");}},i.updateTimingInfoEnd_=function(e){e.timingInfo=e.timingInfo||{};var t=this.getMediaInfo_(),i="main"===this.loaderType_&&t&&t.hasVideo&&e.videoTimingInfo?e.videoTimingInfo:e.audioTimingInfo;i&&(e.timingInfo.end="number"==typeof i.end?i.end:i.start+e.duration);},i.handleAppendsDone_=function(){if(this.pendingSegment_&&this.trigger("appendsdone"),!this.pendingSegment_)return this.state="READY",void(this.paused()||this.monitorBuffer_());var e=this.pendingSegment_;this.updateTimingInfoEnd_(e),this.shouldSaveSegmentTimingInfo_&&this.syncController_.saveSegmentTimingInfo({segmentInfo:e,shouldSaveTimelineMapping:"main"===this.loaderType_});var t=Qs(e,this.sourceType_);if(t&&("warn"===t.severity?Yr.log.warn(t.message):this.logger_(t.message)),this.recordThroughput_(e),this.pendingSegment_=null,this.state="READY",!e.isSyncRequest||(this.trigger("syncinfoupdate"),e.hasAppendedData_)){this.logger_("Appended "+Ys(e)),this.addSegmentMetadataCue_(e),this.fetchAtBuffer_=!0,this.currentTimeline_!==e.timeline&&(this.timelineChangeController_.lastTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline}),"main"!==this.loaderType_||this.audioDisabled_||this.timelineChangeController_.lastTimelineChange({type:"audio",from:this.currentTimeline_,to:e.timeline})),this.currentTimeline_=e.timeline,this.trigger("syncinfoupdate");var i=e.segment;if(i.end&&this.currentTime_()-i.end>3*e.playlist.targetDuration)this.resetEverything();else null!==this.mediaIndex&&this.trigger("bandwidthupdate"),this.trigger("progress"),this.mediaIndex=e.mediaIndex,this.partIndex=e.partIndex,this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex)&&this.endOfStream(),this.trigger("appended"),e.hasAppendedData_&&this.mediaAppends++,this.paused()||this.monitorBuffer_();}else this.logger_("Throwing away un-appended sync request "+Ys(e));},i.recordThroughput_=function(e){if(e.duration<1/60)this.logger_("Ignoring segment's throughput because its duration of "+e.duration+" is less than the min to record "+1/60);else{var t=this.throughput.rate,i=Date.now()-e.endOfAllRequests+1,n=Math.floor(e.byteLength/i*8*1e3);this.throughput.rate+=(n-t)/++this.throughput.count;}},i.addSegmentMetadataCue_=function(e){if(this.segmentMetadataTrack_){var t=e.segment,i=t.start,n=t.end;if(Ws(i)&&Ws(n)){Gs(i,n,this.segmentMetadataTrack_);var r=A["default"].WebKitDataCue||A["default"].VTTCue,a={custom:t.custom,dateTimeObject:t.dateTimeObject,dateTimeString:t.dateTimeString,bandwidth:e.playlist.attributes.BANDWIDTH,resolution:e.playlist.attributes.RESOLUTION,codecs:e.playlist.attributes.CODECS,byteLength:e.byteLength,uri:e.uri,timeline:e.timeline,playlist:e.playlist.id,start:i,end:n},s=new r(i,n,JSON.stringify(a));s.value=a,this.segmentMetadataTrack_.addCue(s);}}},t;}(Yr.EventTarget);function Js(){}var Zs,eo=function eo(e){return"string"!=typeof e?e:e.replace(/./,function(e){return e.toUpperCase();});},to=["video","audio"],io=function io(e,t){var i=t[e+"Buffer"];return i&&i.updating||t.queuePending[e];},no=function e(t,i){if(0!==i.queue.length){var n=0,r=i.queue[n];if("mediaSource"!==r.type){if("mediaSource"!==t&&i.ready()&&"closed"!==i.mediaSource.readyState&&!io(t,i)){if(r.type!==t){if(null===(n=function(e,t){for(var i=0;i=e.playlist.segments.length){e=null;break;}e=this.generateSegmentInfo_({playlist:e.playlist,mediaIndex:e.mediaIndex+1,startOfSegment:e.startOfSegment+e.duration,isSyncRequest:e.isSyncRequest});}return e;},i.stopForError=function(e){this.error(e),this.state="READY",this.pause(),this.trigger("error");},i.segmentRequestFinished_=function(e,t,i){var n=this;if(this.subtitlesTrack_){if(this.saveTransferStats_(t.stats),!this.pendingSegment_)return this.state="READY",void(this.mediaRequestsAborted+=1);if(e)return e.code===ys&&this.handleTimeout_(),e.code===vs?this.mediaRequestsAborted+=1:this.mediaRequestsErrored+=1,void this.stopForError(e);var r=this.pendingSegment_;this.saveBandwidthRelatedStats_(r.duration,t.stats),this.state="APPENDING",this.trigger("appending");var a=r.segment;if(a.map&&(a.map.bytes=t.map.bytes),r.bytes=t.bytes,"function"!=typeof A["default"].WebVTT&&this.subtitlesTrack_&&this.subtitlesTrack_.tech_){var s,o=function o(){n.subtitlesTrack_.tech_.off("vttjsloaded",s),n.stopForError({message:"Error loading vtt.js"});};return s=function s(){n.subtitlesTrack_.tech_.off("vttjserror",o),n.segmentRequestFinished_(e,t,i);},this.state="WAITING_ON_VTTJS",this.subtitlesTrack_.tech_.one("vttjsloaded",s),void this.subtitlesTrack_.tech_.one("vttjserror",o);}a.requested=!0;try{this.parseVTTCues_(r);}catch(e){return void this.stopForError({message:e.message});}if(this.updateTimeMapping_(r,this.syncController_.timelines[r.timeline],this.playlist_),r.cues.length?r.timingInfo={start:r.cues[0].startTime,end:r.cues[r.cues.length-1].endTime}:r.timingInfo={start:r.startOfSegment,end:r.startOfSegment+r.duration},r.isSyncRequest)return this.trigger("syncinfoupdate"),this.pendingSegment_=null,void(this.state="READY");r.byteLength=r.bytes.byteLength,this.mediaSecondsLoaded+=a.duration,r.cues.forEach(function(e){n.subtitlesTrack_.addCue(n.featuresNativeTextTracks_?new A["default"].VTTCue(e.startTime,e.endTime,e.text):e);}),function(e){var t=e.cues;if(t)for(var i=0;i1&&n.push(t[a]);}n.length&&n.forEach(function(t){return e.removeCue(t);});}}(this.subtitlesTrack_),this.handleAppendsDone_();}else this.state="READY";},i.handleData_=function(){},i.updateTimingInfoEnd_=function(){},i.parseVTTCues_=function(e){var t,i=!1;"function"==typeof A["default"].TextDecoder?t=new A["default"].TextDecoder("utf8"):(t=A["default"].WebVTT.StringDecoder(),i=!0);var n=new A["default"].WebVTT.Parser(A["default"],A["default"].vttjs,t);if(e.cues=[],e.timestampmap={MPEGTS:0,LOCAL:0},n.oncue=e.cues.push.bind(e.cues),n.ontimestampmap=function(t){e.timestampmap=t;},n.onparsingerror=function(e){Yr.log.warn("Error encountered when parsing cues: "+e.message);},e.segment.map){var r=e.segment.map.bytes;i&&(r=bo(r)),n.parse(r);}var a=e.bytes;i&&(a=bo(a)),n.parse(a),n.flush();},i.updateTimeMapping_=function(e,t,i){var n=e.segment;if(t)if(e.cues.length){var r=e.timestampmap,a=r.MPEGTS/E.ONE_SECOND_IN_TS-r.LOCAL+t.mapping;if(e.cues.forEach(function(e){e.startTime+=a,e.endTime+=a;}),!i.syncInfo){var s=e.cues[0].startTime,o=e.cues[e.cues.length-1].startTime;i.syncInfo={mediaSequence:i.mediaSequence+e.mediaIndex,time:Math.min(s,o-n.duration)};}}else n.empty=!0;},t;}($s),Eo=function Eo(e,t){for(var i=e.cues,n=0;n=r.adStartTime&&t<=r.adEndTime)return r;}return null;},wo=[{name:"VOD",run:function run(e,t,i,n,r){if(i!==1/0){return{time:0,segmentIndex:0,partIndex:null};}return null;}},{name:"ProgramDateTime",run:function run(e,t,i,n,r){if(!Object.keys(e.timelineToDatetimeMappings).length)return null;var a=null,s=null,o=aa(t);r=r||0;for(var u=0;u=c)&&(s=c,a={time:h,segmentIndex:l.segmentIndex,partIndex:l.partIndex});}}return a;}},{name:"Discontinuity",run:function run(e,t,i,n,r){var a=null;if(r=r||0,t.discontinuityStarts&&t.discontinuityStarts.length)for(var s=null,o=0;o=h)&&(s=h,a={time:d.time,segmentIndex:u,partIndex:null});}}return a;}},{name:"Playlist",run:function run(e,t,i,n,r){return t.syncInfo?{time:t.syncInfo.time,segmentIndex:t.syncInfo.mediaSequence-t.mediaSequence,partIndex:null}:null;}}],Co=function(e){function t(t){var i;return(i=e.call(this)||this).timelines=[],i.discontinuities=[],i.timelineToDatetimeMappings={},i.logger_=$r("SyncController"),i;}P["default"](t,e);var i=t.prototype;return i.getSyncPoint=function(e,t,i,n){var r=this.runStrategies_(e,t,i,n);return r.length?this.selectSyncPoint_(r,{key:"time",value:n}):null;},i.getExpiredTime=function(e,t){if(!e||!e.segments)return null;var i=this.runStrategies_(e,t,e.discontinuitySequence,0);if(!i.length)return null;var n=this.selectSyncPoint_(i,{key:"segmentIndex",value:0});return n.segmentIndex>0&&(n.time*=-1),Math.abs(n.time+ha({defaultDuration:e.targetDuration,durationList:e.segments,startIndex:n.segmentIndex,endIndex:0}));},i.runStrategies_=function(e,t,i,n){for(var r=[],a=0;a=0;i--){var n=e.segments[i];if(n&&void 0!==n.start){t.syncInfo={mediaSequence:e.mediaSequence+i,time:n.start},this.logger_("playlist refresh sync: [time:"+t.syncInfo.time+", mediaSequence: "+t.syncInfo.mediaSequence+"]"),this.trigger("syncinfoupdate");break;}}},i.setDateTimeMappingForStart=function(e){if(this.timelineToDatetimeMappings={},e.segments&&e.segments.length&&e.segments[0].dateTimeObject){var t=e.segments[0],i=t.dateTimeObject.getTime()/1e3;this.timelineToDatetimeMappings[t.timeline]=-i;}},i.saveSegmentTimingInfo=function(e){var t=e.segmentInfo,i=e.shouldSaveTimelineMapping,n=this.calculateSegmentTimeMapping_(t,t.timingInfo,i),r=t.segment;n&&(this.saveDiscontinuitySyncInfo_(t),t.playlist.syncInfo||(t.playlist.syncInfo={mediaSequence:t.playlist.mediaSequence+t.mediaIndex,time:r.start}));var a=r.dateTimeObject;r.discontinuity&&i&&a&&(this.timelineToDatetimeMappings[r.timeline]=-a.getTime()/1e3);},i.timestampOffsetForTimeline=function(e){return void 0===this.timelines[e]?null:this.timelines[e].time;},i.mappingForTimeline=function(e){return void 0===this.timelines[e]?null:this.timelines[e].mapping;},i.calculateSegmentTimeMapping_=function(e,t,i){var n,r,a=e.segment,s=e.part,o=this.timelines[e.timeline];if("number"==typeof e.timestampOffset)o={time:e.startOfSegment,mapping:e.startOfSegment-t.start},i&&(this.timelines[e.timeline]=o,this.trigger("timestampoffset"),this.logger_("time mapping for timeline "+e.timeline+": [time: "+o.time+"] [mapping: "+o.mapping+"]")),n=e.startOfSegment,r=t.end+o.mapping;else{if(!o)return!1;n=t.start+o.mapping,r=t.end+o.mapping;}return s&&(s.start=n,s.end=r),(!a.start||no){var u=void 0;u=s<0?i.start-ha({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex,endIndex:r}):i.end+ha({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex+1,endIndex:r}),this.discontinuities[a]={time:u,accuracy:o};}}},i.dispose=function(){this.trigger("dispose"),this.off();},t;}(Yr.EventTarget),Ao=function(e){function t(){var t;return(t=e.call(this)||this).pendingTimelineChanges_={},t.lastTimelineChanges_={},t;}P["default"](t,e);var i=t.prototype;return i.clearPendingTimelineChange=function(e){this.pendingTimelineChanges_[e]=null,this.trigger("pendingtimelinechange");},i.pendingTimelineChange=function(e){var t=e.type,i=e.from,n=e.to;return"number"==typeof i&&"number"==typeof n&&(this.pendingTimelineChanges_[t]={type:t,from:i,to:n},this.trigger("pendingtimelinechange")),this.pendingTimelineChanges_[t];},i.lastTimelineChange=function(e){var t=e.type,i=e.from,n=e.to;return"number"==typeof i&&"number"==typeof n&&(this.lastTimelineChanges_[t]={type:t,from:i,to:n},delete this.pendingTimelineChanges_[t],this.trigger("timelinechange")),this.lastTimelineChanges_[t];},i.dispose=function(){this.trigger("dispose"),this.pendingTimelineChanges_={},this.lastTimelineChanges_={},this.off();},t;}(Yr.EventTarget),ko=as(ss(os(function(){function e(e,t,i){return e(i={path:t,exports:{},require:function require(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs");}(null==t&&i.path);}},i.exports),i.exports;}var t=e(function(e){function t(e,t){for(var i=0;i-1;},t.trigger=function(e){var t=this.listeners[e];if(t)if(2===arguments.length)for(var i=t.length,n=0;n>7))^e]=e;}for(t=i=0;!h[t];t^=n||1,i=p[i]||1){for(a=(a=i^i<<1^i<<2^i<<3^i<<4)>>8^255&a^99,h[t]=a,c[a]=t,o=16843009*f[r=f[n=f[t]]]^65537*r^257*n^16843008*t,s=257*f[a]^16843008*a,e=0;e<4;e++){l[e][t]=s=s<<24^s>>>8,d[e][a]=o=o<<24^o>>>8;}}for(e=0;e<5;e++){l[e]=l[e].slice(0),d[e]=d[e].slice(0);}return u;}()),this._tables=[[a[0][0].slice(),a[0][1].slice(),a[0][2].slice(),a[0][3].slice(),a[0][4].slice()],[a[1][0].slice(),a[1][1].slice(),a[1][2].slice(),a[1][3].slice(),a[1][4].slice()]];var r=this._tables[0][4],s=this._tables[1],o=e.length,u=1;if(4!==o&&6!==o&&8!==o)throw new Error("Invalid aes key size");var l=e.slice(0),d=[];for(this._key=[l,d],t=o;t<4*o+28;t++){n=l[t-1],(t%o==0||8===o&&t%o==4)&&(n=r[n>>>24]<<24^r[n>>16&255]<<16^r[n>>8&255]<<8^r[255&n],t%o==0&&(n=n<<8^n>>>24^u<<24,u=u<<1^283*(u>>7))),l[t]=l[t-o]^n;}for(i=0;t;i++,t--){n=l[3&i?t:t-4],d[i]=t<=4||i<4?n:s[0][r[n>>>24]]^s[1][r[n>>16&255]]^s[2][r[n>>8&255]]^s[3][r[255&n]];}}return e.prototype.decrypt=function(e,t,i,n,r,a){var s,o,u,l,d=this._key[1],h=e^d[0],c=n^d[1],f=i^d[2],p=t^d[3],m=d.length/4-2,g=4,_=this._tables[1],y=_[0],v=_[1],b=_[2],T=_[3],S=_[4];for(l=0;l>>24]^v[c>>16&255]^b[f>>8&255]^T[255&p]^d[g],o=y[c>>>24]^v[f>>16&255]^b[p>>8&255]^T[255&h]^d[g+1],u=y[f>>>24]^v[p>>16&255]^b[h>>8&255]^T[255&c]^d[g+2],p=y[p>>>24]^v[h>>16&255]^b[c>>8&255]^T[255&f]^d[g+3],g+=4,h=s,c=o,f=u;}for(l=0;l<4;l++){r[(3&-l)+a]=S[h>>>24]<<24^S[c>>16&255]<<16^S[f>>8&255]<<8^S[255&p]^d[g++],s=h,h=c,c=f,f=p,p=s;}},e;}(),o=function(e){function t(){var t;return(t=e.call(this,r)||this).jobs=[],t.delay=1,t.timeout_=null,t;}n(t,e);var i=t.prototype;return i.processJob_=function(){this.jobs.shift()(),this.jobs.length?this.timeout_=setTimeout(this.processJob_.bind(this),this.delay):this.timeout_=null;},i.push=function(e){this.jobs.push(e),this.timeout_||(this.timeout_=setTimeout(this.processJob_.bind(this),this.delay));},t;}(r),u=function u(e){return e<<24|(65280&e)<<8|(16711680&e)>>8|e>>>24;},l=function(){function e(t,i,n,r){var a=e.STEP,s=new Int32Array(t.buffer),l=new Uint8Array(t.byteLength),d=0;for(this.asyncStream_=new o(),this.asyncStream_.push(this.decryptChunk_(s.subarray(d,d+a),i,n,l)),d=a;d>2),m=new s(Array.prototype.slice.call(t)),g=new Uint8Array(e.byteLength),_=new Int32Array(g.buffer);for(n=i[0],r=i[1],a=i[2],o=i[3],f=0;f=0&&(t="main-desc"),t;},Io=function Io(e,t){e.abort(),e.pause(),t&&t.activePlaylistLoader&&(t.activePlaylistLoader.pause(),t.activePlaylistLoader=null);},Po=function Po(e,t){t.activePlaylistLoader=e,e.load();},Lo={AUDIO:function AUDIO(e,t){return function(){var i=t.segmentLoaders[e],n=t.mediaTypes[e],r=t.blacklistCurrentPlaylist;Io(i,n);var a=n.activeTrack(),s=n.activeGroup(),o=(s.filter(function(e){return e["default"];})[0]||s[0]).id,u=n.tracks[o];if(a!==u){for(var l in Yr.log.warn("Problem encountered loading the alternate audio track.Switching back to default."),n.tracks){n.tracks[l].enabled=n.tracks[l]===u;}n.onTrackChanged();}else r({message:"Problem encountered loading the default audio track."});};},SUBTITLES:function SUBTITLES(e,t){return function(){var i=t.segmentLoaders[e],n=t.mediaTypes[e];Yr.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track."),Io(i,n);var r=n.activeTrack();r&&(r.mode="disabled"),n.onTrackChanged();};}},Do={AUDIO:function AUDIO(e,t,i){if(t){var n=i.tech,r=i.requestOptions,a=i.segmentLoaders[e];t.on("loadedmetadata",function(){var e=t.media();a.playlist(e,r),(!n.paused()||e.endList&&"none"!==n.preload())&&a.load();}),t.on("loadedplaylist",function(){a.playlist(t.media(),r),n.paused()||a.load();}),t.on("error",Lo[e](e,i));}},SUBTITLES:function SUBTITLES(e,t,i){var n=i.tech,r=i.requestOptions,a=i.segmentLoaders[e],s=i.mediaTypes[e];t.on("loadedmetadata",function(){var e=t.media();a.playlist(e,r),a.track(s.activeTrack()),(!n.paused()||e.endList&&"none"!==n.preload())&&a.load();}),t.on("loadedplaylist",function(){a.playlist(t.media(),r),n.paused()||a.load();}),t.on("error",Lo[e](e,i));}},Uo={AUDIO:function AUDIO(e,t){var i=t.vhs,n=t.sourceType,r=t.segmentLoaders[e],a=t.requestOptions,s=t.master.mediaGroups,o=t.mediaTypes[e],u=o.groups,l=o.tracks,d=o.logger_,h=t.masterPlaylistLoader,c=ba(h.master);for(var f in s[e]&&0!==Object.keys(s[e]).length||(s[e]={main:{"default":{"default":!0}}},c&&(s[e].main["default"].playlists=h.master.playlists)),s[e]){for(var p in u[f]||(u[f]=[]),s[e][f]){var m=s[e][f][p],g=void 0;if(c?(d("AUDIO group '"+f+"' label '"+p+"' is a master playlist"),m.isMasterPlaylist=!0,g=null):g="vhs-json"===n&&m.playlists?new Oa(m.playlists[0],i,a):m.resolvedUri?new Oa(m.resolvedUri,i,a):m.playlists&&"dash"===n?new is(m.playlists[0],i,a,h):null,m=Yr.mergeOptions({id:p,playlistLoader:g},m),Do[e](e,m.playlistLoader,t),u[f].push(m),void 0===l[p]){var _=new Yr.AudioTrack({id:p,kind:xo(m),enabled:!1,language:m.language,"default":m["default"],label:p});l[p]=_;}}}r.on("error",Lo[e](e,t));},SUBTITLES:function SUBTITLES(e,t){var i=t.tech,n=t.vhs,r=t.sourceType,a=t.segmentLoaders[e],s=t.requestOptions,o=t.master.mediaGroups,u=t.mediaTypes[e],l=u.groups,d=u.tracks,h=t.masterPlaylistLoader;for(var c in o[e]){for(var f in l[c]||(l[c]=[]),o[e][c]){if(!o[e][c][f].forced){var p=o[e][c][f],m=void 0;if("hls"===r)m=new Oa(p.resolvedUri,n,s);else if("dash"===r){if(!p.playlists.filter(function(e){return e.excludeUntil!==1/0;}).length)return;m=new is(p.playlists[0],n,s,h);}else"vhs-json"===r&&(m=new Oa(p.playlists?p.playlists[0]:p.resolvedUri,n,s));if(p=Yr.mergeOptions({id:f,playlistLoader:m},p),Do[e](e,p.playlistLoader,t),l[c].push(p),void 0===d[f]){var g=i.addRemoteTextTrack({id:f,kind:"subtitles","default":p["default"]&&p.autoselect,language:p.language,label:f},!1).track;d[f]=g;}}}}a.on("error",Lo[e](e,t));},"CLOSED-CAPTIONS":function CLOSEDCAPTIONS(e,t){var i=t.tech,n=t.master.mediaGroups,r=t.mediaTypes[e],a=r.groups,s=r.tracks;for(var o in n[e]){for(var u in a[o]||(a[o]=[]),n[e][o]){var l=n[e][o][u];if(/^(?:CC|SERVICE)/.test(l.instreamId)){var d=i.options_.vhs&&i.options_.vhs.captionServices||{},h={label:u,language:l.language,instreamId:l.instreamId,"default":l["default"]&&l.autoselect};if(d[h.instreamId]&&(h=Yr.mergeOptions(h,d[h.instreamId])),void 0===h["default"]&&delete h["default"],a[o].push(Yr.mergeOptions({id:u},l)),void 0===s[u]){var c=i.addRemoteTextTrack({id:h.instreamId,kind:"captions","default":h["default"],language:h.language,label:h.label},!1).track;s[u]=c;}}}}}},Ro=function e(t,i){for(var n=0;n1&&ba(t.master))for(var u=0;u "+a+" from "+t),this.tech_.trigger({type:"usage",name:"vhs-rendition-change-"+t})),this.masterPlaylistLoader_.media(e,i);},i.startABRTimer_=function(){var e=this;this.stopABRTimer_(),this.abrTimer_=A["default"].setInterval(function(){return e.checkABR_();},250);},i.stopABRTimer_=function(){this.tech_.scrubbing&&this.tech_.scrubbing()||(A["default"].clearInterval(this.abrTimer_),this.abrTimer_=null);},i.getAudioTrackPlaylists_=function(){var e=this.master(),t=e&&e.playlists||[];if(!e||!e.mediaGroups||!e.mediaGroups.AUDIO)return t;var i,n=e.mediaGroups.AUDIO,r=Object.keys(n);if(Object.keys(this.mediaTypes_.AUDIO.groups).length)i=this.mediaTypes_.AUDIO.activeTrack();else{var a=n.main||r.length&&n[r[0]];for(var s in a){if(a[s]["default"]){i={label:s};break;}}}if(!i)return t;var o=[];for(var u in n){if(n[u][i.label]){var l=n[u][i.label];if(l.playlists&&l.playlists.length)o.push.apply(o,l.playlists);else if(l.uri)o.push(l);else if(e.playlists.length)for(var d=0;d1&&(this.tech_.trigger({type:"usage",name:"vhs-alternate-audio"}),this.tech_.trigger({type:"usage",name:"hls-alternate-audio"})),this.useCueTags_&&(this.tech_.trigger({type:"usage",name:"vhs-playlist-cue-tags"}),this.tech_.trigger({type:"usage",name:"hls-playlist-cue-tags"}));},i.shouldSwitchToMedia_=function(e){var t=this.masterPlaylistLoader_.media(),i=this.tech_.buffered();return function(e){var t=e.currentPlaylist,i=e.nextPlaylist,n=e.forwardBuffer,r=e.bufferLowWaterLine,a=e.bufferHighWaterLine,s=e.duration,o=e.experimentalBufferBasedABR,u=e.log;if(!i)return Yr.log.warn("We received no playlist to switch to. Please check your stream."),!1;var l="allowing switch "+(t&&t.id||"null")+" -> "+i.id;if(!t)return u(l+" as current playlist is not set"),!0;if(i.id===t.id)return!1;if(!t.endList)return u(l+" as current playlist is live"),!0;var d=o?ns.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:ns.MAX_BUFFER_LOW_WATER_LINE;if(sc)&&n>=r){var p=l+" as forwardBuffer >= bufferLowWaterLine ("+n+" >= "+r+")";return o&&(p+=" and next bandwidth > current bandwidth ("+h+" > "+c+")"),u(p),!0;}return u("not "+l+" as no switching criteria met"),!1;}({currentPlaylist:t,nextPlaylist:e,forwardBuffer:i.length?i.end(i.length-1)-this.tech_.currentTime():0,bufferLowWaterLine:this.bufferLowWaterLine(),bufferHighWaterLine:this.bufferHighWaterLine(),duration:this.duration(),experimentalBufferBasedABR:this.experimentalBufferBasedABR,log:this.logger_});},i.setupSegmentLoaderListeners_=function(){var e=this;this.experimentalBufferBasedABR||(this.mainSegmentLoader_.on("bandwidthupdate",function(){var t=e.selectPlaylist();e.shouldSwitchToMedia_(t)&&e.switchMedia_(t,"bandwidthupdate"),e.tech_.trigger("bandwidthupdate");}),this.mainSegmentLoader_.on("progress",function(){e.trigger("progress");})),this.mainSegmentLoader_.on("error",function(){e.blacklistCurrentPlaylist(e.mainSegmentLoader_.error());}),this.mainSegmentLoader_.on("appenderror",function(){e.error=e.mainSegmentLoader_.error_,e.trigger("error");}),this.mainSegmentLoader_.on("syncinfoupdate",function(){e.onSyncInfoUpdate_();}),this.mainSegmentLoader_.on("timestampoffset",function(){e.tech_.trigger({type:"usage",name:"vhs-timestamp-offset"}),e.tech_.trigger({type:"usage",name:"hls-timestamp-offset"});}),this.audioSegmentLoader_.on("syncinfoupdate",function(){e.onSyncInfoUpdate_();}),this.audioSegmentLoader_.on("appenderror",function(){e.error=e.audioSegmentLoader_.error_,e.trigger("error");}),this.mainSegmentLoader_.on("ended",function(){e.logger_("main segment loader ended"),e.onEndOfStream();}),this.mainSegmentLoader_.on("earlyabort",function(t){e.experimentalBufferBasedABR||(e.delegateLoaders_("all",["abort"]),e.blacklistCurrentPlaylist({message:"Aborted early because there isn't enough bandwidth to complete the request without rebuffering."},120));});var t=function t(){if(!e.sourceUpdater_.hasCreatedSourceBuffers())return e.tryToCreateSourceBuffers_();var t=e.getCodecsOrExclude_();t&&e.sourceUpdater_.addOrChangeSourceBuffers(t);};this.mainSegmentLoader_.on("trackinfo",t),this.audioSegmentLoader_.on("trackinfo",t),this.mainSegmentLoader_.on("fmp4",function(){e.triggeredFmp4Usage||(e.tech_.trigger({type:"usage",name:"vhs-fmp4"}),e.tech_.trigger({type:"usage",name:"hls-fmp4"}),e.triggeredFmp4Usage=!0);}),this.audioSegmentLoader_.on("fmp4",function(){e.triggeredFmp4Usage||(e.tech_.trigger({type:"usage",name:"vhs-fmp4"}),e.tech_.trigger({type:"usage",name:"hls-fmp4"}),e.triggeredFmp4Usage=!0);}),this.audioSegmentLoader_.on("ended",function(){e.logger_("audioSegmentLoader ended"),e.onEndOfStream();});},i.mediaSecondsLoaded_=function(){return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded+this.mainSegmentLoader_.mediaSecondsLoaded);},i.load=function(){this.mainSegmentLoader_.load(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.load(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.load();},i.smoothQualityChange_=function(e){void 0===e&&(e=this.selectPlaylist()),this.fastQualityChange_(e);},i.fastQualityChange_=function(e){var t=this;void 0===e&&(e=this.selectPlaylist()),e!==this.masterPlaylistLoader_.media()?(this.switchMedia_(e,"fast-quality"),this.mainSegmentLoader_.resetEverything(function(){Yr.browser.IE_VERSION||Yr.browser.IS_EDGE?t.tech_.setCurrentTime(t.tech_.currentTime()+.04):t.tech_.setCurrentTime(t.tech_.currentTime());})):this.logger_("skipping fastQualityChange because new media is same as old");},i.play=function(){if(!this.setupFirstPlay()){this.tech_.ended()&&this.tech_.setCurrentTime(0),this.hasPlayed_&&this.load();var e=this.tech_.seekable();return this.tech_.duration()===1/0&&this.tech_.currentTime()this.maxPlaylistRetries?1/0:Date.now()+1e3*t,i.excludeUntil=n,e.reason&&(i.lastExcludeReason_=e.reason),this.tech_.trigger("blacklistplaylist"),this.tech_.trigger({type:"usage",name:"vhs-rendition-blacklisted"}),this.tech_.trigger({type:"usage",name:"hls-rendition-blacklisted"});var u=this.selectPlaylist();if(!u)return this.error="Playback cannot continue. No available working or supported playlists.",void this.trigger("error");var l=e.internal?this.logger_:Yr.log.warn,d=e.message?" "+e.message:"";l((e.internal?"Internal problem":"Problem")+" encountered with playlist "+i.id+"."+d+" Switching to playlist "+u.id+"."),u.attributes.AUDIO!==i.attributes.AUDIO&&this.delegateLoaders_("audio",["abort","pause"]),u.attributes.SUBTITLES!==i.attributes.SUBTITLES&&this.delegateLoaders_("subtitle",["abort","pause"]),this.delegateLoaders_("main",["abort","pause"]);var h=u.targetDuration/2*1e3||5e3,c="number"==typeof u.lastRequest&&Date.now()-u.lastRequest<=h;return this.switchMedia_(u,"exclude",s||c);},i.pauseLoading=function(){this.delegateLoaders_("all",["abort","pause"]),this.stopABRTimer_();},i.delegateLoaders_=function(e,t){var i=this,n=[],r="all"===e;(r||"main"===e)&&n.push(this.masterPlaylistLoader_);var a=[];(r||"audio"===e)&&a.push("AUDIO"),(r||"subtitle"===e)&&(a.push("CLOSED-CAPTIONS"),a.push("SUBTITLES")),a.forEach(function(e){var t=i.mediaTypes_[e]&&i.mediaTypes_[e].activePlaylistLoader;t&&n.push(t);}),["main","audio","subtitle"].forEach(function(t){var r=i[t+"SegmentLoader_"];!r||e!==t&&"all"!==e||n.push(r);}),n.forEach(function(e){return t.forEach(function(t){"function"==typeof e[t]&&e[t]();});});},i.setCurrentTime=function(e){var t=Zr(this.tech_.buffered(),e);return this.masterPlaylistLoader_&&this.masterPlaylistLoader_.media()&&this.masterPlaylistLoader_.media().segments?t&&t.length?e:(this.mainSegmentLoader_.resetEverything(),this.mainSegmentLoader_.abort(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.resetEverything(),this.audioSegmentLoader_.abort()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.resetEverything(),this.subtitleSegmentLoader_.abort()),void this.load()):0;},i.duration=function(){if(!this.masterPlaylistLoader_)return 0;var e=this.masterPlaylistLoader_.media();return e?e.endList?this.mediaSource?this.mediaSource.duration:Zs.Playlist.duration(e):1/0:0;},i.seekable=function(){return this.seekable_;},i.onSyncInfoUpdate_=function(){var e;if(this.masterPlaylistLoader_){var t=this.masterPlaylistLoader_.media();if(t){var i=this.syncController_.getExpiredTime(t,this.duration());if(null!==i){var n=this.masterPlaylistLoader_.master,r=Zs.Playlist.seekable(t,i,Zs.Playlist.liveEdgeDelay(n,t));if(0!==r.length){if(this.mediaTypes_.AUDIO.activePlaylistLoader){if(t=this.mediaTypes_.AUDIO.activePlaylistLoader.media(),null===(i=this.syncController_.getExpiredTime(t,this.duration())))return;if(0===(e=Zs.Playlist.seekable(t,i,Zs.Playlist.liveEdgeDelay(n,t))).length)return;}var a,s;this.seekable_&&this.seekable_.length&&(a=this.seekable_.end(0),s=this.seekable_.start(0)),e?e.start(0)>r.end(0)||r.start(0)>e.end(0)?this.seekable_=r:this.seekable_=Yr.createTimeRanges([[e.start(0)>r.start(0)?e.start(0):r.start(0),e.end(0)0&&(n=Math.max(n,i.end(i.length-1))),this.mediaSource.duration!==n&&this.sourceUpdater_.setDuration(n);}},i.dispose=function(){var e=this;this.trigger("dispose"),this.decrypter_.terminate(),this.masterPlaylistLoader_.dispose(),this.mainSegmentLoader_.dispose(),this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_),["AUDIO","SUBTITLES"].forEach(function(t){var i=e.mediaTypes_[t].groups;for(var n in i){i[n].forEach(function(e){e.playlistLoader&&e.playlistLoader.dispose();});}}),this.audioSegmentLoader_.dispose(),this.subtitleSegmentLoader_.dispose(),this.sourceUpdater_.dispose(),this.timelineChangeController_.dispose(),this.stopABRTimer_(),this.updateDuration_&&this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.mediaSource.removeEventListener("durationchange",this.handleDurationChange_),this.mediaSource.removeEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.removeEventListener("sourceended",this.handleSourceEnded_),this.off();},i.master=function(){return this.masterPlaylistLoader_.master;},i.media=function(){return this.masterPlaylistLoader_.media()||this.initialMedia_;},i.areMediaTypesKnown_=function(){var e=!!this.mediaTypes_.AUDIO.activePlaylistLoader,t=!!this.mainSegmentLoader_.getCurrentMediaInfo_(),i=!e||!!this.audioSegmentLoader_.getCurrentMediaInfo_();return!(!t||!i);},i.getCodecsOrExclude_=function(){var e=this,t={main:this.mainSegmentLoader_.getCurrentMediaInfo_()||{},audio:this.audioSegmentLoader_.getCurrentMediaInfo_()||{}};t.video=t.main;var i=Os(this.master(),this.media()),n={},r=!!this.mediaTypes_.AUDIO.activePlaylistLoader;if(t.main.hasVideo&&(n.video=i.video||t.main.videoCodec||g.DEFAULT_VIDEO_CODEC),t.main.isMuxed&&(n.video+=","+(i.audio||t.main.audioCodec||g.DEFAULT_AUDIO_CODEC)),(t.main.hasAudio&&!t.main.isMuxed||t.audio.hasAudio||r)&&(n.audio=i.audio||t.main.audioCodec||t.audio.audioCodec||g.DEFAULT_AUDIO_CODEC,t.audio.isFmp4=t.main.hasAudio&&!t.main.isMuxed?t.main.isFmp4:t.audio.isFmp4),n.audio||n.video){var a,s={};if(["video","audio"].forEach(function(e){if(n.hasOwnProperty(e)&&(r=t[e].isFmp4,o=n[e],!(r?g.browserSupportsCodec(o):g.muxerSupportsCodec(o)))){var i=t[e].isFmp4?"browser":"muxer";s[i]=s[i]||[],s[i].push(n[e]),"audio"===e&&(a=i);}var r,o;}),r&&a&&this.media().attributes.AUDIO){var o=this.media().attributes.AUDIO;this.master().playlists.forEach(function(t){(t.attributes&&t.attributes.AUDIO)===o&&t!==e.media()&&(t.excludeUntil=1/0);}),this.logger_("excluding audio group "+o+" as "+a+' does not support codec(s): "'+n.audio+'"');}if(!Object.keys(s).length){if(this.sourceUpdater_.hasCreatedSourceBuffers()&&!this.sourceUpdater_.canChangeType()){var u=[];if(["video","audio"].forEach(function(t){var i=(g.parseCodecs(e.sourceUpdater_.codecs[t]||"")[0]||{}).type,r=(g.parseCodecs(n[t]||"")[0]||{}).type;i&&r&&i.toLowerCase()!==r.toLowerCase()&&u.push('"'+e.sourceUpdater_.codecs[t]+'" -> "'+n[t]+'"');}),u.length)return void this.blacklistCurrentPlaylist({playlist:this.media(),message:"Codec switching not supported: "+u.join(", ")+".",blacklistDuration:1/0,internal:!0});}return n;}var l=Object.keys(s).reduce(function(e,t){return e&&(e+=", "),e+=t+' does not support codec(s): "'+s[t].join(",")+'"';},"")+".";this.blacklistCurrentPlaylist({playlist:this.media(),internal:!0,message:l,blacklistDuration:1/0});}else this.blacklistCurrentPlaylist({playlist:this.media(),message:"Could not determine codecs for playlist.",blacklistDuration:1/0});},i.tryToCreateSourceBuffers_=function(){if("open"===this.mediaSource.readyState&&!this.sourceUpdater_.hasCreatedSourceBuffers()&&this.areMediaTypesKnown_()){var e=this.getCodecsOrExclude_();if(e){this.sourceUpdater_.createSourceBuffers(e);var t=[e.video,e.audio].filter(Boolean).join(",");this.excludeIncompatibleVariants_(t);}}},i.excludeUnsupportedVariants_=function(){var e=this,t=this.master().playlists,i=[];Object.keys(t).forEach(function(n){var r=t[n];if(-1===i.indexOf(r.id)){i.push(r.id);var a=Os(e.master,r),s=[];!a.audio||g.muxerSupportsCodec(a.audio)||g.browserSupportsCodec(a.audio)||s.push("audio codec "+a.audio),!a.video||g.muxerSupportsCodec(a.video)||g.browserSupportsCodec(a.video)||s.push("video codec "+a.video),a.text&&"stpp.ttml.im1t"===a.text&&s.push("text codec "+a.text),s.length&&(r.excludeUntil=1/0,e.logger_("excluding "+r.id+" for unsupported: "+s.join(", ")));}});},i.excludeIncompatibleVariants_=function(e){var t=this,i=[],n=this.master().playlists,r=Us(g.parseCodecs(e)),a=Rs(r),s=r.video&&g.parseCodecs(r.video)[0]||null,o=r.audio&&g.parseCodecs(r.audio)[0]||null;Object.keys(n).forEach(function(e){var r=n[e];if(-1===i.indexOf(r.id)&&r.excludeUntil!==1/0){i.push(r.id);var u=[],l=Os(t.masterPlaylistLoader_.master,r),d=Rs(l);if(l.audio||l.video){if(d!==a&&u.push('codec count "'+d+'" !== "'+a+'"'),!t.sourceUpdater_.canChangeType()){var h=l.video&&g.parseCodecs(l.video)[0]||null,c=l.audio&&g.parseCodecs(l.audio)[0]||null;h&&s&&h.type.toLowerCase()!==s.type.toLowerCase()&&u.push('video codec "'+h.type+'" !== "'+s.type+'"'),c&&o&&c.type.toLowerCase()!==o.type.toLowerCase()&&u.push('audio codec "'+c.type+'" !== "'+o.type+'"');}u.length&&(r.excludeUntil=1/0,t.logger_("blacklisting "+r.id+": "+u.join(" && ")));}}});},i.updateAdCues_=function(e){var t=0,i=this.seekable();i.length&&(t=i.start(0)),function(e,t,i){if(void 0===i&&(i=0),e.segments)for(var n,r=i,a=0;a0&&this.logger_("resetting possible stalled download count for "+e+" loader"),this[e+"StalledDownloads_"]=0,this[e+"Buffered_"]=t.buffered_();},t.checkSegmentDownloads_=function(e){var t=this.masterPlaylistController_,i=t[e+"SegmentLoader_"],n=i.buffered_(),r=function(e,t){if(e===t)return!1;if(!e&&t||!t&&e)return!0;if(e.length!==t.length)return!0;for(var i=0;i=t.end(t.length-1)))return this.techWaiting_();this.consecutiveUpdates>=5&&e===this.lastRecordedTime?(this.consecutiveUpdates++,this.waiting_()):e===this.lastRecordedTime?this.consecutiveUpdates++:(this.consecutiveUpdates=0,this.lastRecordedTime=e);}},t.cancelTimer_=function(){this.consecutiveUpdates=0,this.timer_&&(this.logger_("cancelTimer_"),clearTimeout(this.timer_)),this.timer_=null;},t.fixesBadSeeks_=function(){if(!this.tech_.seeking())return!1;var e,t=this.seekable(),i=this.tech_.currentTime();this.afterSeekableWindow_(t,i,this.media(),this.allowSeeksWithinUnsafeLiveWindow)&&(e=t.end(t.length-1));if(this.beforeSeekableWindow_(t,i)){var n=t.start(0);e=n+(n===t.end(0)?0:.1);}if(void 0!==e)return this.logger_("Trying to seek outside of seekable at time "+i+" with seekable range "+ta(t)+". Seeking to "+e+"."),this.tech_.setCurrentTime(e),!0;var r=this.tech_.buffered();return!!function(e){var t=e.buffered,i=e.targetDuration,n=e.currentTime;return!!t.length&&!(t.end(0)-t.start(0)<2*i)&&!(n>t.start(0))&&t.start(0)-n "+i.end(0)+"]. Attempting to resume playback by seeking to the current time."),this.tech_.trigger({type:"usage",name:"vhs-unknown-waiting"}),void this.tech_.trigger({type:"usage",name:"hls-unknown-waiting"})):void 0;}},t.techWaiting_=function(){var e=this.seekable(),t=this.tech_.currentTime();if(this.tech_.seeking()&&this.fixesBadSeeks_())return!0;if(this.tech_.seeking()||null!==this.timer_)return!0;if(this.beforeSeekableWindow_(e,t)){var i=e.end(e.length-1);return this.logger_("Fell out of live window at time "+t+". Seeking to live point (seekable end) "+i),this.cancelTimer_(),this.tech_.setCurrentTime(i),this.tech_.trigger({type:"usage",name:"vhs-live-resync"}),this.tech_.trigger({type:"usage",name:"hls-live-resync"}),!0;}var n=this.tech_.vhs.masterPlaylistController_.sourceUpdater_,r=this.tech_.buffered();if(this.videoUnderflow_({audioBuffered:n.audioBuffered(),videoBuffered:n.videoBuffered(),currentTime:t}))return this.cancelTimer_(),this.tech_.setCurrentTime(t),this.tech_.trigger({type:"usage",name:"vhs-video-underflow"}),this.tech_.trigger({type:"usage",name:"hls-video-underflow"}),!0;var a=ea(r,t);if(a.length>0){var s=a.start(0)-t;return this.logger_("Stopped at "+t+", setting timer for "+s+", seeking to "+a.start(0)),this.cancelTimer_(),this.timer_=setTimeout(this.skipTheGap_.bind(this),1e3*s,t),!0;}return!1;},t.afterSeekableWindow_=function(e,t,i,n){if(void 0===n&&(n=!1),!e.length)return!1;var r=e.end(e.length-1)+.1;return!i.endList&&n&&(r=e.end(e.length-1)+3*i.targetDuration),t>r;},t.beforeSeekableWindow_=function(e,t){return!!(e.length&&e.start(0)>0&&t2)return{start:r,end:a};}return null;},e;}(),zo={errorInterval:30,getSource:function getSource(e){return e(this.tech({IWillNotUseThisInPlugins:!0}).currentSource_||this.currentSource());}},Go=function Go(e){!function e(t,i){var n=0,r=0,a=Yr.mergeOptions(zo,i);t.ready(function(){t.trigger({type:"usage",name:"vhs-error-reload-initialized"}),t.trigger({type:"usage",name:"hls-error-reload-initialized"});});var s=function s(){r&&t.currentTime(r);},o=function o(e){null!=e&&(r=t.duration()!==1/0&&t.currentTime()||0,t.one("loadedmetadata",s),t.src(e),t.trigger({type:"usage",name:"vhs-error-reload"}),t.trigger({type:"usage",name:"hls-error-reload"}),t.play());},u=function u(){return Date.now()-n<1e3*a.errorInterval?(t.trigger({type:"usage",name:"vhs-error-reload-canceled"}),void t.trigger({type:"usage",name:"hls-error-reload-canceled"})):a.getSource&&"function"==typeof a.getSource?(n=Date.now(),a.getSource.call(t,o)):void Yr.log.error("ERROR: reloadSourceOnError - The option getSource must be a function!");},l=function e(){t.off("loadedmetadata",s),t.off("error",u),t.off("dispose",e);};t.on("error",u),t.on("dispose",l),t.reloadSourceOnError=function(i){l(),e(t,i);};}(this,e);},Wo={PlaylistLoader:Oa,Playlist:Ta,utils:Ka,STANDARD_PLAYLIST_SELECTOR:Hs,INITIAL_PLAYLIST_SELECTOR:function INITIAL_PLAYLIST_SELECTOR(){var e=this,t=this.playlists.master.playlists.filter(Ta.isEnabled);return Ns(t,function(e,t){return js(e,t);}),t.filter(function(t){return!!Os(e.playlists.master,t).video;})[0]||null;},lastBandwidthSelector:Hs,movingAverageBandwidthSelector:function movingAverageBandwidthSelector(e){var t=-1,i=-1;if(e<0||e>1)throw new Error("Moving average bandwidth decay must be between 0 and 1.");return function(){var n=this.useDevicePixelRatio&&A["default"].devicePixelRatio||1;return t<0&&(t=this.systemBandwidth,i=this.systemBandwidth),this.systemBandwidth>0&&this.systemBandwidth!==i&&(t=e*this.systemBandwidth+(1-e)*t,i=this.systemBandwidth),Vs(this.playlists.master,t,parseInt(Bs(this.tech_.el(),"width"),10)*n,parseInt(Bs(this.tech_.el(),"height"),10)*n,this.limitRenditionByPlayerDimensions,this.masterPlaylistController_);};},comparePlaylistBandwidth:js,comparePlaylistResolution:function comparePlaylistResolution(e,t){var i,n;return e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width&&(i=e.attributes.RESOLUTION.width),i=i||A["default"].Number.MAX_VALUE,t.attributes.RESOLUTION&&t.attributes.RESOLUTION.width&&(n=t.attributes.RESOLUTION.width),i===(n=n||A["default"].Number.MAX_VALUE)&&e.attributes.BANDWIDTH&&t.attributes.BANDWIDTH?e.attributes.BANDWIDTH-t.attributes.BANDWIDTH:i-n;},xhr:Na()};Object.keys(ns).forEach(function(e){Object.defineProperty(Wo,e,{get:function get(){return Yr.log.warn("using Vhs."+e+" is UNSAFE be sure you know what you are doing"),ns[e];},set:function set(t){Yr.log.warn("using Vhs."+e+" is UNSAFE be sure you know what you are doing"),"number"!=typeof t||t<0?Yr.log.warn("value of Vhs."+e+" must be greater than or equal to 0"):ns[e]=t;}});});var Yo=function Yo(e,t){for(var i=t.media(),n=-1,r=0;r0?1/this.throughput:0,Math.floor(1/(t+e));},set:function set(){Yr.log.error('The "systemBandwidth" property is read-only');}}}),this.options_.bandwidth&&(this.bandwidth=this.options_.bandwidth),this.options_.throughput&&(this.throughput=this.options_.throughput),Object.defineProperties(this.stats,{bandwidth:{get:function get(){return i.bandwidth||0;},enumerable:!0},mediaRequests:{get:function get(){return i.masterPlaylistController_.mediaRequests_()||0;},enumerable:!0},mediaRequestsAborted:{get:function get(){return i.masterPlaylistController_.mediaRequestsAborted_()||0;},enumerable:!0},mediaRequestsTimedout:{get:function get(){return i.masterPlaylistController_.mediaRequestsTimedout_()||0;},enumerable:!0},mediaRequestsErrored:{get:function get(){return i.masterPlaylistController_.mediaRequestsErrored_()||0;},enumerable:!0},mediaTransferDuration:{get:function get(){return i.masterPlaylistController_.mediaTransferDuration_()||0;},enumerable:!0},mediaBytesTransferred:{get:function get(){return i.masterPlaylistController_.mediaBytesTransferred_()||0;},enumerable:!0},mediaSecondsLoaded:{get:function get(){return i.masterPlaylistController_.mediaSecondsLoaded_()||0;},enumerable:!0},mediaAppends:{get:function get(){return i.masterPlaylistController_.mediaAppends_()||0;},enumerable:!0},mainAppendsToLoadedData:{get:function get(){return i.masterPlaylistController_.mainAppendsToLoadedData_()||0;},enumerable:!0},audioAppendsToLoadedData:{get:function get(){return i.masterPlaylistController_.audioAppendsToLoadedData_()||0;},enumerable:!0},appendsToLoadedData:{get:function get(){return i.masterPlaylistController_.appendsToLoadedData_()||0;},enumerable:!0},timeToLoadedData:{get:function get(){return i.masterPlaylistController_.timeToLoadedData_()||0;},enumerable:!0},buffered:{get:function get(){return ia(i.tech_.buffered());},enumerable:!0},currentTime:{get:function get(){return i.tech_.currentTime();},enumerable:!0},currentSource:{get:function get(){return i.tech_.currentSource_;},enumerable:!0},currentTech:{get:function get(){return i.tech_.name_;},enumerable:!0},duration:{get:function get(){return i.tech_.duration();},enumerable:!0},master:{get:function get(){return i.playlists.master;},enumerable:!0},playerDimensions:{get:function get(){return i.tech_.currentDimensions();},enumerable:!0},seekable:{get:function get(){return ia(i.tech_.seekable());},enumerable:!0},timestamp:{get:function get(){return Date.now();},enumerable:!0},videoPlaybackQuality:{get:function get(){return i.tech_.getVideoPlaybackQuality();},enumerable:!0}}),this.tech_.one("canplay",this.masterPlaylistController_.setupFirstPlay.bind(this.masterPlaylistController_)),this.tech_.on("bandwidthupdate",function(){i.options_.useBandwidthFromLocalStorage&&function(e){if(!A["default"].localStorage)return!1;var t=Xo();t=t?Yr.mergeOptions(t,e):e;try{A["default"].localStorage.setItem("videojs-vhs",JSON.stringify(t));}catch(e){return!1;}}({bandwidth:i.bandwidth,throughput:Math.round(i.throughput)});}),this.masterPlaylistController_.on("selectedinitialmedia",function(){var e;(e=i).representations=function(){var t=e.masterPlaylistController_.master(),i=ba(t)?e.masterPlaylistController_.getAudioTrackPlaylists_():t.playlists;return i?i.filter(function(e){return!pa(e);}).map(function(t,i){return new jo(e,t,t.id);}):[];};}),this.masterPlaylistController_.sourceUpdater_.on("createdsourcebuffers",function(){i.setupEme_();}),this.on(this.masterPlaylistController_,"progress",function(){this.tech_.trigger("progress");}),this.on(this.masterPlaylistController_,"firstplay",function(){this.ignoreNextSeekingEvent_=!0;}),this.setupQualityLevels_(),this.tech_.el()&&(this.mediaSourceUrl_=A["default"].URL.createObjectURL(this.masterPlaylistController_.mediaSource),this.tech_.src(this.mediaSourceUrl_));}},i.setupEme_=function(){var e=this,t=this.masterPlaylistController_.mediaTypes_.AUDIO.activePlaylistLoader,i=Ko({player:this.player_,sourceKeySystems:this.source_.keySystems,media:this.playlists.media(),audioMedia:t&&t.media()});this.player_.tech_.on("keystatuschange",function(t){"output-restricted"===t.status&&e.masterPlaylistController_.blacklistCurrentPlaylist({playlist:e.masterPlaylistController_.media(),message:"DRM keystatus changed to "+t.status+". Playlist will fail to play. Check for HDCP content.",blacklistDuration:1/0});}),11!==Yr.browser.IE_VERSION&&i?(this.logger_("waiting for EME key session creation"),qo({player:this.player_,sourceKeySystems:this.source_.keySystems,audioMedia:t&&t.media(),mainPlaylists:this.playlists.master.playlists}).then(function(){e.logger_("created EME key session"),e.masterPlaylistController_.sourceUpdater_.initializedEme();})["catch"](function(t){e.logger_("error while creating EME key session",t),e.player_.error({message:"Failed to initialize media keys for EME",code:3});})):this.masterPlaylistController_.sourceUpdater_.initializedEme();},i.setupQualityLevels_=function(){var e=this,t=Yr.players[this.tech_.options_.playerId];t&&t.qualityLevels&&!this.qualityLevels_&&(this.qualityLevels_=t.qualityLevels(),this.masterPlaylistController_.on("selectedinitialmedia",function(){var t,i;t=e.qualityLevels_,(i=e).representations().forEach(function(e){t.addQualityLevel(e);}),Yo(t,i.playlists);}),this.playlists.on("mediachange",function(){Yo(e.qualityLevels_,e.playlists);}));},t.version=function(){return{"@videojs/http-streaming":"2.10.2","mux.js":"5.13.0","mpd-parser":"0.19.0","m3u8-parser":"4.7.0","aes-decrypter":"3.1.2"};},i.version=function(){return this.constructor.version();},i.canChangeType=function(){return vo.canChangeType();},i.play=function(){this.masterPlaylistController_.play();},i.setCurrentTime=function(e){this.masterPlaylistController_.setCurrentTime(e);},i.duration=function(){return this.masterPlaylistController_.duration();},i.seekable=function(){return this.masterPlaylistController_.seekable();},i.dispose=function(){this.playbackWatcher_&&this.playbackWatcher_.dispose(),this.masterPlaylistController_&&this.masterPlaylistController_.dispose(),this.qualityLevels_&&this.qualityLevels_.dispose(),this.player_&&(delete this.player_.vhs,delete this.player_.dash,delete this.player_.hls),this.tech_&&this.tech_.vhs&&delete this.tech_.vhs,this.tech_&&delete this.tech_.hls,this.mediaSourceUrl_&&A["default"].URL.revokeObjectURL&&(A["default"].URL.revokeObjectURL(this.mediaSourceUrl_),this.mediaSourceUrl_=null),e.prototype.dispose.call(this);},i.convertToProgramTime=function(e,t){return Xa({playlist:this.masterPlaylistController_.media(),time:e,callback:t});},i.seekToProgramTime=function(e,t,i,n){return void 0===i&&(i=!0),void 0===n&&(n=2),Qa({programTime:e,playlist:this.masterPlaylistController_.media(),retryCount:n,pauseAfterSeek:i,seekTo:this.options_.seekTo,tech:this.options_.tech,callback:t});},t;}(Yr.getComponent("Component")),$o={name:"videojs-http-streaming",VERSION:"2.10.2",canHandleSource:function canHandleSource(e,t){void 0===t&&(t={});var i=Yr.mergeOptions(Yr.options,t);return $o.canPlayType(e.type,i);},handleSource:function handleSource(e,t,i){void 0===i&&(i={});var n=Yr.mergeOptions(Yr.options,i);return t.vhs=new Qo(e,t,n),Yr.hasOwnProperty("hls")||Object.defineProperty(t,"hls",{get:function get(){return Yr.log.warn("player.tech().hls is deprecated. Use player.tech().vhs instead."),t.vhs;},configurable:!0}),t.vhs.xhr=Na(),t.vhs.src(e.src,e.type),t.vhs;},canPlayType:function canPlayType(e,t){void 0===t&&(t={});var i=Yr.mergeOptions(Yr.options,t).vhs.overrideNative,n=void 0===i?!Yr.browser.IS_ANY_SAFARI:i,r=_.simpleTypeFromSourceType(e);return r&&(!Wo.supportsTypeNatively(r)||n)?"maybe":"";}};g.browserSupportsCodec("avc1.4d400d,mp4a.40.2")&&Yr.getTech("Html5").registerSourceHandler($o,0),Yr.VhsHandler=Qo,Object.defineProperty(Yr,"HlsHandler",{get:function get(){return Yr.log.warn("videojs.HlsHandler is deprecated. Use videojs.VhsHandler instead."),Qo;},configurable:!0}),Yr.VhsSourceHandler=$o,Object.defineProperty(Yr,"HlsSourceHandler",{get:function get(){return Yr.log.warn("videojs.HlsSourceHandler is deprecated. Use videojs.VhsSourceHandler instead."),$o;},configurable:!0}),Yr.Vhs=Wo,Object.defineProperty(Yr,"Hls",{get:function get(){return Yr.log.warn("videojs.Hls is deprecated. Use videojs.Vhs instead."),Wo;},configurable:!0}),Yr.use||(Yr.registerComponent("Hls",Wo),Yr.registerComponent("Vhs",Wo)),Yr.options.vhs=Yr.options.vhs||{},Yr.options.hls=Yr.options.hls||{},Yr.registerPlugin?Yr.registerPlugin("reloadSourceOnError",Go):Yr.plugin("reloadSourceOnError",Go),t.exports=Yr;},{"@babel/runtime/helpers/assertThisInitialized":1,"@babel/runtime/helpers/construct":2,"@babel/runtime/helpers/extends":3,"@babel/runtime/helpers/inherits":4,"@babel/runtime/helpers/inheritsLoose":5,"@videojs/vhs-utils/cjs/byte-helpers":9,"@videojs/vhs-utils/cjs/codecs.js":11,"@videojs/vhs-utils/cjs/containers":12,"@videojs/vhs-utils/cjs/id3-helpers":15,"@videojs/vhs-utils/cjs/media-types.js":16,"@videojs/vhs-utils/cjs/resolve-url.js":20,"@videojs/xhr":23,"global/document":34,"global/window":35,keycode:38,"m3u8-parser":39,"mpd-parser":41,"mux.js/lib/tools/parse-sidx":42,"mux.js/lib/utils/clock":43,"safe-json-parse/tuple":45,"videojs-vtt.js":48}],48:[function(e,t,i){var n=e("global/window"),r=t.exports={WebVTT:e("./vtt.js"),VTTCue:e("./vttcue.js"),VTTRegion:e("./vttregion.js")};n.vttjs=r,n.WebVTT=r.WebVTT;var a=r.VTTCue,s=r.VTTRegion,o=n.VTTCue,u=n.VTTRegion;r.shim=function(){n.VTTCue=a,n.VTTRegion=s;},r.restore=function(){n.VTTCue=o,n.VTTRegion=u;},n.VTTCue||r.shim();},{"./vtt.js":49,"./vttcue.js":50,"./vttregion.js":51,"global/window":35}],49:[function(e,t,i){var n=e("global/document"),r=Object.create||function(){function e(){}return function(t){if(1!==arguments.length)throw new Error("Object.create shim only accepts one parameter.");return e.prototype=t,new e();};}();function a(e,t){this.name="ParsingError",this.code=e.code,this.message=t||e.message;}function s(e){function t(e,t,i,n){return 3600*(0|e)+60*(0|t)+(0|i)+(0|n)/1e3;}var i=e.match(/^(\d+):(\d{1,2})(:\d{1,2})?\.(\d{3})/);return i?i[3]?t(i[1],i[2],i[3].replace(":",""),i[4]):i[1]>59?t(i[1],i[2],0,i[4]):t(0,i[1],i[2],i[4]):null;}function o(){this.values=r(null);}function u(e,t,i,n){var r=n?e.split(n):[e];for(var a in r){if("string"==typeof r[a]){var s=r[a].split(i);if(2===s.length)t(s[0],s[1]);}}}function l(e,t,i){var n=e;function r(){var t=s(e);if(null===t)throw new a(a.Errors.BadTimeStamp,"Malformed timestamp: "+n);return e=e.replace(/^[^\sa-zA-Z-]+/,""),t;}function l(){e=e.replace(/^\s+/,"");}if(l(),t.startTime=r(),l(),"--\x3e"!==e.substr(0,3))throw new a(a.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '--\x3e'): "+n);e=e.substr(3),l(),t.endTime=r(),l(),function(e,t){var n=new o();u(e,function(e,t){switch(e){case"region":for(var r=i.length-1;r>=0;r--){if(i[r].id===t){n.set(e,i[r].region);break;}}break;case"vertical":n.alt(e,t,["rl","lr"]);break;case"line":var a=t.split(","),s=a[0];n.integer(e,s),n.percent(e,s)&&n.set("snapToLines",!1),n.alt(e,s,["auto"]),2===a.length&&n.alt("lineAlign",a[1],["start","center","end"]);break;case"position":a=t.split(","),n.percent(e,a[0]),2===a.length&&n.alt("positionAlign",a[1],["start","center","end"]);break;case"size":n.percent(e,t);break;case"align":n.alt(e,t,["start","center","end","left","right"]);}},/:/,/\s/),t.region=n.get("region",null),t.vertical=n.get("vertical","");try{t.line=n.get("line","auto");}catch(e){}t.lineAlign=n.get("lineAlign","start"),t.snapToLines=n.get("snapToLines",!0),t.size=n.get("size",100);try{t.align=n.get("align","center");}catch(e){t.align=n.get("align","middle");}try{t.position=n.get("position","auto");}catch(e){t.position=n.get("position",{start:0,left:0,center:50,middle:50,end:100,right:100},t.align);}t.positionAlign=n.get("positionAlign",{start:"start",left:"start",center:"center",middle:"center",end:"end",right:"end"},t.align);}(e,t);}a.prototype=r(Error.prototype),a.prototype.constructor=a,a.Errors={BadSignature:{code:0,message:"Malformed WebVTT signature."},BadTimeStamp:{code:1,message:"Malformed time stamp."}},o.prototype={set:function set(e,t){this.get(e)||""===t||(this.values[e]=t);},get:function get(e,t,i){return i?this.has(e)?this.values[e]:t[i]:this.has(e)?this.values[e]:t;},has:function has(e){return e in this.values;},alt:function alt(e,t,i){for(var n=0;n=0&&t<=100)&&(this.set(e,t),!0);}};var d=n.createElement&&n.createElement("textarea"),h={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"},c={white:"rgba(255,255,255,1)",lime:"rgba(0,255,0,1)",cyan:"rgba(0,255,255,1)",red:"rgba(255,0,0,1)",yellow:"rgba(255,255,0,1)",magenta:"rgba(255,0,255,1)",blue:"rgba(0,0,255,1)",black:"rgba(0,0,0,1)"},f={v:"title",lang:"lang"},p={rt:"ruby"};function m(e,t){function i(){if(!t)return null;var e,i=t.match(/^([^<]*)(<[^>]*>?)?/);return e=i[1]?i[1]:i[2],t=t.substr(e.length),e;}function n(e,t){return!p[t.localName]||p[t.localName]===e.localName;}function r(t,i){var n=h[t];if(!n)return null;var r=e.document.createElement(n),a=f[t];return a&&i&&(r[a]=i.trim()),r;}for(var a,o,u=e.document.createElement("div"),l=u,m=[];null!==(a=i());){if("<"!==a[0])l.appendChild(e.document.createTextNode((o=a,d.innerHTML=o,o=d.textContent,d.textContent="",o)));else{if("/"===a[1]){m.length&&m[m.length-1]===a.substr(2).replace(">","")&&(m.pop(),l=l.parentNode);continue;}var g,_=s(a.substr(1,a.length-2));if(_){g=e.document.createProcessingInstruction("timestamp",_),l.appendChild(g);continue;}var y=a.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!y)continue;if(!(g=r(y[1],y[3])))continue;if(!n(l,g))continue;if(y[2]){var v=y[2].split(".");v.forEach(function(e){var t=/^bg_/.test(e),i=t?e.slice(3):e;if(c.hasOwnProperty(i)){var n=t?"background-color":"color",r=c[i];g.style[n]=r;}}),g.className=v.join(" ");}m.push(y[1]),l.appendChild(g),l=g;}}return u;}var g=[[1470,1470],[1472,1472],[1475,1475],[1478,1478],[1488,1514],[1520,1524],[1544,1544],[1547,1547],[1549,1549],[1563,1563],[1566,1610],[1645,1647],[1649,1749],[1765,1766],[1774,1775],[1786,1805],[1807,1808],[1810,1839],[1869,1957],[1969,1969],[1984,2026],[2036,2037],[2042,2042],[2048,2069],[2074,2074],[2084,2084],[2088,2088],[2096,2110],[2112,2136],[2142,2142],[2208,2208],[2210,2220],[8207,8207],[64285,64285],[64287,64296],[64298,64310],[64312,64316],[64318,64318],[64320,64321],[64323,64324],[64326,64449],[64467,64829],[64848,64911],[64914,64967],[65008,65020],[65136,65140],[65142,65276],[67584,67589],[67592,67592],[67594,67637],[67639,67640],[67644,67644],[67647,67669],[67671,67679],[67840,67867],[67872,67897],[67903,67903],[67968,68023],[68030,68031],[68096,68096],[68112,68115],[68117,68119],[68121,68147],[68160,68167],[68176,68184],[68192,68223],[68352,68405],[68416,68437],[68440,68466],[68472,68479],[68608,68680],[126464,126467],[126469,126495],[126497,126498],[126500,126500],[126503,126503],[126505,126514],[126516,126519],[126521,126521],[126523,126523],[126530,126530],[126535,126535],[126537,126537],[126539,126539],[126541,126543],[126545,126546],[126548,126548],[126551,126551],[126553,126553],[126555,126555],[126557,126557],[126559,126559],[126561,126562],[126564,126564],[126567,126570],[126572,126578],[126580,126583],[126585,126588],[126590,126590],[126592,126601],[126603,126619],[126625,126627],[126629,126633],[126635,126651],[1114109,1114109]];function _(e){for(var t=0;t=i[0]&&e<=i[1])return!0;}return!1;}function y(e){var t=[],i="";if(!e||!e.childNodes)return"ltr";function n(e,t){for(var i=t.childNodes.length-1;i>=0;i--){e.push(t.childNodes[i]);}}function r(e){if(!e||!e.length)return null;var t=e.pop(),i=t.textContent||t.innerText;if(i){var a=i.match(/^.*(\n|\r)/);return a?(e.length=0,a[0]):i;}return"ruby"===t.tagName?r(e):t.childNodes?(n(e,t),r(e)):void 0;}for(n(t,e);i=r(t);){for(var a=0;a=0&&e.line<=100))return e.line;if(!e.track||!e.track.textTrackList||!e.track.textTrackList.mediaElement)return-1;for(var t=e.track,i=t.textTrackList,n=0,r=0;rh&&(d=d<0?-1:1,d*=Math.ceil(h/l)*l),s<0&&(d+=""===a.vertical?i.height:i.width,o=o.reverse()),r.move(c,d);}else{var f=r.lineHeight/i.height*100;switch(a.lineAlign){case"center":s-=f/2;break;case"end":s-=f;}switch(a.vertical){case"":t.applyStyles({top:t.formatStyle(s,"%")});break;case"rl":t.applyStyles({left:t.formatStyle(s,"%")});break;case"lr":t.applyStyles({right:t.formatStyle(s,"%")});}o=["+y","-x","+x","-y"],r=new T(t);}var p=function(e,t){for(var r,a=new T(e),s=1,o=0;ou&&(r=new T(e),s=u),e=new T(a);}return r||a;}(r,o);t.move(p.toCSSCompatValues(i));}function E(){}v.prototype.applyStyles=function(e,t){for(var i in t=t||this.div,e){e.hasOwnProperty(i)&&(t.style[i]=e[i]);}},v.prototype.formatStyle=function(e,t){return 0===e?0:e+t;},b.prototype=r(v.prototype),b.prototype.constructor=b,T.prototype.move=function(e,t){switch(t=void 0!==t?t:this.lineHeight,e){case"+x":this.left+=t,this.right+=t;break;case"-x":this.left-=t,this.right-=t;break;case"+y":this.top+=t,this.bottom+=t;break;case"-y":this.top-=t,this.bottom-=t;}},T.prototype.overlaps=function(e){return this.lefte.left&&this.tope.top;},T.prototype.overlapsAny=function(e){for(var t=0;t=e.top&&this.bottom<=e.bottom&&this.left>=e.left&&this.right<=e.right;},T.prototype.overlapsOppositeAxis=function(e,t){switch(t){case"+x":return this.lefte.right;case"+y":return this.tope.bottom;}},T.prototype.intersectPercentage=function(e){return Math.max(0,Math.min(this.right,e.right)-Math.max(this.left,e.left))*Math.max(0,Math.min(this.bottom,e.bottom)-Math.max(this.top,e.top))/(this.height*this.width);},T.prototype.toCSSCompatValues=function(e){return{top:this.top-e.top,bottom:e.bottom-this.bottom,left:this.left-e.left,right:e.right-this.right,height:this.height,width:this.width};},T.getSimpleBoxPosition=function(e){var t=e.div?e.div.offsetHeight:e.tagName?e.offsetHeight:0,i=e.div?e.div.offsetWidth:e.tagName?e.offsetWidth:0,n=e.div?e.div.offsetTop:e.tagName?e.offsetTop:0;return{left:(e=e.div?e.div.getBoundingClientRect():e.tagName?e.getBoundingClientRect():e).left,right:e.right,top:e.top||n,height:e.height||t,bottom:e.bottom||n+(e.height||t),width:e.width||i};},E.StringDecoder=function(){return{decode:function decode(e){if(!e)return"";if("string"!=typeof e)throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(e));}};},E.convertCueToDOMTree=function(e,t){return e&&t?m(e,t):null;};E.processCues=function(e,t,i){if(!e||!t||!i)return null;for(;i.firstChild;){i.removeChild(i.firstChild);}var n=e.document.createElement("div");if(n.style.position="absolute",n.style.left="0",n.style.right="0",n.style.top="0",n.style.bottom="0",n.style.margin="1.5%",i.appendChild(n),function(e){for(var t=0;t100)throw new Error("Position must be between 0 and 100.");m=e,this.hasBeenReset=!0;}},positionAlign:{enumerable:!0,get:function get(){return g;},set:function set(e){var t=a(e);t&&(g=t,this.hasBeenReset=!0);}},size:{enumerable:!0,get:function get(){return _;},set:function set(e){if(e<0||e>100)throw new Error("Size must be between 0 and 100.");_=e,this.hasBeenReset=!0;}},align:{enumerable:!0,get:function get(){return y;},set:function set(e){var t=a(e);if(!t)throw new SyntaxError("align: an invalid or illegal alignment string was specified.");y=t,this.hasBeenReset=!0;}}}),this.displayState=void 0;}s.prototype.getCueAsHTML=function(){return WebVTT.convertCueToDOMTree(window,this.text);},t.exports=s;},{}],51:[function(e,t,i){var n={"":!0,up:!0};function r(e){return"number"==typeof e&&e>=0&&e<=100;}t.exports=function(){var e=100,t=3,i=0,a=100,s=0,o=100,u="";Object.defineProperties(this,{width:{enumerable:!0,get:function get(){return e;},set:function set(t){if(!r(t))throw new Error("Width must be between 0 and 100.");e=t;}},lines:{enumerable:!0,get:function get(){return t;},set:function set(e){if("number"!=typeof e)throw new TypeError("Lines must be set to a number.");t=e;}},regionAnchorY:{enumerable:!0,get:function get(){return a;},set:function set(e){if(!r(e))throw new Error("RegionAnchorX must be between 0 and 100.");a=e;}},regionAnchorX:{enumerable:!0,get:function get(){return i;},set:function set(e){if(!r(e))throw new Error("RegionAnchorY must be between 0 and 100.");i=e;}},viewportAnchorY:{enumerable:!0,get:function get(){return o;},set:function set(e){if(!r(e))throw new Error("ViewportAnchorY must be between 0 and 100.");o=e;}},viewportAnchorX:{enumerable:!0,get:function get(){return s;},set:function set(e){if(!r(e))throw new Error("ViewportAnchorX must be between 0 and 100.");s=e;}},scroll:{enumerable:!0,get:function get(){return u;},set:function set(e){var t=function(e){return"string"==typeof e&&!!n[e.toLowerCase()]&&e.toLowerCase();}(e);!1===t||(u=t);}}});};},{}],52:[function(e,t,i){"use strict";t.exports={DEFAILT_WEBGL_PLAY_ID:"glplayer",PLAYER_IN_TYPE_MP4:"mp4",PLAYER_IN_TYPE_FLV:"flv",PLAYER_IN_TYPE_HTTPFLV:"httpflv",PLAYER_IN_TYPE_RAW_265:"raw265",PLAYER_IN_TYPE_TS:"ts",PLAYER_IN_TYPE_MPEGTS:"mpegts",PLAYER_IN_TYPE_M3U8:"hls",PLAYER_IN_TYPE_M3U8_VOD:"m3u8",PLAYER_IN_TYPE_M3U8_LIVE:"hls",APPEND_TYPE_STREAM:0,APPEND_TYPE_FRAME:1,APPEND_TYPE_SEQUENCE:2,DEFAULT_WIDTH:600,DEFAULT_HEIGHT:600,DEFAULT_FPS:30,DEFAULT_FRAME_DUR:40,DEFAULT_FIXED:!1,DEFAULT_SAMPLERATE:44100,DEFAULT_CHANNELS:2,DEFAULT_CONSU_SAMPLE_LEN:20,PLAYER_MODE_VOD:"vod",PLAYER_MODE_NOTIME_LIVE:"live",AUDIO_MODE_ONCE:"ONCE",AUDIO_MODE_SWAP:"SWAP",DEFAULT_STRING_LIVE:"LIVE",CODEC_H265:0,CODEC_H264:1,PLAYER_CORE_TYPE_DEFAULT:0,PLAYER_CORE_TYPE_CNATIVE:1,URI_PROTOCOL_WEBSOCKET:"ws",URI_PROTOCOL_WEBSOCKET_DESC:"websocket",URI_PROTOCOL_HTTP:"http",URI_PROTOCOL_HTTP_DESC:"http",FETCH_FIRST_MAX_TIMES:5,FETCH_HTTP_FLV_TIMEOUT_MS:7e3,V_CODEC_NAME_HEVC:265,V_CODEC_NAME_AVC:264,V_CODEC_NAME_UNKN:500,A_CODEC_NAME_AAC:112,A_CODEC_NAME_MP3:113,A_CODEC_NAME_UNKN:500,CACHE_NO_LOADCACHE:192,CACHE_WITH_PLAY_SIGN:193,CACHE_WITH_NOPLAY_SIGN:194};},{}],53:[function(e,t,i){"use strict";var n=window.AudioContext||window.webkitAudioContext,r=e("../consts"),a=e("./av-common");t.exports=function(e){var t={options:{sampleRate:e.sampleRate||r.DEFAULT_SAMPLERATE,appendType:e.appendType||r.APPEND_TYPE_STREAM,playMode:e.playMode||r.AUDIO_MODE_SWAP},sourceChannel:-1,audioCtx:new n({latencyHint:"interactive",sampleRate:e.sampleRate}),gainNode:null,sourceList:[],startStatus:!1,sampleQueue:[],nextBuffer:null,playTimestamp:0,playStartTime:0,durationMs:-1,isLIVE:!1,voice:1,onLoadCache:null,resetStartParam:function resetStartParam(){t.playTimestamp=0,t.playStartTime=0;},setOnLoadCache:function setOnLoadCache(e){t.onLoadCache=e;},setDurationMs:function setDurationMs(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1;t.durationMs=e;},setVoice:function setVoice(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;t.voice=e,t.gainNode.gain.value=e;},getAlignVPTS:function getAlignVPTS(){return t.playTimestamp+(a.GetMsTime()-t.playStartTime)/1e3;},swapSource:function swapSource(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;if(0==t.startStatus)return null;if(e<0||e>=t.sourceList.length)return null;if(i<0||i>=t.sourceList.length)return null;try{t.sourceChannel===e&&null!==t.sourceList[e]&&(t.sourceList[e].disconnect(t.gainNode),t.sourceList[e]=null);}catch(t){console.error("[DEFINE ERROR] audioModule disconnect source Index:"+e+" error happened!",t);}t.sourceChannel=i;var n=t.decodeSample(i,e);-2==n&&t.isLIVE&&(t.getAlignVPTS()>=t.durationMs/1e3-.04?t.pause():null!==t.onLoadCache&&t.onLoadCache());},addSample:function addSample(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return!(null==e||!e||null==e)&&(0==t.sampleQueue.length&&(t.seekPos=e.pts),t.sampleQueue.push(e),!0);},runNextBuffer:function runNextBuffer(){window.setInterval(function(){if(!(null!=t.nextBuffer||t.sampleQueue.length0&&void 0!==arguments[0]?arguments[0]:-1,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;if(e<0||e>=t.sourceList.length)return-1;if(null!=t.sourceList[e]&&null!=t.sourceList[e]&&t.sourceList[e]||(t.sourceList[e]=t.audioCtx.createBufferSource(),t.sourceList[e].onended=function(){t.swapSource(e,i);}),0==t.sampleQueue.length)return t.isLIVE?(t.sourceList[e].connect(t.gainNode),t.sourceList[e].start(),t.sourceList[e].onended=function(){t.swapSource(e,i);},t.sourceList[e].stop(),0):-2;if(t.sourceList[e].buffer)return t.sourceList[e],t.sourceList[i],t.gainNode,t.swapSource(e,i),0;if(null==t.nextBuffer||t.nextBuffer.data.length<1)return t.sourceList[e].connect(t.gainNode),t.sourceList[e].start(),t.sourceList[e].startState=!0,t.sourceList[e].stop(),1;var n=t.nextBuffer.data.buffer;t.playTimestamp=t.nextBuffer.pts,t.playStartTime=a.GetMsTime();try{t.audioCtx.decodeAudioData(n,function(i){null!==t.sourceList[e]&&(t.sourceList[e].buffer=i,t.sourceList[e].connect(t.gainNode),t.sourceList[e].start(),t.sourceList[e].startState=!0);},function(e){});}catch(e){return t.nextBuffer=null,-3;}return t.nextBuffer=null,0;},decodeWholeSamples:function decodeWholeSamples(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1;if(t.sourceChannel=e,e<0||e>=t.sourceList.length)return-1;if(null!=t.sourceList[e]&&null!=t.sourceList[e]&&t.sourceList[e]||(t.sourceList[e]=t.audioCtx.createBufferSource(),t.sourceList[e].onended=function(){}),0==t.sampleQueue.length)return-2;for(var i=null,n=null,a=0;a=2){var s=i.length/2;a=new Float32Array(s);for(var o=0,u=0;u0&&s()-this._start_time>=this._now_seg_dur&&(s(),this._start_time,this._now_seg_dur,this._start_time=-1,this._now_seg_dur=-1),s(),this._start_time<0)if(new Date(),null!==this._pcm_array_buf&&this._pcm_array_buf.length>this._push_start_idx){this._swapStartPlay=!1;var e=this._push_start_idx+this._once_pop_len;e>this._pcm_array_buf.length&&(e=this._pcm_array_buf.length);var t=this._pcm_array_buf.slice(this._push_start_idx,e);this._push_start_idx+=t.length,this._now_seg_dur=1*t.length/this._sample_rate*1e3,t.length,this._sample_rate,this._now_seg_dur;var i=this._ctx.createBuffer(1,t.length,this._sample_rate);t.length,new Date(),i.copyToChannel(t,0),this._active_node=this._ctx.createBufferSource(),this._active_node.buffer=i,this._active_node.connect(this._gain),this._start_time=s(),this._active_node.start(0);}else setTimeout(this.readingLoopWithF32,1);}}])&&n(t.prototype,i),o&&n(t,o),e;}();i.AudioPcmPlayer=o;},{"../consts":52}],55:[function(e,t,i){"use strict";var n=e("../consts"),r=[{format:"mp4",value:"mp4",core:n.PLAYER_CORE_TYPE_CNATIVE},{format:"mov",value:"mp4",core:n.PLAYER_CORE_TYPE_CNATIVE},{format:"flv",value:"flv",core:n.PLAYER_CORE_TYPE_CNATIVE},{format:"m3u8",value:"hls",core:n.PLAYER_CORE_TYPE_DEFAULT},{format:"m3u",value:"hls",core:n.PLAYER_CORE_TYPE_DEFAULT},{format:"ts",value:"ts",core:n.PLAYER_CORE_TYPE_DEFAULT},{format:"mpegts",value:"ts",core:n.PLAYER_CORE_TYPE_DEFAULT},{format:"hevc",value:"raw265",core:n.PLAYER_CORE_TYPE_DEFAULT},{format:"h265",value:"raw265",core:n.PLAYER_CORE_TYPE_DEFAULT}],a=[{format:n.URI_PROTOCOL_HTTP,value:n.URI_PROTOCOL_HTTP_DESC},{format:n.URI_PROTOCOL_WEBSOCKET,value:n.URI_PROTOCOL_WEBSOCKET_DESC}];t.exports={frameDataAlignCrop:function frameDataAlignCrop(e,t,i,n,r,a,s,o){if(0==e-n)return[a,s,o];for(var u=n*r,l=u/4,d=new Uint8Array(u),h=new Uint8Array(l),c=new Uint8Array(l),f=n,p=n/2,m=0;m=0)return i.value;}return r[0].value;},GetFormatPlayCore:function GetFormatPlayCore(e){for(var t=0;t=0)return i.value;}return a[0].value;},GetMsTime:function GetMsTime(){return new Date().getTime();}};},{"../consts":52}],56:[function(e,t,i){"use strict";function n(e,t){for(var i=0;i0&&(t.getPackageTimeMS=a.GetMsTime()),t.pushPkg++,void 0!==t.AVGetInterval&&null!==t.AVGetInterval||(t.AVGetInterval=window.setInterval(function(){Module.cwrap("getBufferLengthApi","number",["number"])(t.AVSniffPtr)>t.config.probeSize?(Module.cwrap("getSniffHttpFlvPkg","number",["number"])(t.AVSniffPtr),t.pushPkg-=1):t.getPackageTimeMS>0&&a.GetMsTime()-t.getPackageTimeMS>=o.FETCH_HTTP_FLV_TIMEOUT_MS&&(t.getPackageTimeMS=a.GetMsTime(),t.workerFetch.postMessage({cmd:"retry",data:null,msg:"retry"}));},5));break;case"close":t.AVGetInterval&&clearInterval(t.AVGetInterval),t.AVGetInterval=null;case"fetch-fin":break;case"fetch-error":t.onNetworkError&&t.onNetworkError(i.data);}}},{key:"_checkDisplaySize",value:function value(e,t,i){var n=t-e,r=this.config.width+Math.ceil(n/2),a=t/this.config.width>i/this.config.height,s=(r/t).toFixed(2),o=(this.config.height/i).toFixed(2),u=a?s:o,l=this.config.fixed,d=l?r:parseInt(t*u),h=l?this.config.height:parseInt(i*u);if(this.CanvasObj.offsetWidth!=d||this.CanvasObj.offsetHeight!=h){var c=parseInt((this.canvasBox.offsetHeight-h)/2),f=parseInt((this.canvasBox.offsetWidth-d)/2);c=c<0?0:c,f=f<0?0:f,this.CanvasObj.style.marginTop=c+"px",this.CanvasObj.style.marginLeft=f+"px",this.CanvasObj.style.width=d+"px",this.CanvasObj.style.height=h+"px";}return this.isCheckDisplay=!0,[d,h];}},{key:"_ptsFixed2",value:function value(e){return Math.ceil(100*e)/100;}},{key:"_callbackProbe",value:function value(e,t,i,n,r,a,u,l,d){for(var h=Module.HEAPU8.subarray(d,d+10),c=0;c100&&(f=o.DEFAULT_FPS,this.mediaInfo.noFPS=!0),this.vCodecID=l,this.config.fps=f,this.mediaInfo.fps=f,this.mediaInfo.size.width=t,this.mediaInfo.size.height=i,this.frameTime=Math.floor(1e3/(this.mediaInfo.fps+2)),this.CanvasObj.width==t&&this.CanvasObj.height==i||(this.CanvasObj.width=t,this.CanvasObj.height=i,this.isCheckDisplay)||this._checkDisplaySize(t,t,i),r>=0&&!1===this.mediaInfo.noFPS?(void 0!==this.audioWAudio&&null!==this.audioWAudio&&(this.audioWAudio.stop(),this.audioWAudio=null),this.config.sampleRate=a,this.mediaInfo.sampleRate=a,this.audioWAudio=s({sampleRate:this.mediaInfo.sampleRate,appendType:o.APPEND_TYPE_FRAME}),this.audioWAudio.isLIVE=!0):this.mediaInfo.audioNone=!0,this.onProbeFinish&&this.onProbeFinish();}},{key:"_callbackYUV",value:function value(e,t,i,n,r,a,s,o,u){var l=Module.HEAPU8.subarray(e,e+n*o),d=new Uint8Array(l),h=Module.HEAPU8.subarray(t,t+r*o/2),c=new Uint8Array(h),f=Module.HEAPU8.subarray(i,i+a*o/2),p={bufY:d,bufU:c,bufV:new Uint8Array(f),line_y:n,h:o,pts:u};this.YuvBuf.push(p),this.checkCacheState(),Module._free(l),l=null,Module._free(h),h=null,Module._free(f),f=null,!1===this.readyShowDone&&(this.playYUV(),this.readyShowDone=!0,this.onReadyShowDone&&this.onReadyShowDone(),this.audioWAudio||this.play());}},{key:"_callbackNALU",value:function value(e,t,i,n,r,a,s){if(!1===this.readyKeyFrame){if(i<=0)return;this.readyKeyFrame=!0;}var o=Module.HEAPU8.subarray(e,e+t),u=new Uint8Array(o);this.NaluBuf.push({bufData:u,len:t,isKey:i,w:n,h:r,pts:1e3*a,dts:1e3*s}),Module._free(o),o=null;}},{key:"_callbackPCM",value:function value(e){}},{key:"_callbackAAC",value:function value(e,t,i,n,r){var a=this._ptsFixed2(r);if(this.audioWAudio){var s=new Uint8Array(7+i),o=Module.HEAPU8.subarray(e,e+7);s.set(o,0);var u=Module.HEAPU8.subarray(t,t+i);s.set(u,7);var l={pts:a,data:s};this.audioWAudio.addSample(l),this.checkCacheState();}}},{key:"_decode",value:function value(){var e=this;setTimeout(function(){if(null!==e.workerFetch){var t=e.NaluBuf.shift();if(null!=t){var i=Module._malloc(t.bufData.length);Module.HEAP8.set(t.bufData,i),Module.cwrap("decodeHttpFlvVideoFrame","number",["number","number","number","number","number"])(e.AVSniffPtr,i,t.bufData.length,t.pts,t.dts,0),Module._free(i),i=null;}e._decode();}},1);}},{key:"checkCacheState",value:function value(){var e=this.YuvBuf.length>=25&&(!0===this.mediaInfo.audioNone||this.audioWAudio&&this.audioWAudio.sampleQueue.length>=50);return!1===this.cache_status&&e&&(this.playInterval&&this.audioWAudio&&this.audioWAudio.play(),this.onLoadCacheFinshed&&this.onLoadCacheFinshed(),this.cache_status=!0),e;}},{key:"setVoice",value:function value(e){this.audioVoice=e,this.audioWAudio&&this.audioWAudio.setVoice(e);}},{key:"_removeBindFuncPtr",value:function value(){null!==this._ptr_probeCallback&&Module.removeFunction(this._ptr_probeCallback),null!==this._ptr_frameCallback&&Module.removeFunction(this._ptr_frameCallback),null!==this._ptr_naluCallback&&Module.removeFunction(this._ptr_naluCallback),null!==this._ptr_sampleCallback&&Module.removeFunction(this._ptr_sampleCallback),null!==this._ptr_aacCallback&&Module.removeFunction(this._ptr_aacCallback),this._ptr_probeCallback=null,this._ptr_frameCallback=null,this._ptr_naluCallback=null,this._ptr_sampleCallback=null,this._ptr_aacCallback=null;}},{key:"release",value:function value(){return this.pause(),this.NaluBuf.length=0,this.YuvBuf.length=0,void 0!==this.workerFetch&&null!==this.workerFetch&&this.workerFetch.postMessage({cmd:"stop",data:"stop",msg:"stop"}),this.workerFetch=null,this.AVGetInterval&&clearInterval(this.AVGetInterval),this.AVGetInterval=null,this._removeBindFuncPtr(),Module.cwrap("releaseHttpFLV","number",["number"])(this.AVSniffPtr),this.playInterval&&clearInterval(this.playInterval),this.playInterval=null,this.audioWAudio&&this.audioWAudio.stop(),this.audioWAudio=null,this.CanvasObj&&this.CanvasObj.remove(),this.CanvasObj=null,0;}},{key:"isPlayingState",value:function value(){return null!==this.playInterval&&void 0!==this.playInterval;}},{key:"pause",value:function value(){this.audioWAudio&&this.audioWAudio.pause(),this.playInterval&&clearInterval(this.playInterval),this.playInterval=null;}},{key:"playYUV",value:function value(){if(this.YuvBuf.length>0){var e=this.YuvBuf.shift();return r.renderFrame(this.AVGLObj,e.bufY,e.bufU,e.bufV,e.line_y,e.h),!0;}return!1;}},{key:"play",value:function value(){var e=this,t=this;if(!1===this.checkCacheState())return this.onLoadCache&&this.onLoadCache(),setTimeout(function(){e.play();},100),!1;if(void 0===this.playInterval||null===this.playInterval){var i=0,n=0,s=0;!1===this.mediaInfo.audioNone&&this.audioWAudio&&!1===this.mediaInfo.noFPS?(this.playInterval=setInterval(function(){if(n=a.GetMsTime(),t.cache_status){if(n-i>=t.frameTime-s){var e=t.YuvBuf.shift();if(null!=e&&null!==e){var o=0;null!==t.audioWAudio&&void 0!==t.audioWAudio&&(o=1e3*(e.pts-t.audioWAudio.getAlignVPTS())),s=t.audioWAudio?o<0&&-1*o<=t.frameTime||o>=0?a.GetMsTime()-n+1:t.frameTime:a.GetMsTime()-n+1,r.renderFrame(t.AVGLObj,e.bufY,e.bufU,e.bufV,e.line_y,e.h);}(t.YuvBuf.length<=0||t.audioWAudio&&t.audioWAudio.sampleQueue.length<=0)&&(t.cache_status=!1,t.onLoadCache&&t.onLoadCache(),t.audioWAudio&&t.audioWAudio.pause()),i=n;}}else s=t.frameTime;},1),this.audioWAudio&&this.audioWAudio.play()):this.playInterval=setInterval(function(){var e=t.YuvBuf.shift();null!=e&&null!==e&&r.renderFrame(t.AVGLObj,e.bufY,e.bufU,e.bufV,e.line_y,e.h),t.YuvBuf.length<=0&&(t.cache_status=!1);},t.frameTime);}}},{key:"start",value:function value(e){var t,i,n,a=this;this.workerFetch=new Worker((t=function(){var e=null,t=new AbortController(),i=t.signal,n=(self,function(e){var t=!1;t||(t=!0,fetch(e,{signal:i}).then(function(e){return function e(t){return t.read().then(function(i){if(!i.done){var n=i.value;return self.postMessage({cmd:"fetch-chunk",data:n,msg:"fetch-chunk"}),e(t);}self.postMessage({cmd:"fetch-fin",data:null,msg:"fetch-fin"});});}(e.body.getReader());})["catch"](function(e){if(!e.toString().includes("user aborted")){var t=" httplive request error:"+e+" start to retry";console.error(t),self.postMessage({cmd:"fetch-error",data:t,msg:"fetch-error"});}}));});self.onmessage=function(r){var a=r.data;switch(void 0===a.cmd||null===a.cmd?"":a.cmd){case"start":e=a.data,n(e),self.postMessage({cmd:"default",data:"WORKER STARTED",msg:"default"});break;case"stop":t.abort(),self.close(),self.postMessage({cmd:"close",data:"close",msg:"close"});break;case"retry":t.abort(),t=null,i=null,t=new AbortController(),i=t.signal,setTimeout(function(){n(e);},3e3);}};}.toString(),i=t.match(/^\s*function\s*\(\s*\)\s*\{(([\s\S](?!\}$))*[\s\S])/),n=[i[1]],window.URL.createObjectURL(new Blob(n,{type:"text/javascript"})))),this.workerFetch.onmessage=function(e){a._workerFetch_onmessage(e,a);},this.workerFetch,this.AVSniffPtr=Module.cwrap("AVSniffHttpFlvInit","number",["string","string"])("base64:QXV0aG9yOmNoYW5neWFubG9uZ3xudW1iZXJ3b2xmLEdpdGh1YjpodHRwczovL2dpdGh1Yi5jb20vbnVtYmVyd29sZixFbWFpbDpwb3JzY2hlZ3QyM0Bmb3htYWlsLmNvbSxRUTo1MzEzNjU4NzIsSG9tZVBhZ2U6aHR0cDovL3h2aWRlby52aWRlbyxEaXNjb3JkOm51bWJlcndvbGYjODY5NCx3ZWNoYXI6bnVtYmVyd29sZjExLEJlaWppbmcsV29ya0luOkJhaWR1","0.0.0"),this.AVSniffPtr,this._ptr_probeCallback=Module.addFunction(this._callbackProbe.bind(this)),this._ptr_yuvCallback=Module.addFunction(this._callbackYUV.bind(this)),this._ptr_naluCallback=Module.addFunction(this._callbackNALU.bind(this)),this._ptr_sampleCallback=Module.addFunction(this._callbackPCM.bind(this)),this._ptr_aacCallback=Module.addFunction(this._callbackAAC.bind(this)),Module.cwrap("initializeSniffHttpFlvModule","number",["number","number","number","number","number","number"])(this.AVSniffPtr,this._ptr_probeCallback,this._ptr_yuvCallback,this._ptr_naluCallback,this._ptr_sampleCallback,this._ptr_aacCallback),this.AVGLObj=r.setupCanvas(this.CanvasObj,{preserveDrawingBuffer:!1}),this.workerFetch.postMessage({cmd:"start",data:e,msg:"start"}),this._decode();}}])&&n(t.prototype,i),u&&n(t,u),e;}();i.CHttpLiveCore=u;},{"../consts":52,"../demuxer/buffer":64,"../demuxer/bufferFrame":65,"../render-engine/webgl-420p":77,"../version":80,"./audio-core":53,"./audio-native-core":54,"./av-common":55,"./cache":59,"./cacheYuv":60}],57:[function(e,t,i){"use strict";function n(e,t){for(var i=0;i0&&void 0!==arguments[0]&&arguments[0];this.showScreen=e,this.canvas&&(e?this.canvas.setAttribute("hidden",!0):this.canvas.removeAttribute("hidden"));}},{key:"getCachePTS",value:function value(){return 1!==this.config.ignoreAudio&&this.audioWAudio?Math.max(this.vCachePTS,this.aCachePTS):this.vCachePTS;}},{key:"getMaxPTS",value:function value(){return Math.max(this.vCachePTS,this.aCachePTS);}},{key:"isPlayingState",value:function value(){return this.isPlaying;}},{key:"pushDone",value:function value(){this.pushEOF=!0;}},{key:"_clearDecInterval",value:function value(){this.decVFrameInterval&&window.clearInterval(this.decVFrameInterval),this.decVFrameInterval=null;}},{key:"_checkPlayFinished",value:function value(){return!(this.config.playMode!==d.PLAYER_MODE_VOD||!(!0===this.bufRecvStat&&(this.playPTS>=this.bufLastVDTS||this.audioWAudio&&this.playPTS>=this.bufLastADTS)||this.duration-this.playPTS0&&(this.isPlaying=!0);var t=0,i=0,n=0;this.config.playMode===d.PLAYER_MODE_NOTIME_LIVE?this.playFrameInterval=window.setInterval(function(){if(e._videoQueue.length>0){var t=e._videoQueue.shift();t.pts,o.renderFrame(e.yuv,t.data_y,t.data_u,t.data_v,t.line1,t.height);}},1e3*this.frameDur):this.playFrameInterval=window.setInterval(function(){if(i=u.GetMsTime(),e._videoQueue.length>0&&i-t>=e.frameTime-n){var r=e._videoQueue.shift(),a=0;if(e.isNewSeek||null===e.audioWAudio||void 0===e.audioWAudio||(a=1e3*(r.pts-e.audioWAudio.getAlignVPTS()),e.playPTS=Math.max(e.audioWAudio.getAlignVPTS(),e.playPTS)),t=i,u.GetMsTime(),e.playPTS=Math.max(r.pts,e.playPTS),e.isNewSeek&&e.seekTarget-e.frameDur>r.pts)return void(n=e.frameTime);if(e.isNewSeek&&(e.audioWAudio&&e.audioWAudio.setVoice(e.audioVoice),e.audioWAudio&&e.audioWAudio.play(),n=0,e.isNewSeek=!1,e.seekTarget=0),e.showScreen?e.onRender&&e.onRender(r.line1,r.height,r.data_y,r.data_u,r.data_v):(r.pts,o.renderFrame(e.yuv,r.data_y,r.data_u,r.data_v,r.line1,r.height)),e.onPlayingTime&&e.onPlayingTime(r.pts),!e.isNewSeek&&e.audioWAudio&&(a<0&&-1*a<=e.frameTime||a>=0)){if(e.config.playMode===d.PLAYER_MODE_VOD)if(r.pts>=e.duration)e.onLoadCacheFinshed&&e.onLoadCacheFinshed(),e.onPlayingFinish&&e.onPlayingFinish(),e._clearDecInterval(),e.pause();else if(e._checkPlayFinished())return;n=u.GetMsTime()-i;}else!e.isNewSeek&&e.audioWAudio&&(a<0&&e.frameTime,n=e.frameTime);}e._checkPlayFinished();},1);}this.isNewSeek||this.audioWAudio&&this.audioWAudio.play();}},{key:"pause",value:function value(){this.isPlaying=!1,this._pause();}},{key:"_pause",value:function value(){this.playFrameInterval&&window.clearInterval(this.playFrameInterval),this.playFrameInterval=null,this.audioWAudio&&this.audioWAudio.pause();}},{key:"seek",value:function value(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.openFrameCall=!1,this.pause(),this._clearDecInterval(),null!==this.avFeedVideoInterval&&(window.clearInterval(this.avFeedVideoInterval),this.avFeedVideoInterval=null),null!==this.avFeedAudioInterval&&(window.clearInterval(this.avFeedAudioInterval),this.avFeedAudioInterval=null),this.yuvMaxTime=0,this.playVPipe.length=0,this._videoQueue.length=0,this.audioWAudio&&this.audioWAudio.stop(),e&&e(),this.isNewSeek=!0,this.avSeekVState=!0,this.seekTarget=i.seekTime,null!==this.audioWAudio&&void 0!==this.audioWAudio&&(this.audioWAudio.setVoice(0),this.audioWAudio.resetStartParam(),this.audioWAudio.stop()),this._avFeedData(i.seekTime),setTimeout(function(){t.yuvMaxTime=0,t._videoQueue.length=0,t.openFrameCall=!0,t.frameCallTag+=1,t._decVFrameIntervalFunc();},1e3);}},{key:"setVoice",value:function value(e){this.audioVoice=e,this.audioWAudio&&this.audioWAudio.setVoice(e);}},{key:"cacheIsFull",value:function value(){return this._videoQueue.length>=50;}},{key:"_checkDisplaySize",value:function value(e,t,i){var n=t-e,r=this.config.width+Math.ceil(n/2),a=t/this.config.width>i/this.config.height,s=(r/t).toFixed(2),o=(this.config.height/i).toFixed(2),u=a?s:o,l=this.config.fixed,d=l?r:parseInt(t*u),h=l?this.config.height:parseInt(i*u);if(this.canvas.offsetWidth!=d||this.canvas.offsetHeight!=h){var c=parseInt((this.canvasBox.offsetHeight-h)/2),f=parseInt((this.canvasBox.offsetWidth-d)/2);c=c<0?0:c,f=f<0?0:f,this.canvas.style.marginTop=c+"px",this.canvas.style.marginLeft=f+"px",this.canvas.style.width=d+"px",this.canvas.style.height=h+"px";}return this.isCheckDisplay=!0,[d,h];}},{key:"_createYUVCanvas",value:function value(){this.canvasBox=document.querySelector("#"+this.config.playerId),this.canvasBox.style.overflow="hidden",this.canvas=document.createElement("canvas"),this.canvas.style.width=this.canvasBox.clientWidth+"px",this.canvas.style.height=this.canvasBox.clientHeight+"px",this.canvas.style.top="0px",this.canvas.style.left="0px",this.canvasBox.appendChild(this.canvas),this.yuv=o.setupCanvas(this.canvas,{preserveDrawingBuffer:!1});}},{key:"_avRecvPackets",value:function value(){var e=this;this.bufObject.cleanPipeline(),null!==this.avRecvInterval&&(window.clearInterval(this.avRecvInterval),this.avRecvInterval=null),!0===this.config.checkProbe?this.avRecvInterval=window.setInterval(function(){Module.cwrap("getSniffStreamPkg","number",["number"])(e.corePtr),e._avCheckRecvFinish();},5):this.avRecvInterval=window.setInterval(function(){Module.cwrap("getSniffStreamPkgNoCheckProbe","number",["number"])(e.corePtr),e._avCheckRecvFinish();},5),this._avFeedData(0,!1);}},{key:"_avCheckRecvFinish",value:function value(){this.config.playMode===d.PLAYER_MODE_VOD&&this.duration-this.getMaxPTS()=50&&(t.onSeekFinish&&t.onSeekFinish(),t.onPlayingTime&&t.onPlayingTime(e),t.play(),window.clearInterval(i),i=null);},10);return!0;}},{key:"_afterAvFeedSeekToStartWithUnFinBuffer",value:function value(e){var t=this,i=window.setInterval(function(){t._videoQueue.length,t._videoQueue.length>=50&&(t.onSeekFinish&&t.onSeekFinish(),t.onPlayingTime&&t.onPlayingTime(e),!1===t.reFull?t.play():t.reFull=!1,window.clearInterval(i),i=null);},10);return!0;}},{key:"_avFeedData",value:function value(e){var t=this;if(this.playVPipe.length=0,this.audioWAudio&&this.audioWAudio.cleanQueue(),e<=0&&!1===this.bufOK){var i=0;if(this.avFeedVideoInterval=window.setInterval(function(){var n=t.bufObject.videoBuffer.length;if(n-1>i||t.duration-t.getMaxPTS()0){for(var s=0;s0&&t.playVPipe[t.playVPipe.length-1].pts>=t.bufLastVDTS&&(window.clearInterval(t.avFeedVideoInterval),t.avFeedVideoInterval=null,t.playVPipe[t.playVPipe.length-1].pts,t.bufLastVDTS,t.bufObject.videoBuffer,t.playVPipe);}else t.config.playMode===d.PLAYER_MODE_VOD&&t.playVPipe.length>0&&t.playVPipe[t.playVPipe.length-1].pts>=t.duration&&(window.clearInterval(t.avFeedVideoInterval),t.avFeedVideoInterval=null,t.playVPipe[t.playVPipe.length-1].pts,t.duration,t.bufObject.videoBuffer,t.playVPipe);t.avSeekVState&&(t.getMaxPTS(),t.duration,t.config.playMode===d.PLAYER_MODE_VOD&&(t._afterAvFeedSeekToStartWithFinishedBuffer(e),t.avSeekVState=!1));},5),void 0!==this.audioWAudio&&null!==this.audioWAudio&&this.config.ignoreAudio<1){var n=0;this.avFeedAudioInterval=window.setInterval(function(){var e=t.bufObject.audioBuffer.length;if(e-1>n||t.duration-t.getMaxPTS()0&&t.audioWAudio.sampleQueue[t.audioWAudio.sampleQueue.length-1].pts>=t.bufLastADTS&&(window.clearInterval(t.avFeedAudioInterval),t.avFeedAudioInterval=null,t.audioWAudio.sampleQueue[t.audioWAudio.sampleQueue.length-1].pts,t.bufObject.audioBuffer);}else t.config.playMode===d.PLAYER_MODE_VOD&&t.audioWAudio.sampleQueue.length>0&&t.audioWAudio.sampleQueue[t.audioWAudio.sampleQueue.length-1].pts>=t.duration&&(window.clearInterval(t.avFeedAudioInterval),t.avFeedAudioInterval=null,t.audioWAudio.sampleQueue[t.audioWAudio.sampleQueue.length-1].pts,t.bufObject.audioBuffer);},5);}}else{var r=this.bufObject.seekIDR(e),s=parseInt(r,10);this.playPTS=0;var o=s;if(this.avFeedVideoInterval=window.setInterval(function(){var i=t.bufObject.videoBuffer.length;if(i-1>o||t.duration-t.getMaxPTS()0){for(var r=0;r0&&t.playVPipe[t.playVPipe.length-1].pts>=t.bufLastVDTS&&(window.clearInterval(t.avFeedVideoInterval),t.avFeedVideoInterval=null);}else t.config.playMode===d.PLAYER_MODE_VOD&&t.playVPipe.length>0&&t.playVPipe[t.playVPipe.length-1].pts>=t.duration&&(window.clearInterval(t.avFeedVideoInterval),t.avFeedVideoInterval=null);t.avSeekVState&&(t.getMaxPTS(),t.duration,t.config.playMode===d.PLAYER_MODE_VOD&&(t._afterAvFeedSeekToStartWithUnFinBuffer(e),t.avSeekVState=!1));},5),this.audioWAudio&&this.config.ignoreAudio<1){var u=parseInt(e,10);this.avFeedAudioInterval=window.setInterval(function(){var e=t.bufObject.audioBuffer.length;if(e-1>u||t.duration-t.getMaxPTS()0&&t.audioWAudio.sampleQueue[t.audioWAudio.sampleQueue.length-1].pts>=t.bufLastADTS&&(window.clearInterval(t.avFeedAudioInterval),t.avFeedAudioInterval=null);}else t.config.playMode===d.PLAYER_MODE_VOD&&t.audioWAudio.sampleQueue.length>0&&t.audioWAudio.sampleQueue[t.audioWAudio.sampleQueue.length-1].pts>=t.duration&&(window.clearInterval(t.avFeedAudioInterval),t.avFeedAudioInterval=null);},5);}}}},{key:"_probeFinCallback",value:function value(e,t,i,n,r,a,s,o,u){var h=this;this._createYUVCanvas(),d.V_CODEC_NAME_HEVC,this.config.fps=1*n,this.frameTime=1e3/this.config.fps,this.width=t,this.height=i,this.frameDur=1/this.config.fps,this.duration=e-this.frameDur,this.vCodecID=o,this.config.sampleRate=a,this.channels=s,this.audioIdx=r,this.duration<0&&(this.config.playMode=d.PLAYER_MODE_NOTIME_LIVE,this.frameTime,this.frameDur);for(var c=Module.HEAPU8.subarray(u,u+10),f=0;f=0&&this.config.ignoreAudio<1?(void 0!==this.audioWAudio&&null!==this.audioWAudio&&(this.audioWAudio.stop(),this.audioWAudio=null),this.audioWAudio=l({sampleRate:a,appendType:d.APPEND_TYPE_FRAME}),this.audioWAudio.setDurationMs(1e3*e),this.onLoadCache&&this.audioWAudio.setOnLoadCache(function(){if(h.retryAuSampleNo,h.retryAuSampleNo<=5){h.pause(),h.onLoadCache&&h.onLoadCache();var e=window.setInterval(function(){return h.retryAuSampleNo,h.audioWAudio.sampleQueue.length,h.audioWAudio.sampleQueue.length>2?(h.onLoadCacheFinshed&&h.onLoadCacheFinshed(),h.play(),h.retryAuSampleNo=0,window.clearInterval(e),void(e=null)):(h.retryAuSampleNo+=1,h.retryAuSampleNo>5?(h.play(),h.onLoadCacheFinshed&&h.onLoadCacheFinshed(),window.clearInterval(e),void(e=null)):void 0);},1e3);}})):this.audioNone=!0,this._avRecvPackets(),this._decVFrameIntervalFunc()),this.onProbeFinish&&this.onProbeFinish();}},{key:"_ptsFixed2",value:function value(e){return Math.ceil(100*e)/100;}},{key:"_naluCallback",value:function value(e,t,i,n,r,a,s){var o=this._ptsFixed2(a),u=Module.HEAPU8.subarray(e,e+t),l=new Uint8Array(u);this.bufObject.appendFrameWithDts(o,s,l,!0,i),this.bufLastVDTS=Math.max(s,this.bufLastVDTS),this.vCachePTS=Math.max(o,this.vCachePTS),this.onCacheProcess&&this.onCacheProcess(this.getCachePTS());}},{key:"_samplesCallback",value:function value(e,t,i,n){}},{key:"_aacFrameCallback",value:function value(e,t,i,n,r){var a=this._ptsFixed2(r);if(this.audioWAudio){var s=new Uint8Array(7+i),o=Module.HEAPU8.subarray(e,e+7);s.set(o,0);var u=Module.HEAPU8.subarray(t,t+i);s.set(u,7),this.bufObject.appendFrame(a,s,!1,!0),this.bufLastADTS=Math.max(a,this.bufLastADTS),this.aCachePTS=Math.max(a,this.aCachePTS),this.onCacheProcess&&this.onCacheProcess(this.getCachePTS());}}},{key:"_decVFrameIntervalFunc",value:function value(){var e=this;null==this.decVFrameInterval&&(this.decVFrameInterval=window.setInterval(function(){if(e._videoQueue.length<50&&e.playVPipe.length>0){var t=e.playVPipe.shift(),i=t.data,n=Module._malloc(i.length);Module.HEAP8.set(i,n);var r=parseInt(1e3*t.pts,10),a=parseInt(1e3*t.dts,10);e.yuvMaxTime=Math.max(t.pts,e.yuvMaxTime),Module.cwrap("decodeVideoFrame","number",["number","number","number","number","number"])(e.corePtr,n,i.length,r,a,e.frameCallTag),Module._free(n),n=null;}},10));}},{key:"_frameCallback",value:function value(e,t,i,n,r,a,s,u,l,d){if(this._videoQueue.length,!(!1===this.openFrameCall||d!==this.frameCallTag||l>this.yuvMaxTime+this.frameDur||this.isNewSeek&&this.seekTarget-l>3*this.frameDur)){var h=this._videoQueue.length;if(this.canvas.width==n&&this.canvas.height==u||(this.canvas.width=n,this.canvas.height=u,this.isCheckDisplay)||this._checkDisplaySize(s,n,u),!(this.playPTS>l)){var f=Module.HEAPU8.subarray(e,e+n*u),p=Module.HEAPU8.subarray(t,t+r*u/2),m=Module.HEAPU8.subarray(i,i+a*u/2),g=new Uint8Array(f),_=new Uint8Array(p),y=new Uint8Array(m);this.config.readyShow&&(o.renderFrame(this.yuv,g,_,y,n,u),this.config.readyShow=!1,this.onReadyShowDone&&this.onReadyShowDone());var v=new c(g,_,y,n,r,a,s,u,l);if(h<=0||l>this._videoQueue[h-1].pts)this._videoQueue.push(v);else if(lthis._videoQueue[b].pts&&b+10&&(t.getPackageTimeMS=a.GetMsTime()),t.pushPkg++,void 0!==t.AVGetInterval&&null!==t.AVGetInterval||(t.AVGetInterval=window.setInterval(function(){Module.cwrap("getBufferLengthApi","number",["number"])(t.AVSniffPtr)>t.config.probeSize&&(Module.cwrap("getSniffHttpFlvPkg","number",["number"])(t.AVSniffPtr),t.pushPkg-=1);},5));break;case"close":t.AVGetInterval&&clearInterval(t.AVGetInterval),t.AVGetInterval=null;case"fetch-fin":break;case"fetch-error":t.onNetworkError&&t.onNetworkError(i.data);}}},{key:"_checkDisplaySize",value:function value(e,t,i){var n=t-e,r=this.config.width+Math.ceil(n/2),a=t/this.config.width>i/this.config.height,s=(r/t).toFixed(2),o=(this.config.height/i).toFixed(2),u=a?s:o,l=this.config.fixed,d=l?r:parseInt(t*u),h=l?this.config.height:parseInt(i*u);if(this.CanvasObj.offsetWidth!=d||this.CanvasObj.offsetHeight!=h){var c=parseInt((this.canvasBox.offsetHeight-h)/2),f=parseInt((this.canvasBox.offsetWidth-d)/2);c=c<0?0:c,f=f<0?0:f,this.CanvasObj.style.marginTop=c+"px",this.CanvasObj.style.marginLeft=f+"px",this.CanvasObj.style.width=d+"px",this.CanvasObj.style.height=h+"px";}return this.isCheckDisplay=!0,[d,h];}},{key:"_ptsFixed2",value:function value(e){return Math.ceil(100*e)/100;}},{key:"_callbackProbe",value:function value(e,t,i,n,r,a,u,l,d){for(var h=Module.HEAPU8.subarray(d,d+10),c=0;c100&&(f=o.DEFAULT_FPS,this.mediaInfo.noFPS=!0),this.vCodecID=l,this.config.fps=f,this.mediaInfo.fps=f,this.mediaInfo.size.width=t,this.mediaInfo.size.height=i,this.frameTime=Math.floor(1e3/(this.mediaInfo.fps+2)),this.CanvasObj.width==t&&this.CanvasObj.height==i||(this.CanvasObj.width=t,this.CanvasObj.height=i,this.isCheckDisplay)||this._checkDisplaySize(t,t,i),r>=0&&!1===this.mediaInfo.noFPS?(void 0!==this.audioWAudio&&null!==this.audioWAudio&&(this.audioWAudio.stop(),this.audioWAudio=null),this.config.sampleRate=a,this.mediaInfo.sampleRate=a,this.audioWAudio=s({sampleRate:this.mediaInfo.sampleRate,appendType:o.APPEND_TYPE_FRAME}),this.audioWAudio.isLIVE=!0):this.mediaInfo.audioNone=!0,this.onProbeFinish&&this.onProbeFinish();}},{key:"_callbackYUV",value:function value(e,t,i,n,r,a,s,o,u){var l=Module.HEAPU8.subarray(e,e+n*o),d=new Uint8Array(l),h=Module.HEAPU8.subarray(t,t+r*o/2),c=new Uint8Array(h),f=Module.HEAPU8.subarray(i,i+a*o/2),p={bufY:d,bufU:c,bufV:new Uint8Array(f),line_y:n,h:o,pts:u};this.YuvBuf.push(p),this.checkCacheState(),Module._free(l),l=null,Module._free(h),h=null,Module._free(f),f=null,!1===this.readyShowDone&&(this.playYUV(),this.readyShowDone=!0,this.onReadyShowDone&&this.onReadyShowDone(),this.audioWAudio||this.play());}},{key:"_callbackNALU",value:function value(e,t,i,n,r,a,s){if(!1===this.readyKeyFrame){if(i<=0)return;this.readyKeyFrame=!0;}var o=Module.HEAPU8.subarray(e,e+t),u=new Uint8Array(o);this.NaluBuf.push({bufData:u,len:t,isKey:i,w:n,h:r,pts:1e3*a,dts:1e3*s}),Module._free(o),o=null;}},{key:"_callbackPCM",value:function value(e){}},{key:"_callbackAAC",value:function value(e,t,i,n,r){var a=this._ptsFixed2(r);if(this.audioWAudio){var s=new Uint8Array(7+i),o=Module.HEAPU8.subarray(e,e+7);s.set(o,0);var u=Module.HEAPU8.subarray(t,t+i);s.set(u,7);var l={pts:a,data:s};this.audioWAudio.addSample(l),this.checkCacheState();}}},{key:"_decode",value:function value(){var e=this;setTimeout(function(){if(null!==e.workerFetch){var t=e.NaluBuf.shift();if(null!=t){var i=Module._malloc(t.bufData.length);Module.HEAP8.set(t.bufData,i),Module.cwrap("decodeHttpFlvVideoFrame","number",["number","number","number","number","number"])(e.AVSniffPtr,i,t.bufData.length,t.pts,t.dts,0),Module._free(i),i=null;}e._decode();}},1);}},{key:"checkCacheState",value:function value(){var e=this.YuvBuf.length>=25&&(!0===this.mediaInfo.audioNone||this.audioWAudio&&this.audioWAudio.sampleQueue.length>=50);return!1===this.cache_status&&e&&(this.playInterval&&this.audioWAudio&&this.audioWAudio.play(),this.onLoadCacheFinshed&&this.onLoadCacheFinshed(),this.cache_status=!0),e;}},{key:"setVoice",value:function value(e){this.audioVoice=e,this.audioWAudio&&this.audioWAudio.setVoice(e);}},{key:"_removeBindFuncPtr",value:function value(){null!==this._ptr_probeCallback&&Module.removeFunction(this._ptr_probeCallback),null!==this._ptr_frameCallback&&Module.removeFunction(this._ptr_frameCallback),null!==this._ptr_naluCallback&&Module.removeFunction(this._ptr_naluCallback),null!==this._ptr_sampleCallback&&Module.removeFunction(this._ptr_sampleCallback),null!==this._ptr_aacCallback&&Module.removeFunction(this._ptr_aacCallback),this._ptr_probeCallback=null,this._ptr_frameCallback=null,this._ptr_naluCallback=null,this._ptr_sampleCallback=null,this._ptr_aacCallback=null;}},{key:"release",value:function value(){return this.pause(),this.NaluBuf.length=0,this.YuvBuf.length=0,void 0!==this.workerFetch&&null!==this.workerFetch&&this.workerFetch.postMessage({cmd:"stop",data:"stop",msg:"stop"}),this.workerFetch=null,this.AVGetInterval&&clearInterval(this.AVGetInterval),this.AVGetInterval=null,this._removeBindFuncPtr(),Module.cwrap("releaseHttpFLV","number",["number"])(this.AVSniffPtr),this.playInterval&&clearInterval(this.playInterval),this.playInterval=null,this.audioWAudio&&this.audioWAudio.stop(),this.audioWAudio=null,this.CanvasObj&&this.CanvasObj.remove(),this.CanvasObj=null,0;}},{key:"isPlayingState",value:function value(){return null!==this.playInterval&&void 0!==this.playInterval;}},{key:"pause",value:function value(){this.audioWAudio&&this.audioWAudio.pause(),this.playInterval&&clearInterval(this.playInterval),this.playInterval=null;}},{key:"playYUV",value:function value(){if(this.YuvBuf.length>0){var e=this.YuvBuf.shift();return r.renderFrame(this.AVGLObj,e.bufY,e.bufU,e.bufV,e.line_y,e.h),!0;}return!1;}},{key:"play",value:function value(){var e=this,t=this;if(!1===this.checkCacheState())return this.onLoadCache&&this.onLoadCache(),setTimeout(function(){e.play();},100),!1;if(void 0===this.playInterval||null===this.playInterval){var i=0,n=0,s=0;!1===this.mediaInfo.audioNone&&this.audioWAudio&&!1===this.mediaInfo.noFPS?(this.playInterval=setInterval(function(){if(n=a.GetMsTime(),t.cache_status){if(n-i>=t.frameTime-s){var e=t.YuvBuf.shift();if(null!=e&&null!==e){var o=0;null!==t.audioWAudio&&void 0!==t.audioWAudio&&(o=1e3*(e.pts-t.audioWAudio.getAlignVPTS())),s=t.audioWAudio?o<0&&-1*o<=t.frameTime||o>=0?a.GetMsTime()-n+1:t.frameTime:a.GetMsTime()-n+1,r.renderFrame(t.AVGLObj,e.bufY,e.bufU,e.bufV,e.line_y,e.h);}(t.YuvBuf.length<=0||t.audioWAudio&&t.audioWAudio.sampleQueue.length<=0)&&(t.cache_status=!1,t.onLoadCache&&t.onLoadCache(),t.audioWAudio&&t.audioWAudio.pause()),i=n;}}else s=t.frameTime;},1),this.audioWAudio&&this.audioWAudio.play()):this.playInterval=setInterval(function(){var e=t.YuvBuf.shift();null!=e&&null!==e&&r.renderFrame(t.AVGLObj,e.bufY,e.bufU,e.bufV,e.line_y,e.h),t.YuvBuf.length<=0&&(t.cache_status=!1);},t.frameTime);}}},{key:"start",value:function value(e){var t,i,n,a=this;this.workerFetch=new Worker((t=function(){var e=null;self,self.onmessage=function(t){var i=t.data;switch(void 0===i.cmd||null===i.cmd?"":i.cmd){case"start":var n=i.data;(e=new WebSocket(n)).binaryType="arraybuffer",e.onopen=function(t){e.send("Hello WebSockets!");},e.onmessage=function(e){if(e.data instanceof ArrayBuffer){var t=e.data;t.byteLength>0&&postMessage({cmd:"fetch-chunk",data:new Uint8Array(t),msg:"fetch-chunk"});}},e.onclose=function(e){};break;case"stop":e&&e.close(),self.close(),self.postMessage({cmd:"close",data:"close",msg:"close"});}};}.toString(),i=t.match(/^\s*function\s*\(\s*\)\s*\{(([\s\S](?!\}$))*[\s\S])/),n=[i[1]],window.URL.createObjectURL(new Blob(n,{type:"text/javascript"})))),this.workerFetch.onmessage=function(e){a._workerFetch_onmessage(e,a);},this.workerFetch,this.AVSniffPtr=Module.cwrap("AVSniffHttpFlvInit","number",["string","string"])("base64:QXV0aG9yOmNoYW5neWFubG9uZ3xudW1iZXJ3b2xmLEdpdGh1YjpodHRwczovL2dpdGh1Yi5jb20vbnVtYmVyd29sZixFbWFpbDpwb3JzY2hlZ3QyM0Bmb3htYWlsLmNvbSxRUTo1MzEzNjU4NzIsSG9tZVBhZ2U6aHR0cDovL3h2aWRlby52aWRlbyxEaXNjb3JkOm51bWJlcndvbGYjODY5NCx3ZWNoYXI6bnVtYmVyd29sZjExLEJlaWppbmcsV29ya0luOkJhaWR1","0.0.0"),this.AVSniffPtr,this._ptr_probeCallback=Module.addFunction(this._callbackProbe.bind(this)),this._ptr_yuvCallback=Module.addFunction(this._callbackYUV.bind(this)),this._ptr_naluCallback=Module.addFunction(this._callbackNALU.bind(this)),this._ptr_sampleCallback=Module.addFunction(this._callbackPCM.bind(this)),this._ptr_aacCallback=Module.addFunction(this._callbackAAC.bind(this)),Module.cwrap("initializeSniffHttpFlvModule","number",["number","number","number","number","number","number"])(this.AVSniffPtr,this._ptr_probeCallback,this._ptr_yuvCallback,this._ptr_naluCallback,this._ptr_sampleCallback,this._ptr_aacCallback),this.AVGLObj=r.setupCanvas(this.CanvasObj,{preserveDrawingBuffer:!1}),this.workerFetch.postMessage({cmd:"start",data:e,msg:"start"}),this._decode();}}])&&n(t.prototype,i),u&&n(t,u),e;}();i.CWsLiveCore=u;},{"../consts":52,"../demuxer/buffer":64,"../demuxer/bufferFrame":65,"../render-engine/webgl-420p":77,"../version":80,"./audio-core":53,"./audio-native-core":54,"./av-common":55,"./cache":59,"./cacheYuv":60}],59:[function(e,t,i){(function(i){"use strict";e("./cacheYuv");i.CACHE_APPEND_STATUS_CODE={FAILED:-1,OVERFLOW:-2,OK:0,NOT_FULL:1,FULL:2,NULL:3},t.exports=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:60,t={limit:e,yuvCache:[],appendCacheByCacheYuv:function appendCacheByCacheYuv(e){e.pts;return t.yuvCache.length>=t.limit?CACHE_APPEND_STATUS_CODE.OVERFLOW:(t.yuvCache.push(e),t.yuvCache.length>=t.limit?CACHE_APPEND_STATUS_CODE.FULL:CACHE_APPEND_STATUS_CODE.NOT_FULL);},getState:function getState(){return t.yuvCache.length<=0?CACHE_APPEND_STATUS_CODE.NULL:t.yuvCache.length>=t.limit?CACHE_APPEND_STATUS_CODE.FULL:CACHE_APPEND_STATUS_CODE.NOT_FULL;},cleanPipeline:function cleanPipeline(){t.yuvCache.length=0;},vYuv:function vYuv(){return t.yuvCache.length<=0?null:t.yuvCache.shift();}};return t;};}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{});},{"./cacheYuv":60}],60:[function(e,t,i){"use strict";function n(e,t){for(var i=0;i>1;return r.indexOf(t);},GET_NALU_TYPE:function GET_NALU_TYPE(e){var t=(126&e)>>1;if(t>=1&&t<=9)return n.DEFINE_P_FRAME;if(t>=16&&t<=21)return n.DEFINE_KEY_FRAME;var i=r.indexOf(t);return i>=0?r[i]:n.DEFINE_OTHERS_FRAME;},PACK_NALU:function PACK_NALU(e){var t=e.nalu,i=e.vlc.vlc;null==t.vps&&(t.vps=new Uint8Array());var n=new Uint8Array(t.vps.length+t.sps.length+t.pps.length+t.sei.length+i.length);return n.set(t.vps,0),n.set(t.sps,t.vps.length),n.set(t.pps,t.vps.length+t.sps.length),n.set(t.sei,t.vps.length+t.sps.length+t.pps.length),n.set(i,t.vps.length+t.sps.length+t.pps.length+t.sei.length),n;}};},{"./hevc-header":61}],63:[function(e,t,i){"use strict";function n(e){return function(e){if(Array.isArray(e)){for(var t=0,i=new Array(e.length);t0&&void 0!==arguments[0]&&arguments[0];null!=t&&(t.showScreen=e,t.canvas&&(e?t.canvas.setAttribute("hidden",!0):t.canvas.removeAttribute("hidden")));},setSize:function setSize(e,i){t.config.width=e||l.DEFAULT_WIDTH,t.config.height=i||l.DEFAULT_HEIGHT;},setFrameRate:function setFrameRate(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:25;t.config.fps=e,t.config.frameDurMs=1e3/e;},setDurationMs:function setDurationMs(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1;t.durationMs=e,0==t.config.audioNone&&t.audio.setDurationMs(e);},setPlayingCall:function setPlayingCall(e){t.onPlayingTime=e;},setVoice:function setVoice(e){t.realVolume=e,0==t.config.audioNone&&t.audio.setVoice(t.realVolume);},isPlayingState:function isPlayingState(){return t.isPlaying||t.isCaching===l.CACHE_WITH_PLAY_SIGN;},appendAACFrame:function appendAACFrame(e){t.audio.addSample(e),t.aCachePTS=Math.max(e.pts,t.aCachePTS);},appendHevcFrame:function appendHevcFrame(e){var i;t.config.appendHevcType==l.APPEND_TYPE_STREAM?t.stream=new Uint8Array((i=n(t.stream)).concat.apply(i,n(e))):t.config.appendHevcType==l.APPEND_TYPE_FRAME&&(t.frameList.push(e),t.vCachePTS=Math.max(e.pts,t.vCachePTS));},getCachePTS:function getCachePTS(){return Math.max(t.vCachePTS,t.aCachePTS);},endAudio:function endAudio(){0==t.config.audioNone&&t.audio.stop();},cleanSample:function cleanSample(){0==t.config.audioNone&&t.audio.cleanQueue();},cleanVideoQueue:function cleanVideoQueue(){t.config.appendHevcType==l.APPEND_TYPE_STREAM?t.stream=new Uint8Array():t.config.appendHevcType==l.APPEND_TYPE_FRAME&&(t.frameList=[],t.frameList.length=0);},cleanCacheYUV:function cleanCacheYUV(){t.cacheYuvBuf.cleanPipeline();},pause:function pause(){t.loop&&window.clearInterval(t.loop),t.loop=null,0==t.config.audioNone&&t.audio.pause(),t.isPlaying=!1,t.isCaching===l.CACHE_WITH_PLAY_SIGN&&(t.isCaching=l.CACHE_WITH_NOPLAY_SIGN);},checkFinished:function checkFinished(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:l.PLAYER_MODE_VOD;return e==l.PLAYER_MODE_VOD&&t.cacheYuvBuf.yuvCache.length<=0&&(t.videoPTS.toFixed(1)>=(t.durationMs-t.config.frameDurMs)/1e3||t.noCacheFrame>=10)&&(null!=t.onPlayingFinish&&(l.PLAYER_MODE_VOD,t.frameList.length,t.cacheYuvBuf.yuvCache.length,t.videoPTS.toFixed(1),t.durationMs,t.config.frameDurMs,t.noCacheFrame,t.onPlayingFinish()),!0);},clearAllCache:function clearAllCache(){t.nowPacket=null,t.vCachePTS=0,t.aCachePTS=0,t.cleanSample(),t.cleanVideoQueue(),t.cleanCacheYUV();},seek:function seek(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.isPlaying;t.pause(),t.stopCacheThread(),t.clearAllCache(),e&&e(),t.isNewSeek=!0,t.flushDecoder=1,t.videoPTS=parseInt(i.seekTime);var r={seekPos:i.seekTime||-1,mode:i.mode||l.PLAYER_MODE_VOD,accurateSeek:i.accurateSeek||!0,seekEvent:i.seekEvent||!0,realPlay:n};t.cacheThread(),t.play(r);},getNalu1Packet:function getNalu1Packet(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],i=null,n=-1;if(t.config.appendHevcType==l.APPEND_TYPE_STREAM)i=t.nextNalu();else{if(t.config.appendHevcType!=l.APPEND_TYPE_FRAME)return null;var r=t.frameList.shift();if(!r)return null;i=r.data,n=r.pts,e&&(t.videoPTS=n);}return{nalBuf:i,pts:n};},decodeNalu1Frame:function decodeNalu1Frame(e,i){var n=Module._malloc(e.length);Module.HEAP8.set(e,n);var r=parseInt(1e3*i);Module.cwrap("decodeCodecContext","number",["number","number","number","number","number"])(t.vcodecerPtr,n,e.length,r,t.flushDecoder);return t.flushDecoder=0,Module._free(n),!1;},cacheThread:function cacheThread(){t.cacheLoop=window.setInterval(function(){if(t.cacheYuvBuf.getState()!=CACHE_APPEND_STATUS_CODE.FULL){var e=t.getNalu1Packet(!1);if(null!=e){var i=e.nalBuf,n=e.pts;t.decodeNalu1Frame(i,n,!0);}}},10);},stopCacheThread:function stopCacheThread(){null!==t.cacheLoop&&(window.clearInterval(t.cacheLoop),t.cacheLoop=null);},loadCache:function loadCache(){if(!(t.frameList.length<=3)){var e=t.isPlaying;if(t.cacheYuvBuf.yuvCache.length<=3){t.pause(),null!=t.onLoadCache&&t.onLoadCache(),t.isCaching=e?l.CACHE_WITH_PLAY_SIGN:l.CACHE_WITH_NOPLAY_SIGN;var i=t.frameList.length>30?30:t.frameList.length;null===t.cacheInterval&&(t.cacheInterval=window.setInterval(function(){t.cacheYuvBuf.yuvCache.length>=i&&(null!=t.onLoadCacheFinshed&&t.onLoadCacheFinshed(),window.clearInterval(t.cacheInterval),t.cacheInterval=null,t.isCaching===l.CACHE_WITH_PLAY_SIGN&&t.play(t.playParams),t.isCaching=l.CACHE_NO_LOADCACHE);},40));}}},playFunc:function playFunc(){var e=!1;if(t.playParams.seekEvent||r.GetMsTime()-t.calcuteStartTime>=t.frameTime-t.preCostTime){e=!0;var i=!0;if(t.calcuteStartTime=r.GetMsTime(),t.config.audioNone)t.playFrameYUV(i,t.playParams.accurateSeek);else{t.fix_poc_err_skip>0&&(t.fix_poc_err_skip--,i=!1);var n=t.videoPTS-t.audio.getAlignVPTS();if(n>0)return void(t.playParams.seekEvent&&!t.config.audioNone&&t.audio.setVoice(0));if(i){if(!(i=-1*n<=1*t.frameTimeSec)){for(var a=parseInt(n/t.frameTimeSec),s=0;s=i&&(t.playFrameYUV(!0,t.playParams.accurateSeek),i+=1);},1);}else t.videoPTS>=t.playParams.seekPos&&!t.isNewSeek||0===t.playParams.seekPos||0===t.playParams.seekPos?(t.frameTime=1e3/t.config.fps,t.frameTimeSec=t.frameTime/1e3,0==t.config.audioNone&&t.audio.play(),t.realVolume=t.config.audioNone?0:t.audio.voice,t.playParams.seekEvent&&(t.fix_poc_err_skip=10),t.loop=window.setInterval(function(){var e=r.GetMsTime();t.playFunc(),t.preCostTime=r.GetMsTime()-e;},1)):(t.loop=window.setInterval(function(){t.playFrameYUV(!1,t.playParams.accurateSeek),t.checkFinished(t.playParams.mode)?(window.clearInterval(t.loop),t.loop=null):t.videoPTS>=t.playParams.seekPos&&(window.clearInterval(t.loop),t.loop=null,t.play(t.playParams));},1),t.isNewSeek=!1);},stop:function stop(){t.release(),Module.cwrap("initializeDecoder","number",["number"])(t.vcodecerPtr),t.stream=new Uint8Array();},release:function release(){return t.endAudio(),t.cacheLoop&&window.clearInterval(t.cacheLoop),t.cacheLoop=null,t.loop&&window.clearInterval(t.loop),t.loop=null,t.pause(),null!==t.videoCallback&&Module.removeFunction(t.videoCallback),t.videoCallback=null,Module.cwrap("release","number",["number"])(t.vcodecerPtr),t.stream=null,t.frameList.length=0,t.durationMs=-1,t.videoPTS=0,t.isPlaying=!1,!0;},nextNalu:function nextNalu(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;if(t.stream.length<=4)return!1;for(var i=-1,n=0;n=t.stream.length){if(-1==i)return!1;var r=t.stream.subarray(i);return t.stream=new Uint8Array(),r;}var a="0 0 1"==t.stream.slice(0,3).join(" "),s="0 0 0 1"==t.stream.slice(0,4).join(" ");if(a||s){if(-1==i)i=n;else{if(e<=1){var o=t.stream.subarray(i,n);return t.stream=t.stream.subarray(n),o;}e-=1;}n+=3;}}return!1;},decodeSendPacket:function decodeSendPacket(e){var i=Module._malloc(e.length);Module.HEAP8.set(e,i);var n=Module.cwrap("decodeSendPacket","number",["number","number","number"])(t.vcodecerPtr,i,e.length);return Module._free(i),n;},decodeRecvFrame:function decodeRecvFrame(){return Module.cwrap("decodeRecv","number",["number"])(t.vcodecerPtr);},playFrameYUV:function playFrameYUV(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],i=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=t.cacheYuvBuf.vYuv();if(null==n)return t.noCacheFrame+=1,e&&!t.playParams.seekEvent&&t.loadCache(),!1;t.noCacheFrame=0;var r=n.pts;return t.videoPTS=r,(!e&&i||e)&&e&&t.drawImage(n.width,n.height,n.imageBufferY,n.imageBufferB,n.imageBufferR),e&&!t.playParams.seekEvent&&t.isPlaying&&t.loadCache(),!0;},drawImage:function drawImage(e,i,n,r,a){if(t.canvas.width===e&&t.canvas.height==i||(t.canvas.width=e,t.canvas.height=i),t.showScreen&&null!=t.onRender)t.onRender(e,i,n,r,a);else{if(!t.isCheckDisplay)t.checkDisplaySize(e,i);var s=e*i,o=e/2*(i/2),l=new Uint8Array(s+2*o);l.set(n,0),l.set(r,s),l.set(a,s+o),u.renderFrame(t.yuv,n,r,a,e,i);}},debugYUV:function debugYUV(e){t.debugYUVSwitch=!0,t.debugID=e;},checkDisplaySize:function checkDisplaySize(e,i){var n=e/t.config.width>i/t.config.height,r=(t.config.width/e).toFixed(2),a=(t.config.height/i).toFixed(2),s=n?r:a,o=t.config.fixed,u=o?t.config.width:parseInt(e*s),l=o?t.config.height:parseInt(i*s);if(t.canvas.offsetWidth!=u||t.canvas.offsetHeight!=l){var d=parseInt((t.canvasBox.offsetHeight-l)/2),h=parseInt((t.canvasBox.offsetWidth-u)/2);t.canvas.style.marginTop=d+"px",t.canvas.style.marginLeft=h+"px",t.canvas.style.width=u+"px",t.canvas.style.height=l+"px";}return t.isCheckDisplay=!0,[u,l];},makeWasm:function makeWasm(){if(null!=t.config.token){t.vcodecerPtr=Module.cwrap("registerPlayer","number",["string","string"])(t.config.token,d.PLAYER_VERSION),t.videoCallback=Module.addFunction(function(e,i,n,r,a,s,u,l,d){var h=Module.HEAPU8.subarray(e,e+r*l),c=Module.HEAPU8.subarray(i,i+a*l/2),f=Module.HEAPU8.subarray(n,n+s*l/2),p=new Uint8Array(h),m=new Uint8Array(c),g=new Uint8Array(f),_=1*d/1e3,y=new o.CacheYuvStruct(_,r,l,p,m,g);t.cacheYuvBuf.appendCacheByCacheYuv(y);}),Module.cwrap("setCodecType","number",["number","number","number"])(t.vcodecerPtr,t.config.videoCodec,t.videoCallback);Module.cwrap("initMissile","number",["number"])(t.vcodecerPtr);Module.cwrap("initializeDecoder","number",["number"])(t.vcodecerPtr);}},makeIt:function makeIt(){var e=document.querySelector("div#"+t.config.playerId),i=document.createElement("canvas");i.style.width=e.clientWidth+"px",i.style.height=e.clientHeight+"px",i.style.top="0px",i.style.left="0px",e.appendChild(i),t.canvasBox=e,t.canvas=i,t.yuv=u.setupCanvas(i,{preserveDrawingBuffer:!1}),0==t.config.audioNone&&(t.audio=a({sampleRate:t.config.sampleRate,appendType:t.config.appendHevcType})),t.isPlayLoadingFinish=1;}};return t.makeWasm(),t.makeIt(),t.cacheThread(),t;};},{"../consts":52,"../render-engine/webgl-420p":77,"../version":80,"./audio-core":53,"./av-common":55,"./cache":59,"./cacheYuv":60}],64:[function(e,t,i){"use strict";var n=e("./bufferFrame");t.exports=function(){var e={videoBuffer:[],audioBuffer:[],idrIdxBuffer:[],appendFrame:function appendFrame(t,i){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],s=new n.BufferFrame(t,a,i,r),o=parseInt(t);return r?(e.videoBuffer.length-1>=o?e.videoBuffer[o].push(s):e.videoBuffer.push([s]),a&&!e.idrIdxBuffer.includes(t)&&e.idrIdxBuffer.push(t)):e.audioBuffer.length-1>=o&&null!=e.audioBuffer[o]&&null!=e.audioBuffer[o]?e.audioBuffer[o]&&e.audioBuffer[o].push(s):e.audioBuffer.push([s]),!0;},appendFrameWithDts:function appendFrameWithDts(t,i,r){var a=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],s=arguments.length>4&&void 0!==arguments[4]&&arguments[4],o=n.ConstructWithDts(t,i,s,r,a),u=parseInt(i);return a?(e.videoBuffer.length-1>=u?e.videoBuffer[u].push(o):e.videoBuffer.push([o]),s&&!e.idrIdxBuffer.includes(i)&&e.idrIdxBuffer.push(i)):e.audioBuffer.length-1>=u&&null!=e.audioBuffer[u]&&null!=e.audioBuffer[u]?e.audioBuffer[u]&&e.audioBuffer[u].push(o):e.audioBuffer.push([o]),!0;},appendFrameByBufferFrame:function appendFrameByBufferFrame(t){var i=t.pts,n=parseInt(i);return t.video?(e.videoBuffer.length-1>=n?e.videoBuffer[n].push(t):e.videoBuffer.push([t]),isKey&&!e.idrIdxBuffer.includes(i)&&e.idrIdxBuffer.push(i)):e.audioBuffer.length-1>=n?e.audioBuffer[n].push(t):e.audioBuffer.push([t]),!0;},cleanPipeline:function cleanPipeline(){e.videoBuffer.length=0,e.audioBuffer.length=0;},vFrame:function vFrame(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1;if(!(t<0||t>e.videoBuffer.length-1))return e.videoBuffer[t];},aFrame:function aFrame(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1;if(!(t<0||t>e.audioBuffer.length-1))return e.audioBuffer[t];},seekIDR:function seekIDR(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1;if(e.idrIdxBuffer,e.videoBuffer,t<0)return null;if(e.idrIdxBuffer.includes(t))return t;for(var i=0;it||0===i&&e.idrIdxBuffer[i]>=t){for(var n=1;n>=0;n--){var r=i-n;if(r>=0)return e.idrIdxBuffer[r],e.idrIdxBuffer[r];}return e.idrIdxBuffer[i],j,e.idrIdxBuffer[i];}}}};return e;};},{"./bufferFrame":65}],65:[function(e,t,i){"use strict";function n(e,t){for(var i=0;i0&&i.extensionInfo.vHeight>0&&(i.size.width=i.extensionInfo.vWidth,i.size.height=i.extensionInfo.vHeight)),i.mediaInfo.duration,null!=i.onDemuxed&&i.onDemuxed(i.onReadyOBJ);for(var e=!1;void 0!==i.mpegTsObj&&null!==i.mpegTsObj;){var n=i.mpegTsObj.readPacket();if(n.size<=0)break;var r=n.dtime>0?n.dtime:n.ptime;if(!(r<0)){if(0==n.type){r<=i.vPreFramePTS&&(e=!0);var a=u.PACK_NALU(n.layer),o=1==n.keyframe,l=1==e?r+i.vStartTime:r,d=new s.BufferFrame(l,o,a,!0);i.bufObject.appendFrame(d.pts,d.data,!0,d.isKey),i.vPreFramePTS=l,null!=i.onSamples&&i.onSamples(i.onReadyOBJ,d);}else if(r<=i.aPreFramePTS&&(e=!0),"aac"==i.mediaInfo.aCodec)for(var h=n.data,c=0;c=3?(i._onTsReady(e),window.clearInterval(i.timerTsWasm),i.timerTsWasm=null):(i.mpegTsWasmRetryLoadTimes+=1,i.mpegTsObj.initDemuxer());},3e3);}},{key:"_onTsReady",value:function value(e){var t=this;t.hls.fetchM3u8(e),t.mpegTsWasmState=!0,t.timerFeed=window.setInterval(function(){if(t.tsList.length>0&&0==t.lockWait.state)try{var e=t.tsList.shift();if(null!=e){var i=e.streamURI,n=e.streamDur;t.lockWait.state=!0,t.lockWait.lockMember.dur=n,t.mpegTsObj.isLive=t.hls.isLive(),t.mpegTsObj.demuxURL(i);}else console.error("_onTsReady need wait ");}catch(e){console.error("onTsReady ERROR:",e),t.lockWait.state=!1;}},50);}},{key:"release",value:function value(){this.hls&&this.hls.release(),this.hls=null,this.timerFeed&&window.clearInterval(this.timerFeed),this.timerFeed=null,this.timerTsWasm&&window.clearInterval(this.timerTsWasm),this.timerTsWasm=null;}},{key:"bindReady",value:function value(e){this.onReadyOBJ=e;}},{key:"popBuffer",value:function value(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;return t<0?null:1===e?t+1>this.bufObject.videoBuffer.length?null:this.bufObject.vFrame(t):2===e?t+1>this.bufObject.audioBuffer.length?null:this.bufObject.aFrame(t):void 0;}},{key:"getVLen",value:function value(){return this.bufObject.videoBuffer.length;}},{key:"getALen",value:function value(){return this.bufObject.audioBuffer.length;}},{key:"getLastIdx",value:function value(){return this.bufObject.videoBuffer.length-1;}},{key:"getALastIdx",value:function value(){return this.bufObject.audioBuffer.length-1;}},{key:"getACodec",value:function value(){return this.aCodec;}},{key:"getVCodec",value:function value(){return this.vCodec;}},{key:"getDurationMs",value:function value(){return this.durationMs;}},{key:"getFPS",value:function value(){return this.fps;}},{key:"getSampleRate",value:function value(){return this.sampleRate;}},{key:"getSampleChannel",value:function value(){return this.aChannel;}},{key:"getSize",value:function value(){return this.size;}},{key:"seek",value:function value(e){if(e>=0){var t=this.bufObject.seekIDR(e);this.seekPos=t;}}}])&&n(t.prototype,i),d&&n(t,d),e;}();i.M3u8=d;},{"../consts":52,"../decoder/hevc-imp":62,"./buffer":64,"./bufferFrame":65,"./m3u8base":67,"./mpegts/mpeg.js":71}],67:[function(e,t,i){"use strict";function n(e,t){for(var i=0;i ",t),setTimeout(function(){i.fetchM3u8(e);},500);});}},{key:"_uriParse",value:function value(e){this._preURI="";var t=e.split("//"),i=null,n=null;if(t.length<1)return!1;t.length>1?(i=t[0],n=t[1].split("/"),this._preURI=i+"//"):n=t[0].split("/");for(var r=0;rp&&(o=p);var m=n[l+=1],g=null;g=m.indexOf("http")>=0?m:this._preURI+m,this._slices.indexOf(g)<0&&(this._slices.push(g),this._slices[this._slices.length-1],null!=this.onTransportStream&&this.onTransportStream(g,p));}}}if(this._slices.length>s.hlsSliceLimit&&this._type==r.PLAYER_IN_TYPE_M3U8_LIVE&&(this._slices=this._slices.slice(-1*s.hlsSliceLimit)),null!=this.onFinished){var _={type:this._type,duration:-1};this.onFinished(_);}return o;}},{key:"_readTag",value:function value(e){var t=s.tagParse.exec(e);return null!==t?{key:t[1],value:t[3]}:null;}}])&&n(t.prototype,i),o&&n(t,o),e;}();i.M3u8Base=o;},{"../consts":52}],68:[function(e,t,i){"use strict";var n=e("mp4box"),r=e("../decoder/hevc-header"),a=e("../decoder/hevc-imp"),s=e("./buffer"),o=e("../consts"),u={96e3:0,88200:1,64e3:2,48e3:3,44100:4,32e3:5,24e3:6,22050:7,16e3:8,12e3:9,11025:10,8e3:11,7350:12,Reserved:13,"frequency is written explictly":15},l=function l(e){for(var t=[],i=0;i1&&void 0!==arguments[1]&&arguments[1],i=null;return t?((i=e)[0]=r.DEFINE_STARTCODE[0],i[1]=r.DEFINE_STARTCODE[1],i[2]=r.DEFINE_STARTCODE[2],i[3]=r.DEFINE_STARTCODE[3]):((i=new Uint8Array(r.DEFINE_STARTCODE.length+e.length)).set(r.DEFINE_STARTCODE,0),i.set(e,r.DEFINE_STARTCODE.length)),i;},d.prototype.setAACAdts=function(e){var t=null,i=this.aacProfile,n=u[this.sampleRate],r=new Uint8Array(7),a=r.length+e.length;return r[0]=255,r[1]=241,r[2]=(i-1<<6)+(n<<2)+0,r[3]=128+(a>>11),r[4]=(2047&a)>>3,r[5]=31+((7&a)<<5),r[6]=252,(t=new Uint8Array(a)).set(r,0),t.set(e,r.length),t;},d.prototype.demux=function(){var e=this;e.seekPos=-1,e.mp4boxfile=n.createFile(),e.movieInfo=null,e.videoCodec=null,e.durationMs=-1,e.fps=-1,e.sampleRate=-1,e.aacProfile=2,e.size={width:-1,height:-1},e.bufObject=s(),e.audioNone=!1,e.naluHeader={vps:null,sps:null,pps:null,sei:null},e.mp4boxfile.onError=function(e){},this.mp4boxfile.onReady=function(t){for(var i in e.movieInfo=t,t.tracks){"VideoHandler"!==t.tracks[i].name&&"video"!==t.tracks[i].type||(t.tracks[i].codec,t.tracks[i].codec.indexOf("hev")>=0||t.tracks[i].codec.indexOf("hvc")>=0?e.videoCodec=o.CODEC_H265:t.tracks[i].codec.indexOf("avc")>=0&&(e.videoCodec=o.CODEC_H264));}var n=-1;if(n=t.videoTracks[0].samples_duration/t.videoTracks[0].timescale,e.durationMs=1e3*n,e.fps=t.videoTracks[0].nb_samples/n,e.seekDiffTime=1/e.fps,e.size.width=t.videoTracks[0].track_width,e.size.height=t.videoTracks[0].track_height,t.audioTracks.length>0){e.sampleRate=t.audioTracks[0].audio.sample_rate;var r=t.audioTracks[0].codec.split(".");e.aacProfile=r[r.length-1];}else e.audioNone=!0;null!=e.onMp4BoxReady&&e.onMp4BoxReady(e.videoCodec),e.videoCodec===o.CODEC_H265?(e.initializeAllSourceBuffers(),e.mp4boxfile.start()):(e.videoCodec,o.CODEC_H264);},e.mp4boxfile.onSamples=function(t,i,n){var s=window.setInterval(function(){for(var i=0;i3?e.naluHeader.sei=e.setStartCode(g[3][0].data,!1):e.naluHeader.sei=new Uint8Array(),e.naluHeader;}else e.videoCodec==o.CODEC_H264&&(e.naluHeader.vps=new Uint8Array(),e.naluHeader.sps=e.setStartCode(f.SPS[0].nalu,!1),e.naluHeader.pps=e.setStartCode(f.PPS[0].nalu,!1),e.naluHeader.sei=new Uint8Array());d[4].toString(16),e.naluHeader.vps[4].toString(16),l(e.naluHeader.vps),l(d);var _=e.setStartCode(d.subarray(0,e.naluHeader.vps.length),!0);if(l(_),d[4]===e.naluHeader.vps[4]){var y=e.naluHeader.vps.length+4,v=e.naluHeader.vps.length+e.naluHeader.sps.length+4,b=e.naluHeader.vps.length+e.naluHeader.sps.length+e.naluHeader.pps.length+4;if(e.naluHeader.sei.length<=0&&e.naluHeader.sps.length>0&&d[y]===e.naluHeader.sps[4]&&e.naluHeader.pps.length>0&&d[v]===e.naluHeader.pps[4]&&78===d[b]){d[e.naluHeader.vps.length+4],e.naluHeader.sps[4],d[e.naluHeader.vps.length+e.naluHeader.sps.length+4],e.naluHeader.pps[4],d[e.naluHeader.vps.length+e.naluHeader.sps.length+e.naluHeader.pps.length+4];for(var T=0,S=0;S4&&d[4]===e.naluHeader.sei[4]){var E=d.subarray(0,10),w=new Uint8Array(e.naluHeader.vps.length+E.length);w.set(E,0),w.set(e.naluHeader.vps,E.length),w[3]=1,e.naluHeader.vps=null,e.naluHeader.vps=new Uint8Array(w),w=null,E=null,(d=d.subarray(10))[4],e.naluHeader.vps[4],e.naluHeader.vps;}else if(0===e.naluHeader.sei.length&&78===d[4]){d=e.setStartCode(d,!0);for(var C=0,A=0;A1&&void 0!==arguments[1]?arguments[1]:0;return e.fileStart=t,this.mp4boxfile.appendBuffer(e);},d.prototype.finishBuffer=function(){this.mp4boxfile.flush();},d.prototype.play=function(){},d.prototype.getVideoCoder=function(){return this.videoCodec;},d.prototype.getDurationMs=function(){return this.durationMs;},d.prototype.getFPS=function(){return this.fps;},d.prototype.getSampleRate=function(){return this.sampleRate;},d.prototype.getSize=function(){return this.size;},d.prototype.seek=function(e){if(e>=0){var t=this.bufObject.seekIDR(e);this.seekPos=t;}},d.prototype.popBuffer=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;return t<0?null:1==e?this.bufObject.vFrame(t):2==e?this.bufObject.aFrame(t):void 0;},d.prototype.addBuffer=function(e){var t=e.id;this.mp4boxfile.setExtractionOptions(t);},d.prototype.initializeAllSourceBuffers=function(){if(this.movieInfo){for(var e=this.movieInfo,t=0;t>5);}},{key:"sliceAACFrames",value:function value(e,t){for(var i=[],n=e,r=0;r>4==15){var a=this._getPktLen(t[r+3],t[r+4],t[r+5]);if(a<=0)continue;var s=t.subarray(r,r+a),o=new Uint8Array(a);o.set(s,0),i.push({ptime:n,data:o}),n+=this.frameDurSec,r+=a;}else r+=1;}return i;}}])&&n(t.prototype,i),r&&n(t,r),e;}();i.AACDecoder=r;},{}],71:[function(e,t,i){(function(t){"use strict";function n(e,t){for(var i=0;i ",e),n=null;})["catch"](function(i){console.error("demuxerTsInit ERROR fetch ERROR ==> ",i),t._releaseOffset(),t.onDemuxedFailed&&t.onDemuxedFailed(i,e);});}},{key:"_releaseOffset",value:function value(){void 0!==this.offsetDemux&&null!==this.offsetDemux&&(Module._free(this.offsetDemux),this.offsetDemux=null);}},{key:"_demuxCore",value:function value(e){if(this._releaseOffset(),this._refreshDemuxer(),!(e.length<=0)){this.offsetDemux=Module._malloc(e.length),Module.HEAP8.set(e,this.offsetDemux);var t=Module.cwrap("demuxBox","number",["number","number","number"])(this.offsetDemux,e.length,this.isLive);Module._free(this.offsetDemux),this.offsetDemux=null,t>=0&&(this._setMediaInfo(),this._setExtensionInfo(),null!=this.onDemuxed&&this.onDemuxed());}}},{key:"_setMediaInfo",value:function value(){var e=Module.cwrap("getMediaInfo","number",[])(),t=Module.HEAPU32[e/4],i=Module.HEAPU32[e/4+1],n=Module.HEAPF64[e/8+1],s=Module.HEAPF64[e/8+1+1],o=Module.HEAPF64[e/8+1+1+1],u=Module.HEAPF64[e/8+1+1+1+1],l=Module.HEAPU32[e/4+2+2+2+2+2];this.mediaAttr.vFps=n,this.mediaAttr.vGop=l,this.mediaAttr.vDuration=s,this.mediaAttr.aDuration=o,this.mediaAttr.duration=u;var d=Module.cwrap("getAudioCodecID","number",[])();d>=0?(this.mediaAttr.aCodec=a.CODEC_OFFSET_TABLE[d],this.mediaAttr.sampleRate=t>0?t:a.DEFAULT_SAMPLERATE,this.mediaAttr.sampleChannel=i>=0?i:a.DEFAULT_CHANNEL):(this.mediaAttr.sampleRate=0,this.mediaAttr.sampleChannel=0,this.mediaAttr.audioNone=!0);var h=Module.cwrap("getVideoCodecID","number",[])();h>=0&&(this.mediaAttr.vCodec=a.CODEC_OFFSET_TABLE[h]),null==this.aacDec?this.aacDec=new r.AACDecoder(this.mediaAttr):this.aacDec.updateConfig(this.mediaAttr);}},{key:"_setExtensionInfo",value:function value(){var e=Module.cwrap("getExtensionInfo","number",[])(),t=Module.HEAPU32[e/4],i=Module.HEAPU32[e/4+1];this.extensionInfo.vWidth=t,this.extensionInfo.vHeight=i;}},{key:"readMediaInfo",value:function value(){return this.mediaAttr;}},{key:"readExtensionInfo",value:function value(){return this.extensionInfo;}},{key:"readAudioNone",value:function value(){return this.mediaAttr.audioNone;}},{key:"_readLayer",value:function value(){var e={vps:null,sps:null,pps:null,sei:null},t={vlc:null},i=Module.cwrap("getSPSLen","number",[])(),n=Module.cwrap("getSPS","number",[])();if(!(i<0)){e.sps=new Uint8Array(i),e.sps.set(Module.HEAPU8.subarray(n,n+i),0);var r=Module.cwrap("getPPSLen","number",[])(),s=Module.cwrap("getPPS","number",[])();e.pps=new Uint8Array(r),e.pps.set(Module.HEAPU8.subarray(s,s+r),0);var o=Module.cwrap("getSEILen","number",[])(),u=Module.cwrap("getSEI","number",[])();e.sei=new Uint8Array(o),e.sei.set(Module.HEAPU8.subarray(u,u+o),0);var l=Module.cwrap("getVLCLen","number",[])(),d=Module.cwrap("getVLC","number",[])();if(t.vlc=new Uint8Array(l),t.vlc.set(Module.HEAPU8.subarray(d,d+l),0),this.mediaAttr.vCodec==a.DEF_HEVC||this.mediaAttr.vCodec==a.DEF_H265){var h=Module.cwrap("getVPSLen","number",[])(),c=Module.cwrap("getVPS","number",[])();e.vps=new Uint8Array(h),e.vps.set(Module.HEAPU8.subarray(c,c+h),0);}else this.mediaAttr.vCodec==a.DEF_AVC||(this.mediaAttr.vCodec,a.DEF_H264);return{nalu:e,vlc:t};}}},{key:"isHEVC",value:function value(){return this.mediaAttr.vCodec==a.DEF_HEVC||this.mediaAttr.vCodec==a.DEF_H265;}},{key:"readPacket",value:function value(){var e=Module.cwrap("getPacket","number",[])(),t=Module.HEAPU32[e/4],i=Module.HEAPU32[e/4+1],n=Module.HEAPF64[e/8+1],r=Module.HEAPF64[e/8+1+1],s=Module.HEAPU32[e/4+1+1+2+2],o=Module.HEAPU32[e/4+1+1+2+2+1],u=Module.HEAPU8.subarray(o,o+i),l=this._readLayer();return{type:t,size:i,ptime:n,dtime:r,keyframe:s,src:u,data:1==t&&this.mediaAttr.aCodec==a.DEF_AAC?this.aacDec.sliceAACFrames(n,u):u,layer:l};}},{key:"_refreshDemuxer",value:function value(){this.releaseTsDemuxer(),this._initDemuxer();}},{key:"_initDemuxer",value:function value(){Module.cwrap("initTsMissile","number",[])(),Module.cwrap("initializeDemuxer","number",[])();}},{key:"releaseTsDemuxer",value:function value(){Module.cwrap("exitTsMissile","number",[])();}}])&&n(i.prototype,s),o&&n(i,o),e;}();i.MPEG_JS=s;}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{});},{"./consts":69,"./decoder/aac":70}],72:[function(e,t,i){"use strict";function n(e,t){for(var i=0;i0&&e.extensionInfo.vHeight>0&&(e.size.width=e.extensionInfo.vWidth,e.size.height=e.extensionInfo.vHeight);for(var t=null;!((t=e.mpegTsObj.readPacket()).size<=0);){var i=t.dtime;if(0==t.type){var n=s.PACK_NALU(t.layer),r=1==t.keyframe;e.bufObject.appendFrame(i,n,!0,r);}else if("aac"==e.mediaInfo.aCodec)for(var a=t.data,o=0;o0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;return t<0?null:1==e?this.bufObject.vFrame(t):2==e?this.bufObject.aFrame(t):void 0;}},{key:"isHEVC",value:function value(){return this.mpegTsObj.isHEVC();}},{key:"getACodec",value:function value(){return this.aCodec;}},{key:"getVCodec",value:function value(){return this.vCodec;}},{key:"getAudioNone",value:function value(){return this.mpegTsObj.mediaAttr.audioNone;}},{key:"getDurationMs",value:function value(){return this.durationMs;}},{key:"getFPS",value:function value(){return this.fps;}},{key:"getSampleRate",value:function value(){return this.sampleRate;}},{key:"getSize",value:function value(){return this.size;}},{key:"seek",value:function value(e){if(e>=0){var t=this.bufObject.seekIDR(e);this.seekPos=t;}}}])&&n(t.prototype,i),o&&n(t,o),e;}();i.MpegTs=o;},{"../decoder/hevc-imp":62,"./buffer":64,"./mpegts/mpeg.js":71}],73:[function(e,t,i){(function(t){"use strict";function n(e,t){for(var i=0;i0&&void 0!==arguments[0]&&arguments[0];return void 0!==this.player&&null!==this.player&&(this.player.setScreen(e),!0);}},{key:"play",value:function value(){if(void 0===this.player||null===this.player)return!1;if(this.playParam.videoCodec===m.CODEC_H265){var e={seekPos:this._getSeekTarget(),mode:this.playMode,accurateSeek:this.configFormat.accurateSeek,seekEvent:!1,realPlay:!0};this.player.play(e);}else this.player.play();return!0;}},{key:"pause",value:function value(){return void 0!==this.player&&null!==this.player&&(this.player.pause(),!0);}},{key:"isPlaying",value:function value(){return void 0!==this.player&&null!==this.player&&this.player.isPlayingState();}},{key:"setVoice",value:function value(e){return!(e<0||void 0===this.player||null===this.player||(this.volume=e,this.player&&this.player.setVoice(e),0));}},{key:"getVolume",value:function value(){return this.volume;}},{key:"mediaInfo",value:function value(){var e={meta:this.playParam,videoType:this.playMode};return e.meta.isHEVC=0===this.playParam.videoCodec,e;}},{key:"_seekHLS",value:function value(e,t,i){if(void 0===this.player||null===this.player)return!1;setTimeout(function(){t.player.getCachePTS(),t.player.getCachePTS()>e?i():t._seekHLS(e,t,i);},100);}},{key:"seek",value:function value(e){if(void 0===this.player||null===this.player)return!1;var t=this;this.seekTarget=e,this.onSeekStart&&this.onSeekStart(e),this.timerFeed&&(window.clearInterval(this.timerFeed),this.timerFeed=null);var i=this._getSeekTarget();return this.playParam.videoCodec===m.CODEC_H264?(this.player.seek(e),this.onSeekFinish&&this.onSeekFinish()):this.configFormat.extInfo.core===m.PLAYER_CORE_TYPE_CNATIVE?(this.pause(),this._seekHLS(e,this,function(){t.player.seek(function(){},{seekTime:i,mode:t.playMode,accurateSeek:t.configFormat.accurateSeek});})):this._seekHLS(e,this,function(){t.player.seek(function(){t.configFormat.type==m.PLAYER_IN_TYPE_MP4?t.mp4Obj.seek(e):t.configFormat.type==m.PLAYER_IN_TYPE_TS||t.configFormat.type==m.PLAYER_IN_TYPE_MPEGTS?t.mpegTsObj.seek(e):t.configFormat.type==m.PLAYER_IN_TYPE_M3U8&&(t.hlsObj.onSamples=null,t.hlsObj.seek(e));var i,n=(i=0,i=t.configFormat.accurateSeek?e:t._getBoxBufSeekIDR(),parseInt(i)),r=parseInt(t._getBoxBufSeekIDR())||0;t._avFeedMP4Data(r,n);},{seekTime:i,mode:t.playMode,accurateSeek:t.configFormat.accurateSeek});}),!0;}},{key:"fullScreen",value:function value(){if(this.autoScreenClose=!0,this.player.vCodecID===m.V_CODEC_NAME_HEVC){var e=document.querySelector("#"+this.configFormat.playerId),t=e.getElementsByTagName("canvas")[0];e.style.width=this.screenW+"px",e.style.height=this.screenH+"px";var i=this._checkScreenDisplaySize(this.screenW,this.screenH,this.playParam.size.width,this.playParam.size.height);t.style.marginTop=i[0]+"px",t.style.marginLeft=i[1]+"px",t.style.width=i[2]+"px",t.style.height=i[3]+"px",this._requestFullScreen(e);}else this._requestFullScreen(this.player.videoTag);}},{key:"closeFullScreen",value:function value(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!1===e&&(this.autoScreenClose=!1,this._exitFull()),this.player.vCodecID===m.V_CODEC_NAME_HEVC){var t=document.querySelector("#"+this.configFormat.playerId),i=t.getElementsByTagName("canvas")[0];t.style.width=this.configFormat.playerW+"px",t.style.height=this.configFormat.playerH+"px";var n=this._checkScreenDisplaySize(this.configFormat.playerW,this.configFormat.playerH,this.playParam.size.width,this.playParam.size.height);i.style.marginTop=n[0]+"px",i.style.marginLeft=n[1]+"px",i.style.width=n[2]+"px",i.style.height=n[3]+"px";}}},{key:"_checkScreenDisplaySize",value:function value(e,t,i,n){var r=i/e>n/t,a=(e/i).toFixed(2),s=(t/n).toFixed(2),o=r?a:s,u=this.fixed?e:parseInt(i*o),l=this.fixed?t:parseInt(n*o);return[parseInt((t-l)/2),parseInt((e-u)/2),u,l];}},{key:"_isFullScreen",value:function value(){var e=document.fullscreenElement||document.mozFullscreenElement||document.webkitFullscreenElement;return document.fullscreenEnabled||document.mozFullscreenEnabled||document.webkitFullscreenEnabled,null!=e;}},{key:"_requestFullScreen",value:function value(e){e.requestFullscreen?e.requestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.msRequestFullscreen?e.msRequestFullscreen():e.webkitRequestFullscreen&&e.webkitRequestFullScreen();}},{key:"_exitFull",value:function value(){document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.msExitFullscreen&&document.msExitFullscreen();}},{key:"_durationText",value:function value(e){if(e<0)return"Play";var t=Math.round(e);return Math.floor(t/3600)+":"+Math.floor(t%3600/60)+":"+Math.floor(t%60);}},{key:"_getSeekTarget",value:function value(){return this.configFormat.accurateSeek?this.seekTarget:this._getBoxBufSeekIDR();}},{key:"_getBoxBufSeekIDR",value:function value(){return this.configFormat.type==m.PLAYER_IN_TYPE_MP4?this.mp4Obj.seekPos:this.configFormat.type==m.PLAYER_IN_TYPE_TS||this.configFormat.type==m.PLAYER_IN_TYPE_MPEGTS?this.mpegTsObj.seekPos:this.configFormat.type==m.PLAYER_IN_TYPE_M3U8?this.hlsObj.seekPos:void 0;}},{key:"_playControl",value:function value(){this.isPlaying()?this.pause():this.play();}},{key:"_avFeedMP4Data",value:function value(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(void 0===this.player||null===this.player)return!1;var r=parseInt(this.playParam.durationMs/1e3);this.player.clearAllCache(),this.timerFeed=window.setInterval(function(){var a=null,s=null,o=!0,u=!0;if(e.configFormat.type==m.PLAYER_IN_TYPE_MP4?(a=e.mp4Obj.popBuffer(1,t),s=e.mp4Obj.audioNone?null:e.mp4Obj.popBuffer(2,i)):e.configFormat.type==m.PLAYER_IN_TYPE_TS||e.configFormat.type==m.PLAYER_IN_TYPE_MPEGTS?(a=e.mpegTsObj.popBuffer(1,t),s=e.mpegTsObj.getAudioNone()?null:e.mpegTsObj.popBuffer(2,i)):e.configFormat.type==m.PLAYER_IN_TYPE_M3U8&&(a=e.hlsObj.popBuffer(1,t),s=e.hlsObj.audioNone?null:e.hlsObj.popBuffer(2,i),t=e.hlsObj.getLastIdx()&&(o=!1),i=e.hlsObj.getALastIdx()&&(u=!1)),!0===o&&null!=a)for(var l=0;lr)return window.clearInterval(e.timerFeed),e.timerFeed=null,e.player.vCachePTS,e.player.aCachePTS,void(null!=n&&n());},5);}},{key:"_makeMP4Player",value:function value(){return this.mediaExtProtocol===m.URI_PROTOCOL_WEBSOCKET_DESC?(this._cWsFLVDecoderEntry(),0):(null!=this.configFormat.extInfo.core&&null!==this.configFormat.extInfo.core&&this.configFormat.extInfo.core===m.PLAYER_CORE_TYPE_CNATIVE?this._cDemuxDecoderEntry():this.configFormat.type==m.PLAYER_IN_TYPE_MP4?this.configFormat.extInfo.moovStartFlag?this._mp4EntryVodStream():this._mp4Entry():this.configFormat.type==m.PLAYER_IN_TYPE_TS||this.configFormat.type==m.PLAYER_IN_TYPE_MPEGTS?this._mpegTsEntry():this.configFormat.type==m.PLAYER_IN_TYPE_M3U8?this._m3u8Entry():this.configFormat.type===m.PLAYER_IN_TYPE_RAW_265&&this._raw265Entry(),0);}},{key:"_makeMP4PlayerViewEvent",value:function value(e,t,i,n){var a=this,s=arguments.length>4&&void 0!==arguments[4]&&arguments[4],o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null,u=this;if(this.playParam.durationMs=e,this.playParam.fps=t,this.playParam.sampleRate=i,this.playParam.size=n,this.playParam.audioNone=s,this.playParam.videoCodec=o||m.CODEC_H265,this.playParam,(this.configFormat.type==m.PLAYER_IN_TYPE_M3U8&&this.hlsConf.hlsType==m.PLAYER_IN_TYPE_M3U8_LIVE||this.configFormat.type==m.PLAYER_IN_TYPE_RAW_265)&&(this.playMode=m.PLAYER_MODE_NOTIME_LIVE),u.configFormat.extInfo.autoCrop){var l=document.querySelector("#"+this.configFormat.playerId),d=n.width/n.height,h=this.configFormat.playerW/this.configFormat.playerH;d>h?l.style.height=this.configFormat.playerW/d+"px":d=m.FETCH_FIRST_MAX_TIMES)return;i=new AbortController(),n=i.signal,e(s+1);}},m.FETCH_HTTP_FLV_TIMEOUT_MS),fetch(t.videoURL,{signal:n}).then(function(e){if(a=!0,e.headers.has("Content-Length"))o=e.headers.get("Content-Length"),t.player&&t.player.setProbeSize(o*t.configFormat.extInfo.coreProbePart);else{if(t.mediaExtFormat===m.PLAYER_IN_TYPE_FLV)return i.abort(),t.player.release(),t.player=null,t._cLiveFLVDecoderEntry(r),!0;t.player&&t.player.setProbeSize(4096);}return e.headers.get("Content-Length"),t.configFormat.type,t.mediaExtFormat,function e(i){return i.read().then(function(n){if(!n.done){n.value.buffer;var r=new Uint8Array(n.value.buffer);return t.player&&t.player.pushBuffer(r)<0?(t.player.release(),t.player=null,t._mp4EntryVodStream(),!1):e(i);}t.player&&t.player.pushDone();});}(e.body.getReader());})["catch"](function(e){e.toString().includes("user aborted")||console.error("cdemuxdecoder error",e);});}(0);}},{key:"_cLiveFLVDecoderEntry",value:function value(e){var t=this,i=this;e.probeSize=this.configFormat.extInfo.probeSize,this.player=new o.CHttpLiveCore(e),e.probeSize,this.player.onProbeFinish=function(){i.playParam.fps=i.player.mediaInfo.fps,i.playParam.durationMs=-1,i.playMode=m.PLAYER_MODE_NOTIME_LIVE,i.playParam.sampleRate=i.player.mediaInfo.sampleRate,i.playParam.size={width:i.player.mediaInfo.width,height:i.player.mediaInfo.height},i.playParam.audioNone=i.player.mediaInfo.audioNone,i.player.mediaInfo,i.player.vCodecID===m.V_CODEC_NAME_HEVC?(i.playParam.audioIdx<0&&(i.playParam.audioNone=!0),i.playParam.videoCodec=m.CODEC_H265,i.onLoadFinish&&i.onLoadFinish()):(i.playParam.videoCodec=m.CODEC_H264,i.player.release(),i.player=null,i._flvJsPlayer());},this.player.onNetworkError=function(e){i.onNetworkError&&i.onNetworkError(e);},this.player.onReadyShowDone=function(){i.configFormat.extInfo.readyShow=!1,i.onReadyShowDone&&i.onReadyShowDone();},this.player.onLoadCache=function(){null!=t.onLoadCache&&t.onLoadCache();},this.player.onLoadCacheFinshed=function(){null!=t.onLoadCacheFinshed&&t.onLoadCacheFinshed();},this.player.start(this.videoURL);}},{key:"_cWsFLVDecoderEntry",value:function value(){var e=this,t=this,i={width:this.configFormat.playerW,height:this.configFormat.playerH,playerId:this.configFormat.playerId,token:this.configFormat.token,readyShow:this.configFormat.extInfo.readyShow,checkProbe:this.configFormat.extInfo.checkProbe,ignoreAudio:this.configFormat.extInfo.ignoreAudio,playMode:this.playMode};i.probeSize=this.configFormat.extInfo.probeSize,this.player=new u.CWsLiveCore(i),i.probeSize,this.player.onProbeFinish=function(){t.playParam.fps=t.player.mediaInfo.fps,t.playParam.durationMs=-1,t.playMode=m.PLAYER_MODE_NOTIME_LIVE,t.playParam.sampleRate=t.player.mediaInfo.sampleRate,t.playParam.size={width:t.player.mediaInfo.width,height:t.player.mediaInfo.height},t.playParam.audioNone=t.player.mediaInfo.audioNone,t.player.mediaInfo,t.player.vCodecID===m.V_CODEC_NAME_HEVC?(t.playParam.audioIdx<0&&(t.playParam.audioNone=!0),t.playParam.videoCodec=m.CODEC_H265,t.onLoadFinish&&t.onLoadFinish()):(t.playParam.videoCodec=m.CODEC_H264,t.player.release(),t.player=null,t._flvJsPlayer());},this.player.onNetworkError=function(e){t.onNetworkError&&t.onNetworkError(e);},this.player.onReadyShowDone=function(){t.configFormat.extInfo.readyShow=!1,t.onReadyShowDone&&t.onReadyShowDone();},this.player.onLoadCache=function(){null!=e.onLoadCache&&e.onLoadCache();},this.player.onLoadCacheFinshed=function(){null!=e.onLoadCacheFinshed&&e.onLoadCacheFinshed();},this.player.start(this.videoURL);}},{key:"_mpegTsEntry",value:function value(){var e=this,t=new AbortController(),i=t.signal;this.timerFeed=null,this.mpegTsObj=new f.MpegTs(),this.mpegTsObj.bindReady(e),this.mpegTsObj.onDemuxed=this._mpegTsEntryReady.bind(this),this.mpegTsObj.onReady=function(){var n=null;fetch(e.videoURL,{signal:i}).then(function(r){if(r.headers.has("Content-Length"))return function t(i){return i.read().then(function(r){if(!r.done){var a=r.value;if(null===n)n=a;else{var s=a,o=n.length+s.length,u=new Uint8Array(o);u.set(n),u.set(s,n.length),n=new Uint8Array(u),s=null,u=null;}return t(i);}e.mpegTsObj.demux(n);});}(r.body.getReader());t.abort(),i=null,t=null;var a={width:e.configFormat.playerW,height:e.configFormat.playerH,playerId:e.configFormat.playerId,token:e.configFormat.token,readyShow:e.configFormat.extInfo.readyShow,checkProbe:e.configFormat.extInfo.checkProbe,ignoreAudio:e.configFormat.extInfo.ignoreAudio,playMode:e.playMode};e._cLiveFLVDecoderEntry(a);})["catch"](function(e){if(!e.toString().includes("user aborted")){var t=" mpegts request error:"+e;console.error(t);}});},this.mpegTsObj.initMPEG();}},{key:"_mpegTsEntryReady",value:function value(e){var t=e,i=(t.mpegTsObj.getVCodec(),t.mpegTsObj.getACodec()),n=t.mpegTsObj.getDurationMs(),r=t.mpegTsObj.getFPS(),a=t.mpegTsObj.getSampleRate(),s=t.mpegTsObj.getSize(),o=this.mpegTsObj.isHEVC();if(!o)return this.mpegTsObj.releaseTsDemuxer(),this.mpegTsObj=null,this.playParam.durationMs=n,this.playParam.fps=r,this.playParam.sampleRate=a,this.playParam.size=s,this.playParam.audioNone=""==i,this.playParam.videoCodec=o?0:1,this.playParam,void(this.onLoadFinish&&this.onLoadFinish());t._makeMP4PlayerViewEvent(n,r,a,s,""==i),parseInt(n/1e3),t._avFeedMP4Data(0,0);}},{key:"_m3u8Entry",value:function value(){var e=this,t=this,i=!1,n=0;this.hlsObj=new p.M3u8(),this.hlsObj.bindReady(t),this.hlsObj.onFinished=function(e,r){0==i&&(n=t.hlsObj.getDurationMs(),t.hlsConf.hlsType=r.type,i=!0);},this.hlsObj.onCacheProcess=function(t){e.playMode!==m.PLAYER_MODE_NOTIME_LIVE&&e.onCacheProcess&&e.onCacheProcess(t);},this.hlsObj.onDemuxed=function(e){if(null==t.player){var i=t.hlsObj.isHevcParam,r=(t.hlsObj.getVCodec(),t.hlsObj.getACodec()),a=t.hlsObj.getFPS(),s=t.hlsObj.getSampleRate(),o=t.hlsObj.getSize(),u=!1;if(u=t.hlsObj.getSampleChannel()<=0||""===r,!i)return t.hlsObj.release(),t.hlsObj.mpegTsObj&&t.hlsObj.mpegTsObj.releaseTsDemuxer(),t.hlsObj=null,t.playParam.durationMs=-1,t.playParam.fps=a,t.playParam.sampleRate=s,t.playParam.size=o,t.playParam.audioNone=""==r,t.playParam.videoCodec=i?0:1,t.playParam,void t._videoJsPlayer();t._makeMP4PlayerViewEvent(n,a,s,o,u);}},this.hlsObj.onSamples=this._hlsOnSamples.bind(this),this.hlsObj.demux(this.videoURL);}},{key:"_hlsOnSamples",value:function value(e,t){1==t.video?this.player.appendHevcFrame(t):!1===this.hlsObj.audioNone&&this.player.appendAACFrame(t);}},{key:"_videoJsPlayer",value:function value(){var e=this,t={width:this.configFormat.playerW,height:this.configFormat.playerH,playerId:this.configFormat.playerId,ignoreAudio:this.configFormat.extInfo.ignoreAudio};this.player=new l.NvVideojsCore(t),this.player.onMakeItReady=function(){e.onMakeItReady&&e.onMakeItReady();},this.player.onLoadFinish=function(){e.playParam.size=e.player.getSize(),e.player.duration===1/0||e.player.duration<0?(e.playParam.durationMs=-1,e.playMode=m.PLAYER_MODE_NOTIME_LIVE):(e.playParam.durationMs=1e3*e.player.duration,e.playMode=m.PLAYER_MODE_VOD),e.onLoadFinish&&e.onLoadFinish();},this.player.onReadyShowDone=function(){e.onReadyShowDone&&e.onReadyShowDone();},this.player.onPlayingFinish=function(){e.pause(),e.seek(0),null!=e.onPlayFinish&&e.onPlayFinish();},this.player.onPlayingTime=function(t){e._durationText(t),e._durationText(e.player.duration),null!=e.onPlayTime&&e.onPlayTime(t);},this.player.onSeekFinish=function(){e.onSeekFinish&&e.onSeekFinish();},this.player.makeIt(this.videoURL);}},{key:"_flvJsPlayer",value:function value(){var e=this,t={width:this.configFormat.playerW,height:this.configFormat.playerH,playerId:this.configFormat.playerId,ignoreAudio:this.configFormat.extInfo.ignoreAudio};this.player=new d.NvFlvjsCore(t),this.player.onLoadFinish=function(){e.playParam.size=e.player.getSize(),!e.player.duration||NaN===e.player.duration||e.player.duration===1/0||e.player.duration<0?(e.playParam.durationMs=-1,e.playMode=m.PLAYER_MODE_NOTIME_LIVE):(e.playParam.durationMs=1e3*e.player.duration,e.playMode=m.PLAYER_MODE_VOD),e.onLoadFinish&&e.onLoadFinish();},this.player.onReadyShowDone=function(){e.onReadyShowDone&&e.onReadyShowDone();},this.player.onPlayingTime=function(t){e._durationText(t),e._durationText(e.player.duration),null!=e.onPlayTime&&e.onPlayTime(t);},this.player.onPlayingFinish=function(){e.pause(),e.seek(0),null!=e.onPlayFinish&&e.onPlayFinish();},this.player.makeIt(this.videoURL);}},{key:"_raw265Entry",value:function value(){this._makeMP4PlayerViewEvent(-1,this.configFormat.extInfo.rawFps,-1,{width:this.configFormat.playerW,height:this.configFormat.playerH},!0,m.CODEC_H265),this.timerFeed&&(window.clearInterval(this.timerFeed),this.timerFeed=null);}},{key:"append265NaluFrame",value:function value(e){var t={data:e,pts:this.rawModePts};this.player.appendHevcFrame(t),this.configFormat.extInfo.readyShow&&this.player.cacheYuvBuf.getState()!=CACHE_APPEND_STATUS_CODE.NULL&&(this.player.playFrameYUV(!0,!0),this.configFormat.extInfo.readyShow=!1,this.onReadyShowDone&&this.onReadyShowDone()),this.rawModePts+=1/this.configFormat.extInfo.rawFps;}}])&&n(i.prototype,v),b&&n(i,b),e;}();i.H265webjs=v,t.new265webjs=function(e,t){return new v(e,t);};}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{});},{"./consts":52,"./decoder/av-common":55,"./decoder/c-httplive-core":56,"./decoder/c-native-core":57,"./decoder/c-wslive-core":58,"./decoder/cache":59,"./decoder/player-core":63,"./demuxer/m3u8":66,"./demuxer/mp4":68,"./demuxer/mpegts/mpeg.js":71,"./demuxer/ts":72,"./native/mp4-player":74,"./native/nv-flvjs-core":75,"./native/nv-videojs-core":76,"./utils/static-mem":78,"./utils/ui/ui":79}],74:[function(e,t,i){"use strict";function n(e,t){for(var i=0;i>1,a>>1,i),e.v.fill(r>>1,a>>1,n),e.drawArrays(e.TRIANGLE_STRIP,0,4);},setupCanvas:function setupCanvas(e,t){var i=e.getContext("webgl")||e.getContext("experimental-webgl");if(!i)return i;var r=i.createProgram(),a=["attribute highp vec4 aVertexPosition;","attribute vec2 aTextureCoord;","varying highp vec2 vTextureCoord;","void main(void) {"," gl_Position = aVertexPosition;"," vTextureCoord = aTextureCoord;","}"].join("\n"),s=i.createShader(i.VERTEX_SHADER);i.shaderSource(s,a),i.compileShader(s);var o=["precision highp float;","varying lowp vec2 vTextureCoord;","uniform sampler2D YTexture;","uniform sampler2D UTexture;","uniform sampler2D VTexture;","const mat4 YUV2RGB = mat4","("," 1.1643828125, 0, 1.59602734375, -.87078515625,"," 1.1643828125, -.39176171875, -.81296875, .52959375,"," 1.1643828125, 2.017234375, 0, -1.081390625,"," 0, 0, 0, 1",");","void main(void) {"," gl_FragColor = vec4( texture2D(YTexture, vTextureCoord).x, texture2D(UTexture, vTextureCoord).x, texture2D(VTexture, vTextureCoord).x, 1) * YUV2RGB;","}"].join("\n"),u=i.createShader(i.FRAGMENT_SHADER);i.shaderSource(u,o),i.compileShader(u),i.attachShader(r,s),i.attachShader(r,u),i.linkProgram(r),i.useProgram(r),i.getProgramParameter(r,i.LINK_STATUS);var l=i.getAttribLocation(r,"aVertexPosition");i.enableVertexAttribArray(l);var d=i.getAttribLocation(r,"aTextureCoord");i.enableVertexAttribArray(d);var h=i.createBuffer();i.bindBuffer(i.ARRAY_BUFFER,h),i.bufferData(i.ARRAY_BUFFER,new Float32Array([1,1,0,-1,1,0,1,-1,0,-1,-1,0]),i.STATIC_DRAW),i.vertexAttribPointer(l,3,i.FLOAT,!1,0,0);var c=i.createBuffer();return i.bindBuffer(i.ARRAY_BUFFER,c),i.bufferData(i.ARRAY_BUFFER,new Float32Array([1,0,0,0,1,1,0,1]),i.STATIC_DRAW),i.vertexAttribPointer(d,2,i.FLOAT,!1,0,0),i.y=new n(i),i.u=new n(i),i.v=new n(i),i.y.bind(0,r,"YTexture"),i.u.bind(1,r,"UTexture"),i.v.bind(2,r,"VTexture"),i;}};},{}],78:[function(e,t,i){(function(e){"use strict";e.STATIC_MEM_wasmDecoderState=-1,e.STATICE_MEM_playerCount=-1,e.STATICE_MEM_playerIndexPtr=0;}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{});},{}],79:[function(e,t,i){"use strict";function n(e,t){for(var i=0;i0?o:0);}if(A["default"].console){var u=A["default"].console[i];u||"debug"!==i||(u=A["default"].console.info||A["default"].console.log),u&&a&&s.test(i)&&u[Array.isArray(r)?"apply":"call"](A["default"].console,r);}};}(t,r),r.createLogger=function(i){return e(t+": "+i);},r.levels={all:"debug|log|warn|error",off:"",debug:"debug|log|warn|error",info:"log|warn|error",warn:"warn|error",error:"error",DEFAULT:n},r.level=function(e){if("string"==typeof e){if(!r.levels.hasOwnProperty(e))throw new Error('"'+e+'" in not a valid log level');n=e;}return n;},(r.history=function(){return q?[].concat(q):[];}).filter=function(e){return(q||[]).filter(function(t){return new RegExp(".*"+e+".*").test(t[0]);});},r.history.clear=function(){q&&(q.length=0);},r.history.disable=function(){null!==q&&(q.length=0,q=null);},r.history.enable=function(){null===q&&(q=[]);},r.error=function(){for(var e=arguments.length,t=new Array(e),r=0;r1?t-1:0),n=1;n=0)throw new Error("class has illegal whitespace characters");}function ke(){return k["default"]===A["default"].document;}function xe(e){return ee(e)&&1===e.nodeType;}function Ie(){try{return A["default"].parent!==A["default"].self;}catch(e){return!0;}}function Pe(e){return function(t,i){if(!Ce(t))return k["default"][e](null);Ce(i)&&(i=k["default"].querySelector(i));var n=xe(i)?i:k["default"];return n[e]&&n[e](t);};}function Le(e,t,i,n){void 0===e&&(e="div"),void 0===t&&(t={}),void 0===i&&(i={});var r=k["default"].createElement(e);return Object.getOwnPropertyNames(t).forEach(function(e){var i=t[e];-1!==e.indexOf("aria-")||"role"===e||"type"===e?(K.warn("Setting attributes in the second argument of createEl()\nhas been deprecated. Use the third argument instead.\ncreateEl(type, properties, attributes). Attempting to set "+e+" to "+i+"."),r.setAttribute(e,i)):"textContent"===e?De(r,i):r[e]===i&&"tabIndex"!==e||(r[e]=i);}),Object.getOwnPropertyNames(i).forEach(function(e){r.setAttribute(e,i[e]);}),n&&$e(r,n),r;}function De(e,t){return void 0===e.textContent?e.innerText=t:e.textContent=t,e;}function Ue(e,t){t.firstChild?t.insertBefore(e,t.firstChild):t.appendChild(e);}function Re(e,t){return Ae(t),e.classList?e.classList.contains(t):(i=t,new RegExp("(^|\\s)"+i+"($|\\s)")).test(e.className);var i;}function Oe(e,t){return e.classList?e.classList.add(t):Re(e,t)||(e.className=(e.className+" "+t).trim()),e;}function Me(e,t){return e?(e.classList?e.classList.remove(t):(Ae(t),e.className=e.className.split(/\s+/).filter(function(e){return e!==t;}).join(" ")),e):(K.warn("removeClass was called with an element that doesn't exist"),null);}function Fe(e,t,i){var n=Re(e,t);if("function"==typeof i&&(i=i(e,t)),"boolean"!=typeof i&&(i=!n),i!==n)return i?Oe(e,t):Me(e,t),e;}function Be(e,t){Object.getOwnPropertyNames(t).forEach(function(i){var n=t[i];null==n||!1===n?e.removeAttribute(i):e.setAttribute(i,!0===n?"":n);});}function Ne(e){var t={},i=",autoplay,controls,playsinline,loop,muted,default,defaultMuted,";if(e&&e.attributes&&e.attributes.length>0)for(var n=e.attributes,r=n.length-1;r>=0;r--){var a=n[r].name,s=n[r].value;"boolean"!=typeof e[a]&&-1===i.indexOf(","+a+",")||(s=null!==s),t[a]=s;}return t;}function je(e,t){return e.getAttribute(t);}function Ve(e,t,i){e.setAttribute(t,i);}function He(e,t){e.removeAttribute(t);}function ze(){k["default"].body.focus(),k["default"].onselectstart=function(){return!1;};}function Ge(){k["default"].onselectstart=function(){return!0;};}function We(e){if(e&&e.getBoundingClientRect&&e.parentNode){var t=e.getBoundingClientRect(),i={};return["bottom","height","left","right","top","width"].forEach(function(e){void 0!==t[e]&&(i[e]=t[e]);}),i.height||(i.height=parseFloat(ie(e,"height"))),i.width||(i.width=parseFloat(ie(e,"width"))),i;}}function Ye(e){if(!e||e&&!e.offsetParent)return{left:0,top:0,width:0,height:0};for(var t=e.offsetWidth,i=e.offsetHeight,n=0,r=0;e.offsetParent&&e!==k["default"][H.fullscreenElement];){n+=e.offsetLeft,r+=e.offsetTop,e=e.offsetParent;}return{left:n,top:r,width:t,height:i};}function qe(e,t){var i={x:0,y:0};if(Se)for(var n=e;n&&"html"!==n.nodeName.toLowerCase();){var r=ie(n,"transform");if(/^matrix/.test(r)){var a=r.slice(7,-1).split(/,\s/).map(Number);i.x+=a[4],i.y+=a[5];}else if(/^matrix3d/.test(r)){var s=r.slice(9,-1).split(/,\s/).map(Number);i.x+=s[12],i.y+=s[13];}n=n.parentNode;}var o={},u=Ye(t.target),l=Ye(e),d=l.width,h=l.height,c=t.offsetY-(l.top-u.top),f=t.offsetX-(l.left-u.left);return t.changedTouches&&(f=t.changedTouches[0].pageX-l.left,c=t.changedTouches[0].pageY+l.top,Se&&(f-=i.x,c-=i.y)),o.y=1-Math.max(0,Math.min(1,c/h)),o.x=Math.max(0,Math.min(1,f/d)),o;}function Ke(e){return ee(e)&&3===e.nodeType;}function Xe(e){for(;e.firstChild;){e.removeChild(e.firstChild);}return e;}function Qe(e){return"function"==typeof e&&(e=e()),(Array.isArray(e)?e:[e]).map(function(e){return"function"==typeof e&&(e=e()),xe(e)||Ke(e)?e:"string"==typeof e&&/\S/.test(e)?k["default"].createTextNode(e):void 0;}).filter(function(e){return e;});}function $e(e,t){return Qe(t).forEach(function(t){return e.appendChild(t);}),e;}function Je(e,t){return $e(Xe(e),t);}function Ze(e){return void 0===e.button&&void 0===e.buttons||0===e.button&&void 0===e.buttons||"mouseup"===e.type&&0===e.button&&0===e.buttons||0===e.button&&1===e.buttons;}var et,tt=Pe("querySelector"),it=Pe("querySelectorAll"),nt=Object.freeze({__proto__:null,isReal:ke,isEl:xe,isInFrame:Ie,createEl:Le,textContent:De,prependTo:Ue,hasClass:Re,addClass:Oe,removeClass:Me,toggleClass:Fe,setAttributes:Be,getAttributes:Ne,getAttribute:je,setAttribute:Ve,removeAttribute:He,blockTextSelection:ze,unblockTextSelection:Ge,getBoundingClientRect:We,findPosition:Ye,getPointerPosition:qe,isTextNode:Ke,emptyEl:Xe,normalizeContent:Qe,appendContent:$e,insertContent:Je,isSingleLeftClick:Ze,$:tt,$$:it}),rt=!1,at=function at(){if(!1!==et.options.autoSetup){var e=Array.prototype.slice.call(k["default"].getElementsByTagName("video")),t=Array.prototype.slice.call(k["default"].getElementsByTagName("audio")),i=Array.prototype.slice.call(k["default"].getElementsByTagName("video-js")),n=e.concat(t,i);if(n&&n.length>0)for(var r=0,a=n.length;r-1&&(r={passive:!0}),e.addEventListener(t,n.dispatcher,r);}else e.attachEvent&&e.attachEvent("on"+t,n.dispatcher);}function bt(e,t,i){if(pt.has(e)){var n=pt.get(e);if(n.handlers){if(Array.isArray(t))return gt(bt,e,t,i);var r=function r(e,t){n.handlers[t]=[],mt(e,t);};if(void 0!==t){var a=n.handlers[t];if(a)if(i){if(i.guid)for(var s=0;s=t&&(e.apply(void 0,arguments),i=n);};},xt=function xt(){};xt.prototype.allowedEvents_={},xt.prototype.on=function(e,t){var i=this.addEventListener;this.addEventListener=function(){},vt(this,e,t),this.addEventListener=i;},xt.prototype.addEventListener=xt.prototype.on,xt.prototype.off=function(e,t){bt(this,e,t);},xt.prototype.removeEventListener=xt.prototype.off,xt.prototype.one=function(e,t){var i=this.addEventListener;this.addEventListener=function(){},St(this,e,t),this.addEventListener=i;},xt.prototype.any=function(e,t){var i=this.addEventListener;this.addEventListener=function(){},Et(this,e,t),this.addEventListener=i;},xt.prototype.trigger=function(e){var t=e.type||e;"string"==typeof e&&(e={type:t}),e=_t(e),this.allowedEvents_[t]&&this["on"+t]&&this["on"+t](e),Tt(this,e);},xt.prototype.dispatchEvent=xt.prototype.trigger,xt.prototype.queueTrigger=function(e){var t=this;wt||(wt=new Map());var i=e.type||e,n=wt.get(this);n||(n=new Map(),wt.set(this,n));var r=n.get(i);n["delete"](i),A["default"].clearTimeout(r);var a=A["default"].setTimeout(function(){0===n.size&&(n=null,wt["delete"](t)),t.trigger(e);},0);n.set(i,a);};var It=function It(e){return"function"==typeof e.name?e.name():"string"==typeof e.name?e.name:e.name_?e.name_:e.constructor&&e.constructor.name?e.constructor.name:_typeof(e);},Pt=function Pt(e){return e instanceof xt||!!e.eventBusEl_&&["on","one","off","trigger"].every(function(t){return"function"==typeof e[t];});},Lt=function Lt(e){return"string"==typeof e&&/\S/.test(e)||Array.isArray(e)&&!!e.length;},Dt=function Dt(e,t,i){if(!e||!e.nodeName&&!Pt(e))throw new Error("Invalid target for "+It(t)+"#"+i+"; must be a DOM node or evented object.");},Ut=function Ut(e,t,i){if(!Lt(e))throw new Error("Invalid event type for "+It(t)+"#"+i+"; must be a non-empty string or array.");},Rt=function Rt(e,t,i){if("function"!=typeof e)throw new Error("Invalid listener for "+It(t)+"#"+i+"; must be a function.");},Ot=function Ot(e,t,i){var n,r,a,s=t.length<3||t[0]===e||t[0]===e.eventBusEl_;return s?(n=e.eventBusEl_,t.length>=3&&t.shift(),r=t[0],a=t[1]):(n=t[0],r=t[1],a=t[2]),Dt(n,e,i),Ut(r,e,i),Rt(a,e,i),{isTargetingSelf:s,target:n,type:r,listener:a=At(e,a)};},Mt=function Mt(e,t,i,n){Dt(e,e,t),e.nodeName?Ct[t](e,i,n):e[t](i,n);},Ft={on:function on(){for(var e=this,t=arguments.length,i=new Array(t),n=0;n=0;e--){this.children_[e].dispose&&this.children_[e].dispose();}this.children_=null,this.childIndex_=null,this.childNameIndex_=null,this.parentComponent_=null,this.el_&&(this.el_.parentNode&&this.el_.parentNode.removeChild(this.el_),this.el_=null),this.player_=null;}},t.isDisposed=function(){return Boolean(this.isDisposed_);},t.player=function(){return this.player_;},t.options=function(e){return e?(this.options_=zt(this.options_,e),this.options_):this.options_;},t.el=function(){return this.el_;},t.createEl=function(e,t,i){return Le(e,t,i);},t.localize=function(e,t,i){void 0===i&&(i=e);var n=this.player_.language&&this.player_.language(),r=this.player_.languages&&this.player_.languages(),a=r&&r[n],s=n&&n.split("-")[0],o=r&&r[s],u=i;return a&&a[e]?u=a[e]:o&&o[e]&&(u=o[e]),t&&(u=u.replace(/\{(\d+)\}/g,function(e,i){var n=t[i-1],r=n;return void 0===n&&(r=e),r;})),u;},t.handleLanguagechange=function(){},t.contentEl=function(){return this.contentEl_||this.el_;},t.id=function(){return this.id_;},t.name=function(){return this.name_;},t.children=function(){return this.children_;},t.getChildById=function(e){return this.childIndex_[e];},t.getChild=function(e){if(e)return this.childNameIndex_[e];},t.getDescendant=function(){for(var e=arguments.length,t=new Array(e),i=0;i=0;i--){if(this.children_[i]===e){t=!0,this.children_.splice(i,1);break;}}if(t){e.parentComponent_=null,this.childIndex_[e.id()]=null,this.childNameIndex_[Ht(e.name())]=null,this.childNameIndex_[Vt(e.name())]=null;var n=e.el();n&&n.parentNode===this.contentEl()&&this.contentEl().removeChild(e.el());}}},t.initChildren=function(){var t=this,i=this.options_.children;if(i){var n,r=this.options_,a=e.getComponent("Tech");(n=Array.isArray(i)?i:Object.keys(i)).concat(Object.keys(this.options_).filter(function(e){return!n.some(function(t){return"string"==typeof t?e===t:e===t.name;});})).map(function(e){var n,r;return"string"==typeof e?r=i[n=e]||t.options_[n]||{}:(n=e.name,r=e),{name:n,opts:r};}).filter(function(t){var i=e.getComponent(t.opts.componentClass||Ht(t.name));return i&&!a.isTech(i);}).forEach(function(e){var i=e.name,n=e.opts;if(void 0!==r[i]&&(n=r[i]),!1!==n){!0===n&&(n={}),n.playerOptions=t.options_.playerOptions;var a=t.addChild(i,n);a&&(t[i]=a);}});}},t.buildCSSClass=function(){return"";},t.ready=function(e,t){if(void 0===t&&(t=!1),e)return this.isReady_?void(t?e.call(this):this.setTimeout(e,1)):(this.readyQueue_=this.readyQueue_||[],void this.readyQueue_.push(e));},t.triggerReady=function(){this.isReady_=!0,this.setTimeout(function(){var e=this.readyQueue_;this.readyQueue_=[],e&&e.length>0&&e.forEach(function(e){e.call(this);},this),this.trigger("ready");},1);},t.$=function(e,t){return tt(e,t||this.contentEl());},t.$$=function(e,t){return it(e,t||this.contentEl());},t.hasClass=function(e){return Re(this.el_,e);},t.addClass=function(e){Oe(this.el_,e);},t.removeClass=function(e){Me(this.el_,e);},t.toggleClass=function(e,t){Fe(this.el_,e,t);},t.show=function(){this.removeClass("vjs-hidden");},t.hide=function(){this.addClass("vjs-hidden");},t.lockShowing=function(){this.addClass("vjs-lock-showing");},t.unlockShowing=function(){this.removeClass("vjs-lock-showing");},t.getAttribute=function(e){return je(this.el_,e);},t.setAttribute=function(e,t){Ve(this.el_,e,t);},t.removeAttribute=function(e){He(this.el_,e);},t.width=function(e,t){return this.dimension("width",e,t);},t.height=function(e,t){return this.dimension("height",e,t);},t.dimensions=function(e,t){this.width(e,!0),this.height(t);},t.dimension=function(e,t,i){if(void 0!==t)return null!==t&&t==t||(t=0),-1!==(""+t).indexOf("%")||-1!==(""+t).indexOf("px")?this.el_.style[e]=t:this.el_.style[e]="auto"===t?"":t+"px",void(i||this.trigger("componentresize"));if(!this.el_)return 0;var n=this.el_.style[e],r=n.indexOf("px");return-1!==r?parseInt(n.slice(0,r),10):parseInt(this.el_["offset"+Ht(e)],10);},t.currentDimension=function(e){var t=0;if("width"!==e&&"height"!==e)throw new Error("currentDimension only accepts width or height value");if(t=ie(this.el_,e),0===(t=parseFloat(t))||isNaN(t)){var i="offset"+Ht(e);t=this.el_[i];}return t;},t.currentDimensions=function(){return{width:this.currentDimension("width"),height:this.currentDimension("height")};},t.currentWidth=function(){return this.currentDimension("width");},t.currentHeight=function(){return this.currentDimension("height");},t.focus=function(){this.el_.focus();},t.blur=function(){this.el_.blur();},t.handleKeyDown=function(e){this.player_&&(e.stopPropagation(),this.player_.handleKeyDown(e));},t.handleKeyPress=function(e){this.handleKeyDown(e);},t.emitTapEvents=function(){var e,t=0,i=null;this.on("touchstart",function(n){1===n.touches.length&&(i={pageX:n.touches[0].pageX,pageY:n.touches[0].pageY},t=A["default"].performance.now(),e=!0);}),this.on("touchmove",function(t){if(t.touches.length>1)e=!1;else if(i){var n=t.touches[0].pageX-i.pageX,r=t.touches[0].pageY-i.pageY;Math.sqrt(n*n+r*r)>10&&(e=!1);}});var n=function n(){e=!1;};this.on("touchleave",n),this.on("touchcancel",n),this.on("touchend",function(n){(i=null,!0===e)&&A["default"].performance.now()-t<200&&(n.preventDefault(),this.trigger("tap"));});},t.enableTouchActivity=function(){if(this.player()&&this.player().reportUserActivity){var e,t=At(this.player(),this.player().reportUserActivity);this.on("touchstart",function(){t(),this.clearInterval(e),e=this.setInterval(t,250);});var i=function i(_i3){t(),this.clearInterval(e);};this.on("touchmove",t),this.on("touchend",i),this.on("touchcancel",i);}},t.setTimeout=function(e,t){var i,n=this;return e=At(this,e),this.clearTimersOnDispose_(),i=A["default"].setTimeout(function(){n.setTimeoutIds_.has(i)&&n.setTimeoutIds_["delete"](i),e();},t),this.setTimeoutIds_.add(i),i;},t.clearTimeout=function(e){return this.setTimeoutIds_.has(e)&&(this.setTimeoutIds_["delete"](e),A["default"].clearTimeout(e)),e;},t.setInterval=function(e,t){e=At(this,e),this.clearTimersOnDispose_();var i=A["default"].setInterval(e,t);return this.setIntervalIds_.add(i),i;},t.clearInterval=function(e){return this.setIntervalIds_.has(e)&&(this.setIntervalIds_["delete"](e),A["default"].clearInterval(e)),e;},t.requestAnimationFrame=function(e){var t,i=this;return this.supportsRaf_?(this.clearTimersOnDispose_(),e=At(this,e),t=A["default"].requestAnimationFrame(function(){i.rafIds_.has(t)&&i.rafIds_["delete"](t),e();}),this.rafIds_.add(t),t):this.setTimeout(e,1e3/60);},t.requestNamedAnimationFrame=function(e,t){var i=this;if(!this.namedRafs_.has(e)){this.clearTimersOnDispose_(),t=At(this,t);var n=this.requestAnimationFrame(function(){t(),i.namedRafs_.has(e)&&i.namedRafs_["delete"](e);});return this.namedRafs_.set(e,n),e;}},t.cancelNamedAnimationFrame=function(e){this.namedRafs_.has(e)&&(this.cancelAnimationFrame(this.namedRafs_.get(e)),this.namedRafs_["delete"](e));},t.cancelAnimationFrame=function(e){return this.supportsRaf_?(this.rafIds_.has(e)&&(this.rafIds_["delete"](e),A["default"].cancelAnimationFrame(e)),e):this.clearTimeout(e);},t.clearTimersOnDispose_=function(){var e=this;this.clearingTimersOnDispose_||(this.clearingTimersOnDispose_=!0,this.one("dispose",function(){[["namedRafs_","cancelNamedAnimationFrame"],["rafIds_","cancelAnimationFrame"],["setTimeoutIds_","clearTimeout"],["setIntervalIds_","clearInterval"]].forEach(function(t){var i=t[0],n=t[1];e[i].forEach(function(t,i){return e[n](i);});}),e.clearingTimersOnDispose_=!1;}));},e.registerComponent=function(t,i){if("string"!=typeof t||!t)throw new Error('Illegal component name, "'+t+'"; must be a non-empty string.');var n,r=e.getComponent("Tech"),a=r&&r.isTech(i),s=e===i||e.prototype.isPrototypeOf(i.prototype);if(a||!s)throw n=a?"techs must be registered using Tech.registerTech()":"must be a Component subclass",new Error('Illegal component, "'+t+'"; '+n+".");t=Ht(t),e.components_||(e.components_={});var o=e.getComponent("Player");if("Player"===t&&o&&o.players){var u=o.players,l=Object.keys(u);if(u&&l.length>0&&l.map(function(e){return u[e];}).every(Boolean))throw new Error("Can not register Player component after player has been created.");}return e.components_[t]=i,e.components_[Vt(t)]=i,i;},e.getComponent=function(t){if(t&&e.components_)return e.components_[t];},e;}();function Xt(e,t,i,n){return function(e,t,i){if("number"!=typeof t||t<0||t>i)throw new Error("Failed to execute '"+e+"' on 'TimeRanges': The index provided ("+t+") is non-numeric or out of bounds (0-"+i+").");}(e,n,i.length-1),i[n][t];}function Qt(e){var t;return t=void 0===e||0===e.length?{length:0,start:function start(){throw new Error("This TimeRanges object is empty");},end:function end(){throw new Error("This TimeRanges object is empty");}}:{length:e.length,start:Xt.bind(null,"start",0,e),end:Xt.bind(null,"end",1,e)},A["default"].Symbol&&A["default"].Symbol.iterator&&(t[A["default"].Symbol.iterator]=function(){return(e||[]).values();}),t;}function $t(e,t){return Array.isArray(e)?Qt(e):void 0===e||void 0===t?Qt():Qt([[e,t]]);}function Jt(e,t){var i,n,r=0;if(!t)return 0;e&&e.length||(e=$t(0,0));for(var a=0;at&&(n=t),r+=n-i;}return r/t;}function Zt(e){if(e instanceof Zt)return e;"number"==typeof e?this.code=e:"string"==typeof e?this.message=e:ee(e)&&("number"==typeof e.code&&(this.code=e.code),Z(this,e)),this.message||(this.message=Zt.defaultMessages[this.code]||"");}Kt.prototype.supportsRaf_="function"==typeof A["default"].requestAnimationFrame&&"function"==typeof A["default"].cancelAnimationFrame,Kt.registerComponent("Component",Kt),Zt.prototype.code=0,Zt.prototype.message="",Zt.prototype.status=null,Zt.errorTypes=["MEDIA_ERR_CUSTOM","MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED","MEDIA_ERR_ENCRYPTED"],Zt.defaultMessages={1:"You aborted the media playback",2:"A network error caused the media download to fail part-way.",3:"The media playback was aborted due to a corruption problem or because the media used features your browser did not support.",4:"The media could not be loaded, either because the server or network failed or because the format is not supported.",5:"The media is encrypted and we do not have the keys to decrypt it."};for(var ei=0;ei=0;n--){if(t[n].enabled){li(t,t[n]);break;}}return(i=e.call(this,t)||this).changing_=!1,i;}P["default"](t,e);var i=t.prototype;return i.addTrack=function(t){var i=this;t.enabled&&li(this,t),e.prototype.addTrack.call(this,t),t.addEventListener&&(t.enabledChange_=function(){i.changing_||(i.changing_=!0,li(i,t),i.changing_=!1,i.trigger("change"));},t.addEventListener("enabledchange",t.enabledChange_));},i.removeTrack=function(t){e.prototype.removeTrack.call(this,t),t.removeEventListener&&t.enabledChange_&&(t.removeEventListener("enabledchange",t.enabledChange_),t.enabledChange_=null);},t;}(oi),hi=function hi(e,t){for(var i=0;i=0;n--){if(t[n].selected){hi(t,t[n]);break;}}return(i=e.call(this,t)||this).changing_=!1,Object.defineProperty(I["default"](i),"selectedIndex",{get:function get(){for(var e=0;e0&&(A["default"].console&&A["default"].console.groupCollapsed&&A["default"].console.groupCollapsed("Text Track parsing errors for "+t.src),n.forEach(function(e){return K.error(e);}),A["default"].console&&A["default"].console.groupEnd&&A["default"].console.groupEnd()),i.flush();},ki=function ki(e,t){var i={uri:e},n=wi(e);n&&(i.cors=n);var r="use-credentials"===t.tech_.crossOrigin();r&&(i.withCredentials=r),U["default"](i,At(this,function(e,i,n){if(e)return K.error(e,i);t.loaded_=!0,"function"!=typeof A["default"].WebVTT?t.tech_&&t.tech_.any(["vttjsloaded","vttjserror"],function(e){if("vttjserror"!==e.type)return Ai(n,t);K.error("vttjs failed to load, stopping trying to process "+t.src);}):Ai(n,t);}));},xi=function(e){function t(t){var i;if(void 0===t&&(t={}),!t.tech)throw new Error("A tech was not provided.");var n=zt(t,{kind:yi[t.kind]||"subtitles",language:t.language||t.srclang||""}),r=vi[n.mode]||"disabled",a=n["default"];"metadata"!==n.kind&&"chapters"!==n.kind||(r="hidden"),(i=e.call(this,n)||this).tech_=n.tech,i.cues_=[],i.activeCues_=[],i.preload_=!1!==i.tech_.preloadTextTracks;var s=new mi(i.cues_),o=new mi(i.activeCues_),u=!1,l=At(I["default"](i),function(){this.tech_.isReady_&&!this.tech_.isDisposed()&&(this.activeCues=this.activeCues,u&&(this.trigger("cuechange"),u=!1));});return i.tech_.one("dispose",function(){i.tech_.off("timeupdate",l);}),"disabled"!==r&&i.tech_.on("timeupdate",l),Object.defineProperties(I["default"](i),{"default":{get:function get(){return a;},set:function set(){}},mode:{get:function get(){return r;},set:function set(e){vi[e]&&r!==e&&(r=e,this.preload_||"disabled"===r||0!==this.cues.length||ki(this.src,this),this.tech_.off("timeupdate",l),"disabled"!==r&&this.tech_.on("timeupdate",l),this.trigger("modechange"));}},cues:{get:function get(){return this.loaded_?s:null;},set:function set(){}},activeCues:{get:function get(){if(!this.loaded_)return null;if(0===this.cues.length)return o;for(var e=this.tech_.currentTime(),t=[],i=0,n=this.cues.length;i=e||r.startTime===r.endTime&&r.startTime<=e&&r.startTime+.5>=e)&&t.push(r);}if(u=!1,t.length!==this.activeCues_.length)u=!0;else for(var a=0;a0)return void this.trigger("vttjsloaded");var t=k["default"].createElement("script");t.src=this.options_["vtt.js"]||"https://vjs.zencdn.net/vttjs/0.14.1/vtt.min.js",t.onload=function(){e.trigger("vttjsloaded");},t.onerror=function(){e.trigger("vttjserror");},this.on("dispose",function(){t.onload=null,t.onerror=null;}),A["default"].WebVTT=!0,this.el().parentNode.appendChild(t);}else this.ready(this.addWebVttScript_);},i.emulateTextTracks=function(){var e=this,t=this.textTracks(),i=this.remoteTextTracks(),n=function n(e){return t.addTrack(e.track);},r=function r(e){return t.removeTrack(e.track);};i.on("addtrack",n),i.on("removetrack",r),this.addWebVttScript_();var a=function a(){return e.trigger("texttrackchange");},s=function s(){a();for(var e=0;e=0;r--){var a=e[r];a[t]&&a[t](n,i);}}(e,i,o,s),o;}var Vi={buffered:1,currentTime:1,duration:1,muted:1,played:1,paused:1,seekable:1,volume:1,ended:1},Hi={setCurrentTime:1,setMuted:1,setVolume:1},zi={play:1,pause:1};function Gi(e){return function(t,i){return t===Bi?Bi:i[e]?i[e](t):t;};}var Wi={opus:"video/ogg",ogv:"video/ogg",mp4:"video/mp4",mov:"video/mp4",m4v:"video/mp4",mkv:"video/x-matroska",m4a:"audio/mp4",mp3:"audio/mpeg",aac:"audio/aac",caf:"audio/x-caf",flac:"audio/flac",oga:"audio/ogg",wav:"audio/wav",m3u8:"application/x-mpegURL",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",png:"image/png",svg:"image/svg+xml",webp:"image/webp"},Yi=function Yi(e){void 0===e&&(e="");var t=Ei(e);return Wi[t.toLowerCase()]||"";};function qi(e){if(!e.type){var t=Yi(e.src);t&&(e.type=t);}return e;}var Ki=function(e){function t(t,i,n){var r,a=zt({createEl:!1},i);if(r=e.call(this,t,a,n)||this,i.playerOptions.sources&&0!==i.playerOptions.sources.length)t.src(i.playerOptions.sources);else for(var s=0,o=i.playerOptions.techOrder;s0;!this.player_.tech(!0)||(ge||fe)&&t||this.player_.tech(!0).focus(),this.player_.paused()?ii(this.player_.play()):this.player_.pause();}},t;}(Xi);Kt.registerComponent("PosterImage",Qi);var $i={monospace:"monospace",sansSerif:"sans-serif",serif:"serif",monospaceSansSerif:'"Andale Mono", "Lucida Console", monospace',monospaceSerif:'"Courier New", monospace',proportionalSansSerif:"sans-serif",proportionalSerif:"serif",casual:'"Comic Sans MS", Impact, fantasy',script:'"Monotype Corsiva", cursive',smallcaps:'"Andale Mono", "Lucida Console", monospace, sans-serif'};function Ji(e,t){var i;if(4===e.length)i=e[1]+e[1]+e[2]+e[2]+e[3]+e[3];else{if(7!==e.length)throw new Error("Invalid color code provided, "+e+"; must be formatted as e.g. #f0e or #f604e2.");i=e.slice(1);}return"rgba("+parseInt(i.slice(0,2),16)+","+parseInt(i.slice(2,4),16)+","+parseInt(i.slice(4,6),16)+","+t+")";}function Zi(e,t,i){try{e.style[t]=i;}catch(e){return;}}var en=function(e){function t(t,i,n){var r;r=e.call(this,t,i,n)||this;var a=function a(e){return r.updateDisplay(e);};return t.on("loadstart",function(e){return r.toggleDisplay(e);}),t.on("texttrackchange",a),t.on("loadedmetadata",function(e){return r.preselectTrack(e);}),t.ready(At(I["default"](r),function(){if(t.tech_&&t.tech_.featuresNativeTextTracks)this.hide();else{t.on("fullscreenchange",a),t.on("playerresize",a),A["default"].addEventListener("orientationchange",a),t.on("dispose",function(){return A["default"].removeEventListener("orientationchange",a);});for(var e=this.options_.playerOptions.tracks||[],i=0;i0;return ii(t),void(!this.player_.tech(!0)||(ge||fe)&&i||this.player_.tech(!0).focus());}var n=this.player_.getChild("controlBar"),r=n&&n.getChild("playToggle");if(r){var a=function a(){return r.focus();};ti(t)?t.then(a,function(){}):this.setTimeout(a,1);}else this.player_.tech(!0).focus();},i.handleKeyDown=function(t){this.mouseused_=!1,e.prototype.handleKeyDown.call(this,t);},i.handleMouseDown=function(e){this.mouseused_=!0;},t;}(nn);rn.prototype.controlText_="Play Video",Kt.registerComponent("BigPlayButton",rn);var an=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).controlText(i&&i.controlText||n.localize("Close")),n;}P["default"](t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-close-button "+e.prototype.buildCSSClass.call(this);},i.handleClick=function(e){this.trigger({type:"close",bubbles:!1});},i.handleKeyDown=function(t){D["default"].isEventKey(t,"Esc")?(t.preventDefault(),t.stopPropagation(),this.trigger("click")):e.prototype.handleKeyDown.call(this,t);},t;}(nn);Kt.registerComponent("CloseButton",an);var sn=function(e){function t(t,i){var n;return void 0===i&&(i={}),n=e.call(this,t,i)||this,i.replay=void 0===i.replay||i.replay,n.on(t,"play",function(e){return n.handlePlay(e);}),n.on(t,"pause",function(e){return n.handlePause(e);}),i.replay&&n.on(t,"ended",function(e){return n.handleEnded(e);}),n;}P["default"](t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-play-control "+e.prototype.buildCSSClass.call(this);},i.handleClick=function(e){this.player_.paused()?ii(this.player_.play()):this.player_.pause();},i.handleSeeked=function(e){this.removeClass("vjs-ended"),this.player_.paused()?this.handlePause(e):this.handlePlay(e);},i.handlePlay=function(e){this.removeClass("vjs-ended"),this.removeClass("vjs-paused"),this.addClass("vjs-playing"),this.controlText("Pause");},i.handlePause=function(e){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.controlText("Play");},i.handleEnded=function(e){var t=this;this.removeClass("vjs-playing"),this.addClass("vjs-ended"),this.controlText("Replay"),this.one(this.player_,"seeked",function(e){return t.handleSeeked(e);});},t;}(nn);sn.prototype.controlText_="Play",Kt.registerComponent("PlayToggle",sn);var on=function on(e,t){e=e<0?0:e;var i=Math.floor(e%60),n=Math.floor(e/60%60),r=Math.floor(e/3600),a=Math.floor(t/60%60),s=Math.floor(t/3600);return(isNaN(e)||e===1/0)&&(r=n=i="-"),(r=r>0||s>0?r+":":"")+(n=((r||a>=10)&&n<10?"0"+n:n)+":")+(i=i<10?"0"+i:i);},un=on;function ln(e,t){return void 0===t&&(t=e),un(e,t);}var dn=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).on(t,["timeupdate","ended"],function(e){return n.updateContent(e);}),n.updateTextNode_(),n;}P["default"](t,e);var i=t.prototype;return i.createEl=function(){var t=this.buildCSSClass(),i=e.prototype.createEl.call(this,"div",{className:t+" vjs-time-control vjs-control"}),n=Le("span",{className:"vjs-control-text",textContent:this.localize(this.labelText_)+" "},{role:"presentation"});return i.appendChild(n),this.contentEl_=Le("span",{className:t+"-display"},{"aria-live":"off",role:"presentation"}),i.appendChild(this.contentEl_),i;},i.dispose=function(){this.contentEl_=null,this.textNode_=null,e.prototype.dispose.call(this);},i.updateTextNode_=function(e){var t=this;void 0===e&&(e=0),e=ln(e),this.formattedTime_!==e&&(this.formattedTime_=e,this.requestNamedAnimationFrame("TimeDisplay#updateTextNode_",function(){if(t.contentEl_){var e=t.textNode_;e&&t.contentEl_.firstChild!==e&&(e=null,K.warn("TimeDisplay#updateTextnode_: Prevented replacement of text node element since it was no longer a child of this node. Appending a new node instead.")),t.textNode_=k["default"].createTextNode(t.formattedTime_),t.textNode_&&(e?t.contentEl_.replaceChild(t.textNode_,e):t.contentEl_.appendChild(t.textNode_));}}));},i.updateContent=function(e){},t;}(Kt);dn.prototype.labelText_="Time",dn.prototype.controlText_="Time",Kt.registerComponent("TimeDisplay",dn);var hn=function(e){function t(){return e.apply(this,arguments)||this;}P["default"](t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-current-time";},i.updateContent=function(e){var t;t=this.player_.ended()?this.player_.duration():this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime(),this.updateTextNode_(t);},t;}(dn);hn.prototype.labelText_="Current Time",hn.prototype.controlText_="Current Time",Kt.registerComponent("CurrentTimeDisplay",hn);var cn=function(e){function t(t,i){var n,r=function r(e){return n.updateContent(e);};return(n=e.call(this,t,i)||this).on(t,"durationchange",r),n.on(t,"loadstart",r),n.on(t,"loadedmetadata",r),n;}P["default"](t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-duration";},i.updateContent=function(e){var t=this.player_.duration();this.updateTextNode_(t);},t;}(dn);cn.prototype.labelText_="Duration",cn.prototype.controlText_="Duration",Kt.registerComponent("DurationDisplay",cn);var fn=function(e){function t(){return e.apply(this,arguments)||this;}return P["default"](t,e),t.prototype.createEl=function(){var t=e.prototype.createEl.call(this,"div",{className:"vjs-time-control vjs-time-divider"},{"aria-hidden":!0}),i=e.prototype.createEl.call(this,"div"),n=e.prototype.createEl.call(this,"span",{textContent:"/"});return i.appendChild(n),t.appendChild(i),t;},t;}(Kt);Kt.registerComponent("TimeDivider",fn);var pn=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).on(t,"durationchange",function(e){return n.updateContent(e);}),n;}P["default"](t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-remaining-time";},i.createEl=function(){var t=e.prototype.createEl.call(this);return t.insertBefore(Le("span",{},{"aria-hidden":!0},"-"),this.contentEl_),t;},i.updateContent=function(e){var t;"number"==typeof this.player_.duration()&&(t=this.player_.ended()?0:this.player_.remainingTimeDisplay?this.player_.remainingTimeDisplay():this.player_.remainingTime(),this.updateTextNode_(t));},t;}(dn);pn.prototype.labelText_="Remaining Time",pn.prototype.controlText_="Remaining Time",Kt.registerComponent("RemainingTimeDisplay",pn);var mn=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).updateShowing(),n.on(n.player(),"durationchange",function(e){return n.updateShowing(e);}),n;}P["default"](t,e);var i=t.prototype;return i.createEl=function(){var t=e.prototype.createEl.call(this,"div",{className:"vjs-live-control vjs-control"});return this.contentEl_=Le("div",{className:"vjs-live-display"},{"aria-live":"off"}),this.contentEl_.appendChild(Le("span",{className:"vjs-control-text",textContent:this.localize("Stream Type")+" "})),this.contentEl_.appendChild(k["default"].createTextNode(this.localize("LIVE"))),t.appendChild(this.contentEl_),t;},i.dispose=function(){this.contentEl_=null,e.prototype.dispose.call(this);},i.updateShowing=function(e){this.player().duration()===1/0?this.show():this.hide();},t;}(Kt);Kt.registerComponent("LiveDisplay",mn);var gn=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).updateLiveEdgeStatus(),n.player_.liveTracker&&(n.updateLiveEdgeStatusHandler_=function(e){return n.updateLiveEdgeStatus(e);},n.on(n.player_.liveTracker,"liveedgechange",n.updateLiveEdgeStatusHandler_)),n;}P["default"](t,e);var i=t.prototype;return i.createEl=function(){var t=e.prototype.createEl.call(this,"button",{className:"vjs-seek-to-live-control vjs-control"});return this.textEl_=Le("span",{className:"vjs-seek-to-live-text",textContent:this.localize("LIVE")},{"aria-hidden":"true"}),t.appendChild(this.textEl_),t;},i.updateLiveEdgeStatus=function(){!this.player_.liveTracker||this.player_.liveTracker.atLiveEdge()?(this.setAttribute("aria-disabled",!0),this.addClass("vjs-at-live-edge"),this.controlText("Seek to live, currently playing live")):(this.setAttribute("aria-disabled",!1),this.removeClass("vjs-at-live-edge"),this.controlText("Seek to live, currently behind live"));},i.handleClick=function(){this.player_.liveTracker.seekToLiveEdge();},i.dispose=function(){this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_),this.textEl_=null,e.prototype.dispose.call(this);},t;}(nn);gn.prototype.controlText_="Seek to live, currently playing live",Kt.registerComponent("SeekToLive",gn);var _n=function _n(e,t,i){return e=Number(e),Math.min(i,Math.max(t,isNaN(e)?t:e));},yn=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).handleMouseDown_=function(e){return n.handleMouseDown(e);},n.handleMouseUp_=function(e){return n.handleMouseUp(e);},n.handleKeyDown_=function(e){return n.handleKeyDown(e);},n.handleClick_=function(e){return n.handleClick(e);},n.handleMouseMove_=function(e){return n.handleMouseMove(e);},n.update_=function(e){return n.update(e);},n.bar=n.getChild(n.options_.barName),n.vertical(!!n.options_.vertical),n.enable(),n;}P["default"](t,e);var i=t.prototype;return i.enabled=function(){return this.enabled_;},i.enable=function(){this.enabled()||(this.on("mousedown",this.handleMouseDown_),this.on("touchstart",this.handleMouseDown_),this.on("keydown",this.handleKeyDown_),this.on("click",this.handleClick_),this.on(this.player_,"controlsvisible",this.update),this.playerEvent&&this.on(this.player_,this.playerEvent,this.update),this.removeClass("disabled"),this.setAttribute("tabindex",0),this.enabled_=!0);},i.disable=function(){if(this.enabled()){var e=this.bar.el_.ownerDocument;this.off("mousedown",this.handleMouseDown_),this.off("touchstart",this.handleMouseDown_),this.off("keydown",this.handleKeyDown_),this.off("click",this.handleClick_),this.off(this.player_,"controlsvisible",this.update_),this.off(e,"mousemove",this.handleMouseMove_),this.off(e,"mouseup",this.handleMouseUp_),this.off(e,"touchmove",this.handleMouseMove_),this.off(e,"touchend",this.handleMouseUp_),this.removeAttribute("tabindex"),this.addClass("disabled"),this.playerEvent&&this.off(this.player_,this.playerEvent,this.update),this.enabled_=!1;}},i.createEl=function(t,i,n){return void 0===i&&(i={}),void 0===n&&(n={}),i.className=i.className+" vjs-slider",i=Z({tabIndex:0},i),n=Z({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100,tabIndex:0},n),e.prototype.createEl.call(this,t,i,n);},i.handleMouseDown=function(e){var t=this.bar.el_.ownerDocument;"mousedown"===e.type&&e.preventDefault(),"touchstart"!==e.type||pe||e.preventDefault(),ze(),this.addClass("vjs-sliding"),this.trigger("slideractive"),this.on(t,"mousemove",this.handleMouseMove_),this.on(t,"mouseup",this.handleMouseUp_),this.on(t,"touchmove",this.handleMouseMove_),this.on(t,"touchend",this.handleMouseUp_),this.handleMouseMove(e);},i.handleMouseMove=function(e){},i.handleMouseUp=function(){var e=this.bar.el_.ownerDocument;Ge(),this.removeClass("vjs-sliding"),this.trigger("sliderinactive"),this.off(e,"mousemove",this.handleMouseMove_),this.off(e,"mouseup",this.handleMouseUp_),this.off(e,"touchmove",this.handleMouseMove_),this.off(e,"touchend",this.handleMouseUp_),this.update();},i.update=function(){var e=this;if(this.el_&&this.bar){var t=this.getProgress();return t===this.progress_||(this.progress_=t,this.requestNamedAnimationFrame("Slider#update",function(){var i=e.vertical()?"height":"width";e.bar.el().style[i]=(100*t).toFixed(2)+"%";})),t;}},i.getProgress=function(){return Number(_n(this.getPercent(),0,1).toFixed(4));},i.calculateDistance=function(e){var t=qe(this.el_,e);return this.vertical()?t.y:t.x;},i.handleKeyDown=function(t){D["default"].isEventKey(t,"Left")||D["default"].isEventKey(t,"Down")?(t.preventDefault(),t.stopPropagation(),this.stepBack()):D["default"].isEventKey(t,"Right")||D["default"].isEventKey(t,"Up")?(t.preventDefault(),t.stopPropagation(),this.stepForward()):e.prototype.handleKeyDown.call(this,t);},i.handleClick=function(e){e.stopPropagation(),e.preventDefault();},i.vertical=function(e){if(void 0===e)return this.vertical_||!1;this.vertical_=!!e,this.vertical_?this.addClass("vjs-slider-vertical"):this.addClass("vjs-slider-horizontal");},t;}(Kt);Kt.registerComponent("Slider",yn);var vn=function vn(e,t){return _n(e/t*100,0,100).toFixed(2)+"%";},bn=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).partEls_=[],n.on(t,"progress",function(e){return n.update(e);}),n;}P["default"](t,e);var i=t.prototype;return i.createEl=function(){var t=e.prototype.createEl.call(this,"div",{className:"vjs-load-progress"}),i=Le("span",{className:"vjs-control-text"}),n=Le("span",{textContent:this.localize("Loaded")}),r=k["default"].createTextNode(": ");return this.percentageEl_=Le("span",{className:"vjs-control-text-loaded-percentage",textContent:"0%"}),t.appendChild(i),i.appendChild(n),i.appendChild(r),i.appendChild(this.percentageEl_),t;},i.dispose=function(){this.partEls_=null,this.percentageEl_=null,e.prototype.dispose.call(this);},i.update=function(e){var t=this;this.requestNamedAnimationFrame("LoadProgressBar#update",function(){var e=t.player_.liveTracker,i=t.player_.buffered(),n=e&&e.isLive()?e.seekableEnd():t.player_.duration(),r=t.player_.bufferedEnd(),a=t.partEls_,s=vn(r,n);t.percent_!==s&&(t.el_.style.width=s,De(t.percentageEl_,s),t.percent_=s);for(var o=0;oi.length;h--){t.el_.removeChild(a[h-1]);}a.length=i.length;});},t;}(Kt);Kt.registerComponent("LoadProgressBar",bn);var Tn=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).update=kt(At(I["default"](n),n.update),30),n;}P["default"](t,e);var i=t.prototype;return i.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-time-tooltip"},{"aria-hidden":"true"});},i.update=function(e,t,i){var n=Ye(this.el_),r=We(this.player_.el()),a=e.width*t;if(r&&n){var s=e.left-r.left+a,o=e.width-a+(r.right-e.right),u=n.width/2;sn.width&&(u=n.width),u=Math.round(u),this.el_.style.right="-"+u+"px",this.write(i);}},i.write=function(e){De(this.el_,e);},i.updateTime=function(e,t,i,n){var r=this;this.requestNamedAnimationFrame("TimeTooltip#updateTime",function(){var a,s=r.player_.duration();if(r.player_.liveTracker&&r.player_.liveTracker.isLive()){var o=r.player_.liveTracker.liveWindow(),u=o-t*o;a=(u<1?"":"-")+ln(u,o);}else a=ln(i,s);r.update(e,t,a),n&&n();});},t;}(Kt);Kt.registerComponent("TimeTooltip",Tn);var Sn=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).update=kt(At(I["default"](n),n.update),30),n;}P["default"](t,e);var i=t.prototype;return i.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-play-progress vjs-slider-bar"},{"aria-hidden":"true"});},i.update=function(e,t){var i=this.getChild("timeTooltip");if(i){var n=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();i.updateTime(e,t,n);}},t;}(Kt);Sn.prototype.options_={children:[]},Se||le||Sn.prototype.options_.children.push("timeTooltip"),Kt.registerComponent("PlayProgressBar",Sn);var En=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).update=kt(At(I["default"](n),n.update),30),n;}P["default"](t,e);var i=t.prototype;return i.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-mouse-display"});},i.update=function(e,t){var i=this,n=t*this.player_.duration();this.getChild("timeTooltip").updateTime(e,t,n,function(){i.el_.style.left=e.width*t+"px";});},t;}(Kt);En.prototype.options_={children:["timeTooltip"]},Kt.registerComponent("MouseTimeDisplay",En);var wn=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).setEventHandlers_(),n;}P["default"](t,e);var i=t.prototype;return i.setEventHandlers_=function(){var e=this;this.update_=At(this,this.update),this.update=kt(this.update_,30),this.on(this.player_,["ended","durationchange","timeupdate"],this.update),this.player_.liveTracker&&this.on(this.player_.liveTracker,"liveedgechange",this.update),this.updateInterval=null,this.enableIntervalHandler_=function(t){return e.enableInterval_(t);},this.disableIntervalHandler_=function(t){return e.disableInterval_(t);},this.on(this.player_,["playing"],this.enableIntervalHandler_),this.on(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in k["default"]&&"visibilityState"in k["default"]&&this.on(k["default"],"visibilitychange",this.toggleVisibility_);},i.toggleVisibility_=function(e){"hidden"===k["default"].visibilityState?(this.cancelNamedAnimationFrame("SeekBar#update"),this.cancelNamedAnimationFrame("Slider#update"),this.disableInterval_(e)):(this.player_.ended()||this.player_.paused()||this.enableInterval_(),this.update());},i.enableInterval_=function(){this.updateInterval||(this.updateInterval=this.setInterval(this.update,30));},i.disableInterval_=function(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&e&&"ended"!==e.type||this.updateInterval&&(this.clearInterval(this.updateInterval),this.updateInterval=null);},i.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-progress-holder"},{"aria-label":this.localize("Progress Bar")});},i.update=function(t){var i=this;if("hidden"!==k["default"].visibilityState){var n=e.prototype.update.call(this);return this.requestNamedAnimationFrame("SeekBar#update",function(){var e=i.player_.ended()?i.player_.duration():i.getCurrentTime_(),t=i.player_.liveTracker,r=i.player_.duration();t&&t.isLive()&&(r=i.player_.liveTracker.liveCurrentTime()),i.percent_!==n&&(i.el_.setAttribute("aria-valuenow",(100*n).toFixed(2)),i.percent_=n),i.currentTime_===e&&i.duration_===r||(i.el_.setAttribute("aria-valuetext",i.localize("progress bar timing: currentTime={1} duration={2}",[ln(e,r),ln(r,r)],"{1} of {2}")),i.currentTime_=e,i.duration_=r),i.bar&&i.bar.update(We(i.el()),i.getProgress());}),n;}},i.userSeek_=function(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&this.player_.liveTracker.nextSeekedFromUser(),this.player_.currentTime(e);},i.getCurrentTime_=function(){return this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();},i.getPercent=function(){var e,t=this.getCurrentTime_(),i=this.player_.liveTracker;return i&&i.isLive()?(e=(t-i.seekableStart())/i.liveWindow(),i.atLiveEdge()&&(e=1)):e=t/this.player_.duration(),e;},i.handleMouseDown=function(t){Ze(t)&&(t.stopPropagation(),this.player_.scrubbing(!0),this.videoWasPlaying=!this.player_.paused(),this.player_.pause(),e.prototype.handleMouseDown.call(this,t));},i.handleMouseMove=function(e){if(Ze(e)){var t,i=this.calculateDistance(e),n=this.player_.liveTracker;if(n&&n.isLive()){if(i>=.99)return void n.seekToLiveEdge();var r=n.seekableStart(),a=n.liveCurrentTime();if((t=r+i*n.liveWindow())>=a&&(t=a),t<=r&&(t=r+.1),t===1/0)return;}else(t=i*this.player_.duration())===this.player_.duration()&&(t-=.1);this.userSeek_(t);}},i.enable=function(){e.prototype.enable.call(this);var t=this.getChild("mouseTimeDisplay");t&&t.show();},i.disable=function(){e.prototype.disable.call(this);var t=this.getChild("mouseTimeDisplay");t&&t.hide();},i.handleMouseUp=function(t){e.prototype.handleMouseUp.call(this,t),t&&t.stopPropagation(),this.player_.scrubbing(!1),this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:!0}),this.videoWasPlaying?ii(this.player_.play()):this.update_();},i.stepForward=function(){this.userSeek_(this.player_.currentTime()+5);},i.stepBack=function(){this.userSeek_(this.player_.currentTime()-5);},i.handleAction=function(e){this.player_.paused()?this.player_.play():this.player_.pause();},i.handleKeyDown=function(t){var i=this.player_.liveTracker;if(D["default"].isEventKey(t,"Space")||D["default"].isEventKey(t,"Enter"))t.preventDefault(),t.stopPropagation(),this.handleAction(t);else if(D["default"].isEventKey(t,"Home"))t.preventDefault(),t.stopPropagation(),this.userSeek_(0);else if(D["default"].isEventKey(t,"End"))t.preventDefault(),t.stopPropagation(),i&&i.isLive()?this.userSeek_(i.liveCurrentTime()):this.userSeek_(this.player_.duration());else if(/^[0-9]$/.test(D["default"](t))){t.preventDefault(),t.stopPropagation();var n=10*(D["default"].codes[D["default"](t)]-D["default"].codes[0])/100;i&&i.isLive()?this.userSeek_(i.seekableStart()+i.liveWindow()*n):this.userSeek_(this.player_.duration()*n);}else D["default"].isEventKey(t,"PgDn")?(t.preventDefault(),t.stopPropagation(),this.userSeek_(this.player_.currentTime()-60)):D["default"].isEventKey(t,"PgUp")?(t.preventDefault(),t.stopPropagation(),this.userSeek_(this.player_.currentTime()+60)):e.prototype.handleKeyDown.call(this,t);},i.dispose=function(){this.disableInterval_(),this.off(this.player_,["ended","durationchange","timeupdate"],this.update),this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.update),this.off(this.player_,["playing"],this.enableIntervalHandler_),this.off(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in k["default"]&&"visibilityState"in k["default"]&&this.off(k["default"],"visibilitychange",this.toggleVisibility_),e.prototype.dispose.call(this);},t;}(yn);wn.prototype.options_={children:["loadProgressBar","playProgressBar"],barName:"playProgressBar"},Se||le||wn.prototype.options_.children.splice(1,0,"mouseTimeDisplay"),Kt.registerComponent("SeekBar",wn);var Cn=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).handleMouseMove=kt(At(I["default"](n),n.handleMouseMove),30),n.throttledHandleMouseSeek=kt(At(I["default"](n),n.handleMouseSeek),30),n.handleMouseUpHandler_=function(e){return n.handleMouseUp(e);},n.handleMouseDownHandler_=function(e){return n.handleMouseDown(e);},n.enable(),n;}P["default"](t,e);var i=t.prototype;return i.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-progress-control vjs-control"});},i.handleMouseMove=function(e){var t=this.getChild("seekBar");if(t){var i=t.getChild("playProgressBar"),n=t.getChild("mouseTimeDisplay");if(i||n){var r=t.el(),a=Ye(r),s=qe(r,e).x;s=_n(s,0,1),n&&n.update(a,s),i&&i.update(a,t.getProgress());}}},i.handleMouseSeek=function(e){var t=this.getChild("seekBar");t&&t.handleMouseMove(e);},i.enabled=function(){return this.enabled_;},i.disable=function(){if(this.children().forEach(function(e){return e.disable&&e.disable();}),this.enabled()&&(this.off(["mousedown","touchstart"],this.handleMouseDownHandler_),this.off(this.el_,"mousemove",this.handleMouseMove),this.removeListenersAddedOnMousedownAndTouchstart(),this.addClass("disabled"),this.enabled_=!1,this.player_.scrubbing())){var e=this.getChild("seekBar");this.player_.scrubbing(!1),e.videoWasPlaying&&ii(this.player_.play());}},i.enable=function(){this.children().forEach(function(e){return e.enable&&e.enable();}),this.enabled()||(this.on(["mousedown","touchstart"],this.handleMouseDownHandler_),this.on(this.el_,"mousemove",this.handleMouseMove),this.removeClass("disabled"),this.enabled_=!0);},i.removeListenersAddedOnMousedownAndTouchstart=function(){var e=this.el_.ownerDocument;this.off(e,"mousemove",this.throttledHandleMouseSeek),this.off(e,"touchmove",this.throttledHandleMouseSeek),this.off(e,"mouseup",this.handleMouseUpHandler_),this.off(e,"touchend",this.handleMouseUpHandler_);},i.handleMouseDown=function(e){var t=this.el_.ownerDocument,i=this.getChild("seekBar");i&&i.handleMouseDown(e),this.on(t,"mousemove",this.throttledHandleMouseSeek),this.on(t,"touchmove",this.throttledHandleMouseSeek),this.on(t,"mouseup",this.handleMouseUpHandler_),this.on(t,"touchend",this.handleMouseUpHandler_);},i.handleMouseUp=function(e){var t=this.getChild("seekBar");t&&t.handleMouseUp(e),this.removeListenersAddedOnMousedownAndTouchstart();},t;}(Kt);Cn.prototype.options_={children:["seekBar"]},Kt.registerComponent("ProgressControl",Cn);var An=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).on(t,["enterpictureinpicture","leavepictureinpicture"],function(e){return n.handlePictureInPictureChange(e);}),n.on(t,["disablepictureinpicturechanged","loadedmetadata"],function(e){return n.handlePictureInPictureEnabledChange(e);}),n.disable(),n;}P["default"](t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-picture-in-picture-control "+e.prototype.buildCSSClass.call(this);},i.handlePictureInPictureEnabledChange=function(){k["default"].pictureInPictureEnabled&&!1===this.player_.disablePictureInPicture()?this.enable():this.disable();},i.handlePictureInPictureChange=function(e){this.player_.isInPictureInPicture()?this.controlText("Exit Picture-in-Picture"):this.controlText("Picture-in-Picture"),this.handlePictureInPictureEnabledChange();},i.handleClick=function(e){this.player_.isInPictureInPicture()?this.player_.exitPictureInPicture():this.player_.requestPictureInPicture();},t;}(nn);An.prototype.controlText_="Picture-in-Picture",Kt.registerComponent("PictureInPictureToggle",An);var kn=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).on(t,"fullscreenchange",function(e){return n.handleFullscreenChange(e);}),!1===k["default"][t.fsApi_.fullscreenEnabled]&&n.disable(),n;}P["default"](t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-fullscreen-control "+e.prototype.buildCSSClass.call(this);},i.handleFullscreenChange=function(e){this.player_.isFullscreen()?this.controlText("Non-Fullscreen"):this.controlText("Fullscreen");},i.handleClick=function(e){this.player_.isFullscreen()?this.player_.exitFullscreen():this.player_.requestFullscreen();},t;}(nn);kn.prototype.controlText_="Fullscreen",Kt.registerComponent("FullscreenToggle",kn);var xn=function(e){function t(){return e.apply(this,arguments)||this;}return P["default"](t,e),t.prototype.createEl=function(){var t=e.prototype.createEl.call(this,"div",{className:"vjs-volume-level"});return t.appendChild(e.prototype.createEl.call(this,"span",{className:"vjs-control-text"})),t;},t;}(Kt);Kt.registerComponent("VolumeLevel",xn);var In=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).update=kt(At(I["default"](n),n.update),30),n;}P["default"](t,e);var i=t.prototype;return i.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-volume-tooltip"},{"aria-hidden":"true"});},i.update=function(e,t,i,n){if(!i){var r=We(this.el_),a=We(this.player_.el()),s=e.width*t;if(!a||!r)return;var o=e.left-a.left+s,u=e.width-s+(a.right-e.right),l=r.width/2;or.width&&(l=r.width),this.el_.style.right="-"+l+"px";}this.write(n+"%");},i.write=function(e){De(this.el_,e);},i.updateVolume=function(e,t,i,n,r){var a=this;this.requestNamedAnimationFrame("VolumeLevelTooltip#updateVolume",function(){a.update(e,t,i,n.toFixed(0)),r&&r();});},t;}(Kt);Kt.registerComponent("VolumeLevelTooltip",In);var Pn=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).update=kt(At(I["default"](n),n.update),30),n;}P["default"](t,e);var i=t.prototype;return i.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-mouse-display"});},i.update=function(e,t,i){var n=this,r=100*t;this.getChild("volumeLevelTooltip").updateVolume(e,t,i,r,function(){i?n.el_.style.bottom=e.height*t+"px":n.el_.style.left=e.width*t+"px";});},t;}(Kt);Pn.prototype.options_={children:["volumeLevelTooltip"]},Kt.registerComponent("MouseVolumeLevelDisplay",Pn);var Ln=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).on("slideractive",function(e){return n.updateLastVolume_(e);}),n.on(t,"volumechange",function(e){return n.updateARIAAttributes(e);}),t.ready(function(){return n.updateARIAAttributes();}),n;}P["default"](t,e);var i=t.prototype;return i.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-volume-bar vjs-slider-bar"},{"aria-label":this.localize("Volume Level"),"aria-live":"polite"});},i.handleMouseDown=function(t){Ze(t)&&e.prototype.handleMouseDown.call(this,t);},i.handleMouseMove=function(e){var t=this.getChild("mouseVolumeLevelDisplay");if(t){var i=this.el(),n=We(i),r=this.vertical(),a=qe(i,e);a=r?a.y:a.x,a=_n(a,0,1),t.update(n,a,r);}Ze(e)&&(this.checkMuted(),this.player_.volume(this.calculateDistance(e)));},i.checkMuted=function(){this.player_.muted()&&this.player_.muted(!1);},i.getPercent=function(){return this.player_.muted()?0:this.player_.volume();},i.stepForward=function(){this.checkMuted(),this.player_.volume(this.player_.volume()+.1);},i.stepBack=function(){this.checkMuted(),this.player_.volume(this.player_.volume()-.1);},i.updateARIAAttributes=function(e){var t=this.player_.muted()?0:this.volumeAsPercentage_();this.el_.setAttribute("aria-valuenow",t),this.el_.setAttribute("aria-valuetext",t+"%");},i.volumeAsPercentage_=function(){return Math.round(100*this.player_.volume());},i.updateLastVolume_=function(){var e=this,t=this.player_.volume();this.one("sliderinactive",function(){0===e.player_.volume()&&e.player_.lastVolume_(t);});},t;}(yn);Ln.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"},Se||le||Ln.prototype.options_.children.splice(0,0,"mouseVolumeLevelDisplay"),Ln.prototype.playerEvent="volumechange",Kt.registerComponent("VolumeBar",Ln);var Dn=function(e){function t(t,i){var n;return void 0===i&&(i={}),i.vertical=i.vertical||!1,(void 0===i.volumeBar||te(i.volumeBar))&&(i.volumeBar=i.volumeBar||{},i.volumeBar.vertical=i.vertical),n=e.call(this,t,i)||this,function(e,t){t.tech_&&!t.tech_.featuresVolumeControl&&e.addClass("vjs-hidden"),e.on(t,"loadstart",function(){t.tech_.featuresVolumeControl?e.removeClass("vjs-hidden"):e.addClass("vjs-hidden");});}(I["default"](n),t),n.throttledHandleMouseMove=kt(At(I["default"](n),n.handleMouseMove),30),n.handleMouseUpHandler_=function(e){return n.handleMouseUp(e);},n.on("mousedown",function(e){return n.handleMouseDown(e);}),n.on("touchstart",function(e){return n.handleMouseDown(e);}),n.on("mousemove",function(e){return n.handleMouseMove(e);}),n.on(n.volumeBar,["focus","slideractive"],function(){n.volumeBar.addClass("vjs-slider-active"),n.addClass("vjs-slider-active"),n.trigger("slideractive");}),n.on(n.volumeBar,["blur","sliderinactive"],function(){n.volumeBar.removeClass("vjs-slider-active"),n.removeClass("vjs-slider-active"),n.trigger("sliderinactive");}),n;}P["default"](t,e);var i=t.prototype;return i.createEl=function(){var t="vjs-volume-horizontal";return this.options_.vertical&&(t="vjs-volume-vertical"),e.prototype.createEl.call(this,"div",{className:"vjs-volume-control vjs-control "+t});},i.handleMouseDown=function(e){var t=this.el_.ownerDocument;this.on(t,"mousemove",this.throttledHandleMouseMove),this.on(t,"touchmove",this.throttledHandleMouseMove),this.on(t,"mouseup",this.handleMouseUpHandler_),this.on(t,"touchend",this.handleMouseUpHandler_);},i.handleMouseUp=function(e){var t=this.el_.ownerDocument;this.off(t,"mousemove",this.throttledHandleMouseMove),this.off(t,"touchmove",this.throttledHandleMouseMove),this.off(t,"mouseup",this.handleMouseUpHandler_),this.off(t,"touchend",this.handleMouseUpHandler_);},i.handleMouseMove=function(e){this.volumeBar.handleMouseMove(e);},t;}(Kt);Dn.prototype.options_={children:["volumeBar"]},Kt.registerComponent("VolumeControl",Dn);var Un=function(e){function t(t,i){var n;return n=e.call(this,t,i)||this,function(e,t){t.tech_&&!t.tech_.featuresMuteControl&&e.addClass("vjs-hidden"),e.on(t,"loadstart",function(){t.tech_.featuresMuteControl?e.removeClass("vjs-hidden"):e.addClass("vjs-hidden");});}(I["default"](n),t),n.on(t,["loadstart","volumechange"],function(e){return n.update(e);}),n;}P["default"](t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-mute-control "+e.prototype.buildCSSClass.call(this);},i.handleClick=function(e){var t=this.player_.volume(),i=this.player_.lastVolume_();if(0===t){var n=i<.1?.1:i;this.player_.volume(n),this.player_.muted(!1);}else this.player_.muted(!this.player_.muted());},i.update=function(e){this.updateIcon_(),this.updateControlText_();},i.updateIcon_=function(){var e=this.player_.volume(),t=3;Se&&this.player_.tech_&&this.player_.tech_.el_&&this.player_.muted(this.player_.tech_.el_.muted),0===e||this.player_.muted()?t=0:e<.33?t=1:e<.67&&(t=2);for(var i=0;i<4;i++){Me(this.el_,"vjs-vol-"+i);}Oe(this.el_,"vjs-vol-"+t);},i.updateControlText_=function(){var e=this.player_.muted()||0===this.player_.volume()?"Unmute":"Mute";this.controlText()!==e&&this.controlText(e);},t;}(nn);Un.prototype.controlText_="Mute",Kt.registerComponent("MuteToggle",Un);var Rn=function(e){function t(t,i){var n;return void 0===i&&(i={}),void 0!==i.inline?i.inline=i.inline:i.inline=!0,(void 0===i.volumeControl||te(i.volumeControl))&&(i.volumeControl=i.volumeControl||{},i.volumeControl.vertical=!i.inline),(n=e.call(this,t,i)||this).handleKeyPressHandler_=function(e){return n.handleKeyPress(e);},n.on(t,["loadstart"],function(e){return n.volumePanelState_(e);}),n.on(n.muteToggle,"keyup",function(e){return n.handleKeyPress(e);}),n.on(n.volumeControl,"keyup",function(e){return n.handleVolumeControlKeyUp(e);}),n.on("keydown",function(e){return n.handleKeyPress(e);}),n.on("mouseover",function(e){return n.handleMouseOver(e);}),n.on("mouseout",function(e){return n.handleMouseOut(e);}),n.on(n.volumeControl,["slideractive"],n.sliderActive_),n.on(n.volumeControl,["sliderinactive"],n.sliderInactive_),n;}P["default"](t,e);var i=t.prototype;return i.sliderActive_=function(){this.addClass("vjs-slider-active");},i.sliderInactive_=function(){this.removeClass("vjs-slider-active");},i.volumePanelState_=function(){this.volumeControl.hasClass("vjs-hidden")&&this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-hidden"),this.volumeControl.hasClass("vjs-hidden")&&!this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-mute-toggle-only");},i.createEl=function(){var t="vjs-volume-panel-horizontal";return this.options_.inline||(t="vjs-volume-panel-vertical"),e.prototype.createEl.call(this,"div",{className:"vjs-volume-panel vjs-control "+t});},i.dispose=function(){this.handleMouseOut(),e.prototype.dispose.call(this);},i.handleVolumeControlKeyUp=function(e){D["default"].isEventKey(e,"Esc")&&this.muteToggle.focus();},i.handleMouseOver=function(e){this.addClass("vjs-hover"),vt(k["default"],"keyup",this.handleKeyPressHandler_);},i.handleMouseOut=function(e){this.removeClass("vjs-hover"),bt(k["default"],"keyup",this.handleKeyPressHandler_);},i.handleKeyPress=function(e){D["default"].isEventKey(e,"Esc")&&this.handleMouseOut();},t;}(Kt);Rn.prototype.options_={children:["muteToggle","volumeControl"]},Kt.registerComponent("VolumePanel",Rn);var On=function(e){function t(t,i){var n;return n=e.call(this,t,i)||this,i&&(n.menuButton_=i.menuButton),n.focusedChild_=-1,n.on("keydown",function(e){return n.handleKeyDown(e);}),n.boundHandleBlur_=function(e){return n.handleBlur(e);},n.boundHandleTapClick_=function(e){return n.handleTapClick(e);},n;}P["default"](t,e);var i=t.prototype;return i.addEventListenerForItem=function(e){e instanceof Kt&&(this.on(e,"blur",this.boundHandleBlur_),this.on(e,["tap","click"],this.boundHandleTapClick_));},i.removeEventListenerForItem=function(e){e instanceof Kt&&(this.off(e,"blur",this.boundHandleBlur_),this.off(e,["tap","click"],this.boundHandleTapClick_));},i.removeChild=function(t){"string"==typeof t&&(t=this.getChild(t)),this.removeEventListenerForItem(t),e.prototype.removeChild.call(this,t);},i.addItem=function(e){var t=this.addChild(e);t&&this.addEventListenerForItem(t);},i.createEl=function(){var t=this.options_.contentElType||"ul";this.contentEl_=Le(t,{className:"vjs-menu-content"}),this.contentEl_.setAttribute("role","menu");var i=e.prototype.createEl.call(this,"div",{append:this.contentEl_,className:"vjs-menu"});return i.appendChild(this.contentEl_),vt(i,"click",function(e){e.preventDefault(),e.stopImmediatePropagation();}),i;},i.dispose=function(){this.contentEl_=null,this.boundHandleBlur_=null,this.boundHandleTapClick_=null,e.prototype.dispose.call(this);},i.handleBlur=function(e){var t=e.relatedTarget||k["default"].activeElement;if(!this.children().some(function(e){return e.el()===t;})){var i=this.menuButton_;i&&i.buttonPressed_&&t!==i.el().firstChild&&i.unpressButton();}},i.handleTapClick=function(e){if(this.menuButton_){this.menuButton_.unpressButton();var t=this.children();if(!Array.isArray(t))return;var i=t.filter(function(t){return t.el()===e.target;})[0];if(!i)return;"CaptionSettingsMenuItem"!==i.name()&&this.menuButton_.focus();}},i.handleKeyDown=function(e){D["default"].isEventKey(e,"Left")||D["default"].isEventKey(e,"Down")?(e.preventDefault(),e.stopPropagation(),this.stepForward()):(D["default"].isEventKey(e,"Right")||D["default"].isEventKey(e,"Up"))&&(e.preventDefault(),e.stopPropagation(),this.stepBack());},i.stepForward=function(){var e=0;void 0!==this.focusedChild_&&(e=this.focusedChild_+1),this.focus(e);},i.stepBack=function(){var e=0;void 0!==this.focusedChild_&&(e=this.focusedChild_-1),this.focus(e);},i.focus=function(e){void 0===e&&(e=0);var t=this.children().slice();t.length&&t[0].hasClass("vjs-menu-title")&&t.shift(),t.length>0&&(e<0?e=0:e>=t.length&&(e=t.length-1),this.focusedChild_=e,t[e].el_.focus());},t;}(Kt);Kt.registerComponent("Menu",On);var Mn=function(e){function t(t,i){var n;void 0===i&&(i={}),(n=e.call(this,t,i)||this).menuButton_=new nn(t,i),n.menuButton_.controlText(n.controlText_),n.menuButton_.el_.setAttribute("aria-haspopup","true");var r=nn.prototype.buildCSSClass();n.menuButton_.el_.className=n.buildCSSClass()+" "+r,n.menuButton_.removeClass("vjs-control"),n.addChild(n.menuButton_),n.update(),n.enabled_=!0;var a=function a(e){return n.handleClick(e);};return n.handleMenuKeyUp_=function(e){return n.handleMenuKeyUp(e);},n.on(n.menuButton_,"tap",a),n.on(n.menuButton_,"click",a),n.on(n.menuButton_,"keydown",function(e){return n.handleKeyDown(e);}),n.on(n.menuButton_,"mouseenter",function(){n.addClass("vjs-hover"),n.menu.show(),vt(k["default"],"keyup",n.handleMenuKeyUp_);}),n.on("mouseleave",function(e){return n.handleMouseLeave(e);}),n.on("keydown",function(e){return n.handleSubmenuKeyDown(e);}),n;}P["default"](t,e);var i=t.prototype;return i.update=function(){var e=this.createMenu();this.menu&&(this.menu.dispose(),this.removeChild(this.menu)),this.menu=e,this.addChild(e),this.buttonPressed_=!1,this.menuButton_.el_.setAttribute("aria-expanded","false"),this.items&&this.items.length<=this.hideThreshold_?this.hide():this.show();},i.createMenu=function(){var e=new On(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title){var t=Le("li",{className:"vjs-menu-title",textContent:Ht(this.options_.title),tabIndex:-1}),i=new Kt(this.player_,{el:t});e.addItem(i);}if(this.items=this.createItems(),this.items)for(var n=0;n-1&&"showing"===a.mode){i=!1;break;}}i!==this.isSelected_&&this.selected(i);},i.handleSelectedLanguageChange=function(e){for(var t=this.player().textTracks(),i=!0,n=0,r=t.length;n-1&&"showing"===a.mode){i=!1;break;}}i&&(this.player_.cache_.selectedLanguage={enabled:!1});},t;}(jn);Kt.registerComponent("OffTextTrackMenuItem",Vn);var Hn=function(e){function t(t,i){return void 0===i&&(i={}),i.tracks=t.textTracks(),e.call(this,t,i)||this;}return P["default"](t,e),t.prototype.createItems=function(e,t){var i;void 0===e&&(e=[]),void 0===t&&(t=jn),this.label_&&(i=this.label_+" off"),e.push(new Vn(this.player_,{kinds:this.kinds_,kind:this.kind_,label:i})),this.hideThreshold_+=1;var n=this.player_.textTracks();Array.isArray(this.kinds_)||(this.kinds_=[this.kind_]);for(var r=0;r-1){var s=new t(this.player_,{track:a,kinds:this.kinds_,kind:this.kind_,selectable:!0,multiSelectable:!1});s.addClass("vjs-"+a.kind+"-menu-item"),e.push(s);}}return e;},t;}(Fn);Kt.registerComponent("TextTrackButton",Hn);var zn=function(e){function t(t,i){var n,r=i.track,a=i.cue,s=t.currentTime();return i.selectable=!0,i.multiSelectable=!1,i.label=a.text,i.selected=a.startTime<=s&&s=0;t--){var i=e[t];if(i.kind===this.kind_)return i;}},i.getMenuCaption=function(){return this.track_&&this.track_.label?this.track_.label:this.localize(Ht(this.kind_));},i.createMenu=function(){return this.options_.title=this.getMenuCaption(),e.prototype.createMenu.call(this);},i.createItems=function(){var e=[];if(!this.track_)return e;var t=this.track_.cues;if(!t)return e;for(var i=0,n=t.length;i-1&&(n.label_="captions"),n.menuButton_.controlText(Ht(n.label_)),n;}P["default"](t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-subs-caps-button "+e.prototype.buildCSSClass.call(this);},i.buildWrapperCSSClass=function(){return"vjs-subs-caps-button "+e.prototype.buildWrapperCSSClass.call(this);},i.createItems=function(){var t=[];return this.player().tech_&&this.player().tech_.featuresNativeTextTracks||!this.player().getChild("textTrackSettings")||(t.push(new qn(this.player_,{kind:this.label_})),this.hideThreshold_+=1),t=e.prototype.createItems.call(this,t,Xn);},t;}(Hn);Qn.prototype.kinds_=["captions","subtitles"],Qn.prototype.controlText_="Subtitles",Kt.registerComponent("SubsCapsButton",Qn);var $n=function(e){function t(t,i){var n,r=i.track,a=t.audioTracks();i.label=r.label||r.language||"Unknown",i.selected=r.enabled,(n=e.call(this,t,i)||this).track=r,n.addClass("vjs-"+r.kind+"-menu-item");var s=function s(){for(var e=arguments.length,t=new Array(e),i=0;i=0;i--){t.push(new Zn(this.player(),{rate:e[i]+"x"}));}return t;},i.updateARIAAttributes=function(){this.el().setAttribute("aria-valuenow",this.player().playbackRate());},i.handleClick=function(e){for(var t=this.player().playbackRate(),i=this.playbackRates(),n=i[0],r=0;rt){n=i[r];break;}}this.player().playbackRate(n);},i.handlePlaybackRateschange=function(e){this.update();},i.playbackRates=function(){var e=this.player();return e.playbackRates&&e.playbackRates()||[];},i.playbackRateSupported=function(){return this.player().tech_&&this.player().tech_.featuresPlaybackRate&&this.playbackRates()&&this.playbackRates().length>0;},i.updateVisibility=function(e){this.playbackRateSupported()?this.removeClass("vjs-hidden"):this.addClass("vjs-hidden");},i.updateLabel=function(e){this.playbackRateSupported()&&(this.labelEl_.textContent=this.player().playbackRate()+"x");},t;}(Mn);er.prototype.controlText_="Playback Rate",Kt.registerComponent("PlaybackRateMenuButton",er);var tr=function(e){function t(){return e.apply(this,arguments)||this;}P["default"](t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-spacer "+e.prototype.buildCSSClass.call(this);},i.createEl=function(t,i,n){return void 0===t&&(t="div"),void 0===i&&(i={}),void 0===n&&(n={}),i.className||(i.className=this.buildCSSClass()),e.prototype.createEl.call(this,t,i,n);},t;}(Kt);Kt.registerComponent("Spacer",tr);var ir=function(e){function t(){return e.apply(this,arguments)||this;}P["default"](t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-custom-control-spacer "+e.prototype.buildCSSClass.call(this);},i.createEl=function(){return e.prototype.createEl.call(this,"div",{className:this.buildCSSClass(),textContent:" "});},t;}(tr);Kt.registerComponent("CustomControlSpacer",ir);var nr=function(e){function t(){return e.apply(this,arguments)||this;}return P["default"](t,e),t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-control-bar",dir:"ltr"});},t;}(Kt);nr.prototype.options_={children:["playToggle","volumePanel","currentTimeDisplay","timeDivider","durationDisplay","progressControl","liveDisplay","seekToLive","remainingTimeDisplay","customControlSpacer","playbackRateMenuButton","chaptersButton","descriptionsButton","subsCapsButton","audioTrackButton","fullscreenToggle"]},"exitPictureInPicture"in k["default"]&&nr.prototype.options_.children.splice(nr.prototype.options_.children.length-1,0,"pictureInPictureToggle"),Kt.registerComponent("ControlBar",nr);var rr=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).on(t,"error",function(e){return n.open(e);}),n;}P["default"](t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-error-display "+e.prototype.buildCSSClass.call(this);},i.content=function(){var e=this.player().error();return e?this.localize(e.message):"";},t;}(si);rr.prototype.options_=x["default"]({},si.prototype.options_,{pauseOnOpen:!1,fillAlways:!0,temporary:!1,uncloseable:!0}),Kt.registerComponent("ErrorDisplay",rr);var ar=["#000","Black"],sr=["#00F","Blue"],or=["#0FF","Cyan"],ur=["#0F0","Green"],lr=["#F0F","Magenta"],dr=["#F00","Red"],hr=["#FFF","White"],cr=["#FF0","Yellow"],fr=["1","Opaque"],pr=["0.5","Semi-Transparent"],mr=["0","Transparent"],gr={backgroundColor:{selector:".vjs-bg-color > select",id:"captions-background-color-%s",label:"Color",options:[ar,hr,dr,ur,sr,cr,lr,or]},backgroundOpacity:{selector:".vjs-bg-opacity > select",id:"captions-background-opacity-%s",label:"Transparency",options:[fr,pr,mr]},color:{selector:".vjs-fg-color > select",id:"captions-foreground-color-%s",label:"Color",options:[hr,ar,dr,ur,sr,cr,lr,or]},edgeStyle:{selector:".vjs-edge-style > select",id:"%s",label:"Text Edge Style",options:[["none","None"],["raised","Raised"],["depressed","Depressed"],["uniform","Uniform"],["dropshadow","Dropshadow"]]},fontFamily:{selector:".vjs-font-family > select",id:"captions-font-family-%s",label:"Font Family",options:[["proportionalSansSerif","Proportional Sans-Serif"],["monospaceSansSerif","Monospace Sans-Serif"],["proportionalSerif","Proportional Serif"],["monospaceSerif","Monospace Serif"],["casual","Casual"],["script","Script"],["small-caps","Small Caps"]]},fontPercent:{selector:".vjs-font-percent > select",id:"captions-font-size-%s",label:"Font Size",options:[["0.50","50%"],["0.75","75%"],["1.00","100%"],["1.25","125%"],["1.50","150%"],["1.75","175%"],["2.00","200%"],["3.00","300%"],["4.00","400%"]],"default":2,parser:function parser(e){return"1.00"===e?null:Number(e);}},textOpacity:{selector:".vjs-text-opacity > select",id:"captions-foreground-opacity-%s",label:"Transparency",options:[fr,pr]},windowColor:{selector:".vjs-window-color > select",id:"captions-window-color-%s",label:"Color"},windowOpacity:{selector:".vjs-window-opacity > select",id:"captions-window-opacity-%s",label:"Transparency",options:[mr,pr,fr]}};function _r(e,t){if(t&&(e=t(e)),e&&"none"!==e)return e;}gr.windowColor.options=gr.backgroundColor.options;var yr=function(e){function t(t,i){var n;return i.temporary=!1,(n=e.call(this,t,i)||this).updateDisplay=n.updateDisplay.bind(I["default"](n)),n.fill(),n.hasBeenOpened_=n.hasBeenFilled_=!0,n.endDialog=Le("p",{className:"vjs-control-text",textContent:n.localize("End of dialog window.")}),n.el().appendChild(n.endDialog),n.setDefaults(),void 0===i.persistTextTrackSettings&&(n.options_.persistTextTrackSettings=n.options_.playerOptions.persistTextTrackSettings),n.on(n.$(".vjs-done-button"),"click",function(){n.saveSettings(),n.close();}),n.on(n.$(".vjs-default-button"),"click",function(){n.setDefaults(),n.updateDisplay();}),J(gr,function(e){n.on(n.$(e.selector),"change",n.updateDisplay);}),n.options_.persistTextTrackSettings&&n.restoreSettings(),n;}P["default"](t,e);var i=t.prototype;return i.dispose=function(){this.endDialog=null,e.prototype.dispose.call(this);},i.createElSelect_=function(e,t,i){var n=this;void 0===t&&(t=""),void 0===i&&(i="label");var r=gr[e],a=r.id.replace("%s",this.id_),s=[t,a].join(" ").trim();return["<"+i+' id="'+a+'" class="'+("label"===i?"vjs-label":"")+'">',this.localize(r.label),"",'").join("");},i.createElFgColor_=function(){var e="captions-text-legend-"+this.id_;return['
','',this.localize("Text"),"",this.createElSelect_("color",e),'',this.createElSelect_("textOpacity",e),"","
"].join("");},i.createElBgColor_=function(){var e="captions-background-"+this.id_;return['
','',this.localize("Background"),"",this.createElSelect_("backgroundColor",e),'',this.createElSelect_("backgroundOpacity",e),"","
"].join("");},i.createElWinColor_=function(){var e="captions-window-"+this.id_;return['
','',this.localize("Window"),"",this.createElSelect_("windowColor",e),'',this.createElSelect_("windowOpacity",e),"","
"].join("");},i.createElColors_=function(){return Le("div",{className:"vjs-track-settings-colors",innerHTML:[this.createElFgColor_(),this.createElBgColor_(),this.createElWinColor_()].join("")});},i.createElFont_=function(){return Le("div",{className:"vjs-track-settings-font",innerHTML:['
',this.createElSelect_("fontPercent","","legend"),"
",'
',this.createElSelect_("edgeStyle","","legend"),"
",'
',this.createElSelect_("fontFamily","","legend"),"
"].join("")});},i.createElControls_=function(){var e=this.localize("restore all settings to the default values");return Le("div",{className:"vjs-track-settings-controls",innerHTML:['",'"].join("")});},i.content=function(){return[this.createElColors_(),this.createElFont_(),this.createElControls_()];},i.label=function(){return this.localize("Caption Settings Dialog");},i.description=function(){return this.localize("Beginning of dialog window. Escape will cancel and close the window.");},i.buildCSSClass=function(){return e.prototype.buildCSSClass.call(this)+" vjs-text-track-settings";},i.getValues=function(){var e,t,i,n=this;return t=function t(e,_t2,i){var r,a,s=(r=n.$(_t2.selector),a=_t2.parser,_r(r.options[r.options.selectedIndex].value,a));return void 0!==s&&(e[i]=s),e;},void 0===(i={})&&(i=0),$(e=gr).reduce(function(i,n){return t(i,e[n],n);},i);},i.setValues=function(e){var t=this;J(gr,function(i,n){!function(e,t,i){if(t)for(var n=0;nthis.options_.liveTolerance;this.timeupdateSeen_&&n!==1/0||(a=!1),a!==this.behindLiveEdge_&&(this.behindLiveEdge_=a,this.trigger("liveedgechange"));}},i.handleDurationchange=function(){this.toggleTracking();},i.toggleTracking=function(){this.player_.duration()===1/0&&this.liveWindow()>=this.options_.trackingThreshold?(this.player_.options_.liveui&&this.player_.addClass("vjs-liveui"),this.startTracking()):(this.player_.removeClass("vjs-liveui"),this.stopTracking());},i.startTracking=function(){this.isTracking()||(this.timeupdateSeen_||(this.timeupdateSeen_=this.player_.hasStarted()),this.trackingInterval_=this.setInterval(this.trackLiveHandler_,30),this.trackLive_(),this.on(this.player_,["play","pause"],this.trackLiveHandler_),this.timeupdateSeen_?this.on(this.player_,"seeked",this.handleSeeked_):(this.one(this.player_,"play",this.handlePlay_),this.one(this.player_,"timeupdate",this.handleFirstTimeupdate_)));},i.handleFirstTimeupdate=function(){this.timeupdateSeen_=!0,this.on(this.player_,"seeked",this.handleSeeked_);},i.handleSeeked=function(){var e=Math.abs(this.liveCurrentTime()-this.player_.currentTime());this.seekedBehindLive_=this.nextSeekedFromUser_&&e>2,this.nextSeekedFromUser_=!1,this.trackLive_();},i.handlePlay=function(){this.one(this.player_,"timeupdate",this.seekToLiveEdge_);},i.reset_=function(){this.lastTime_=-1,this.pastSeekEnd_=0,this.lastSeekEnd_=-1,this.behindLiveEdge_=!0,this.timeupdateSeen_=!1,this.seekedBehindLive_=!1,this.nextSeekedFromUser_=!1,this.clearInterval(this.trackingInterval_),this.trackingInterval_=null,this.off(this.player_,["play","pause"],this.trackLiveHandler_),this.off(this.player_,"seeked",this.handleSeeked_),this.off(this.player_,"play",this.handlePlay_),this.off(this.player_,"timeupdate",this.handleFirstTimeupdate_),this.off(this.player_,"timeupdate",this.seekToLiveEdge_);},i.nextSeekedFromUser=function(){this.nextSeekedFromUser_=!0;},i.stopTracking=function(){this.isTracking()&&(this.reset_(),this.trigger("liveedgechange"));},i.seekableEnd=function(){for(var e=this.player_.seekable(),t=[],i=e?e.length:0;i--;){t.push(e.end(i));}return t.length?t.sort()[t.length-1]:1/0;},i.seekableStart=function(){for(var e=this.player_.seekable(),t=[],i=e?e.length:0;i--;){t.push(e.start(i));}return t.length?t.sort()[0]:0;},i.liveWindow=function(){var e=this.liveCurrentTime();return e===1/0?0:e-this.seekableStart();},i.isLive=function(){return this.isTracking();},i.atLiveEdge=function(){return!this.behindLiveEdge();},i.liveCurrentTime=function(){return this.pastSeekEnd()+this.seekableEnd();},i.pastSeekEnd=function(){var e=this.seekableEnd();return-1!==this.lastSeekEnd_&&e!==this.lastSeekEnd_&&(this.pastSeekEnd_=0),this.lastSeekEnd_=e,this.pastSeekEnd_;},i.behindLiveEdge=function(){return this.behindLiveEdge_;},i.isTracking=function(){return"number"==typeof this.trackingInterval_;},i.seekToLiveEdge=function(){this.seekedBehindLive_=!1,this.atLiveEdge()||(this.nextSeekedFromUser_=!1,this.player_.currentTime(this.liveCurrentTime()));},i.dispose=function(){this.off(k["default"],"visibilitychange",this.handleVisibilityChange_),this.stopTracking(),e.prototype.dispose.call(this);},t;}(Kt);Kt.registerComponent("LiveTracker",Tr);var Sr,Er=function Er(e){var t=e.el();if(t.hasAttribute("src"))return e.triggerSourceset(t.src),!0;var i=e.$$("source"),n=[],r="";if(!i.length)return!1;for(var a=0;a=2&&r.push("loadeddata"),e.readyState>=3&&r.push("canplay"),e.readyState>=4&&r.push("canplaythrough"),this.ready(function(){r.forEach(function(e){this.trigger(e);},this);});}},i.setScrubbing=function(e){this.isScrubbing_=e;},i.scrubbing=function(){return this.isScrubbing_;},i.setCurrentTime=function(e){try{this.isScrubbing_&&this.el_.fastSeek&&Ee?this.el_.fastSeek(e):this.el_.currentTime=e;}catch(e){K(e,"Video is not ready. (Video.js)");}},i.duration=function(){var e=this;if(this.el_.duration===1/0&&le&&pe&&0===this.el_.currentTime){return this.on("timeupdate",function t(){e.el_.currentTime>0&&(e.el_.duration===1/0&&e.trigger("durationchange"),e.off("timeupdate",t));}),NaN;}return this.el_.duration||NaN;},i.width=function(){return this.el_.offsetWidth;},i.height=function(){return this.el_.offsetHeight;},i.proxyWebkitFullscreen_=function(){var e=this;if("webkitDisplayingFullscreen"in this.el_){var t=function t(){this.trigger("fullscreenchange",{isFullscreen:!1});},i=function i(){"webkitPresentationMode"in this.el_&&"picture-in-picture"!==this.el_.webkitPresentationMode&&(this.one("webkitendfullscreen",t),this.trigger("fullscreenchange",{isFullscreen:!0,nativeIOSFullscreen:!0}));};this.on("webkitbeginfullscreen",i),this.on("dispose",function(){e.off("webkitbeginfullscreen",i),e.off("webkitendfullscreen",t);});}},i.supportsFullScreen=function(){if("function"==typeof this.el_.webkitEnterFullScreen){var e=A["default"].navigator&&A["default"].navigator.userAgent||"";if(/Android/.test(e)||!/Chrome|Mac OS X 10.5/.test(e))return!0;}return!1;},i.enterFullScreen=function(){var e=this.el_;if(e.paused&&e.networkState<=e.HAVE_METADATA)ii(this.el_.play()),this.setTimeout(function(){e.pause();try{e.webkitEnterFullScreen();}catch(e){this.trigger("fullscreenerror",e);}},0);else try{e.webkitEnterFullScreen();}catch(e){this.trigger("fullscreenerror",e);}},i.exitFullScreen=function(){this.el_.webkitDisplayingFullscreen?this.el_.webkitExitFullScreen():this.trigger("fullscreenerror",new Error("The video is not fullscreen"));},i.requestPictureInPicture=function(){return this.el_.requestPictureInPicture();},i.src=function(e){if(void 0===e)return this.el_.src;this.setSrc(e);},i.reset=function(){t.resetMediaElement(this.el_);},i.currentSrc=function(){return this.currentSource_?this.currentSource_.src:this.el_.currentSrc;},i.setControls=function(e){this.el_.controls=!!e;},i.addTextTrack=function(t,i,n){return this.featuresNativeTextTracks?this.el_.addTextTrack(t,i,n):e.prototype.addTextTrack.call(this,t,i,n);},i.createRemoteTextTrack=function(t){if(!this.featuresNativeTextTracks)return e.prototype.createRemoteTextTrack.call(this,t);var i=k["default"].createElement("track");return t.kind&&(i.kind=t.kind),t.label&&(i.label=t.label),(t.language||t.srclang)&&(i.srclang=t.language||t.srclang),t["default"]&&(i["default"]=t["default"]),t.id&&(i.id=t.id),t.src&&(i.src=t.src),i;},i.addRemoteTextTrack=function(t,i){var n=e.prototype.addRemoteTextTrack.call(this,t,i);return this.featuresNativeTextTracks&&this.el().appendChild(n),n;},i.removeRemoteTextTrack=function(t){if(e.prototype.removeRemoteTextTrack.call(this,t),this.featuresNativeTextTracks)for(var i=this.$$("track"),n=i.length;n--;){t!==i[n]&&t!==i[n].track||this.el().removeChild(i[n]);}},i.getVideoPlaybackQuality=function(){if("function"==typeof this.el().getVideoPlaybackQuality)return this.el().getVideoPlaybackQuality();var e={};return void 0!==this.el().webkitDroppedFrameCount&&void 0!==this.el().webkitDecodedFrameCount&&(e.droppedVideoFrames=this.el().webkitDroppedFrameCount,e.totalVideoFrames=this.el().webkitDecodedFrameCount),A["default"].performance&&"function"==typeof A["default"].performance.now?e.creationTime=A["default"].performance.now():A["default"].performance&&A["default"].performance.timing&&"number"==typeof A["default"].performance.timing.navigationStart&&(e.creationTime=A["default"].Date.now()-A["default"].performance.timing.navigationStart),e;},t;}(Oi);Ir(Pr,"TEST_VID",function(){if(ke()){var e=k["default"].createElement("video"),t=k["default"].createElement("track");return t.kind="captions",t.srclang="en",t.label="English",e.appendChild(t),e;}}),Pr.isSupported=function(){try{Pr.TEST_VID.volume=.5;}catch(e){return!1;}return!(!Pr.TEST_VID||!Pr.TEST_VID.canPlayType);},Pr.canPlayType=function(e){return Pr.TEST_VID.canPlayType(e);},Pr.canPlaySource=function(e,t){return Pr.canPlayType(e.type);},Pr.canControlVolume=function(){try{var e=Pr.TEST_VID.volume;return Pr.TEST_VID.volume=e/2+.1,e!==Pr.TEST_VID.volume;}catch(e){return!1;}},Pr.canMuteVolume=function(){try{var e=Pr.TEST_VID.muted;return Pr.TEST_VID.muted=!e,Pr.TEST_VID.muted?Ve(Pr.TEST_VID,"muted","muted"):He(Pr.TEST_VID,"muted"),e!==Pr.TEST_VID.muted;}catch(e){return!1;}},Pr.canControlPlaybackRate=function(){if(le&&pe&&me<58)return!1;try{var e=Pr.TEST_VID.playbackRate;return Pr.TEST_VID.playbackRate=e/2+.1,e!==Pr.TEST_VID.playbackRate;}catch(e){return!1;}},Pr.canOverrideAttributes=function(){try{var e=function e(){};Object.defineProperty(k["default"].createElement("video"),"src",{get:e,set:e}),Object.defineProperty(k["default"].createElement("audio"),"src",{get:e,set:e}),Object.defineProperty(k["default"].createElement("video"),"innerHTML",{get:e,set:e}),Object.defineProperty(k["default"].createElement("audio"),"innerHTML",{get:e,set:e});}catch(e){return!1;}return!0;},Pr.supportsNativeTextTracks=function(){return Ee||Se&&pe;},Pr.supportsNativeVideoTracks=function(){return!(!Pr.TEST_VID||!Pr.TEST_VID.videoTracks);},Pr.supportsNativeAudioTracks=function(){return!(!Pr.TEST_VID||!Pr.TEST_VID.audioTracks);},Pr.Events=["loadstart","suspend","abort","error","emptied","stalled","loadedmetadata","loadeddata","canplay","canplaythrough","playing","waiting","seeking","seeked","ended","durationchange","timeupdate","progress","play","pause","ratechange","resize","volumechange"],[["featuresVolumeControl","canControlVolume"],["featuresMuteControl","canMuteVolume"],["featuresPlaybackRate","canControlPlaybackRate"],["featuresSourceset","canOverrideAttributes"],["featuresNativeTextTracks","supportsNativeTextTracks"],["featuresNativeVideoTracks","supportsNativeVideoTracks"],["featuresNativeAudioTracks","supportsNativeAudioTracks"]].forEach(function(e){var t=e[0],i=e[1];Ir(Pr.prototype,t,function(){return Pr[i]();},!0);}),Pr.prototype.movingMediaElementInDOM=!Se,Pr.prototype.featuresFullscreenResize=!0,Pr.prototype.featuresProgressEvents=!0,Pr.prototype.featuresTimeupdateEvents=!0,Pr.patchCanPlayType=function(){de>=4&&!ce&&!pe&&(Sr=Pr.TEST_VID&&Pr.TEST_VID.constructor.prototype.canPlayType,Pr.TEST_VID.constructor.prototype.canPlayType=function(e){return e&&/^application\/(?:x-|vnd\.apple\.)mpegurl/i.test(e)?"maybe":Sr.call(this,e);});},Pr.unpatchCanPlayType=function(){var e=Pr.TEST_VID.constructor.prototype.canPlayType;return Sr&&(Pr.TEST_VID.constructor.prototype.canPlayType=Sr),e;},Pr.patchCanPlayType(),Pr.disposeMediaElement=function(e){if(e){for(e.parentNode&&e.parentNode.removeChild(e);e.hasChildNodes();){e.removeChild(e.firstChild);}e.removeAttribute("src"),"function"==typeof e.load&&function(){try{e.load();}catch(e){}}();}},Pr.resetMediaElement=function(e){if(e){for(var t=e.querySelectorAll("source"),i=t.length;i--;){e.removeChild(t[i]);}e.removeAttribute("src"),"function"==typeof e.load&&function(){try{e.load();}catch(e){}}();}},["muted","defaultMuted","autoplay","controls","loop","playsinline"].forEach(function(e){Pr.prototype[e]=function(){return this.el_[e]||this.el_.hasAttribute(e);};}),["muted","defaultMuted","autoplay","loop","playsinline"].forEach(function(e){Pr.prototype["set"+Ht(e)]=function(t){this.el_[e]=t,t?this.el_.setAttribute(e,e):this.el_.removeAttribute(e);};}),["paused","currentTime","buffered","volume","poster","preload","error","seeking","seekable","ended","playbackRate","defaultPlaybackRate","disablePictureInPicture","played","networkState","readyState","videoWidth","videoHeight","crossOrigin"].forEach(function(e){Pr.prototype[e]=function(){return this.el_[e];};}),["volume","src","poster","preload","playbackRate","defaultPlaybackRate","disablePictureInPicture","crossOrigin"].forEach(function(e){Pr.prototype["set"+Ht(e)]=function(t){this.el_[e]=t;};}),["pause","load","play"].forEach(function(e){Pr.prototype[e]=function(){return this.el_[e]();};}),Oi.withSourceHandlers(Pr),Pr.nativeSourceHandler={},Pr.nativeSourceHandler.canPlayType=function(e){try{return Pr.TEST_VID.canPlayType(e);}catch(e){return"";}},Pr.nativeSourceHandler.canHandleSource=function(e,t){if(e.type)return Pr.nativeSourceHandler.canPlayType(e.type);if(e.src){var i=Ei(e.src);return Pr.nativeSourceHandler.canPlayType("video/"+i);}return"";},Pr.nativeSourceHandler.handleSource=function(e,t,i){t.setSrc(e.src);},Pr.nativeSourceHandler.dispose=function(){},Pr.registerSourceHandler(Pr.nativeSourceHandler),Oi.registerTech("Html5",Pr);var Lr=["progress","abort","suspend","emptied","stalled","loadedmetadata","loadeddata","timeupdate","resize","volumechange","texttrackchange"],Dr={canplay:"CanPlay",canplaythrough:"CanPlayThrough",playing:"Playing",seeked:"Seeked"},Ur=["tiny","xsmall","small","medium","large","xlarge","huge"],Rr={};Ur.forEach(function(e){var t="x"===e.charAt(0)?"x-"+e.substring(1):e;Rr[e]="vjs-layout-"+t;});var Or={tiny:210,xsmall:320,small:425,medium:768,large:1440,xlarge:2560,huge:1/0},Mr=function(e){function t(i,n,r){var a;if(i.id=i.id||n.id||"vjs_video_"+ct(),(n=Z(t.getTagSettings(i),n)).initChildren=!1,n.createEl=!1,n.evented=!1,n.reportTouchActivity=!1,!n.language)if("function"==typeof i.closest){var s=i.closest("[lang]");s&&s.getAttribute&&(n.language=s.getAttribute("lang"));}else for(var o=i;o&&1===o.nodeType;){if(Ne(o).hasOwnProperty("lang")){n.language=o.getAttribute("lang");break;}o=o.parentNode;}if((a=e.call(this,null,n,r)||this).boundDocumentFullscreenChange_=function(e){return a.documentFullscreenChange_(e);},a.boundFullWindowOnEscKey_=function(e){return a.fullWindowOnEscKey(e);},a.boundUpdateStyleEl_=function(e){return a.updateStyleEl_(e);},a.boundApplyInitTime_=function(e){return a.applyInitTime_(e);},a.boundUpdateCurrentBreakpoint_=function(e){return a.updateCurrentBreakpoint_(e);},a.boundHandleTechClick_=function(e){return a.handleTechClick_(e);},a.boundHandleTechDoubleClick_=function(e){return a.handleTechDoubleClick_(e);},a.boundHandleTechTouchStart_=function(e){return a.handleTechTouchStart_(e);},a.boundHandleTechTouchMove_=function(e){return a.handleTechTouchMove_(e);},a.boundHandleTechTouchEnd_=function(e){return a.handleTechTouchEnd_(e);},a.boundHandleTechTap_=function(e){return a.handleTechTap_(e);},a.isFullscreen_=!1,a.log=X(a.id_),a.fsApi_=H,a.isPosterFromTech_=!1,a.queuedCallbacks_=[],a.isReady_=!1,a.hasStarted_=!1,a.userActive_=!1,a.debugEnabled_=!1,!a.options_||!a.options_.techOrder||!a.options_.techOrder.length)throw new Error("No techOrder specified. Did you overwrite videojs.options instead of just changing the properties you want to override?");if(a.tag=i,a.tagAttributes=i&&Ne(i),a.language(a.options_.language),n.languages){var u={};Object.getOwnPropertyNames(n.languages).forEach(function(e){u[e.toLowerCase()]=n.languages[e];}),a.languages_=u;}else a.languages_=t.prototype.options_.languages;a.resetCache_(),a.poster_=n.poster||"",a.controls_=!!n.controls,i.controls=!1,i.removeAttribute("controls"),a.changingSrc_=!1,a.playCallbacks_=[],a.playTerminatedQueue_=[],i.hasAttribute("autoplay")?a.autoplay(!0):a.autoplay(a.options_.autoplay),n.plugins&&Object.keys(n.plugins).forEach(function(e){if("function"!=typeof a[e])throw new Error('plugin "'+e+'" does not exist');}),a.scrubbing_=!1,a.el_=a.createEl(),Bt(I["default"](a),{eventBusKey:"el_"}),a.fsApi_.requestFullscreen&&(vt(k["default"],a.fsApi_.fullscreenchange,a.boundDocumentFullscreenChange_),a.on(a.fsApi_.fullscreenchange,a.boundDocumentFullscreenChange_)),a.fluid_&&a.on(["playerreset","resize"],a.boundUpdateStyleEl_);var l=zt(a.options_);n.plugins&&Object.keys(n.plugins).forEach(function(e){a[e](n.plugins[e]);}),n.debug&&a.debug(!0),a.options_.playerOptions=l,a.middleware_=[],a.playbackRates(n.playbackRates),a.initChildren(),a.isAudio("audio"===i.nodeName.toLowerCase()),a.controls()?a.addClass("vjs-controls-enabled"):a.addClass("vjs-controls-disabled"),a.el_.setAttribute("role","region"),a.isAudio()?a.el_.setAttribute("aria-label",a.localize("Audio Player")):a.el_.setAttribute("aria-label",a.localize("Video Player")),a.isAudio()&&a.addClass("vjs-audio"),a.flexNotSupported_()&&a.addClass("vjs-no-flex"),ve&&a.addClass("vjs-touch-enabled"),Se||a.addClass("vjs-workinghover"),t.players[a.id_]=I["default"](a);var d="7.15.4".split(".")[0];return a.addClass("vjs-v"+d),a.userActive(!0),a.reportUserActivity(),a.one("play",function(e){return a.listenForUserActivity_(e);}),a.on("stageclick",function(e){return a.handleStageClick_(e);}),a.on("keydown",function(e){return a.handleKeyDown(e);}),a.on("languagechange",function(e){return a.handleLanguagechange(e);}),a.breakpoints(a.options_.breakpoints),a.responsive(a.options_.responsive),a;}P["default"](t,e);var i=t.prototype;return i.dispose=function(){var i=this;this.trigger("dispose"),this.off("dispose"),bt(k["default"],this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),bt(k["default"],"keydown",this.boundFullWindowOnEscKey_),this.styleEl_&&this.styleEl_.parentNode&&(this.styleEl_.parentNode.removeChild(this.styleEl_),this.styleEl_=null),t.players[this.id_]=null,this.tag&&this.tag.player&&(this.tag.player=null),this.el_&&this.el_.player&&(this.el_.player=null),this.tech_&&(this.tech_.dispose(),this.isPosterFromTech_=!1,this.poster_=""),this.playerElIngest_&&(this.playerElIngest_=null),this.tag&&(this.tag=null),Fi[this.id()]=null,Ri.names.forEach(function(e){var t=Ri[e],n=i[t.getterName]();n&&n.off&&n.off();}),e.prototype.dispose.call(this);},i.createEl=function(){var t,i=this.tag,n=this.playerElIngest_=i.parentNode&&i.parentNode.hasAttribute&&i.parentNode.hasAttribute("data-vjs-player"),r="video-js"===this.tag.tagName.toLowerCase();n?t=this.el_=i.parentNode:r||(t=this.el_=e.prototype.createEl.call(this,"div"));var a=Ne(i);if(r){for(t=this.el_=i,i=this.tag=k["default"].createElement("video");t.children.length;){i.appendChild(t.firstChild);}Re(t,"video-js")||Oe(t,"video-js"),t.appendChild(i),n=this.playerElIngest_=t,Object.keys(t).forEach(function(e){try{i[e]=t[e];}catch(e){}});}if(i.setAttribute("tabindex","-1"),a.tabindex="-1",(ge||pe&&ye)&&(i.setAttribute("role","application"),a.role="application"),i.removeAttribute("width"),i.removeAttribute("height"),"width"in a&&delete a.width,"height"in a&&delete a.height,Object.getOwnPropertyNames(a).forEach(function(e){r&&"class"===e||t.setAttribute(e,a[e]),r&&i.setAttribute(e,a[e]);}),i.playerId=i.id,i.id+="_html5_api",i.className="vjs-tech",i.player=t.player=this,this.addClass("vjs-paused"),!0!==A["default"].VIDEOJS_NO_DYNAMIC_STYLE){this.styleEl_=lt("vjs-styles-dimensions");var s=tt(".vjs-styles-defaults"),o=tt("head");o.insertBefore(this.styleEl_,s?s.nextSibling:o.firstChild);}this.fill_=!1,this.fluid_=!1,this.width(this.options_.width),this.height(this.options_.height),this.fill(this.options_.fill),this.fluid(this.options_.fluid),this.aspectRatio(this.options_.aspectRatio),this.crossOrigin(this.options_.crossOrigin||this.options_.crossorigin);for(var u=i.getElementsByTagName("a"),l=0;l0?this.videoWidth()+":"+this.videoHeight():"16:9").split(":"),r=n[1]/n[0];e=void 0!==this.width_?this.width_:void 0!==this.height_?this.height_/r:this.videoWidth()||300,t=void 0!==this.height_?this.height_:e*r,i=/^[^a-zA-Z]/.test(this.id())?"dimensions-"+this.id():this.id()+"-dimensions",this.addClass(i),dt(this.styleEl_,"\n ."+i+" {\n width: "+e+"px;\n height: "+t+"px;\n }\n\n ."+i+".vjs-fluid {\n padding-top: "+100*r+"%;\n }\n ");}else{var a="number"==typeof this.width_?this.width_:this.options_.width,s="number"==typeof this.height_?this.height_:this.options_.height,o=this.tech_&&this.tech_.el();o&&(a>=0&&(o.width=a),s>=0&&(o.height=s));}},i.loadTech_=function(e,t){var i=this;this.tech_&&this.unloadTech_();var n=Ht(e),r=e.charAt(0).toLowerCase()+e.slice(1);"Html5"!==n&&this.tag&&(Oi.getTech("Html5").disposeMediaElement(this.tag),this.tag.player=null,this.tag=null),this.techName_=n,this.isReady_=!1;var a=this.autoplay();("string"==typeof this.autoplay()||!0===this.autoplay()&&this.options_.normalizeAutoplay)&&(a=!1);var s={source:t,autoplay:a,nativeControlsForTouch:this.options_.nativeControlsForTouch,playerId:this.id(),techId:this.id()+"_"+r+"_api",playsinline:this.options_.playsinline,preload:this.options_.preload,loop:this.options_.loop,disablePictureInPicture:this.options_.disablePictureInPicture,muted:this.options_.muted,poster:this.poster(),language:this.language(),playerElIngest:this.playerElIngest_||!1,"vtt.js":this.options_["vtt.js"],canOverridePoster:!!this.options_.techCanOverridePoster,enableSourceset:this.options_.enableSourceset,Promise:this.options_.Promise};Ri.names.forEach(function(e){var t=Ri[e];s[t.getterName]=i[t.privateName];}),Z(s,this.options_[n]),Z(s,this.options_[r]),Z(s,this.options_[e.toLowerCase()]),this.tag&&(s.tag=this.tag),t&&t.src===this.cache_.src&&this.cache_.currentTime>0&&(s.startTime=this.cache_.currentTime);var o=Oi.getTech(e);if(!o)throw new Error("No Tech named '"+n+"' exists! '"+n+"' should be registered using videojs.registerTech()'");this.tech_=new o(s),this.tech_.ready(At(this,this.handleTechReady_),!0),ai(this.textTracksJson_||[],this.tech_),Lr.forEach(function(e){i.on(i.tech_,e,function(t){return i["handleTech"+Ht(e)+"_"](t);});}),Object.keys(Dr).forEach(function(e){i.on(i.tech_,e,function(t){0===i.tech_.playbackRate()&&i.tech_.seeking()?i.queuedCallbacks_.push({callback:i["handleTech"+Dr[e]+"_"].bind(i),event:t}):i["handleTech"+Dr[e]+"_"](t);});}),this.on(this.tech_,"loadstart",function(e){return i.handleTechLoadStart_(e);}),this.on(this.tech_,"sourceset",function(e){return i.handleTechSourceset_(e);}),this.on(this.tech_,"waiting",function(e){return i.handleTechWaiting_(e);}),this.on(this.tech_,"ended",function(e){return i.handleTechEnded_(e);}),this.on(this.tech_,"seeking",function(e){return i.handleTechSeeking_(e);}),this.on(this.tech_,"play",function(e){return i.handleTechPlay_(e);}),this.on(this.tech_,"firstplay",function(e){return i.handleTechFirstPlay_(e);}),this.on(this.tech_,"pause",function(e){return i.handleTechPause_(e);}),this.on(this.tech_,"durationchange",function(e){return i.handleTechDurationChange_(e);}),this.on(this.tech_,"fullscreenchange",function(e,t){return i.handleTechFullscreenChange_(e,t);}),this.on(this.tech_,"fullscreenerror",function(e,t){return i.handleTechFullscreenError_(e,t);}),this.on(this.tech_,"enterpictureinpicture",function(e){return i.handleTechEnterPictureInPicture_(e);}),this.on(this.tech_,"leavepictureinpicture",function(e){return i.handleTechLeavePictureInPicture_(e);}),this.on(this.tech_,"error",function(e){return i.handleTechError_(e);}),this.on(this.tech_,"posterchange",function(e){return i.handleTechPosterChange_(e);}),this.on(this.tech_,"textdata",function(e){return i.handleTechTextData_(e);}),this.on(this.tech_,"ratechange",function(e){return i.handleTechRateChange_(e);}),this.on(this.tech_,"loadedmetadata",this.boundUpdateStyleEl_),this.usingNativeControls(this.techGet_("controls")),this.controls()&&!this.usingNativeControls()&&this.addTechControlsListeners_(),this.tech_.el().parentNode===this.el()||"Html5"===n&&this.tag||Ue(this.tech_.el(),this.el()),this.tag&&(this.tag.player=null,this.tag=null);},i.unloadTech_=function(){var e=this;Ri.names.forEach(function(t){var i=Ri[t];e[i.privateName]=e[i.getterName]();}),this.textTracksJson_=ri(this.tech_),this.isReady_=!1,this.tech_.dispose(),this.tech_=!1,this.isPosterFromTech_&&(this.poster_="",this.trigger("posterchange")),this.isPosterFromTech_=!1;},i.tech=function(e){return void 0===e&&K.warn("Using the tech directly can be dangerous. I hope you know what you're doing.\nSee https://github.com/videojs/video.js/issues/2617 for more info.\n"),this.tech_;},i.addTechControlsListeners_=function(){this.removeTechControlsListeners_(),this.on(this.tech_,"click",this.boundHandleTechClick_),this.on(this.tech_,"dblclick",this.boundHandleTechDoubleClick_),this.on(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.on(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.on(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.on(this.tech_,"tap",this.boundHandleTechTap_);},i.removeTechControlsListeners_=function(){this.off(this.tech_,"tap",this.boundHandleTechTap_),this.off(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.off(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.off(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.off(this.tech_,"click",this.boundHandleTechClick_),this.off(this.tech_,"dblclick",this.boundHandleTechDoubleClick_);},i.handleTechReady_=function(){this.triggerReady(),this.cache_.volume&&this.techCall_("setVolume",this.cache_.volume),this.handleTechPosterChange_(),this.handleTechDurationChange_();},i.handleTechLoadStart_=function(){this.removeClass("vjs-ended"),this.removeClass("vjs-seeking"),this.error(null),this.handleTechDurationChange_(),this.paused()?(this.hasStarted(!1),this.trigger("loadstart")):(this.trigger("loadstart"),this.trigger("firstplay")),this.manualAutoplay_(!0===this.autoplay()&&this.options_.normalizeAutoplay?"play":this.autoplay());},i.manualAutoplay_=function(e){var t=this;if(this.tech_&&"string"==typeof e){var i,n=function n(){var e=t.muted();t.muted(!0);var i=function i(){t.muted(e);};t.playTerminatedQueue_.push(i);var n=t.play();if(ti(n))return n["catch"](function(e){throw i(),new Error("Rejection at manualAutoplay. Restoring muted value. "+(e||""));});};if("any"!==e||this.muted()?i="muted"!==e||this.muted()?this.play():n():ti(i=this.play())&&(i=i["catch"](n)),ti(i))return i.then(function(){t.trigger({type:"autoplay-success",autoplay:e});})["catch"](function(){t.trigger({type:"autoplay-failure",autoplay:e});});}},i.updateSourceCaches_=function(e){void 0===e&&(e="");var t=e,i="";"string"!=typeof t&&(t=e.src,i=e.type),this.cache_.source=this.cache_.source||{},this.cache_.sources=this.cache_.sources||[],t&&!i&&(i=function(e,t){if(!t)return"";if(e.cache_.source.src===t&&e.cache_.source.type)return e.cache_.source.type;var i=e.cache_.sources.filter(function(e){return e.src===t;});if(i.length)return i[0].type;for(var n=e.$$("source"),r=0;r0&&0===this.cache_.lastPlaybackRate&&(this.queuedCallbacks_.forEach(function(e){return e.callback(e.event);}),this.queuedCallbacks_=[]),this.cache_.lastPlaybackRate=this.tech_.playbackRate(),this.trigger("ratechange");},i.handleTechWaiting_=function(){var e=this;this.addClass("vjs-waiting"),this.trigger("waiting");var t=this.currentTime();this.on("timeupdate",function i(){t!==e.currentTime()&&(e.removeClass("vjs-waiting"),e.off("timeupdate",i));});},i.handleTechCanPlay_=function(){this.removeClass("vjs-waiting"),this.trigger("canplay");},i.handleTechCanPlayThrough_=function(){this.removeClass("vjs-waiting"),this.trigger("canplaythrough");},i.handleTechPlaying_=function(){this.removeClass("vjs-waiting"),this.trigger("playing");},i.handleTechSeeking_=function(){this.addClass("vjs-seeking"),this.trigger("seeking");},i.handleTechSeeked_=function(){this.removeClass("vjs-seeking"),this.removeClass("vjs-ended"),this.trigger("seeked");},i.handleTechFirstPlay_=function(){this.options_.starttime&&(K.warn("Passing the `starttime` option to the player will be deprecated in 6.0"),this.currentTime(this.options_.starttime)),this.addClass("vjs-has-started"),this.trigger("firstplay");},i.handleTechPause_=function(){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.trigger("pause");},i.handleTechEnded_=function(){this.addClass("vjs-ended"),this.removeClass("vjs-waiting"),this.options_.loop?(this.currentTime(0),this.play()):this.paused()||this.pause(),this.trigger("ended");},i.handleTechDurationChange_=function(){this.duration(this.techGet_("duration"));},i.handleTechClick_=function(e){this.controls_&&(this.paused()?ii(this.play()):this.pause());},i.handleTechDoubleClick_=function(e){this.controls_&&(Array.prototype.some.call(this.$$(".vjs-control-bar, .vjs-modal-dialog"),function(t){return t.contains(e.target);})||void 0!==this.options_&&void 0!==this.options_.userActions&&void 0!==this.options_.userActions.doubleClick&&!1===this.options_.userActions.doubleClick||(void 0!==this.options_&&void 0!==this.options_.userActions&&"function"==typeof this.options_.userActions.doubleClick?this.options_.userActions.doubleClick.call(this,e):this.isFullscreen()?this.exitFullscreen():this.requestFullscreen()));},i.handleTechTap_=function(){this.userActive(!this.userActive());},i.handleTechTouchStart_=function(){this.userWasActive=this.userActive();},i.handleTechTouchMove_=function(){this.userWasActive&&this.reportUserActivity();},i.handleTechTouchEnd_=function(e){e.cancelable&&e.preventDefault();},i.handleStageClick_=function(){this.reportUserActivity();},i.toggleFullscreenClass_=function(){this.isFullscreen()?this.addClass("vjs-fullscreen"):this.removeClass("vjs-fullscreen");},i.documentFullscreenChange_=function(e){var t=e.target.player;if(!t||t===this){var i=this.el(),n=k["default"][this.fsApi_.fullscreenElement]===i;!n&&i.matches?n=i.matches(":"+this.fsApi_.fullscreen):!n&&i.msMatchesSelector&&(n=i.msMatchesSelector(":"+this.fsApi_.fullscreen)),this.isFullscreen(n);}},i.handleTechFullscreenChange_=function(e,t){t&&(t.nativeIOSFullscreen&&this.toggleClass("vjs-ios-native-fs"),this.isFullscreen(t.isFullscreen));},i.handleTechFullscreenError_=function(e,t){this.trigger("fullscreenerror",t);},i.togglePictureInPictureClass_=function(){this.isInPictureInPicture()?this.addClass("vjs-picture-in-picture"):this.removeClass("vjs-picture-in-picture");},i.handleTechEnterPictureInPicture_=function(e){this.isInPictureInPicture(!0);},i.handleTechLeavePictureInPicture_=function(e){this.isInPictureInPicture(!1);},i.handleTechError_=function(){var e=this.tech_.error();this.error(e);},i.handleTechTextData_=function(){var e=null;arguments.length>1&&(e=arguments[1]),this.trigger("textdata",e);},i.getCache=function(){return this.cache_;},i.resetCache_=function(){this.cache_={currentTime:0,initTime:0,inactivityTimeout:this.options_.inactivityTimeout,duration:NaN,lastVolume:1,lastPlaybackRate:this.defaultPlaybackRate(),media:null,src:"",source:{},sources:[],playbackRates:[],volume:1};},i.techCall_=function(e,t){this.ready(function(){if(e in Hi)return function(e,t,i,n){return t[i](e.reduce(Gi(i),n));}(this.middleware_,this.tech_,e,t);if(e in zi)return ji(this.middleware_,this.tech_,e,t);try{this.tech_&&this.tech_[e](t);}catch(e){throw K(e),e;}},!0);},i.techGet_=function(e){if(this.tech_&&this.tech_.isReady_){if(e in Vi)return function(e,t,i){return e.reduceRight(Gi(i),t[i]());}(this.middleware_,this.tech_,e);if(e in zi)return ji(this.middleware_,this.tech_,e);try{return this.tech_[e]();}catch(t){if(void 0===this.tech_[e])throw K("Video.js: "+e+" method not defined for "+this.techName_+" playback technology.",t),t;if("TypeError"===t.name)throw K("Video.js: "+e+" unavailable on "+this.techName_+" playback technology element.",t),this.tech_.isReady_=!1,t;throw K(t),t;}}},i.play=function(){var e=this,t=this.options_.Promise||A["default"].Promise;return t?new t(function(t){e.play_(t);}):this.play_();},i.play_=function(e){var t=this;void 0===e&&(e=ii),this.playCallbacks_.push(e);var i=Boolean(!this.changingSrc_&&(this.src()||this.currentSrc()));if(this.waitToPlay_&&(this.off(["ready","loadstart"],this.waitToPlay_),this.waitToPlay_=null),!this.isReady_||!i)return this.waitToPlay_=function(e){t.play_();},this.one(["ready","loadstart"],this.waitToPlay_),void(i||!Ee&&!Se||this.load());var n=this.techGet_("play");null===n?this.runPlayTerminatedQueue_():this.runPlayCallbacks_(n);},i.runPlayTerminatedQueue_=function(){var e=this.playTerminatedQueue_.slice(0);this.playTerminatedQueue_=[],e.forEach(function(e){e();});},i.runPlayCallbacks_=function(e){var t=this.playCallbacks_.slice(0);this.playCallbacks_=[],this.playTerminatedQueue_=[],t.forEach(function(t){t(e);});},i.pause=function(){this.techCall_("pause");},i.paused=function(){return!1!==this.techGet_("paused");},i.played=function(){return this.techGet_("played")||$t(0,0);},i.scrubbing=function(e){if(void 0===e)return this.scrubbing_;this.scrubbing_=!!e,this.techCall_("setScrubbing",this.scrubbing_),e?this.addClass("vjs-scrubbing"):this.removeClass("vjs-scrubbing");},i.currentTime=function(e){return void 0!==e?(e<0&&(e=0),this.isReady_&&!this.changingSrc_&&this.tech_&&this.tech_.isReady_?(this.techCall_("setCurrentTime",e),void(this.cache_.initTime=0)):(this.cache_.initTime=e,this.off("canplay",this.boundApplyInitTime_),void this.one("canplay",this.boundApplyInitTime_))):(this.cache_.currentTime=this.techGet_("currentTime")||0,this.cache_.currentTime);},i.applyInitTime_=function(){this.currentTime(this.cache_.initTime);},i.duration=function(e){if(void 0===e)return void 0!==this.cache_.duration?this.cache_.duration:NaN;(e=parseFloat(e))<0&&(e=1/0),e!==this.cache_.duration&&(this.cache_.duration=e,e===1/0?this.addClass("vjs-live"):this.removeClass("vjs-live"),isNaN(e)||this.trigger("durationchange"));},i.remainingTime=function(){return this.duration()-this.currentTime();},i.remainingTimeDisplay=function(){return Math.floor(this.duration())-Math.floor(this.currentTime());},i.buffered=function(){var e=this.techGet_("buffered");return e&&e.length||(e=$t(0,0)),e;},i.bufferedPercent=function(){return Jt(this.buffered(),this.duration());},i.bufferedEnd=function(){var e=this.buffered(),t=this.duration(),i=e.end(e.length-1);return i>t&&(i=t),i;},i.volume=function(e){var t;return void 0!==e?(t=Math.max(0,Math.min(1,parseFloat(e))),this.cache_.volume=t,this.techCall_("setVolume",t),void(t>0&&this.lastVolume_(t))):(t=parseFloat(this.techGet_("volume")),isNaN(t)?1:t);},i.muted=function(e){if(void 0===e)return this.techGet_("muted")||!1;this.techCall_("setMuted",e);},i.defaultMuted=function(e){return void 0!==e?this.techCall_("setDefaultMuted",e):this.techGet_("defaultMuted")||!1;},i.lastVolume_=function(e){if(void 0===e||0===e)return this.cache_.lastVolume;this.cache_.lastVolume=e;},i.supportsFullScreen=function(){return this.techGet_("supportsFullScreen")||!1;},i.isFullscreen=function(e){if(void 0!==e){var t=this.isFullscreen_;return this.isFullscreen_=Boolean(e),this.isFullscreen_!==t&&this.fsApi_.prefixed&&this.trigger("fullscreenchange"),void this.toggleFullscreenClass_();}return this.isFullscreen_;},i.requestFullscreen=function(e){var t=this.options_.Promise||A["default"].Promise;if(t){var i=this;return new t(function(t,n){function r(){i.off("fullscreenerror",s),i.off("fullscreenchange",a);}function a(){r(),t();}function s(e,t){r(),n(t);}i.one("fullscreenchange",a),i.one("fullscreenerror",s);var o=i.requestFullscreenHelper_(e);o&&(o.then(r,r),o.then(t,n));});}return this.requestFullscreenHelper_();},i.requestFullscreenHelper_=function(e){var t,i=this;if(this.fsApi_.prefixed||(t=this.options_.fullscreen&&this.options_.fullscreen.options||{},void 0!==e&&(t=e)),this.fsApi_.requestFullscreen){var n=this.el_[this.fsApi_.requestFullscreen](t);return n&&n.then(function(){return i.isFullscreen(!0);},function(){return i.isFullscreen(!1);}),n;}this.tech_.supportsFullScreen()&&!0==!this.options_.preferFullWindow?this.techCall_("enterFullScreen"):this.enterFullWindow();},i.exitFullscreen=function(){var e=this.options_.Promise||A["default"].Promise;if(e){var t=this;return new e(function(e,i){function n(){t.off("fullscreenerror",a),t.off("fullscreenchange",r);}function r(){n(),e();}function a(e,t){n(),i(t);}t.one("fullscreenchange",r),t.one("fullscreenerror",a);var s=t.exitFullscreenHelper_();s&&(s.then(n,n),s.then(e,i));});}return this.exitFullscreenHelper_();},i.exitFullscreenHelper_=function(){var e=this;if(this.fsApi_.requestFullscreen){var t=k["default"][this.fsApi_.exitFullscreen]();return t&&ii(t.then(function(){return e.isFullscreen(!1);})),t;}this.tech_.supportsFullScreen()&&!0==!this.options_.preferFullWindow?this.techCall_("exitFullScreen"):this.exitFullWindow();},i.enterFullWindow=function(){this.isFullscreen(!0),this.isFullWindow=!0,this.docOrigOverflow=k["default"].documentElement.style.overflow,vt(k["default"],"keydown",this.boundFullWindowOnEscKey_),k["default"].documentElement.style.overflow="hidden",Oe(k["default"].body,"vjs-full-window"),this.trigger("enterFullWindow");},i.fullWindowOnEscKey=function(e){D["default"].isEventKey(e,"Esc")&&!0===this.isFullscreen()&&(this.isFullWindow?this.exitFullWindow():this.exitFullscreen());},i.exitFullWindow=function(){this.isFullscreen(!1),this.isFullWindow=!1,bt(k["default"],"keydown",this.boundFullWindowOnEscKey_),k["default"].documentElement.style.overflow=this.docOrigOverflow,Me(k["default"].body,"vjs-full-window"),this.trigger("exitFullWindow");},i.disablePictureInPicture=function(e){if(void 0===e)return this.techGet_("disablePictureInPicture");this.techCall_("setDisablePictureInPicture",e),this.options_.disablePictureInPicture=e,this.trigger("disablepictureinpicturechanged");},i.isInPictureInPicture=function(e){return void 0!==e?(this.isInPictureInPicture_=!!e,void this.togglePictureInPictureClass_()):!!this.isInPictureInPicture_;},i.requestPictureInPicture=function(){if("pictureInPictureEnabled"in k["default"]&&!1===this.disablePictureInPicture())return this.techGet_("requestPictureInPicture");},i.exitPictureInPicture=function(){if("pictureInPictureEnabled"in k["default"])return k["default"].exitPictureInPicture();},i.handleKeyDown=function(e){var t=this.options_.userActions;if(t&&t.hotkeys){(function(e){var t=e.tagName.toLowerCase();if(e.isContentEditable)return!0;if("input"===t)return-1===["button","checkbox","hidden","radio","reset","submit"].indexOf(e.type);return-1!==["textarea"].indexOf(t);})(this.el_.ownerDocument.activeElement)||("function"==typeof t.hotkeys?t.hotkeys.call(this,e):this.handleHotkeys(e));}},i.handleHotkeys=function(e){var t=this.options_.userActions?this.options_.userActions.hotkeys:{},i=t.fullscreenKey,n=void 0===i?function(e){return D["default"].isEventKey(e,"f");}:i,r=t.muteKey,a=void 0===r?function(e){return D["default"].isEventKey(e,"m");}:r,s=t.playPauseKey,o=void 0===s?function(e){return D["default"].isEventKey(e,"k")||D["default"].isEventKey(e,"Space");}:s;if(n.call(this,e)){e.preventDefault(),e.stopPropagation();var u=Kt.getComponent("FullscreenToggle");!1!==k["default"][this.fsApi_.fullscreenEnabled]&&u.prototype.handleClick.call(this,e);}else if(a.call(this,e)){e.preventDefault(),e.stopPropagation(),Kt.getComponent("MuteToggle").prototype.handleClick.call(this,e);}else if(o.call(this,e)){e.preventDefault(),e.stopPropagation(),Kt.getComponent("PlayToggle").prototype.handleClick.call(this,e);}},i.canPlayType=function(e){for(var t,i=0,n=this.options_.techOrder;i1?i.handleSrc_(n.slice(1)):(i.changingSrc_=!1,i.setTimeout(function(){this.error({code:4,message:this.localize(this.options_.notSupportedMessage)});},0),void i.triggerReady());a=r,s=i.tech_,a.forEach(function(e){return e.setTech&&e.setTech(s);});}),this.options_.retryOnError&&n.length>1){var r=function r(){i.error(null),i.handleSrc_(n.slice(1),!0);},a=function a(){i.off("error",r);};this.one("error",r),this.one("playing",a),this.resetRetryOnError_=function(){i.off("error",r),i.off("playing",a);};}}else this.setTimeout(function(){this.error({code:4,message:this.localize(this.options_.notSupportedMessage)});},0);},i.src=function(e){return this.handleSrc_(e,!1);},i.src_=function(e){var t,i,n=this,r=this.selectSource([e]);return!r||(t=r.tech,i=this.techName_,Ht(t)!==Ht(i)?(this.changingSrc_=!0,this.loadTech_(r.tech,r.source),this.tech_.ready(function(){n.changingSrc_=!1;}),!1):(this.ready(function(){this.tech_.constructor.prototype.hasOwnProperty("setSource")?this.techCall_("setSource",e):this.techCall_("src",e.src),this.changingSrc_=!1;},!0),!1));},i.load=function(){this.techCall_("load");},i.reset=function(){var e=this,t=this.options_.Promise||A["default"].Promise;this.paused()||!t?this.doReset_():ii(this.play().then(function(){return e.doReset_();}));},i.doReset_=function(){this.tech_&&this.tech_.clearTracks("text"),this.resetCache_(),this.poster(""),this.loadTech_(this.options_.techOrder[0],null),this.techCall_("reset"),this.resetControlBarUI_(),Pt(this)&&this.trigger("playerreset");},i.resetControlBarUI_=function(){this.resetProgressBar_(),this.resetPlaybackRate_(),this.resetVolumeBar_();},i.resetProgressBar_=function(){this.currentTime(0);var e=this.controlBar,t=e.durationDisplay,i=e.remainingTimeDisplay;t&&t.updateContent(),i&&i.updateContent();},i.resetPlaybackRate_=function(){this.playbackRate(this.defaultPlaybackRate()),this.handleTechRateChange_();},i.resetVolumeBar_=function(){this.volume(1),this.trigger("volumechange");},i.currentSources=function(){var e=this.currentSource(),t=[];return 0!==Object.keys(e).length&&t.push(e),this.cache_.sources||t;},i.currentSource=function(){return this.cache_.source||{};},i.currentSrc=function(){return this.currentSource()&&this.currentSource().src||"";},i.currentType=function(){return this.currentSource()&&this.currentSource().type||"";},i.preload=function(e){return void 0!==e?(this.techCall_("setPreload",e),void(this.options_.preload=e)):this.techGet_("preload");},i.autoplay=function(e){if(void 0===e)return this.options_.autoplay||!1;var t;"string"==typeof e&&/(any|play|muted)/.test(e)||!0===e&&this.options_.normalizeAutoplay?(this.options_.autoplay=e,this.manualAutoplay_("string"==typeof e?e:"play"),t=!1):this.options_.autoplay=!!e,t=void 0===t?this.options_.autoplay:t,this.tech_&&this.techCall_("setAutoplay",t);},i.playsinline=function(e){return void 0!==e?(this.techCall_("setPlaysinline",e),this.options_.playsinline=e,this):this.techGet_("playsinline");},i.loop=function(e){return void 0!==e?(this.techCall_("setLoop",e),void(this.options_.loop=e)):this.techGet_("loop");},i.poster=function(e){if(void 0===e)return this.poster_;e||(e=""),e!==this.poster_&&(this.poster_=e,this.techCall_("setPoster",e),this.isPosterFromTech_=!1,this.trigger("posterchange"));},i.handleTechPosterChange_=function(){if((!this.poster_||this.options_.techCanOverridePoster)&&this.tech_&&this.tech_.poster){var e=this.tech_.poster()||"";e!==this.poster_&&(this.poster_=e,this.isPosterFromTech_=!0,this.trigger("posterchange"));}},i.controls=function(e){if(void 0===e)return!!this.controls_;e=!!e,this.controls_!==e&&(this.controls_=e,this.usingNativeControls()&&this.techCall_("setControls",e),this.controls_?(this.removeClass("vjs-controls-disabled"),this.addClass("vjs-controls-enabled"),this.trigger("controlsenabled"),this.usingNativeControls()||this.addTechControlsListeners_()):(this.removeClass("vjs-controls-enabled"),this.addClass("vjs-controls-disabled"),this.trigger("controlsdisabled"),this.usingNativeControls()||this.removeTechControlsListeners_()));},i.usingNativeControls=function(e){if(void 0===e)return!!this.usingNativeControls_;e=!!e,this.usingNativeControls_!==e&&(this.usingNativeControls_=e,this.usingNativeControls_?(this.addClass("vjs-using-native-controls"),this.trigger("usingnativecontrols")):(this.removeClass("vjs-using-native-controls"),this.trigger("usingcustomcontrols")));},i.error=function(e){var t=this;if(void 0===e)return this.error_||null;if(j("beforeerror").forEach(function(i){var n=i(t,e);ee(n)&&!Array.isArray(n)||"string"==typeof n||"number"==typeof n||null===n?e=n:t.log.error("please return a value that MediaError expects in beforeerror hooks");}),this.options_.suppressNotSupportedError&&e&&4===e.code){var i=function i(){this.error(e);};return this.options_.suppressNotSupportedError=!1,this.any(["click","touchstart"],i),void this.one("loadstart",function(){this.off(["click","touchstart"],i);});}if(null===e)return this.error_=e,this.removeClass("vjs-error"),void(this.errorDisplay&&this.errorDisplay.close());this.error_=new Zt(e),this.addClass("vjs-error"),K.error("(CODE:"+this.error_.code+" "+Zt.errorTypes[this.error_.code]+")",this.error_.message,this.error_),this.trigger("error"),j("error").forEach(function(e){return e(t,t.error_);});},i.reportUserActivity=function(e){this.userActivity_=!0;},i.userActive=function(e){if(void 0===e)return this.userActive_;if((e=!!e)!==this.userActive_){if(this.userActive_=e,this.userActive_)return this.userActivity_=!0,this.removeClass("vjs-user-inactive"),this.addClass("vjs-user-active"),void this.trigger("useractive");this.tech_&&this.tech_.one("mousemove",function(e){e.stopPropagation(),e.preventDefault();}),this.userActivity_=!1,this.removeClass("vjs-user-active"),this.addClass("vjs-user-inactive"),this.trigger("userinactive");}},i.listenForUserActivity_=function(){var e,t,i,n=At(this,this.reportUserActivity),r=function r(t){n(),this.clearInterval(e);};this.on("mousedown",function(){n(),this.clearInterval(e),e=this.setInterval(n,250);}),this.on("mousemove",function(e){e.screenX===t&&e.screenY===i||(t=e.screenX,i=e.screenY,n());}),this.on("mouseup",r),this.on("mouseleave",r);var a,s=this.getChild("controlBar");!s||Se||le||(s.on("mouseenter",function(e){0!==this.player().options_.inactivityTimeout&&(this.player().cache_.inactivityTimeout=this.player().options_.inactivityTimeout),this.player().options_.inactivityTimeout=0;}),s.on("mouseleave",function(e){this.player().options_.inactivityTimeout=this.player().cache_.inactivityTimeout;})),this.on("keydown",n),this.on("keyup",n),this.setInterval(function(){if(this.userActivity_){this.userActivity_=!1,this.userActive(!0),this.clearTimeout(a);var e=this.options_.inactivityTimeout;e<=0||(a=this.setTimeout(function(){this.userActivity_||this.userActive(!1);},e));}},250);},i.playbackRate=function(e){if(void 0===e)return this.tech_&&this.tech_.featuresPlaybackRate?this.cache_.lastPlaybackRate||this.techGet_("playbackRate"):1;this.techCall_("setPlaybackRate",e);},i.defaultPlaybackRate=function(e){return void 0!==e?this.techCall_("setDefaultPlaybackRate",e):this.tech_&&this.tech_.featuresPlaybackRate?this.techGet_("defaultPlaybackRate"):1;},i.isAudio=function(e){if(void 0===e)return!!this.isAudio_;this.isAudio_=!!e;},i.addTextTrack=function(e,t,i){if(this.tech_)return this.tech_.addTextTrack(e,t,i);},i.addRemoteTextTrack=function(e,t){if(this.tech_)return this.tech_.addRemoteTextTrack(e,t);},i.removeRemoteTextTrack=function(e){void 0===e&&(e={});var t=e.track;if(t||(t=e),this.tech_)return this.tech_.removeRemoteTextTrack(t);},i.getVideoPlaybackQuality=function(){return this.techGet_("getVideoPlaybackQuality");},i.videoWidth=function(){return this.tech_&&this.tech_.videoWidth&&this.tech_.videoWidth()||0;},i.videoHeight=function(){return this.tech_&&this.tech_.videoHeight&&this.tech_.videoHeight()||0;},i.language=function(e){if(void 0===e)return this.language_;this.language_!==String(e).toLowerCase()&&(this.language_=String(e).toLowerCase(),Pt(this)&&this.trigger("languagechange"));},i.languages=function(){return zt(t.prototype.options_.languages,this.languages_);},i.toJSON=function(){var e=zt(this.options_),t=e.tracks;e.tracks=[];for(var i=0;i"):function(){};},Jr=function Jr(e,t){var i,n=[];if(e&&e.length)for(i=0;i=t;});},ea=function ea(e,t){return Jr(e,function(e){return e-1/30>=t;});},ta=function ta(e){var t=[];if(!e||!e.length)return"";for(var i=0;i "+e.end(i));}return t.join(", ");},ia=function ia(e){for(var t=[],i=0;i0;return i&&t.serverControl&&t.serverControl.partHoldBack?t.serverControl.partHoldBack:i&&t.partTargetDuration?3*t.partTargetDuration:t.serverControl&&t.serverControl.holdBack?t.serverControl.holdBack:t.targetDuration?3*t.targetDuration:0;},la=function la(e,t,i){if(void 0===t&&(t=e.mediaSequence+e.segments.length),tr){var s=[r,n];n=s[0],r=s[1];}if(n<0){for(var o=n;oDate.now();},pa=function pa(e){return e.excludeUntil&&e.excludeUntil===1/0;},ma=function ma(e){var t=fa(e);return!e.disabled&&!t;},ga=function ga(e,t){return t.attributes&&t.attributes[e];},_a=function _a(e,t){if(1===e.playlists.length)return!0;var i=t.attributes.BANDWIDTH||Number.MAX_VALUE;return 0===e.playlists.filter(function(e){return!!ma(e)&&(e.attributes.BANDWIDTH||0)0)for(var c=l-1;c>=0;c--){var f=u[c];if(o+=f.duration,s){if(o<0)continue;}else if(o+1/30<=0)continue;return{partIndex:f.partIndex,segmentIndex:f.segmentIndex,startTime:a-ha({defaultDuration:t.targetDuration,durationList:u,startIndex:l,endIndex:c})};}return{partIndex:u[0]&&u[0].partIndex||null,segmentIndex:u[0]&&u[0].segmentIndex||0,startTime:i};}if(l<0){for(var p=l;p<0;p++){if((o-=t.targetDuration)<0)return{partIndex:u[0]&&u[0].partIndex||null,segmentIndex:u[0]&&u[0].segmentIndex||0,startTime:i};}l=0;}for(var m=l;m0)continue;}else if(o-1/30>=0)continue;return{partIndex:g.partIndex,segmentIndex:g.segmentIndex,startTime:a+ha({defaultDuration:t.targetDuration,durationList:u,startIndex:l,endIndex:m})};}return{segmentIndex:u[u.length-1].segmentIndex,partIndex:u[u.length-1].partIndex,startTime:i};},isEnabled:ma,isDisabled:function isDisabled(e){return e.disabled;},isBlacklisted:fa,isIncompatible:pa,playlistEnd:ca,isAes:function isAes(e){for(var t=0;t-1&&s!==a.length-1&&i.push("_HLS_part="+s),(s>-1||a.length)&&r--;}i.unshift("_HLS_msn="+r);}return t.serverControl&&t.serverControl.canSkipUntil&&i.unshift("_HLS_skip="+(t.serverControl.canSkipDateranges?"v2":"YES")),i.forEach(function(t,i){e+=""+(0===i?"?":"&")+t;}),e;}(i,t)),this.state="HAVE_CURRENT_METADATA",this.request=this.vhs_.xhr({uri:i,withCredentials:this.withCredentials},function(t,i){if(e.request)return t?e.playlistRequestError(e.request,e.media(),"HAVE_METADATA"):void e.haveMetadata({playlistString:e.request.responseText,url:e.media().uri,id:e.media().id});});}},i.playlistRequestError=function(e,t,i){var n=t.uri,r=t.id;this.request=null,i&&(this.state=i),this.error={playlist:this.master.playlists[r],status:e.status,message:"HLS playlist request error at URL: "+n+".",responseText:e.responseText,code:e.status>=500?4:2},this.trigger("error");},i.parseManifest_=function(e){var t=this,i=e.url;return function(e){var t=e.onwarn,i=e.oninfo,n=e.manifestString,r=e.customTagParsers,a=void 0===r?[]:r,s=e.customTagMappers,o=void 0===s?[]:s,u=e.experimentalLLHLS,l=new m.Parser();t&&l.on("warn",t),i&&l.on("info",i),a.forEach(function(e){return l.addParser(e);}),o.forEach(function(e){return l.addTagMapper(e);}),l.push(n),l.end();var d=l.manifest;if(u||(["preloadSegment","skip","serverControl","renditionReports","partInf","partTargetDuration"].forEach(function(e){d.hasOwnProperty(e)&&delete d[e];}),d.segments&&d.segments.forEach(function(e){["parts","preloadHints"].forEach(function(t){e.hasOwnProperty(t)&&delete e[t];});})),!d.targetDuration){var h=10;d.segments&&d.segments.length&&(h=d.segments.reduce(function(e,t){return Math.max(e,t.duration);},0)),t&&t("manifest has no targetDuration defaulting to "+h),d.targetDuration=h;}var c=sa(d);if(c.length&&!d.partTargetDuration){var f=c.reduce(function(e,t){return Math.max(e,t.duration);},0);t&&(t("manifest has no partTargetDuration defaulting to "+f),Sa.error("LL-HLS manifest has parts but lacks required #EXT-X-PART-INF:PART-TARGET value. See https://datatracker.ietf.org/doc/html/draft-pantos-hls-rfc8216bis-09#section-4.4.3.7. Playback is not guaranteed.")),d.partTargetDuration=f;}return d;}({onwarn:function onwarn(e){var n=e.message;return t.logger_("m3u8-parser warn for "+i+": "+n);},oninfo:function oninfo(e){var n=e.message;return t.logger_("m3u8-parser info for "+i+": "+n);},manifestString:e.manifestString,customTagParsers:this.customTagParsers,customTagMappers:this.customTagMappers,experimentalLLHLS:this.experimentalLLHLS});},i.haveMetadata=function(e){var t=e.playlistString,i=e.playlistObject,n=e.url,r=e.id;this.request=null,this.state="HAVE_METADATA";var a=i||this.parseManifest_({url:n,manifestString:t});a.lastRequest=Date.now(),Ca({playlist:a,uri:n,id:r});var s=Ua(this.master,a);this.targetDuration=a.partTargetDuration||a.targetDuration,s?(this.master=s,this.media_=this.master.playlists[r]):this.trigger("playlistunchanged"),this.updateMediaUpdateTimeout_(Ra(this.media(),!!s)),this.trigger("loadedplaylist");},i.dispose=function(){this.trigger("dispose"),this.stopRequest(),A["default"].clearTimeout(this.mediaUpdateTimeout),A["default"].clearTimeout(this.finalRenditionTimeout),this.off();},i.stopRequest=function(){if(this.request){var e=this.request;this.request=null,e.onreadystatechange=null,e.abort();}},i.media=function(e,t){var i=this;if(!e)return this.media_;if("HAVE_NOTHING"===this.state)throw new Error("Cannot switch media playlist from "+this.state);if("string"==typeof e){if(!this.master.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.master.playlists[e];}if(A["default"].clearTimeout(this.finalRenditionTimeout),t){var n=(e.partTargetDuration||e.targetDuration)/2*1e3||5e3;this.finalRenditionTimeout=A["default"].setTimeout(this.media.bind(this,e,!1),n);}else{var r=this.state,a=!this.media_||e.id!==this.media_.id,s=this.master.playlists[e.id];if(s&&s.endList||e.endList&&e.segments.length)return this.request&&(this.request.onreadystatechange=null,this.request.abort(),this.request=null),this.state="HAVE_METADATA",this.media_=e,void(a&&(this.trigger("mediachanging"),"HAVE_MASTER"===r?this.trigger("loadedmetadata"):this.trigger("mediachange")));if(this.updateMediaUpdateTimeout_(Ra(e,!0)),a){if(this.state="SWITCHING_MEDIA",this.request){if(e.resolvedUri===this.request.url)return;this.request.onreadystatechange=null,this.request.abort(),this.request=null;}this.media_&&this.trigger("mediachanging"),this.request=this.vhs_.xhr({uri:e.resolvedUri,withCredentials:this.withCredentials},function(t,n){if(i.request){if(e.lastRequest=Date.now(),e.resolvedUri=Qr(i.handleManifestRedirects,e.resolvedUri,n),t)return i.playlistRequestError(i.request,e,r);i.haveMetadata({playlistString:n.responseText,url:e.uri,id:e.id}),"HAVE_MASTER"===r?i.trigger("loadedmetadata"):i.trigger("mediachange");}});}}},i.pause=function(){this.mediaUpdateTimeout&&(A["default"].clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),this.stopRequest(),"HAVE_NOTHING"===this.state&&(this.started=!1),"SWITCHING_MEDIA"===this.state?this.media_?this.state="HAVE_METADATA":this.state="HAVE_MASTER":"HAVE_CURRENT_METADATA"===this.state&&(this.state="HAVE_METADATA");},i.load=function(e){var t=this;this.mediaUpdateTimeout&&(A["default"].clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null);var i=this.media();if(e){var n=i?(i.partTargetDuration||i.targetDuration)/2*1e3:5e3;this.mediaUpdateTimeout=A["default"].setTimeout(function(){t.mediaUpdateTimeout=null,t.load();},n);}else this.started?i&&!i.endList?this.trigger("mediaupdatetimeout"):this.trigger("loadedplaylist"):this.start();},i.updateMediaUpdateTimeout_=function(e){var t=this;this.mediaUpdateTimeout&&(A["default"].clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),this.media()&&!this.media().endList&&(this.mediaUpdateTimeout=A["default"].setTimeout(function(){t.mediaUpdateTimeout=null,t.trigger("mediaupdatetimeout"),t.updateMediaUpdateTimeout_(e);},e));},i.start=function(){var e=this;if(this.started=!0,"object"==_typeof(this.src))return this.src.uri||(this.src.uri=A["default"].location.href),this.src.resolvedUri=this.src.uri,void setTimeout(function(){e.setupInitialPlaylist(e.src);},0);this.request=this.vhs_.xhr({uri:this.src,withCredentials:this.withCredentials},function(t,i){if(e.request){if(e.request=null,t)return e.error={status:i.status,message:"HLS playlist request error at URL: "+e.src+".",responseText:i.responseText,code:2},"HAVE_NOTHING"===e.state&&(e.started=!1),e.trigger("error");e.src=Qr(e.handleManifestRedirects,e.src,i);var n=e.parseManifest_({manifestString:i.responseText,url:e.src});e.setupInitialPlaylist(n);}});},i.srcUri=function(){return"string"==typeof this.src?this.src:this.src.uri;},i.setupInitialPlaylist=function(e){if(this.state="HAVE_MASTER",e.playlists)return this.master=e,Aa(this.master,this.srcUri()),e.playlists.forEach(function(e){e.segments=La(e),e.segments.forEach(function(t){Pa(t,e.resolvedUri);});}),this.trigger("loadedplaylist"),void(this.request||this.media(this.master.playlists[0]));var t=this.srcUri()||A["default"].location.href;this.master=function(e,t){var i=Ea(0,t),n={mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:A["default"].location.href,resolvedUri:A["default"].location.href,playlists:[{uri:t,id:i,resolvedUri:t,attributes:{}}]};return n.playlists[i]=n.playlists[0],n.playlists[t]=n.playlists[0],n;}(0,t),this.haveMetadata({playlistObject:e,url:t,id:this.master.playlists[0].id}),this.trigger("loadedmetadata");},t;}(xa),Ma=Yr.xhr,Fa=Yr.mergeOptions,Ba=function Ba(e,t,i,n){var r="arraybuffer"===e.responseType?e.response:e.responseText;!t&&r&&(e.responseTime=Date.now(),e.roundTripTime=e.responseTime-e.requestTime,e.bytesReceived=r.byteLength||r.length,e.bandwidth||(e.bandwidth=Math.floor(e.bytesReceived/e.roundTripTime*8*1e3))),i.headers&&(e.responseHeaders=i.headers),t&&"ETIMEDOUT"===t.code&&(e.timedout=!0),t||e.aborted||200===i.statusCode||206===i.statusCode||0===i.statusCode||(t=new Error("XHR Failed with a response of: "+(e&&(r||e.responseText)))),n(t,e);},Na=function Na(){var e=function e(t,i){t=Fa({timeout:45e3},t);var n=e.beforeRequest||Yr.Vhs.xhr.beforeRequest;if(n&&"function"==typeof n){var r=n(t);r&&(t=r);}var a=(!0===Yr.Vhs.xhr.original?Ma:Yr.Vhs.xhr)(t,function(e,t){return Ba(a,e,t,i);}),s=a.abort;return a.abort=function(){return a.aborted=!0,s.apply(a,arguments);},a.uri=t.uri,a.requestTime=Date.now(),a;};return e.original=!0,e;},ja=function ja(e){var t,i,n={};return e.byterange&&(n.Range=(t=e.byterange,i=t.offset+t.length-1,"bytes="+t.offset+"-"+i)),n;},Va=function Va(e,t){return e.start(t)+"-"+e.end(t);},Ha=function Ha(e,t){var i=e.toString(16);return"00".substring(0,2-i.length)+i+(t%2?" ":"");},za=function za(e){return e>=32&&e<126?String.fromCharCode(e):".";},Ga=function Ga(e){var t={};return Object.keys(e).forEach(function(i){var n=e[i];ArrayBuffer.isView(n)?t[i]={bytes:n.buffer,byteOffset:n.byteOffset,byteLength:n.byteLength}:t[i]=n;}),t;},Wa=function Wa(e){var t=e.byterange||{length:1/0,offset:0};return[t.length,t.offset,e.resolvedUri].join(",");},Ya=function Ya(e){return e.resolvedUri;},qa=function qa(e){for(var t=Array.prototype.slice.call(e),i="",n=0;nn){if(e>n+.25*a.duration)return null;i=a;}return{segment:i,estimatedStart:i.videoTimingInfo?i.videoTimingInfo.transmuxedPresentationStart:n-i.duration,type:i.videoTimingInfo?"accurate":"estimate"};}(n,t);if(!a)return r({message:"valid programTime was not found"});if("estimate"===a.type)return r({message:"Accurate programTime could not be determined. Please seek to e.seekTime and try again",seekTime:a.estimatedStart});var s={mediaSeconds:n},o=function(e,t){if(!t.dateTimeObject)return null;var i=t.videoTimingInfo.transmuxerPrependedSeconds,n=e-(t.videoTimingInfo.transmuxedPresentationStart+i);return new Date(t.dateTimeObject.getTime()+1e3*n);}(n,a.segment);return o&&(s.programDateTime=o.toISOString()),r(null,s);},Qa=function e(t){var i=t.programTime,n=t.playlist,r=t.retryCount,a=void 0===r?2:r,s=t.seekTo,o=t.pauseAfterSeek,u=void 0===o||o,l=t.tech,d=t.callback;if(!d)throw new Error("seekToProgramTime: callback must be provided");if(void 0===i||!n||!s)return d({message:"seekToProgramTime: programTime, seekTo and playlist must be provided"});if(!n.endList&&!l.hasStarted_)return d({message:"player must be playing a live stream to start buffering"});if(!function(e){if(!e.segments||0===e.segments.length)return!1;for(var t=0;tnew Date(o.getTime()+1e3*u)?null:(i>o&&(n=s),{segment:n,estimatedStart:n.videoTimingInfo?n.videoTimingInfo.transmuxedPresentationStart:Ta.duration(t,t.mediaSequence+t.segments.indexOf(n)),type:n.videoTimingInfo?"accurate":"estimate"});}(i,n);if(!h)return d({message:i+" was not found in the stream"});var c=h.segment,f=function(e,t){var i,n;try{i=new Date(e),n=new Date(t);}catch(e){}var r=i.getTime();return(n.getTime()-r)/1e3;}(c.dateTimeObject,i);if("estimate"===h.type)return 0===a?d({message:i+" is not buffered yet. Try again"}):(s(h.estimatedStart+f),void l.one("seeked",function(){e({programTime:i,playlist:n,retryCount:a-1,seekTo:s,pauseAfterSeek:u,tech:l,callback:d});}));var p=c.start+f;l.one("seeked",function(){return d(null,l.currentTime());}),u&&l.pause(),s(p);},$a=function $a(e,t){if(4===e.readyState)return t();},Ja=Yr.EventTarget,Za=Yr.mergeOptions,es=function es(e,t){if(!Da(e,t))return!1;if(e.sidx&&t.sidx&&(e.sidx.offset!==t.sidx.offset||e.sidx.length!==t.sidx.length))return!1;if(!e.sidx&&t.sidx||e.sidx&&!t.sidx)return!1;if(e.segments&&!t.segments||!e.segments&&t.segments)return!1;if(!e.segments&&!t.segments)return!0;for(var i=0;i=d+l)return s(t,{response:o.subarray(l,l+d),status:i.status,uri:i.uri});n.request=n.vhs_.xhr({uri:a,responseType:"arraybuffer",headers:ja({byterange:e.sidx.byterange})},s);});}else this.mediaRequest_=A["default"].setTimeout(function(){return i(!1);},0);},i.dispose=function(){this.trigger("dispose"),this.stopRequest(),this.loadedPlaylists_={},A["default"].clearTimeout(this.minimumUpdatePeriodTimeout_),A["default"].clearTimeout(this.mediaRequest_),A["default"].clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.mediaRequest_=null,this.minimumUpdatePeriodTimeout_=null,this.masterPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.masterPlaylistLoader_.createMupOnMedia_),this.masterPlaylistLoader_.createMupOnMedia_=null),this.off();},i.hasPendingRequest=function(){return this.request||this.mediaRequest_;},i.stopRequest=function(){if(this.request){var e=this.request;this.request=null,e.onreadystatechange=null,e.abort();}},i.media=function(e){var t=this;if(!e)return this.media_;if("HAVE_NOTHING"===this.state)throw new Error("Cannot switch media playlist from "+this.state);var i=this.state;if("string"==typeof e){if(!this.masterPlaylistLoader_.master.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.masterPlaylistLoader_.master.playlists[e];}var n=!this.media_||e.id!==this.media_.id;if(n&&this.loadedPlaylists_[e.id]&&this.loadedPlaylists_[e.id].endList)return this.state="HAVE_METADATA",this.media_=e,void(n&&(this.trigger("mediachanging"),this.trigger("mediachange")));n&&(this.media_&&this.trigger("mediachanging"),this.addSidxSegments_(e,i,function(n){t.haveMetadata({startingState:i,playlist:e});}));},i.haveMetadata=function(e){var t=e.startingState,i=e.playlist;this.state="HAVE_METADATA",this.loadedPlaylists_[i.id]=i,this.mediaRequest_=null,this.refreshMedia_(i.id),"HAVE_MASTER"===t?this.trigger("loadedmetadata"):this.trigger("mediachange");},i.pause=function(){this.masterPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.masterPlaylistLoader_.createMupOnMedia_),this.masterPlaylistLoader_.createMupOnMedia_=null),this.stopRequest(),A["default"].clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.isMaster_&&(A["default"].clearTimeout(this.masterPlaylistLoader_.minimumUpdatePeriodTimeout_),this.masterPlaylistLoader_.minimumUpdatePeriodTimeout_=null),"HAVE_NOTHING"===this.state&&(this.started=!1);},i.load=function(e){var t=this;A["default"].clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null;var i=this.media();if(e){var n=i?i.targetDuration/2*1e3:5e3;this.mediaUpdateTimeout=A["default"].setTimeout(function(){return t.load();},n);}else this.started?i&&!i.endList?(this.isMaster_&&!this.minimumUpdatePeriodTimeout_&&(this.trigger("minimumUpdatePeriod"),this.updateMinimumUpdatePeriodTimeout_()),this.trigger("mediaupdatetimeout")):this.trigger("loadedplaylist"):this.start();},i.start=function(){var e=this;this.started=!0,this.isMaster_?this.requestMaster_(function(t,i){e.haveMaster_(),e.hasPendingRequest()||e.media_||e.media(e.masterPlaylistLoader_.master.playlists[0]);}):this.mediaRequest_=A["default"].setTimeout(function(){return e.haveMaster_();},0);},i.requestMaster_=function(e){var t=this;this.request=this.vhs_.xhr({uri:this.masterPlaylistLoader_.srcUrl,withCredentials:this.withCredentials},function(i,n){if(!t.requestErrored_(i,n)){var r=n.responseText!==t.masterPlaylistLoader_.masterXml_;return t.masterPlaylistLoader_.masterXml_=n.responseText,n.responseHeaders&&n.responseHeaders.date?t.masterLoaded_=Date.parse(n.responseHeaders.date):t.masterLoaded_=Date.now(),t.masterPlaylistLoader_.srcUrl=Qr(t.handleManifestRedirects,t.masterPlaylistLoader_.srcUrl,n),r?(t.handleMaster_(),void t.syncClientServerClock_(function(){return e(n,r);})):e(n,r);}"HAVE_NOTHING"===t.state&&(t.started=!1);});},i.syncClientServerClock_=function(e){var t=this,i=y.parseUTCTiming(this.masterPlaylistLoader_.masterXml_);return null===i?(this.masterPlaylistLoader_.clientOffset_=this.masterLoaded_-Date.now(),e()):"DIRECT"===i.method?(this.masterPlaylistLoader_.clientOffset_=i.value-Date.now(),e()):void(this.request=this.vhs_.xhr({uri:Xr(this.masterPlaylistLoader_.srcUrl,i.value),method:i.method,withCredentials:this.withCredentials},function(n,r){if(t.request){if(n)return t.masterPlaylistLoader_.clientOffset_=t.masterLoaded_-Date.now(),e();var a;a="HEAD"===i.method?r.responseHeaders&&r.responseHeaders.date?Date.parse(r.responseHeaders.date):t.masterLoaded_:Date.parse(r.responseText),t.masterPlaylistLoader_.clientOffset_=a-Date.now(),e();}}));},i.haveMaster_=function(){this.state="HAVE_MASTER",this.isMaster_?this.trigger("loadedplaylist"):this.media_||this.media(this.childPlaylist_);},i.handleMaster_=function(){this.mediaRequest_=null;var e,t,i,n,r,a,s=(e={masterXml:this.masterPlaylistLoader_.masterXml_,srcUrl:this.masterPlaylistLoader_.srcUrl,clientOffset:this.masterPlaylistLoader_.clientOffset_,sidxMapping:this.masterPlaylistLoader_.sidxMapping_},t=e.masterXml,i=e.srcUrl,n=e.clientOffset,r=e.sidxMapping,a=y.parse(t,{manifestUri:i,clientOffset:n,sidxMapping:r}),Aa(a,i),a),o=this.masterPlaylistLoader_.master;o&&(s=function(e,t,i){for(var n=!0,r=Za(e,{duration:t.duration,minimumUpdatePeriod:t.minimumUpdatePeriod}),a=0;a-1);},this.trigger=function(t){var i,n,r,a;if(i=e[t])if(2===arguments.length)for(r=i.length,n=0;n>>1,e.samplingfrequencyindex<<7|e.channelcount<<3,6,1,2]));},m=function m(e){return t(S.hdlr,x[e]);},p=function p(e){var i=new Uint8Array([0,0,0,0,0,0,0,2,0,0,0,3,0,1,95,144,e.duration>>>24&255,e.duration>>>16&255,e.duration>>>8&255,255&e.duration,85,196,0,0]);return e.samplerate&&(i[12]=e.samplerate>>>24&255,i[13]=e.samplerate>>>16&255,i[14]=e.samplerate>>>8&255,i[15]=255&e.samplerate),t(S.mdhd,i);},f=function f(e){return t(S.mdia,p(e),m(e.type),s(e));},a=function a(e){return t(S.mfhd,new Uint8Array([0,0,0,0,(4278190080&e)>>24,(16711680&e)>>16,(65280&e)>>8,255&e]));},s=function s(e){return t(S.minf,"video"===e.type?t(S.vmhd,I):t(S.smhd,P),i(),_(e));},o=function o(e,i){for(var n=[],r=i.length;r--;){n[r]=v(i[r]);}return t.apply(null,[S.moof,a(e)].concat(n));},u=function u(e){for(var i=e.length,n=[];i--;){n[i]=h(e[i]);}return t.apply(null,[S.moov,d(4294967295)].concat(n).concat(l(e)));},l=function l(e){for(var i=e.length,n=[];i--;){n[i]=b(e[i]);}return t.apply(null,[S.mvex].concat(n));},d=function d(e){var i=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,2,0,1,95,144,(4278190080&e)>>24,(16711680&e)>>16,(65280&e)>>8,255&e,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 t(S.mvhd,i);},g=function g(e){var i,n,r=e.samples||[],a=new Uint8Array(4+r.length);for(n=0;n>>8),s.push(255&r[i].byteLength),s=s.concat(Array.prototype.slice.call(r[i]));}for(i=0;i>>8),o.push(255&a[i].byteLength),o=o.concat(Array.prototype.slice.call(a[i]));}if(n=[S.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&e.width)>>8,255&e.width,(65280&e.height)>>8,255&e.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]),t(S.avcC,new Uint8Array([1,e.profileIdc,e.profileCompatibility,e.levelIdc,255].concat([r.length],s,[a.length],o))),t(S.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192]))],e.sarRatio){var u=e.sarRatio[0],l=e.sarRatio[1];n.push(t(S.pasp,new Uint8Array([(4278190080&u)>>24,(16711680&u)>>16,(65280&u)>>8,255&u,(4278190080&l)>>24,(16711680&l)>>16,(65280&l)>>8,255&l])));}return t.apply(null,n);},F=function F(e){return t(S.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,(65280&e.channelcount)>>8,255&e.channelcount,(65280&e.samplesize)>>8,255&e.samplesize,0,0,0,0,(65280&e.samplerate)>>8,255&e.samplerate,0,0]),n(e));},c=function c(e){var i=new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,(4278190080&e.id)>>24,(16711680&e.id)>>16,(65280&e.id)>>8,255&e.id,0,0,0,0,(4278190080&e.duration)>>24,(16711680&e.duration)>>16,(65280&e.duration)>>8,255&e.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&e.width)>>8,255&e.width,0,0,(65280&e.height)>>8,255&e.height,0,0]);return t(S.tkhd,i);},v=function v(e){var i,n,r,a,s,o;return i=t(S.tfhd,new Uint8Array([0,0,0,58,(4278190080&e.id)>>24,(16711680&e.id)>>16,(65280&e.id)>>8,255&e.id,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0])),s=Math.floor(e.baseMediaDecodeTime/(H+1)),o=Math.floor(e.baseMediaDecodeTime%(H+1)),n=t(S.tfdt,new Uint8Array([1,0,0,0,s>>>24&255,s>>>16&255,s>>>8&255,255&s,o>>>24&255,o>>>16&255,o>>>8&255,255&o])),92,"audio"===e.type?(r=T(e,92),t(S.traf,i,n,r)):(a=g(e),r=T(e,a.length+92),t(S.traf,i,n,r,a));},h=function h(e){return e.duration=e.duration||4294967295,t(S.trak,c(e),f(e));},b=function b(e){var i=new Uint8Array([0,0,0,0,(4278190080&e.id)>>24,(16711680&e.id)>>16,(65280&e.id)>>8,255&e.id,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return"video"!==e.type&&(i[i.length-1]=0),t(S.trex,i);},j=function j(e,t){var i=0,n=0,r=0,a=0;return e.length&&(void 0!==e[0].duration&&(i=1),void 0!==e[0].size&&(n=2),void 0!==e[0].flags&&(r=4),void 0!==e[0].compositionTimeOffset&&(a=8)),[0,0,i|n|r|a,1,(4278190080&e.length)>>>24,(16711680&e.length)>>>16,(65280&e.length)>>>8,255&e.length,(4278190080&t)>>>24,(16711680&t)>>>16,(65280&t)>>>8,255&t];},N=function N(e,i){var n,r,a,s,o,u;for(i+=20+16*(s=e.samples||[]).length,a=j(s,i),(r=new Uint8Array(a.length+16*s.length)).set(a),n=a.length,u=0;u>>24,r[n++]=(16711680&o.duration)>>>16,r[n++]=(65280&o.duration)>>>8,r[n++]=255&o.duration,r[n++]=(4278190080&o.size)>>>24,r[n++]=(16711680&o.size)>>>16,r[n++]=(65280&o.size)>>>8,r[n++]=255&o.size,r[n++]=o.flags.isLeading<<2|o.flags.dependsOn,r[n++]=o.flags.isDependedOn<<6|o.flags.hasRedundancy<<4|o.flags.paddingValue<<1|o.flags.isNonSyncSample,r[n++]=61440&o.flags.degradationPriority,r[n++]=15&o.flags.degradationPriority,r[n++]=(4278190080&o.compositionTimeOffset)>>>24,r[n++]=(16711680&o.compositionTimeOffset)>>>16,r[n++]=(65280&o.compositionTimeOffset)>>>8,r[n++]=255&o.compositionTimeOffset;}return t(S.trun,r);},B=function B(e,i){var n,r,a,s,o,u;for(i+=20+8*(s=e.samples||[]).length,a=j(s,i),(n=new Uint8Array(a.length+8*s.length)).set(a),r=a.length,u=0;u>>24,n[r++]=(16711680&o.duration)>>>16,n[r++]=(65280&o.duration)>>>8,n[r++]=255&o.duration,n[r++]=(4278190080&o.size)>>>24,n[r++]=(16711680&o.size)>>>16,n[r++]=(65280&o.size)>>>8,n[r++]=255&o.size;}return t(S.trun,n);},T=function T(e,t){return"audio"===e.type?B(e,t):N(e,t);};r=function r(){return t(S.ftyp,E,w,E,C);};var z,G,W,Y,q,K,X,Q,$=function $(e){return t(S.mdat,e);},J=o,Z=function Z(e){var t,i=r(),n=u(e);return(t=new Uint8Array(i.byteLength+n.byteLength)).set(i),t.set(n,i.byteLength),t;},ee=function ee(e,t){var i={size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0,isNonSyncSample:1}};return i.dataOffset=t,i.compositionTimeOffset=e.pts-e.dts,i.duration=e.duration,i.size=4*e.length,i.size+=e.byteLength,e.keyFrame&&(i.flags.dependsOn=2,i.flags.isNonSyncSample=0),i;},te=function te(e){var t,i,n=[],r=[];for(r.byteLength=0,r.nalCount=0,r.duration=0,n.byteLength=0,t=0;t1&&(t=e.shift(),e.byteLength-=t.byteLength,e.nalCount-=t.nalCount,e[0][0].dts=t.dts,e[0][0].pts=t.pts,e[0][0].duration+=t.duration),e;},re=function re(e,t){var i,n,r,a,s,o=t||0,u=[];for(i=0;ide/2))){for((s=le()[e.samplerate])||(s=t[0].data),o=0;o=i?e:(t.minSegmentDts=1/0,e.filter(function(e){return e.dts>=i&&(t.minSegmentDts=Math.min(t.minSegmentDts,e.dts),t.minSegmentPts=t.minSegmentDts,!0);}));},ye=function ye(e){var t,i,n=[];for(t=0;t=this.virtualRowCount&&"function"==typeof this.beforeRowOverflow&&this.beforeRowOverflow(e),this.rows.length>0&&(this.rows.push(""),this.rowIdx++);this.rows.length>this.virtualRowCount;){this.rows.shift(),this.rowIdx--;}},De.prototype.isEmpty=function(){return 0===this.rows.length||1===this.rows.length&&""===this.rows[0];},De.prototype.addText=function(e){this.rows[this.rowIdx]+=e;},De.prototype.backspace=function(){if(!this.isEmpty()){var e=this.rows[this.rowIdx];this.rows[this.rowIdx]=e.substr(0,e.length-1);}};var Ue=function Ue(e){this.serviceNum=e,this.text="",this.currentWindow=new De(-1),this.windows=[];};Ue.prototype.init=function(e,t){this.startPts=e;for(var i=0;i<8;i++){this.windows[i]=new De(i),"function"==typeof t&&(this.windows[i].beforeRowOverflow=t);}},Ue.prototype.setCurrentWindow=function(e){this.currentWindow=this.windows[e];};var Re=function e(){e.prototype.init.call(this);var t=this;this.current708Packet=null,this.services={},this.push=function(e){3===e.type?(t.new708Packet(),t.add708Bytes(e)):(null===t.current708Packet&&t.new708Packet(),t.add708Bytes(e));};};Re.prototype=new V(),Re.prototype.new708Packet=function(){null!==this.current708Packet&&this.push708Packet(),this.current708Packet={data:[],ptsVals:[]};},Re.prototype.add708Bytes=function(e){var t=e.ccData,i=t>>>8,n=255&t;this.current708Packet.ptsVals.push(e.pts),this.current708Packet.data.push(i),this.current708Packet.data.push(n);},Re.prototype.push708Packet=function(){var e=this.current708Packet,t=e.data,i=null,n=null,r=0,a=t[r++];for(e.seq=a>>6,e.sizeCode=63&a;r>5)&&n>0&&(i=a=t[r++]),this.pushServiceBlock(i,r,n),n>0&&(r+=n-1);}},Re.prototype.pushServiceBlock=function(e,t,i){var n,r=t,a=this.current708Packet.data,s=this.services[e];for(s||(s=this.initService(e,r));r>5,a.rowLock=(16&n)>>4,a.columnLock=(8&n)>>3,a.priority=7&n,n=i[++e],a.relativePositioning=(128&n)>>7,a.anchorVertical=127&n,n=i[++e],a.anchorHorizontal=n,n=i[++e],a.anchorPoint=(240&n)>>4,a.rowCount=15&n,n=i[++e],a.columnCount=63&n,n=i[++e],a.windowStyle=(56&n)>>3,a.penStyle=7&n,a.virtualRowCount=a.rowCount+1,e;},Re.prototype.setWindowAttributes=function(e,t){var i=this.current708Packet.data,n=i[e],r=t.currentWindow.winAttr;return n=i[++e],r.fillOpacity=(192&n)>>6,r.fillRed=(48&n)>>4,r.fillGreen=(12&n)>>2,r.fillBlue=3&n,n=i[++e],r.borderType=(192&n)>>6,r.borderRed=(48&n)>>4,r.borderGreen=(12&n)>>2,r.borderBlue=3&n,n=i[++e],r.borderType+=(128&n)>>5,r.wordWrap=(64&n)>>6,r.printDirection=(48&n)>>4,r.scrollDirection=(12&n)>>2,r.justify=3&n,n=i[++e],r.effectSpeed=(240&n)>>4,r.effectDirection=(12&n)>>2,r.displayEffect=3&n,e;},Re.prototype.flushDisplayed=function(e,t){for(var i=[],n=0;n<8;n++){t.windows[n].visible&&!t.windows[n].isEmpty()&&i.push(t.windows[n].getText());}t.endPts=e,t.text=i.join("\n\n"),this.pushCaption(t),t.startPts=e;},Re.prototype.pushCaption=function(e){""!==e.text&&(this.trigger("data",{startPts:e.startPts,endPts:e.endPts,text:e.text,stream:"cc708_"+e.serviceNum}),e.text="",e.startPts=e.endPts);},Re.prototype.displayWindows=function(e,t){var i=this.current708Packet.data[++e],n=this.getPts(e);this.flushDisplayed(n,t);for(var r=0;r<8;r++){i&1<>4,r.offset=(12&n)>>2,r.penSize=3&n,n=i[++e],r.italics=(128&n)>>7,r.underline=(64&n)>>6,r.edgeType=(56&n)>>3,r.fontStyle=7&n,e;},Re.prototype.setPenColor=function(e,t){var i=this.current708Packet.data,n=i[e],r=t.currentWindow.penColor;return n=i[++e],r.fgOpacity=(192&n)>>6,r.fgRed=(48&n)>>4,r.fgGreen=(12&n)>>2,r.fgBlue=3&n,n=i[++e],r.bgOpacity=(192&n)>>6,r.bgRed=(48&n)>>4,r.bgGreen=(12&n)>>2,r.bgBlue=3&n,n=i[++e],r.edgeRed=(48&n)>>4,r.edgeGreen=(12&n)>>2,r.edgeBlue=3&n,e;},Re.prototype.setPenLocation=function(e,t){var i=this.current708Packet.data,n=i[e],r=t.currentWindow.penLoc;return t.currentWindow.pendingNewLine=!0,n=i[++e],r.row=15&n,n=i[++e],r.column=63&n,e;},Re.prototype.reset=function(e,t){var i=this.getPts(e);return this.flushDisplayed(i,t),this.initService(t.serviceNum,e);};var Oe={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,304:174,305:176,306:189,307:191,308:8482,309:162,310:163,311:9834,312:224,313:160,314:232,315:226,316:234,317:238,318:244,319:251,544:193,545:201,546:211,547:218,548:220,549:252,550:8216,551:161,552:42,553:39,554:8212,555:169,556:8480,557:8226,558:8220,559:8221,560:192,561:194,562:199,563:200,564:202,565:203,566:235,567:206,568:207,569:239,570:212,571:217,572:249,573:219,574:171,575:187,800:195,801:227,802:205,803:204,804:236,805:210,806:242,807:213,808:245,809:123,810:125,811:92,812:94,813:95,814:124,815:126,816:196,817:228,818:214,819:246,820:223,821:165,822:164,823:9474,824:197,825:229,826:216,827:248,828:9484,829:9488,830:9492,831:9496},Me=function Me(e){return null===e?"":(e=Oe[e]||e,String.fromCharCode(e));},Fe=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],Be=function Be(){for(var e=[],t=15;t--;){e.push("");}return e;},Ne=function e(t,i){e.prototype.init.call(this),this.field_=t||0,this.dataChannel_=i||0,this.name_="CC"+(1+(this.field_<<1|this.dataChannel_)),this.setConstants(),this.reset(),this.push=function(e){var t,i,n,r,a;if((t=32639&e.ccData)!==this.lastControlCode_){if(4096==(61440&t)?this.lastControlCode_=t:t!==this.PADDING_&&(this.lastControlCode_=null),n=t>>>8,r=255&t,t!==this.PADDING_)if(t===this.RESUME_CAPTION_LOADING_)this.mode_="popOn";else if(t===this.END_OF_CAPTION_)this.mode_="popOn",this.clearFormatting(e.pts),this.flushDisplayed(e.pts),i=this.displayed_,this.displayed_=this.nonDisplayed_,this.nonDisplayed_=i,this.startPts_=e.pts;else if(t===this.ROLL_UP_2_ROWS_)this.rollUpRows_=2,this.setRollUp(e.pts);else if(t===this.ROLL_UP_3_ROWS_)this.rollUpRows_=3,this.setRollUp(e.pts);else if(t===this.ROLL_UP_4_ROWS_)this.rollUpRows_=4,this.setRollUp(e.pts);else if(t===this.CARRIAGE_RETURN_)this.clearFormatting(e.pts),this.flushDisplayed(e.pts),this.shiftRowsUp_(),this.startPts_=e.pts;else if(t===this.BACKSPACE_)"popOn"===this.mode_?this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1):this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1);else if(t===this.ERASE_DISPLAYED_MEMORY_)this.flushDisplayed(e.pts),this.displayed_=Be();else if(t===this.ERASE_NON_DISPLAYED_MEMORY_)this.nonDisplayed_=Be();else if(t===this.RESUME_DIRECT_CAPTIONING_)"paintOn"!==this.mode_&&(this.flushDisplayed(e.pts),this.displayed_=Be()),this.mode_="paintOn",this.startPts_=e.pts;else if(this.isSpecialCharacter(n,r))a=Me((n=(3&n)<<8)|r),this[this.mode_](e.pts,a),this.column_++;else if(this.isExtCharacter(n,r))"popOn"===this.mode_?this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1):this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1),a=Me((n=(3&n)<<8)|r),this[this.mode_](e.pts,a),this.column_++;else if(this.isMidRowCode(n,r))this.clearFormatting(e.pts),this[this.mode_](e.pts," "),this.column_++,14==(14&r)&&this.addFormatting(e.pts,["i"]),1==(1&r)&&this.addFormatting(e.pts,["u"]);else if(this.isOffsetControlCode(n,r))this.column_+=3&r;else if(this.isPAC(n,r)){var s=Fe.indexOf(7968&t);"rollUp"===this.mode_&&(s-this.rollUpRows_+1<0&&(s=this.rollUpRows_-1),this.setRollUp(e.pts,s)),s!==this.row_&&(this.clearFormatting(e.pts),this.row_=s),1&r&&-1===this.formatting_.indexOf("u")&&this.addFormatting(e.pts,["u"]),16==(16&t)&&(this.column_=4*((14&t)>>1)),this.isColorPAC(r)&&14==(14&r)&&this.addFormatting(e.pts,["i"]);}else this.isNormalChar(n)&&(0===r&&(r=null),a=Me(n),a+=Me(r),this[this.mode_](e.pts,a),this.column_+=a.length);}else this.lastControlCode_=null;};};Ne.prototype=new V(),Ne.prototype.flushDisplayed=function(e){var t=this.displayed_.map(function(e,t){try{return e.trim();}catch(e){return this.trigger("log",{level:"warn",message:"Skipping a malformed 608 caption at index "+t+"."}),"";}},this).join("\n").replace(/^\n+|\n+$/g,"");t.length&&this.trigger("data",{startPts:this.startPts_,endPts:e,text:t,stream:this.name_});},Ne.prototype.reset=function(){this.mode_="popOn",this.topRow_=0,this.startPts_=0,this.displayed_=Be(),this.nonDisplayed_=Be(),this.lastControlCode_=null,this.column_=0,this.row_=14,this.rollUpRows_=2,this.formatting_=[];},Ne.prototype.setConstants=function(){0===this.dataChannel_?(this.BASE_=16,this.EXT_=17,this.CONTROL_=(20|this.field_)<<8,this.OFFSET_=23):1===this.dataChannel_&&(this.BASE_=24,this.EXT_=25,this.CONTROL_=(28|this.field_)<<8,this.OFFSET_=31),this.PADDING_=0,this.RESUME_CAPTION_LOADING_=32|this.CONTROL_,this.END_OF_CAPTION_=47|this.CONTROL_,this.ROLL_UP_2_ROWS_=37|this.CONTROL_,this.ROLL_UP_3_ROWS_=38|this.CONTROL_,this.ROLL_UP_4_ROWS_=39|this.CONTROL_,this.CARRIAGE_RETURN_=45|this.CONTROL_,this.RESUME_DIRECT_CAPTIONING_=41|this.CONTROL_,this.BACKSPACE_=33|this.CONTROL_,this.ERASE_DISPLAYED_MEMORY_=44|this.CONTROL_,this.ERASE_NON_DISPLAYED_MEMORY_=46|this.CONTROL_;},Ne.prototype.isSpecialCharacter=function(e,t){return e===this.EXT_&&t>=48&&t<=63;},Ne.prototype.isExtCharacter=function(e,t){return(e===this.EXT_+1||e===this.EXT_+2)&&t>=32&&t<=63;},Ne.prototype.isMidRowCode=function(e,t){return e===this.EXT_&&t>=32&&t<=47;},Ne.prototype.isOffsetControlCode=function(e,t){return e===this.OFFSET_&&t>=33&&t<=35;},Ne.prototype.isPAC=function(e,t){return e>=this.BASE_&&e=64&&t<=127;},Ne.prototype.isColorPAC=function(e){return e>=64&&e<=79||e>=96&&e<=127;},Ne.prototype.isNormalChar=function(e){return e>=32&&e<=127;},Ne.prototype.setRollUp=function(e,t){if("rollUp"!==this.mode_&&(this.row_=14,this.mode_="rollUp",this.flushDisplayed(e),this.nonDisplayed_=Be(),this.displayed_=Be()),void 0!==t&&t!==this.row_)for(var i=0;i";},"");this[this.mode_](e,i);},Ne.prototype.clearFormatting=function(e){if(this.formatting_.length){var t=this.formatting_.reverse().reduce(function(e,t){return e+"";},"");this.formatting_=[],this[this.mode_](e,t);}},Ne.prototype.popOn=function(e,t){var i=this.nonDisplayed_[this.row_];i+=t,this.nonDisplayed_[this.row_]=i;},Ne.prototype.rollUp=function(e,t){var i=this.displayed_[this.row_];i+=t,this.displayed_[this.row_]=i;},Ne.prototype.shiftRowsUp_=function(){var e;for(e=0;et&&(i=-1);Math.abs(t-e)>4294967296;){e+=8589934592*i;}return e;},ze=function e(t){var i,n;e.prototype.init.call(this),this.type_=t||"shared",this.push=function(e){"shared"!==this.type_&&e.type!==this.type_||(void 0===n&&(n=e.dts),e.dts=He(e.dts,n),e.pts=He(e.pts,n),i=e.dts,this.trigger("data",e));},this.flush=function(){n=i,this.trigger("done");},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline");},this.discontinuity=function(){n=void 0,i=void 0;},this.reset=function(){this.discontinuity(),this.trigger("reset");};};ze.prototype=new V();var _Ge,We=ze,Ye=He,qe=function qe(e,t,i){var n,r="";for(n=t;n>>2;d*=4,d+=3&l[7],o.timeStamp=d,void 0===t.pts&&void 0===t.dts&&(t.pts=o.timeStamp,t.dts=o.timeStamp),this.trigger("timestamp",o);}t.frames.push(o),i+=10,i+=s;}while(i>>4>1&&(n+=t[n]+1),0===i.pid)i.type="pat",e(t.subarray(n),i),this.trigger("data",i);else if(i.pid===this.pmtPid)for(i.type="pmt",e(t.subarray(n),i),this.trigger("data",i);this.packetsWaitingForPmt.length;){this.processPes_.apply(this,this.packetsWaitingForPmt.shift());}else void 0===this.programMapTable?this.packetsWaitingForPmt.push([t,n,i]):this.processPes_(t,n,i);},this.processPes_=function(e,t,i){i.pid===this.programMapTable.video?i.streamType=Ve.H264_STREAM_TYPE:i.pid===this.programMapTable.audio?i.streamType=Ve.ADTS_STREAM_TYPE:i.streamType=this.programMapTable["timed-metadata"][i.pid],i.type="pes",i.data=e.subarray(t),this.trigger("data",i);};}).prototype=new V(),_Je.STREAM_TYPES={h264:27,adts:15},(_Ze=function Ze(){var e,t=this,i=!1,n={data:[],size:0},r={data:[],size:0},a={data:[],size:0},s=function s(e,i,n){var r,a,s=new Uint8Array(e.size),o={type:i},u=0,l=0;if(e.data.length&&!(e.size<9)){for(o.trackId=e.data[0].pid,u=0;u>>3,h.pts*=4,h.pts+=(6&d[13])>>>1,h.dts=h.pts,64&c&&(h.dts=(14&d[14])<<27|(255&d[15])<<20|(254&d[16])<<12|(255&d[17])<<5|(254&d[18])>>>3,h.dts*=4,h.dts+=(6&d[18])>>>1)),h.data=d.subarray(9+d[8])),r="video"===i||o.packetLength<=e.size,(n||r)&&(e.size=0,e.data.length=0),r&&t.trigger("data",o);}};_Ze.prototype.init.call(this),this.push=function(o){({pat:function pat(){},pes:function pes(){var e,t;switch(o.streamType){case Ve.H264_STREAM_TYPE:e=n,t="video";break;case Ve.ADTS_STREAM_TYPE:e=r,t="audio";break;case Ve.METADATA_STREAM_TYPE:e=a,t="timed-metadata";break;default:return;}o.payloadUnitStartIndicator&&s(e,t,!0),e.data.push(o),e.size+=o.data.byteLength;},pmt:function pmt(){var n={type:"metadata",tracks:[]};null!==(e=o.programMapTable).video&&n.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+e.video,codec:"avc",type:"video"}),null!==e.audio&&n.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+e.audio,codec:"adts",type:"audio"}),i=!0,t.trigger("data",n);}})[o.type]();},this.reset=function(){n.size=0,n.data.length=0,r.size=0,r.data.length=0,this.trigger("reset");},this.flushStreams_=function(){s(n,"video"),s(r,"audio"),s(a,"timed-metadata");},this.flush=function(){if(!i&&e){var n={type:"metadata",tracks:[]};null!==e.video&&n.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+e.video,codec:"avc",type:"video"}),null!==e.audio&&n.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+e.audio,codec:"adts",type:"audio"}),t.trigger("data",n);}i=!1,this.flushStreams_(),this.trigger("done");};}).prototype=new V();var it={PAT_PID:0,MP2T_PACKET_LENGTH:188,TransportPacketStream:_$e,TransportParseStream:_Je,ElementaryStream:_Ze,TimestampRolloverStream:tt,CaptionStream:je.CaptionStream,Cea608Stream:je.Cea608Stream,Cea708Stream:je.Cea708Stream,MetadataStream:et};for(var nt in Ve){Ve.hasOwnProperty(nt)&&(it[nt]=Ve[nt]);}var _rt,at=it,st=de,ot=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];(_rt=function rt(e){var t,i=0;_rt.prototype.init.call(this),this.skipWarn_=function(e,t){this.trigger("log",{level:"warn",message:"adts skiping bytes "+e+" to "+t+" in frame "+i+" outside syncword"});},this.push=function(n){var r,a,s,o,u,l=0;if(e||(i=0),"audio"===n.type){var d;for(t&&t.length?(s=t,(t=new Uint8Array(s.byteLength+n.data.byteLength)).set(s),t.set(n.data,s.byteLength)):t=n.data;l+7>5,u=(o=1024*(1+(3&t[l+6])))*st/ot[(60&t[l+2])>>>2],t.byteLength-l>>6&3),channelcount:(1&t[l+2])<<2|(192&t[l+3])>>>6,samplerate:ot[(60&t[l+2])>>>2],samplingfrequencyindex:(60&t[l+2])>>>2,samplesize:16,data:t.subarray(l+7+a,l+r)}),i++,l+=r;}else"number"!=typeof d&&(d=l),l++;}"number"==typeof d&&(this.skipWarn_(d,l),d=null),t=t.subarray(l);}},this.flush=function(){i=0,this.trigger("done");},this.reset=function(){t=void 0,this.trigger("reset");},this.endTimeline=function(){t=void 0,this.trigger("endedtimeline");};}).prototype=new V();var _ut,_lt,dt,ht=_rt,ct=function ct(e){var t=e.byteLength,i=0,n=0;this.length=function(){return 8*t;},this.bitsAvailable=function(){return 8*t+n;},this.loadWord=function(){var r=e.byteLength-t,a=new Uint8Array(4),s=Math.min(4,t);if(0===s)throw new Error("no bytes available");a.set(e.subarray(r,r+s)),i=new DataView(a.buffer).getUint32(0),n=8*s,t-=s;},this.skipBits=function(e){var r;n>e?(i<<=e,n-=e):(e-=n,e-=8*(r=Math.floor(e/8)),t-=r,this.loadWord(),i<<=e,n-=e);},this.readBits=function(e){var r=Math.min(n,e),a=i>>>32-r;return(n-=r)>0?i<<=r:t>0&&this.loadWord(),(r=e-r)>0?a<>>e))return i<<=e,n-=e,e;}return this.loadWord(),e+this.skipLeadingZeros();},this.skipUnsignedExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros());},this.skipExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros());},this.readUnsignedExpGolomb=function(){var e=this.skipLeadingZeros();return this.readBits(e+1)-1;},this.readExpGolomb=function(){var e=this.readUnsignedExpGolomb();return 1&e?1+e>>>1:-1*(e>>>1);},this.readBoolean=function(){return 1===this.readBits(1);},this.readUnsignedByte=function(){return this.readBits(8);},this.loadWord();};(_lt=function lt(){var e,t,i=0;_lt.prototype.init.call(this),this.push=function(n){var r;t?((r=new Uint8Array(t.byteLength+n.data.byteLength)).set(t),r.set(n.data,t.byteLength),t=r):t=n.data;for(var a=t.byteLength;i3&&this.trigger("data",t.subarray(i+3)),t=null,i=0,this.trigger("done");},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline");};}).prototype=new V(),dt={100:!0,110:!0,122:!0,244:!0,44:!0,83:!0,86:!0,118:!0,128:!0,138:!0,139:!0,134:!0},(_ut=function ut(){var e,t,i,n,r,a,s,o=new _lt();_ut.prototype.init.call(this),e=this,this.push=function(e){"video"===e.type&&(t=e.trackId,i=e.pts,n=e.dts,o.push(e));},o.on("data",function(s){var o={trackId:t,pts:i,dts:n,data:s,nalUnitTypeCode:31&s[0]};switch(o.nalUnitTypeCode){case 5:o.nalUnitType="slice_layer_without_partitioning_rbsp_idr";break;case 6:o.nalUnitType="sei_rbsp",o.escapedRBSP=r(s.subarray(1));break;case 7:o.nalUnitType="seq_parameter_set_rbsp",o.escapedRBSP=r(s.subarray(1)),o.config=a(o.escapedRBSP);break;case 8:o.nalUnitType="pic_parameter_set_rbsp";break;case 9:o.nalUnitType="access_unit_delimiter_rbsp";}e.trigger("data",o);}),o.on("done",function(){e.trigger("done");}),o.on("partialdone",function(){e.trigger("partialdone");}),o.on("reset",function(){e.trigger("reset");}),o.on("endedtimeline",function(){e.trigger("endedtimeline");}),this.flush=function(){o.flush();},this.partialFlush=function(){o.partialFlush();},this.reset=function(){o.reset();},this.endTimeline=function(){o.endTimeline();},s=function s(e,t){var i,n=8,r=8;for(i=0;i=0?i:0,(16&e[t+5])>>4?i+20:i+10;},_t=function _t(e){return e[0]<<21|e[1]<<14|e[2]<<7|e[3];},yt={isLikelyAacData:function isLikelyAacData(e){var t=function e(t,i){return t.length-i<10||t[i]!=="I".charCodeAt(0)||t[i+1]!=="D".charCodeAt(0)||t[i+2]!=="3".charCodeAt(0)?i:e(t,i+=gt(t,i));}(e,0);return e.length>=t+2&&255==(255&e[t])&&240==(240&e[t+1])&&16==(22&e[t+1]);},parseId3TagSize:gt,parseAdtsSize:function parseAdtsSize(e,t){var i=(224&e[t+5])>>5,n=e[t+4]<<3;return 6144&e[t+3]|n|i;},parseType:function parseType(e,t){return e[t]==="I".charCodeAt(0)&&e[t+1]==="D".charCodeAt(0)&&e[t+2]==="3".charCodeAt(0)?"timed-metadata":!0&e[t]&&240==(240&e[t+1])?"audio":null;},parseSampleRate:function parseSampleRate(e){for(var t=0;t+5>>2];t++;}return null;},parseAacTimestamp:function parseAacTimestamp(e){var t,i,n;t=10,64&e[5]&&(t+=4,t+=_t(e.subarray(10,14)));do{if((i=_t(e.subarray(t+4,t+8)))<1)return null;if("PRIV"===String.fromCharCode(e[t],e[t+1],e[t+2],e[t+3])){n=e.subarray(t+10,t+i+10);for(var r=0;r>>2;return s*=4,s+=3&a[7];}break;}}}t+=10,t+=i;}while(t=3;){if(e[u]!=="I".charCodeAt(0)||e[u+1]!=="D".charCodeAt(0)||e[u+2]!=="3".charCodeAt(0)){if(255!=(255&e[u])||240!=(240&e[u+1]))u++;else{if(e.length-u<7)break;if(u+(o=yt.parseAdtsSize(e,u))>e.length)break;a={type:"audio",data:e.subarray(u,u+o),pts:t,dts:t},this.trigger("data",a),u+=o;}}else{if(e.length-u<10)break;if(u+(o=yt.parseId3TagSize(e,u))>e.length)break;r={type:"timed-metadata",data:e.subarray(u,u+o)},this.trigger("data",r),u+=o;}}n=e.length-u,e=n>0?e.subarray(u):new Uint8Array();},this.reset=function(){e=new Uint8Array(),this.trigger("reset");},this.endTimeline=function(){e=new Uint8Array(),this.trigger("endedtimeline");};}).prototype=new V();var _vt,_bt,_Tt,_St,Et=_ft,wt=["audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize"],Ct=["width","height","profileIdc","levelIdc","profileCompatibility","sarRatio"],At=pt.H264Stream,kt=yt.isLikelyAacData,xt=de,It=function It(e,t){var i;if(e.length!==t.length)return!1;for(i=0;i=-1e4&&i<=45e3&&(!n||o>i)&&(n=a,o=i));}return n?n.gop:null;},this.alignGopsAtStart_=function(e){var t,i,n,r,a,o,u,l;for(a=e.byteLength,o=e.nalCount,u=e.duration,t=i=0;tn.pts?t++:(i++,a-=r.byteLength,o-=r.nalCount,u-=r.duration);}return 0===i?e:i===e.length?null:((l=e.slice(i)).byteLength=a,l.duration=u,l.nalCount=o,l.pts=l[0].pts,l.dts=l[0].dts,l);},this.alignGopsAtEnd_=function(e){var t,i,n,r,a,o,u;for(t=s.length-1,i=e.length-1,a=null,o=!1;t>=0&&i>=0;){if(n=s[t],r=e[i],n.pts===r.pts){o=!0;break;}n.pts>r.pts?t--:(t===s.length-1&&(a=i),i--);}if(!o&&null===a)return null;if(0===(u=o?i:a))return e;var l=e.slice(u),d=l.reduce(function(e,t){return e.byteLength+=t.byteLength,e.duration+=t.duration,e.nalCount+=t.nalCount,e;},{byteLength:0,duration:0,nalCount:0});return l.byteLength=d.byteLength,l.duration=d.duration,l.nalCount=d.nalCount,l.pts=l[0].pts,l.dts=l[0].dts,l;},this.alignGopsWith=function(e){s=e;};}).prototype=new V(),(_St=function St(e,t){this.numberOfTracks=0,this.metadataStream=t,void 0!==(e=e||{}).remux?this.remuxTracks=!!e.remux:this.remuxTracks=!0,"boolean"==typeof e.keepOriginalTimestamps?this.keepOriginalTimestamps=e.keepOriginalTimestamps:this.keepOriginalTimestamps=!1,this.pendingTracks=[],this.videoTrack=null,this.pendingBoxes=[],this.pendingCaptions=[],this.pendingMetadata=[],this.pendingBytes=0,this.emittedTracks=0,_St.prototype.init.call(this),this.push=function(e){return e.text?this.pendingCaptions.push(e):e.frames?this.pendingMetadata.push(e):(this.pendingTracks.push(e.track),this.pendingBytes+=e.boxes.byteLength,"video"===e.track.type&&(this.videoTrack=e.track,this.pendingBoxes.push(e.boxes)),void("audio"===e.track.type&&(this.audioTrack=e.track,this.pendingBoxes.unshift(e.boxes))));};}).prototype=new V(),_St.prototype.flush=function(e){var t,i,n,r,a=0,s={captions:[],captionStreams:{},metadata:[],info:{}},o=0;if(this.pendingTracks.length=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0));}if(this.videoTrack?(o=this.videoTrack.timelineStartInfo.pts,Ct.forEach(function(e){s.info[e]=this.videoTrack[e];},this)):this.audioTrack&&(o=this.audioTrack.timelineStartInfo.pts,wt.forEach(function(e){s.info[e]=this.audioTrack[e];},this)),this.videoTrack||this.audioTrack){for(1===this.pendingTracks.length?s.type=this.pendingTracks[0].type:s.type="combined",this.emittedTracks+=this.pendingTracks.length,n=Z(this.pendingTracks),s.initSegment=new Uint8Array(n.byteLength),s.initSegment.set(n),s.data=new Uint8Array(this.pendingBytes),r=0;r=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0);},_St.prototype.setRemux=function(e){this.remuxTracks=e;},(_Tt=function Tt(e){var t,i,n=this,r=!0;_Tt.prototype.init.call(this),e=e||{},this.baseMediaDecodeTime=e.baseMediaDecodeTime||0,this.transmuxPipeline_={},this.setupAacPipeline=function(){var r={};this.transmuxPipeline_=r,r.type="aac",r.metadataStream=new at.MetadataStream(),r.aacStream=new Et(),r.audioTimestampRolloverStream=new at.TimestampRolloverStream("audio"),r.timedMetadataTimestampRolloverStream=new at.TimestampRolloverStream("timed-metadata"),r.adtsStream=new ht(),r.coalesceStream=new _St(e,r.metadataStream),r.headOfPipeline=r.aacStream,r.aacStream.pipe(r.audioTimestampRolloverStream).pipe(r.adtsStream),r.aacStream.pipe(r.timedMetadataTimestampRolloverStream).pipe(r.metadataStream).pipe(r.coalesceStream),r.metadataStream.on("timestamp",function(e){r.aacStream.setTimestamp(e.timeStamp);}),r.aacStream.on("data",function(a){"timed-metadata"!==a.type&&"audio"!==a.type||r.audioSegmentStream||(i=i||{timelineStartInfo:{baseMediaDecodeTime:n.baseMediaDecodeTime},codec:"adts",type:"audio"},r.coalesceStream.numberOfTracks++,r.audioSegmentStream=new _bt(i,e),r.audioSegmentStream.on("log",n.getLogTrigger_("audioSegmentStream")),r.audioSegmentStream.on("timingInfo",n.trigger.bind(n,"audioTimingInfo")),r.adtsStream.pipe(r.audioSegmentStream).pipe(r.coalesceStream),n.trigger("trackinfo",{hasAudio:!!i,hasVideo:!!t}));}),r.coalesceStream.on("data",this.trigger.bind(this,"data")),r.coalesceStream.on("done",this.trigger.bind(this,"done"));},this.setupTsPipeline=function(){var r={};this.transmuxPipeline_=r,r.type="ts",r.metadataStream=new at.MetadataStream(),r.packetStream=new at.TransportPacketStream(),r.parseStream=new at.TransportParseStream(),r.elementaryStream=new at.ElementaryStream(),r.timestampRolloverStream=new at.TimestampRolloverStream(),r.adtsStream=new ht(),r.h264Stream=new At(),r.captionStream=new at.CaptionStream(e),r.coalesceStream=new _St(e,r.metadataStream),r.headOfPipeline=r.packetStream,r.packetStream.pipe(r.parseStream).pipe(r.elementaryStream).pipe(r.timestampRolloverStream),r.timestampRolloverStream.pipe(r.h264Stream),r.timestampRolloverStream.pipe(r.adtsStream),r.timestampRolloverStream.pipe(r.metadataStream).pipe(r.coalesceStream),r.h264Stream.pipe(r.captionStream).pipe(r.coalesceStream),r.elementaryStream.on("data",function(a){var s;if("metadata"===a.type){for(s=a.tracks.length;s--;){t||"video"!==a.tracks[s].type?i||"audio"!==a.tracks[s].type||((i=a.tracks[s]).timelineStartInfo.baseMediaDecodeTime=n.baseMediaDecodeTime):(t=a.tracks[s]).timelineStartInfo.baseMediaDecodeTime=n.baseMediaDecodeTime;}t&&!r.videoSegmentStream&&(r.coalesceStream.numberOfTracks++,r.videoSegmentStream=new _vt(t,e),r.videoSegmentStream.on("log",n.getLogTrigger_("videoSegmentStream")),r.videoSegmentStream.on("timelineStartInfo",function(t){i&&!e.keepOriginalTimestamps&&(i.timelineStartInfo=t,r.audioSegmentStream.setEarliestDts(t.dts-n.baseMediaDecodeTime));}),r.videoSegmentStream.on("processedGopsInfo",n.trigger.bind(n,"gopInfo")),r.videoSegmentStream.on("segmentTimingInfo",n.trigger.bind(n,"videoSegmentTimingInfo")),r.videoSegmentStream.on("baseMediaDecodeTime",function(e){i&&r.audioSegmentStream.setVideoBaseMediaDecodeTime(e);}),r.videoSegmentStream.on("timingInfo",n.trigger.bind(n,"videoTimingInfo")),r.h264Stream.pipe(r.videoSegmentStream).pipe(r.coalesceStream)),i&&!r.audioSegmentStream&&(r.coalesceStream.numberOfTracks++,r.audioSegmentStream=new _bt(i,e),r.audioSegmentStream.on("log",n.getLogTrigger_("audioSegmentStream")),r.audioSegmentStream.on("timingInfo",n.trigger.bind(n,"audioTimingInfo")),r.audioSegmentStream.on("segmentTimingInfo",n.trigger.bind(n,"audioSegmentTimingInfo")),r.adtsStream.pipe(r.audioSegmentStream).pipe(r.coalesceStream)),n.trigger("trackinfo",{hasAudio:!!i,hasVideo:!!t});}}),r.coalesceStream.on("data",this.trigger.bind(this,"data")),r.coalesceStream.on("id3Frame",function(e){e.dispatchType=r.metadataStream.dispatchType,n.trigger("id3Frame",e);}),r.coalesceStream.on("caption",this.trigger.bind(this,"caption")),r.coalesceStream.on("done",this.trigger.bind(this,"done"));},this.setBaseMediaDecodeTime=function(n){var r=this.transmuxPipeline_;e.keepOriginalTimestamps||(this.baseMediaDecodeTime=n),i&&(i.timelineStartInfo.dts=void 0,i.timelineStartInfo.pts=void 0,Te(i),r.audioTimestampRolloverStream&&r.audioTimestampRolloverStream.discontinuity()),t&&(r.videoSegmentStream&&(r.videoSegmentStream.gopCache_=[]),t.timelineStartInfo.dts=void 0,t.timelineStartInfo.pts=void 0,Te(t),r.captionStream.reset()),r.timestampRolloverStream&&r.timestampRolloverStream.discontinuity();},this.setAudioAppendStart=function(e){i&&this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(e);},this.setRemux=function(t){var i=this.transmuxPipeline_;e.remux=t,i&&i.coalesceStream&&i.coalesceStream.setRemux(t);},this.alignGopsWith=function(e){t&&this.transmuxPipeline_.videoSegmentStream&&this.transmuxPipeline_.videoSegmentStream.alignGopsWith(e);},this.getLogTrigger_=function(e){var t=this;return function(i){i.stream=e,t.trigger("log",i);};},this.push=function(e){if(r){var t=kt(e);if(t&&"aac"!==this.transmuxPipeline_.type?this.setupAacPipeline():t||"ts"===this.transmuxPipeline_.type||this.setupTsPipeline(),this.transmuxPipeline_)for(var i=Object.keys(this.transmuxPipeline_),n=0;n>>0;},Mt=function Mt(e){var t="";return t+=String.fromCharCode(e[0]),t+=String.fromCharCode(e[1]),t+=String.fromCharCode(e[2]),t+=String.fromCharCode(e[3]);},Ft=Ot,Bt=function e(t,i){var n,r,a,s,o,u=[];if(!i.length)return null;for(n=0;n1?n+r:t.byteLength,a===i[0]&&(1===i.length?u.push(t.subarray(n+8,s)):(o=e(t.subarray(n+8,s),i.slice(1))).length&&(u=u.concat(o))),n=s;}return u;},Nt=Ot,jt=function jt(e){var t={version:e[0],flags:new Uint8Array(e.subarray(1,4)),baseMediaDecodeTime:Nt(e[4]<<24|e[5]<<16|e[6]<<8|e[7])};return 1===t.version&&(t.baseMediaDecodeTime*=Math.pow(2,32),t.baseMediaDecodeTime+=Nt(e[8]<<24|e[9]<<16|e[10]<<8|e[11])),t;},Vt=function Vt(e){return{isLeading:(12&e[0])>>>2,dependsOn:3&e[0],isDependedOn:(192&e[1])>>>6,hasRedundancy:(48&e[1])>>>4,paddingValue:(14&e[1])>>>1,isNonSyncSample:1&e[1],degradationPriority:e[2]<<8|e[3]};},Ht=function Ht(e){var t,i={version:e[0],flags:new Uint8Array(e.subarray(1,4)),samples:[]},n=new DataView(e.buffer,e.byteOffset,e.byteLength),r=1&i.flags[2],a=4&i.flags[2],s=1&i.flags[1],o=2&i.flags[1],u=4&i.flags[1],l=8&i.flags[1],d=n.getUint32(4),h=8;for(r&&(i.dataOffset=n.getInt32(h),h+=4),a&&d&&(t={flags:Vt(e.subarray(h,h+4))},h+=4,s&&(t.duration=n.getUint32(h),h+=4),o&&(t.size=n.getUint32(h),h+=4),l&&(1===i.version?t.compositionTimeOffset=n.getInt32(h):t.compositionTimeOffset=n.getUint32(h),h+=4),i.samples.push(t),d--);d--;){t={},s&&(t.duration=n.getUint32(h),h+=4),o&&(t.size=n.getUint32(h),h+=4),u&&(t.flags=Vt(e.subarray(h,h+4)),h+=4),l&&(1===i.version?t.compositionTimeOffset=n.getInt32(h):t.compositionTimeOffset=n.getUint32(h),h+=4),i.samples.push(t);}return i;},zt=function zt(e){var t,i=new DataView(e.buffer,e.byteOffset,e.byteLength),n={version:e[0],flags:new Uint8Array(e.subarray(1,4)),trackId:i.getUint32(4)},r=1&n.flags[2],a=2&n.flags[2],s=8&n.flags[2],o=16&n.flags[2],u=32&n.flags[2],l=65536&n.flags[0],d=131072&n.flags[0];return t=8,r&&(t+=4,n.baseDataOffset=i.getUint32(12),t+=4),a&&(n.sampleDescriptionIndex=i.getUint32(t),t+=4),s&&(n.defaultSampleDuration=i.getUint32(t),t+=4),o&&(n.defaultSampleSize=i.getUint32(t),t+=4),u&&(n.defaultSampleFlags=i.getUint32(t)),l&&(n.durationIsEmpty=!0),!r&&d&&(n.baseDataOffsetIsMoof=!0),n;},Gt=ke,Wt=je.CaptionStream,Yt=function Yt(e,t){for(var i=e,n=0;n0?jt(l[0]).baseMediaDecodeTime:0,h=Bt(a,["trun"]);t===u&&h.length>0&&(i=function(e,t,i){var n,r,a,s,o=new DataView(e.buffer,e.byteOffset,e.byteLength),u={logs:[],seiNals:[]};for(r=0;r+40;){var u=t.shift();this.parse(u,a,s);}return(o=function(e,t,i){if(null===t)return null;var n=qt(e,t)[t]||{};return{seiNals:n.seiNals,logs:n.logs,timescale:i};}(e,i,n))&&o.logs&&(r.logs=r.logs.concat(o.logs)),null!==o&&o.seiNals?(this.pushNals(o.seiNals),this.flushStream(),r):r.logs.length?{logs:r.logs,captions:[],captionStreams:[]}:null;},this.pushNals=function(t){if(!this.isInitialized()||!t||0===t.length)return null;t.forEach(function(t){e.push(t);});},this.flushStream=function(){if(!this.isInitialized())return null;a?e.partialFlush():e.flush();},this.clearParsedCaptions=function(){r.captions=[],r.captionStreams={},r.logs=[];},this.resetCaptionStream=function(){if(!this.isInitialized())return null;e.reset();},this.clearAllCaptions=function(){this.clearParsedCaptions(),this.resetCaptionStream();},this.reset=function(){t=[],i=null,n=null,r?this.clearParsedCaptions():r={captions:[],captionStreams:{},logs:[]},this.resetCaptionStream();},this.reset();},Xt=Ot,Qt=function Qt(e){return("00"+e.toString(16)).slice(-2);};Lt=function Lt(e,t){var i,n,r;return i=Bt(t,["moof","traf"]),n=[].concat.apply([],i.map(function(t){return Bt(t,["tfhd"]).map(function(i){var n,r,a;return n=Xt(i[4]<<24|i[5]<<16|i[6]<<8|i[7]),r=e[n]||9e4,(a="number"!=typeof(a=Bt(t,["tfdt"]).map(function(e){var t,i;return t=e[0],i=Xt(e[4]<<24|e[5]<<16|e[6]<<8|e[7]),1===t&&(i*=Math.pow(2,32),i+=Xt(e[8]<<24|e[9]<<16|e[10]<<8|e[11])),i;})[0])||isNaN(a)?1/0:a)/r;});})),r=Math.min.apply(null,n),isFinite(r)?r:0;},Dt=function Dt(e){var t=Bt(e,["moov","trak"]),i=[];return t.forEach(function(e){var t,n,r={},a=Bt(e,["tkhd"])[0];a&&(n=(t=new DataView(a.buffer,a.byteOffset,a.byteLength)).getUint8(0),r.id=0===n?t.getUint32(12):t.getUint32(20));var s=Bt(e,["mdia","hdlr"])[0];if(s){var o=Mt(s.subarray(8,12));r.type="vide"===o?"video":"soun"===o?"audio":o;}var u=Bt(e,["mdia","minf","stbl","stsd"])[0];if(u){var l=u.subarray(8);r.codec=Mt(l.subarray(4,8));var d,h=Bt(l,[r.codec])[0];h&&(/^[a-z]vc[1-9]$/i.test(r.codec)?(d=h.subarray(78),"avcC"===Mt(d.subarray(4,8))&&d.length>11?(r.codec+=".",r.codec+=Qt(d[9]),r.codec+=Qt(d[10]),r.codec+=Qt(d[11])):r.codec="avc1.4d400d"):/^mp4[a,v]$/i.test(r.codec)?(d=h.subarray(28),"esds"===Mt(d.subarray(4,8))&&d.length>20&&0!==d[19]?(r.codec+="."+Qt(d[19]),r.codec+="."+Qt(d[20]>>>2&63).replace(/^0/,"")):r.codec="mp4a.40.2"):r.codec=r.codec.toLowerCase());}var c=Bt(e,["mdia","mdhd"])[0];c&&(r.timescale=Ut(c)),i.push(r);}),i;};var $t=Lt,Jt=Dt,Zt=(Ut=function Ut(e){var t=0===e[0]?12:20;return Xt(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3]);},function(e){var t=31&e[1];return t<<=8,t|=e[2];}),ei=function ei(e){return!!(64&e[1]);},ti=function ti(e){var t=0;return(48&e[3])>>>4>1&&(t+=e[4]+1),t;},ii=function ii(e){switch(e){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;}},ni={parseType:function parseType(e,t){var i=Zt(e);return 0===i?"pat":i===t?"pmt":t?"pes":null;},parsePat:function parsePat(e){var t=ei(e),i=4+ti(e);return t&&(i+=e[i]+1),(31&e[i+10])<<8|e[i+11];},parsePmt:function parsePmt(e){var t={},i=ei(e),n=4+ti(e);if(i&&(n+=e[n]+1),1&e[n+5]){var r;r=3+((15&e[n+1])<<8|e[n+2])-4;for(var a=12+((15&e[n+10])<<8|e[n+11]);a=e.byteLength)return null;var i,n=null;return 192&(i=e[t+7])&&((n={}).pts=(14&e[t+9])<<27|(255&e[t+10])<<20|(254&e[t+11])<<12|(255&e[t+12])<<5|(254&e[t+13])>>>3,n.pts*=4,n.pts+=(6&e[t+13])>>>1,n.dts=n.pts,64&i&&(n.dts=(14&e[t+14])<<27|(255&e[t+15])<<20|(254&e[t+16])<<12|(255&e[t+17])<<5|(254&e[t+18])>>>3,n.dts*=4,n.dts+=(6&e[t+18])>>>1)),n;},videoPacketContainsKeyFrame:function videoPacketContainsKeyFrame(e){for(var t=4+ti(e),i=e.subarray(t),n=0,r=0,a=!1;r3&&"slice_layer_without_partitioning_rbsp_idr"===ii(31&i[r+3])&&(a=!0),a;}},ri=Ye,ai={};ai.ts=ni,ai.aac=yt;var si=de,oi=function oi(e,t,i){for(var n,r,a,s,o=0,u=188,l=!1;u<=e.byteLength;){if(71!==e[o]||71!==e[u]&&u!==e.byteLength)o++,u++;else{switch(n=e.subarray(o,u),ai.ts.parseType(n,t.pid)){case"pes":r=ai.ts.parsePesType(n,t.table),a=ai.ts.parsePayloadUnitStartIndicator(n),"audio"===r&&a&&(s=ai.ts.parsePesTime(n))&&(s.type="audio",i.audio.push(s),l=!0);}if(l)break;o+=188,u+=188;}}for(o=(u=e.byteLength)-188,l=!1;o>=0;){if(71!==e[o]||71!==e[u]&&u!==e.byteLength)o--,u--;else{switch(n=e.subarray(o,u),ai.ts.parseType(n,t.pid)){case"pes":r=ai.ts.parsePesType(n,t.table),a=ai.ts.parsePayloadUnitStartIndicator(n),"audio"===r&&a&&(s=ai.ts.parsePesTime(n))&&(s.type="audio",i.audio.push(s),l=!0);}if(l)break;o-=188,u-=188;}}},ui=function ui(e,t,i){for(var n,r,a,s,o,u,l,d=0,h=188,c=!1,f={data:[],size:0};h=0;){if(71!==e[d]||71!==e[h])d--,h--;else{switch(n=e.subarray(d,h),ai.ts.parseType(n,t.pid)){case"pes":r=ai.ts.parsePesType(n,t.table),a=ai.ts.parsePayloadUnitStartIndicator(n),"video"===r&&a&&(s=ai.ts.parsePesTime(n))&&(s.type="video",i.video.push(s),c=!0);}if(c)break;d-=188,h-=188;}}},li=function li(e){var t={pid:null,table:null},i={};for(var n in function(e,t){for(var i,n=0,r=188;r=3;){switch(ai.aac.parseType(e,o)){case"timed-metadata":if(e.length-o<10){i=!0;break;}if((s=ai.aac.parseId3TagSize(e,o))>e.length){i=!0;break;}null===a&&(t=e.subarray(o,o+s),a=ai.aac.parseAacTimestamp(t)),o+=s;break;case"audio":if(e.length-o<7){i=!0;break;}if((s=ai.aac.parseAdtsSize(e,o))>e.length){i=!0;break;}null===r&&(t=e.subarray(o,o+s),r=ai.aac.parseSampleRate(t)),n++,o+=s;break;default:o++;}if(i)return null;}if(null===r||null===a)return null;var u=si/r;return{audio:[{type:"audio",dts:a,pts:a},{type:"audio",dts:a+1024*n*u,pts:a+1024*n*u}]};}(e):li(e))&&(i.audio||i.video)?(function(e,t){if(e.audio&&e.audio.length){var i=t;(void 0===i||isNaN(i))&&(i=e.audio[0].dts),e.audio.forEach(function(e){e.dts=ri(e.dts,i),e.pts=ri(e.pts,i),e.dtsTime=e.dts/si,e.ptsTime=e.pts/si;});}if(e.video&&e.video.length){var n=t;if((void 0===n||isNaN(n))&&(n=e.video[0].dts),e.video.forEach(function(e){e.dts=ri(e.dts,n),e.pts=ri(e.pts,n),e.dtsTime=e.dts/si,e.ptsTime=e.pts/si;}),e.firstKeyFrame){var r=e.firstKeyFrame;r.dts=ri(r.dts,n),r.pts=ri(r.pts,n),r.dtsTime=r.dts/si,r.ptsTime=r.pts/si;}}}(i,t),i):null;},hi=function(){function e(e,t){this.options=t||{},this.self=e,this.init();}var t=e.prototype;return t.init=function(){this.transmuxer&&this.transmuxer.dispose(),this.transmuxer=new Rt.Transmuxer(this.options),function(e,t){t.on("data",function(t){var i=t.initSegment;t.initSegment={data:i.buffer,byteOffset:i.byteOffset,byteLength:i.byteLength};var n=t.data;t.data=n.buffer,e.postMessage({action:"data",segment:t,byteOffset:n.byteOffset,byteLength:n.byteLength},[t.data]);}),t.on("done",function(t){e.postMessage({action:"done"});}),t.on("gopInfo",function(t){e.postMessage({action:"gopInfo",gopInfo:t});}),t.on("videoSegmentTimingInfo",function(t){var i={start:{decode:ce(t.start.dts),presentation:ce(t.start.pts)},end:{decode:ce(t.end.dts),presentation:ce(t.end.pts)},baseMediaDecodeTime:ce(t.baseMediaDecodeTime)};t.prependedContentDuration&&(i.prependedContentDuration=ce(t.prependedContentDuration)),e.postMessage({action:"videoSegmentTimingInfo",videoSegmentTimingInfo:i});}),t.on("audioSegmentTimingInfo",function(t){var i={start:{decode:ce(t.start.dts),presentation:ce(t.start.pts)},end:{decode:ce(t.end.dts),presentation:ce(t.end.pts)},baseMediaDecodeTime:ce(t.baseMediaDecodeTime)};t.prependedContentDuration&&(i.prependedContentDuration=ce(t.prependedContentDuration)),e.postMessage({action:"audioSegmentTimingInfo",audioSegmentTimingInfo:i});}),t.on("id3Frame",function(t){e.postMessage({action:"id3Frame",id3Frame:t});}),t.on("caption",function(t){e.postMessage({action:"caption",caption:t});}),t.on("trackinfo",function(t){e.postMessage({action:"trackinfo",trackInfo:t});}),t.on("audioTimingInfo",function(t){e.postMessage({action:"audioTimingInfo",audioTimingInfo:{start:ce(t.start),end:ce(t.end)}});}),t.on("videoTimingInfo",function(t){e.postMessage({action:"videoTimingInfo",videoTimingInfo:{start:ce(t.start),end:ce(t.end)}});}),t.on("log",function(t){e.postMessage({action:"log",log:t});});}(this.self,this.transmuxer);},t.pushMp4Captions=function(e){this.captionParser||(this.captionParser=new Kt(),this.captionParser.init());var t=new Uint8Array(e.data,e.byteOffset,e.byteLength),i=this.captionParser.parse(t,e.trackIds,e.timescales);this.self.postMessage({action:"mp4Captions",captions:i&&i.captions||[],logs:i&&i.logs||[],data:t.buffer},[t.buffer]);},t.probeMp4StartTime=function(e){var t=e.timescales,i=e.data,n=$t(t,i);this.self.postMessage({action:"probeMp4StartTime",startTime:n,data:i},[i.buffer]);},t.probeMp4Tracks=function(e){var t=e.data,i=Jt(t);this.self.postMessage({action:"probeMp4Tracks",tracks:i,data:t},[t.buffer]);},t.probeTs=function(e){var t=e.data,i=e.baseStartTime,n="number"!=typeof i||isNaN(i)?void 0:i*de,r=di(t,n),a=null;r&&((a={hasVideo:r.video&&2===r.video.length||!1,hasAudio:r.audio&&2===r.audio.length||!1}).hasVideo&&(a.videoStart=r.video[0].ptsTime),a.hasAudio&&(a.audioStart=r.audio[0].ptsTime)),this.self.postMessage({action:"probeTs",result:a,data:t},[t.buffer]);},t.clearAllMp4Captions=function(){this.captionParser&&this.captionParser.clearAllCaptions();},t.clearParsedMp4Captions=function(){this.captionParser&&this.captionParser.clearParsedCaptions();},t.push=function(e){var t=new Uint8Array(e.data,e.byteOffset,e.byteLength);this.transmuxer.push(t);},t.reset=function(){this.transmuxer.reset();},t.setTimestampOffset=function(e){var t=e.timestampOffset||0;this.transmuxer.setBaseMediaDecodeTime(Math.round(he(t)));},t.setAudioAppendStart=function(e){this.transmuxer.setAudioAppendStart(Math.ceil(he(e.appendStart)));},t.setRemux=function(e){this.transmuxer.setRemux(e.remux);},t.flush=function(e){this.transmuxer.flush(),self.postMessage({action:"done",type:"transmuxed"});},t.endTimeline=function(){this.transmuxer.endTimeline(),self.postMessage({action:"endedtimeline",type:"transmuxed"});},t.alignGopsWith=function(e){this.transmuxer.alignGopsWith(e.gopsToAlignWith.slice());},e;}();self.onmessage=function(e){"init"===e.data.action&&e.data.options?this.messageHandlers=new hi(self,e.data.options):(this.messageHandlers||(this.messageHandlers=new hi(self)),e.data&&e.data.action&&"init"!==e.data.action&&this.messageHandlers[e.data.action]&&this.messageHandlers[e.data.action](e.data));};}))),ls=function ls(e){var t=e.transmuxer,i=e.bytes,n=e.audioAppendStart,r=e.gopsToAlignWith,a=e.remux,s=e.onData,o=e.onTrackInfo,u=e.onAudioTimingInfo,l=e.onVideoTimingInfo,d=e.onVideoSegmentTimingInfo,h=e.onAudioSegmentTimingInfo,c=e.onId3,f=e.onCaptions,p=e.onDone,m=e.onEndedTimeline,g=e.onTransmuxerLog,_=e.isEndOfTimeline,y={buffer:[]},v=_;if(t.onmessage=function(i){t.currentTransmux===e&&("data"===i.data.action&&function(e,t,i){var n=e.data.segment,r=n.type,a=n.initSegment,s=n.captions,o=n.captionStreams,u=n.metadata,l=n.videoFrameDtsTime,d=n.videoFramePtsTime;t.buffer.push({captions:s,captionStreams:o,metadata:u});var h=e.data.segment.boxes||{data:e.data.segment.data},c={type:r,data:new Uint8Array(h.data,h.data.byteOffset,h.data.byteLength),initSegment:new Uint8Array(a.data,a.byteOffset,a.byteLength)};void 0!==l&&(c.videoFrameDtsTime=l),void 0!==d&&(c.videoFramePtsTime=d),i(c);}(i,y,s),"trackinfo"===i.data.action&&o(i.data.trackInfo),"gopInfo"===i.data.action&&function(e,t){t.gopInfo=e.data.gopInfo;}(i,y),"audioTimingInfo"===i.data.action&&u(i.data.audioTimingInfo),"videoTimingInfo"===i.data.action&&l(i.data.videoTimingInfo),"videoSegmentTimingInfo"===i.data.action&&d(i.data.videoSegmentTimingInfo),"audioSegmentTimingInfo"===i.data.action&&h(i.data.audioSegmentTimingInfo),"id3Frame"===i.data.action&&c([i.data.id3Frame],i.data.id3Frame.dispatchType),"caption"===i.data.action&&f(i.data.caption),"endedtimeline"===i.data.action&&(v=!1,m()),"log"===i.data.action&&g(i.data.log),"transmuxed"===i.data.type&&(v||(t.onmessage=null,function(e){var t=e.transmuxedData,i=e.callback;t.buffer=[],i(t);}({transmuxedData:y,callback:p}),ds(t))));},n&&t.postMessage({action:"setAudioAppendStart",appendStart:n}),Array.isArray(r)&&t.postMessage({action:"alignGopsWith",gopsToAlignWith:r}),void 0!==a&&t.postMessage({action:"setRemux",remux:a}),i.byteLength){var b=i instanceof ArrayBuffer?i:i.buffer,T=i instanceof ArrayBuffer?0:i.byteOffset;t.postMessage({action:"push",data:b,byteOffset:T,byteLength:i.byteLength},[b]);}_&&t.postMessage({action:"endTimeline"}),t.postMessage({action:"flush"});},ds=function ds(e){e.currentTransmux=null,e.transmuxQueue.length&&(e.currentTransmux=e.transmuxQueue.shift(),"function"==typeof e.currentTransmux?e.currentTransmux():ls(e.currentTransmux));},hs=function hs(e,t){e.postMessage({action:t}),ds(e);},cs=function cs(e,t){if(!t.currentTransmux)return t.currentTransmux=e,void hs(t,e);t.transmuxQueue.push(hs.bind(null,t,e));},fs=function fs(e){if(!e.transmuxer.currentTransmux)return e.transmuxer.currentTransmux=e,void ls(e);e.transmuxer.transmuxQueue.push(e);},ps=function ps(e){cs("reset",e);},ms=function ms(e){var t=new us();t.currentTransmux=null,t.transmuxQueue=[];var i=t.terminate;return t.terminate=function(){return t.currentTransmux=null,t.transmuxQueue.length=0,i.call(t);},t.postMessage({action:"init",options:e}),t;},gs=function gs(e){var t=e.transmuxer,i=e.endAction||e.action,n=e.callback,r=x["default"]({},e,{endAction:null,transmuxer:null,callback:null});if(t.addEventListener("message",function r(a){a.data.action===i&&(t.removeEventListener("message",r),a.data.data&&(a.data.data=new Uint8Array(a.data.data,e.byteOffset||0,e.byteLength||a.data.data.byteLength),e.data&&(e.data=a.data.data)),n(a.data));}),e.data){var a=e.data instanceof ArrayBuffer;r.byteOffset=a?0:e.data.byteOffset,r.byteLength=e.data.byteLength;var s=[a?e.data:e.data.buffer];t.postMessage(r,s);}else t.postMessage(r);},_s=2,ys=-101,vs=-102,bs=function bs(e){e.forEach(function(e){e.abort();});},Ts=function Ts(e,t){return t.timedout?{status:t.status,message:"HLS request timed-out at URL: "+t.uri,code:ys,xhr:t}:t.aborted?{status:t.status,message:"HLS request aborted at URL: "+t.uri,code:vs,xhr:t}:e?{status:t.status,message:"HLS request errored at URL: "+t.uri,code:_s,xhr:t}:"arraybuffer"===t.responseType&&0===t.response.byteLength?{status:t.status,message:"Empty HLS response at URL: "+t.uri,code:_s,xhr:t}:null;},Ss=function Ss(e,t,i){return function(n,r){var a=r.response,s=Ts(n,r);if(s)return i(s,e);if(16!==a.byteLength)return i({status:r.status,message:"Invalid HLS key at URL: "+r.uri,code:_s,xhr:r},e);for(var o=new DataView(a),u=new Uint32Array([o.getUint32(0),o.getUint32(4),o.getUint32(8),o.getUint32(12)]),l=0;l1)return Ls("multiple "+e+" codecs found as attributes: "+t[e].join(", ")+". Setting playlist codecs to null so that we wait for mux.js to probe segments for real codecs."),void(t[e]=null);t[e]=t[e][0];}),t;},Rs=function Rs(e){var t=0;return e.audio&&t++,e.video&&t++,t;},Os=function Os(e,t){var i=t.attributes||{},n=Us(function(e){var t=e.attributes||{};if(t.CODECS)return g.parseCodecs(t.CODECS);}(t)||[]);if(Ds(e,t)&&!n.audio&&!function(e,t){if(!Ds(e,t))return!0;var i=t.attributes||{},n=e.mediaGroups.AUDIO[i.AUDIO];for(var r in n){if(!n[r].uri&&!n[r].playlists)return!0;}return!1;}(e,t)){var r=Us(g.codecsFromDefault(e,i.AUDIO)||[]);r.audio&&(n.audio=r.audio);}return n;},Ms=$r("PlaylistSelector"),Fs=function Fs(e){if(e&&e.playlist){var t=e.playlist;return JSON.stringify({id:t.id,bandwidth:e.bandwidth,width:e.width,height:e.height,codecs:t.attributes&&t.attributes.CODECS||""});}},Bs=function Bs(e,t){if(!e)return"";var i=A["default"].getComputedStyle(e);return i?i[t]:"";},Ns=function Ns(e,t){var i=e.slice();e.sort(function(e,n){var r=t(e,n);return 0===r?i.indexOf(e)-i.indexOf(n):r;});},js=function js(e,t){var i,n;return e.attributes.BANDWIDTH&&(i=e.attributes.BANDWIDTH),i=i||A["default"].Number.MAX_VALUE,t.attributes.BANDWIDTH&&(n=t.attributes.BANDWIDTH),i-(n=n||A["default"].Number.MAX_VALUE);},Vs=function Vs(e,t,i,n,r,a){if(e){var s={bandwidth:t,width:i,height:n,limitRenditionByPlayerDimensions:r},o=e.playlists;Ta.isAudioOnly(e)&&(o=a.getAudioTrackPlaylists_(),s.audioOnly=!0);var u=o.map(function(e){var t=e.attributes&&e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width,i=e.attributes&&e.attributes.RESOLUTION&&e.attributes.RESOLUTION.height;return{bandwidth:e.attributes&&e.attributes.BANDWIDTH||A["default"].Number.MAX_VALUE,width:t,height:i,playlist:e};});Ns(u,function(e,t){return e.bandwidth-t.bandwidth;});var l=(u=u.filter(function(e){return!Ta.isIncompatible(e.playlist);})).filter(function(e){return Ta.isEnabled(e.playlist);});l.length||(l=u.filter(function(e){return!Ta.isDisabled(e.playlist);}));var d=l.filter(function(e){return e.bandwidth*ns.BANDWIDTH_VARIANCEi||e.height>n;})).filter(function(e){return e.width===_[0].width&&e.height===_[0].height;}),h=y[y.length-1],v=y.filter(function(e){return e.bandwidth===h.bandwidth;})[0]),a.experimentalLeastPixelDiffSelector){var S=m.map(function(e){return e.pixelDiff=Math.abs(e.width-i)+Math.abs(e.height-n),e;});Ns(S,function(e,t){return e.pixelDiff===t.pixelDiff?t.bandwidth-e.bandwidth:e.pixelDiff-t.pixelDiff;}),b=S[0];}var E=b||v||T||c||l[0]||u[0];if(E&&E.playlist){var w="sortedPlaylistReps";return b?w="leastPixelDiffRep":v?w="resolutionPlusOneRep":T?w="resolutionBestRep":c?w="bandwidthBestRep":l[0]&&(w="enabledPlaylistReps"),Ms("choosing "+Fs(E)+" using "+w+" with options",s),E.playlist;}return Ms("could not choose a playlist with options",s),null;}},Hs=function Hs(){var e=this.useDevicePixelRatio&&A["default"].devicePixelRatio||1;return Vs(this.playlists.master,this.systemBandwidth,parseInt(Bs(this.tech_.el(),"width"),10)*e,parseInt(Bs(this.tech_.el(),"height"),10)*e,this.limitRenditionByPlayerDimensions,this.masterPlaylistController_);},zs=function zs(e){var t=e.inbandTextTracks,i=e.metadataArray,n=e.timestampOffset,r=e.videoDuration;if(i){var a=A["default"].WebKitDataCue||A["default"].VTTCue,s=t.metadataTrack_;if(s&&(i.forEach(function(e){var t=e.cueTime+n;!("number"!=typeof t||A["default"].isNaN(t)||t<0)&&t<1/0&&e.frames.forEach(function(e){var i=new a(t,t,e.value||e.url||e.data||"");i.frame=e,i.value=e,function(e){Object.defineProperties(e.frame,{id:{get:function get(){return Yr.log.warn("cue.frame.id is deprecated. Use cue.value.key instead."),e.value.key;}},value:{get:function get(){return Yr.log.warn("cue.frame.value is deprecated. Use cue.value.data instead."),e.value.data;}},privateData:{get:function get(){return Yr.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead."),e.value.data;}}});}(i),s.addCue(i);});}),s.cues&&s.cues.length)){for(var o=s.cues,u=[],l=0;l=e&&r.endTime<=t&&i.removeCue(r);}},Ws=function Ws(e){return"number"==typeof e&&isFinite(e);},Ys=function Ys(e){var t=e.startOfSegment,i=e.duration,n=e.segment,r=e.part,a=e.playlist,s=a.mediaSequence,o=a.id,u=a.segments,l=void 0===u?[]:u,d=e.mediaIndex,h=e.partIndex,c=e.timeline,f=l.length-1,p="mediaIndex/partIndex increment";e.getMediaInfoForTime?p="getMediaInfoForTime ("+e.getMediaInfoForTime+")":e.isSyncRequest&&(p="getSyncSegmentCandidate (isSyncRequest)");var m="number"==typeof h,g=e.segment.uri?"segment":"pre-segment",_=m?oa({preloadSegment:n})-1:0;return g+" ["+(s+d)+"/"+(s+f)+"]"+(m?" part ["+h+"/"+_+"]":"")+" segment start/end ["+n.start+" => "+n.end+"]"+(m?" part start/end ["+r.start+" => "+r.end+"]":"")+" startOfSegment ["+t+"] duration ["+i+"] timeline ["+c+"] selected by ["+p+"] playlist ["+o+"]";},qs=function qs(e){return e+"TimingInfo";},Ks=function Ks(e){var t=e.timelineChangeController,i=e.currentTimeline,n=e.segmentTimeline,r=e.loaderType,a=e.audioDisabled;if(i===n)return!1;if("audio"===r){var s=t.lastTimelineChange({type:"main"});return!s||s.to!==n;}if("main"===r&&a){var o=t.pendingTimelineChange({type:"audio"});return!o||o.to!==n;}return!1;},Xs=function Xs(e){var t=e.segmentDuration,i=e.maxDuration;return!!t&&Math.round(t)>i+1/30;},Qs=function Qs(e,t){if("hls"!==t)return null;var i,n,r,a,s=(i=e.audioTimingInfo,n=e.videoTimingInfo,r=i&&"number"==typeof i.start&&"number"==typeof i.end?i.end-i.start:0,a=n&&"number"==typeof n.start&&"number"==typeof n.end?n.end-n.start:0,Math.max(r,a));if(!s)return null;var o=e.playlist.targetDuration,u=Xs({segmentDuration:s,maxDuration:2*o}),l=Xs({segmentDuration:s,maxDuration:o}),d="Segment with index "+e.mediaIndex+" from playlist "+e.playlist.id+" has a duration of "+s+" when the reported duration is "+e.duration+" and the target duration is "+o+". For HLS content, a duration in excess of the target duration may result in playback issues. See the HLS specification section on EXT-X-TARGETDURATION for more details: https://tools.ietf.org/html/draft-pantos-http-live-streaming-23#section-4.3.3.1";return u||l?{severity:u?"warn":"info",message:d}:null;},$s=function(e){function t(t,i){var n;if(n=e.call(this)||this,!t)throw new TypeError("Initialization settings are required");if("function"!=typeof t.currentTime)throw new TypeError("No currentTime getter specified");if(!t.mediaSource)throw new TypeError("No MediaSource specified");return n.bandwidth=t.bandwidth,n.throughput={rate:0,count:0},n.roundTrip=NaN,n.resetStats_(),n.mediaIndex=null,n.partIndex=null,n.hasPlayed_=t.hasPlayed,n.currentTime_=t.currentTime,n.seekable_=t.seekable,n.seeking_=t.seeking,n.duration_=t.duration,n.mediaSource_=t.mediaSource,n.vhs_=t.vhs,n.loaderType_=t.loaderType,n.currentMediaInfo_=void 0,n.startingMediaInfo_=void 0,n.segmentMetadataTrack_=t.segmentMetadataTrack,n.goalBufferLength_=t.goalBufferLength,n.sourceType_=t.sourceType,n.sourceUpdater_=t.sourceUpdater,n.inbandTextTracks_=t.inbandTextTracks,n.state_="INIT",n.timelineChangeController_=t.timelineChangeController,n.shouldSaveSegmentTimingInfo_=!0,n.parse708captions_=t.parse708captions,n.experimentalExactManifestTimings=t.experimentalExactManifestTimings,n.checkBufferTimeout_=null,n.error_=void 0,n.currentTimeline_=-1,n.pendingSegment_=null,n.xhrOptions_=null,n.pendingSegments_=[],n.audioDisabled_=!1,n.isPendingTimestampOffset_=!1,n.gopBuffer_=[],n.timeMapping_=0,n.safeAppend_=Yr.browser.IE_VERSION>=11,n.appendInitSegment_={audio:!0,video:!0},n.playlistOfLastInitSegment_={audio:null,video:null},n.callQueue_=[],n.loadQueue_=[],n.metadataQueue_={id3:[],caption:[]},n.waitingOnRemove_=!1,n.quotaExceededErrorRetryTimeout_=null,n.activeInitSegmentId_=null,n.initSegments_={},n.cacheEncryptionKeys_=t.cacheEncryptionKeys,n.keyCache_={},n.decrypter_=t.decrypter,n.syncController_=t.syncController,n.syncPoint_={segmentIndex:0,time:0},n.transmuxer_=n.createTransmuxer_(),n.triggerSyncInfoUpdate_=function(){return n.trigger("syncinfoupdate");},n.syncController_.on("syncinfoupdate",n.triggerSyncInfoUpdate_),n.mediaSource_.addEventListener("sourceopen",function(){n.isEndOfStream_()||(n.ended_=!1);}),n.fetchAtBuffer_=!1,n.logger_=$r("SegmentLoader["+n.loaderType_+"]"),Object.defineProperty(I["default"](n),"state",{get:function get(){return this.state_;},set:function set(e){e!==this.state_&&(this.logger_(this.state_+" -> "+e),this.state_=e,this.trigger("statechange"));}}),n.sourceUpdater_.on("ready",function(){n.hasEnoughInfoToAppend_()&&n.processCallQueue_();}),"main"===n.loaderType_&&n.timelineChangeController_.on("pendingtimelinechange",function(){n.hasEnoughInfoToAppend_()&&n.processCallQueue_();}),"audio"===n.loaderType_&&n.timelineChangeController_.on("timelinechange",function(){n.hasEnoughInfoToLoad_()&&n.processLoadQueue_(),n.hasEnoughInfoToAppend_()&&n.processCallQueue_();}),n;}P["default"](t,e);var i=t.prototype;return i.createTransmuxer_=function(){return ms({remux:!1,alignGopsAtEnd:this.safeAppend_,keepOriginalTimestamps:!0,parse708captions:this.parse708captions_});},i.resetStats_=function(){this.mediaBytesTransferred=0,this.mediaRequests=0,this.mediaRequestsAborted=0,this.mediaRequestsTimedout=0,this.mediaRequestsErrored=0,this.mediaTransferDuration=0,this.mediaSecondsLoaded=0,this.mediaAppends=0;},i.dispose=function(){this.trigger("dispose"),this.state="DISPOSED",this.pause(),this.abort_(),this.transmuxer_&&this.transmuxer_.terminate(),this.resetStats_(),this.checkBufferTimeout_&&A["default"].clearTimeout(this.checkBufferTimeout_),this.syncController_&&this.triggerSyncInfoUpdate_&&this.syncController_.off("syncinfoupdate",this.triggerSyncInfoUpdate_),this.off();},i.setAudio=function(e){this.audioDisabled_=!e,e?this.appendInitSegment_.audio=!0:this.sourceUpdater_.removeAudio(0,this.duration_());},i.abort=function(){"WAITING"===this.state?(this.abort_(),this.state="READY",this.paused()||this.monitorBuffer_()):this.pendingSegment_&&(this.pendingSegment_=null);},i.abort_=function(){this.pendingSegment_&&this.pendingSegment_.abortRequests&&this.pendingSegment_.abortRequests(),this.pendingSegment_=null,this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.timelineChangeController_.clearPendingTimelineChange(this.loaderType_),this.waitingOnRemove_=!1,A["default"].clearTimeout(this.quotaExceededErrorRetryTimeout_),this.quotaExceededErrorRetryTimeout_=null;},i.checkForAbort_=function(e){return"APPENDING"!==this.state||this.pendingSegment_?!this.pendingSegment_||this.pendingSegment_.requestId!==e:(this.state="READY",!0);},i.error=function(e){return void 0!==e&&(this.logger_("error occurred:",e),this.error_=e),this.pendingSegment_=null,this.error_;},i.endOfStream=function(){this.ended_=!0,this.transmuxer_&&ps(this.transmuxer_),this.gopBuffer_.length=0,this.pause(),this.trigger("ended");},i.buffered_=function(){var e=this.getMediaInfo_();if(!this.sourceUpdater_||!e)return Yr.createTimeRanges();if("main"===this.loaderType_){var t=e.hasAudio,i=e.hasVideo,n=e.isMuxed;if(i&&t&&!this.audioDisabled_&&!n)return this.sourceUpdater_.buffered();if(i)return this.sourceUpdater_.videoBuffered();}return this.sourceUpdater_.audioBuffered();},i.initSegmentForMap=function(e,t){if(void 0===t&&(t=!1),!e)return null;var i=Wa(e),n=this.initSegments_[i];return t&&!n&&e.bytes&&(this.initSegments_[i]=n={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:e.bytes,tracks:e.tracks,timescales:e.timescales}),n||e;},i.segmentKey=function(e,t){if(void 0===t&&(t=!1),!e)return null;var i=Ya(e),n=this.keyCache_[i];this.cacheEncryptionKeys_&&t&&!n&&e.bytes&&(this.keyCache_[i]=n={resolvedUri:e.resolvedUri,bytes:e.bytes});var r={resolvedUri:(n||e).resolvedUri};return n&&(r.bytes=n.bytes),r;},i.couldBeginLoading_=function(){return this.playlist_&&!this.paused();},i.load=function(){if(this.monitorBuffer_(),this.playlist_)return"INIT"===this.state&&this.couldBeginLoading_()?this.init_():void(!this.couldBeginLoading_()||"READY"!==this.state&&"INIT"!==this.state||(this.state="READY"));},i.init_=function(){return this.state="READY",this.resetEverything(),this.monitorBuffer_();},i.playlist=function(e,t){if(void 0===t&&(t={}),e){var i=this.playlist_,n=this.pendingSegment_;this.playlist_=e,this.xhrOptions_=t,"INIT"===this.state&&(e.syncInfo={mediaSequence:e.mediaSequence,time:0},"main"===this.loaderType_&&this.syncController_.setDateTimeMappingForStart(e));var r=null;if(i&&(i.id?r=i.id:i.uri&&(r=i.uri)),this.logger_("playlist update ["+r+" => "+(e.id||e.uri)+"]"),this.trigger("syncinfoupdate"),"INIT"===this.state&&this.couldBeginLoading_())return this.init_();if(!i||i.uri!==e.uri)return null!==this.mediaIndex&&this.resyncLoader(),this.currentMediaInfo_=void 0,void this.trigger("playlistupdate");var a=e.mediaSequence-i.mediaSequence;if(this.logger_("live window shift ["+a+"]"),null!==this.mediaIndex)if(this.mediaIndex-=a,this.mediaIndex<0)this.mediaIndex=null,this.partIndex=null;else{var s=this.playlist_.segments[this.mediaIndex];if(this.partIndex&&(!s.parts||!s.parts.length||!s.parts[this.partIndex])){var o=this.mediaIndex;this.logger_("currently processing part (index "+this.partIndex+") no longer exists."),this.resetLoader(),this.mediaIndex=o;}}n&&(n.mediaIndex-=a,n.mediaIndex<0?(n.mediaIndex=null,n.partIndex=null):(n.mediaIndex>=0&&(n.segment=e.segments[n.mediaIndex]),n.partIndex>=0&&n.segment.parts&&(n.part=n.segment.parts[n.partIndex]))),this.syncController_.saveExpiredSegmentInfo(i,e);}},i.pause=function(){this.checkBufferTimeout_&&(A["default"].clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=null);},i.paused=function(){return null===this.checkBufferTimeout_;},i.resetEverything=function(e){this.ended_=!1,this.appendInitSegment_={audio:!0,video:!0},this.resetLoader(),this.remove(0,1/0,e),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearAllMp4Captions"});},i.resetLoader=function(){this.fetchAtBuffer_=!1,this.resyncLoader();},i.resyncLoader=function(){this.transmuxer_&&ps(this.transmuxer_),this.mediaIndex=null,this.partIndex=null,this.syncPoint_=null,this.isPendingTimestampOffset_=!1,this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.abort(),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"});},i.remove=function(e,t,i,n){if(void 0===i&&(i=function i(){}),void 0===n&&(n=!1),t===1/0&&(t=this.duration_()),t<=e)this.logger_("skipping remove because end ${end} is <= start ${start}");else if(this.sourceUpdater_&&this.getMediaInfo_()){var r=1,a=function a(){0===--r&&i();};for(var s in!n&&this.audioDisabled_||(r++,this.sourceUpdater_.removeAudio(e,t,a)),(n||"main"===this.loaderType_)&&(this.gopBuffer_=function(e,t,i,n){for(var r=Math.ceil((t-n)*E.ONE_SECOND_IN_TS),a=Math.ceil((i-n)*E.ONE_SECOND_IN_TS),s=e.slice(),o=e.length;o--&&!(e[o].pts<=a);){;}if(-1===o)return s;for(var u=o+1;u--&&!(e[u].pts<=r);){;}return u=Math.max(u,0),s.splice(u,o-u+1),s;}(this.gopBuffer_,e,t,this.timeMapping_),r++,this.sourceUpdater_.removeVideo(e,t,a)),this.inbandTextTracks_){Gs(e,t,this.inbandTextTracks_[s]);}Gs(e,t,this.segmentMetadataTrack_),a();}else this.logger_("skipping remove because no source updater or starting media info");},i.monitorBuffer_=function(){this.checkBufferTimeout_&&A["default"].clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=A["default"].setTimeout(this.monitorBufferTick_.bind(this),1);},i.monitorBufferTick_=function(){"READY"===this.state&&this.fillBuffer_(),this.checkBufferTimeout_&&A["default"].clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=A["default"].setTimeout(this.monitorBufferTick_.bind(this),500);},i.fillBuffer_=function(){if(!this.sourceUpdater_.updating()){var e=this.chooseNextRequest_();e&&("number"==typeof e.timestampOffset&&(this.isPendingTimestampOffset_=!1,this.timelineChangeController_.pendingTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline})),this.loadSegment_(e));}},i.isEndOfStream_=function(e,t,i){if(void 0===e&&(e=this.mediaIndex),void 0===t&&(t=this.playlist_),void 0===i&&(i=this.partIndex),!t||!this.mediaSource_)return!1;var n="number"==typeof e&&t.segments[e],r=e+1===t.segments.length,a=!n||!n.parts||i+1===n.parts.length;return t.endList&&"open"===this.mediaSource_.readyState&&r&&a;},i.chooseNextRequest_=function(){var e=na(this.buffered_())||0,t=Math.max(0,e-this.currentTime_()),i=!this.hasPlayed_()&&t>=1,n=t>=this.goalBufferLength_(),r=this.playlist_.segments;if(!r.length||i||n)return null;this.syncPoint_=this.syncPoint_||this.syncController_.getSyncPoint(this.playlist_,this.duration_(),this.currentTimeline_,this.currentTime_());var a={partIndex:null,mediaIndex:null,startOfSegment:null,playlist:this.playlist_,isSyncRequest:Boolean(!this.syncPoint_)};if(a.isSyncRequest)a.mediaIndex=function(e,t,i){t=t||[];for(var n=[],r=0,a=0;ai))return a;}return 0===n.length?0:n[n.length-1];}(this.currentTimeline_,r,e);else if(null!==this.mediaIndex){var s=r[this.mediaIndex],o="number"==typeof this.partIndex?this.partIndex:-1;a.startOfSegment=s.end?s.end:e,s.parts&&s.parts[o+1]?(a.mediaIndex=this.mediaIndex,a.partIndex=o+1):a.mediaIndex=this.mediaIndex+1;}else{var u=Ta.getMediaInfoForTime({experimentalExactManifestTimings:this.experimentalExactManifestTimings,playlist:this.playlist_,currentTime:this.fetchAtBuffer_?e:this.currentTime_(),startingPartIndex:this.syncPoint_.partIndex,startingSegmentIndex:this.syncPoint_.segmentIndex,startTime:this.syncPoint_.time}),l=u.segmentIndex,d=u.startTime,h=u.partIndex;a.getMediaInfoForTime=this.fetchAtBuffer_?"bufferedEnd":"currentTime",a.mediaIndex=l,a.startOfSegment=d,a.partIndex=h;}var c=r[a.mediaIndex],f=c&&"number"==typeof a.partIndex&&c.parts&&c.parts[a.partIndex];if(!c||"number"==typeof a.partIndex&&!f)return null;"number"!=typeof a.partIndex&&c.parts&&(a.partIndex=0);var p=this.mediaSource_&&"ended"===this.mediaSource_.readyState;return a.mediaIndex>=r.length-1&&p&&!this.seeking_()?null:this.generateSegmentInfo_(a);},i.generateSegmentInfo_=function(e){var t=e.playlist,i=e.mediaIndex,n=e.startOfSegment,r=e.isSyncRequest,a=e.partIndex,s=e.forceTimestampOffset,o=e.getMediaInfoForTime,u=t.segments[i],l="number"==typeof a&&u.parts[a],d={requestId:"segment-loader-"+Math.random(),uri:l&&l.resolvedUri||u.resolvedUri,mediaIndex:i,partIndex:l?a:null,isSyncRequest:r,startOfSegment:n,playlist:t,bytes:null,encryptedBytes:null,timestampOffset:null,timeline:u.timeline,duration:l&&l.duration||u.duration,segment:u,part:l,byteLength:0,transmuxer:this.transmuxer_,getMediaInfoForTime:o},h=void 0!==s?s:this.isPendingTimestampOffset_;d.timestampOffset=this.timestampOffsetForSegment_({segmentTimeline:u.timeline,currentTimeline:this.currentTimeline_,startOfSegment:n,buffered:this.buffered_(),overrideCheck:h});var c=na(this.sourceUpdater_.audioBuffered());return"number"==typeof c&&(d.audioAppendStart=c-this.sourceUpdater_.audioTimestampOffset()),this.sourceUpdater_.videoBuffered().length&&(d.gopsToAlignWith=function(e,t,i){if(null==t||!e.length)return[];var n,r=Math.ceil((t-i+3)*E.ONE_SECOND_IN_TS);for(n=0;nr);n++){;}return e.slice(n);}(this.gopBuffer_,this.currentTime_()-this.sourceUpdater_.videoTimestampOffset(),this.timeMapping_)),d;},i.timestampOffsetForSegment_=function(e){return i=(t=e).segmentTimeline,n=t.currentTimeline,r=t.startOfSegment,a=t.buffered,t.overrideCheck||i!==n?i "+s+" for "+e),function(e,t,i){if(!e[i]){t.trigger({type:"usage",name:"vhs-608"}),t.trigger({type:"usage",name:"hls-608"});var n=i;/^cc708_/.test(i)&&(n="SERVICE"+i.split("_")[1]);var r=t.textTracks().getTrackById(n);if(r)e[i]=r;else{var a=i,s=i,o=!1,u=(t.options_.vhs&&t.options_.vhs.captionServices||{})[n];u&&(a=u.label,s=u.language,o=u["default"]),e[i]=t.addRemoteTextTrack({kind:"captions",id:n,"default":o,label:a,language:s},!1).track;}}}(u,i.vhs_.tech_,e),Gs(a,s,u[e]),function(e){var t=e.inbandTextTracks,i=e.captionArray,n=e.timestampOffset;if(i){var r=A["default"].WebKitDataCue||A["default"].VTTCue;i.forEach(function(e){var i=e.stream;t[i].addCue(new r(e.startTime+n,e.endTime+n,e.text));});}}({captionArray:o,inbandTextTracks:u,timestampOffset:n});}),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"});}else this.metadataQueue_.caption.push(this.handleCaptions_.bind(this,e,t));}else this.logger_("SegmentLoader received no captions from a caption event");},i.handleId3_=function(e,t,i){if(this.earlyAbortWhenNeeded_(e.stats),!this.checkForAbort_(e.requestId))if(this.pendingSegment_.hasAppendedData_){var n=null===this.sourceUpdater_.videoTimestampOffset()?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset();!function(e,t,i){e.metadataTrack_||(e.metadataTrack_=i.addRemoteTextTrack({kind:"metadata",label:"Timed Metadata"},!1).track,e.metadataTrack_.inBandMetadataTrackDispatchType=t);}(this.inbandTextTracks_,i,this.vhs_.tech_),zs({inbandTextTracks:this.inbandTextTracks_,metadataArray:t,timestampOffset:n,videoDuration:this.duration_()});}else this.metadataQueue_.id3.push(this.handleId3_.bind(this,e,t,i));},i.processMetadataQueue_=function(){this.metadataQueue_.id3.forEach(function(e){return e();}),this.metadataQueue_.caption.forEach(function(e){return e();}),this.metadataQueue_.id3=[],this.metadataQueue_.caption=[];},i.processCallQueue_=function(){var e=this.callQueue_;this.callQueue_=[],e.forEach(function(e){return e();});},i.processLoadQueue_=function(){var e=this.loadQueue_;this.loadQueue_=[],e.forEach(function(e){return e();});},i.hasEnoughInfoToLoad_=function(){if("audio"!==this.loaderType_)return!0;var e=this.pendingSegment_;return!!e&&(!this.getCurrentMediaInfo_()||!Ks({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}));},i.getCurrentMediaInfo_=function(e){return void 0===e&&(e=this.pendingSegment_),e&&e.trackInfo||this.currentMediaInfo_;},i.getMediaInfo_=function(e){return void 0===e&&(e=this.pendingSegment_),this.getCurrentMediaInfo_(e)||this.startingMediaInfo_;},i.hasEnoughInfoToAppend_=function(){if(!this.sourceUpdater_.ready())return!1;if(this.waitingOnRemove_||this.quotaExceededErrorRetryTimeout_)return!1;var e=this.pendingSegment_,t=this.getCurrentMediaInfo_();if(!e||!t)return!1;var i=t.hasAudio,n=t.hasVideo,r=t.isMuxed;return!(n&&!e.videoTimingInfo)&&!(i&&!this.audioDisabled_&&!r&&!e.audioTimingInfo)&&!Ks({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_});},i.handleData_=function(e,t){if(this.earlyAbortWhenNeeded_(e.stats),!this.checkForAbort_(e.requestId))if(!this.callQueue_.length&&this.hasEnoughInfoToAppend_()){var i=this.pendingSegment_;if(this.setTimeMapping_(i.timeline),this.updateMediaSecondsLoaded_(i.segment),"closed"!==this.mediaSource_.readyState){if(e.map&&(e.map=this.initSegmentForMap(e.map,!0),i.segment.map=e.map),e.key&&this.segmentKey(e.key,!0),i.isFmp4=e.isFmp4,i.timingInfo=i.timingInfo||{},i.isFmp4)this.trigger("fmp4"),i.timingInfo.start=i[qs(t.type)].start;else{var n,r=this.getCurrentMediaInfo_(),a="main"===this.loaderType_&&r&&r.hasVideo;a&&(n=i.videoTimingInfo.start),i.timingInfo.start=this.trueSegmentStart_({currentStart:i.timingInfo.start,playlist:i.playlist,mediaIndex:i.mediaIndex,currentVideoTimestampOffset:this.sourceUpdater_.videoTimestampOffset(),useVideoTimingInfo:a,firstVideoFrameTimeForData:n,videoTimingInfo:i.videoTimingInfo,audioTimingInfo:i.audioTimingInfo});}if(this.updateAppendInitSegmentStatus(i,t.type),this.updateSourceBufferTimestampOffset_(i),i.isSyncRequest){this.updateTimingInfoEnd_(i),this.syncController_.saveSegmentTimingInfo({segmentInfo:i,shouldSaveTimelineMapping:"main"===this.loaderType_});var s=this.chooseNextRequest_();if(s.mediaIndex!==i.mediaIndex||s.partIndex!==i.partIndex)return void this.logger_("sync segment was incorrect, not appending");this.logger_("sync segment was correct, appending");}i.hasAppendedData_=!0,this.processMetadataQueue_(),this.appendData_(i,t);}}else this.callQueue_.push(this.handleData_.bind(this,e,t));},i.updateAppendInitSegmentStatus=function(e,t){"main"!==this.loaderType_||"number"!=typeof e.timestampOffset||e.changedTimestampOffset||(this.appendInitSegment_={audio:!0,video:!0}),this.playlistOfLastInitSegment_[t]!==e.playlist&&(this.appendInitSegment_[t]=!0);},i.getInitSegmentAndUpdateState_=function(e){var t=e.type,i=e.initSegment,n=e.map,r=e.playlist;if(n){var a=Wa(n);if(this.activeInitSegmentId_===a)return null;i=this.initSegmentForMap(n,!0).bytes,this.activeInitSegmentId_=a;}return i&&this.appendInitSegment_[t]?(this.playlistOfLastInitSegment_[t]=r,this.appendInitSegment_[t]=!1,this.activeInitSegmentId_=null,i):null;},i.handleQuotaExceededError_=function(e,t){var i=this,n=e.segmentInfo,r=e.type,a=e.bytes,s=this.sourceUpdater_.audioBuffered(),o=this.sourceUpdater_.videoBuffered();s.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the audio buffer: "+ia(s).join(", ")),o.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the video buffer: "+ia(o).join(", "));var u=s.length?s.start(0):0,l=s.length?s.end(s.length-1):0,d=o.length?o.start(0):0,h=o.length?o.end(o.length-1):0;if(l-u<=1&&h-d<=1)return this.logger_("On QUOTA_EXCEEDED_ERR, single segment too large to append to buffer, triggering an error. Appended byte length: "+a.byteLength+", audio buffer: "+ia(s).join(", ")+", video buffer: "+ia(o).join(", ")+", "),this.error({message:"Quota exceeded error with append of a single segment of content",excludeUntil:1/0}),void this.trigger("error");this.waitingOnRemove_=!0,this.callQueue_.push(this.appendToSourceBuffer_.bind(this,{segmentInfo:n,type:r,bytes:a}));var c=this.currentTime_()-1;this.logger_("On QUOTA_EXCEEDED_ERR, removing audio/video from 0 to "+c),this.remove(0,c,function(){i.logger_("On QUOTA_EXCEEDED_ERR, retrying append in 1s"),i.waitingOnRemove_=!1,i.quotaExceededErrorRetryTimeout_=A["default"].setTimeout(function(){i.logger_("On QUOTA_EXCEEDED_ERR, re-processing call queue"),i.quotaExceededErrorRetryTimeout_=null,i.processCallQueue_();},1e3);},!0);},i.handleAppendError_=function(e,t){var i=e.segmentInfo,n=e.type,r=e.bytes;t&&(22!==t.code?(this.logger_("Received non QUOTA_EXCEEDED_ERR on append",t),this.error(n+" append of "+r.length+"b failed for segment #"+i.mediaIndex+" in playlist "+i.playlist.id),this.trigger("appenderror")):this.handleQuotaExceededError_({segmentInfo:i,type:n,bytes:r}));},i.appendToSourceBuffer_=function(e){var t,i,n,r=e.segmentInfo,a=e.type,s=e.initSegment,o=e.data,u=e.bytes;if(!u){var l=[o],d=o.byteLength;s&&(l.unshift(s),d+=s.byteLength),n=0,(t={bytes:d,segments:l}).bytes&&(i=new Uint8Array(t.bytes),t.segments.forEach(function(e){i.set(e,n),n+=e.byteLength;})),u=i;}this.sourceUpdater_.appendBuffer({segmentInfo:r,type:a,bytes:u},this.handleAppendError_.bind(this,{segmentInfo:r,type:a,bytes:u}));},i.handleSegmentTimingInfo_=function(e,t,i){if(this.pendingSegment_&&t===this.pendingSegment_.requestId){var n=this.pendingSegment_.segment,r=e+"TimingInfo";n[r]||(n[r]={}),n[r].transmuxerPrependedSeconds=i.prependedContentDuration||0,n[r].transmuxedPresentationStart=i.start.presentation,n[r].transmuxedDecodeStart=i.start.decode,n[r].transmuxedPresentationEnd=i.end.presentation,n[r].transmuxedDecodeEnd=i.end.decode,n[r].baseMediaDecodeTime=i.baseMediaDecodeTime;}},i.appendData_=function(e,t){var i=t.type,n=t.data;if(n&&n.byteLength&&("audio"!==i||!this.audioDisabled_)){var r=this.getInitSegmentAndUpdateState_({type:i,initSegment:t.initSegment,playlist:e.playlist,map:e.isFmp4?e.segment.map:null});this.appendToSourceBuffer_({segmentInfo:e,type:i,initSegment:r,data:n});}},i.loadSegment_=function(e){var t=this;this.state="WAITING",this.pendingSegment_=e,this.trimBackBuffer_(e),"number"==typeof e.timestampOffset&&this.transmuxer_&&this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),this.hasEnoughInfoToLoad_()?this.updateTransmuxerAndRequestSegment_(e):this.loadQueue_.push(function(){var i=x["default"]({},e,{forceTimestampOffset:!0});x["default"](e,t.generateSegmentInfo_(i)),t.isPendingTimestampOffset_=!1,t.updateTransmuxerAndRequestSegment_(e);});},i.updateTransmuxerAndRequestSegment_=function(e){var t=this;this.shouldUpdateTransmuxerTimestampOffset_(e.timestampOffset)&&(this.gopBuffer_.length=0,e.gopsToAlignWith=[],this.timeMapping_=0,this.transmuxer_.postMessage({action:"reset"}),this.transmuxer_.postMessage({action:"setTimestampOffset",timestampOffset:e.timestampOffset}));var i=this.createSimplifiedSegmentObj_(e),n=this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex),r=null!==this.mediaIndex,a=e.timeline!==this.currentTimeline_&&e.timeline>0,s=n||r&&a;this.logger_("Requesting "+Ys(e)),i.map&&!i.map.bytes&&(this.logger_("going to request init segment."),this.appendInitSegment_={video:!0,audio:!0}),e.abortRequests=Ps({xhr:this.vhs_.xhr,xhrOptions:this.xhrOptions_,decryptionWorker:this.decrypter_,segment:i,abortFn:this.handleAbort_.bind(this,e),progressFn:this.handleProgress_.bind(this),trackInfoFn:this.handleTrackInfo_.bind(this),timingInfoFn:this.handleTimingInfo_.bind(this),videoSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"video",e.requestId),audioSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"audio",e.requestId),captionsFn:this.handleCaptions_.bind(this),isEndOfTimeline:s,endedTimelineFn:function endedTimelineFn(){t.logger_("received endedtimeline callback");},id3Fn:this.handleId3_.bind(this),dataFn:this.handleData_.bind(this),doneFn:this.segmentRequestFinished_.bind(this),onTransmuxerLog:function onTransmuxerLog(i){var n=i.message,r=i.level,a=i.stream;t.logger_(Ys(e)+" logged from transmuxer stream "+a+" as a "+r+": "+n);}});},i.trimBackBuffer_=function(e){var t=function(e,t,i){var n=t-ns.BACK_BUFFER_LENGTH;e.length&&(n=Math.max(n,e.start(0)));var r=t-i;return Math.min(r,n);}(this.seekable_(),this.currentTime_(),this.playlist_.targetDuration||10);t>0&&this.remove(0,t);},i.createSimplifiedSegmentObj_=function(e){var t=e.segment,i=e.part,n={resolvedUri:i?i.resolvedUri:t.resolvedUri,byterange:i?i.byterange:t.byterange,requestId:e.requestId,transmuxer:e.transmuxer,audioAppendStart:e.audioAppendStart,gopsToAlignWith:e.gopsToAlignWith,part:e.part},r=e.playlist.segments[e.mediaIndex-1];if(r&&r.timeline===t.timeline&&(r.videoTimingInfo?n.baseStartTime=r.videoTimingInfo.transmuxedDecodeEnd:r.audioTimingInfo&&(n.baseStartTime=r.audioTimingInfo.transmuxedDecodeEnd)),t.key){var a=t.key.iv||new Uint32Array([0,0,0,e.mediaIndex+e.playlist.mediaSequence]);n.key=this.segmentKey(t.key),n.key.iv=a;}return t.map&&(n.map=this.initSegmentForMap(t.map)),n;},i.saveTransferStats_=function(e){this.mediaRequests+=1,e&&(this.mediaBytesTransferred+=e.bytesReceived,this.mediaTransferDuration+=e.roundTripTime);},i.saveBandwidthRelatedStats_=function(e,t){this.pendingSegment_.byteLength=t.bytesReceived,e<1/60?this.logger_("Ignoring segment's bandwidth because its duration of "+e+" is less than the min to record "+1/60):(this.bandwidth=t.bandwidth,this.roundTrip=t.roundTripTime);},i.handleTimeout_=function(){this.mediaRequestsTimedout+=1,this.bandwidth=1,this.roundTrip=NaN,this.trigger("bandwidthupdate");},i.segmentRequestFinished_=function(e,t,i){if(this.callQueue_.length)this.callQueue_.push(this.segmentRequestFinished_.bind(this,e,t,i));else if(this.saveTransferStats_(t.stats),this.pendingSegment_&&t.requestId===this.pendingSegment_.requestId){if(e){if(this.pendingSegment_=null,this.state="READY",e.code===vs)return;return this.pause(),e.code===ys?void this.handleTimeout_():(this.mediaRequestsErrored+=1,this.error(e),void this.trigger("error"));}var n=this.pendingSegment_;this.saveBandwidthRelatedStats_(n.duration,t.stats),n.endOfAllRequests=t.endOfAllRequests,i.gopInfo&&(this.gopBuffer_=function(e,t,i){if(!t.length)return e;if(i)return t.slice();for(var n=t[0].pts,r=0;r=n);r++){;}return e.slice(0,r).concat(t);}(this.gopBuffer_,i.gopInfo,this.safeAppend_)),this.state="APPENDING",this.trigger("appending"),this.waitForAppendsToComplete_(n);}},i.setTimeMapping_=function(e){var t=this.syncController_.mappingForTimeline(e);null!==t&&(this.timeMapping_=t);},i.updateMediaSecondsLoaded_=function(e){"number"==typeof e.start&&"number"==typeof e.end?this.mediaSecondsLoaded+=e.end-e.start:this.mediaSecondsLoaded+=e.duration;},i.shouldUpdateTransmuxerTimestampOffset_=function(e){return null!==e&&("main"===this.loaderType_&&e!==this.sourceUpdater_.videoTimestampOffset()||!this.audioDisabled_&&e!==this.sourceUpdater_.audioTimestampOffset());},i.trueSegmentStart_=function(e){var t=e.currentStart,i=e.playlist,n=e.mediaIndex,r=e.firstVideoFrameTimeForData,a=e.currentVideoTimestampOffset,s=e.useVideoTimingInfo,o=e.videoTimingInfo,u=e.audioTimingInfo;if(void 0!==t)return t;if(!s)return u.start;var l=i.segments[n-1];return 0!==n&&l&&void 0!==l.start&&l.end===r+a?o.start:r;},i.waitForAppendsToComplete_=function(e){var t=this.getCurrentMediaInfo_(e);if(!t)return this.error({message:"No starting media returned, likely due to an unsupported media format.",blacklistDuration:1/0}),void this.trigger("error");var i=t.hasAudio,n=t.hasVideo,r=t.isMuxed,a="main"===this.loaderType_&&n,s=!this.audioDisabled_&&i&&!r;if(e.waitingOnAppends=0,!e.hasAppendedData_)return e.timingInfo||"number"!=typeof e.timestampOffset||(this.isPendingTimestampOffset_=!0),e.timingInfo={start:0},e.waitingOnAppends++,this.isPendingTimestampOffset_||(this.updateSourceBufferTimestampOffset_(e),this.processMetadataQueue_()),void this.checkAppendsDone_(e);a&&e.waitingOnAppends++,s&&e.waitingOnAppends++,a&&this.sourceUpdater_.videoQueueCallback(this.checkAppendsDone_.bind(this,e)),s&&this.sourceUpdater_.audioQueueCallback(this.checkAppendsDone_.bind(this,e));},i.checkAppendsDone_=function(e){this.checkForAbort_(e.requestId)||(e.waitingOnAppends--,0===e.waitingOnAppends&&this.handleAppendsDone_());},i.checkForIllegalMediaSwitch=function(e){var t=function(e,t,i){return"main"===e&&t&&i?i.hasAudio||i.hasVideo?t.hasVideo&&!i.hasVideo?"Only audio found in segment when we expected video. We can't switch to audio only from a stream that had video. To get rid of this message, please add codec information to the manifest.":!t.hasVideo&&i.hasVideo?"Video found in segment when we expected only audio. We can't switch to a stream with video from an audio only stream. To get rid of this message, please add codec information to the manifest.":null:"Neither audio nor video found in segment.":null;}(this.loaderType_,this.getCurrentMediaInfo_(),e);return!!t&&(this.error({message:t,blacklistDuration:1/0}),this.trigger("error"),!0);},i.updateSourceBufferTimestampOffset_=function(e){if(null!==e.timestampOffset&&"number"==typeof e.timingInfo.start&&!e.changedTimestampOffset&&"main"===this.loaderType_){var t=!1;e.timestampOffset-=e.timingInfo.start,e.changedTimestampOffset=!0,e.timestampOffset!==this.sourceUpdater_.videoTimestampOffset()&&(this.sourceUpdater_.videoTimestampOffset(e.timestampOffset),t=!0),e.timestampOffset!==this.sourceUpdater_.audioTimestampOffset()&&(this.sourceUpdater_.audioTimestampOffset(e.timestampOffset),t=!0),t&&this.trigger("timestampoffset");}},i.updateTimingInfoEnd_=function(e){e.timingInfo=e.timingInfo||{};var t=this.getMediaInfo_(),i="main"===this.loaderType_&&t&&t.hasVideo&&e.videoTimingInfo?e.videoTimingInfo:e.audioTimingInfo;i&&(e.timingInfo.end="number"==typeof i.end?i.end:i.start+e.duration);},i.handleAppendsDone_=function(){if(this.pendingSegment_&&this.trigger("appendsdone"),!this.pendingSegment_)return this.state="READY",void(this.paused()||this.monitorBuffer_());var e=this.pendingSegment_;this.updateTimingInfoEnd_(e),this.shouldSaveSegmentTimingInfo_&&this.syncController_.saveSegmentTimingInfo({segmentInfo:e,shouldSaveTimelineMapping:"main"===this.loaderType_});var t=Qs(e,this.sourceType_);if(t&&("warn"===t.severity?Yr.log.warn(t.message):this.logger_(t.message)),this.recordThroughput_(e),this.pendingSegment_=null,this.state="READY",!e.isSyncRequest||(this.trigger("syncinfoupdate"),e.hasAppendedData_)){this.logger_("Appended "+Ys(e)),this.addSegmentMetadataCue_(e),this.fetchAtBuffer_=!0,this.currentTimeline_!==e.timeline&&(this.timelineChangeController_.lastTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline}),"main"!==this.loaderType_||this.audioDisabled_||this.timelineChangeController_.lastTimelineChange({type:"audio",from:this.currentTimeline_,to:e.timeline})),this.currentTimeline_=e.timeline,this.trigger("syncinfoupdate");var i=e.segment;if(i.end&&this.currentTime_()-i.end>3*e.playlist.targetDuration)this.resetEverything();else null!==this.mediaIndex&&this.trigger("bandwidthupdate"),this.trigger("progress"),this.mediaIndex=e.mediaIndex,this.partIndex=e.partIndex,this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex)&&this.endOfStream(),this.trigger("appended"),e.hasAppendedData_&&this.mediaAppends++,this.paused()||this.monitorBuffer_();}else this.logger_("Throwing away un-appended sync request "+Ys(e));},i.recordThroughput_=function(e){if(e.duration<1/60)this.logger_("Ignoring segment's throughput because its duration of "+e.duration+" is less than the min to record "+1/60);else{var t=this.throughput.rate,i=Date.now()-e.endOfAllRequests+1,n=Math.floor(e.byteLength/i*8*1e3);this.throughput.rate+=(n-t)/++this.throughput.count;}},i.addSegmentMetadataCue_=function(e){if(this.segmentMetadataTrack_){var t=e.segment,i=t.start,n=t.end;if(Ws(i)&&Ws(n)){Gs(i,n,this.segmentMetadataTrack_);var r=A["default"].WebKitDataCue||A["default"].VTTCue,a={custom:t.custom,dateTimeObject:t.dateTimeObject,dateTimeString:t.dateTimeString,bandwidth:e.playlist.attributes.BANDWIDTH,resolution:e.playlist.attributes.RESOLUTION,codecs:e.playlist.attributes.CODECS,byteLength:e.byteLength,uri:e.uri,timeline:e.timeline,playlist:e.playlist.id,start:i,end:n},s=new r(i,n,JSON.stringify(a));s.value=a,this.segmentMetadataTrack_.addCue(s);}}},t;}(Yr.EventTarget);function Js(){}var Zs,eo=function eo(e){return"string"!=typeof e?e:e.replace(/./,function(e){return e.toUpperCase();});},to=["video","audio"],io=function io(e,t){var i=t[e+"Buffer"];return i&&i.updating||t.queuePending[e];},no=function e(t,i){if(0!==i.queue.length){var n=0,r=i.queue[n];if("mediaSource"!==r.type){if("mediaSource"!==t&&i.ready()&&"closed"!==i.mediaSource.readyState&&!io(t,i)){if(r.type!==t){if(null===(n=function(e,t){for(var i=0;i=e.playlist.segments.length){e=null;break;}e=this.generateSegmentInfo_({playlist:e.playlist,mediaIndex:e.mediaIndex+1,startOfSegment:e.startOfSegment+e.duration,isSyncRequest:e.isSyncRequest});}return e;},i.stopForError=function(e){this.error(e),this.state="READY",this.pause(),this.trigger("error");},i.segmentRequestFinished_=function(e,t,i){var n=this;if(this.subtitlesTrack_){if(this.saveTransferStats_(t.stats),!this.pendingSegment_)return this.state="READY",void(this.mediaRequestsAborted+=1);if(e)return e.code===ys&&this.handleTimeout_(),e.code===vs?this.mediaRequestsAborted+=1:this.mediaRequestsErrored+=1,void this.stopForError(e);var r=this.pendingSegment_;this.saveBandwidthRelatedStats_(r.duration,t.stats),this.state="APPENDING",this.trigger("appending");var a=r.segment;if(a.map&&(a.map.bytes=t.map.bytes),r.bytes=t.bytes,"function"!=typeof A["default"].WebVTT&&this.subtitlesTrack_&&this.subtitlesTrack_.tech_){var s,o=function o(){n.subtitlesTrack_.tech_.off("vttjsloaded",s),n.stopForError({message:"Error loading vtt.js"});};return s=function s(){n.subtitlesTrack_.tech_.off("vttjserror",o),n.segmentRequestFinished_(e,t,i);},this.state="WAITING_ON_VTTJS",this.subtitlesTrack_.tech_.one("vttjsloaded",s),void this.subtitlesTrack_.tech_.one("vttjserror",o);}a.requested=!0;try{this.parseVTTCues_(r);}catch(e){return void this.stopForError({message:e.message});}if(this.updateTimeMapping_(r,this.syncController_.timelines[r.timeline],this.playlist_),r.cues.length?r.timingInfo={start:r.cues[0].startTime,end:r.cues[r.cues.length-1].endTime}:r.timingInfo={start:r.startOfSegment,end:r.startOfSegment+r.duration},r.isSyncRequest)return this.trigger("syncinfoupdate"),this.pendingSegment_=null,void(this.state="READY");r.byteLength=r.bytes.byteLength,this.mediaSecondsLoaded+=a.duration,r.cues.forEach(function(e){n.subtitlesTrack_.addCue(n.featuresNativeTextTracks_?new A["default"].VTTCue(e.startTime,e.endTime,e.text):e);}),function(e){var t=e.cues;if(t)for(var i=0;i1&&n.push(t[a]);}n.length&&n.forEach(function(t){return e.removeCue(t);});}}(this.subtitlesTrack_),this.handleAppendsDone_();}else this.state="READY";},i.handleData_=function(){},i.updateTimingInfoEnd_=function(){},i.parseVTTCues_=function(e){var t,i=!1;"function"==typeof A["default"].TextDecoder?t=new A["default"].TextDecoder("utf8"):(t=A["default"].WebVTT.StringDecoder(),i=!0);var n=new A["default"].WebVTT.Parser(A["default"],A["default"].vttjs,t);if(e.cues=[],e.timestampmap={MPEGTS:0,LOCAL:0},n.oncue=e.cues.push.bind(e.cues),n.ontimestampmap=function(t){e.timestampmap=t;},n.onparsingerror=function(e){Yr.log.warn("Error encountered when parsing cues: "+e.message);},e.segment.map){var r=e.segment.map.bytes;i&&(r=bo(r)),n.parse(r);}var a=e.bytes;i&&(a=bo(a)),n.parse(a),n.flush();},i.updateTimeMapping_=function(e,t,i){var n=e.segment;if(t)if(e.cues.length){var r=e.timestampmap,a=r.MPEGTS/E.ONE_SECOND_IN_TS-r.LOCAL+t.mapping;if(e.cues.forEach(function(e){e.startTime+=a,e.endTime+=a;}),!i.syncInfo){var s=e.cues[0].startTime,o=e.cues[e.cues.length-1].startTime;i.syncInfo={mediaSequence:i.mediaSequence+e.mediaIndex,time:Math.min(s,o-n.duration)};}}else n.empty=!0;},t;}($s),Eo=function Eo(e,t){for(var i=e.cues,n=0;n=r.adStartTime&&t<=r.adEndTime)return r;}return null;},wo=[{name:"VOD",run:function run(e,t,i,n,r){if(i!==1/0){return{time:0,segmentIndex:0,partIndex:null};}return null;}},{name:"ProgramDateTime",run:function run(e,t,i,n,r){if(!Object.keys(e.timelineToDatetimeMappings).length)return null;var a=null,s=null,o=aa(t);r=r||0;for(var u=0;u=c)&&(s=c,a={time:h,segmentIndex:l.segmentIndex,partIndex:l.partIndex});}}return a;}},{name:"Discontinuity",run:function run(e,t,i,n,r){var a=null;if(r=r||0,t.discontinuityStarts&&t.discontinuityStarts.length)for(var s=null,o=0;o=h)&&(s=h,a={time:d.time,segmentIndex:u,partIndex:null});}}return a;}},{name:"Playlist",run:function run(e,t,i,n,r){return t.syncInfo?{time:t.syncInfo.time,segmentIndex:t.syncInfo.mediaSequence-t.mediaSequence,partIndex:null}:null;}}],Co=function(e){function t(t){var i;return(i=e.call(this)||this).timelines=[],i.discontinuities=[],i.timelineToDatetimeMappings={},i.logger_=$r("SyncController"),i;}P["default"](t,e);var i=t.prototype;return i.getSyncPoint=function(e,t,i,n){var r=this.runStrategies_(e,t,i,n);return r.length?this.selectSyncPoint_(r,{key:"time",value:n}):null;},i.getExpiredTime=function(e,t){if(!e||!e.segments)return null;var i=this.runStrategies_(e,t,e.discontinuitySequence,0);if(!i.length)return null;var n=this.selectSyncPoint_(i,{key:"segmentIndex",value:0});return n.segmentIndex>0&&(n.time*=-1),Math.abs(n.time+ha({defaultDuration:e.targetDuration,durationList:e.segments,startIndex:n.segmentIndex,endIndex:0}));},i.runStrategies_=function(e,t,i,n){for(var r=[],a=0;a=0;i--){var n=e.segments[i];if(n&&void 0!==n.start){t.syncInfo={mediaSequence:e.mediaSequence+i,time:n.start},this.logger_("playlist refresh sync: [time:"+t.syncInfo.time+", mediaSequence: "+t.syncInfo.mediaSequence+"]"),this.trigger("syncinfoupdate");break;}}},i.setDateTimeMappingForStart=function(e){if(this.timelineToDatetimeMappings={},e.segments&&e.segments.length&&e.segments[0].dateTimeObject){var t=e.segments[0],i=t.dateTimeObject.getTime()/1e3;this.timelineToDatetimeMappings[t.timeline]=-i;}},i.saveSegmentTimingInfo=function(e){var t=e.segmentInfo,i=e.shouldSaveTimelineMapping,n=this.calculateSegmentTimeMapping_(t,t.timingInfo,i),r=t.segment;n&&(this.saveDiscontinuitySyncInfo_(t),t.playlist.syncInfo||(t.playlist.syncInfo={mediaSequence:t.playlist.mediaSequence+t.mediaIndex,time:r.start}));var a=r.dateTimeObject;r.discontinuity&&i&&a&&(this.timelineToDatetimeMappings[r.timeline]=-a.getTime()/1e3);},i.timestampOffsetForTimeline=function(e){return void 0===this.timelines[e]?null:this.timelines[e].time;},i.mappingForTimeline=function(e){return void 0===this.timelines[e]?null:this.timelines[e].mapping;},i.calculateSegmentTimeMapping_=function(e,t,i){var n,r,a=e.segment,s=e.part,o=this.timelines[e.timeline];if("number"==typeof e.timestampOffset)o={time:e.startOfSegment,mapping:e.startOfSegment-t.start},i&&(this.timelines[e.timeline]=o,this.trigger("timestampoffset"),this.logger_("time mapping for timeline "+e.timeline+": [time: "+o.time+"] [mapping: "+o.mapping+"]")),n=e.startOfSegment,r=t.end+o.mapping;else{if(!o)return!1;n=t.start+o.mapping,r=t.end+o.mapping;}return s&&(s.start=n,s.end=r),(!a.start||no){var u=void 0;u=s<0?i.start-ha({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex,endIndex:r}):i.end+ha({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex+1,endIndex:r}),this.discontinuities[a]={time:u,accuracy:o};}}},i.dispose=function(){this.trigger("dispose"),this.off();},t;}(Yr.EventTarget),Ao=function(e){function t(){var t;return(t=e.call(this)||this).pendingTimelineChanges_={},t.lastTimelineChanges_={},t;}P["default"](t,e);var i=t.prototype;return i.clearPendingTimelineChange=function(e){this.pendingTimelineChanges_[e]=null,this.trigger("pendingtimelinechange");},i.pendingTimelineChange=function(e){var t=e.type,i=e.from,n=e.to;return"number"==typeof i&&"number"==typeof n&&(this.pendingTimelineChanges_[t]={type:t,from:i,to:n},this.trigger("pendingtimelinechange")),this.pendingTimelineChanges_[t];},i.lastTimelineChange=function(e){var t=e.type,i=e.from,n=e.to;return"number"==typeof i&&"number"==typeof n&&(this.lastTimelineChanges_[t]={type:t,from:i,to:n},delete this.pendingTimelineChanges_[t],this.trigger("timelinechange")),this.lastTimelineChanges_[t];},i.dispose=function(){this.trigger("dispose"),this.pendingTimelineChanges_={},this.lastTimelineChanges_={},this.off();},t;}(Yr.EventTarget),ko=as(ss(os(function(){function e(e,t,i){return e(i={path:t,exports:{},require:function require(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs");}(null==t&&i.path);}},i.exports),i.exports;}var t=e(function(e){function t(e,t){for(var i=0;i-1;},t.trigger=function(e){var t=this.listeners[e];if(t)if(2===arguments.length)for(var i=t.length,n=0;n>7))^e]=e;}for(t=i=0;!h[t];t^=n||1,i=p[i]||1){for(a=(a=i^i<<1^i<<2^i<<3^i<<4)>>8^255&a^99,h[t]=a,c[a]=t,o=16843009*f[r=f[n=f[t]]]^65537*r^257*n^16843008*t,s=257*f[a]^16843008*a,e=0;e<4;e++){l[e][t]=s=s<<24^s>>>8,d[e][a]=o=o<<24^o>>>8;}}for(e=0;e<5;e++){l[e]=l[e].slice(0),d[e]=d[e].slice(0);}return u;}()),this._tables=[[a[0][0].slice(),a[0][1].slice(),a[0][2].slice(),a[0][3].slice(),a[0][4].slice()],[a[1][0].slice(),a[1][1].slice(),a[1][2].slice(),a[1][3].slice(),a[1][4].slice()]];var r=this._tables[0][4],s=this._tables[1],o=e.length,u=1;if(4!==o&&6!==o&&8!==o)throw new Error("Invalid aes key size");var l=e.slice(0),d=[];for(this._key=[l,d],t=o;t<4*o+28;t++){n=l[t-1],(t%o==0||8===o&&t%o==4)&&(n=r[n>>>24]<<24^r[n>>16&255]<<16^r[n>>8&255]<<8^r[255&n],t%o==0&&(n=n<<8^n>>>24^u<<24,u=u<<1^283*(u>>7))),l[t]=l[t-o]^n;}for(i=0;t;i++,t--){n=l[3&i?t:t-4],d[i]=t<=4||i<4?n:s[0][r[n>>>24]]^s[1][r[n>>16&255]]^s[2][r[n>>8&255]]^s[3][r[255&n]];}}return e.prototype.decrypt=function(e,t,i,n,r,a){var s,o,u,l,d=this._key[1],h=e^d[0],c=n^d[1],f=i^d[2],p=t^d[3],m=d.length/4-2,g=4,_=this._tables[1],y=_[0],v=_[1],b=_[2],T=_[3],S=_[4];for(l=0;l>>24]^v[c>>16&255]^b[f>>8&255]^T[255&p]^d[g],o=y[c>>>24]^v[f>>16&255]^b[p>>8&255]^T[255&h]^d[g+1],u=y[f>>>24]^v[p>>16&255]^b[h>>8&255]^T[255&c]^d[g+2],p=y[p>>>24]^v[h>>16&255]^b[c>>8&255]^T[255&f]^d[g+3],g+=4,h=s,c=o,f=u;}for(l=0;l<4;l++){r[(3&-l)+a]=S[h>>>24]<<24^S[c>>16&255]<<16^S[f>>8&255]<<8^S[255&p]^d[g++],s=h,h=c,c=f,f=p,p=s;}},e;}(),o=function(e){function t(){var t;return(t=e.call(this,r)||this).jobs=[],t.delay=1,t.timeout_=null,t;}n(t,e);var i=t.prototype;return i.processJob_=function(){this.jobs.shift()(),this.jobs.length?this.timeout_=setTimeout(this.processJob_.bind(this),this.delay):this.timeout_=null;},i.push=function(e){this.jobs.push(e),this.timeout_||(this.timeout_=setTimeout(this.processJob_.bind(this),this.delay));},t;}(r),u=function u(e){return e<<24|(65280&e)<<8|(16711680&e)>>8|e>>>24;},l=function(){function e(t,i,n,r){var a=e.STEP,s=new Int32Array(t.buffer),l=new Uint8Array(t.byteLength),d=0;for(this.asyncStream_=new o(),this.asyncStream_.push(this.decryptChunk_(s.subarray(d,d+a),i,n,l)),d=a;d>2),m=new s(Array.prototype.slice.call(t)),g=new Uint8Array(e.byteLength),_=new Int32Array(g.buffer);for(n=i[0],r=i[1],a=i[2],o=i[3],f=0;f=0&&(t="main-desc"),t;},Io=function Io(e,t){e.abort(),e.pause(),t&&t.activePlaylistLoader&&(t.activePlaylistLoader.pause(),t.activePlaylistLoader=null);},Po=function Po(e,t){t.activePlaylistLoader=e,e.load();},Lo={AUDIO:function AUDIO(e,t){return function(){var i=t.segmentLoaders[e],n=t.mediaTypes[e],r=t.blacklistCurrentPlaylist;Io(i,n);var a=n.activeTrack(),s=n.activeGroup(),o=(s.filter(function(e){return e["default"];})[0]||s[0]).id,u=n.tracks[o];if(a!==u){for(var l in Yr.log.warn("Problem encountered loading the alternate audio track.Switching back to default."),n.tracks){n.tracks[l].enabled=n.tracks[l]===u;}n.onTrackChanged();}else r({message:"Problem encountered loading the default audio track."});};},SUBTITLES:function SUBTITLES(e,t){return function(){var i=t.segmentLoaders[e],n=t.mediaTypes[e];Yr.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track."),Io(i,n);var r=n.activeTrack();r&&(r.mode="disabled"),n.onTrackChanged();};}},Do={AUDIO:function AUDIO(e,t,i){if(t){var n=i.tech,r=i.requestOptions,a=i.segmentLoaders[e];t.on("loadedmetadata",function(){var e=t.media();a.playlist(e,r),(!n.paused()||e.endList&&"none"!==n.preload())&&a.load();}),t.on("loadedplaylist",function(){a.playlist(t.media(),r),n.paused()||a.load();}),t.on("error",Lo[e](e,i));}},SUBTITLES:function SUBTITLES(e,t,i){var n=i.tech,r=i.requestOptions,a=i.segmentLoaders[e],s=i.mediaTypes[e];t.on("loadedmetadata",function(){var e=t.media();a.playlist(e,r),a.track(s.activeTrack()),(!n.paused()||e.endList&&"none"!==n.preload())&&a.load();}),t.on("loadedplaylist",function(){a.playlist(t.media(),r),n.paused()||a.load();}),t.on("error",Lo[e](e,i));}},Uo={AUDIO:function AUDIO(e,t){var i=t.vhs,n=t.sourceType,r=t.segmentLoaders[e],a=t.requestOptions,s=t.master.mediaGroups,o=t.mediaTypes[e],u=o.groups,l=o.tracks,d=o.logger_,h=t.masterPlaylistLoader,c=ba(h.master);for(var f in s[e]&&0!==Object.keys(s[e]).length||(s[e]={main:{"default":{"default":!0}}},c&&(s[e].main["default"].playlists=h.master.playlists)),s[e]){for(var p in u[f]||(u[f]=[]),s[e][f]){var m=s[e][f][p],g=void 0;if(c?(d("AUDIO group '"+f+"' label '"+p+"' is a master playlist"),m.isMasterPlaylist=!0,g=null):g="vhs-json"===n&&m.playlists?new Oa(m.playlists[0],i,a):m.resolvedUri?new Oa(m.resolvedUri,i,a):m.playlists&&"dash"===n?new is(m.playlists[0],i,a,h):null,m=Yr.mergeOptions({id:p,playlistLoader:g},m),Do[e](e,m.playlistLoader,t),u[f].push(m),void 0===l[p]){var _=new Yr.AudioTrack({id:p,kind:xo(m),enabled:!1,language:m.language,"default":m["default"],label:p});l[p]=_;}}}r.on("error",Lo[e](e,t));},SUBTITLES:function SUBTITLES(e,t){var i=t.tech,n=t.vhs,r=t.sourceType,a=t.segmentLoaders[e],s=t.requestOptions,o=t.master.mediaGroups,u=t.mediaTypes[e],l=u.groups,d=u.tracks,h=t.masterPlaylistLoader;for(var c in o[e]){for(var f in l[c]||(l[c]=[]),o[e][c]){if(!o[e][c][f].forced){var p=o[e][c][f],m=void 0;if("hls"===r)m=new Oa(p.resolvedUri,n,s);else if("dash"===r){if(!p.playlists.filter(function(e){return e.excludeUntil!==1/0;}).length)return;m=new is(p.playlists[0],n,s,h);}else"vhs-json"===r&&(m=new Oa(p.playlists?p.playlists[0]:p.resolvedUri,n,s));if(p=Yr.mergeOptions({id:f,playlistLoader:m},p),Do[e](e,p.playlistLoader,t),l[c].push(p),void 0===d[f]){var g=i.addRemoteTextTrack({id:f,kind:"subtitles","default":p["default"]&&p.autoselect,language:p.language,label:f},!1).track;d[f]=g;}}}}a.on("error",Lo[e](e,t));},"CLOSED-CAPTIONS":function CLOSEDCAPTIONS(e,t){var i=t.tech,n=t.master.mediaGroups,r=t.mediaTypes[e],a=r.groups,s=r.tracks;for(var o in n[e]){for(var u in a[o]||(a[o]=[]),n[e][o]){var l=n[e][o][u];if(/^(?:CC|SERVICE)/.test(l.instreamId)){var d=i.options_.vhs&&i.options_.vhs.captionServices||{},h={label:u,language:l.language,instreamId:l.instreamId,"default":l["default"]&&l.autoselect};if(d[h.instreamId]&&(h=Yr.mergeOptions(h,d[h.instreamId])),void 0===h["default"]&&delete h["default"],a[o].push(Yr.mergeOptions({id:u},l)),void 0===s[u]){var c=i.addRemoteTextTrack({id:h.instreamId,kind:"captions","default":h["default"],language:h.language,label:h.label},!1).track;s[u]=c;}}}}}},Ro=function e(t,i){for(var n=0;n1&&ba(t.master))for(var u=0;u "+a+" from "+t),this.tech_.trigger({type:"usage",name:"vhs-rendition-change-"+t})),this.masterPlaylistLoader_.media(e,i);},i.startABRTimer_=function(){var e=this;this.stopABRTimer_(),this.abrTimer_=A["default"].setInterval(function(){return e.checkABR_();},250);},i.stopABRTimer_=function(){this.tech_.scrubbing&&this.tech_.scrubbing()||(A["default"].clearInterval(this.abrTimer_),this.abrTimer_=null);},i.getAudioTrackPlaylists_=function(){var e=this.master(),t=e&&e.playlists||[];if(!e||!e.mediaGroups||!e.mediaGroups.AUDIO)return t;var i,n=e.mediaGroups.AUDIO,r=Object.keys(n);if(Object.keys(this.mediaTypes_.AUDIO.groups).length)i=this.mediaTypes_.AUDIO.activeTrack();else{var a=n.main||r.length&&n[r[0]];for(var s in a){if(a[s]["default"]){i={label:s};break;}}}if(!i)return t;var o=[];for(var u in n){if(n[u][i.label]){var l=n[u][i.label];if(l.playlists&&l.playlists.length)o.push.apply(o,l.playlists);else if(l.uri)o.push(l);else if(e.playlists.length)for(var d=0;d1&&(this.tech_.trigger({type:"usage",name:"vhs-alternate-audio"}),this.tech_.trigger({type:"usage",name:"hls-alternate-audio"})),this.useCueTags_&&(this.tech_.trigger({type:"usage",name:"vhs-playlist-cue-tags"}),this.tech_.trigger({type:"usage",name:"hls-playlist-cue-tags"}));},i.shouldSwitchToMedia_=function(e){var t=this.masterPlaylistLoader_.media(),i=this.tech_.buffered();return function(e){var t=e.currentPlaylist,i=e.nextPlaylist,n=e.forwardBuffer,r=e.bufferLowWaterLine,a=e.bufferHighWaterLine,s=e.duration,o=e.experimentalBufferBasedABR,u=e.log;if(!i)return Yr.log.warn("We received no playlist to switch to. Please check your stream."),!1;var l="allowing switch "+(t&&t.id||"null")+" -> "+i.id;if(!t)return u(l+" as current playlist is not set"),!0;if(i.id===t.id)return!1;if(!t.endList)return u(l+" as current playlist is live"),!0;var d=o?ns.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:ns.MAX_BUFFER_LOW_WATER_LINE;if(sc)&&n>=r){var p=l+" as forwardBuffer >= bufferLowWaterLine ("+n+" >= "+r+")";return o&&(p+=" and next bandwidth > current bandwidth ("+h+" > "+c+")"),u(p),!0;}return u("not "+l+" as no switching criteria met"),!1;}({currentPlaylist:t,nextPlaylist:e,forwardBuffer:i.length?i.end(i.length-1)-this.tech_.currentTime():0,bufferLowWaterLine:this.bufferLowWaterLine(),bufferHighWaterLine:this.bufferHighWaterLine(),duration:this.duration(),experimentalBufferBasedABR:this.experimentalBufferBasedABR,log:this.logger_});},i.setupSegmentLoaderListeners_=function(){var e=this;this.experimentalBufferBasedABR||(this.mainSegmentLoader_.on("bandwidthupdate",function(){var t=e.selectPlaylist();e.shouldSwitchToMedia_(t)&&e.switchMedia_(t,"bandwidthupdate"),e.tech_.trigger("bandwidthupdate");}),this.mainSegmentLoader_.on("progress",function(){e.trigger("progress");})),this.mainSegmentLoader_.on("error",function(){e.blacklistCurrentPlaylist(e.mainSegmentLoader_.error());}),this.mainSegmentLoader_.on("appenderror",function(){e.error=e.mainSegmentLoader_.error_,e.trigger("error");}),this.mainSegmentLoader_.on("syncinfoupdate",function(){e.onSyncInfoUpdate_();}),this.mainSegmentLoader_.on("timestampoffset",function(){e.tech_.trigger({type:"usage",name:"vhs-timestamp-offset"}),e.tech_.trigger({type:"usage",name:"hls-timestamp-offset"});}),this.audioSegmentLoader_.on("syncinfoupdate",function(){e.onSyncInfoUpdate_();}),this.audioSegmentLoader_.on("appenderror",function(){e.error=e.audioSegmentLoader_.error_,e.trigger("error");}),this.mainSegmentLoader_.on("ended",function(){e.logger_("main segment loader ended"),e.onEndOfStream();}),this.mainSegmentLoader_.on("earlyabort",function(t){e.experimentalBufferBasedABR||(e.delegateLoaders_("all",["abort"]),e.blacklistCurrentPlaylist({message:"Aborted early because there isn't enough bandwidth to complete the request without rebuffering."},120));});var t=function t(){if(!e.sourceUpdater_.hasCreatedSourceBuffers())return e.tryToCreateSourceBuffers_();var t=e.getCodecsOrExclude_();t&&e.sourceUpdater_.addOrChangeSourceBuffers(t);};this.mainSegmentLoader_.on("trackinfo",t),this.audioSegmentLoader_.on("trackinfo",t),this.mainSegmentLoader_.on("fmp4",function(){e.triggeredFmp4Usage||(e.tech_.trigger({type:"usage",name:"vhs-fmp4"}),e.tech_.trigger({type:"usage",name:"hls-fmp4"}),e.triggeredFmp4Usage=!0);}),this.audioSegmentLoader_.on("fmp4",function(){e.triggeredFmp4Usage||(e.tech_.trigger({type:"usage",name:"vhs-fmp4"}),e.tech_.trigger({type:"usage",name:"hls-fmp4"}),e.triggeredFmp4Usage=!0);}),this.audioSegmentLoader_.on("ended",function(){e.logger_("audioSegmentLoader ended"),e.onEndOfStream();});},i.mediaSecondsLoaded_=function(){return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded+this.mainSegmentLoader_.mediaSecondsLoaded);},i.load=function(){this.mainSegmentLoader_.load(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.load(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.load();},i.smoothQualityChange_=function(e){void 0===e&&(e=this.selectPlaylist()),this.fastQualityChange_(e);},i.fastQualityChange_=function(e){var t=this;void 0===e&&(e=this.selectPlaylist()),e!==this.masterPlaylistLoader_.media()?(this.switchMedia_(e,"fast-quality"),this.mainSegmentLoader_.resetEverything(function(){Yr.browser.IE_VERSION||Yr.browser.IS_EDGE?t.tech_.setCurrentTime(t.tech_.currentTime()+.04):t.tech_.setCurrentTime(t.tech_.currentTime());})):this.logger_("skipping fastQualityChange because new media is same as old");},i.play=function(){if(!this.setupFirstPlay()){this.tech_.ended()&&this.tech_.setCurrentTime(0),this.hasPlayed_&&this.load();var e=this.tech_.seekable();return this.tech_.duration()===1/0&&this.tech_.currentTime()this.maxPlaylistRetries?1/0:Date.now()+1e3*t,i.excludeUntil=n,e.reason&&(i.lastExcludeReason_=e.reason),this.tech_.trigger("blacklistplaylist"),this.tech_.trigger({type:"usage",name:"vhs-rendition-blacklisted"}),this.tech_.trigger({type:"usage",name:"hls-rendition-blacklisted"});var u=this.selectPlaylist();if(!u)return this.error="Playback cannot continue. No available working or supported playlists.",void this.trigger("error");var l=e.internal?this.logger_:Yr.log.warn,d=e.message?" "+e.message:"";l((e.internal?"Internal problem":"Problem")+" encountered with playlist "+i.id+"."+d+" Switching to playlist "+u.id+"."),u.attributes.AUDIO!==i.attributes.AUDIO&&this.delegateLoaders_("audio",["abort","pause"]),u.attributes.SUBTITLES!==i.attributes.SUBTITLES&&this.delegateLoaders_("subtitle",["abort","pause"]),this.delegateLoaders_("main",["abort","pause"]);var h=u.targetDuration/2*1e3||5e3,c="number"==typeof u.lastRequest&&Date.now()-u.lastRequest<=h;return this.switchMedia_(u,"exclude",s||c);},i.pauseLoading=function(){this.delegateLoaders_("all",["abort","pause"]),this.stopABRTimer_();},i.delegateLoaders_=function(e,t){var i=this,n=[],r="all"===e;(r||"main"===e)&&n.push(this.masterPlaylistLoader_);var a=[];(r||"audio"===e)&&a.push("AUDIO"),(r||"subtitle"===e)&&(a.push("CLOSED-CAPTIONS"),a.push("SUBTITLES")),a.forEach(function(e){var t=i.mediaTypes_[e]&&i.mediaTypes_[e].activePlaylistLoader;t&&n.push(t);}),["main","audio","subtitle"].forEach(function(t){var r=i[t+"SegmentLoader_"];!r||e!==t&&"all"!==e||n.push(r);}),n.forEach(function(e){return t.forEach(function(t){"function"==typeof e[t]&&e[t]();});});},i.setCurrentTime=function(e){var t=Zr(this.tech_.buffered(),e);return this.masterPlaylistLoader_&&this.masterPlaylistLoader_.media()&&this.masterPlaylistLoader_.media().segments?t&&t.length?e:(this.mainSegmentLoader_.resetEverything(),this.mainSegmentLoader_.abort(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.resetEverything(),this.audioSegmentLoader_.abort()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.resetEverything(),this.subtitleSegmentLoader_.abort()),void this.load()):0;},i.duration=function(){if(!this.masterPlaylistLoader_)return 0;var e=this.masterPlaylistLoader_.media();return e?e.endList?this.mediaSource?this.mediaSource.duration:Zs.Playlist.duration(e):1/0:0;},i.seekable=function(){return this.seekable_;},i.onSyncInfoUpdate_=function(){var e;if(this.masterPlaylistLoader_){var t=this.masterPlaylistLoader_.media();if(t){var i=this.syncController_.getExpiredTime(t,this.duration());if(null!==i){var n=this.masterPlaylistLoader_.master,r=Zs.Playlist.seekable(t,i,Zs.Playlist.liveEdgeDelay(n,t));if(0!==r.length){if(this.mediaTypes_.AUDIO.activePlaylistLoader){if(t=this.mediaTypes_.AUDIO.activePlaylistLoader.media(),null===(i=this.syncController_.getExpiredTime(t,this.duration())))return;if(0===(e=Zs.Playlist.seekable(t,i,Zs.Playlist.liveEdgeDelay(n,t))).length)return;}var a,s;this.seekable_&&this.seekable_.length&&(a=this.seekable_.end(0),s=this.seekable_.start(0)),e?e.start(0)>r.end(0)||r.start(0)>e.end(0)?this.seekable_=r:this.seekable_=Yr.createTimeRanges([[e.start(0)>r.start(0)?e.start(0):r.start(0),e.end(0)0&&(n=Math.max(n,i.end(i.length-1))),this.mediaSource.duration!==n&&this.sourceUpdater_.setDuration(n);}},i.dispose=function(){var e=this;this.trigger("dispose"),this.decrypter_.terminate(),this.masterPlaylistLoader_.dispose(),this.mainSegmentLoader_.dispose(),this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_),["AUDIO","SUBTITLES"].forEach(function(t){var i=e.mediaTypes_[t].groups;for(var n in i){i[n].forEach(function(e){e.playlistLoader&&e.playlistLoader.dispose();});}}),this.audioSegmentLoader_.dispose(),this.subtitleSegmentLoader_.dispose(),this.sourceUpdater_.dispose(),this.timelineChangeController_.dispose(),this.stopABRTimer_(),this.updateDuration_&&this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.mediaSource.removeEventListener("durationchange",this.handleDurationChange_),this.mediaSource.removeEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.removeEventListener("sourceended",this.handleSourceEnded_),this.off();},i.master=function(){return this.masterPlaylistLoader_.master;},i.media=function(){return this.masterPlaylistLoader_.media()||this.initialMedia_;},i.areMediaTypesKnown_=function(){var e=!!this.mediaTypes_.AUDIO.activePlaylistLoader,t=!!this.mainSegmentLoader_.getCurrentMediaInfo_(),i=!e||!!this.audioSegmentLoader_.getCurrentMediaInfo_();return!(!t||!i);},i.getCodecsOrExclude_=function(){var e=this,t={main:this.mainSegmentLoader_.getCurrentMediaInfo_()||{},audio:this.audioSegmentLoader_.getCurrentMediaInfo_()||{}};t.video=t.main;var i=Os(this.master(),this.media()),n={},r=!!this.mediaTypes_.AUDIO.activePlaylistLoader;if(t.main.hasVideo&&(n.video=i.video||t.main.videoCodec||g.DEFAULT_VIDEO_CODEC),t.main.isMuxed&&(n.video+=","+(i.audio||t.main.audioCodec||g.DEFAULT_AUDIO_CODEC)),(t.main.hasAudio&&!t.main.isMuxed||t.audio.hasAudio||r)&&(n.audio=i.audio||t.main.audioCodec||t.audio.audioCodec||g.DEFAULT_AUDIO_CODEC,t.audio.isFmp4=t.main.hasAudio&&!t.main.isMuxed?t.main.isFmp4:t.audio.isFmp4),n.audio||n.video){var a,s={};if(["video","audio"].forEach(function(e){if(n.hasOwnProperty(e)&&(r=t[e].isFmp4,o=n[e],!(r?g.browserSupportsCodec(o):g.muxerSupportsCodec(o)))){var i=t[e].isFmp4?"browser":"muxer";s[i]=s[i]||[],s[i].push(n[e]),"audio"===e&&(a=i);}var r,o;}),r&&a&&this.media().attributes.AUDIO){var o=this.media().attributes.AUDIO;this.master().playlists.forEach(function(t){(t.attributes&&t.attributes.AUDIO)===o&&t!==e.media()&&(t.excludeUntil=1/0);}),this.logger_("excluding audio group "+o+" as "+a+' does not support codec(s): "'+n.audio+'"');}if(!Object.keys(s).length){if(this.sourceUpdater_.hasCreatedSourceBuffers()&&!this.sourceUpdater_.canChangeType()){var u=[];if(["video","audio"].forEach(function(t){var i=(g.parseCodecs(e.sourceUpdater_.codecs[t]||"")[0]||{}).type,r=(g.parseCodecs(n[t]||"")[0]||{}).type;i&&r&&i.toLowerCase()!==r.toLowerCase()&&u.push('"'+e.sourceUpdater_.codecs[t]+'" -> "'+n[t]+'"');}),u.length)return void this.blacklistCurrentPlaylist({playlist:this.media(),message:"Codec switching not supported: "+u.join(", ")+".",blacklistDuration:1/0,internal:!0});}return n;}var l=Object.keys(s).reduce(function(e,t){return e&&(e+=", "),e+=t+' does not support codec(s): "'+s[t].join(",")+'"';},"")+".";this.blacklistCurrentPlaylist({playlist:this.media(),internal:!0,message:l,blacklistDuration:1/0});}else this.blacklistCurrentPlaylist({playlist:this.media(),message:"Could not determine codecs for playlist.",blacklistDuration:1/0});},i.tryToCreateSourceBuffers_=function(){if("open"===this.mediaSource.readyState&&!this.sourceUpdater_.hasCreatedSourceBuffers()&&this.areMediaTypesKnown_()){var e=this.getCodecsOrExclude_();if(e){this.sourceUpdater_.createSourceBuffers(e);var t=[e.video,e.audio].filter(Boolean).join(",");this.excludeIncompatibleVariants_(t);}}},i.excludeUnsupportedVariants_=function(){var e=this,t=this.master().playlists,i=[];Object.keys(t).forEach(function(n){var r=t[n];if(-1===i.indexOf(r.id)){i.push(r.id);var a=Os(e.master,r),s=[];!a.audio||g.muxerSupportsCodec(a.audio)||g.browserSupportsCodec(a.audio)||s.push("audio codec "+a.audio),!a.video||g.muxerSupportsCodec(a.video)||g.browserSupportsCodec(a.video)||s.push("video codec "+a.video),a.text&&"stpp.ttml.im1t"===a.text&&s.push("text codec "+a.text),s.length&&(r.excludeUntil=1/0,e.logger_("excluding "+r.id+" for unsupported: "+s.join(", ")));}});},i.excludeIncompatibleVariants_=function(e){var t=this,i=[],n=this.master().playlists,r=Us(g.parseCodecs(e)),a=Rs(r),s=r.video&&g.parseCodecs(r.video)[0]||null,o=r.audio&&g.parseCodecs(r.audio)[0]||null;Object.keys(n).forEach(function(e){var r=n[e];if(-1===i.indexOf(r.id)&&r.excludeUntil!==1/0){i.push(r.id);var u=[],l=Os(t.masterPlaylistLoader_.master,r),d=Rs(l);if(l.audio||l.video){if(d!==a&&u.push('codec count "'+d+'" !== "'+a+'"'),!t.sourceUpdater_.canChangeType()){var h=l.video&&g.parseCodecs(l.video)[0]||null,c=l.audio&&g.parseCodecs(l.audio)[0]||null;h&&s&&h.type.toLowerCase()!==s.type.toLowerCase()&&u.push('video codec "'+h.type+'" !== "'+s.type+'"'),c&&o&&c.type.toLowerCase()!==o.type.toLowerCase()&&u.push('audio codec "'+c.type+'" !== "'+o.type+'"');}u.length&&(r.excludeUntil=1/0,t.logger_("blacklisting "+r.id+": "+u.join(" && ")));}}});},i.updateAdCues_=function(e){var t=0,i=this.seekable();i.length&&(t=i.start(0)),function(e,t,i){if(void 0===i&&(i=0),e.segments)for(var n,r=i,a=0;a0&&this.logger_("resetting possible stalled download count for "+e+" loader"),this[e+"StalledDownloads_"]=0,this[e+"Buffered_"]=t.buffered_();},t.checkSegmentDownloads_=function(e){var t=this.masterPlaylistController_,i=t[e+"SegmentLoader_"],n=i.buffered_(),r=function(e,t){if(e===t)return!1;if(!e&&t||!t&&e)return!0;if(e.length!==t.length)return!0;for(var i=0;i=t.end(t.length-1)))return this.techWaiting_();this.consecutiveUpdates>=5&&e===this.lastRecordedTime?(this.consecutiveUpdates++,this.waiting_()):e===this.lastRecordedTime?this.consecutiveUpdates++:(this.consecutiveUpdates=0,this.lastRecordedTime=e);}},t.cancelTimer_=function(){this.consecutiveUpdates=0,this.timer_&&(this.logger_("cancelTimer_"),clearTimeout(this.timer_)),this.timer_=null;},t.fixesBadSeeks_=function(){if(!this.tech_.seeking())return!1;var e,t=this.seekable(),i=this.tech_.currentTime();this.afterSeekableWindow_(t,i,this.media(),this.allowSeeksWithinUnsafeLiveWindow)&&(e=t.end(t.length-1));if(this.beforeSeekableWindow_(t,i)){var n=t.start(0);e=n+(n===t.end(0)?0:.1);}if(void 0!==e)return this.logger_("Trying to seek outside of seekable at time "+i+" with seekable range "+ta(t)+". Seeking to "+e+"."),this.tech_.setCurrentTime(e),!0;var r=this.tech_.buffered();return!!function(e){var t=e.buffered,i=e.targetDuration,n=e.currentTime;return!!t.length&&!(t.end(0)-t.start(0)<2*i)&&!(n>t.start(0))&&t.start(0)-n "+i.end(0)+"]. Attempting to resume playback by seeking to the current time."),this.tech_.trigger({type:"usage",name:"vhs-unknown-waiting"}),void this.tech_.trigger({type:"usage",name:"hls-unknown-waiting"})):void 0;}},t.techWaiting_=function(){var e=this.seekable(),t=this.tech_.currentTime();if(this.tech_.seeking()&&this.fixesBadSeeks_())return!0;if(this.tech_.seeking()||null!==this.timer_)return!0;if(this.beforeSeekableWindow_(e,t)){var i=e.end(e.length-1);return this.logger_("Fell out of live window at time "+t+". Seeking to live point (seekable end) "+i),this.cancelTimer_(),this.tech_.setCurrentTime(i),this.tech_.trigger({type:"usage",name:"vhs-live-resync"}),this.tech_.trigger({type:"usage",name:"hls-live-resync"}),!0;}var n=this.tech_.vhs.masterPlaylistController_.sourceUpdater_,r=this.tech_.buffered();if(this.videoUnderflow_({audioBuffered:n.audioBuffered(),videoBuffered:n.videoBuffered(),currentTime:t}))return this.cancelTimer_(),this.tech_.setCurrentTime(t),this.tech_.trigger({type:"usage",name:"vhs-video-underflow"}),this.tech_.trigger({type:"usage",name:"hls-video-underflow"}),!0;var a=ea(r,t);if(a.length>0){var s=a.start(0)-t;return this.logger_("Stopped at "+t+", setting timer for "+s+", seeking to "+a.start(0)),this.cancelTimer_(),this.timer_=setTimeout(this.skipTheGap_.bind(this),1e3*s,t),!0;}return!1;},t.afterSeekableWindow_=function(e,t,i,n){if(void 0===n&&(n=!1),!e.length)return!1;var r=e.end(e.length-1)+.1;return!i.endList&&n&&(r=e.end(e.length-1)+3*i.targetDuration),t>r;},t.beforeSeekableWindow_=function(e,t){return!!(e.length&&e.start(0)>0&&t2)return{start:r,end:a};}return null;},e;}(),zo={errorInterval:30,getSource:function getSource(e){return e(this.tech({IWillNotUseThisInPlugins:!0}).currentSource_||this.currentSource());}},Go=function Go(e){!function e(t,i){var n=0,r=0,a=Yr.mergeOptions(zo,i);t.ready(function(){t.trigger({type:"usage",name:"vhs-error-reload-initialized"}),t.trigger({type:"usage",name:"hls-error-reload-initialized"});});var s=function s(){r&&t.currentTime(r);},o=function o(e){null!=e&&(r=t.duration()!==1/0&&t.currentTime()||0,t.one("loadedmetadata",s),t.src(e),t.trigger({type:"usage",name:"vhs-error-reload"}),t.trigger({type:"usage",name:"hls-error-reload"}),t.play());},u=function u(){return Date.now()-n<1e3*a.errorInterval?(t.trigger({type:"usage",name:"vhs-error-reload-canceled"}),void t.trigger({type:"usage",name:"hls-error-reload-canceled"})):a.getSource&&"function"==typeof a.getSource?(n=Date.now(),a.getSource.call(t,o)):void Yr.log.error("ERROR: reloadSourceOnError - The option getSource must be a function!");},l=function e(){t.off("loadedmetadata",s),t.off("error",u),t.off("dispose",e);};t.on("error",u),t.on("dispose",l),t.reloadSourceOnError=function(i){l(),e(t,i);};}(this,e);},Wo={PlaylistLoader:Oa,Playlist:Ta,utils:Ka,STANDARD_PLAYLIST_SELECTOR:Hs,INITIAL_PLAYLIST_SELECTOR:function INITIAL_PLAYLIST_SELECTOR(){var e=this,t=this.playlists.master.playlists.filter(Ta.isEnabled);return Ns(t,function(e,t){return js(e,t);}),t.filter(function(t){return!!Os(e.playlists.master,t).video;})[0]||null;},lastBandwidthSelector:Hs,movingAverageBandwidthSelector:function movingAverageBandwidthSelector(e){var t=-1,i=-1;if(e<0||e>1)throw new Error("Moving average bandwidth decay must be between 0 and 1.");return function(){var n=this.useDevicePixelRatio&&A["default"].devicePixelRatio||1;return t<0&&(t=this.systemBandwidth,i=this.systemBandwidth),this.systemBandwidth>0&&this.systemBandwidth!==i&&(t=e*this.systemBandwidth+(1-e)*t,i=this.systemBandwidth),Vs(this.playlists.master,t,parseInt(Bs(this.tech_.el(),"width"),10)*n,parseInt(Bs(this.tech_.el(),"height"),10)*n,this.limitRenditionByPlayerDimensions,this.masterPlaylistController_);};},comparePlaylistBandwidth:js,comparePlaylistResolution:function comparePlaylistResolution(e,t){var i,n;return e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width&&(i=e.attributes.RESOLUTION.width),i=i||A["default"].Number.MAX_VALUE,t.attributes.RESOLUTION&&t.attributes.RESOLUTION.width&&(n=t.attributes.RESOLUTION.width),i===(n=n||A["default"].Number.MAX_VALUE)&&e.attributes.BANDWIDTH&&t.attributes.BANDWIDTH?e.attributes.BANDWIDTH-t.attributes.BANDWIDTH:i-n;},xhr:Na()};Object.keys(ns).forEach(function(e){Object.defineProperty(Wo,e,{get:function get(){return Yr.log.warn("using Vhs."+e+" is UNSAFE be sure you know what you are doing"),ns[e];},set:function set(t){Yr.log.warn("using Vhs."+e+" is UNSAFE be sure you know what you are doing"),"number"!=typeof t||t<0?Yr.log.warn("value of Vhs."+e+" must be greater than or equal to 0"):ns[e]=t;}});});var Yo=function Yo(e,t){for(var i=t.media(),n=-1,r=0;r0?1/this.throughput:0,Math.floor(1/(t+e));},set:function set(){Yr.log.error('The "systemBandwidth" property is read-only');}}}),this.options_.bandwidth&&(this.bandwidth=this.options_.bandwidth),this.options_.throughput&&(this.throughput=this.options_.throughput),Object.defineProperties(this.stats,{bandwidth:{get:function get(){return i.bandwidth||0;},enumerable:!0},mediaRequests:{get:function get(){return i.masterPlaylistController_.mediaRequests_()||0;},enumerable:!0},mediaRequestsAborted:{get:function get(){return i.masterPlaylistController_.mediaRequestsAborted_()||0;},enumerable:!0},mediaRequestsTimedout:{get:function get(){return i.masterPlaylistController_.mediaRequestsTimedout_()||0;},enumerable:!0},mediaRequestsErrored:{get:function get(){return i.masterPlaylistController_.mediaRequestsErrored_()||0;},enumerable:!0},mediaTransferDuration:{get:function get(){return i.masterPlaylistController_.mediaTransferDuration_()||0;},enumerable:!0},mediaBytesTransferred:{get:function get(){return i.masterPlaylistController_.mediaBytesTransferred_()||0;},enumerable:!0},mediaSecondsLoaded:{get:function get(){return i.masterPlaylistController_.mediaSecondsLoaded_()||0;},enumerable:!0},mediaAppends:{get:function get(){return i.masterPlaylistController_.mediaAppends_()||0;},enumerable:!0},mainAppendsToLoadedData:{get:function get(){return i.masterPlaylistController_.mainAppendsToLoadedData_()||0;},enumerable:!0},audioAppendsToLoadedData:{get:function get(){return i.masterPlaylistController_.audioAppendsToLoadedData_()||0;},enumerable:!0},appendsToLoadedData:{get:function get(){return i.masterPlaylistController_.appendsToLoadedData_()||0;},enumerable:!0},timeToLoadedData:{get:function get(){return i.masterPlaylistController_.timeToLoadedData_()||0;},enumerable:!0},buffered:{get:function get(){return ia(i.tech_.buffered());},enumerable:!0},currentTime:{get:function get(){return i.tech_.currentTime();},enumerable:!0},currentSource:{get:function get(){return i.tech_.currentSource_;},enumerable:!0},currentTech:{get:function get(){return i.tech_.name_;},enumerable:!0},duration:{get:function get(){return i.tech_.duration();},enumerable:!0},master:{get:function get(){return i.playlists.master;},enumerable:!0},playerDimensions:{get:function get(){return i.tech_.currentDimensions();},enumerable:!0},seekable:{get:function get(){return ia(i.tech_.seekable());},enumerable:!0},timestamp:{get:function get(){return Date.now();},enumerable:!0},videoPlaybackQuality:{get:function get(){return i.tech_.getVideoPlaybackQuality();},enumerable:!0}}),this.tech_.one("canplay",this.masterPlaylistController_.setupFirstPlay.bind(this.masterPlaylistController_)),this.tech_.on("bandwidthupdate",function(){i.options_.useBandwidthFromLocalStorage&&function(e){if(!A["default"].localStorage)return!1;var t=Xo();t=t?Yr.mergeOptions(t,e):e;try{A["default"].localStorage.setItem("videojs-vhs",JSON.stringify(t));}catch(e){return!1;}}({bandwidth:i.bandwidth,throughput:Math.round(i.throughput)});}),this.masterPlaylistController_.on("selectedinitialmedia",function(){var e;(e=i).representations=function(){var t=e.masterPlaylistController_.master(),i=ba(t)?e.masterPlaylistController_.getAudioTrackPlaylists_():t.playlists;return i?i.filter(function(e){return!pa(e);}).map(function(t,i){return new jo(e,t,t.id);}):[];};}),this.masterPlaylistController_.sourceUpdater_.on("createdsourcebuffers",function(){i.setupEme_();}),this.on(this.masterPlaylistController_,"progress",function(){this.tech_.trigger("progress");}),this.on(this.masterPlaylistController_,"firstplay",function(){this.ignoreNextSeekingEvent_=!0;}),this.setupQualityLevels_(),this.tech_.el()&&(this.mediaSourceUrl_=A["default"].URL.createObjectURL(this.masterPlaylistController_.mediaSource),this.tech_.src(this.mediaSourceUrl_));}},i.setupEme_=function(){var e=this,t=this.masterPlaylistController_.mediaTypes_.AUDIO.activePlaylistLoader,i=Ko({player:this.player_,sourceKeySystems:this.source_.keySystems,media:this.playlists.media(),audioMedia:t&&t.media()});this.player_.tech_.on("keystatuschange",function(t){"output-restricted"===t.status&&e.masterPlaylistController_.blacklistCurrentPlaylist({playlist:e.masterPlaylistController_.media(),message:"DRM keystatus changed to "+t.status+". Playlist will fail to play. Check for HDCP content.",blacklistDuration:1/0});}),11!==Yr.browser.IE_VERSION&&i?(this.logger_("waiting for EME key session creation"),qo({player:this.player_,sourceKeySystems:this.source_.keySystems,audioMedia:t&&t.media(),mainPlaylists:this.playlists.master.playlists}).then(function(){e.logger_("created EME key session"),e.masterPlaylistController_.sourceUpdater_.initializedEme();})["catch"](function(t){e.logger_("error while creating EME key session",t),e.player_.error({message:"Failed to initialize media keys for EME",code:3});})):this.masterPlaylistController_.sourceUpdater_.initializedEme();},i.setupQualityLevels_=function(){var e=this,t=Yr.players[this.tech_.options_.playerId];t&&t.qualityLevels&&!this.qualityLevels_&&(this.qualityLevels_=t.qualityLevels(),this.masterPlaylistController_.on("selectedinitialmedia",function(){var t,i;t=e.qualityLevels_,(i=e).representations().forEach(function(e){t.addQualityLevel(e);}),Yo(t,i.playlists);}),this.playlists.on("mediachange",function(){Yo(e.qualityLevels_,e.playlists);}));},t.version=function(){return{"@videojs/http-streaming":"2.10.2","mux.js":"5.13.0","mpd-parser":"0.19.0","m3u8-parser":"4.7.0","aes-decrypter":"3.1.2"};},i.version=function(){return this.constructor.version();},i.canChangeType=function(){return vo.canChangeType();},i.play=function(){this.masterPlaylistController_.play();},i.setCurrentTime=function(e){this.masterPlaylistController_.setCurrentTime(e);},i.duration=function(){return this.masterPlaylistController_.duration();},i.seekable=function(){return this.masterPlaylistController_.seekable();},i.dispose=function(){this.playbackWatcher_&&this.playbackWatcher_.dispose(),this.masterPlaylistController_&&this.masterPlaylistController_.dispose(),this.qualityLevels_&&this.qualityLevels_.dispose(),this.player_&&(delete this.player_.vhs,delete this.player_.dash,delete this.player_.hls),this.tech_&&this.tech_.vhs&&delete this.tech_.vhs,this.tech_&&delete this.tech_.hls,this.mediaSourceUrl_&&A["default"].URL.revokeObjectURL&&(A["default"].URL.revokeObjectURL(this.mediaSourceUrl_),this.mediaSourceUrl_=null),e.prototype.dispose.call(this);},i.convertToProgramTime=function(e,t){return Xa({playlist:this.masterPlaylistController_.media(),time:e,callback:t});},i.seekToProgramTime=function(e,t,i,n){return void 0===i&&(i=!0),void 0===n&&(n=2),Qa({programTime:e,playlist:this.masterPlaylistController_.media(),retryCount:n,pauseAfterSeek:i,seekTo:this.options_.seekTo,tech:this.options_.tech,callback:t});},t;}(Yr.getComponent("Component")),$o={name:"videojs-http-streaming",VERSION:"2.10.2",canHandleSource:function canHandleSource(e,t){void 0===t&&(t={});var i=Yr.mergeOptions(Yr.options,t);return $o.canPlayType(e.type,i);},handleSource:function handleSource(e,t,i){void 0===i&&(i={});var n=Yr.mergeOptions(Yr.options,i);return t.vhs=new Qo(e,t,n),Yr.hasOwnProperty("hls")||Object.defineProperty(t,"hls",{get:function get(){return Yr.log.warn("player.tech().hls is deprecated. Use player.tech().vhs instead."),t.vhs;},configurable:!0}),t.vhs.xhr=Na(),t.vhs.src(e.src,e.type),t.vhs;},canPlayType:function canPlayType(e,t){void 0===t&&(t={});var i=Yr.mergeOptions(Yr.options,t).vhs.overrideNative,n=void 0===i?!Yr.browser.IS_ANY_SAFARI:i,r=_.simpleTypeFromSourceType(e);return r&&(!Wo.supportsTypeNatively(r)||n)?"maybe":"";}};g.browserSupportsCodec("avc1.4d400d,mp4a.40.2")&&Yr.getTech("Html5").registerSourceHandler($o,0),Yr.VhsHandler=Qo,Object.defineProperty(Yr,"HlsHandler",{get:function get(){return Yr.log.warn("videojs.HlsHandler is deprecated. Use videojs.VhsHandler instead."),Qo;},configurable:!0}),Yr.VhsSourceHandler=$o,Object.defineProperty(Yr,"HlsSourceHandler",{get:function get(){return Yr.log.warn("videojs.HlsSourceHandler is deprecated. Use videojs.VhsSourceHandler instead."),$o;},configurable:!0}),Yr.Vhs=Wo,Object.defineProperty(Yr,"Hls",{get:function get(){return Yr.log.warn("videojs.Hls is deprecated. Use videojs.Vhs instead."),Wo;},configurable:!0}),Yr.use||(Yr.registerComponent("Hls",Wo),Yr.registerComponent("Vhs",Wo)),Yr.options.vhs=Yr.options.vhs||{},Yr.options.hls=Yr.options.hls||{},Yr.registerPlugin?Yr.registerPlugin("reloadSourceOnError",Go):Yr.plugin("reloadSourceOnError",Go),t.exports=Yr;},{"@babel/runtime/helpers/assertThisInitialized":1,"@babel/runtime/helpers/construct":2,"@babel/runtime/helpers/extends":3,"@babel/runtime/helpers/inherits":4,"@babel/runtime/helpers/inheritsLoose":5,"@videojs/vhs-utils/cjs/byte-helpers":9,"@videojs/vhs-utils/cjs/codecs.js":11,"@videojs/vhs-utils/cjs/containers":12,"@videojs/vhs-utils/cjs/id3-helpers":15,"@videojs/vhs-utils/cjs/media-types.js":16,"@videojs/vhs-utils/cjs/resolve-url.js":20,"@videojs/xhr":23,"global/document":34,"global/window":35,keycode:38,"m3u8-parser":39,"mpd-parser":41,"mux.js/lib/tools/parse-sidx":42,"mux.js/lib/utils/clock":43,"safe-json-parse/tuple":45,"videojs-vtt.js":48}],48:[function(e,t,i){var n=e("global/window"),r=t.exports={WebVTT:e("./vtt.js"),VTTCue:e("./vttcue.js"),VTTRegion:e("./vttregion.js")};n.vttjs=r,n.WebVTT=r.WebVTT;var a=r.VTTCue,s=r.VTTRegion,o=n.VTTCue,u=n.VTTRegion;r.shim=function(){n.VTTCue=a,n.VTTRegion=s;},r.restore=function(){n.VTTCue=o,n.VTTRegion=u;},n.VTTCue||r.shim();},{"./vtt.js":49,"./vttcue.js":50,"./vttregion.js":51,"global/window":35}],49:[function(e,t,i){var n=e("global/document"),r=Object.create||function(){function e(){}return function(t){if(1!==arguments.length)throw new Error("Object.create shim only accepts one parameter.");return e.prototype=t,new e();};}();function a(e,t){this.name="ParsingError",this.code=e.code,this.message=t||e.message;}function s(e){function t(e,t,i,n){return 3600*(0|e)+60*(0|t)+(0|i)+(0|n)/1e3;}var i=e.match(/^(\d+):(\d{1,2})(:\d{1,2})?\.(\d{3})/);return i?i[3]?t(i[1],i[2],i[3].replace(":",""),i[4]):i[1]>59?t(i[1],i[2],0,i[4]):t(0,i[1],i[2],i[4]):null;}function o(){this.values=r(null);}function u(e,t,i,n){var r=n?e.split(n):[e];for(var a in r){if("string"==typeof r[a]){var s=r[a].split(i);if(2===s.length)t(s[0],s[1]);}}}function l(e,t,i){var n=e;function r(){var t=s(e);if(null===t)throw new a(a.Errors.BadTimeStamp,"Malformed timestamp: "+n);return e=e.replace(/^[^\sa-zA-Z-]+/,""),t;}function l(){e=e.replace(/^\s+/,"");}if(l(),t.startTime=r(),l(),"--\x3e"!==e.substr(0,3))throw new a(a.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '--\x3e'): "+n);e=e.substr(3),l(),t.endTime=r(),l(),function(e,t){var n=new o();u(e,function(e,t){switch(e){case"region":for(var r=i.length-1;r>=0;r--){if(i[r].id===t){n.set(e,i[r].region);break;}}break;case"vertical":n.alt(e,t,["rl","lr"]);break;case"line":var a=t.split(","),s=a[0];n.integer(e,s),n.percent(e,s)&&n.set("snapToLines",!1),n.alt(e,s,["auto"]),2===a.length&&n.alt("lineAlign",a[1],["start","center","end"]);break;case"position":a=t.split(","),n.percent(e,a[0]),2===a.length&&n.alt("positionAlign",a[1],["start","center","end"]);break;case"size":n.percent(e,t);break;case"align":n.alt(e,t,["start","center","end","left","right"]);}},/:/,/\s/),t.region=n.get("region",null),t.vertical=n.get("vertical","");try{t.line=n.get("line","auto");}catch(e){}t.lineAlign=n.get("lineAlign","start"),t.snapToLines=n.get("snapToLines",!0),t.size=n.get("size",100);try{t.align=n.get("align","center");}catch(e){t.align=n.get("align","middle");}try{t.position=n.get("position","auto");}catch(e){t.position=n.get("position",{start:0,left:0,center:50,middle:50,end:100,right:100},t.align);}t.positionAlign=n.get("positionAlign",{start:"start",left:"start",center:"center",middle:"center",end:"end",right:"end"},t.align);}(e,t);}a.prototype=r(Error.prototype),a.prototype.constructor=a,a.Errors={BadSignature:{code:0,message:"Malformed WebVTT signature."},BadTimeStamp:{code:1,message:"Malformed time stamp."}},o.prototype={set:function set(e,t){this.get(e)||""===t||(this.values[e]=t);},get:function get(e,t,i){return i?this.has(e)?this.values[e]:t[i]:this.has(e)?this.values[e]:t;},has:function has(e){return e in this.values;},alt:function alt(e,t,i){for(var n=0;n=0&&t<=100)&&(this.set(e,t),!0);}};var d=n.createElement&&n.createElement("textarea"),h={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"},c={white:"rgba(255,255,255,1)",lime:"rgba(0,255,0,1)",cyan:"rgba(0,255,255,1)",red:"rgba(255,0,0,1)",yellow:"rgba(255,255,0,1)",magenta:"rgba(255,0,255,1)",blue:"rgba(0,0,255,1)",black:"rgba(0,0,0,1)"},f={v:"title",lang:"lang"},p={rt:"ruby"};function m(e,t){function i(){if(!t)return null;var e,i=t.match(/^([^<]*)(<[^>]*>?)?/);return e=i[1]?i[1]:i[2],t=t.substr(e.length),e;}function n(e,t){return!p[t.localName]||p[t.localName]===e.localName;}function r(t,i){var n=h[t];if(!n)return null;var r=e.document.createElement(n),a=f[t];return a&&i&&(r[a]=i.trim()),r;}for(var a,o,u=e.document.createElement("div"),l=u,m=[];null!==(a=i());){if("<"!==a[0])l.appendChild(e.document.createTextNode((o=a,d.innerHTML=o,o=d.textContent,d.textContent="",o)));else{if("/"===a[1]){m.length&&m[m.length-1]===a.substr(2).replace(">","")&&(m.pop(),l=l.parentNode);continue;}var g,_=s(a.substr(1,a.length-2));if(_){g=e.document.createProcessingInstruction("timestamp",_),l.appendChild(g);continue;}var y=a.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!y)continue;if(!(g=r(y[1],y[3])))continue;if(!n(l,g))continue;if(y[2]){var v=y[2].split(".");v.forEach(function(e){var t=/^bg_/.test(e),i=t?e.slice(3):e;if(c.hasOwnProperty(i)){var n=t?"background-color":"color",r=c[i];g.style[n]=r;}}),g.className=v.join(" ");}m.push(y[1]),l.appendChild(g),l=g;}}return u;}var g=[[1470,1470],[1472,1472],[1475,1475],[1478,1478],[1488,1514],[1520,1524],[1544,1544],[1547,1547],[1549,1549],[1563,1563],[1566,1610],[1645,1647],[1649,1749],[1765,1766],[1774,1775],[1786,1805],[1807,1808],[1810,1839],[1869,1957],[1969,1969],[1984,2026],[2036,2037],[2042,2042],[2048,2069],[2074,2074],[2084,2084],[2088,2088],[2096,2110],[2112,2136],[2142,2142],[2208,2208],[2210,2220],[8207,8207],[64285,64285],[64287,64296],[64298,64310],[64312,64316],[64318,64318],[64320,64321],[64323,64324],[64326,64449],[64467,64829],[64848,64911],[64914,64967],[65008,65020],[65136,65140],[65142,65276],[67584,67589],[67592,67592],[67594,67637],[67639,67640],[67644,67644],[67647,67669],[67671,67679],[67840,67867],[67872,67897],[67903,67903],[67968,68023],[68030,68031],[68096,68096],[68112,68115],[68117,68119],[68121,68147],[68160,68167],[68176,68184],[68192,68223],[68352,68405],[68416,68437],[68440,68466],[68472,68479],[68608,68680],[126464,126467],[126469,126495],[126497,126498],[126500,126500],[126503,126503],[126505,126514],[126516,126519],[126521,126521],[126523,126523],[126530,126530],[126535,126535],[126537,126537],[126539,126539],[126541,126543],[126545,126546],[126548,126548],[126551,126551],[126553,126553],[126555,126555],[126557,126557],[126559,126559],[126561,126562],[126564,126564],[126567,126570],[126572,126578],[126580,126583],[126585,126588],[126590,126590],[126592,126601],[126603,126619],[126625,126627],[126629,126633],[126635,126651],[1114109,1114109]];function _(e){for(var t=0;t=i[0]&&e<=i[1])return!0;}return!1;}function y(e){var t=[],i="";if(!e||!e.childNodes)return"ltr";function n(e,t){for(var i=t.childNodes.length-1;i>=0;i--){e.push(t.childNodes[i]);}}function r(e){if(!e||!e.length)return null;var t=e.pop(),i=t.textContent||t.innerText;if(i){var a=i.match(/^.*(\n|\r)/);return a?(e.length=0,a[0]):i;}return"ruby"===t.tagName?r(e):t.childNodes?(n(e,t),r(e)):void 0;}for(n(t,e);i=r(t);){for(var a=0;a=0&&e.line<=100))return e.line;if(!e.track||!e.track.textTrackList||!e.track.textTrackList.mediaElement)return-1;for(var t=e.track,i=t.textTrackList,n=0,r=0;rh&&(d=d<0?-1:1,d*=Math.ceil(h/l)*l),s<0&&(d+=""===a.vertical?i.height:i.width,o=o.reverse()),r.move(c,d);}else{var f=r.lineHeight/i.height*100;switch(a.lineAlign){case"center":s-=f/2;break;case"end":s-=f;}switch(a.vertical){case"":t.applyStyles({top:t.formatStyle(s,"%")});break;case"rl":t.applyStyles({left:t.formatStyle(s,"%")});break;case"lr":t.applyStyles({right:t.formatStyle(s,"%")});}o=["+y","-x","+x","-y"],r=new T(t);}var p=function(e,t){for(var r,a=new T(e),s=1,o=0;ou&&(r=new T(e),s=u),e=new T(a);}return r||a;}(r,o);t.move(p.toCSSCompatValues(i));}function E(){}v.prototype.applyStyles=function(e,t){for(var i in t=t||this.div,e){e.hasOwnProperty(i)&&(t.style[i]=e[i]);}},v.prototype.formatStyle=function(e,t){return 0===e?0:e+t;},b.prototype=r(v.prototype),b.prototype.constructor=b,T.prototype.move=function(e,t){switch(t=void 0!==t?t:this.lineHeight,e){case"+x":this.left+=t,this.right+=t;break;case"-x":this.left-=t,this.right-=t;break;case"+y":this.top+=t,this.bottom+=t;break;case"-y":this.top-=t,this.bottom-=t;}},T.prototype.overlaps=function(e){return this.lefte.left&&this.tope.top;},T.prototype.overlapsAny=function(e){for(var t=0;t=e.top&&this.bottom<=e.bottom&&this.left>=e.left&&this.right<=e.right;},T.prototype.overlapsOppositeAxis=function(e,t){switch(t){case"+x":return this.lefte.right;case"+y":return this.tope.bottom;}},T.prototype.intersectPercentage=function(e){return Math.max(0,Math.min(this.right,e.right)-Math.max(this.left,e.left))*Math.max(0,Math.min(this.bottom,e.bottom)-Math.max(this.top,e.top))/(this.height*this.width);},T.prototype.toCSSCompatValues=function(e){return{top:this.top-e.top,bottom:e.bottom-this.bottom,left:this.left-e.left,right:e.right-this.right,height:this.height,width:this.width};},T.getSimpleBoxPosition=function(e){var t=e.div?e.div.offsetHeight:e.tagName?e.offsetHeight:0,i=e.div?e.div.offsetWidth:e.tagName?e.offsetWidth:0,n=e.div?e.div.offsetTop:e.tagName?e.offsetTop:0;return{left:(e=e.div?e.div.getBoundingClientRect():e.tagName?e.getBoundingClientRect():e).left,right:e.right,top:e.top||n,height:e.height||t,bottom:e.bottom||n+(e.height||t),width:e.width||i};},E.StringDecoder=function(){return{decode:function decode(e){if(!e)return"";if("string"!=typeof e)throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(e));}};},E.convertCueToDOMTree=function(e,t){return e&&t?m(e,t):null;};E.processCues=function(e,t,i){if(!e||!t||!i)return null;for(;i.firstChild;){i.removeChild(i.firstChild);}var n=e.document.createElement("div");if(n.style.position="absolute",n.style.left="0",n.style.right="0",n.style.top="0",n.style.bottom="0",n.style.margin="1.5%",i.appendChild(n),function(e){for(var t=0;t100)throw new Error("Position must be between 0 and 100.");m=e,this.hasBeenReset=!0;}},positionAlign:{enumerable:!0,get:function get(){return g;},set:function set(e){var t=a(e);t&&(g=t,this.hasBeenReset=!0);}},size:{enumerable:!0,get:function get(){return _;},set:function set(e){if(e<0||e>100)throw new Error("Size must be between 0 and 100.");_=e,this.hasBeenReset=!0;}},align:{enumerable:!0,get:function get(){return y;},set:function set(e){var t=a(e);if(!t)throw new SyntaxError("align: an invalid or illegal alignment string was specified.");y=t,this.hasBeenReset=!0;}}}),this.displayState=void 0;}s.prototype.getCueAsHTML=function(){return WebVTT.convertCueToDOMTree(window,this.text);},t.exports=s;},{}],51:[function(e,t,i){var n={"":!0,up:!0};function r(e){return"number"==typeof e&&e>=0&&e<=100;}t.exports=function(){var e=100,t=3,i=0,a=100,s=0,o=100,u="";Object.defineProperties(this,{width:{enumerable:!0,get:function get(){return e;},set:function set(t){if(!r(t))throw new Error("Width must be between 0 and 100.");e=t;}},lines:{enumerable:!0,get:function get(){return t;},set:function set(e){if("number"!=typeof e)throw new TypeError("Lines must be set to a number.");t=e;}},regionAnchorY:{enumerable:!0,get:function get(){return a;},set:function set(e){if(!r(e))throw new Error("RegionAnchorX must be between 0 and 100.");a=e;}},regionAnchorX:{enumerable:!0,get:function get(){return i;},set:function set(e){if(!r(e))throw new Error("RegionAnchorY must be between 0 and 100.");i=e;}},viewportAnchorY:{enumerable:!0,get:function get(){return o;},set:function set(e){if(!r(e))throw new Error("ViewportAnchorY must be between 0 and 100.");o=e;}},viewportAnchorX:{enumerable:!0,get:function get(){return s;},set:function set(e){if(!r(e))throw new Error("ViewportAnchorX must be between 0 and 100.");s=e;}},scroll:{enumerable:!0,get:function get(){return u;},set:function set(e){var t=function(e){return"string"==typeof e&&!!n[e.toLowerCase()]&&e.toLowerCase();}(e);!1===t||(u=t);}}});};},{}],52:[function(e,t,i){"use strict";t.exports={DEFAILT_WEBGL_PLAY_ID:"glplayer",PLAYER_IN_TYPE_MP4:"mp4",PLAYER_IN_TYPE_FLV:"flv",PLAYER_IN_TYPE_HTTPFLV:"httpflv",PLAYER_IN_TYPE_RAW_265:"raw265",PLAYER_IN_TYPE_TS:"ts",PLAYER_IN_TYPE_MPEGTS:"mpegts",PLAYER_IN_TYPE_M3U8:"hls",PLAYER_IN_TYPE_M3U8_VOD:"m3u8",PLAYER_IN_TYPE_M3U8_LIVE:"hls",APPEND_TYPE_STREAM:0,APPEND_TYPE_FRAME:1,APPEND_TYPE_SEQUENCE:2,DEFAULT_WIDTH:600,DEFAULT_HEIGHT:600,DEFAULT_FPS:30,DEFAULT_FRAME_DUR:40,DEFAULT_FIXED:!1,DEFAULT_SAMPLERATE:44100,DEFAULT_CHANNELS:2,DEFAULT_CONSU_SAMPLE_LEN:20,PLAYER_MODE_VOD:"vod",PLAYER_MODE_NOTIME_LIVE:"live",AUDIO_MODE_ONCE:"ONCE",AUDIO_MODE_SWAP:"SWAP",DEFAULT_STRING_LIVE:"LIVE",CODEC_H265:0,CODEC_H264:1,PLAYER_CORE_TYPE_DEFAULT:0,PLAYER_CORE_TYPE_CNATIVE:1,URI_PROTOCOL_WEBSOCKET:"ws",URI_PROTOCOL_WEBSOCKET_DESC:"websocket",URI_PROTOCOL_HTTP:"http",URI_PROTOCOL_HTTP_DESC:"http",FETCH_FIRST_MAX_TIMES:5,FETCH_HTTP_FLV_TIMEOUT_MS:7e3,V_CODEC_NAME_HEVC:265,V_CODEC_NAME_AVC:264,V_CODEC_NAME_UNKN:500,A_CODEC_NAME_AAC:112,A_CODEC_NAME_MP3:113,A_CODEC_NAME_UNKN:500,CACHE_NO_LOADCACHE:192,CACHE_WITH_PLAY_SIGN:193,CACHE_WITH_NOPLAY_SIGN:194};},{}],53:[function(e,t,i){"use strict";var n=window.AudioContext||window.webkitAudioContext,r=e("../consts"),a=e("./av-common");t.exports=function(e){var t={options:{sampleRate:e.sampleRate||r.DEFAULT_SAMPLERATE,appendType:e.appendType||r.APPEND_TYPE_STREAM,playMode:e.playMode||r.AUDIO_MODE_SWAP},sourceChannel:-1,audioCtx:new n({latencyHint:"interactive",sampleRate:e.sampleRate}),gainNode:null,sourceList:[],startStatus:!1,sampleQueue:[],nextBuffer:null,playTimestamp:0,playStartTime:0,durationMs:-1,isLIVE:!1,voice:1,onLoadCache:null,resetStartParam:function resetStartParam(){t.playTimestamp=0,t.playStartTime=0;},setOnLoadCache:function setOnLoadCache(e){t.onLoadCache=e;},setDurationMs:function setDurationMs(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1;t.durationMs=e;},setVoice:function setVoice(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;t.voice=e,t.gainNode.gain.value=e;},getAlignVPTS:function getAlignVPTS(){return t.playTimestamp+(a.GetMsTime()-t.playStartTime)/1e3;},swapSource:function swapSource(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;if(0==t.startStatus)return null;if(e<0||e>=t.sourceList.length)return null;if(i<0||i>=t.sourceList.length)return null;try{t.sourceChannel===e&&null!==t.sourceList[e]&&(t.sourceList[e].disconnect(t.gainNode),t.sourceList[e]=null);}catch(t){console.error("[DEFINE ERROR] audioModule disconnect source Index:"+e+" error happened!",t);}t.sourceChannel=i;var n=t.decodeSample(i,e);-2==n&&t.isLIVE&&(t.getAlignVPTS()>=t.durationMs/1e3-.04?t.pause():null!==t.onLoadCache&&t.onLoadCache());},addSample:function addSample(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return!(null==e||!e||null==e)&&(0==t.sampleQueue.length&&(t.seekPos=e.pts),t.sampleQueue.push(e),!0);},runNextBuffer:function runNextBuffer(){window.setInterval(function(){if(!(null!=t.nextBuffer||t.sampleQueue.length0&&void 0!==arguments[0]?arguments[0]:-1,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;if(e<0||e>=t.sourceList.length)return-1;if(null!=t.sourceList[e]&&null!=t.sourceList[e]&&t.sourceList[e]||(t.sourceList[e]=t.audioCtx.createBufferSource(),t.sourceList[e].onended=function(){t.swapSource(e,i);}),0==t.sampleQueue.length)return t.isLIVE?(t.sourceList[e].connect(t.gainNode),t.sourceList[e].start(),t.sourceList[e].onended=function(){t.swapSource(e,i);},t.sourceList[e].stop(),0):-2;if(t.sourceList[e].buffer)return t.sourceList[e],t.sourceList[i],t.gainNode,t.swapSource(e,i),0;if(null==t.nextBuffer||t.nextBuffer.data.length<1)return t.sourceList[e].connect(t.gainNode),t.sourceList[e].start(),t.sourceList[e].startState=!0,t.sourceList[e].stop(),1;var n=t.nextBuffer.data.buffer;t.playTimestamp=t.nextBuffer.pts,t.playStartTime=a.GetMsTime();try{t.audioCtx.decodeAudioData(n,function(i){null!==t.sourceList[e]&&(t.sourceList[e].buffer=i,t.sourceList[e].connect(t.gainNode),t.sourceList[e].start(),t.sourceList[e].startState=!0);},function(e){});}catch(e){return t.nextBuffer=null,-3;}return t.nextBuffer=null,0;},decodeWholeSamples:function decodeWholeSamples(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1;if(t.sourceChannel=e,e<0||e>=t.sourceList.length)return-1;if(null!=t.sourceList[e]&&null!=t.sourceList[e]&&t.sourceList[e]||(t.sourceList[e]=t.audioCtx.createBufferSource(),t.sourceList[e].onended=function(){}),0==t.sampleQueue.length)return-2;for(var i=null,n=null,a=0;a=2){var s=i.length/2;a=new Float32Array(s);for(var o=0,u=0;u0&&s()-this._start_time>=this._now_seg_dur&&(s(),this._start_time,this._now_seg_dur,this._start_time=-1,this._now_seg_dur=-1),s(),this._start_time<0)if(new Date(),null!==this._pcm_array_buf&&this._pcm_array_buf.length>this._push_start_idx){this._swapStartPlay=!1;var e=this._push_start_idx+this._once_pop_len;e>this._pcm_array_buf.length&&(e=this._pcm_array_buf.length);var t=this._pcm_array_buf.slice(this._push_start_idx,e);this._push_start_idx+=t.length,this._now_seg_dur=1*t.length/this._sample_rate*1e3,t.length,this._sample_rate,this._now_seg_dur;var i=this._ctx.createBuffer(1,t.length,this._sample_rate);t.length,new Date(),i.copyToChannel(t,0),this._active_node=this._ctx.createBufferSource(),this._active_node.buffer=i,this._active_node.connect(this._gain),this._start_time=s(),this._active_node.start(0);}else setTimeout(this.readingLoopWithF32,1);}}])&&n(t.prototype,i),o&&n(t,o),e;}();i.AudioPcmPlayer=o;},{"../consts":52}],55:[function(e,t,i){"use strict";var n=e("../consts"),r=[{format:"mp4",value:"mp4",core:n.PLAYER_CORE_TYPE_CNATIVE},{format:"mov",value:"mp4",core:n.PLAYER_CORE_TYPE_CNATIVE},{format:"flv",value:"flv",core:n.PLAYER_CORE_TYPE_CNATIVE},{format:"m3u8",value:"hls",core:n.PLAYER_CORE_TYPE_DEFAULT},{format:"m3u",value:"hls",core:n.PLAYER_CORE_TYPE_DEFAULT},{format:"ts",value:"ts",core:n.PLAYER_CORE_TYPE_DEFAULT},{format:"mpegts",value:"ts",core:n.PLAYER_CORE_TYPE_DEFAULT},{format:"hevc",value:"raw265",core:n.PLAYER_CORE_TYPE_DEFAULT},{format:"h265",value:"raw265",core:n.PLAYER_CORE_TYPE_DEFAULT}],a=[{format:n.URI_PROTOCOL_HTTP,value:n.URI_PROTOCOL_HTTP_DESC},{format:n.URI_PROTOCOL_WEBSOCKET,value:n.URI_PROTOCOL_WEBSOCKET_DESC}];t.exports={frameDataAlignCrop:function frameDataAlignCrop(e,t,i,n,r,a,s,o){if(0==e-n)return[a,s,o];for(var u=n*r,l=u/4,d=new Uint8Array(u),h=new Uint8Array(l),c=new Uint8Array(l),f=n,p=n/2,m=0;m=0)return i.value;}return r[0].value;},GetFormatPlayCore:function GetFormatPlayCore(e){for(var t=0;t=0)return i.value;}return a[0].value;},GetMsTime:function GetMsTime(){return new Date().getTime();}};},{"../consts":52}],56:[function(e,t,i){"use strict";function n(e,t){for(var i=0;i0&&(t.getPackageTimeMS=a.GetMsTime()),t.pushPkg++,void 0!==t.AVGetInterval&&null!==t.AVGetInterval||(t.AVGetInterval=window.setInterval(function(){Module.cwrap("getBufferLengthApi","number",["number"])(t.AVSniffPtr)>t.config.probeSize?(Module.cwrap("getSniffHttpFlvPkg","number",["number"])(t.AVSniffPtr),t.pushPkg-=1):t.getPackageTimeMS>0&&a.GetMsTime()-t.getPackageTimeMS>=o.FETCH_HTTP_FLV_TIMEOUT_MS&&(t.getPackageTimeMS=a.GetMsTime(),t.workerFetch.postMessage({cmd:"retry",data:null,msg:"retry"}));},5));break;case"close":t.AVGetInterval&&clearInterval(t.AVGetInterval),t.AVGetInterval=null;case"fetch-fin":break;case"fetch-error":t.onNetworkError&&t.onNetworkError(i.data);}}},{key:"_checkDisplaySize",value:function value(e,t,i){var n=t-e,r=this.config.width+Math.ceil(n/2),a=t/this.config.width>i/this.config.height,s=(r/t).toFixed(2),o=(this.config.height/i).toFixed(2),u=a?s:o,l=this.config.fixed,d=l?r:parseInt(t*u),h=l?this.config.height:parseInt(i*u);if(this.CanvasObj.offsetWidth!=d||this.CanvasObj.offsetHeight!=h){var c=parseInt((this.canvasBox.offsetHeight-h)/2),f=parseInt((this.canvasBox.offsetWidth-d)/2);c=c<0?0:c,f=f<0?0:f,this.CanvasObj.style.marginTop=c+"px",this.CanvasObj.style.marginLeft=f+"px",this.CanvasObj.style.width=d+"px",this.CanvasObj.style.height=h+"px";}return this.isCheckDisplay=!0,[d,h];}},{key:"_ptsFixed2",value:function value(e){return Math.ceil(100*e)/100;}},{key:"_callbackProbe",value:function value(e,t,i,n,r,a,u,l,d){for(var h=Module.HEAPU8.subarray(d,d+10),c=0;c100&&(f=o.DEFAULT_FPS,this.mediaInfo.noFPS=!0),this.vCodecID=l,this.config.fps=f,this.mediaInfo.fps=f,this.mediaInfo.size.width=t,this.mediaInfo.size.height=i,this.frameTime=Math.floor(1e3/(this.mediaInfo.fps+2)),this.CanvasObj.width==t&&this.CanvasObj.height==i||(this.CanvasObj.width=t,this.CanvasObj.height=i,this.isCheckDisplay)||this._checkDisplaySize(t,t,i),r>=0&&!1===this.mediaInfo.noFPS&&this.config.ignoreAudio<1?(void 0!==this.audioWAudio&&null!==this.audioWAudio&&(this.audioWAudio.stop(),this.audioWAudio=null),this.config.sampleRate=a,this.mediaInfo.sampleRate=a,this.audioWAudio=s({sampleRate:this.mediaInfo.sampleRate,appendType:o.APPEND_TYPE_FRAME}),this.audioWAudio.isLIVE=!0):this.mediaInfo.audioNone=!0,this.onProbeFinish&&this.onProbeFinish();}},{key:"_callbackYUV",value:function value(e,t,i,n,r,a,s,o,u){var l=Module.HEAPU8.subarray(e,e+n*o),d=new Uint8Array(l),h=Module.HEAPU8.subarray(t,t+r*o/2),c=new Uint8Array(h),f=Module.HEAPU8.subarray(i,i+a*o/2),p={bufY:d,bufU:c,bufV:new Uint8Array(f),line_y:n,h:o,pts:u};this.YuvBuf.push(p),this.checkCacheState(),Module._free(l),l=null,Module._free(h),h=null,Module._free(f),f=null,!1===this.readyShowDone&&(this.playYUV(),this.readyShowDone=!0,this.onReadyShowDone&&this.onReadyShowDone(),this.audioWAudio||this.play());}},{key:"_callbackNALU",value:function value(e,t,i,n,r,a,s){if(!1===this.readyKeyFrame){if(i<=0)return;this.readyKeyFrame=!0;}var o=Module.HEAPU8.subarray(e,e+t),u=new Uint8Array(o);this.NaluBuf.push({bufData:u,len:t,isKey:i,w:n,h:r,pts:1e3*a,dts:1e3*s}),Module._free(o),o=null;}},{key:"_callbackPCM",value:function value(e){}},{key:"_callbackAAC",value:function value(e,t,i,n,r){var a=this._ptsFixed2(r);if(this.audioWAudio){var s=new Uint8Array(7+i),o=Module.HEAPU8.subarray(e,e+7);s.set(o,0);var u=Module.HEAPU8.subarray(t,t+i);s.set(u,7);var l={pts:a,data:s};this.audioWAudio.addSample(l),this.checkCacheState();}}},{key:"_decode",value:function value(){var e=this;setTimeout(function(){if(null!==e.workerFetch){var t=e.NaluBuf.shift();if(null!=t){var i=Module._malloc(t.bufData.length);Module.HEAP8.set(t.bufData,i),Module.cwrap("decodeHttpFlvVideoFrame","number",["number","number","number","number","number"])(e.AVSniffPtr,i,t.bufData.length,t.pts,t.dts,0),Module._free(i),i=null;}e._decode();}},1);}},{key:"checkCacheState",value:function value(){var e=this.YuvBuf.length>=25&&(!0===this.mediaInfo.audioNone||this.audioWAudio&&this.audioWAudio.sampleQueue.length>=50);return!1===this.cache_status&&e&&(this.playInterval&&this.audioWAudio&&this.audioWAudio.play(),this.onLoadCacheFinshed&&this.onLoadCacheFinshed(),this.cache_status=!0),e;}},{key:"setVoice",value:function value(e){this.audioVoice=e,this.audioWAudio&&this.audioWAudio.setVoice(e);}},{key:"_removeBindFuncPtr",value:function value(){null!==this._ptr_probeCallback&&Module.removeFunction(this._ptr_probeCallback),null!==this._ptr_frameCallback&&Module.removeFunction(this._ptr_frameCallback),null!==this._ptr_naluCallback&&Module.removeFunction(this._ptr_naluCallback),null!==this._ptr_sampleCallback&&Module.removeFunction(this._ptr_sampleCallback),null!==this._ptr_aacCallback&&Module.removeFunction(this._ptr_aacCallback),this._ptr_probeCallback=null,this._ptr_frameCallback=null,this._ptr_naluCallback=null,this._ptr_sampleCallback=null,this._ptr_aacCallback=null;}},{key:"release",value:function value(){return this.pause(),this.NaluBuf.length=0,this.YuvBuf.length=0,void 0!==this.workerFetch&&null!==this.workerFetch&&this.workerFetch.postMessage({cmd:"stop",data:"stop",msg:"stop"}),this.workerFetch=null,this.AVGetInterval&&clearInterval(this.AVGetInterval),this.AVGetInterval=null,this._removeBindFuncPtr(),Module.cwrap("releaseHttpFLV","number",["number"])(this.AVSniffPtr),this.playInterval&&clearInterval(this.playInterval),this.playInterval=null,this.audioWAudio&&this.audioWAudio.stop(),this.audioWAudio=null,this.CanvasObj&&this.CanvasObj.remove(),this.CanvasObj=null,0;}},{key:"isPlayingState",value:function value(){return null!==this.playInterval&&void 0!==this.playInterval;}},{key:"pause",value:function value(){this.audioWAudio&&this.audioWAudio.pause(),this.playInterval&&clearInterval(this.playInterval),this.playInterval=null;}},{key:"playYUV",value:function value(){if(this.YuvBuf.length>0){var e=this.YuvBuf.shift();return r.renderFrame(this.AVGLObj,e.bufY,e.bufU,e.bufV,e.line_y,e.h),!0;}return!1;}},{key:"play",value:function value(){var e=this,t=this;if(!1===this.checkCacheState())return this.onLoadCache&&this.onLoadCache(),setTimeout(function(){e.play();},100),!1;if(void 0===this.playInterval||null===this.playInterval){var i=0,n=0,s=0;!1===this.mediaInfo.audioNone&&this.audioWAudio&&!1===this.mediaInfo.noFPS?(this.playInterval=setInterval(function(){if(n=a.GetMsTime(),t.cache_status){if(n-i>=t.frameTime-s){var e=t.YuvBuf.shift();if(null!=e&&null!==e){var o=0;null!==t.audioWAudio&&void 0!==t.audioWAudio&&(o=1e3*(e.pts-t.audioWAudio.getAlignVPTS())),s=t.audioWAudio?o<0&&-1*o<=t.frameTime||o>=0?a.GetMsTime()-n+1:t.frameTime:a.GetMsTime()-n+1,r.renderFrame(t.AVGLObj,e.bufY,e.bufU,e.bufV,e.line_y,e.h);}(t.YuvBuf.length<=0||t.audioWAudio&&t.audioWAudio.sampleQueue.length<=0)&&(t.cache_status=!1,t.onLoadCache&&t.onLoadCache(),t.audioWAudio&&t.audioWAudio.pause()),i=n;}}else s=t.frameTime;},1),this.audioWAudio&&this.audioWAudio.play()):this.playInterval=setInterval(function(){var e=t.YuvBuf.shift();null!=e&&null!==e&&r.renderFrame(t.AVGLObj,e.bufY,e.bufU,e.bufV,e.line_y,e.h),t.YuvBuf.length<=0&&(t.cache_status=!1);},t.frameTime);}}},{key:"start",value:function value(e){var t,i,n,a=this;this.workerFetch=new Worker((t=function(){var e=null,t=new AbortController(),i=t.signal,n=(self,function(e){var t=!1;t||(t=!0,fetch(e,{signal:i}).then(function(e){return function e(t){return t.read().then(function(i){if(!i.done){var n=i.value;return self.postMessage({cmd:"fetch-chunk",data:n,msg:"fetch-chunk"}),e(t);}self.postMessage({cmd:"fetch-fin",data:null,msg:"fetch-fin"});});}(e.body.getReader());})["catch"](function(e){if(!e.toString().includes("user aborted")){var t=" httplive request error:"+e+" start to retry";console.error(t),self.postMessage({cmd:"fetch-error",data:t,msg:"fetch-error"});}}));});self.onmessage=function(r){var a=r.data;switch(void 0===a.cmd||null===a.cmd?"":a.cmd){case"start":e=a.data,n(e),self.postMessage({cmd:"default",data:"WORKER STARTED",msg:"default"});break;case"stop":t.abort(),self.close(),self.postMessage({cmd:"close",data:"close",msg:"close"});break;case"retry":t.abort(),t=null,i=null,t=new AbortController(),i=t.signal,setTimeout(function(){n(e);},3e3);}};}.toString(),i=t.match(/^\s*function\s*\(\s*\)\s*\{(([\s\S](?!\}$))*[\s\S])/),n=[i[1]],window.URL.createObjectURL(new Blob(n,{type:"text/javascript"})))),this.workerFetch.onmessage=function(e){a._workerFetch_onmessage(e,a);},this.workerFetch,this.AVSniffPtr=Module.cwrap("AVSniffHttpFlvInit","number",["string","string"])("base64:QXV0aG9yOmNoYW5neWFubG9uZ3xudW1iZXJ3b2xmLEdpdGh1YjpodHRwczovL2dpdGh1Yi5jb20vbnVtYmVyd29sZixFbWFpbDpwb3JzY2hlZ3QyM0Bmb3htYWlsLmNvbSxRUTo1MzEzNjU4NzIsSG9tZVBhZ2U6aHR0cDovL3h2aWRlby52aWRlbyxEaXNjb3JkOm51bWJlcndvbGYjODY5NCx3ZWNoYXI6bnVtYmVyd29sZjExLEJlaWppbmcsV29ya0luOkJhaWR1","0.0.0"),this.AVSniffPtr,this._ptr_probeCallback=Module.addFunction(this._callbackProbe.bind(this)),this._ptr_yuvCallback=Module.addFunction(this._callbackYUV.bind(this)),this._ptr_naluCallback=Module.addFunction(this._callbackNALU.bind(this)),this._ptr_sampleCallback=Module.addFunction(this._callbackPCM.bind(this)),this._ptr_aacCallback=Module.addFunction(this._callbackAAC.bind(this)),Module.cwrap("initializeSniffHttpFlvModule","number",["number","number","number","number","number","number"])(this.AVSniffPtr,this._ptr_probeCallback,this._ptr_yuvCallback,this._ptr_naluCallback,this._ptr_sampleCallback,this._ptr_aacCallback),this.AVGLObj=r.setupCanvas(this.CanvasObj,{preserveDrawingBuffer:!1}),this.workerFetch.postMessage({cmd:"start",data:e,msg:"start"}),this._decode();}}])&&n(t.prototype,i),u&&n(t,u),e;}();i.CHttpLiveCore=u;},{"../consts":52,"../demuxer/buffer":64,"../demuxer/bufferFrame":65,"../render-engine/webgl-420p":77,"../version":80,"./audio-core":53,"./audio-native-core":54,"./av-common":55,"./cache":59,"./cacheYuv":60}],57:[function(e,t,i){"use strict";function n(e,t){for(var i=0;i0&&void 0!==arguments[0]&&arguments[0];this.showScreen=e,this.canvas&&(e?this.canvas.setAttribute("hidden",!0):this.canvas.removeAttribute("hidden"));}},{key:"getCachePTS",value:function value(){return 1!==this.config.ignoreAudio&&this.audioWAudio?Math.max(this.vCachePTS,this.aCachePTS):this.vCachePTS;}},{key:"getMaxPTS",value:function value(){return Math.max(this.vCachePTS,this.aCachePTS);}},{key:"isPlayingState",value:function value(){return this.isPlaying;}},{key:"pushDone",value:function value(){this.pushEOF=!0;}},{key:"_clearDecInterval",value:function value(){this.decVFrameInterval&&window.clearInterval(this.decVFrameInterval),this.decVFrameInterval=null;}},{key:"_checkPlayFinished",value:function value(){return!(this.config.playMode!==d.PLAYER_MODE_VOD||!(!0===this.bufRecvStat&&(this.playPTS>=this.bufLastVDTS||this.audioWAudio&&this.playPTS>=this.bufLastADTS)||this.duration-this.playPTS0&&(this.isPlaying=!0);var t=0,i=0,n=0;this.config.playMode===d.PLAYER_MODE_NOTIME_LIVE?this.playFrameInterval=window.setInterval(function(){if(e._videoQueue.length>0){var t=e._videoQueue.shift();t.pts,o.renderFrame(e.yuv,t.data_y,t.data_u,t.data_v,t.line1,t.height);}},1e3*this.frameDur):this.playFrameInterval=window.setInterval(function(){if(i=u.GetMsTime(),e._videoQueue.length>0&&i-t>=e.frameTime-n){var r=e._videoQueue.shift(),a=0;if(e.isNewSeek||null===e.audioWAudio||void 0===e.audioWAudio||(a=1e3*(r.pts-e.audioWAudio.getAlignVPTS()),e.playPTS=Math.max(e.audioWAudio.getAlignVPTS(),e.playPTS)),t=i,u.GetMsTime(),e.playPTS=Math.max(r.pts,e.playPTS),e.isNewSeek&&e.seekTarget-e.frameDur>r.pts)return void(n=e.frameTime);if(e.isNewSeek&&(e.audioWAudio&&e.audioWAudio.setVoice(e.audioVoice),e.audioWAudio&&e.audioWAudio.play(),n=0,e.isNewSeek=!1,e.seekTarget=0),e.showScreen?e.onRender&&e.onRender(r.line1,r.height,r.data_y,r.data_u,r.data_v):(r.pts,o.renderFrame(e.yuv,r.data_y,r.data_u,r.data_v,r.line1,r.height)),e.onPlayingTime&&e.onPlayingTime(r.pts),!e.isNewSeek&&e.audioWAudio&&(a<0&&-1*a<=e.frameTime||a>=0)){if(e.config.playMode===d.PLAYER_MODE_VOD)if(r.pts>=e.duration)e.onLoadCacheFinshed&&e.onLoadCacheFinshed(),e.onPlayingFinish&&e.onPlayingFinish(),e._clearDecInterval(),e.pause();else if(e._checkPlayFinished())return;n=u.GetMsTime()-i;}else!e.isNewSeek&&e.audioWAudio&&(a<0&&e.frameTime,n=e.frameTime);}e._checkPlayFinished();},1);}this.isNewSeek||this.audioWAudio&&this.audioWAudio.play();}},{key:"pause",value:function value(){this.isPlaying=!1,this._pause();}},{key:"_pause",value:function value(){this.playFrameInterval&&window.clearInterval(this.playFrameInterval),this.playFrameInterval=null,this.audioWAudio&&this.audioWAudio.pause();}},{key:"seek",value:function value(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.openFrameCall=!1,this.pause(),this._clearDecInterval(),null!==this.avFeedVideoInterval&&(window.clearInterval(this.avFeedVideoInterval),this.avFeedVideoInterval=null),null!==this.avFeedAudioInterval&&(window.clearInterval(this.avFeedAudioInterval),this.avFeedAudioInterval=null),this.yuvMaxTime=0,this.playVPipe.length=0,this._videoQueue.length=0,this.audioWAudio&&this.audioWAudio.stop(),e&&e(),this.isNewSeek=!0,this.avSeekVState=!0,this.seekTarget=i.seekTime,null!==this.audioWAudio&&void 0!==this.audioWAudio&&(this.audioWAudio.setVoice(0),this.audioWAudio.resetStartParam(),this.audioWAudio.stop()),this._avFeedData(i.seekTime),setTimeout(function(){t.yuvMaxTime=0,t._videoQueue.length=0,t.openFrameCall=!0,t.frameCallTag+=1,t._decVFrameIntervalFunc();},1e3);}},{key:"setVoice",value:function value(e){this.audioVoice=e,this.audioWAudio&&this.audioWAudio.setVoice(e);}},{key:"cacheIsFull",value:function value(){return this._videoQueue.length>=50;}},{key:"_checkDisplaySize",value:function value(e,t,i){var n=t-e,r=this.config.width+Math.ceil(n/2),a=t/this.config.width>i/this.config.height,s=(r/t).toFixed(2),o=(this.config.height/i).toFixed(2),u=a?s:o,l=this.config.fixed,d=l?r:parseInt(t*u),h=l?this.config.height:parseInt(i*u);if(this.canvas.offsetWidth!=d||this.canvas.offsetHeight!=h){var c=parseInt((this.canvasBox.offsetHeight-h)/2),f=parseInt((this.canvasBox.offsetWidth-d)/2);c=c<0?0:c,f=f<0?0:f,this.canvas.style.marginTop=c+"px",this.canvas.style.marginLeft=f+"px",this.canvas.style.width=d+"px",this.canvas.style.height=h+"px";}return this.isCheckDisplay=!0,[d,h];}},{key:"_createYUVCanvas",value:function value(){this.canvasBox=document.querySelector("#"+this.config.playerId),this.canvasBox.style.overflow="hidden",this.canvas=document.createElement("canvas"),this.canvas.style.width=this.canvasBox.clientWidth+"px",this.canvas.style.height=this.canvasBox.clientHeight+"px",this.canvas.style.top="0px",this.canvas.style.left="0px",this.canvasBox.appendChild(this.canvas),this.yuv=o.setupCanvas(this.canvas,{preserveDrawingBuffer:!1});}},{key:"_avRecvPackets",value:function value(){var e=this;this.bufObject.cleanPipeline(),null!==this.avRecvInterval&&(window.clearInterval(this.avRecvInterval),this.avRecvInterval=null),!0===this.config.checkProbe?this.avRecvInterval=window.setInterval(function(){Module.cwrap("getSniffStreamPkg","number",["number"])(e.corePtr),e._avCheckRecvFinish();},5):this.avRecvInterval=window.setInterval(function(){Module.cwrap("getSniffStreamPkgNoCheckProbe","number",["number"])(e.corePtr),e._avCheckRecvFinish();},5),this._avFeedData(0,!1);}},{key:"_avCheckRecvFinish",value:function value(){this.config.playMode===d.PLAYER_MODE_VOD&&this.duration-this.getMaxPTS()=50&&(t.onSeekFinish&&t.onSeekFinish(),t.onPlayingTime&&t.onPlayingTime(e),t.play(),window.clearInterval(i),i=null);},10);return!0;}},{key:"_afterAvFeedSeekToStartWithUnFinBuffer",value:function value(e){var t=this,i=window.setInterval(function(){t._videoQueue.length,t._videoQueue.length>=50&&(t.onSeekFinish&&t.onSeekFinish(),t.onPlayingTime&&t.onPlayingTime(e),!1===t.reFull?t.play():t.reFull=!1,window.clearInterval(i),i=null);},10);return!0;}},{key:"_avFeedData",value:function value(e){var t=this;if(this.playVPipe.length=0,this.audioWAudio&&this.audioWAudio.cleanQueue(),e<=0&&!1===this.bufOK){var i=0;if(this.avFeedVideoInterval=window.setInterval(function(){var n=t.bufObject.videoBuffer.length;if(n-1>i||t.duration-t.getMaxPTS()0){for(var s=0;s0&&t.playVPipe[t.playVPipe.length-1].pts>=t.bufLastVDTS&&(window.clearInterval(t.avFeedVideoInterval),t.avFeedVideoInterval=null,t.playVPipe[t.playVPipe.length-1].pts,t.bufLastVDTS,t.bufObject.videoBuffer,t.playVPipe);}else t.config.playMode===d.PLAYER_MODE_VOD&&t.playVPipe.length>0&&t.playVPipe[t.playVPipe.length-1].pts>=t.duration&&(window.clearInterval(t.avFeedVideoInterval),t.avFeedVideoInterval=null,t.playVPipe[t.playVPipe.length-1].pts,t.duration,t.bufObject.videoBuffer,t.playVPipe);t.avSeekVState&&(t.getMaxPTS(),t.duration,t.config.playMode===d.PLAYER_MODE_VOD&&(t._afterAvFeedSeekToStartWithFinishedBuffer(e),t.avSeekVState=!1));},5),void 0!==this.audioWAudio&&null!==this.audioWAudio&&this.config.ignoreAudio<1){var n=0;this.avFeedAudioInterval=window.setInterval(function(){var e=t.bufObject.audioBuffer.length;if(e-1>n||t.duration-t.getMaxPTS()0&&t.audioWAudio.sampleQueue[t.audioWAudio.sampleQueue.length-1].pts>=t.bufLastADTS&&(window.clearInterval(t.avFeedAudioInterval),t.avFeedAudioInterval=null,t.audioWAudio.sampleQueue[t.audioWAudio.sampleQueue.length-1].pts,t.bufObject.audioBuffer);}else t.config.playMode===d.PLAYER_MODE_VOD&&t.audioWAudio.sampleQueue.length>0&&t.audioWAudio.sampleQueue[t.audioWAudio.sampleQueue.length-1].pts>=t.duration&&(window.clearInterval(t.avFeedAudioInterval),t.avFeedAudioInterval=null,t.audioWAudio.sampleQueue[t.audioWAudio.sampleQueue.length-1].pts,t.bufObject.audioBuffer);},5);}}else{var r=this.bufObject.seekIDR(e),s=parseInt(r,10);this.playPTS=0;var o=s;if(this.avFeedVideoInterval=window.setInterval(function(){var i=t.bufObject.videoBuffer.length;if(i-1>o||t.duration-t.getMaxPTS()0){for(var r=0;r0&&t.playVPipe[t.playVPipe.length-1].pts>=t.bufLastVDTS&&(window.clearInterval(t.avFeedVideoInterval),t.avFeedVideoInterval=null);}else t.config.playMode===d.PLAYER_MODE_VOD&&t.playVPipe.length>0&&t.playVPipe[t.playVPipe.length-1].pts>=t.duration&&(window.clearInterval(t.avFeedVideoInterval),t.avFeedVideoInterval=null);t.avSeekVState&&(t.getMaxPTS(),t.duration,t.config.playMode===d.PLAYER_MODE_VOD&&(t._afterAvFeedSeekToStartWithUnFinBuffer(e),t.avSeekVState=!1));},5),this.audioWAudio&&this.config.ignoreAudio<1){var u=parseInt(e,10);this.avFeedAudioInterval=window.setInterval(function(){var e=t.bufObject.audioBuffer.length;if(e-1>u||t.duration-t.getMaxPTS()0&&t.audioWAudio.sampleQueue[t.audioWAudio.sampleQueue.length-1].pts>=t.bufLastADTS&&(window.clearInterval(t.avFeedAudioInterval),t.avFeedAudioInterval=null);}else t.config.playMode===d.PLAYER_MODE_VOD&&t.audioWAudio.sampleQueue.length>0&&t.audioWAudio.sampleQueue[t.audioWAudio.sampleQueue.length-1].pts>=t.duration&&(window.clearInterval(t.avFeedAudioInterval),t.avFeedAudioInterval=null);},5);}}}},{key:"_probeFinCallback",value:function value(e,t,i,n,r,a,s,o,u){var h=this;this._createYUVCanvas(),d.V_CODEC_NAME_HEVC,this.config.fps=1*n,this.frameTime=1e3/this.config.fps,this.width=t,this.height=i,this.frameDur=1/this.config.fps,this.duration=e-this.frameDur,this.vCodecID=o,this.config.sampleRate=a,this.channels=s,this.audioIdx=r,this.duration<0&&(this.config.playMode=d.PLAYER_MODE_NOTIME_LIVE,this.frameTime,this.frameDur);for(var c=Module.HEAPU8.subarray(u,u+10),f=0;f=0&&this.config.ignoreAudio<1?(void 0!==this.audioWAudio&&null!==this.audioWAudio&&(this.audioWAudio.stop(),this.audioWAudio=null),this.audioWAudio=l({sampleRate:a,appendType:d.APPEND_TYPE_FRAME}),this.audioWAudio.setDurationMs(1e3*e),this.onLoadCache&&this.audioWAudio.setOnLoadCache(function(){if(h.retryAuSampleNo,h.retryAuSampleNo<=5){h.pause(),h.onLoadCache&&h.onLoadCache();var e=window.setInterval(function(){return h.retryAuSampleNo,h.audioWAudio.sampleQueue.length,h.audioWAudio.sampleQueue.length>2?(h.onLoadCacheFinshed&&h.onLoadCacheFinshed(),h.play(),h.retryAuSampleNo=0,window.clearInterval(e),void(e=null)):(h.retryAuSampleNo+=1,h.retryAuSampleNo>5?(h.play(),h.onLoadCacheFinshed&&h.onLoadCacheFinshed(),window.clearInterval(e),void(e=null)):void 0);},1e3);}})):this.audioNone=!0,this._avRecvPackets(),this._decVFrameIntervalFunc()),this.onProbeFinish&&this.onProbeFinish();}},{key:"_ptsFixed2",value:function value(e){return Math.ceil(100*e)/100;}},{key:"_naluCallback",value:function value(e,t,i,n,r,a,s){var o=this._ptsFixed2(a),u=Module.HEAPU8.subarray(e,e+t),l=new Uint8Array(u);this.bufObject.appendFrameWithDts(o,s,l,!0,i),this.bufLastVDTS=Math.max(s,this.bufLastVDTS),this.vCachePTS=Math.max(o,this.vCachePTS),this.onCacheProcess&&this.onCacheProcess(this.getCachePTS());}},{key:"_samplesCallback",value:function value(e,t,i,n){}},{key:"_aacFrameCallback",value:function value(e,t,i,n,r){var a=this._ptsFixed2(r);if(this.audioWAudio){var s=new Uint8Array(7+i),o=Module.HEAPU8.subarray(e,e+7);s.set(o,0);var u=Module.HEAPU8.subarray(t,t+i);s.set(u,7),this.bufObject.appendFrame(a,s,!1,!0),this.bufLastADTS=Math.max(a,this.bufLastADTS),this.aCachePTS=Math.max(a,this.aCachePTS),this.onCacheProcess&&this.onCacheProcess(this.getCachePTS());}}},{key:"_decVFrameIntervalFunc",value:function value(){var e=this;null==this.decVFrameInterval&&(this.decVFrameInterval=window.setInterval(function(){if(e._videoQueue.length<50&&e.playVPipe.length>0){var t=e.playVPipe.shift(),i=t.data,n=Module._malloc(i.length);Module.HEAP8.set(i,n);var r=parseInt(1e3*t.pts,10),a=parseInt(1e3*t.dts,10);e.yuvMaxTime=Math.max(t.pts,e.yuvMaxTime),Module.cwrap("decodeVideoFrame","number",["number","number","number","number","number"])(e.corePtr,n,i.length,r,a,e.frameCallTag),Module._free(n),n=null;}},10));}},{key:"_frameCallback",value:function value(e,t,i,n,r,a,s,u,l,d){if(this._videoQueue.length,!(!1===this.openFrameCall||d!==this.frameCallTag||l>this.yuvMaxTime+this.frameDur||this.isNewSeek&&this.seekTarget-l>3*this.frameDur)){var h=this._videoQueue.length;if(this.canvas.width==n&&this.canvas.height==u||(this.canvas.width=n,this.canvas.height=u,this.isCheckDisplay)||this._checkDisplaySize(s,n,u),!(this.playPTS>l)){var f=Module.HEAPU8.subarray(e,e+n*u),p=Module.HEAPU8.subarray(t,t+r*u/2),m=Module.HEAPU8.subarray(i,i+a*u/2),g=new Uint8Array(f),_=new Uint8Array(p),y=new Uint8Array(m);this.config.readyShow&&(o.renderFrame(this.yuv,g,_,y,n,u),this.config.readyShow=!1,this.onReadyShowDone&&this.onReadyShowDone());var v=new c(g,_,y,n,r,a,s,u,l);if(h<=0||l>this._videoQueue[h-1].pts)this._videoQueue.push(v);else if(lthis._videoQueue[b].pts&&b+10&&(t.getPackageTimeMS=a.GetMsTime()),t.pushPkg++,void 0!==t.AVGetInterval&&null!==t.AVGetInterval||(t.AVGetInterval=window.setInterval(function(){Module.cwrap("getBufferLengthApi","number",["number"])(t.AVSniffPtr)>t.config.probeSize&&(Module.cwrap("getSniffHttpFlvPkg","number",["number"])(t.AVSniffPtr),t.pushPkg-=1);},5));break;case"close":t.AVGetInterval&&clearInterval(t.AVGetInterval),t.AVGetInterval=null;case"fetch-fin":break;case"fetch-error":t.onNetworkError&&t.onNetworkError(i.data);}}},{key:"_checkDisplaySize",value:function value(e,t,i){var n=t-e,r=this.config.width+Math.ceil(n/2),a=t/this.config.width>i/this.config.height,s=(r/t).toFixed(2),o=(this.config.height/i).toFixed(2),u=a?s:o,l=this.config.fixed,d=l?r:parseInt(t*u),h=l?this.config.height:parseInt(i*u);if(this.CanvasObj.offsetWidth!=d||this.CanvasObj.offsetHeight!=h){var c=parseInt((this.canvasBox.offsetHeight-h)/2),f=parseInt((this.canvasBox.offsetWidth-d)/2);c=c<0?0:c,f=f<0?0:f,this.CanvasObj.style.marginTop=c+"px",this.CanvasObj.style.marginLeft=f+"px",this.CanvasObj.style.width=d+"px",this.CanvasObj.style.height=h+"px";}return this.isCheckDisplay=!0,[d,h];}},{key:"_ptsFixed2",value:function value(e){return Math.ceil(100*e)/100;}},{key:"_callbackProbe",value:function value(e,t,i,n,r,a,u,l,d){for(var h=Module.HEAPU8.subarray(d,d+10),c=0;c100&&(f=o.DEFAULT_FPS,this.mediaInfo.noFPS=!0),this.vCodecID=l,this.config.fps=f,this.mediaInfo.fps=f,this.mediaInfo.size.width=t,this.mediaInfo.size.height=i,this.frameTime=Math.floor(1e3/(this.mediaInfo.fps+2)),this.CanvasObj.width==t&&this.CanvasObj.height==i||(this.CanvasObj.width=t,this.CanvasObj.height=i,this.isCheckDisplay)||this._checkDisplaySize(t,t,i),r>=0&&!1===this.mediaInfo.noFPS&&this.config.ignoreAudio<1?(void 0!==this.audioWAudio&&null!==this.audioWAudio&&(this.audioWAudio.stop(),this.audioWAudio=null),this.config.sampleRate=a,this.mediaInfo.sampleRate=a,this.audioWAudio=s({sampleRate:this.mediaInfo.sampleRate,appendType:o.APPEND_TYPE_FRAME}),this.audioWAudio.isLIVE=!0):this.mediaInfo.audioNone=!0,this.onProbeFinish&&this.onProbeFinish();}},{key:"_callbackYUV",value:function value(e,t,i,n,r,a,s,o,u){var l=Module.HEAPU8.subarray(e,e+n*o),d=new Uint8Array(l),h=Module.HEAPU8.subarray(t,t+r*o/2),c=new Uint8Array(h),f=Module.HEAPU8.subarray(i,i+a*o/2),p={bufY:d,bufU:c,bufV:new Uint8Array(f),line_y:n,h:o,pts:u};this.YuvBuf.push(p),this.checkCacheState(),Module._free(l),l=null,Module._free(h),h=null,Module._free(f),f=null,!1===this.readyShowDone&&(this.playYUV(),this.readyShowDone=!0,this.onReadyShowDone&&this.onReadyShowDone(),this.audioWAudio||this.play());}},{key:"_callbackNALU",value:function value(e,t,i,n,r,a,s){if(!1===this.readyKeyFrame){if(i<=0)return;this.readyKeyFrame=!0;}var o=Module.HEAPU8.subarray(e,e+t),u=new Uint8Array(o);this.NaluBuf.push({bufData:u,len:t,isKey:i,w:n,h:r,pts:1e3*a,dts:1e3*s}),Module._free(o),o=null;}},{key:"_callbackPCM",value:function value(e){}},{key:"_callbackAAC",value:function value(e,t,i,n,r){var a=this._ptsFixed2(r);if(this.audioWAudio){var s=new Uint8Array(7+i),o=Module.HEAPU8.subarray(e,e+7);s.set(o,0);var u=Module.HEAPU8.subarray(t,t+i);s.set(u,7);var l={pts:a,data:s};this.audioWAudio.addSample(l),this.checkCacheState();}}},{key:"_decode",value:function value(){var e=this;setTimeout(function(){if(null!==e.workerFetch){var t=e.NaluBuf.shift();if(null!=t){var i=Module._malloc(t.bufData.length);Module.HEAP8.set(t.bufData,i),Module.cwrap("decodeHttpFlvVideoFrame","number",["number","number","number","number","number"])(e.AVSniffPtr,i,t.bufData.length,t.pts,t.dts,0),Module._free(i),i=null;}e._decode();}},1);}},{key:"checkCacheState",value:function value(){var e=this.YuvBuf.length>=25&&(!0===this.mediaInfo.audioNone||this.audioWAudio&&this.audioWAudio.sampleQueue.length>=50);return!1===this.cache_status&&e&&(this.playInterval&&this.audioWAudio&&this.audioWAudio.play(),this.onLoadCacheFinshed&&this.onLoadCacheFinshed(),this.cache_status=!0),e;}},{key:"setVoice",value:function value(e){this.audioVoice=e,this.audioWAudio&&this.audioWAudio.setVoice(e);}},{key:"_removeBindFuncPtr",value:function value(){null!==this._ptr_probeCallback&&Module.removeFunction(this._ptr_probeCallback),null!==this._ptr_frameCallback&&Module.removeFunction(this._ptr_frameCallback),null!==this._ptr_naluCallback&&Module.removeFunction(this._ptr_naluCallback),null!==this._ptr_sampleCallback&&Module.removeFunction(this._ptr_sampleCallback),null!==this._ptr_aacCallback&&Module.removeFunction(this._ptr_aacCallback),this._ptr_probeCallback=null,this._ptr_frameCallback=null,this._ptr_naluCallback=null,this._ptr_sampleCallback=null,this._ptr_aacCallback=null;}},{key:"release",value:function value(){return this.pause(),this.NaluBuf.length=0,this.YuvBuf.length=0,void 0!==this.workerFetch&&null!==this.workerFetch&&this.workerFetch.postMessage({cmd:"stop",data:"stop",msg:"stop"}),this.workerFetch=null,this.AVGetInterval&&clearInterval(this.AVGetInterval),this.AVGetInterval=null,this._removeBindFuncPtr(),Module.cwrap("releaseHttpFLV","number",["number"])(this.AVSniffPtr),this.playInterval&&clearInterval(this.playInterval),this.playInterval=null,this.audioWAudio&&this.audioWAudio.stop(),this.audioWAudio=null,this.CanvasObj&&this.CanvasObj.remove(),this.CanvasObj=null,0;}},{key:"isPlayingState",value:function value(){return null!==this.playInterval&&void 0!==this.playInterval;}},{key:"pause",value:function value(){this.audioWAudio&&this.audioWAudio.pause(),this.playInterval&&clearInterval(this.playInterval),this.playInterval=null;}},{key:"playYUV",value:function value(){if(this.YuvBuf.length>0){var e=this.YuvBuf.shift();return r.renderFrame(this.AVGLObj,e.bufY,e.bufU,e.bufV,e.line_y,e.h),!0;}return!1;}},{key:"play",value:function value(){var e=this,t=this;if(!1===this.checkCacheState())return this.onLoadCache&&this.onLoadCache(),setTimeout(function(){e.play();},100),!1;if(void 0===this.playInterval||null===this.playInterval){var i=0,n=0,s=0;!1===this.mediaInfo.audioNone&&this.audioWAudio&&!1===this.mediaInfo.noFPS?(this.playInterval=setInterval(function(){if(n=a.GetMsTime(),t.cache_status){if(n-i>=t.frameTime-s){var e=t.YuvBuf.shift();if(null!=e&&null!==e){var o=0;null!==t.audioWAudio&&void 0!==t.audioWAudio&&(o=1e3*(e.pts-t.audioWAudio.getAlignVPTS())),s=t.audioWAudio?o<0&&-1*o<=t.frameTime||o>=0?a.GetMsTime()-n+1:t.frameTime:a.GetMsTime()-n+1,r.renderFrame(t.AVGLObj,e.bufY,e.bufU,e.bufV,e.line_y,e.h);}(t.YuvBuf.length<=0||t.audioWAudio&&t.audioWAudio.sampleQueue.length<=0)&&(t.cache_status=!1,t.onLoadCache&&t.onLoadCache(),t.audioWAudio&&t.audioWAudio.pause()),i=n;}}else s=t.frameTime;},1),this.audioWAudio&&this.audioWAudio.play()):this.playInterval=setInterval(function(){var e=t.YuvBuf.shift();null!=e&&null!==e&&r.renderFrame(t.AVGLObj,e.bufY,e.bufU,e.bufV,e.line_y,e.h),t.YuvBuf.length<=0&&(t.cache_status=!1);},t.frameTime);}}},{key:"start",value:function value(e){var t,i,n,a=this;this.workerFetch=new Worker((t=function(){var e=null;self,self.onmessage=function(t){var i=t.data;switch(void 0===i.cmd||null===i.cmd?"":i.cmd){case"start":var n=i.data;(e=new WebSocket(n)).binaryType="arraybuffer",e.onopen=function(t){e.send("Hello WebSockets!");},e.onmessage=function(e){if(e.data instanceof ArrayBuffer){var t=e.data;t.byteLength>0&&postMessage({cmd:"fetch-chunk",data:new Uint8Array(t),msg:"fetch-chunk"});}},e.onclose=function(e){};break;case"stop":e&&e.close(),self.close(),self.postMessage({cmd:"close",data:"close",msg:"close"});}};}.toString(),i=t.match(/^\s*function\s*\(\s*\)\s*\{(([\s\S](?!\}$))*[\s\S])/),n=[i[1]],window.URL.createObjectURL(new Blob(n,{type:"text/javascript"})))),this.workerFetch.onmessage=function(e){a._workerFetch_onmessage(e,a);},this.workerFetch,this.AVSniffPtr=Module.cwrap("AVSniffHttpFlvInit","number",["string","string"])("base64:QXV0aG9yOmNoYW5neWFubG9uZ3xudW1iZXJ3b2xmLEdpdGh1YjpodHRwczovL2dpdGh1Yi5jb20vbnVtYmVyd29sZixFbWFpbDpwb3JzY2hlZ3QyM0Bmb3htYWlsLmNvbSxRUTo1MzEzNjU4NzIsSG9tZVBhZ2U6aHR0cDovL3h2aWRlby52aWRlbyxEaXNjb3JkOm51bWJlcndvbGYjODY5NCx3ZWNoYXI6bnVtYmVyd29sZjExLEJlaWppbmcsV29ya0luOkJhaWR1","0.0.0"),this.AVSniffPtr,this._ptr_probeCallback=Module.addFunction(this._callbackProbe.bind(this)),this._ptr_yuvCallback=Module.addFunction(this._callbackYUV.bind(this)),this._ptr_naluCallback=Module.addFunction(this._callbackNALU.bind(this)),this._ptr_sampleCallback=Module.addFunction(this._callbackPCM.bind(this)),this._ptr_aacCallback=Module.addFunction(this._callbackAAC.bind(this)),Module.cwrap("initializeSniffHttpFlvModule","number",["number","number","number","number","number","number"])(this.AVSniffPtr,this._ptr_probeCallback,this._ptr_yuvCallback,this._ptr_naluCallback,this._ptr_sampleCallback,this._ptr_aacCallback),this.AVGLObj=r.setupCanvas(this.CanvasObj,{preserveDrawingBuffer:!1}),this.workerFetch.postMessage({cmd:"start",data:e,msg:"start"}),this._decode();}}])&&n(t.prototype,i),u&&n(t,u),e;}();i.CWsLiveCore=u;},{"../consts":52,"../demuxer/buffer":64,"../demuxer/bufferFrame":65,"../render-engine/webgl-420p":77,"../version":80,"./audio-core":53,"./audio-native-core":54,"./av-common":55,"./cache":59,"./cacheYuv":60}],59:[function(e,t,i){(function(i){"use strict";e("./cacheYuv");i.CACHE_APPEND_STATUS_CODE={FAILED:-1,OVERFLOW:-2,OK:0,NOT_FULL:1,FULL:2,NULL:3},t.exports=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:60,t={limit:e,yuvCache:[],appendCacheByCacheYuv:function appendCacheByCacheYuv(e){e.pts;return t.yuvCache.length>=t.limit?CACHE_APPEND_STATUS_CODE.OVERFLOW:(t.yuvCache.push(e),t.yuvCache.length>=t.limit?CACHE_APPEND_STATUS_CODE.FULL:CACHE_APPEND_STATUS_CODE.NOT_FULL);},getState:function getState(){return t.yuvCache.length<=0?CACHE_APPEND_STATUS_CODE.NULL:t.yuvCache.length>=t.limit?CACHE_APPEND_STATUS_CODE.FULL:CACHE_APPEND_STATUS_CODE.NOT_FULL;},cleanPipeline:function cleanPipeline(){t.yuvCache.length=0;},vYuv:function vYuv(){return t.yuvCache.length<=0?null:t.yuvCache.shift();}};return t;};}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{});},{"./cacheYuv":60}],60:[function(e,t,i){"use strict";function n(e,t){for(var i=0;i>1;return r.indexOf(t);},GET_NALU_TYPE:function GET_NALU_TYPE(e){var t=(126&e)>>1;if(t>=1&&t<=9)return n.DEFINE_P_FRAME;if(t>=16&&t<=21)return n.DEFINE_KEY_FRAME;var i=r.indexOf(t);return i>=0?r[i]:n.DEFINE_OTHERS_FRAME;},PACK_NALU:function PACK_NALU(e){var t=e.nalu,i=e.vlc.vlc;null==t.vps&&(t.vps=new Uint8Array());var n=new Uint8Array(t.vps.length+t.sps.length+t.pps.length+t.sei.length+i.length);return n.set(t.vps,0),n.set(t.sps,t.vps.length),n.set(t.pps,t.vps.length+t.sps.length),n.set(t.sei,t.vps.length+t.sps.length+t.pps.length),n.set(i,t.vps.length+t.sps.length+t.pps.length+t.sei.length),n;}};},{"./hevc-header":61}],63:[function(e,t,i){"use strict";function n(e){return function(e){if(Array.isArray(e)){for(var t=0,i=new Array(e.length);t0&&void 0!==arguments[0]&&arguments[0];null!=t&&(t.showScreen=e,t.canvas&&(e?t.canvas.setAttribute("hidden",!0):t.canvas.removeAttribute("hidden")));},setSize:function setSize(e,i){t.config.width=e||l.DEFAULT_WIDTH,t.config.height=i||l.DEFAULT_HEIGHT;},setFrameRate:function setFrameRate(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:25;t.config.fps=e,t.config.frameDurMs=1e3/e;},setDurationMs:function setDurationMs(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1;t.durationMs=e,0==t.config.audioNone&&t.audio.setDurationMs(e);},setPlayingCall:function setPlayingCall(e){t.onPlayingTime=e;},setVoice:function setVoice(e){t.realVolume=e,0==t.config.audioNone&&t.audio.setVoice(t.realVolume);},isPlayingState:function isPlayingState(){return t.isPlaying||t.isCaching===l.CACHE_WITH_PLAY_SIGN;},appendAACFrame:function appendAACFrame(e){t.audio.addSample(e),t.aCachePTS=Math.max(e.pts,t.aCachePTS);},appendHevcFrame:function appendHevcFrame(e){var i;t.config.appendHevcType==l.APPEND_TYPE_STREAM?t.stream=new Uint8Array((i=n(t.stream)).concat.apply(i,n(e))):t.config.appendHevcType==l.APPEND_TYPE_FRAME&&(t.frameList.push(e),t.vCachePTS=Math.max(e.pts,t.vCachePTS));},getCachePTS:function getCachePTS(){return Math.max(t.vCachePTS,t.aCachePTS);},endAudio:function endAudio(){0==t.config.audioNone&&t.audio.stop();},cleanSample:function cleanSample(){0==t.config.audioNone&&t.audio.cleanQueue();},cleanVideoQueue:function cleanVideoQueue(){t.config.appendHevcType==l.APPEND_TYPE_STREAM?t.stream=new Uint8Array():t.config.appendHevcType==l.APPEND_TYPE_FRAME&&(t.frameList=[],t.frameList.length=0);},cleanCacheYUV:function cleanCacheYUV(){t.cacheYuvBuf.cleanPipeline();},pause:function pause(){t.loop&&window.clearInterval(t.loop),t.loop=null,0==t.config.audioNone&&t.audio.pause(),t.isPlaying=!1,t.isCaching===l.CACHE_WITH_PLAY_SIGN&&(t.isCaching=l.CACHE_WITH_NOPLAY_SIGN);},checkFinished:function checkFinished(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:l.PLAYER_MODE_VOD;return e==l.PLAYER_MODE_VOD&&t.cacheYuvBuf.yuvCache.length<=0&&(t.videoPTS.toFixed(1)>=(t.durationMs-t.config.frameDurMs)/1e3||t.noCacheFrame>=10)&&(null!=t.onPlayingFinish&&(l.PLAYER_MODE_VOD,t.frameList.length,t.cacheYuvBuf.yuvCache.length,t.videoPTS.toFixed(1),t.durationMs,t.config.frameDurMs,t.noCacheFrame,t.onPlayingFinish()),!0);},clearAllCache:function clearAllCache(){t.nowPacket=null,t.vCachePTS=0,t.aCachePTS=0,t.cleanSample(),t.cleanVideoQueue(),t.cleanCacheYUV();},seek:function seek(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.isPlaying;t.pause(),t.stopCacheThread(),t.clearAllCache(),e&&e(),t.isNewSeek=!0,t.flushDecoder=1,t.videoPTS=parseInt(i.seekTime);var r={seekPos:i.seekTime||-1,mode:i.mode||l.PLAYER_MODE_VOD,accurateSeek:i.accurateSeek||!0,seekEvent:i.seekEvent||!0,realPlay:n};t.cacheThread(),t.play(r);},getNalu1Packet:function getNalu1Packet(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],i=null,n=-1;if(t.config.appendHevcType==l.APPEND_TYPE_STREAM)i=t.nextNalu();else{if(t.config.appendHevcType!=l.APPEND_TYPE_FRAME)return null;var r=t.frameList.shift();if(!r)return null;i=r.data,n=r.pts,e&&(t.videoPTS=n);}return{nalBuf:i,pts:n};},decodeNalu1Frame:function decodeNalu1Frame(e,i){var n=Module._malloc(e.length);Module.HEAP8.set(e,n);var r=parseInt(1e3*i);Module.cwrap("decodeCodecContext","number",["number","number","number","number","number"])(t.vcodecerPtr,n,e.length,r,t.flushDecoder);return t.flushDecoder=0,Module._free(n),!1;},cacheThread:function cacheThread(){t.cacheLoop=window.setInterval(function(){if(t.cacheYuvBuf.getState()!=CACHE_APPEND_STATUS_CODE.FULL){var e=t.getNalu1Packet(!1);if(null!=e){var i=e.nalBuf,n=e.pts;t.decodeNalu1Frame(i,n,!0);}}},10);},stopCacheThread:function stopCacheThread(){null!==t.cacheLoop&&(window.clearInterval(t.cacheLoop),t.cacheLoop=null);},loadCache:function loadCache(){if(!(t.frameList.length<=3)){var e=t.isPlaying;if(t.cacheYuvBuf.yuvCache.length<=3){t.pause(),null!=t.onLoadCache&&t.onLoadCache(),t.isCaching=e?l.CACHE_WITH_PLAY_SIGN:l.CACHE_WITH_NOPLAY_SIGN;var i=t.frameList.length>30?30:t.frameList.length;null===t.cacheInterval&&(t.cacheInterval=window.setInterval(function(){t.cacheYuvBuf.yuvCache.length>=i&&(null!=t.onLoadCacheFinshed&&t.onLoadCacheFinshed(),window.clearInterval(t.cacheInterval),t.cacheInterval=null,t.isCaching===l.CACHE_WITH_PLAY_SIGN&&t.play(t.playParams),t.isCaching=l.CACHE_NO_LOADCACHE);},40));}}},playFunc:function playFunc(){var e=!1;if(t.playParams.seekEvent||r.GetMsTime()-t.calcuteStartTime>=t.frameTime-t.preCostTime){e=!0;var i=!0;if(t.calcuteStartTime=r.GetMsTime(),t.config.audioNone)t.playFrameYUV(i,t.playParams.accurateSeek);else{t.fix_poc_err_skip>0&&(t.fix_poc_err_skip--,i=!1);var n=t.videoPTS-t.audio.getAlignVPTS();if(n>0)return void(t.playParams.seekEvent&&!t.config.audioNone&&t.audio.setVoice(0));if(i){if(!(i=-1*n<=1*t.frameTimeSec)){for(var a=parseInt(n/t.frameTimeSec),s=0;s=i&&(t.playFrameYUV(!0,t.playParams.accurateSeek),i+=1);},1);}else t.videoPTS>=t.playParams.seekPos&&!t.isNewSeek||0===t.playParams.seekPos||0===t.playParams.seekPos?(t.frameTime=1e3/t.config.fps,t.frameTimeSec=t.frameTime/1e3,0==t.config.audioNone&&t.audio.play(),t.realVolume=t.config.audioNone?0:t.audio.voice,t.playParams.seekEvent&&(t.fix_poc_err_skip=10),t.loop=window.setInterval(function(){var e=r.GetMsTime();t.playFunc(),t.preCostTime=r.GetMsTime()-e;},1)):(t.loop=window.setInterval(function(){t.playFrameYUV(!1,t.playParams.accurateSeek),t.checkFinished(t.playParams.mode)?(window.clearInterval(t.loop),t.loop=null):t.videoPTS>=t.playParams.seekPos&&(window.clearInterval(t.loop),t.loop=null,t.play(t.playParams));},1),t.isNewSeek=!1);},stop:function stop(){t.release(),Module.cwrap("initializeDecoder","number",["number"])(t.vcodecerPtr),t.stream=new Uint8Array();},release:function release(){return t.endAudio(),t.cacheLoop&&window.clearInterval(t.cacheLoop),t.cacheLoop=null,t.loop&&window.clearInterval(t.loop),t.loop=null,t.pause(),null!==t.videoCallback&&Module.removeFunction(t.videoCallback),t.videoCallback=null,Module.cwrap("release","number",["number"])(t.vcodecerPtr),t.stream=null,t.frameList.length=0,t.durationMs=-1,t.videoPTS=0,t.isPlaying=!1,!0;},nextNalu:function nextNalu(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;if(t.stream.length<=4)return!1;for(var i=-1,n=0;n=t.stream.length){if(-1==i)return!1;var r=t.stream.subarray(i);return t.stream=new Uint8Array(),r;}var a="0 0 1"==t.stream.slice(0,3).join(" "),s="0 0 0 1"==t.stream.slice(0,4).join(" ");if(a||s){if(-1==i)i=n;else{if(e<=1){var o=t.stream.subarray(i,n);return t.stream=t.stream.subarray(n),o;}e-=1;}n+=3;}}return!1;},decodeSendPacket:function decodeSendPacket(e){var i=Module._malloc(e.length);Module.HEAP8.set(e,i);var n=Module.cwrap("decodeSendPacket","number",["number","number","number"])(t.vcodecerPtr,i,e.length);return Module._free(i),n;},decodeRecvFrame:function decodeRecvFrame(){return Module.cwrap("decodeRecv","number",["number"])(t.vcodecerPtr);},playFrameYUV:function playFrameYUV(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],i=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=t.cacheYuvBuf.vYuv();if(null==n)return t.noCacheFrame+=1,e&&!t.playParams.seekEvent&&t.loadCache(),!1;t.noCacheFrame=0;var r=n.pts;return t.videoPTS=r,(!e&&i||e)&&e&&t.drawImage(n.width,n.height,n.imageBufferY,n.imageBufferB,n.imageBufferR),e&&!t.playParams.seekEvent&&t.isPlaying&&t.loadCache(),!0;},drawImage:function drawImage(e,i,n,r,a){if(t.canvas.width===e&&t.canvas.height==i||(t.canvas.width=e,t.canvas.height=i),t.showScreen&&null!=t.onRender)t.onRender(e,i,n,r,a);else{if(!t.isCheckDisplay)t.checkDisplaySize(e,i);var s=e*i,o=e/2*(i/2),l=new Uint8Array(s+2*o);l.set(n,0),l.set(r,s),l.set(a,s+o),u.renderFrame(t.yuv,n,r,a,e,i);}},debugYUV:function debugYUV(e){t.debugYUVSwitch=!0,t.debugID=e;},checkDisplaySize:function checkDisplaySize(e,i){var n=e/t.config.width>i/t.config.height,r=(t.config.width/e).toFixed(2),a=(t.config.height/i).toFixed(2),s=n?r:a,o=t.config.fixed,u=o?t.config.width:parseInt(e*s),l=o?t.config.height:parseInt(i*s);if(t.canvas.offsetWidth!=u||t.canvas.offsetHeight!=l){var d=parseInt((t.canvasBox.offsetHeight-l)/2),h=parseInt((t.canvasBox.offsetWidth-u)/2);t.canvas.style.marginTop=d+"px",t.canvas.style.marginLeft=h+"px",t.canvas.style.width=u+"px",t.canvas.style.height=l+"px";}return t.isCheckDisplay=!0,[u,l];},makeWasm:function makeWasm(){if(null!=t.config.token){t.vcodecerPtr=Module.cwrap("registerPlayer","number",["string","string"])(t.config.token,d.PLAYER_VERSION),t.videoCallback=Module.addFunction(function(e,i,n,r,a,s,u,l,d){var h=Module.HEAPU8.subarray(e,e+r*l),c=Module.HEAPU8.subarray(i,i+a*l/2),f=Module.HEAPU8.subarray(n,n+s*l/2),p=new Uint8Array(h),m=new Uint8Array(c),g=new Uint8Array(f),_=1*d/1e3,y=new o.CacheYuvStruct(_,r,l,p,m,g);t.cacheYuvBuf.appendCacheByCacheYuv(y);}),Module.cwrap("setCodecType","number",["number","number","number"])(t.vcodecerPtr,t.config.videoCodec,t.videoCallback);Module.cwrap("initMissile","number",["number"])(t.vcodecerPtr);Module.cwrap("initializeDecoder","number",["number"])(t.vcodecerPtr);}},makeIt:function makeIt(){var e=document.querySelector("div#"+t.config.playerId),i=document.createElement("canvas");i.style.width=e.clientWidth+"px",i.style.height=e.clientHeight+"px",i.style.top="0px",i.style.left="0px",e.appendChild(i),t.canvasBox=e,t.canvas=i,t.yuv=u.setupCanvas(i,{preserveDrawingBuffer:!1}),0==t.config.audioNone&&(t.audio=a({sampleRate:t.config.sampleRate,appendType:t.config.appendHevcType})),t.isPlayLoadingFinish=1;}};return t.makeWasm(),t.makeIt(),t.cacheThread(),t;};},{"../consts":52,"../render-engine/webgl-420p":77,"../version":80,"./audio-core":53,"./av-common":55,"./cache":59,"./cacheYuv":60}],64:[function(e,t,i){"use strict";var n=e("./bufferFrame");t.exports=function(){var e={videoBuffer:[],audioBuffer:[],idrIdxBuffer:[],appendFrame:function appendFrame(t,i){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],s=new n.BufferFrame(t,a,i,r),o=parseInt(t);return r?(e.videoBuffer.length-1>=o?e.videoBuffer[o].push(s):e.videoBuffer.push([s]),a&&!e.idrIdxBuffer.includes(t)&&e.idrIdxBuffer.push(t)):e.audioBuffer.length-1>=o&&null!=e.audioBuffer[o]&&null!=e.audioBuffer[o]?e.audioBuffer[o]&&e.audioBuffer[o].push(s):e.audioBuffer.push([s]),!0;},appendFrameWithDts:function appendFrameWithDts(t,i,r){var a=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],s=arguments.length>4&&void 0!==arguments[4]&&arguments[4],o=n.ConstructWithDts(t,i,s,r,a),u=parseInt(i);return a?(e.videoBuffer.length-1>=u?e.videoBuffer[u].push(o):e.videoBuffer.push([o]),s&&!e.idrIdxBuffer.includes(i)&&e.idrIdxBuffer.push(i)):e.audioBuffer.length-1>=u&&null!=e.audioBuffer[u]&&null!=e.audioBuffer[u]?e.audioBuffer[u]&&e.audioBuffer[u].push(o):e.audioBuffer.push([o]),!0;},appendFrameByBufferFrame:function appendFrameByBufferFrame(t){var i=t.pts,n=parseInt(i);return t.video?(e.videoBuffer.length-1>=n?e.videoBuffer[n].push(t):e.videoBuffer.push([t]),isKey&&!e.idrIdxBuffer.includes(i)&&e.idrIdxBuffer.push(i)):e.audioBuffer.length-1>=n?e.audioBuffer[n].push(t):e.audioBuffer.push([t]),!0;},cleanPipeline:function cleanPipeline(){e.videoBuffer.length=0,e.audioBuffer.length=0;},vFrame:function vFrame(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1;if(!(t<0||t>e.videoBuffer.length-1))return e.videoBuffer[t];},aFrame:function aFrame(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1;if(!(t<0||t>e.audioBuffer.length-1))return e.audioBuffer[t];},seekIDR:function seekIDR(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1;if(e.idrIdxBuffer,e.videoBuffer,t<0)return null;if(e.idrIdxBuffer.includes(t))return t;for(var i=0;it||0===i&&e.idrIdxBuffer[i]>=t){for(var n=1;n>=0;n--){var r=i-n;if(r>=0)return e.idrIdxBuffer[r],e.idrIdxBuffer[r];}return e.idrIdxBuffer[i],j,e.idrIdxBuffer[i];}}}};return e;};},{"./bufferFrame":65}],65:[function(e,t,i){"use strict";function n(e,t){for(var i=0;i0&&i.extensionInfo.vHeight>0&&(i.size.width=i.extensionInfo.vWidth,i.size.height=i.extensionInfo.vHeight)),i.mediaInfo.duration,null!=i.onDemuxed&&i.onDemuxed(i.onReadyOBJ);for(var e=!1;void 0!==i.mpegTsObj&&null!==i.mpegTsObj;){var n=i.mpegTsObj.readPacket();if(n.size<=0)break;var r=n.dtime>0?n.dtime:n.ptime;if(!(r<0)){if(0==n.type){r<=i.vPreFramePTS&&(e=!0);var a=u.PACK_NALU(n.layer),o=1==n.keyframe,l=1==e?r+i.vStartTime:r,d=new s.BufferFrame(l,o,a,!0);i.bufObject.appendFrame(d.pts,d.data,!0,d.isKey),i.vPreFramePTS=l,null!=i.onSamples&&i.onSamples(i.onReadyOBJ,d);}else if(r<=i.aPreFramePTS&&(e=!0),"aac"==i.mediaInfo.aCodec)for(var h=n.data,c=0;c=3?(i._onTsReady(e),window.clearInterval(i.timerTsWasm),i.timerTsWasm=null):(i.mpegTsWasmRetryLoadTimes+=1,i.mpegTsObj.initDemuxer());},3e3);}},{key:"_onTsReady",value:function value(e){var t=this;t.hls.fetchM3u8(e),t.mpegTsWasmState=!0,t.timerFeed=window.setInterval(function(){if(t.tsList.length>0&&0==t.lockWait.state)try{var e=t.tsList.shift();if(null!=e){var i=e.streamURI,n=e.streamDur;t.lockWait.state=!0,t.lockWait.lockMember.dur=n,t.mpegTsObj.isLive=t.hls.isLive(),t.mpegTsObj.demuxURL(i);}else console.error("_onTsReady need wait ");}catch(e){console.error("onTsReady ERROR:",e),t.lockWait.state=!1;}},50);}},{key:"release",value:function value(){this.hls&&this.hls.release(),this.hls=null,this.timerFeed&&window.clearInterval(this.timerFeed),this.timerFeed=null,this.timerTsWasm&&window.clearInterval(this.timerTsWasm),this.timerTsWasm=null;}},{key:"bindReady",value:function value(e){this.onReadyOBJ=e;}},{key:"popBuffer",value:function value(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;return t<0?null:1===e?t+1>this.bufObject.videoBuffer.length?null:this.bufObject.vFrame(t):2===e?t+1>this.bufObject.audioBuffer.length?null:this.bufObject.aFrame(t):void 0;}},{key:"getVLen",value:function value(){return this.bufObject.videoBuffer.length;}},{key:"getALen",value:function value(){return this.bufObject.audioBuffer.length;}},{key:"getLastIdx",value:function value(){return this.bufObject.videoBuffer.length-1;}},{key:"getALastIdx",value:function value(){return this.bufObject.audioBuffer.length-1;}},{key:"getACodec",value:function value(){return this.aCodec;}},{key:"getVCodec",value:function value(){return this.vCodec;}},{key:"getDurationMs",value:function value(){return this.durationMs;}},{key:"getFPS",value:function value(){return this.fps;}},{key:"getSampleRate",value:function value(){return this.sampleRate;}},{key:"getSampleChannel",value:function value(){return this.aChannel;}},{key:"getSize",value:function value(){return this.size;}},{key:"seek",value:function value(e){if(e>=0){var t=this.bufObject.seekIDR(e);this.seekPos=t;}}}])&&n(t.prototype,i),d&&n(t,d),e;}();i.M3u8=d;},{"../consts":52,"../decoder/hevc-imp":62,"./buffer":64,"./bufferFrame":65,"./m3u8base":67,"./mpegts/mpeg.js":71}],67:[function(e,t,i){"use strict";function n(e,t){for(var i=0;i ",t),setTimeout(function(){i.fetchM3u8(e);},500);});}},{key:"_uriParse",value:function value(e){this._preURI="";var t=e.split("//"),i=null,n=null;if(t.length<1)return!1;t.length>1?(i=t[0],n=t[1].split("/"),this._preURI=i+"//"):n=t[0].split("/");for(var r=0;rp&&(o=p);var m=n[l+=1],g=null;g=m.indexOf("http")>=0?m:this._preURI+m,this._slices.indexOf(g)<0&&(this._slices.push(g),this._slices[this._slices.length-1],null!=this.onTransportStream&&this.onTransportStream(g,p));}}}if(this._slices.length>s.hlsSliceLimit&&this._type==r.PLAYER_IN_TYPE_M3U8_LIVE&&(this._slices=this._slices.slice(-1*s.hlsSliceLimit)),null!=this.onFinished){var _={type:this._type,duration:-1};this.onFinished(_);}return o;}},{key:"_readTag",value:function value(e){var t=s.tagParse.exec(e);return null!==t?{key:t[1],value:t[3]}:null;}}])&&n(t.prototype,i),o&&n(t,o),e;}();i.M3u8Base=o;},{"../consts":52}],68:[function(e,t,i){"use strict";var n=e("mp4box"),r=e("../decoder/hevc-header"),a=e("../decoder/hevc-imp"),s=e("./buffer"),o=e("../consts"),u={96e3:0,88200:1,64e3:2,48e3:3,44100:4,32e3:5,24e3:6,22050:7,16e3:8,12e3:9,11025:10,8e3:11,7350:12,Reserved:13,"frequency is written explictly":15},l=function l(e){for(var t=[],i=0;i1&&void 0!==arguments[1]&&arguments[1],i=null;return t?((i=e)[0]=r.DEFINE_STARTCODE[0],i[1]=r.DEFINE_STARTCODE[1],i[2]=r.DEFINE_STARTCODE[2],i[3]=r.DEFINE_STARTCODE[3]):((i=new Uint8Array(r.DEFINE_STARTCODE.length+e.length)).set(r.DEFINE_STARTCODE,0),i.set(e,r.DEFINE_STARTCODE.length)),i;},d.prototype.setAACAdts=function(e){var t=null,i=this.aacProfile,n=u[this.sampleRate],r=new Uint8Array(7),a=r.length+e.length;return r[0]=255,r[1]=241,r[2]=(i-1<<6)+(n<<2)+0,r[3]=128+(a>>11),r[4]=(2047&a)>>3,r[5]=31+((7&a)<<5),r[6]=252,(t=new Uint8Array(a)).set(r,0),t.set(e,r.length),t;},d.prototype.demux=function(){var e=this;e.seekPos=-1,e.mp4boxfile=n.createFile(),e.movieInfo=null,e.videoCodec=null,e.durationMs=-1,e.fps=-1,e.sampleRate=-1,e.aacProfile=2,e.size={width:-1,height:-1},e.bufObject=s(),e.audioNone=!1,e.naluHeader={vps:null,sps:null,pps:null,sei:null},e.mp4boxfile.onError=function(e){},this.mp4boxfile.onReady=function(t){for(var i in e.movieInfo=t,t.tracks){"VideoHandler"!==t.tracks[i].name&&"video"!==t.tracks[i].type||(t.tracks[i].codec,t.tracks[i].codec.indexOf("hev")>=0||t.tracks[i].codec.indexOf("hvc")>=0?e.videoCodec=o.CODEC_H265:t.tracks[i].codec.indexOf("avc")>=0&&(e.videoCodec=o.CODEC_H264));}var n=-1;if(n=t.videoTracks[0].samples_duration/t.videoTracks[0].timescale,e.durationMs=1e3*n,e.fps=t.videoTracks[0].nb_samples/n,e.seekDiffTime=1/e.fps,e.size.width=t.videoTracks[0].track_width,e.size.height=t.videoTracks[0].track_height,t.audioTracks.length>0){e.sampleRate=t.audioTracks[0].audio.sample_rate;var r=t.audioTracks[0].codec.split(".");e.aacProfile=r[r.length-1];}else e.audioNone=!0;null!=e.onMp4BoxReady&&e.onMp4BoxReady(e.videoCodec),e.videoCodec===o.CODEC_H265?(e.initializeAllSourceBuffers(),e.mp4boxfile.start()):(e.videoCodec,o.CODEC_H264);},e.mp4boxfile.onSamples=function(t,i,n){var s=window.setInterval(function(){for(var i=0;i3?e.naluHeader.sei=e.setStartCode(g[3][0].data,!1):e.naluHeader.sei=new Uint8Array(),e.naluHeader;}else e.videoCodec==o.CODEC_H264&&(e.naluHeader.vps=new Uint8Array(),e.naluHeader.sps=e.setStartCode(f.SPS[0].nalu,!1),e.naluHeader.pps=e.setStartCode(f.PPS[0].nalu,!1),e.naluHeader.sei=new Uint8Array());d[4].toString(16),e.naluHeader.vps[4].toString(16),l(e.naluHeader.vps),l(d);var _=e.setStartCode(d.subarray(0,e.naluHeader.vps.length),!0);if(l(_),d[4]===e.naluHeader.vps[4]){var y=e.naluHeader.vps.length+4,v=e.naluHeader.vps.length+e.naluHeader.sps.length+4,b=e.naluHeader.vps.length+e.naluHeader.sps.length+e.naluHeader.pps.length+4;if(e.naluHeader.sei.length<=0&&e.naluHeader.sps.length>0&&d[y]===e.naluHeader.sps[4]&&e.naluHeader.pps.length>0&&d[v]===e.naluHeader.pps[4]&&78===d[b]){d[e.naluHeader.vps.length+4],e.naluHeader.sps[4],d[e.naluHeader.vps.length+e.naluHeader.sps.length+4],e.naluHeader.pps[4],d[e.naluHeader.vps.length+e.naluHeader.sps.length+e.naluHeader.pps.length+4];for(var T=0,S=0;S4&&d[4]===e.naluHeader.sei[4]){var E=d.subarray(0,10),w=new Uint8Array(e.naluHeader.vps.length+E.length);w.set(E,0),w.set(e.naluHeader.vps,E.length),w[3]=1,e.naluHeader.vps=null,e.naluHeader.vps=new Uint8Array(w),w=null,E=null,(d=d.subarray(10))[4],e.naluHeader.vps[4],e.naluHeader.vps;}else if(0===e.naluHeader.sei.length&&78===d[4]){d=e.setStartCode(d,!0);for(var C=0,A=0;A1&&void 0!==arguments[1]?arguments[1]:0;return e.fileStart=t,this.mp4boxfile.appendBuffer(e);},d.prototype.finishBuffer=function(){this.mp4boxfile.flush();},d.prototype.play=function(){},d.prototype.getVideoCoder=function(){return this.videoCodec;},d.prototype.getDurationMs=function(){return this.durationMs;},d.prototype.getFPS=function(){return this.fps;},d.prototype.getSampleRate=function(){return this.sampleRate;},d.prototype.getSize=function(){return this.size;},d.prototype.seek=function(e){if(e>=0){var t=this.bufObject.seekIDR(e);this.seekPos=t;}},d.prototype.popBuffer=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;return t<0?null:1==e?this.bufObject.vFrame(t):2==e?this.bufObject.aFrame(t):void 0;},d.prototype.addBuffer=function(e){var t=e.id;this.mp4boxfile.setExtractionOptions(t);},d.prototype.initializeAllSourceBuffers=function(){if(this.movieInfo){for(var e=this.movieInfo,t=0;t>5);}},{key:"sliceAACFrames",value:function value(e,t){for(var i=[],n=e,r=0;r>4==15){var a=this._getPktLen(t[r+3],t[r+4],t[r+5]);if(a<=0)continue;var s=t.subarray(r,r+a),o=new Uint8Array(a);o.set(s,0),i.push({ptime:n,data:o}),n+=this.frameDurSec,r+=a;}else r+=1;}return i;}}])&&n(t.prototype,i),r&&n(t,r),e;}();i.AACDecoder=r;},{}],71:[function(e,t,i){(function(t){"use strict";function n(e,t){for(var i=0;i ",e),n=null;})["catch"](function(i){console.error("demuxerTsInit ERROR fetch ERROR ==> ",i),t._releaseOffset(),t.onDemuxedFailed&&t.onDemuxedFailed(i,e);});}},{key:"_releaseOffset",value:function value(){void 0!==this.offsetDemux&&null!==this.offsetDemux&&(Module._free(this.offsetDemux),this.offsetDemux=null);}},{key:"_demuxCore",value:function value(e){if(this._releaseOffset(),this._refreshDemuxer(),!(e.length<=0)){this.offsetDemux=Module._malloc(e.length),Module.HEAP8.set(e,this.offsetDemux);var t=Module.cwrap("demuxBox","number",["number","number","number"])(this.offsetDemux,e.length,this.isLive);Module._free(this.offsetDemux),this.offsetDemux=null,t>=0&&(this._setMediaInfo(),this._setExtensionInfo(),null!=this.onDemuxed&&this.onDemuxed());}}},{key:"_setMediaInfo",value:function value(){var e=Module.cwrap("getMediaInfo","number",[])(),t=Module.HEAPU32[e/4],i=Module.HEAPU32[e/4+1],n=Module.HEAPF64[e/8+1],s=Module.HEAPF64[e/8+1+1],o=Module.HEAPF64[e/8+1+1+1],u=Module.HEAPF64[e/8+1+1+1+1],l=Module.HEAPU32[e/4+2+2+2+2+2];this.mediaAttr.vFps=n,this.mediaAttr.vGop=l,this.mediaAttr.vDuration=s,this.mediaAttr.aDuration=o,this.mediaAttr.duration=u;var d=Module.cwrap("getAudioCodecID","number",[])();d>=0?(this.mediaAttr.aCodec=a.CODEC_OFFSET_TABLE[d],this.mediaAttr.sampleRate=t>0?t:a.DEFAULT_SAMPLERATE,this.mediaAttr.sampleChannel=i>=0?i:a.DEFAULT_CHANNEL):(this.mediaAttr.sampleRate=0,this.mediaAttr.sampleChannel=0,this.mediaAttr.audioNone=!0);var h=Module.cwrap("getVideoCodecID","number",[])();h>=0&&(this.mediaAttr.vCodec=a.CODEC_OFFSET_TABLE[h]),null==this.aacDec?this.aacDec=new r.AACDecoder(this.mediaAttr):this.aacDec.updateConfig(this.mediaAttr);}},{key:"_setExtensionInfo",value:function value(){var e=Module.cwrap("getExtensionInfo","number",[])(),t=Module.HEAPU32[e/4],i=Module.HEAPU32[e/4+1];this.extensionInfo.vWidth=t,this.extensionInfo.vHeight=i;}},{key:"readMediaInfo",value:function value(){return this.mediaAttr;}},{key:"readExtensionInfo",value:function value(){return this.extensionInfo;}},{key:"readAudioNone",value:function value(){return this.mediaAttr.audioNone;}},{key:"_readLayer",value:function value(){var e={vps:null,sps:null,pps:null,sei:null},t={vlc:null},i=Module.cwrap("getSPSLen","number",[])(),n=Module.cwrap("getSPS","number",[])();if(!(i<0)){e.sps=new Uint8Array(i),e.sps.set(Module.HEAPU8.subarray(n,n+i),0);var r=Module.cwrap("getPPSLen","number",[])(),s=Module.cwrap("getPPS","number",[])();e.pps=new Uint8Array(r),e.pps.set(Module.HEAPU8.subarray(s,s+r),0);var o=Module.cwrap("getSEILen","number",[])(),u=Module.cwrap("getSEI","number",[])();e.sei=new Uint8Array(o),e.sei.set(Module.HEAPU8.subarray(u,u+o),0);var l=Module.cwrap("getVLCLen","number",[])(),d=Module.cwrap("getVLC","number",[])();if(t.vlc=new Uint8Array(l),t.vlc.set(Module.HEAPU8.subarray(d,d+l),0),this.mediaAttr.vCodec==a.DEF_HEVC||this.mediaAttr.vCodec==a.DEF_H265){var h=Module.cwrap("getVPSLen","number",[])(),c=Module.cwrap("getVPS","number",[])();e.vps=new Uint8Array(h),e.vps.set(Module.HEAPU8.subarray(c,c+h),0);}else this.mediaAttr.vCodec==a.DEF_AVC||(this.mediaAttr.vCodec,a.DEF_H264);return{nalu:e,vlc:t};}}},{key:"isHEVC",value:function value(){return this.mediaAttr.vCodec==a.DEF_HEVC||this.mediaAttr.vCodec==a.DEF_H265;}},{key:"readPacket",value:function value(){var e=Module.cwrap("getPacket","number",[])(),t=Module.HEAPU32[e/4],i=Module.HEAPU32[e/4+1],n=Module.HEAPF64[e/8+1],r=Module.HEAPF64[e/8+1+1],s=Module.HEAPU32[e/4+1+1+2+2],o=Module.HEAPU32[e/4+1+1+2+2+1],u=Module.HEAPU8.subarray(o,o+i),l=this._readLayer();return{type:t,size:i,ptime:n,dtime:r,keyframe:s,src:u,data:1==t&&this.mediaAttr.aCodec==a.DEF_AAC?this.aacDec.sliceAACFrames(n,u):u,layer:l};}},{key:"_refreshDemuxer",value:function value(){this.releaseTsDemuxer(),this._initDemuxer();}},{key:"_initDemuxer",value:function value(){Module.cwrap("initTsMissile","number",[])(),Module.cwrap("initializeDemuxer","number",[])();}},{key:"releaseTsDemuxer",value:function value(){Module.cwrap("exitTsMissile","number",[])();}}])&&n(i.prototype,s),o&&n(i,o),e;}();i.MPEG_JS=s;}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{});},{"./consts":69,"./decoder/aac":70}],72:[function(e,t,i){"use strict";function n(e,t){for(var i=0;i0&&e.extensionInfo.vHeight>0&&(e.size.width=e.extensionInfo.vWidth,e.size.height=e.extensionInfo.vHeight);for(var t=null;!((t=e.mpegTsObj.readPacket()).size<=0);){var i=t.dtime;if(0==t.type){var n=s.PACK_NALU(t.layer),r=1==t.keyframe;e.bufObject.appendFrame(i,n,!0,r);}else if("aac"==e.mediaInfo.aCodec)for(var a=t.data,o=0;o0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;return t<0?null:1==e?this.bufObject.vFrame(t):2==e?this.bufObject.aFrame(t):void 0;}},{key:"isHEVC",value:function value(){return this.mpegTsObj.isHEVC();}},{key:"getACodec",value:function value(){return this.aCodec;}},{key:"getVCodec",value:function value(){return this.vCodec;}},{key:"getAudioNone",value:function value(){return this.mpegTsObj.mediaAttr.audioNone;}},{key:"getDurationMs",value:function value(){return this.durationMs;}},{key:"getFPS",value:function value(){return this.fps;}},{key:"getSampleRate",value:function value(){return this.sampleRate;}},{key:"getSize",value:function value(){return this.size;}},{key:"seek",value:function value(e){if(e>=0){var t=this.bufObject.seekIDR(e);this.seekPos=t;}}}])&&n(t.prototype,i),o&&n(t,o),e;}();i.MpegTs=o;},{"../decoder/hevc-imp":62,"./buffer":64,"./mpegts/mpeg.js":71}],73:[function(e,t,i){(function(t){"use strict";function n(e,t){for(var i=0;i0&&void 0!==arguments[0]&&arguments[0];return void 0!==this.player&&null!==this.player&&(this.player.setScreen(e),!0);}},{key:"play",value:function value(){if(void 0===this.player||null===this.player)return!1;if(this.playParam.videoCodec===m.CODEC_H265){var e={seekPos:this._getSeekTarget(),mode:this.playMode,accurateSeek:this.configFormat.accurateSeek,seekEvent:!1,realPlay:!0};this.player.play(e);}else this.player.play();return!0;}},{key:"pause",value:function value(){return void 0!==this.player&&null!==this.player&&(this.player.pause(),!0);}},{key:"isPlaying",value:function value(){return void 0!==this.player&&null!==this.player&&this.player.isPlayingState();}},{key:"setVoice",value:function value(e){return!(e<0||void 0===this.player||null===this.player||(this.volume=e,this.player&&this.player.setVoice(e),0));}},{key:"getVolume",value:function value(){return this.volume;}},{key:"mediaInfo",value:function value(){var e={meta:this.playParam,videoType:this.playMode};return e.meta.isHEVC=0===this.playParam.videoCodec,e;}},{key:"_seekHLS",value:function value(e,t,i){if(void 0===this.player||null===this.player)return!1;setTimeout(function(){t.player.getCachePTS(),t.player.getCachePTS()>e?i():t._seekHLS(e,t,i);},100);}},{key:"seek",value:function value(e){if(void 0===this.player||null===this.player)return!1;var t=this;this.seekTarget=e,this.onSeekStart&&this.onSeekStart(e),this.timerFeed&&(window.clearInterval(this.timerFeed),this.timerFeed=null);var i=this._getSeekTarget();return this.playParam.videoCodec===m.CODEC_H264?(this.player.seek(e),this.onSeekFinish&&this.onSeekFinish()):this.configFormat.extInfo.core===m.PLAYER_CORE_TYPE_CNATIVE?(this.pause(),this._seekHLS(e,this,function(){t.player.seek(function(){},{seekTime:i,mode:t.playMode,accurateSeek:t.configFormat.accurateSeek});})):this._seekHLS(e,this,function(){t.player.seek(function(){t.configFormat.type==m.PLAYER_IN_TYPE_MP4?t.mp4Obj.seek(e):t.configFormat.type==m.PLAYER_IN_TYPE_TS||t.configFormat.type==m.PLAYER_IN_TYPE_MPEGTS?t.mpegTsObj.seek(e):t.configFormat.type==m.PLAYER_IN_TYPE_M3U8&&(t.hlsObj.onSamples=null,t.hlsObj.seek(e));var i,n=(i=0,i=t.configFormat.accurateSeek?e:t._getBoxBufSeekIDR(),parseInt(i)),r=parseInt(t._getBoxBufSeekIDR())||0;t._avFeedMP4Data(r,n);},{seekTime:i,mode:t.playMode,accurateSeek:t.configFormat.accurateSeek});}),!0;}},{key:"fullScreen",value:function value(){if(this.autoScreenClose=!0,this.player.vCodecID===m.V_CODEC_NAME_HEVC){var e=document.querySelector("#"+this.configFormat.playerId),t=e.getElementsByTagName("canvas")[0];e.style.width=this.screenW+"px",e.style.height=this.screenH+"px";var i=this._checkScreenDisplaySize(this.screenW,this.screenH,this.playParam.size.width,this.playParam.size.height);t.style.marginTop=i[0]+"px",t.style.marginLeft=i[1]+"px",t.style.width=i[2]+"px",t.style.height=i[3]+"px",this._requestFullScreen(e);}else this._requestFullScreen(this.player.videoTag);}},{key:"closeFullScreen",value:function value(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!1===e&&(this.autoScreenClose=!1,this._exitFull()),this.player.vCodecID===m.V_CODEC_NAME_HEVC){var t=document.querySelector("#"+this.configFormat.playerId),i=t.getElementsByTagName("canvas")[0];t.style.width=this.configFormat.playerW+"px",t.style.height=this.configFormat.playerH+"px";var n=this._checkScreenDisplaySize(this.configFormat.playerW,this.configFormat.playerH,this.playParam.size.width,this.playParam.size.height);i.style.marginTop=n[0]+"px",i.style.marginLeft=n[1]+"px",i.style.width=n[2]+"px",i.style.height=n[3]+"px";}}},{key:"_checkScreenDisplaySize",value:function value(e,t,i,n){var r=i/e>n/t,a=(e/i).toFixed(2),s=(t/n).toFixed(2),o=r?a:s,u=this.fixed?e:parseInt(i*o),l=this.fixed?t:parseInt(n*o);return[parseInt((t-l)/2),parseInt((e-u)/2),u,l];}},{key:"_isFullScreen",value:function value(){var e=document.fullscreenElement||document.mozFullscreenElement||document.webkitFullscreenElement;return document.fullscreenEnabled||document.mozFullscreenEnabled||document.webkitFullscreenEnabled,null!=e;}},{key:"_requestFullScreen",value:function value(e){e.requestFullscreen?e.requestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.msRequestFullscreen?e.msRequestFullscreen():e.webkitRequestFullscreen&&e.webkitRequestFullScreen();}},{key:"_exitFull",value:function value(){document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.msExitFullscreen&&document.msExitFullscreen();}},{key:"_durationText",value:function value(e){if(e<0)return"Play";var t=Math.round(e);return Math.floor(t/3600)+":"+Math.floor(t%3600/60)+":"+Math.floor(t%60);}},{key:"_getSeekTarget",value:function value(){return this.configFormat.accurateSeek?this.seekTarget:this._getBoxBufSeekIDR();}},{key:"_getBoxBufSeekIDR",value:function value(){return this.configFormat.type==m.PLAYER_IN_TYPE_MP4?this.mp4Obj.seekPos:this.configFormat.type==m.PLAYER_IN_TYPE_TS||this.configFormat.type==m.PLAYER_IN_TYPE_MPEGTS?this.mpegTsObj.seekPos:this.configFormat.type==m.PLAYER_IN_TYPE_M3U8?this.hlsObj.seekPos:void 0;}},{key:"_playControl",value:function value(){this.isPlaying()?this.pause():this.play();}},{key:"_avFeedMP4Data",value:function value(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(void 0===this.player||null===this.player)return!1;var r=parseInt(this.playParam.durationMs/1e3);this.player.clearAllCache(),this.timerFeed=window.setInterval(function(){var a=null,s=null,o=!0,u=!0;if(e.configFormat.type==m.PLAYER_IN_TYPE_MP4?(a=e.mp4Obj.popBuffer(1,t),s=e.mp4Obj.audioNone?null:e.mp4Obj.popBuffer(2,i)):e.configFormat.type==m.PLAYER_IN_TYPE_TS||e.configFormat.type==m.PLAYER_IN_TYPE_MPEGTS?(a=e.mpegTsObj.popBuffer(1,t),s=e.mpegTsObj.getAudioNone()?null:e.mpegTsObj.popBuffer(2,i)):e.configFormat.type==m.PLAYER_IN_TYPE_M3U8&&(a=e.hlsObj.popBuffer(1,t),s=e.hlsObj.audioNone?null:e.hlsObj.popBuffer(2,i),t=e.hlsObj.getLastIdx()&&(o=!1),i=e.hlsObj.getALastIdx()&&(u=!1)),!0===o&&null!=a)for(var l=0;lr)return window.clearInterval(e.timerFeed),e.timerFeed=null,e.player.vCachePTS,e.player.aCachePTS,void(null!=n&&n());},5);}},{key:"_makeMP4Player",value:function value(){return this.mediaExtProtocol===m.URI_PROTOCOL_WEBSOCKET_DESC?(this._cWsFLVDecoderEntry(),0):(null!=this.configFormat.extInfo.core&&null!==this.configFormat.extInfo.core&&this.configFormat.extInfo.core===m.PLAYER_CORE_TYPE_CNATIVE?this._cDemuxDecoderEntry():this.configFormat.type==m.PLAYER_IN_TYPE_MP4?this.configFormat.extInfo.moovStartFlag?this._mp4EntryVodStream():this._mp4Entry():this.configFormat.type==m.PLAYER_IN_TYPE_TS||this.configFormat.type==m.PLAYER_IN_TYPE_MPEGTS?this._mpegTsEntry():this.configFormat.type==m.PLAYER_IN_TYPE_M3U8?this._m3u8Entry():this.configFormat.type===m.PLAYER_IN_TYPE_RAW_265&&this._raw265Entry(),0);}},{key:"_makeMP4PlayerViewEvent",value:function value(e,t,i,n){var a=this,s=arguments.length>4&&void 0!==arguments[4]&&arguments[4],o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null,u=this;if(this.playParam.durationMs=e,this.playParam.fps=t,this.playParam.sampleRate=i,this.playParam.size=n,this.playParam.audioNone=s,this.playParam.videoCodec=o||m.CODEC_H265,this.playParam,(this.configFormat.type==m.PLAYER_IN_TYPE_M3U8&&this.hlsConf.hlsType==m.PLAYER_IN_TYPE_M3U8_LIVE||this.configFormat.type==m.PLAYER_IN_TYPE_RAW_265)&&(this.playMode=m.PLAYER_MODE_NOTIME_LIVE),u.configFormat.extInfo.autoCrop){var l=document.querySelector("#"+this.configFormat.playerId),d=n.width/n.height,h=this.configFormat.playerW/this.configFormat.playerH;d>h?l.style.height=this.configFormat.playerW/d+"px":d=m.FETCH_FIRST_MAX_TIMES)return;i=new AbortController(),n=i.signal,e(s+1);}},m.FETCH_HTTP_FLV_TIMEOUT_MS),fetch(t.videoURL,{signal:n}).then(function(e){if(a=!0,e.headers.has("Content-Length"))o=e.headers.get("Content-Length"),t.player&&t.player.setProbeSize(o*t.configFormat.extInfo.coreProbePart);else{if(t.mediaExtFormat===m.PLAYER_IN_TYPE_FLV)return i.abort(),t.player.release(),t.player=null,t._cLiveFLVDecoderEntry(r),!0;t.player&&t.player.setProbeSize(4096);}return e.headers.get("Content-Length"),t.configFormat.type,t.mediaExtFormat,function e(i){return i.read().then(function(n){if(!n.done){n.value.buffer;var r=new Uint8Array(n.value.buffer);return t.player&&t.player.pushBuffer(r)<0?(t.player.release(),t.player=null,t._mp4EntryVodStream(),!1):e(i);}t.player&&t.player.pushDone();});}(e.body.getReader());})["catch"](function(e){e.toString().includes("user aborted")||console.error("cdemuxdecoder error",e);});}(0);}},{key:"_cLiveFLVDecoderEntry",value:function value(e){var t=this,i=this;e.probeSize=this.configFormat.extInfo.probeSize,this.player=new o.CHttpLiveCore(e),e.probeSize,this.player.onProbeFinish=function(){i.playParam.fps=i.player.mediaInfo.fps,i.playParam.durationMs=-1,i.playMode=m.PLAYER_MODE_NOTIME_LIVE,i.playParam.sampleRate=i.player.mediaInfo.sampleRate,i.playParam.size={width:i.player.mediaInfo.width,height:i.player.mediaInfo.height},i.playParam.audioNone=i.player.mediaInfo.audioNone,i.player.mediaInfo,i.player.vCodecID===m.V_CODEC_NAME_HEVC?(i.playParam.audioIdx<0&&(i.playParam.audioNone=!0),i.playParam.videoCodec=m.CODEC_H265,i.onLoadFinish&&i.onLoadFinish()):(i.playParam.videoCodec=m.CODEC_H264,i.player.release(),i.player=null,i._flvJsPlayer());},this.player.onNetworkError=function(e){i.onNetworkError&&i.onNetworkError(e);},this.player.onReadyShowDone=function(){i.configFormat.extInfo.readyShow=!1,i.onReadyShowDone&&i.onReadyShowDone();},this.player.onLoadCache=function(){null!=t.onLoadCache&&t.onLoadCache();},this.player.onLoadCacheFinshed=function(){null!=t.onLoadCacheFinshed&&t.onLoadCacheFinshed();},this.player.start(this.videoURL);}},{key:"_cWsFLVDecoderEntry",value:function value(){var e=this,t=this,i={width:this.configFormat.playerW,height:this.configFormat.playerH,playerId:this.configFormat.playerId,token:this.configFormat.token,readyShow:this.configFormat.extInfo.readyShow,checkProbe:this.configFormat.extInfo.checkProbe,ignoreAudio:this.configFormat.extInfo.ignoreAudio,playMode:this.playMode};i.probeSize=this.configFormat.extInfo.probeSize,this.player=new u.CWsLiveCore(i),i.probeSize,this.player.onProbeFinish=function(){t.playParam.fps=t.player.mediaInfo.fps,t.playParam.durationMs=-1,t.playMode=m.PLAYER_MODE_NOTIME_LIVE,t.playParam.sampleRate=t.player.mediaInfo.sampleRate,t.playParam.size={width:t.player.mediaInfo.width,height:t.player.mediaInfo.height},t.playParam.audioNone=t.player.mediaInfo.audioNone,t.player.mediaInfo,t.player.vCodecID===m.V_CODEC_NAME_HEVC?(t.playParam.audioIdx<0&&(t.playParam.audioNone=!0),t.playParam.videoCodec=m.CODEC_H265,t.onLoadFinish&&t.onLoadFinish()):(t.playParam.videoCodec=m.CODEC_H264,t.player.release(),t.player=null,t._flvJsPlayer());},this.player.onNetworkError=function(e){t.onNetworkError&&t.onNetworkError(e);},this.player.onReadyShowDone=function(){t.configFormat.extInfo.readyShow=!1,t.onReadyShowDone&&t.onReadyShowDone();},this.player.onLoadCache=function(){null!=e.onLoadCache&&e.onLoadCache();},this.player.onLoadCacheFinshed=function(){null!=e.onLoadCacheFinshed&&e.onLoadCacheFinshed();},this.player.start(this.videoURL);}},{key:"_mpegTsEntry",value:function value(){var e=this,t=new AbortController(),i=t.signal;this.timerFeed=null,this.mpegTsObj=new f.MpegTs(),this.mpegTsObj.bindReady(e),this.mpegTsObj.onDemuxed=this._mpegTsEntryReady.bind(this),this.mpegTsObj.onReady=function(){var n=null;fetch(e.videoURL,{signal:i}).then(function(r){if(r.headers.has("Content-Length"))return function t(i){return i.read().then(function(r){if(!r.done){var a=r.value;if(null===n)n=a;else{var s=a,o=n.length+s.length,u=new Uint8Array(o);u.set(n),u.set(s,n.length),n=new Uint8Array(u),s=null,u=null;}return t(i);}e.mpegTsObj.demux(n);});}(r.body.getReader());t.abort(),i=null,t=null;var a={width:e.configFormat.playerW,height:e.configFormat.playerH,playerId:e.configFormat.playerId,token:e.configFormat.token,readyShow:e.configFormat.extInfo.readyShow,checkProbe:e.configFormat.extInfo.checkProbe,ignoreAudio:e.configFormat.extInfo.ignoreAudio,playMode:e.playMode};e._cLiveFLVDecoderEntry(a);})["catch"](function(e){if(!e.toString().includes("user aborted")){var t=" mpegts request error:"+e;console.error(t);}});},this.mpegTsObj.initMPEG();}},{key:"_mpegTsEntryReady",value:function value(e){var t=e,i=(t.mpegTsObj.getVCodec(),t.mpegTsObj.getACodec()),n=t.mpegTsObj.getDurationMs(),r=t.mpegTsObj.getFPS(),a=t.mpegTsObj.getSampleRate(),s=t.mpegTsObj.getSize(),o=this.mpegTsObj.isHEVC();if(!o)return this.mpegTsObj.releaseTsDemuxer(),this.mpegTsObj=null,this.playParam.durationMs=n,this.playParam.fps=r,this.playParam.sampleRate=a,this.playParam.size=s,this.playParam.audioNone=""==i,this.playParam.videoCodec=o?0:1,this.playParam,void(this.onLoadFinish&&this.onLoadFinish());t._makeMP4PlayerViewEvent(n,r,a,s,""==i),parseInt(n/1e3),t._avFeedMP4Data(0,0);}},{key:"_m3u8Entry",value:function value(){var e=this,t=this,i=!1,n=0;this.hlsObj=new p.M3u8(),this.hlsObj.bindReady(t),this.hlsObj.onFinished=function(e,r){0==i&&(n=t.hlsObj.getDurationMs(),t.hlsConf.hlsType=r.type,i=!0);},this.hlsObj.onCacheProcess=function(t){e.playMode!==m.PLAYER_MODE_NOTIME_LIVE&&e.onCacheProcess&&e.onCacheProcess(t);},this.hlsObj.onDemuxed=function(e){if(null==t.player){var i=t.hlsObj.isHevcParam,r=(t.hlsObj.getVCodec(),t.hlsObj.getACodec()),a=t.hlsObj.getFPS(),s=t.hlsObj.getSampleRate(),o=t.hlsObj.getSize(),u=!1;if(u=t.hlsObj.getSampleChannel()<=0||""===r,!i)return t.hlsObj.release(),t.hlsObj.mpegTsObj&&t.hlsObj.mpegTsObj.releaseTsDemuxer(),t.hlsObj=null,t.playParam.durationMs=-1,t.playParam.fps=a,t.playParam.sampleRate=s,t.playParam.size=o,t.playParam.audioNone=""==r,t.playParam.videoCodec=i?0:1,t.playParam,void t._videoJsPlayer();t._makeMP4PlayerViewEvent(n,a,s,o,u);}},this.hlsObj.onSamples=this._hlsOnSamples.bind(this),this.hlsObj.demux(this.videoURL);}},{key:"_hlsOnSamples",value:function value(e,t){1==t.video?this.player.appendHevcFrame(t):!1===this.hlsObj.audioNone&&this.player.appendAACFrame(t);}},{key:"_videoJsPlayer",value:function value(){var e=this,t={width:this.configFormat.playerW,height:this.configFormat.playerH,playerId:this.configFormat.playerId,ignoreAudio:this.configFormat.extInfo.ignoreAudio};this.player=new l.NvVideojsCore(t),this.player.onMakeItReady=function(){e.onMakeItReady&&e.onMakeItReady();},this.player.onLoadFinish=function(){e.playParam.size=e.player.getSize(),e.player.duration===1/0||e.player.duration<0?(e.playParam.durationMs=-1,e.playMode=m.PLAYER_MODE_NOTIME_LIVE):(e.playParam.durationMs=1e3*e.player.duration,e.playMode=m.PLAYER_MODE_VOD),e.onLoadFinish&&e.onLoadFinish();},this.player.onReadyShowDone=function(){e.onReadyShowDone&&e.onReadyShowDone();},this.player.onPlayingFinish=function(){e.pause(),e.seek(0),null!=e.onPlayFinish&&e.onPlayFinish();},this.player.onPlayingTime=function(t){e._durationText(t),e._durationText(e.player.duration),null!=e.onPlayTime&&e.onPlayTime(t);},this.player.onSeekFinish=function(){e.onSeekFinish&&e.onSeekFinish();},this.player.makeIt(this.videoURL);}},{key:"_flvJsPlayer",value:function value(){var e=this,t={width:this.configFormat.playerW,height:this.configFormat.playerH,playerId:this.configFormat.playerId,ignoreAudio:this.configFormat.extInfo.ignoreAudio};this.player=new d.NvFlvjsCore(t),this.player.onLoadFinish=function(){e.playParam.size=e.player.getSize(),!e.player.duration||NaN===e.player.duration||e.player.duration===1/0||e.player.duration<0?(e.playParam.durationMs=-1,e.playMode=m.PLAYER_MODE_NOTIME_LIVE):(e.playParam.durationMs=1e3*e.player.duration,e.playMode=m.PLAYER_MODE_VOD),e.onLoadFinish&&e.onLoadFinish();},this.player.onReadyShowDone=function(){e.onReadyShowDone&&e.onReadyShowDone();},this.player.onPlayingTime=function(t){e._durationText(t),e._durationText(e.player.duration),null!=e.onPlayTime&&e.onPlayTime(t);},this.player.onPlayingFinish=function(){e.pause(),e.seek(0),null!=e.onPlayFinish&&e.onPlayFinish();},this.player.makeIt(this.videoURL);}},{key:"_raw265Entry",value:function value(){this._makeMP4PlayerViewEvent(-1,this.configFormat.extInfo.rawFps,-1,{width:this.configFormat.playerW,height:this.configFormat.playerH},!0,m.CODEC_H265),this.timerFeed&&(window.clearInterval(this.timerFeed),this.timerFeed=null);}},{key:"append265NaluFrame",value:function value(e){var t={data:e,pts:this.rawModePts};this.player.appendHevcFrame(t),this.configFormat.extInfo.readyShow&&this.player.cacheYuvBuf.getState()!=CACHE_APPEND_STATUS_CODE.NULL&&(this.player.playFrameYUV(!0,!0),this.configFormat.extInfo.readyShow=!1,this.onReadyShowDone&&this.onReadyShowDone()),this.rawModePts+=1/this.configFormat.extInfo.rawFps;}}])&&n(i.prototype,v),b&&n(i,b),e;}();i.H265webjs=v,t.new265webjs=function(e,t){return new v(e,t);};}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{});},{"./consts":52,"./decoder/av-common":55,"./decoder/c-httplive-core":56,"./decoder/c-native-core":57,"./decoder/c-wslive-core":58,"./decoder/cache":59,"./decoder/player-core":63,"./demuxer/m3u8":66,"./demuxer/mp4":68,"./demuxer/mpegts/mpeg.js":71,"./demuxer/ts":72,"./native/mp4-player":74,"./native/nv-flvjs-core":75,"./native/nv-videojs-core":76,"./utils/static-mem":78,"./utils/ui/ui":79}],74:[function(e,t,i){"use strict";function n(e,t){for(var i=0;i>1,a>>1,i),e.v.fill(r>>1,a>>1,n),e.drawArrays(e.TRIANGLE_STRIP,0,4);},setupCanvas:function setupCanvas(e,t){var i=e.getContext("webgl")||e.getContext("experimental-webgl");if(!i)return i;var r=i.createProgram(),a=["attribute highp vec4 aVertexPosition;","attribute vec2 aTextureCoord;","varying highp vec2 vTextureCoord;","void main(void) {"," gl_Position = aVertexPosition;"," vTextureCoord = aTextureCoord;","}"].join("\n"),s=i.createShader(i.VERTEX_SHADER);i.shaderSource(s,a),i.compileShader(s);var o=["precision highp float;","varying lowp vec2 vTextureCoord;","uniform sampler2D YTexture;","uniform sampler2D UTexture;","uniform sampler2D VTexture;","const mat4 YUV2RGB = mat4","("," 1.1643828125, 0, 1.59602734375, -.87078515625,"," 1.1643828125, -.39176171875, -.81296875, .52959375,"," 1.1643828125, 2.017234375, 0, -1.081390625,"," 0, 0, 0, 1",");","void main(void) {"," gl_FragColor = vec4( texture2D(YTexture, vTextureCoord).x, texture2D(UTexture, vTextureCoord).x, texture2D(VTexture, vTextureCoord).x, 1) * YUV2RGB;","}"].join("\n"),u=i.createShader(i.FRAGMENT_SHADER);i.shaderSource(u,o),i.compileShader(u),i.attachShader(r,s),i.attachShader(r,u),i.linkProgram(r),i.useProgram(r),i.getProgramParameter(r,i.LINK_STATUS);var l=i.getAttribLocation(r,"aVertexPosition");i.enableVertexAttribArray(l);var d=i.getAttribLocation(r,"aTextureCoord");i.enableVertexAttribArray(d);var h=i.createBuffer();i.bindBuffer(i.ARRAY_BUFFER,h),i.bufferData(i.ARRAY_BUFFER,new Float32Array([1,1,0,-1,1,0,1,-1,0,-1,-1,0]),i.STATIC_DRAW),i.vertexAttribPointer(l,3,i.FLOAT,!1,0,0);var c=i.createBuffer();return i.bindBuffer(i.ARRAY_BUFFER,c),i.bufferData(i.ARRAY_BUFFER,new Float32Array([1,0,0,0,1,1,0,1]),i.STATIC_DRAW),i.vertexAttribPointer(d,2,i.FLOAT,!1,0,0),i.y=new n(i),i.u=new n(i),i.v=new n(i),i.y.bind(0,r,"YTexture"),i.u.bind(1,r,"UTexture"),i.v.bind(2,r,"VTexture"),i;}};},{}],78:[function(e,t,i){(function(e){"use strict";e.STATIC_MEM_wasmDecoderState=-1,e.STATICE_MEM_playerCount=-1,e.STATICE_MEM_playerIndexPtr=0;}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{});},{}],79:[function(e,t,i){"use strict";function n(e,t){for(var i=0;i>7))^e]=e;for(t=i=0;!h[t];t^=n||1,i=p[i]||1)for(a=(a=i^i<<1^i<<2^i<<3^i<<4)>>8^255&a^99,h[t]=a,c[a]=t,o=16843009*f[r=f[n=f[t]]]^65537*r^257*n^16843008*t,s=257*f[a]^16843008*a,e=0;e<4;e++)l[e][t]=s=s<<24^s>>>8,d[e][a]=o=o<<24^o>>>8;for(e=0;e<5;e++)l[e]=l[e].slice(0),d[e]=d[e].slice(0);return u}()),this._tables=[[a[0][0].slice(),a[0][1].slice(),a[0][2].slice(),a[0][3].slice(),a[0][4].slice()],[a[1][0].slice(),a[1][1].slice(),a[1][2].slice(),a[1][3].slice(),a[1][4].slice()]];var r=this._tables[0][4],s=this._tables[1],o=e.length,u=1;if(4!==o&&6!==o&&8!==o)throw new Error("Invalid aes key size");var l=e.slice(0),d=[];for(this._key=[l,d],t=o;t<4*o+28;t++)n=l[t-1],(t%o==0||8===o&&t%o==4)&&(n=r[n>>>24]<<24^r[n>>16&255]<<16^r[n>>8&255]<<8^r[255&n],t%o==0&&(n=n<<8^n>>>24^u<<24,u=u<<1^283*(u>>7))),l[t]=l[t-o]^n;for(i=0;t;i++,t--)n=l[3&i?t:t-4],d[i]=t<=4||i<4?n:s[0][r[n>>>24]]^s[1][r[n>>16&255]]^s[2][r[n>>8&255]]^s[3][r[255&n]]}return e.prototype.decrypt=function(e,t,i,n,r,a){var s,o,u,l,d=this._key[1],h=e^d[0],c=n^d[1],f=i^d[2],p=t^d[3],m=d.length/4-2,g=4,_=this._tables[1],y=_[0],v=_[1],b=_[2],T=_[3],S=_[4];for(l=0;l>>24]^v[c>>16&255]^b[f>>8&255]^T[255&p]^d[g],o=y[c>>>24]^v[f>>16&255]^b[p>>8&255]^T[255&h]^d[g+1],u=y[f>>>24]^v[p>>16&255]^b[h>>8&255]^T[255&c]^d[g+2],p=y[p>>>24]^v[h>>16&255]^b[c>>8&255]^T[255&f]^d[g+3],g+=4,h=s,c=o,f=u;for(l=0;l<4;l++)r[(3&-l)+a]=S[h>>>24]<<24^S[c>>16&255]<<16^S[f>>8&255]<<8^S[255&p]^d[g++],s=h,h=c,c=f,f=p,p=s},e}(),o=function(e){function t(){var t;return(t=e.call(this,r)||this).jobs=[],t.delay=1,t.timeout_=null,t}n(t,e);var i=t.prototype;return i.processJob_=function(){this.jobs.shift()(),this.jobs.length?this.timeout_=setTimeout(this.processJob_.bind(this),this.delay):this.timeout_=null},i.push=function(e){this.jobs.push(e),this.timeout_||(this.timeout_=setTimeout(this.processJob_.bind(this),this.delay))},t}(r),u=function(e){return e<<24|(65280&e)<<8|(16711680&e)>>8|e>>>24},l=function(){function e(t,i,n,r){var a=e.STEP,s=new Int32Array(t.buffer),l=new Uint8Array(t.byteLength),d=0;for(this.asyncStream_=new o,this.asyncStream_.push(this.decryptChunk_(s.subarray(d,d+a),i,n,l)),d=a;d>2),m=new s(Array.prototype.slice.call(t)),g=new Uint8Array(e.byteLength),_=new Int32Array(g.buffer);for(n=i[0],r=i[1],a=i[2],o=i[3],f=0;f=0&&(t="main-desc"),t},Io=function(e,t){e.abort(),e.pause(),t&&t.activePlaylistLoader&&(t.activePlaylistLoader.pause(),t.activePlaylistLoader=null)},Po=function(e,t){t.activePlaylistLoader=e,e.load()},Lo={AUDIO:function(e,t){return function(){var i=t.segmentLoaders[e],n=t.mediaTypes[e],r=t.blacklistCurrentPlaylist;Io(i,n);var a=n.activeTrack(),s=n.activeGroup(),o=(s.filter((function(e){return e.default}))[0]||s[0]).id,u=n.tracks[o];if(a!==u){for(var l in Yr.log.warn("Problem encountered loading the alternate audio track.Switching back to default."),n.tracks)n.tracks[l].enabled=n.tracks[l]===u;n.onTrackChanged()}else r({message:"Problem encountered loading the default audio track."})}},SUBTITLES:function(e,t){return function(){var i=t.segmentLoaders[e],n=t.mediaTypes[e];Yr.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track."),Io(i,n);var r=n.activeTrack();r&&(r.mode="disabled"),n.onTrackChanged()}}},Do={AUDIO:function(e,t,i){if(t){var n=i.tech,r=i.requestOptions,a=i.segmentLoaders[e];t.on("loadedmetadata",(function(){var e=t.media();a.playlist(e,r),(!n.paused()||e.endList&&"none"!==n.preload())&&a.load()})),t.on("loadedplaylist",(function(){a.playlist(t.media(),r),n.paused()||a.load()})),t.on("error",Lo[e](e,i))}},SUBTITLES:function(e,t,i){var n=i.tech,r=i.requestOptions,a=i.segmentLoaders[e],s=i.mediaTypes[e];t.on("loadedmetadata",(function(){var e=t.media();a.playlist(e,r),a.track(s.activeTrack()),(!n.paused()||e.endList&&"none"!==n.preload())&&a.load()})),t.on("loadedplaylist",(function(){a.playlist(t.media(),r),n.paused()||a.load()})),t.on("error",Lo[e](e,i))}},Uo={AUDIO:function(e,t){var i=t.vhs,n=t.sourceType,r=t.segmentLoaders[e],a=t.requestOptions,s=t.master.mediaGroups,o=t.mediaTypes[e],u=o.groups,l=o.tracks,d=o.logger_,h=t.masterPlaylistLoader,c=ba(h.master);for(var f in s[e]&&0!==Object.keys(s[e]).length||(s[e]={main:{default:{default:!0}}},c&&(s[e].main.default.playlists=h.master.playlists)),s[e])for(var p in u[f]||(u[f]=[]),s[e][f]){var m=s[e][f][p],g=void 0;if(c?(d("AUDIO group '"+f+"' label '"+p+"' is a master playlist"),m.isMasterPlaylist=!0,g=null):g="vhs-json"===n&&m.playlists?new Oa(m.playlists[0],i,a):m.resolvedUri?new Oa(m.resolvedUri,i,a):m.playlists&&"dash"===n?new is(m.playlists[0],i,a,h):null,m=Yr.mergeOptions({id:p,playlistLoader:g},m),Do[e](e,m.playlistLoader,t),u[f].push(m),void 0===l[p]){var _=new Yr.AudioTrack({id:p,kind:xo(m),enabled:!1,language:m.language,default:m.default,label:p});l[p]=_}}r.on("error",Lo[e](e,t))},SUBTITLES:function(e,t){var i=t.tech,n=t.vhs,r=t.sourceType,a=t.segmentLoaders[e],s=t.requestOptions,o=t.master.mediaGroups,u=t.mediaTypes[e],l=u.groups,d=u.tracks,h=t.masterPlaylistLoader;for(var c in o[e])for(var f in l[c]||(l[c]=[]),o[e][c])if(!o[e][c][f].forced){var p=o[e][c][f],m=void 0;if("hls"===r)m=new Oa(p.resolvedUri,n,s);else if("dash"===r){if(!p.playlists.filter((function(e){return e.excludeUntil!==1/0})).length)return;m=new is(p.playlists[0],n,s,h)}else"vhs-json"===r&&(m=new Oa(p.playlists?p.playlists[0]:p.resolvedUri,n,s));if(p=Yr.mergeOptions({id:f,playlistLoader:m},p),Do[e](e,p.playlistLoader,t),l[c].push(p),void 0===d[f]){var g=i.addRemoteTextTrack({id:f,kind:"subtitles",default:p.default&&p.autoselect,language:p.language,label:f},!1).track;d[f]=g}}a.on("error",Lo[e](e,t))},"CLOSED-CAPTIONS":function(e,t){var i=t.tech,n=t.master.mediaGroups,r=t.mediaTypes[e],a=r.groups,s=r.tracks;for(var o in n[e])for(var u in a[o]||(a[o]=[]),n[e][o]){var l=n[e][o][u];if(/^(?:CC|SERVICE)/.test(l.instreamId)){var d=i.options_.vhs&&i.options_.vhs.captionServices||{},h={label:u,language:l.language,instreamId:l.instreamId,default:l.default&&l.autoselect};if(d[h.instreamId]&&(h=Yr.mergeOptions(h,d[h.instreamId])),void 0===h.default&&delete h.default,a[o].push(Yr.mergeOptions({id:u},l)),void 0===s[u]){var c=i.addRemoteTextTrack({id:h.instreamId,kind:"captions",default:h.default,language:h.language,label:h.label},!1).track;s[u]=c}}}}},Ro=function e(t,i){for(var n=0;n1&&ba(t.master))for(var u=0;u "+a+" from "+t),this.tech_.trigger({type:"usage",name:"vhs-rendition-change-"+t})),this.masterPlaylistLoader_.media(e,i)},i.startABRTimer_=function(){var e=this;this.stopABRTimer_(),this.abrTimer_=A.default.setInterval((function(){return e.checkABR_()}),250)},i.stopABRTimer_=function(){this.tech_.scrubbing&&this.tech_.scrubbing()||(A.default.clearInterval(this.abrTimer_),this.abrTimer_=null)},i.getAudioTrackPlaylists_=function(){var e=this.master(),t=e&&e.playlists||[];if(!e||!e.mediaGroups||!e.mediaGroups.AUDIO)return t;var i,n=e.mediaGroups.AUDIO,r=Object.keys(n);if(Object.keys(this.mediaTypes_.AUDIO.groups).length)i=this.mediaTypes_.AUDIO.activeTrack();else{var a=n.main||r.length&&n[r[0]];for(var s in a)if(a[s].default){i={label:s};break}}if(!i)return t;var o=[];for(var u in n)if(n[u][i.label]){var l=n[u][i.label];if(l.playlists&&l.playlists.length)o.push.apply(o,l.playlists);else if(l.uri)o.push(l);else if(e.playlists.length)for(var d=0;d1&&(this.tech_.trigger({type:"usage",name:"vhs-alternate-audio"}),this.tech_.trigger({type:"usage",name:"hls-alternate-audio"})),this.useCueTags_&&(this.tech_.trigger({type:"usage",name:"vhs-playlist-cue-tags"}),this.tech_.trigger({type:"usage",name:"hls-playlist-cue-tags"}))},i.shouldSwitchToMedia_=function(e){var t=this.masterPlaylistLoader_.media(),i=this.tech_.buffered();return function(e){var t=e.currentPlaylist,i=e.nextPlaylist,n=e.forwardBuffer,r=e.bufferLowWaterLine,a=e.bufferHighWaterLine,s=e.duration,o=e.experimentalBufferBasedABR,u=e.log;if(!i)return Yr.log.warn("We received no playlist to switch to. Please check your stream."),!1;var l="allowing switch "+(t&&t.id||"null")+" -> "+i.id;if(!t)return u(l+" as current playlist is not set"),!0;if(i.id===t.id)return!1;if(!t.endList)return u(l+" as current playlist is live"),!0;var d=o?ns.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:ns.MAX_BUFFER_LOW_WATER_LINE;if(sc)&&n>=r){var p=l+" as forwardBuffer >= bufferLowWaterLine ("+n+" >= "+r+")";return o&&(p+=" and next bandwidth > current bandwidth ("+h+" > "+c+")"),u(p),!0}return u("not "+l+" as no switching criteria met"),!1}({currentPlaylist:t,nextPlaylist:e,forwardBuffer:i.length?i.end(i.length-1)-this.tech_.currentTime():0,bufferLowWaterLine:this.bufferLowWaterLine(),bufferHighWaterLine:this.bufferHighWaterLine(),duration:this.duration(),experimentalBufferBasedABR:this.experimentalBufferBasedABR,log:this.logger_})},i.setupSegmentLoaderListeners_=function(){var e=this;this.experimentalBufferBasedABR||(this.mainSegmentLoader_.on("bandwidthupdate",(function(){var t=e.selectPlaylist();e.shouldSwitchToMedia_(t)&&e.switchMedia_(t,"bandwidthupdate"),e.tech_.trigger("bandwidthupdate")})),this.mainSegmentLoader_.on("progress",(function(){e.trigger("progress")}))),this.mainSegmentLoader_.on("error",(function(){e.blacklistCurrentPlaylist(e.mainSegmentLoader_.error())})),this.mainSegmentLoader_.on("appenderror",(function(){e.error=e.mainSegmentLoader_.error_,e.trigger("error")})),this.mainSegmentLoader_.on("syncinfoupdate",(function(){e.onSyncInfoUpdate_()})),this.mainSegmentLoader_.on("timestampoffset",(function(){e.tech_.trigger({type:"usage",name:"vhs-timestamp-offset"}),e.tech_.trigger({type:"usage",name:"hls-timestamp-offset"})})),this.audioSegmentLoader_.on("syncinfoupdate",(function(){e.onSyncInfoUpdate_()})),this.audioSegmentLoader_.on("appenderror",(function(){e.error=e.audioSegmentLoader_.error_,e.trigger("error")})),this.mainSegmentLoader_.on("ended",(function(){e.logger_("main segment loader ended"),e.onEndOfStream()})),this.mainSegmentLoader_.on("earlyabort",(function(t){e.experimentalBufferBasedABR||(e.delegateLoaders_("all",["abort"]),e.blacklistCurrentPlaylist({message:"Aborted early because there isn't enough bandwidth to complete the request without rebuffering."},120))}));var t=function(){if(!e.sourceUpdater_.hasCreatedSourceBuffers())return e.tryToCreateSourceBuffers_();var t=e.getCodecsOrExclude_();t&&e.sourceUpdater_.addOrChangeSourceBuffers(t)};this.mainSegmentLoader_.on("trackinfo",t),this.audioSegmentLoader_.on("trackinfo",t),this.mainSegmentLoader_.on("fmp4",(function(){e.triggeredFmp4Usage||(e.tech_.trigger({type:"usage",name:"vhs-fmp4"}),e.tech_.trigger({type:"usage",name:"hls-fmp4"}),e.triggeredFmp4Usage=!0)})),this.audioSegmentLoader_.on("fmp4",(function(){e.triggeredFmp4Usage||(e.tech_.trigger({type:"usage",name:"vhs-fmp4"}),e.tech_.trigger({type:"usage",name:"hls-fmp4"}),e.triggeredFmp4Usage=!0)})),this.audioSegmentLoader_.on("ended",(function(){e.logger_("audioSegmentLoader ended"),e.onEndOfStream()}))},i.mediaSecondsLoaded_=function(){return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded+this.mainSegmentLoader_.mediaSecondsLoaded)},i.load=function(){this.mainSegmentLoader_.load(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.load(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.load()},i.smoothQualityChange_=function(e){void 0===e&&(e=this.selectPlaylist()),this.fastQualityChange_(e)},i.fastQualityChange_=function(e){var t=this;void 0===e&&(e=this.selectPlaylist()),e!==this.masterPlaylistLoader_.media()?(this.switchMedia_(e,"fast-quality"),this.mainSegmentLoader_.resetEverything((function(){Yr.browser.IE_VERSION||Yr.browser.IS_EDGE?t.tech_.setCurrentTime(t.tech_.currentTime()+.04):t.tech_.setCurrentTime(t.tech_.currentTime())}))):this.logger_("skipping fastQualityChange because new media is same as old")},i.play=function(){if(!this.setupFirstPlay()){this.tech_.ended()&&this.tech_.setCurrentTime(0),this.hasPlayed_&&this.load();var e=this.tech_.seekable();return this.tech_.duration()===1/0&&this.tech_.currentTime()this.maxPlaylistRetries?1/0:Date.now()+1e3*t,i.excludeUntil=n,e.reason&&(i.lastExcludeReason_=e.reason),this.tech_.trigger("blacklistplaylist"),this.tech_.trigger({type:"usage",name:"vhs-rendition-blacklisted"}),this.tech_.trigger({type:"usage",name:"hls-rendition-blacklisted"});var u=this.selectPlaylist();if(!u)return this.error="Playback cannot continue. No available working or supported playlists.",void this.trigger("error");var l=e.internal?this.logger_:Yr.log.warn,d=e.message?" "+e.message:"";l((e.internal?"Internal problem":"Problem")+" encountered with playlist "+i.id+"."+d+" Switching to playlist "+u.id+"."),u.attributes.AUDIO!==i.attributes.AUDIO&&this.delegateLoaders_("audio",["abort","pause"]),u.attributes.SUBTITLES!==i.attributes.SUBTITLES&&this.delegateLoaders_("subtitle",["abort","pause"]),this.delegateLoaders_("main",["abort","pause"]);var h=u.targetDuration/2*1e3||5e3,c="number"==typeof u.lastRequest&&Date.now()-u.lastRequest<=h;return this.switchMedia_(u,"exclude",s||c)},i.pauseLoading=function(){this.delegateLoaders_("all",["abort","pause"]),this.stopABRTimer_()},i.delegateLoaders_=function(e,t){var i=this,n=[],r="all"===e;(r||"main"===e)&&n.push(this.masterPlaylistLoader_);var a=[];(r||"audio"===e)&&a.push("AUDIO"),(r||"subtitle"===e)&&(a.push("CLOSED-CAPTIONS"),a.push("SUBTITLES")),a.forEach((function(e){var t=i.mediaTypes_[e]&&i.mediaTypes_[e].activePlaylistLoader;t&&n.push(t)})),["main","audio","subtitle"].forEach((function(t){var r=i[t+"SegmentLoader_"];!r||e!==t&&"all"!==e||n.push(r)})),n.forEach((function(e){return t.forEach((function(t){"function"==typeof e[t]&&e[t]()}))}))},i.setCurrentTime=function(e){var t=Zr(this.tech_.buffered(),e);return this.masterPlaylistLoader_&&this.masterPlaylistLoader_.media()&&this.masterPlaylistLoader_.media().segments?t&&t.length?e:(this.mainSegmentLoader_.resetEverything(),this.mainSegmentLoader_.abort(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.resetEverything(),this.audioSegmentLoader_.abort()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.resetEverything(),this.subtitleSegmentLoader_.abort()),void this.load()):0},i.duration=function(){if(!this.masterPlaylistLoader_)return 0;var e=this.masterPlaylistLoader_.media();return e?e.endList?this.mediaSource?this.mediaSource.duration:Zs.Playlist.duration(e):1/0:0},i.seekable=function(){return this.seekable_},i.onSyncInfoUpdate_=function(){var e;if(this.masterPlaylistLoader_){var t=this.masterPlaylistLoader_.media();if(t){var i=this.syncController_.getExpiredTime(t,this.duration());if(null!==i){var n=this.masterPlaylistLoader_.master,r=Zs.Playlist.seekable(t,i,Zs.Playlist.liveEdgeDelay(n,t));if(0!==r.length){if(this.mediaTypes_.AUDIO.activePlaylistLoader){if(t=this.mediaTypes_.AUDIO.activePlaylistLoader.media(),null===(i=this.syncController_.getExpiredTime(t,this.duration())))return;if(0===(e=Zs.Playlist.seekable(t,i,Zs.Playlist.liveEdgeDelay(n,t))).length)return}var a,s;this.seekable_&&this.seekable_.length&&(a=this.seekable_.end(0),s=this.seekable_.start(0)),e?e.start(0)>r.end(0)||r.start(0)>e.end(0)?this.seekable_=r:this.seekable_=Yr.createTimeRanges([[e.start(0)>r.start(0)?e.start(0):r.start(0),e.end(0)0&&(n=Math.max(n,i.end(i.length-1))),this.mediaSource.duration!==n&&this.sourceUpdater_.setDuration(n)}},i.dispose=function(){var e=this;this.trigger("dispose"),this.decrypter_.terminate(),this.masterPlaylistLoader_.dispose(),this.mainSegmentLoader_.dispose(),this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_),["AUDIO","SUBTITLES"].forEach((function(t){var i=e.mediaTypes_[t].groups;for(var n in i)i[n].forEach((function(e){e.playlistLoader&&e.playlistLoader.dispose()}))})),this.audioSegmentLoader_.dispose(),this.subtitleSegmentLoader_.dispose(),this.sourceUpdater_.dispose(),this.timelineChangeController_.dispose(),this.stopABRTimer_(),this.updateDuration_&&this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.mediaSource.removeEventListener("durationchange",this.handleDurationChange_),this.mediaSource.removeEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.removeEventListener("sourceended",this.handleSourceEnded_),this.off()},i.master=function(){return this.masterPlaylistLoader_.master},i.media=function(){return this.masterPlaylistLoader_.media()||this.initialMedia_},i.areMediaTypesKnown_=function(){var e=!!this.mediaTypes_.AUDIO.activePlaylistLoader,t=!!this.mainSegmentLoader_.getCurrentMediaInfo_(),i=!e||!!this.audioSegmentLoader_.getCurrentMediaInfo_();return!(!t||!i)},i.getCodecsOrExclude_=function(){var e=this,t={main:this.mainSegmentLoader_.getCurrentMediaInfo_()||{},audio:this.audioSegmentLoader_.getCurrentMediaInfo_()||{}};t.video=t.main;var i=Os(this.master(),this.media()),n={},r=!!this.mediaTypes_.AUDIO.activePlaylistLoader;if(t.main.hasVideo&&(n.video=i.video||t.main.videoCodec||g.DEFAULT_VIDEO_CODEC),t.main.isMuxed&&(n.video+=","+(i.audio||t.main.audioCodec||g.DEFAULT_AUDIO_CODEC)),(t.main.hasAudio&&!t.main.isMuxed||t.audio.hasAudio||r)&&(n.audio=i.audio||t.main.audioCodec||t.audio.audioCodec||g.DEFAULT_AUDIO_CODEC,t.audio.isFmp4=t.main.hasAudio&&!t.main.isMuxed?t.main.isFmp4:t.audio.isFmp4),n.audio||n.video){var a,s={};if(["video","audio"].forEach((function(e){if(n.hasOwnProperty(e)&&(r=t[e].isFmp4,o=n[e],!(r?g.browserSupportsCodec(o):g.muxerSupportsCodec(o)))){var i=t[e].isFmp4?"browser":"muxer";s[i]=s[i]||[],s[i].push(n[e]),"audio"===e&&(a=i)}var r,o})),r&&a&&this.media().attributes.AUDIO){var o=this.media().attributes.AUDIO;this.master().playlists.forEach((function(t){(t.attributes&&t.attributes.AUDIO)===o&&t!==e.media()&&(t.excludeUntil=1/0)})),this.logger_("excluding audio group "+o+" as "+a+' does not support codec(s): "'+n.audio+'"')}if(!Object.keys(s).length){if(this.sourceUpdater_.hasCreatedSourceBuffers()&&!this.sourceUpdater_.canChangeType()){var u=[];if(["video","audio"].forEach((function(t){var i=(g.parseCodecs(e.sourceUpdater_.codecs[t]||"")[0]||{}).type,r=(g.parseCodecs(n[t]||"")[0]||{}).type;i&&r&&i.toLowerCase()!==r.toLowerCase()&&u.push('"'+e.sourceUpdater_.codecs[t]+'" -> "'+n[t]+'"')})),u.length)return void this.blacklistCurrentPlaylist({playlist:this.media(),message:"Codec switching not supported: "+u.join(", ")+".",blacklistDuration:1/0,internal:!0})}return n}var l=Object.keys(s).reduce((function(e,t){return e&&(e+=", "),e+=t+' does not support codec(s): "'+s[t].join(",")+'"'}),"")+".";this.blacklistCurrentPlaylist({playlist:this.media(),internal:!0,message:l,blacklistDuration:1/0})}else this.blacklistCurrentPlaylist({playlist:this.media(),message:"Could not determine codecs for playlist.",blacklistDuration:1/0})},i.tryToCreateSourceBuffers_=function(){if("open"===this.mediaSource.readyState&&!this.sourceUpdater_.hasCreatedSourceBuffers()&&this.areMediaTypesKnown_()){var e=this.getCodecsOrExclude_();if(e){this.sourceUpdater_.createSourceBuffers(e);var t=[e.video,e.audio].filter(Boolean).join(",");this.excludeIncompatibleVariants_(t)}}},i.excludeUnsupportedVariants_=function(){var e=this,t=this.master().playlists,i=[];Object.keys(t).forEach((function(n){var r=t[n];if(-1===i.indexOf(r.id)){i.push(r.id);var a=Os(e.master,r),s=[];!a.audio||g.muxerSupportsCodec(a.audio)||g.browserSupportsCodec(a.audio)||s.push("audio codec "+a.audio),!a.video||g.muxerSupportsCodec(a.video)||g.browserSupportsCodec(a.video)||s.push("video codec "+a.video),a.text&&"stpp.ttml.im1t"===a.text&&s.push("text codec "+a.text),s.length&&(r.excludeUntil=1/0,e.logger_("excluding "+r.id+" for unsupported: "+s.join(", ")))}}))},i.excludeIncompatibleVariants_=function(e){var t=this,i=[],n=this.master().playlists,r=Us(g.parseCodecs(e)),a=Rs(r),s=r.video&&g.parseCodecs(r.video)[0]||null,o=r.audio&&g.parseCodecs(r.audio)[0]||null;Object.keys(n).forEach((function(e){var r=n[e];if(-1===i.indexOf(r.id)&&r.excludeUntil!==1/0){i.push(r.id);var u=[],l=Os(t.masterPlaylistLoader_.master,r),d=Rs(l);if(l.audio||l.video){if(d!==a&&u.push('codec count "'+d+'" !== "'+a+'"'),!t.sourceUpdater_.canChangeType()){var h=l.video&&g.parseCodecs(l.video)[0]||null,c=l.audio&&g.parseCodecs(l.audio)[0]||null;h&&s&&h.type.toLowerCase()!==s.type.toLowerCase()&&u.push('video codec "'+h.type+'" !== "'+s.type+'"'),c&&o&&c.type.toLowerCase()!==o.type.toLowerCase()&&u.push('audio codec "'+c.type+'" !== "'+o.type+'"')}u.length&&(r.excludeUntil=1/0,t.logger_("blacklisting "+r.id+": "+u.join(" && ")))}}}))},i.updateAdCues_=function(e){var t=0,i=this.seekable();i.length&&(t=i.start(0)),function(e,t,i){if(void 0===i&&(i=0),e.segments)for(var n,r=i,a=0;a0&&this.logger_("resetting possible stalled download count for "+e+" loader"),this[e+"StalledDownloads_"]=0,this[e+"Buffered_"]=t.buffered_()},t.checkSegmentDownloads_=function(e){var t=this.masterPlaylistController_,i=t[e+"SegmentLoader_"],n=i.buffered_(),r=function(e,t){if(e===t)return!1;if(!e&&t||!t&&e)return!0;if(e.length!==t.length)return!0;for(var i=0;i=t.end(t.length-1)))return this.techWaiting_();this.consecutiveUpdates>=5&&e===this.lastRecordedTime?(this.consecutiveUpdates++,this.waiting_()):e===this.lastRecordedTime?this.consecutiveUpdates++:(this.consecutiveUpdates=0,this.lastRecordedTime=e)}},t.cancelTimer_=function(){this.consecutiveUpdates=0,this.timer_&&(this.logger_("cancelTimer_"),clearTimeout(this.timer_)),this.timer_=null},t.fixesBadSeeks_=function(){if(!this.tech_.seeking())return!1;var e,t=this.seekable(),i=this.tech_.currentTime();this.afterSeekableWindow_(t,i,this.media(),this.allowSeeksWithinUnsafeLiveWindow)&&(e=t.end(t.length-1));if(this.beforeSeekableWindow_(t,i)){var n=t.start(0);e=n+(n===t.end(0)?0:.1)}if(void 0!==e)return this.logger_("Trying to seek outside of seekable at time "+i+" with seekable range "+ta(t)+". Seeking to "+e+"."),this.tech_.setCurrentTime(e),!0;var r=this.tech_.buffered();return!!function(e){var t=e.buffered,i=e.targetDuration,n=e.currentTime;return!!t.length&&(!(t.end(0)-t.start(0)<2*i)&&(!(n>t.start(0))&&t.start(0)-n "+i.end(0)+"]. Attempting to resume playback by seeking to the current time."),this.tech_.trigger({type:"usage",name:"vhs-unknown-waiting"}),void this.tech_.trigger({type:"usage",name:"hls-unknown-waiting"})):void 0}},t.techWaiting_=function(){var e=this.seekable(),t=this.tech_.currentTime();if(this.tech_.seeking()&&this.fixesBadSeeks_())return!0;if(this.tech_.seeking()||null!==this.timer_)return!0;if(this.beforeSeekableWindow_(e,t)){var i=e.end(e.length-1);return this.logger_("Fell out of live window at time "+t+". Seeking to live point (seekable end) "+i),this.cancelTimer_(),this.tech_.setCurrentTime(i),this.tech_.trigger({type:"usage",name:"vhs-live-resync"}),this.tech_.trigger({type:"usage",name:"hls-live-resync"}),!0}var n=this.tech_.vhs.masterPlaylistController_.sourceUpdater_,r=this.tech_.buffered();if(this.videoUnderflow_({audioBuffered:n.audioBuffered(),videoBuffered:n.videoBuffered(),currentTime:t}))return this.cancelTimer_(),this.tech_.setCurrentTime(t),this.tech_.trigger({type:"usage",name:"vhs-video-underflow"}),this.tech_.trigger({type:"usage",name:"hls-video-underflow"}),!0;var a=ea(r,t);if(a.length>0){var s=a.start(0)-t;return this.logger_("Stopped at "+t+", setting timer for "+s+", seeking to "+a.start(0)),this.cancelTimer_(),this.timer_=setTimeout(this.skipTheGap_.bind(this),1e3*s,t),!0}return!1},t.afterSeekableWindow_=function(e,t,i,n){if(void 0===n&&(n=!1),!e.length)return!1;var r=e.end(e.length-1)+.1;return!i.endList&&n&&(r=e.end(e.length-1)+3*i.targetDuration),t>r},t.beforeSeekableWindow_=function(e,t){return!!(e.length&&e.start(0)>0&&t2)return{start:r,end:a}}return null},e}(),zo={errorInterval:30,getSource:function(e){return e(this.tech({IWillNotUseThisInPlugins:!0}).currentSource_||this.currentSource())}},Go=function(e){!function e(t,i){var n=0,r=0,a=Yr.mergeOptions(zo,i);t.ready((function(){t.trigger({type:"usage",name:"vhs-error-reload-initialized"}),t.trigger({type:"usage",name:"hls-error-reload-initialized"})}));var s=function(){r&&t.currentTime(r)},o=function(e){null!=e&&(r=t.duration()!==1/0&&t.currentTime()||0,t.one("loadedmetadata",s),t.src(e),t.trigger({type:"usage",name:"vhs-error-reload"}),t.trigger({type:"usage",name:"hls-error-reload"}),t.play())},u=function(){return Date.now()-n<1e3*a.errorInterval?(t.trigger({type:"usage",name:"vhs-error-reload-canceled"}),void t.trigger({type:"usage",name:"hls-error-reload-canceled"})):a.getSource&&"function"==typeof a.getSource?(n=Date.now(),a.getSource.call(t,o)):void Yr.log.error("ERROR: reloadSourceOnError - The option getSource must be a function!")},l=function e(){t.off("loadedmetadata",s),t.off("error",u),t.off("dispose",e)};t.on("error",u),t.on("dispose",l),t.reloadSourceOnError=function(i){l(),e(t,i)}}(this,e)},Wo={PlaylistLoader:Oa,Playlist:Ta,utils:Ka,STANDARD_PLAYLIST_SELECTOR:Hs,INITIAL_PLAYLIST_SELECTOR:function(){var e=this,t=this.playlists.master.playlists.filter(Ta.isEnabled);return Ns(t,(function(e,t){return js(e,t)})),t.filter((function(t){return!!Os(e.playlists.master,t).video}))[0]||null},lastBandwidthSelector:Hs,movingAverageBandwidthSelector:function(e){var t=-1,i=-1;if(e<0||e>1)throw new Error("Moving average bandwidth decay must be between 0 and 1.");return function(){var n=this.useDevicePixelRatio&&A.default.devicePixelRatio||1;return t<0&&(t=this.systemBandwidth,i=this.systemBandwidth),this.systemBandwidth>0&&this.systemBandwidth!==i&&(t=e*this.systemBandwidth+(1-e)*t,i=this.systemBandwidth),Vs(this.playlists.master,t,parseInt(Bs(this.tech_.el(),"width"),10)*n,parseInt(Bs(this.tech_.el(),"height"),10)*n,this.limitRenditionByPlayerDimensions,this.masterPlaylistController_)}},comparePlaylistBandwidth:js,comparePlaylistResolution:function(e,t){var i,n;return e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width&&(i=e.attributes.RESOLUTION.width),i=i||A.default.Number.MAX_VALUE,t.attributes.RESOLUTION&&t.attributes.RESOLUTION.width&&(n=t.attributes.RESOLUTION.width),i===(n=n||A.default.Number.MAX_VALUE)&&e.attributes.BANDWIDTH&&t.attributes.BANDWIDTH?e.attributes.BANDWIDTH-t.attributes.BANDWIDTH:i-n},xhr:Na()};Object.keys(ns).forEach((function(e){Object.defineProperty(Wo,e,{get:function(){return Yr.log.warn("using Vhs."+e+" is UNSAFE be sure you know what you are doing"),ns[e]},set:function(t){Yr.log.warn("using Vhs."+e+" is UNSAFE be sure you know what you are doing"),"number"!=typeof t||t<0?Yr.log.warn("value of Vhs."+e+" must be greater than or equal to 0"):ns[e]=t}})}));var Yo=function(e,t){for(var i=t.media(),n=-1,r=0;r0?1/this.throughput:0,Math.floor(1/(t+e))},set:function(){Yr.log.error('The "systemBandwidth" property is read-only')}}}),this.options_.bandwidth&&(this.bandwidth=this.options_.bandwidth),this.options_.throughput&&(this.throughput=this.options_.throughput),Object.defineProperties(this.stats,{bandwidth:{get:function(){return i.bandwidth||0},enumerable:!0},mediaRequests:{get:function(){return i.masterPlaylistController_.mediaRequests_()||0},enumerable:!0},mediaRequestsAborted:{get:function(){return i.masterPlaylistController_.mediaRequestsAborted_()||0},enumerable:!0},mediaRequestsTimedout:{get:function(){return i.masterPlaylistController_.mediaRequestsTimedout_()||0},enumerable:!0},mediaRequestsErrored:{get:function(){return i.masterPlaylistController_.mediaRequestsErrored_()||0},enumerable:!0},mediaTransferDuration:{get:function(){return i.masterPlaylistController_.mediaTransferDuration_()||0},enumerable:!0},mediaBytesTransferred:{get:function(){return i.masterPlaylistController_.mediaBytesTransferred_()||0},enumerable:!0},mediaSecondsLoaded:{get:function(){return i.masterPlaylistController_.mediaSecondsLoaded_()||0},enumerable:!0},mediaAppends:{get:function(){return i.masterPlaylistController_.mediaAppends_()||0},enumerable:!0},mainAppendsToLoadedData:{get:function(){return i.masterPlaylistController_.mainAppendsToLoadedData_()||0},enumerable:!0},audioAppendsToLoadedData:{get:function(){return i.masterPlaylistController_.audioAppendsToLoadedData_()||0},enumerable:!0},appendsToLoadedData:{get:function(){return i.masterPlaylistController_.appendsToLoadedData_()||0},enumerable:!0},timeToLoadedData:{get:function(){return i.masterPlaylistController_.timeToLoadedData_()||0},enumerable:!0},buffered:{get:function(){return ia(i.tech_.buffered())},enumerable:!0},currentTime:{get:function(){return i.tech_.currentTime()},enumerable:!0},currentSource:{get:function(){return i.tech_.currentSource_},enumerable:!0},currentTech:{get:function(){return i.tech_.name_},enumerable:!0},duration:{get:function(){return i.tech_.duration()},enumerable:!0},master:{get:function(){return i.playlists.master},enumerable:!0},playerDimensions:{get:function(){return i.tech_.currentDimensions()},enumerable:!0},seekable:{get:function(){return ia(i.tech_.seekable())},enumerable:!0},timestamp:{get:function(){return Date.now()},enumerable:!0},videoPlaybackQuality:{get:function(){return i.tech_.getVideoPlaybackQuality()},enumerable:!0}}),this.tech_.one("canplay",this.masterPlaylistController_.setupFirstPlay.bind(this.masterPlaylistController_)),this.tech_.on("bandwidthupdate",(function(){i.options_.useBandwidthFromLocalStorage&&function(e){if(!A.default.localStorage)return!1;var t=Xo();t=t?Yr.mergeOptions(t,e):e;try{A.default.localStorage.setItem("videojs-vhs",JSON.stringify(t))}catch(e){return!1}}({bandwidth:i.bandwidth,throughput:Math.round(i.throughput)})})),this.masterPlaylistController_.on("selectedinitialmedia",(function(){var e;(e=i).representations=function(){var t=e.masterPlaylistController_.master(),i=ba(t)?e.masterPlaylistController_.getAudioTrackPlaylists_():t.playlists;return i?i.filter((function(e){return!pa(e)})).map((function(t,i){return new jo(e,t,t.id)})):[]}})),this.masterPlaylistController_.sourceUpdater_.on("createdsourcebuffers",(function(){i.setupEme_()})),this.on(this.masterPlaylistController_,"progress",(function(){this.tech_.trigger("progress")})),this.on(this.masterPlaylistController_,"firstplay",(function(){this.ignoreNextSeekingEvent_=!0})),this.setupQualityLevels_(),this.tech_.el()&&(this.mediaSourceUrl_=A.default.URL.createObjectURL(this.masterPlaylistController_.mediaSource),this.tech_.src(this.mediaSourceUrl_))}},i.setupEme_=function(){var e=this,t=this.masterPlaylistController_.mediaTypes_.AUDIO.activePlaylistLoader,i=Ko({player:this.player_,sourceKeySystems:this.source_.keySystems,media:this.playlists.media(),audioMedia:t&&t.media()});this.player_.tech_.on("keystatuschange",(function(t){"output-restricted"===t.status&&e.masterPlaylistController_.blacklistCurrentPlaylist({playlist:e.masterPlaylistController_.media(),message:"DRM keystatus changed to "+t.status+". Playlist will fail to play. Check for HDCP content.",blacklistDuration:1/0})})),11!==Yr.browser.IE_VERSION&&i?(this.logger_("waiting for EME key session creation"),qo({player:this.player_,sourceKeySystems:this.source_.keySystems,audioMedia:t&&t.media(),mainPlaylists:this.playlists.master.playlists}).then((function(){e.logger_("created EME key session"),e.masterPlaylistController_.sourceUpdater_.initializedEme()})).catch((function(t){e.logger_("error while creating EME key session",t),e.player_.error({message:"Failed to initialize media keys for EME",code:3})}))):this.masterPlaylistController_.sourceUpdater_.initializedEme()},i.setupQualityLevels_=function(){var e=this,t=Yr.players[this.tech_.options_.playerId];t&&t.qualityLevels&&!this.qualityLevels_&&(this.qualityLevels_=t.qualityLevels(),this.masterPlaylistController_.on("selectedinitialmedia",(function(){var t,i;t=e.qualityLevels_,(i=e).representations().forEach((function(e){t.addQualityLevel(e)})),Yo(t,i.playlists)})),this.playlists.on("mediachange",(function(){Yo(e.qualityLevels_,e.playlists)})))},t.version=function(){return{"@videojs/http-streaming":"2.10.2","mux.js":"5.13.0","mpd-parser":"0.19.0","m3u8-parser":"4.7.0","aes-decrypter":"3.1.2"}},i.version=function(){return this.constructor.version()},i.canChangeType=function(){return vo.canChangeType()},i.play=function(){this.masterPlaylistController_.play()},i.setCurrentTime=function(e){this.masterPlaylistController_.setCurrentTime(e)},i.duration=function(){return this.masterPlaylistController_.duration()},i.seekable=function(){return this.masterPlaylistController_.seekable()},i.dispose=function(){this.playbackWatcher_&&this.playbackWatcher_.dispose(),this.masterPlaylistController_&&this.masterPlaylistController_.dispose(),this.qualityLevels_&&this.qualityLevels_.dispose(),this.player_&&(delete this.player_.vhs,delete this.player_.dash,delete this.player_.hls),this.tech_&&this.tech_.vhs&&delete this.tech_.vhs,this.tech_&&delete this.tech_.hls,this.mediaSourceUrl_&&A.default.URL.revokeObjectURL&&(A.default.URL.revokeObjectURL(this.mediaSourceUrl_),this.mediaSourceUrl_=null),e.prototype.dispose.call(this)},i.convertToProgramTime=function(e,t){return Xa({playlist:this.masterPlaylistController_.media(),time:e,callback:t})},i.seekToProgramTime=function(e,t,i,n){return void 0===i&&(i=!0),void 0===n&&(n=2),Qa({programTime:e,playlist:this.masterPlaylistController_.media(),retryCount:n,pauseAfterSeek:i,seekTo:this.options_.seekTo,tech:this.options_.tech,callback:t})},t}(Yr.getComponent("Component")),$o={name:"videojs-http-streaming",VERSION:"2.10.2",canHandleSource:function(e,t){void 0===t&&(t={});var i=Yr.mergeOptions(Yr.options,t);return $o.canPlayType(e.type,i)},handleSource:function(e,t,i){void 0===i&&(i={});var n=Yr.mergeOptions(Yr.options,i);return t.vhs=new Qo(e,t,n),Yr.hasOwnProperty("hls")||Object.defineProperty(t,"hls",{get:function(){return Yr.log.warn("player.tech().hls is deprecated. Use player.tech().vhs instead."),t.vhs},configurable:!0}),t.vhs.xhr=Na(),t.vhs.src(e.src,e.type),t.vhs},canPlayType:function(e,t){void 0===t&&(t={});var i=Yr.mergeOptions(Yr.options,t).vhs.overrideNative,n=void 0===i?!Yr.browser.IS_ANY_SAFARI:i,r=_.simpleTypeFromSourceType(e);return r&&(!Wo.supportsTypeNatively(r)||n)?"maybe":""}};g.browserSupportsCodec("avc1.4d400d,mp4a.40.2")&&Yr.getTech("Html5").registerSourceHandler($o,0),Yr.VhsHandler=Qo,Object.defineProperty(Yr,"HlsHandler",{get:function(){return Yr.log.warn("videojs.HlsHandler is deprecated. Use videojs.VhsHandler instead."),Qo},configurable:!0}),Yr.VhsSourceHandler=$o,Object.defineProperty(Yr,"HlsSourceHandler",{get:function(){return Yr.log.warn("videojs.HlsSourceHandler is deprecated. Use videojs.VhsSourceHandler instead."),$o},configurable:!0}),Yr.Vhs=Wo,Object.defineProperty(Yr,"Hls",{get:function(){return Yr.log.warn("videojs.Hls is deprecated. Use videojs.Vhs instead."),Wo},configurable:!0}),Yr.use||(Yr.registerComponent("Hls",Wo),Yr.registerComponent("Vhs",Wo)),Yr.options.vhs=Yr.options.vhs||{},Yr.options.hls=Yr.options.hls||{},Yr.registerPlugin?Yr.registerPlugin("reloadSourceOnError",Go):Yr.plugin("reloadSourceOnError",Go),t.exports=Yr},{"@babel/runtime/helpers/assertThisInitialized":1,"@babel/runtime/helpers/construct":2,"@babel/runtime/helpers/extends":3,"@babel/runtime/helpers/inherits":4,"@babel/runtime/helpers/inheritsLoose":5,"@videojs/vhs-utils/cjs/byte-helpers":9,"@videojs/vhs-utils/cjs/codecs.js":11,"@videojs/vhs-utils/cjs/containers":12,"@videojs/vhs-utils/cjs/id3-helpers":15,"@videojs/vhs-utils/cjs/media-types.js":16,"@videojs/vhs-utils/cjs/resolve-url.js":20,"@videojs/xhr":23,"global/document":34,"global/window":35,keycode:38,"m3u8-parser":39,"mpd-parser":41,"mux.js/lib/tools/parse-sidx":42,"mux.js/lib/utils/clock":43,"safe-json-parse/tuple":45,"videojs-vtt.js":48}],48:[function(e,t,i){var n=e("global/window"),r=t.exports={WebVTT:e("./vtt.js"),VTTCue:e("./vttcue.js"),VTTRegion:e("./vttregion.js")};n.vttjs=r,n.WebVTT=r.WebVTT;var a=r.VTTCue,s=r.VTTRegion,o=n.VTTCue,u=n.VTTRegion;r.shim=function(){n.VTTCue=a,n.VTTRegion=s},r.restore=function(){n.VTTCue=o,n.VTTRegion=u},n.VTTCue||r.shim()},{"./vtt.js":49,"./vttcue.js":50,"./vttregion.js":51,"global/window":35}],49:[function(e,t,i){var n=e("global/document"),r=Object.create||function(){function e(){}return function(t){if(1!==arguments.length)throw new Error("Object.create shim only accepts one parameter.");return e.prototype=t,new e}}();function a(e,t){this.name="ParsingError",this.code=e.code,this.message=t||e.message}function s(e){function t(e,t,i,n){return 3600*(0|e)+60*(0|t)+(0|i)+(0|n)/1e3}var i=e.match(/^(\d+):(\d{1,2})(:\d{1,2})?\.(\d{3})/);return i?i[3]?t(i[1],i[2],i[3].replace(":",""),i[4]):i[1]>59?t(i[1],i[2],0,i[4]):t(0,i[1],i[2],i[4]):null}function o(){this.values=r(null)}function u(e,t,i,n){var r=n?e.split(n):[e];for(var a in r)if("string"==typeof r[a]){var s=r[a].split(i);if(2===s.length)t(s[0],s[1])}}function l(e,t,i){var n=e;function r(){var t=s(e);if(null===t)throw new a(a.Errors.BadTimeStamp,"Malformed timestamp: "+n);return e=e.replace(/^[^\sa-zA-Z-]+/,""),t}function l(){e=e.replace(/^\s+/,"")}if(l(),t.startTime=r(),l(),"--\x3e"!==e.substr(0,3))throw new a(a.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '--\x3e'): "+n);e=e.substr(3),l(),t.endTime=r(),l(),function(e,t){var n=new o;u(e,(function(e,t){switch(e){case"region":for(var r=i.length-1;r>=0;r--)if(i[r].id===t){n.set(e,i[r].region);break}break;case"vertical":n.alt(e,t,["rl","lr"]);break;case"line":var a=t.split(","),s=a[0];n.integer(e,s),n.percent(e,s)&&n.set("snapToLines",!1),n.alt(e,s,["auto"]),2===a.length&&n.alt("lineAlign",a[1],["start","center","end"]);break;case"position":a=t.split(","),n.percent(e,a[0]),2===a.length&&n.alt("positionAlign",a[1],["start","center","end"]);break;case"size":n.percent(e,t);break;case"align":n.alt(e,t,["start","center","end","left","right"])}}),/:/,/\s/),t.region=n.get("region",null),t.vertical=n.get("vertical","");try{t.line=n.get("line","auto")}catch(e){}t.lineAlign=n.get("lineAlign","start"),t.snapToLines=n.get("snapToLines",!0),t.size=n.get("size",100);try{t.align=n.get("align","center")}catch(e){t.align=n.get("align","middle")}try{t.position=n.get("position","auto")}catch(e){t.position=n.get("position",{start:0,left:0,center:50,middle:50,end:100,right:100},t.align)}t.positionAlign=n.get("positionAlign",{start:"start",left:"start",center:"center",middle:"center",end:"end",right:"end"},t.align)}(e,t)}a.prototype=r(Error.prototype),a.prototype.constructor=a,a.Errors={BadSignature:{code:0,message:"Malformed WebVTT signature."},BadTimeStamp:{code:1,message:"Malformed time stamp."}},o.prototype={set:function(e,t){this.get(e)||""===t||(this.values[e]=t)},get:function(e,t,i){return i?this.has(e)?this.values[e]:t[i]:this.has(e)?this.values[e]:t},has:function(e){return e in this.values},alt:function(e,t,i){for(var n=0;n=0&&t<=100)&&(this.set(e,t),!0)}};var d=n.createElement&&n.createElement("textarea"),h={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"},c={white:"rgba(255,255,255,1)",lime:"rgba(0,255,0,1)",cyan:"rgba(0,255,255,1)",red:"rgba(255,0,0,1)",yellow:"rgba(255,255,0,1)",magenta:"rgba(255,0,255,1)",blue:"rgba(0,0,255,1)",black:"rgba(0,0,0,1)"},f={v:"title",lang:"lang"},p={rt:"ruby"};function m(e,t){function i(){if(!t)return null;var e,i=t.match(/^([^<]*)(<[^>]*>?)?/);return e=i[1]?i[1]:i[2],t=t.substr(e.length),e}function n(e,t){return!p[t.localName]||p[t.localName]===e.localName}function r(t,i){var n=h[t];if(!n)return null;var r=e.document.createElement(n),a=f[t];return a&&i&&(r[a]=i.trim()),r}for(var a,o,u=e.document.createElement("div"),l=u,m=[];null!==(a=i());)if("<"!==a[0])l.appendChild(e.document.createTextNode((o=a,d.innerHTML=o,o=d.textContent,d.textContent="",o)));else{if("/"===a[1]){m.length&&m[m.length-1]===a.substr(2).replace(">","")&&(m.pop(),l=l.parentNode);continue}var g,_=s(a.substr(1,a.length-2));if(_){g=e.document.createProcessingInstruction("timestamp",_),l.appendChild(g);continue}var y=a.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!y)continue;if(!(g=r(y[1],y[3])))continue;if(!n(l,g))continue;if(y[2]){var v=y[2].split(".");v.forEach((function(e){var t=/^bg_/.test(e),i=t?e.slice(3):e;if(c.hasOwnProperty(i)){var n=t?"background-color":"color",r=c[i];g.style[n]=r}})),g.className=v.join(" ")}m.push(y[1]),l.appendChild(g),l=g}return u}var g=[[1470,1470],[1472,1472],[1475,1475],[1478,1478],[1488,1514],[1520,1524],[1544,1544],[1547,1547],[1549,1549],[1563,1563],[1566,1610],[1645,1647],[1649,1749],[1765,1766],[1774,1775],[1786,1805],[1807,1808],[1810,1839],[1869,1957],[1969,1969],[1984,2026],[2036,2037],[2042,2042],[2048,2069],[2074,2074],[2084,2084],[2088,2088],[2096,2110],[2112,2136],[2142,2142],[2208,2208],[2210,2220],[8207,8207],[64285,64285],[64287,64296],[64298,64310],[64312,64316],[64318,64318],[64320,64321],[64323,64324],[64326,64449],[64467,64829],[64848,64911],[64914,64967],[65008,65020],[65136,65140],[65142,65276],[67584,67589],[67592,67592],[67594,67637],[67639,67640],[67644,67644],[67647,67669],[67671,67679],[67840,67867],[67872,67897],[67903,67903],[67968,68023],[68030,68031],[68096,68096],[68112,68115],[68117,68119],[68121,68147],[68160,68167],[68176,68184],[68192,68223],[68352,68405],[68416,68437],[68440,68466],[68472,68479],[68608,68680],[126464,126467],[126469,126495],[126497,126498],[126500,126500],[126503,126503],[126505,126514],[126516,126519],[126521,126521],[126523,126523],[126530,126530],[126535,126535],[126537,126537],[126539,126539],[126541,126543],[126545,126546],[126548,126548],[126551,126551],[126553,126553],[126555,126555],[126557,126557],[126559,126559],[126561,126562],[126564,126564],[126567,126570],[126572,126578],[126580,126583],[126585,126588],[126590,126590],[126592,126601],[126603,126619],[126625,126627],[126629,126633],[126635,126651],[1114109,1114109]];function _(e){for(var t=0;t=i[0]&&e<=i[1])return!0}return!1}function y(e){var t=[],i="";if(!e||!e.childNodes)return"ltr";function n(e,t){for(var i=t.childNodes.length-1;i>=0;i--)e.push(t.childNodes[i])}function r(e){if(!e||!e.length)return null;var t=e.pop(),i=t.textContent||t.innerText;if(i){var a=i.match(/^.*(\n|\r)/);return a?(e.length=0,a[0]):i}return"ruby"===t.tagName?r(e):t.childNodes?(n(e,t),r(e)):void 0}for(n(t,e);i=r(t);)for(var a=0;a=0&&e.line<=100))return e.line;if(!e.track||!e.track.textTrackList||!e.track.textTrackList.mediaElement)return-1;for(var t=e.track,i=t.textTrackList,n=0,r=0;rh&&(d=d<0?-1:1,d*=Math.ceil(h/l)*l),s<0&&(d+=""===a.vertical?i.height:i.width,o=o.reverse()),r.move(c,d)}else{var f=r.lineHeight/i.height*100;switch(a.lineAlign){case"center":s-=f/2;break;case"end":s-=f}switch(a.vertical){case"":t.applyStyles({top:t.formatStyle(s,"%")});break;case"rl":t.applyStyles({left:t.formatStyle(s,"%")});break;case"lr":t.applyStyles({right:t.formatStyle(s,"%")})}o=["+y","-x","+x","-y"],r=new T(t)}var p=function(e,t){for(var r,a=new T(e),s=1,o=0;ou&&(r=new T(e),s=u),e=new T(a)}return r||a}(r,o);t.move(p.toCSSCompatValues(i))}function E(){}v.prototype.applyStyles=function(e,t){for(var i in t=t||this.div,e)e.hasOwnProperty(i)&&(t.style[i]=e[i])},v.prototype.formatStyle=function(e,t){return 0===e?0:e+t},b.prototype=r(v.prototype),b.prototype.constructor=b,T.prototype.move=function(e,t){switch(t=void 0!==t?t:this.lineHeight,e){case"+x":this.left+=t,this.right+=t;break;case"-x":this.left-=t,this.right-=t;break;case"+y":this.top+=t,this.bottom+=t;break;case"-y":this.top-=t,this.bottom-=t}},T.prototype.overlaps=function(e){return this.lefte.left&&this.tope.top},T.prototype.overlapsAny=function(e){for(var t=0;t=e.top&&this.bottom<=e.bottom&&this.left>=e.left&&this.right<=e.right},T.prototype.overlapsOppositeAxis=function(e,t){switch(t){case"+x":return this.lefte.right;case"+y":return this.tope.bottom}},T.prototype.intersectPercentage=function(e){return Math.max(0,Math.min(this.right,e.right)-Math.max(this.left,e.left))*Math.max(0,Math.min(this.bottom,e.bottom)-Math.max(this.top,e.top))/(this.height*this.width)},T.prototype.toCSSCompatValues=function(e){return{top:this.top-e.top,bottom:e.bottom-this.bottom,left:this.left-e.left,right:e.right-this.right,height:this.height,width:this.width}},T.getSimpleBoxPosition=function(e){var t=e.div?e.div.offsetHeight:e.tagName?e.offsetHeight:0,i=e.div?e.div.offsetWidth:e.tagName?e.offsetWidth:0,n=e.div?e.div.offsetTop:e.tagName?e.offsetTop:0;return{left:(e=e.div?e.div.getBoundingClientRect():e.tagName?e.getBoundingClientRect():e).left,right:e.right,top:e.top||n,height:e.height||t,bottom:e.bottom||n+(e.height||t),width:e.width||i}},E.StringDecoder=function(){return{decode:function(e){if(!e)return"";if("string"!=typeof e)throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(e))}}},E.convertCueToDOMTree=function(e,t){return e&&t?m(e,t):null};E.processCues=function(e,t,i){if(!e||!t||!i)return null;for(;i.firstChild;)i.removeChild(i.firstChild);var n=e.document.createElement("div");if(n.style.position="absolute",n.style.left="0",n.style.right="0",n.style.top="0",n.style.bottom="0",n.style.margin="1.5%",i.appendChild(n),function(e){for(var t=0;t100)throw new Error("Position must be between 0 and 100.");m=e,this.hasBeenReset=!0}},positionAlign:{enumerable:!0,get:function(){return g},set:function(e){var t=a(e);t&&(g=t,this.hasBeenReset=!0)}},size:{enumerable:!0,get:function(){return _},set:function(e){if(e<0||e>100)throw new Error("Size must be between 0 and 100.");_=e,this.hasBeenReset=!0}},align:{enumerable:!0,get:function(){return y},set:function(e){var t=a(e);if(!t)throw new SyntaxError("align: an invalid or illegal alignment string was specified.");y=t,this.hasBeenReset=!0}}}),this.displayState=void 0}s.prototype.getCueAsHTML=function(){return WebVTT.convertCueToDOMTree(window,this.text)},t.exports=s},{}],51:[function(e,t,i){var n={"":!0,up:!0};function r(e){return"number"==typeof e&&e>=0&&e<=100}t.exports=function(){var e=100,t=3,i=0,a=100,s=0,o=100,u="";Object.defineProperties(this,{width:{enumerable:!0,get:function(){return e},set:function(t){if(!r(t))throw new Error("Width must be between 0 and 100.");e=t}},lines:{enumerable:!0,get:function(){return t},set:function(e){if("number"!=typeof e)throw new TypeError("Lines must be set to a number.");t=e}},regionAnchorY:{enumerable:!0,get:function(){return a},set:function(e){if(!r(e))throw new Error("RegionAnchorX must be between 0 and 100.");a=e}},regionAnchorX:{enumerable:!0,get:function(){return i},set:function(e){if(!r(e))throw new Error("RegionAnchorY must be between 0 and 100.");i=e}},viewportAnchorY:{enumerable:!0,get:function(){return o},set:function(e){if(!r(e))throw new Error("ViewportAnchorY must be between 0 and 100.");o=e}},viewportAnchorX:{enumerable:!0,get:function(){return s},set:function(e){if(!r(e))throw new Error("ViewportAnchorX must be between 0 and 100.");s=e}},scroll:{enumerable:!0,get:function(){return u},set:function(e){var t=function(e){return"string"==typeof e&&(!!n[e.toLowerCase()]&&e.toLowerCase())}(e);!1===t||(u=t)}}})}},{}],52:[function(e,t,i){"use strict";t.exports={DEFAILT_WEBGL_PLAY_ID:"glplayer",PLAYER_IN_TYPE_MP4:"mp4",PLAYER_IN_TYPE_FLV:"flv",PLAYER_IN_TYPE_HTTPFLV:"httpflv",PLAYER_IN_TYPE_RAW_265:"raw265",PLAYER_IN_TYPE_TS:"ts",PLAYER_IN_TYPE_MPEGTS:"mpegts",PLAYER_IN_TYPE_M3U8:"hls",PLAYER_IN_TYPE_M3U8_VOD:"m3u8",PLAYER_IN_TYPE_M3U8_LIVE:"hls",APPEND_TYPE_STREAM:0,APPEND_TYPE_FRAME:1,APPEND_TYPE_SEQUENCE:2,DEFAULT_WIDTH:600,DEFAULT_HEIGHT:600,DEFAULT_FPS:30,DEFAULT_FRAME_DUR:40,DEFAULT_FIXED:!1,DEFAULT_SAMPLERATE:44100,DEFAULT_CHANNELS:2,DEFAULT_CONSU_SAMPLE_LEN:20,PLAYER_MODE_VOD:"vod",PLAYER_MODE_NOTIME_LIVE:"live",AUDIO_MODE_ONCE:"ONCE",AUDIO_MODE_SWAP:"SWAP",DEFAULT_STRING_LIVE:"LIVE",CODEC_H265:0,CODEC_H264:1,PLAYER_CORE_TYPE_DEFAULT:0,PLAYER_CORE_TYPE_CNATIVE:1,URI_PROTOCOL_WEBSOCKET:"ws",URI_PROTOCOL_WEBSOCKET_DESC:"websocket",URI_PROTOCOL_HTTP:"http",URI_PROTOCOL_HTTP_DESC:"http",FETCH_FIRST_MAX_TIMES:5,FETCH_HTTP_FLV_TIMEOUT_MS:7e3,V_CODEC_NAME_HEVC:265,V_CODEC_NAME_AVC:264,V_CODEC_NAME_UNKN:500,A_CODEC_NAME_AAC:112,A_CODEC_NAME_MP3:113,A_CODEC_NAME_UNKN:500,CACHE_NO_LOADCACHE:192,CACHE_WITH_PLAY_SIGN:193,CACHE_WITH_NOPLAY_SIGN:194}},{}],53:[function(e,t,i){"use strict";var n=window.AudioContext||window.webkitAudioContext,r=e("../consts"),a=e("./av-common");t.exports=function(e){var t={options:{sampleRate:e.sampleRate||r.DEFAULT_SAMPLERATE,appendType:e.appendType||r.APPEND_TYPE_STREAM,playMode:e.playMode||r.AUDIO_MODE_SWAP},sourceChannel:-1,audioCtx:new n({latencyHint:"interactive",sampleRate:e.sampleRate}),gainNode:null,sourceList:[],startStatus:!1,sampleQueue:[],nextBuffer:null,playTimestamp:0,playStartTime:0,durationMs:-1,isLIVE:!1,voice:1,onLoadCache:null,resetStartParam:function(){t.playTimestamp=0,t.playStartTime=0},setOnLoadCache:function(e){t.onLoadCache=e},setDurationMs:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1;t.durationMs=e},setVoice:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;t.voice=e,t.gainNode.gain.value=e},getAlignVPTS:function(){return t.playTimestamp+(a.GetMsTime()-t.playStartTime)/1e3},swapSource:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;if(0==t.startStatus)return null;if(e<0||e>=t.sourceList.length)return null;if(i<0||i>=t.sourceList.length)return null;try{t.sourceChannel===e&&null!==t.sourceList[e]&&(t.sourceList[e].disconnect(t.gainNode),t.sourceList[e]=null)}catch(t){console.error("[DEFINE ERROR] audioModule disconnect source Index:"+e+" error happened!",t)}t.sourceChannel=i;var n=t.decodeSample(i,e);-2==n&&t.isLIVE&&(t.getAlignVPTS()>=t.durationMs/1e3-.04?t.pause():null!==t.onLoadCache&&t.onLoadCache())},addSample:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return!(null==e||!e||null==e)&&(0==t.sampleQueue.length&&(t.seekPos=e.pts),t.sampleQueue.push(e),!0)},runNextBuffer:function(){window.setInterval((function(){if(!(null!=t.nextBuffer||t.sampleQueue.length0&&void 0!==arguments[0]?arguments[0]:-1,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;if(e<0||e>=t.sourceList.length)return-1;if(null!=t.sourceList[e]&&null!=t.sourceList[e]&&t.sourceList[e]||(t.sourceList[e]=t.audioCtx.createBufferSource(),t.sourceList[e].onended=function(){t.swapSource(e,i)}),0==t.sampleQueue.length)return t.isLIVE?(t.sourceList[e].connect(t.gainNode),t.sourceList[e].start(),t.sourceList[e].onended=function(){t.swapSource(e,i)},t.sourceList[e].stop(),0):-2;if(t.sourceList[e].buffer)return t.sourceList[e],t.sourceList[i],t.gainNode,t.swapSource(e,i),0;if(null==t.nextBuffer||t.nextBuffer.data.length<1)return t.sourceList[e].connect(t.gainNode),t.sourceList[e].start(),t.sourceList[e].startState=!0,t.sourceList[e].stop(),1;var n=t.nextBuffer.data.buffer;t.playTimestamp=t.nextBuffer.pts,t.playStartTime=a.GetMsTime();try{t.audioCtx.decodeAudioData(n,(function(i){null!==t.sourceList[e]&&(t.sourceList[e].buffer=i,t.sourceList[e].connect(t.gainNode),t.sourceList[e].start(),t.sourceList[e].startState=!0)}),(function(e){}))}catch(e){return t.nextBuffer=null,-3}return t.nextBuffer=null,0},decodeWholeSamples:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1;if(t.sourceChannel=e,e<0||e>=t.sourceList.length)return-1;if(null!=t.sourceList[e]&&null!=t.sourceList[e]&&t.sourceList[e]||(t.sourceList[e]=t.audioCtx.createBufferSource(),t.sourceList[e].onended=function(){}),0==t.sampleQueue.length)return-2;for(var i=null,n=null,a=0;a=2){var s=i.length/2;a=new Float32Array(s);for(var o=0,u=0;u0&&s()-this._start_time>=this._now_seg_dur&&(s(),this._start_time,this._now_seg_dur,this._start_time=-1,this._now_seg_dur=-1),s(),this._start_time<0)if(new Date,null!==this._pcm_array_buf&&this._pcm_array_buf.length>this._push_start_idx){this._swapStartPlay=!1;var e=this._push_start_idx+this._once_pop_len;e>this._pcm_array_buf.length&&(e=this._pcm_array_buf.length);var t=this._pcm_array_buf.slice(this._push_start_idx,e);this._push_start_idx+=t.length,this._now_seg_dur=1*t.length/this._sample_rate*1e3,t.length,this._sample_rate,this._now_seg_dur;var i=this._ctx.createBuffer(1,t.length,this._sample_rate);t.length,new Date,i.copyToChannel(t,0),this._active_node=this._ctx.createBufferSource(),this._active_node.buffer=i,this._active_node.connect(this._gain),this._start_time=s(),this._active_node.start(0)}else setTimeout(this.readingLoopWithF32,1)}}])&&n(t.prototype,i),o&&n(t,o),e}();i.AudioPcmPlayer=o},{"../consts":52}],55:[function(e,t,i){"use strict";var n=e("../consts"),r=[{format:"mp4",value:"mp4",core:n.PLAYER_CORE_TYPE_CNATIVE},{format:"mov",value:"mp4",core:n.PLAYER_CORE_TYPE_CNATIVE},{format:"flv",value:"flv",core:n.PLAYER_CORE_TYPE_CNATIVE},{format:"m3u8",value:"hls",core:n.PLAYER_CORE_TYPE_DEFAULT},{format:"m3u",value:"hls",core:n.PLAYER_CORE_TYPE_DEFAULT},{format:"ts",value:"ts",core:n.PLAYER_CORE_TYPE_DEFAULT},{format:"mpegts",value:"ts",core:n.PLAYER_CORE_TYPE_DEFAULT},{format:"hevc",value:"raw265",core:n.PLAYER_CORE_TYPE_DEFAULT},{format:"h265",value:"raw265",core:n.PLAYER_CORE_TYPE_DEFAULT}],a=[{format:n.URI_PROTOCOL_HTTP,value:n.URI_PROTOCOL_HTTP_DESC},{format:n.URI_PROTOCOL_WEBSOCKET,value:n.URI_PROTOCOL_WEBSOCKET_DESC}];t.exports={frameDataAlignCrop:function(e,t,i,n,r,a,s,o){if(0==e-n)return[a,s,o];for(var u=n*r,l=u/4,d=new Uint8Array(u),h=new Uint8Array(l),c=new Uint8Array(l),f=n,p=n/2,m=0;m=0)return i.value}return r[0].value},GetFormatPlayCore:function(e){for(var t=0;t=0)return i.value}return a[0].value},GetMsTime:function(){return(new Date).getTime()}}},{"../consts":52}],56:[function(e,t,i){"use strict";function n(e,t){for(var i=0;i0&&(t.getPackageTimeMS=a.GetMsTime()),t.pushPkg++,void 0!==t.AVGetInterval&&null!==t.AVGetInterval||(t.AVGetInterval=window.setInterval((function(){Module.cwrap("getBufferLengthApi","number",["number"])(t.AVSniffPtr)>t.config.probeSize?(Module.cwrap("getSniffHttpFlvPkg","number",["number"])(t.AVSniffPtr),t.pushPkg-=1):t.getPackageTimeMS>0&&a.GetMsTime()-t.getPackageTimeMS>=o.FETCH_HTTP_FLV_TIMEOUT_MS&&(t.getPackageTimeMS=a.GetMsTime(),t.workerFetch.postMessage({cmd:"retry",data:null,msg:"retry"}))}),5));break;case"close":t.AVGetInterval&&clearInterval(t.AVGetInterval),t.AVGetInterval=null;case"fetch-fin":break;case"fetch-error":t.onNetworkError&&t.onNetworkError(i.data)}}},{key:"_checkDisplaySize",value:function(e,t,i){var n=t-e,r=this.config.width+Math.ceil(n/2),a=t/this.config.width>i/this.config.height,s=(r/t).toFixed(2),o=(this.config.height/i).toFixed(2),u=a?s:o,l=this.config.fixed,d=l?r:parseInt(t*u),h=l?this.config.height:parseInt(i*u);if(this.CanvasObj.offsetWidth!=d||this.CanvasObj.offsetHeight!=h){var c=parseInt((this.canvasBox.offsetHeight-h)/2),f=parseInt((this.canvasBox.offsetWidth-d)/2);c=c<0?0:c,f=f<0?0:f,this.CanvasObj.style.marginTop=c+"px",this.CanvasObj.style.marginLeft=f+"px",this.CanvasObj.style.width=d+"px",this.CanvasObj.style.height=h+"px"}return this.isCheckDisplay=!0,[d,h]}},{key:"_ptsFixed2",value:function(e){return Math.ceil(100*e)/100}},{key:"_callbackProbe",value:function(e,t,i,n,r,a,u,l,d){for(var h=Module.HEAPU8.subarray(d,d+10),c=0;c100&&(f=o.DEFAULT_FPS,this.mediaInfo.noFPS=!0),this.vCodecID=l,this.config.fps=f,this.mediaInfo.fps=f,this.mediaInfo.size.width=t,this.mediaInfo.size.height=i,this.frameTime=Math.floor(1e3/(this.mediaInfo.fps+2)),this.CanvasObj.width==t&&this.CanvasObj.height==i||(this.CanvasObj.width=t,this.CanvasObj.height=i,this.isCheckDisplay)||this._checkDisplaySize(t,t,i),r>=0&&!1===this.mediaInfo.noFPS?(void 0!==this.audioWAudio&&null!==this.audioWAudio&&(this.audioWAudio.stop(),this.audioWAudio=null),this.config.sampleRate=a,this.mediaInfo.sampleRate=a,this.audioWAudio=s({sampleRate:this.mediaInfo.sampleRate,appendType:o.APPEND_TYPE_FRAME}),this.audioWAudio.isLIVE=!0):this.mediaInfo.audioNone=!0,this.onProbeFinish&&this.onProbeFinish()}},{key:"_callbackYUV",value:function(e,t,i,n,r,a,s,o,u){var l=Module.HEAPU8.subarray(e,e+n*o),d=new Uint8Array(l),h=Module.HEAPU8.subarray(t,t+r*o/2),c=new Uint8Array(h),f=Module.HEAPU8.subarray(i,i+a*o/2),p={bufY:d,bufU:c,bufV:new Uint8Array(f),line_y:n,h:o,pts:u};this.YuvBuf.push(p),this.checkCacheState(),Module._free(l),l=null,Module._free(h),h=null,Module._free(f),f=null,!1===this.readyShowDone&&(this.playYUV(),this.readyShowDone=!0,this.onReadyShowDone&&this.onReadyShowDone(),this.audioWAudio||this.play())}},{key:"_callbackNALU",value:function(e,t,i,n,r,a,s){if(!1===this.readyKeyFrame){if(i<=0)return;this.readyKeyFrame=!0}var o=Module.HEAPU8.subarray(e,e+t),u=new Uint8Array(o);this.NaluBuf.push({bufData:u,len:t,isKey:i,w:n,h:r,pts:1e3*a,dts:1e3*s}),Module._free(o),o=null}},{key:"_callbackPCM",value:function(e){}},{key:"_callbackAAC",value:function(e,t,i,n,r){var a=this._ptsFixed2(r);if(this.audioWAudio){var s=new Uint8Array(7+i),o=Module.HEAPU8.subarray(e,e+7);s.set(o,0);var u=Module.HEAPU8.subarray(t,t+i);s.set(u,7);var l={pts:a,data:s};this.audioWAudio.addSample(l),this.checkCacheState()}}},{key:"_decode",value:function(){var e=this;setTimeout((function(){if(null!==e.workerFetch){var t=e.NaluBuf.shift();if(null!=t){var i=Module._malloc(t.bufData.length);Module.HEAP8.set(t.bufData,i),Module.cwrap("decodeHttpFlvVideoFrame","number",["number","number","number","number","number"])(e.AVSniffPtr,i,t.bufData.length,t.pts,t.dts,0),Module._free(i),i=null}e._decode()}}),1)}},{key:"checkCacheState",value:function(){var e=this.YuvBuf.length>=25&&(!0===this.mediaInfo.audioNone||this.audioWAudio&&this.audioWAudio.sampleQueue.length>=50);return!1===this.cache_status&&e&&(this.playInterval&&this.audioWAudio&&this.audioWAudio.play(),this.onLoadCacheFinshed&&this.onLoadCacheFinshed(),this.cache_status=!0),e}},{key:"setVoice",value:function(e){this.audioVoice=e,this.audioWAudio&&this.audioWAudio.setVoice(e)}},{key:"_removeBindFuncPtr",value:function(){null!==this._ptr_probeCallback&&Module.removeFunction(this._ptr_probeCallback),null!==this._ptr_frameCallback&&Module.removeFunction(this._ptr_frameCallback),null!==this._ptr_naluCallback&&Module.removeFunction(this._ptr_naluCallback),null!==this._ptr_sampleCallback&&Module.removeFunction(this._ptr_sampleCallback),null!==this._ptr_aacCallback&&Module.removeFunction(this._ptr_aacCallback),this._ptr_probeCallback=null,this._ptr_frameCallback=null,this._ptr_naluCallback=null,this._ptr_sampleCallback=null,this._ptr_aacCallback=null}},{key:"release",value:function(){return this.pause(),this.NaluBuf.length=0,this.YuvBuf.length=0,void 0!==this.workerFetch&&null!==this.workerFetch&&this.workerFetch.postMessage({cmd:"stop",data:"stop",msg:"stop"}),this.workerFetch=null,this.AVGetInterval&&clearInterval(this.AVGetInterval),this.AVGetInterval=null,this._removeBindFuncPtr(),Module.cwrap("releaseHttpFLV","number",["number"])(this.AVSniffPtr),this.playInterval&&clearInterval(this.playInterval),this.playInterval=null,this.audioWAudio&&this.audioWAudio.stop(),this.audioWAudio=null,this.CanvasObj&&this.CanvasObj.remove(),this.CanvasObj=null,0}},{key:"isPlayingState",value:function(){return null!==this.playInterval&&void 0!==this.playInterval}},{key:"pause",value:function(){this.audioWAudio&&this.audioWAudio.pause(),this.playInterval&&clearInterval(this.playInterval),this.playInterval=null}},{key:"playYUV",value:function(){if(this.YuvBuf.length>0){var e=this.YuvBuf.shift();return r.renderFrame(this.AVGLObj,e.bufY,e.bufU,e.bufV,e.line_y,e.h),!0}return!1}},{key:"play",value:function(){var e=this,t=this;if(!1===this.checkCacheState())return this.onLoadCache&&this.onLoadCache(),setTimeout((function(){e.play()}),100),!1;if(void 0===this.playInterval||null===this.playInterval){var i=0,n=0,s=0;!1===this.mediaInfo.audioNone&&this.audioWAudio&&!1===this.mediaInfo.noFPS?(this.playInterval=setInterval((function(){if(n=a.GetMsTime(),t.cache_status){if(n-i>=t.frameTime-s){var e=t.YuvBuf.shift();if(null!=e&&null!==e){var o=0;null!==t.audioWAudio&&void 0!==t.audioWAudio&&(o=1e3*(e.pts-t.audioWAudio.getAlignVPTS())),s=t.audioWAudio?o<0&&-1*o<=t.frameTime||o>=0?a.GetMsTime()-n+1:t.frameTime:a.GetMsTime()-n+1,r.renderFrame(t.AVGLObj,e.bufY,e.bufU,e.bufV,e.line_y,e.h)}(t.YuvBuf.length<=0||t.audioWAudio&&t.audioWAudio.sampleQueue.length<=0)&&(t.cache_status=!1,t.onLoadCache&&t.onLoadCache(),t.audioWAudio&&t.audioWAudio.pause()),i=n}}else s=t.frameTime}),1),this.audioWAudio&&this.audioWAudio.play()):this.playInterval=setInterval((function(){var e=t.YuvBuf.shift();null!=e&&null!==e&&r.renderFrame(t.AVGLObj,e.bufY,e.bufU,e.bufV,e.line_y,e.h),t.YuvBuf.length<=0&&(t.cache_status=!1)}),t.frameTime)}}},{key:"start",value:function(e){var t,i,n,a=this;this.workerFetch=new Worker((t=function(){var e=null,t=new AbortController,i=t.signal,n=(self,function(e){var t=!1;t||(t=!0,fetch(e,{signal:i}).then((function(e){return function e(t){return t.read().then((function(i){if(!i.done){var n=i.value;return self.postMessage({cmd:"fetch-chunk",data:n,msg:"fetch-chunk"}),e(t)}self.postMessage({cmd:"fetch-fin",data:null,msg:"fetch-fin"})}))}(e.body.getReader())})).catch((function(e){if(!e.toString().includes("user aborted")){var t=" httplive request error:"+e+" start to retry";console.error(t),self.postMessage({cmd:"fetch-error",data:t,msg:"fetch-error"})}})))});self.onmessage=function(r){var a=r.data;switch(void 0===a.cmd||null===a.cmd?"":a.cmd){case"start":e=a.data,n(e),self.postMessage({cmd:"default",data:"WORKER STARTED",msg:"default"});break;case"stop":t.abort(),self.close(),self.postMessage({cmd:"close",data:"close",msg:"close"});break;case"retry":t.abort(),t=null,i=null,t=new AbortController,i=t.signal,setTimeout((function(){n(e)}),3e3)}}}.toString(),i=t.match(/^\s*function\s*\(\s*\)\s*\{(([\s\S](?!\}$))*[\s\S])/),n=[i[1]],window.URL.createObjectURL(new Blob(n,{type:"text/javascript"})))),this.workerFetch.onmessage=function(e){a._workerFetch_onmessage(e,a)},this.workerFetch,this.AVSniffPtr=Module.cwrap("AVSniffHttpFlvInit","number",["string","string"])("base64:QXV0aG9yOmNoYW5neWFubG9uZ3xudW1iZXJ3b2xmLEdpdGh1YjpodHRwczovL2dpdGh1Yi5jb20vbnVtYmVyd29sZixFbWFpbDpwb3JzY2hlZ3QyM0Bmb3htYWlsLmNvbSxRUTo1MzEzNjU4NzIsSG9tZVBhZ2U6aHR0cDovL3h2aWRlby52aWRlbyxEaXNjb3JkOm51bWJlcndvbGYjODY5NCx3ZWNoYXI6bnVtYmVyd29sZjExLEJlaWppbmcsV29ya0luOkJhaWR1","0.0.0"),this.AVSniffPtr,this._ptr_probeCallback=Module.addFunction(this._callbackProbe.bind(this)),this._ptr_yuvCallback=Module.addFunction(this._callbackYUV.bind(this)),this._ptr_naluCallback=Module.addFunction(this._callbackNALU.bind(this)),this._ptr_sampleCallback=Module.addFunction(this._callbackPCM.bind(this)),this._ptr_aacCallback=Module.addFunction(this._callbackAAC.bind(this)),Module.cwrap("initializeSniffHttpFlvModule","number",["number","number","number","number","number","number"])(this.AVSniffPtr,this._ptr_probeCallback,this._ptr_yuvCallback,this._ptr_naluCallback,this._ptr_sampleCallback,this._ptr_aacCallback),this.AVGLObj=r.setupCanvas(this.CanvasObj,{preserveDrawingBuffer:!1}),this.workerFetch.postMessage({cmd:"start",data:e,msg:"start"}),this._decode()}}])&&n(t.prototype,i),u&&n(t,u),e}();i.CHttpLiveCore=u},{"../consts":52,"../demuxer/buffer":64,"../demuxer/bufferFrame":65,"../render-engine/webgl-420p":77,"../version":80,"./audio-core":53,"./audio-native-core":54,"./av-common":55,"./cache":59,"./cacheYuv":60}],57:[function(e,t,i){"use strict";function n(e,t){for(var i=0;i0&&void 0!==arguments[0]&&arguments[0];this.showScreen=e,this.canvas&&(e?this.canvas.setAttribute("hidden",!0):this.canvas.removeAttribute("hidden"))}},{key:"getCachePTS",value:function(){return 1!==this.config.ignoreAudio&&this.audioWAudio?Math.max(this.vCachePTS,this.aCachePTS):this.vCachePTS}},{key:"getMaxPTS",value:function(){return Math.max(this.vCachePTS,this.aCachePTS)}},{key:"isPlayingState",value:function(){return this.isPlaying}},{key:"pushDone",value:function(){this.pushEOF=!0}},{key:"_clearDecInterval",value:function(){this.decVFrameInterval&&window.clearInterval(this.decVFrameInterval),this.decVFrameInterval=null}},{key:"_checkPlayFinished",value:function(){return!(this.config.playMode!==d.PLAYER_MODE_VOD||!(!0===this.bufRecvStat&&(this.playPTS>=this.bufLastVDTS||this.audioWAudio&&this.playPTS>=this.bufLastADTS)||this.duration-this.playPTS0&&(this.isPlaying=!0);var t=0,i=0,n=0;this.config.playMode===d.PLAYER_MODE_NOTIME_LIVE?this.playFrameInterval=window.setInterval((function(){if(e._videoQueue.length>0){var t=e._videoQueue.shift();t.pts,o.renderFrame(e.yuv,t.data_y,t.data_u,t.data_v,t.line1,t.height)}}),1e3*this.frameDur):this.playFrameInterval=window.setInterval((function(){if(i=u.GetMsTime(),e._videoQueue.length>0&&i-t>=e.frameTime-n){var r=e._videoQueue.shift(),a=0;if(e.isNewSeek||null===e.audioWAudio||void 0===e.audioWAudio||(a=1e3*(r.pts-e.audioWAudio.getAlignVPTS()),e.playPTS=Math.max(e.audioWAudio.getAlignVPTS(),e.playPTS)),t=i,u.GetMsTime(),e.playPTS=Math.max(r.pts,e.playPTS),e.isNewSeek&&e.seekTarget-e.frameDur>r.pts)return void(n=e.frameTime);if(e.isNewSeek&&(e.audioWAudio&&e.audioWAudio.setVoice(e.audioVoice),e.audioWAudio&&e.audioWAudio.play(),n=0,e.isNewSeek=!1,e.seekTarget=0),e.showScreen?e.onRender&&e.onRender(r.line1,r.height,r.data_y,r.data_u,r.data_v):(r.pts,o.renderFrame(e.yuv,r.data_y,r.data_u,r.data_v,r.line1,r.height)),e.onPlayingTime&&e.onPlayingTime(r.pts),!e.isNewSeek&&e.audioWAudio&&(a<0&&-1*a<=e.frameTime||a>=0)){if(e.config.playMode===d.PLAYER_MODE_VOD)if(r.pts>=e.duration)e.onLoadCacheFinshed&&e.onLoadCacheFinshed(),e.onPlayingFinish&&e.onPlayingFinish(),e._clearDecInterval(),e.pause();else if(e._checkPlayFinished())return;n=u.GetMsTime()-i}else!e.isNewSeek&&e.audioWAudio&&(a<0&&e.frameTime,n=e.frameTime)}e._checkPlayFinished()}),1)}this.isNewSeek||this.audioWAudio&&this.audioWAudio.play()}},{key:"pause",value:function(){this.isPlaying=!1,this._pause()}},{key:"_pause",value:function(){this.playFrameInterval&&window.clearInterval(this.playFrameInterval),this.playFrameInterval=null,this.audioWAudio&&this.audioWAudio.pause()}},{key:"seek",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.openFrameCall=!1,this.pause(),this._clearDecInterval(),null!==this.avFeedVideoInterval&&(window.clearInterval(this.avFeedVideoInterval),this.avFeedVideoInterval=null),null!==this.avFeedAudioInterval&&(window.clearInterval(this.avFeedAudioInterval),this.avFeedAudioInterval=null),this.yuvMaxTime=0,this.playVPipe.length=0,this._videoQueue.length=0,this.audioWAudio&&this.audioWAudio.stop(),e&&e(),this.isNewSeek=!0,this.avSeekVState=!0,this.seekTarget=i.seekTime,null!==this.audioWAudio&&void 0!==this.audioWAudio&&(this.audioWAudio.setVoice(0),this.audioWAudio.resetStartParam(),this.audioWAudio.stop()),this._avFeedData(i.seekTime),setTimeout((function(){t.yuvMaxTime=0,t._videoQueue.length=0,t.openFrameCall=!0,t.frameCallTag+=1,t._decVFrameIntervalFunc()}),1e3)}},{key:"setVoice",value:function(e){this.audioVoice=e,this.audioWAudio&&this.audioWAudio.setVoice(e)}},{key:"cacheIsFull",value:function(){return this._videoQueue.length>=50}},{key:"_checkDisplaySize",value:function(e,t,i){var n=t-e,r=this.config.width+Math.ceil(n/2),a=t/this.config.width>i/this.config.height,s=(r/t).toFixed(2),o=(this.config.height/i).toFixed(2),u=a?s:o,l=this.config.fixed,d=l?r:parseInt(t*u),h=l?this.config.height:parseInt(i*u);if(this.canvas.offsetWidth!=d||this.canvas.offsetHeight!=h){var c=parseInt((this.canvasBox.offsetHeight-h)/2),f=parseInt((this.canvasBox.offsetWidth-d)/2);c=c<0?0:c,f=f<0?0:f,this.canvas.style.marginTop=c+"px",this.canvas.style.marginLeft=f+"px",this.canvas.style.width=d+"px",this.canvas.style.height=h+"px"}return this.isCheckDisplay=!0,[d,h]}},{key:"_createYUVCanvas",value:function(){this.canvasBox=document.querySelector("#"+this.config.playerId),this.canvasBox.style.overflow="hidden",this.canvas=document.createElement("canvas"),this.canvas.style.width=this.canvasBox.clientWidth+"px",this.canvas.style.height=this.canvasBox.clientHeight+"px",this.canvas.style.top="0px",this.canvas.style.left="0px",this.canvasBox.appendChild(this.canvas),this.yuv=o.setupCanvas(this.canvas,{preserveDrawingBuffer:!1})}},{key:"_avRecvPackets",value:function(){var e=this;this.bufObject.cleanPipeline(),null!==this.avRecvInterval&&(window.clearInterval(this.avRecvInterval),this.avRecvInterval=null),!0===this.config.checkProbe?this.avRecvInterval=window.setInterval((function(){Module.cwrap("getSniffStreamPkg","number",["number"])(e.corePtr),e._avCheckRecvFinish()}),5):this.avRecvInterval=window.setInterval((function(){Module.cwrap("getSniffStreamPkgNoCheckProbe","number",["number"])(e.corePtr),e._avCheckRecvFinish()}),5),this._avFeedData(0,!1)}},{key:"_avCheckRecvFinish",value:function(){this.config.playMode===d.PLAYER_MODE_VOD&&this.duration-this.getMaxPTS()=50&&(t.onSeekFinish&&t.onSeekFinish(),t.onPlayingTime&&t.onPlayingTime(e),t.play(),window.clearInterval(i),i=null)}),10);return!0}},{key:"_afterAvFeedSeekToStartWithUnFinBuffer",value:function(e){var t=this,i=window.setInterval((function(){t._videoQueue.length,t._videoQueue.length>=50&&(t.onSeekFinish&&t.onSeekFinish(),t.onPlayingTime&&t.onPlayingTime(e),!1===t.reFull?t.play():t.reFull=!1,window.clearInterval(i),i=null)}),10);return!0}},{key:"_avFeedData",value:function(e){var t=this;if(this.playVPipe.length=0,this.audioWAudio&&this.audioWAudio.cleanQueue(),e<=0&&!1===this.bufOK){var i=0;if(this.avFeedVideoInterval=window.setInterval((function(){var n=t.bufObject.videoBuffer.length;if(n-1>i||t.duration-t.getMaxPTS()0){for(var s=0;s0&&t.playVPipe[t.playVPipe.length-1].pts>=t.bufLastVDTS&&(window.clearInterval(t.avFeedVideoInterval),t.avFeedVideoInterval=null,t.playVPipe[t.playVPipe.length-1].pts,t.bufLastVDTS,t.bufObject.videoBuffer,t.playVPipe)}else t.config.playMode===d.PLAYER_MODE_VOD&&t.playVPipe.length>0&&t.playVPipe[t.playVPipe.length-1].pts>=t.duration&&(window.clearInterval(t.avFeedVideoInterval),t.avFeedVideoInterval=null,t.playVPipe[t.playVPipe.length-1].pts,t.duration,t.bufObject.videoBuffer,t.playVPipe);t.avSeekVState&&(t.getMaxPTS(),t.duration,t.config.playMode===d.PLAYER_MODE_VOD&&(t._afterAvFeedSeekToStartWithFinishedBuffer(e),t.avSeekVState=!1))}),5),void 0!==this.audioWAudio&&null!==this.audioWAudio&&this.config.ignoreAudio<1){var n=0;this.avFeedAudioInterval=window.setInterval((function(){var e=t.bufObject.audioBuffer.length;if(e-1>n||t.duration-t.getMaxPTS()0&&t.audioWAudio.sampleQueue[t.audioWAudio.sampleQueue.length-1].pts>=t.bufLastADTS&&(window.clearInterval(t.avFeedAudioInterval),t.avFeedAudioInterval=null,t.audioWAudio.sampleQueue[t.audioWAudio.sampleQueue.length-1].pts,t.bufObject.audioBuffer)}else t.config.playMode===d.PLAYER_MODE_VOD&&t.audioWAudio.sampleQueue.length>0&&t.audioWAudio.sampleQueue[t.audioWAudio.sampleQueue.length-1].pts>=t.duration&&(window.clearInterval(t.avFeedAudioInterval),t.avFeedAudioInterval=null,t.audioWAudio.sampleQueue[t.audioWAudio.sampleQueue.length-1].pts,t.bufObject.audioBuffer)}),5)}}else{var r=this.bufObject.seekIDR(e),s=parseInt(r,10);this.playPTS=0;var o=s;if(this.avFeedVideoInterval=window.setInterval((function(){var i=t.bufObject.videoBuffer.length;if(i-1>o||t.duration-t.getMaxPTS()0){for(var r=0;r0&&t.playVPipe[t.playVPipe.length-1].pts>=t.bufLastVDTS&&(window.clearInterval(t.avFeedVideoInterval),t.avFeedVideoInterval=null)}else t.config.playMode===d.PLAYER_MODE_VOD&&t.playVPipe.length>0&&t.playVPipe[t.playVPipe.length-1].pts>=t.duration&&(window.clearInterval(t.avFeedVideoInterval),t.avFeedVideoInterval=null);t.avSeekVState&&(t.getMaxPTS(),t.duration,t.config.playMode===d.PLAYER_MODE_VOD&&(t._afterAvFeedSeekToStartWithUnFinBuffer(e),t.avSeekVState=!1))}),5),this.audioWAudio&&this.config.ignoreAudio<1){var u=parseInt(e,10);this.avFeedAudioInterval=window.setInterval((function(){var e=t.bufObject.audioBuffer.length;if(e-1>u||t.duration-t.getMaxPTS()0&&t.audioWAudio.sampleQueue[t.audioWAudio.sampleQueue.length-1].pts>=t.bufLastADTS&&(window.clearInterval(t.avFeedAudioInterval),t.avFeedAudioInterval=null)}else t.config.playMode===d.PLAYER_MODE_VOD&&t.audioWAudio.sampleQueue.length>0&&t.audioWAudio.sampleQueue[t.audioWAudio.sampleQueue.length-1].pts>=t.duration&&(window.clearInterval(t.avFeedAudioInterval),t.avFeedAudioInterval=null)}),5)}}}},{key:"_probeFinCallback",value:function(e,t,i,n,r,a,s,o,u){var h=this;this._createYUVCanvas(),d.V_CODEC_NAME_HEVC,this.config.fps=1*n,this.frameTime=1e3/this.config.fps,this.width=t,this.height=i,this.frameDur=1/this.config.fps,this.duration=e-this.frameDur,this.vCodecID=o,this.config.sampleRate=a,this.channels=s,this.audioIdx=r,this.duration<0&&(this.config.playMode=d.PLAYER_MODE_NOTIME_LIVE,this.frameTime,this.frameDur);for(var c=Module.HEAPU8.subarray(u,u+10),f=0;f=0&&this.config.ignoreAudio<1?(void 0!==this.audioWAudio&&null!==this.audioWAudio&&(this.audioWAudio.stop(),this.audioWAudio=null),this.audioWAudio=l({sampleRate:a,appendType:d.APPEND_TYPE_FRAME}),this.audioWAudio.setDurationMs(1e3*e),this.onLoadCache&&this.audioWAudio.setOnLoadCache((function(){if(h.retryAuSampleNo,h.retryAuSampleNo<=5){h.pause(),h.onLoadCache&&h.onLoadCache();var e=window.setInterval((function(){return h.retryAuSampleNo,h.audioWAudio.sampleQueue.length,h.audioWAudio.sampleQueue.length>2?(h.onLoadCacheFinshed&&h.onLoadCacheFinshed(),h.play(),h.retryAuSampleNo=0,window.clearInterval(e),void(e=null)):(h.retryAuSampleNo+=1,h.retryAuSampleNo>5?(h.play(),h.onLoadCacheFinshed&&h.onLoadCacheFinshed(),window.clearInterval(e),void(e=null)):void 0)}),1e3)}}))):this.audioNone=!0,this._avRecvPackets(),this._decVFrameIntervalFunc()),this.onProbeFinish&&this.onProbeFinish()}},{key:"_ptsFixed2",value:function(e){return Math.ceil(100*e)/100}},{key:"_naluCallback",value:function(e,t,i,n,r,a,s){var o=this._ptsFixed2(a),u=Module.HEAPU8.subarray(e,e+t),l=new Uint8Array(u);this.bufObject.appendFrameWithDts(o,s,l,!0,i),this.bufLastVDTS=Math.max(s,this.bufLastVDTS),this.vCachePTS=Math.max(o,this.vCachePTS),this.onCacheProcess&&this.onCacheProcess(this.getCachePTS())}},{key:"_samplesCallback",value:function(e,t,i,n){}},{key:"_aacFrameCallback",value:function(e,t,i,n,r){var a=this._ptsFixed2(r);if(this.audioWAudio){var s=new Uint8Array(7+i),o=Module.HEAPU8.subarray(e,e+7);s.set(o,0);var u=Module.HEAPU8.subarray(t,t+i);s.set(u,7),this.bufObject.appendFrame(a,s,!1,!0),this.bufLastADTS=Math.max(a,this.bufLastADTS),this.aCachePTS=Math.max(a,this.aCachePTS),this.onCacheProcess&&this.onCacheProcess(this.getCachePTS())}}},{key:"_decVFrameIntervalFunc",value:function(){var e=this;null==this.decVFrameInterval&&(this.decVFrameInterval=window.setInterval((function(){if(e._videoQueue.length<50&&e.playVPipe.length>0){var t=e.playVPipe.shift(),i=t.data,n=Module._malloc(i.length);Module.HEAP8.set(i,n);var r=parseInt(1e3*t.pts,10),a=parseInt(1e3*t.dts,10);e.yuvMaxTime=Math.max(t.pts,e.yuvMaxTime),Module.cwrap("decodeVideoFrame","number",["number","number","number","number","number"])(e.corePtr,n,i.length,r,a,e.frameCallTag),Module._free(n),n=null}}),10))}},{key:"_frameCallback",value:function(e,t,i,n,r,a,s,u,l,d){if(this._videoQueue.length,!(!1===this.openFrameCall||d!==this.frameCallTag||l>this.yuvMaxTime+this.frameDur||this.isNewSeek&&this.seekTarget-l>3*this.frameDur)){var h=this._videoQueue.length;if(this.canvas.width==n&&this.canvas.height==u||(this.canvas.width=n,this.canvas.height=u,this.isCheckDisplay)||this._checkDisplaySize(s,n,u),!(this.playPTS>l)){var f=Module.HEAPU8.subarray(e,e+n*u),p=Module.HEAPU8.subarray(t,t+r*u/2),m=Module.HEAPU8.subarray(i,i+a*u/2),g=new Uint8Array(f),_=new Uint8Array(p),y=new Uint8Array(m);this.config.readyShow&&(o.renderFrame(this.yuv,g,_,y,n,u),this.config.readyShow=!1,this.onReadyShowDone&&this.onReadyShowDone());var v=new c(g,_,y,n,r,a,s,u,l);if(h<=0||l>this._videoQueue[h-1].pts)this._videoQueue.push(v);else if(lthis._videoQueue[b].pts&&b+10&&(t.getPackageTimeMS=a.GetMsTime()),t.pushPkg++,void 0!==t.AVGetInterval&&null!==t.AVGetInterval||(t.AVGetInterval=window.setInterval((function(){Module.cwrap("getBufferLengthApi","number",["number"])(t.AVSniffPtr)>t.config.probeSize&&(Module.cwrap("getSniffHttpFlvPkg","number",["number"])(t.AVSniffPtr),t.pushPkg-=1)}),5));break;case"close":t.AVGetInterval&&clearInterval(t.AVGetInterval),t.AVGetInterval=null;case"fetch-fin":break;case"fetch-error":t.onNetworkError&&t.onNetworkError(i.data)}}},{key:"_checkDisplaySize",value:function(e,t,i){var n=t-e,r=this.config.width+Math.ceil(n/2),a=t/this.config.width>i/this.config.height,s=(r/t).toFixed(2),o=(this.config.height/i).toFixed(2),u=a?s:o,l=this.config.fixed,d=l?r:parseInt(t*u),h=l?this.config.height:parseInt(i*u);if(this.CanvasObj.offsetWidth!=d||this.CanvasObj.offsetHeight!=h){var c=parseInt((this.canvasBox.offsetHeight-h)/2),f=parseInt((this.canvasBox.offsetWidth-d)/2);c=c<0?0:c,f=f<0?0:f,this.CanvasObj.style.marginTop=c+"px",this.CanvasObj.style.marginLeft=f+"px",this.CanvasObj.style.width=d+"px",this.CanvasObj.style.height=h+"px"}return this.isCheckDisplay=!0,[d,h]}},{key:"_ptsFixed2",value:function(e){return Math.ceil(100*e)/100}},{key:"_callbackProbe",value:function(e,t,i,n,r,a,u,l,d){for(var h=Module.HEAPU8.subarray(d,d+10),c=0;c100&&(f=o.DEFAULT_FPS,this.mediaInfo.noFPS=!0),this.vCodecID=l,this.config.fps=f,this.mediaInfo.fps=f,this.mediaInfo.size.width=t,this.mediaInfo.size.height=i,this.frameTime=Math.floor(1e3/(this.mediaInfo.fps+2)),this.CanvasObj.width==t&&this.CanvasObj.height==i||(this.CanvasObj.width=t,this.CanvasObj.height=i,this.isCheckDisplay)||this._checkDisplaySize(t,t,i),r>=0&&!1===this.mediaInfo.noFPS?(void 0!==this.audioWAudio&&null!==this.audioWAudio&&(this.audioWAudio.stop(),this.audioWAudio=null),this.config.sampleRate=a,this.mediaInfo.sampleRate=a,this.audioWAudio=s({sampleRate:this.mediaInfo.sampleRate,appendType:o.APPEND_TYPE_FRAME}),this.audioWAudio.isLIVE=!0):this.mediaInfo.audioNone=!0,this.onProbeFinish&&this.onProbeFinish()}},{key:"_callbackYUV",value:function(e,t,i,n,r,a,s,o,u){var l=Module.HEAPU8.subarray(e,e+n*o),d=new Uint8Array(l),h=Module.HEAPU8.subarray(t,t+r*o/2),c=new Uint8Array(h),f=Module.HEAPU8.subarray(i,i+a*o/2),p={bufY:d,bufU:c,bufV:new Uint8Array(f),line_y:n,h:o,pts:u};this.YuvBuf.push(p),this.checkCacheState(),Module._free(l),l=null,Module._free(h),h=null,Module._free(f),f=null,!1===this.readyShowDone&&(this.playYUV(),this.readyShowDone=!0,this.onReadyShowDone&&this.onReadyShowDone(),this.audioWAudio||this.play())}},{key:"_callbackNALU",value:function(e,t,i,n,r,a,s){if(!1===this.readyKeyFrame){if(i<=0)return;this.readyKeyFrame=!0}var o=Module.HEAPU8.subarray(e,e+t),u=new Uint8Array(o);this.NaluBuf.push({bufData:u,len:t,isKey:i,w:n,h:r,pts:1e3*a,dts:1e3*s}),Module._free(o),o=null}},{key:"_callbackPCM",value:function(e){}},{key:"_callbackAAC",value:function(e,t,i,n,r){var a=this._ptsFixed2(r);if(this.audioWAudio){var s=new Uint8Array(7+i),o=Module.HEAPU8.subarray(e,e+7);s.set(o,0);var u=Module.HEAPU8.subarray(t,t+i);s.set(u,7);var l={pts:a,data:s};this.audioWAudio.addSample(l),this.checkCacheState()}}},{key:"_decode",value:function(){var e=this;setTimeout((function(){if(null!==e.workerFetch){var t=e.NaluBuf.shift();if(null!=t){var i=Module._malloc(t.bufData.length);Module.HEAP8.set(t.bufData,i),Module.cwrap("decodeHttpFlvVideoFrame","number",["number","number","number","number","number"])(e.AVSniffPtr,i,t.bufData.length,t.pts,t.dts,0),Module._free(i),i=null}e._decode()}}),1)}},{key:"checkCacheState",value:function(){var e=this.YuvBuf.length>=25&&(!0===this.mediaInfo.audioNone||this.audioWAudio&&this.audioWAudio.sampleQueue.length>=50);return!1===this.cache_status&&e&&(this.playInterval&&this.audioWAudio&&this.audioWAudio.play(),this.onLoadCacheFinshed&&this.onLoadCacheFinshed(),this.cache_status=!0),e}},{key:"setVoice",value:function(e){this.audioVoice=e,this.audioWAudio&&this.audioWAudio.setVoice(e)}},{key:"_removeBindFuncPtr",value:function(){null!==this._ptr_probeCallback&&Module.removeFunction(this._ptr_probeCallback),null!==this._ptr_frameCallback&&Module.removeFunction(this._ptr_frameCallback),null!==this._ptr_naluCallback&&Module.removeFunction(this._ptr_naluCallback),null!==this._ptr_sampleCallback&&Module.removeFunction(this._ptr_sampleCallback),null!==this._ptr_aacCallback&&Module.removeFunction(this._ptr_aacCallback),this._ptr_probeCallback=null,this._ptr_frameCallback=null,this._ptr_naluCallback=null,this._ptr_sampleCallback=null,this._ptr_aacCallback=null}},{key:"release",value:function(){return this.pause(),this.NaluBuf.length=0,this.YuvBuf.length=0,void 0!==this.workerFetch&&null!==this.workerFetch&&this.workerFetch.postMessage({cmd:"stop",data:"stop",msg:"stop"}),this.workerFetch=null,this.AVGetInterval&&clearInterval(this.AVGetInterval),this.AVGetInterval=null,this._removeBindFuncPtr(),Module.cwrap("releaseHttpFLV","number",["number"])(this.AVSniffPtr),this.playInterval&&clearInterval(this.playInterval),this.playInterval=null,this.audioWAudio&&this.audioWAudio.stop(),this.audioWAudio=null,this.CanvasObj&&this.CanvasObj.remove(),this.CanvasObj=null,0}},{key:"isPlayingState",value:function(){return null!==this.playInterval&&void 0!==this.playInterval}},{key:"pause",value:function(){this.audioWAudio&&this.audioWAudio.pause(),this.playInterval&&clearInterval(this.playInterval),this.playInterval=null}},{key:"playYUV",value:function(){if(this.YuvBuf.length>0){var e=this.YuvBuf.shift();return r.renderFrame(this.AVGLObj,e.bufY,e.bufU,e.bufV,e.line_y,e.h),!0}return!1}},{key:"play",value:function(){var e=this,t=this;if(!1===this.checkCacheState())return this.onLoadCache&&this.onLoadCache(),setTimeout((function(){e.play()}),100),!1;if(void 0===this.playInterval||null===this.playInterval){var i=0,n=0,s=0;!1===this.mediaInfo.audioNone&&this.audioWAudio&&!1===this.mediaInfo.noFPS?(this.playInterval=setInterval((function(){if(n=a.GetMsTime(),t.cache_status){if(n-i>=t.frameTime-s){var e=t.YuvBuf.shift();if(null!=e&&null!==e){var o=0;null!==t.audioWAudio&&void 0!==t.audioWAudio&&(o=1e3*(e.pts-t.audioWAudio.getAlignVPTS())),s=t.audioWAudio?o<0&&-1*o<=t.frameTime||o>=0?a.GetMsTime()-n+1:t.frameTime:a.GetMsTime()-n+1,r.renderFrame(t.AVGLObj,e.bufY,e.bufU,e.bufV,e.line_y,e.h)}(t.YuvBuf.length<=0||t.audioWAudio&&t.audioWAudio.sampleQueue.length<=0)&&(t.cache_status=!1,t.onLoadCache&&t.onLoadCache(),t.audioWAudio&&t.audioWAudio.pause()),i=n}}else s=t.frameTime}),1),this.audioWAudio&&this.audioWAudio.play()):this.playInterval=setInterval((function(){var e=t.YuvBuf.shift();null!=e&&null!==e&&r.renderFrame(t.AVGLObj,e.bufY,e.bufU,e.bufV,e.line_y,e.h),t.YuvBuf.length<=0&&(t.cache_status=!1)}),t.frameTime)}}},{key:"start",value:function(e){var t,i,n,a=this;this.workerFetch=new Worker((t=function(){var e=null;self,self.onmessage=function(t){var i=t.data;switch(void 0===i.cmd||null===i.cmd?"":i.cmd){case"start":var n=i.data;(e=new WebSocket(n)).binaryType="arraybuffer",e.onopen=function(t){e.send("Hello WebSockets!")},e.onmessage=function(e){if(e.data instanceof ArrayBuffer){var t=e.data;t.byteLength>0&&postMessage({cmd:"fetch-chunk",data:new Uint8Array(t),msg:"fetch-chunk"})}},e.onclose=function(e){};break;case"stop":e&&e.close(),self.close(),self.postMessage({cmd:"close",data:"close",msg:"close"})}}}.toString(),i=t.match(/^\s*function\s*\(\s*\)\s*\{(([\s\S](?!\}$))*[\s\S])/),n=[i[1]],window.URL.createObjectURL(new Blob(n,{type:"text/javascript"})))),this.workerFetch.onmessage=function(e){a._workerFetch_onmessage(e,a)},this.workerFetch,this.AVSniffPtr=Module.cwrap("AVSniffHttpFlvInit","number",["string","string"])("base64:QXV0aG9yOmNoYW5neWFubG9uZ3xudW1iZXJ3b2xmLEdpdGh1YjpodHRwczovL2dpdGh1Yi5jb20vbnVtYmVyd29sZixFbWFpbDpwb3JzY2hlZ3QyM0Bmb3htYWlsLmNvbSxRUTo1MzEzNjU4NzIsSG9tZVBhZ2U6aHR0cDovL3h2aWRlby52aWRlbyxEaXNjb3JkOm51bWJlcndvbGYjODY5NCx3ZWNoYXI6bnVtYmVyd29sZjExLEJlaWppbmcsV29ya0luOkJhaWR1","0.0.0"),this.AVSniffPtr,this._ptr_probeCallback=Module.addFunction(this._callbackProbe.bind(this)),this._ptr_yuvCallback=Module.addFunction(this._callbackYUV.bind(this)),this._ptr_naluCallback=Module.addFunction(this._callbackNALU.bind(this)),this._ptr_sampleCallback=Module.addFunction(this._callbackPCM.bind(this)),this._ptr_aacCallback=Module.addFunction(this._callbackAAC.bind(this)),Module.cwrap("initializeSniffHttpFlvModule","number",["number","number","number","number","number","number"])(this.AVSniffPtr,this._ptr_probeCallback,this._ptr_yuvCallback,this._ptr_naluCallback,this._ptr_sampleCallback,this._ptr_aacCallback),this.AVGLObj=r.setupCanvas(this.CanvasObj,{preserveDrawingBuffer:!1}),this.workerFetch.postMessage({cmd:"start",data:e,msg:"start"}),this._decode()}}])&&n(t.prototype,i),u&&n(t,u),e}();i.CWsLiveCore=u},{"../consts":52,"../demuxer/buffer":64,"../demuxer/bufferFrame":65,"../render-engine/webgl-420p":77,"../version":80,"./audio-core":53,"./audio-native-core":54,"./av-common":55,"./cache":59,"./cacheYuv":60}],59:[function(e,t,i){(function(i){"use strict";e("./cacheYuv");i.CACHE_APPEND_STATUS_CODE={FAILED:-1,OVERFLOW:-2,OK:0,NOT_FULL:1,FULL:2,NULL:3},t.exports=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:60,t={limit:e,yuvCache:[],appendCacheByCacheYuv:function(e){e.pts;return t.yuvCache.length>=t.limit?CACHE_APPEND_STATUS_CODE.OVERFLOW:(t.yuvCache.push(e),t.yuvCache.length>=t.limit?CACHE_APPEND_STATUS_CODE.FULL:CACHE_APPEND_STATUS_CODE.NOT_FULL)},getState:function(){return t.yuvCache.length<=0?CACHE_APPEND_STATUS_CODE.NULL:t.yuvCache.length>=t.limit?CACHE_APPEND_STATUS_CODE.FULL:CACHE_APPEND_STATUS_CODE.NOT_FULL},cleanPipeline:function(){t.yuvCache.length=0},vYuv:function(){return t.yuvCache.length<=0?null:t.yuvCache.shift()}};return t}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./cacheYuv":60}],60:[function(e,t,i){"use strict";function n(e,t){for(var i=0;i>1;return r.indexOf(t)},GET_NALU_TYPE:function(e){var t=(126&e)>>1;if(t>=1&&t<=9)return n.DEFINE_P_FRAME;if(t>=16&&t<=21)return n.DEFINE_KEY_FRAME;var i=r.indexOf(t);return i>=0?r[i]:n.DEFINE_OTHERS_FRAME},PACK_NALU:function(e){var t=e.nalu,i=e.vlc.vlc;null==t.vps&&(t.vps=new Uint8Array);var n=new Uint8Array(t.vps.length+t.sps.length+t.pps.length+t.sei.length+i.length);return n.set(t.vps,0),n.set(t.sps,t.vps.length),n.set(t.pps,t.vps.length+t.sps.length),n.set(t.sei,t.vps.length+t.sps.length+t.pps.length),n.set(i,t.vps.length+t.sps.length+t.pps.length+t.sei.length),n}}},{"./hevc-header":61}],63:[function(e,t,i){"use strict";function n(e){return function(e){if(Array.isArray(e)){for(var t=0,i=new Array(e.length);t0&&void 0!==arguments[0]&&arguments[0];null!=t&&(t.showScreen=e,t.canvas&&(e?t.canvas.setAttribute("hidden",!0):t.canvas.removeAttribute("hidden")))},setSize:function(e,i){t.config.width=e||l.DEFAULT_WIDTH,t.config.height=i||l.DEFAULT_HEIGHT},setFrameRate:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:25;t.config.fps=e,t.config.frameDurMs=1e3/e},setDurationMs:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1;t.durationMs=e,0==t.config.audioNone&&t.audio.setDurationMs(e)},setPlayingCall:function(e){t.onPlayingTime=e},setVoice:function(e){t.realVolume=e,0==t.config.audioNone&&t.audio.setVoice(t.realVolume)},isPlayingState:function(){return t.isPlaying||t.isCaching===l.CACHE_WITH_PLAY_SIGN},appendAACFrame:function(e){t.audio.addSample(e),t.aCachePTS=Math.max(e.pts,t.aCachePTS)},appendHevcFrame:function(e){var i;t.config.appendHevcType==l.APPEND_TYPE_STREAM?t.stream=new Uint8Array((i=n(t.stream)).concat.apply(i,n(e))):t.config.appendHevcType==l.APPEND_TYPE_FRAME&&(t.frameList.push(e),t.vCachePTS=Math.max(e.pts,t.vCachePTS))},getCachePTS:function(){return Math.max(t.vCachePTS,t.aCachePTS)},endAudio:function(){0==t.config.audioNone&&t.audio.stop()},cleanSample:function(){0==t.config.audioNone&&t.audio.cleanQueue()},cleanVideoQueue:function(){t.config.appendHevcType==l.APPEND_TYPE_STREAM?t.stream=new Uint8Array:t.config.appendHevcType==l.APPEND_TYPE_FRAME&&(t.frameList=[],t.frameList.length=0)},cleanCacheYUV:function(){t.cacheYuvBuf.cleanPipeline()},pause:function(){t.loop&&window.clearInterval(t.loop),t.loop=null,0==t.config.audioNone&&t.audio.pause(),t.isPlaying=!1,t.isCaching===l.CACHE_WITH_PLAY_SIGN&&(t.isCaching=l.CACHE_WITH_NOPLAY_SIGN)},checkFinished:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:l.PLAYER_MODE_VOD;return e==l.PLAYER_MODE_VOD&&t.cacheYuvBuf.yuvCache.length<=0&&(t.videoPTS.toFixed(1)>=(t.durationMs-t.config.frameDurMs)/1e3||t.noCacheFrame>=10)&&(null!=t.onPlayingFinish&&(l.PLAYER_MODE_VOD,t.frameList.length,t.cacheYuvBuf.yuvCache.length,t.videoPTS.toFixed(1),t.durationMs,t.config.frameDurMs,t.noCacheFrame,t.onPlayingFinish()),!0)},clearAllCache:function(){t.nowPacket=null,t.vCachePTS=0,t.aCachePTS=0,t.cleanSample(),t.cleanVideoQueue(),t.cleanCacheYUV()},seek:function(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.isPlaying;t.pause(),t.stopCacheThread(),t.clearAllCache(),e&&e(),t.isNewSeek=!0,t.flushDecoder=1,t.videoPTS=parseInt(i.seekTime);var r={seekPos:i.seekTime||-1,mode:i.mode||l.PLAYER_MODE_VOD,accurateSeek:i.accurateSeek||!0,seekEvent:i.seekEvent||!0,realPlay:n};t.cacheThread(),t.play(r)},getNalu1Packet:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],i=null,n=-1;if(t.config.appendHevcType==l.APPEND_TYPE_STREAM)i=t.nextNalu();else{if(t.config.appendHevcType!=l.APPEND_TYPE_FRAME)return null;var r=t.frameList.shift();if(!r)return null;i=r.data,n=r.pts,e&&(t.videoPTS=n)}return{nalBuf:i,pts:n}},decodeNalu1Frame:function(e,i){var n=Module._malloc(e.length);Module.HEAP8.set(e,n);var r=parseInt(1e3*i);Module.cwrap("decodeCodecContext","number",["number","number","number","number","number"])(t.vcodecerPtr,n,e.length,r,t.flushDecoder);return t.flushDecoder=0,Module._free(n),!1},cacheThread:function(){t.cacheLoop=window.setInterval((function(){if(t.cacheYuvBuf.getState()!=CACHE_APPEND_STATUS_CODE.FULL){var e=t.getNalu1Packet(!1);if(null!=e){var i=e.nalBuf,n=e.pts;t.decodeNalu1Frame(i,n,!0)}}}),10)},stopCacheThread:function(){null!==t.cacheLoop&&(window.clearInterval(t.cacheLoop),t.cacheLoop=null)},loadCache:function(){if(!(t.frameList.length<=3)){var e=t.isPlaying;if(t.cacheYuvBuf.yuvCache.length<=3){t.pause(),null!=t.onLoadCache&&t.onLoadCache(),t.isCaching=e?l.CACHE_WITH_PLAY_SIGN:l.CACHE_WITH_NOPLAY_SIGN;var i=t.frameList.length>30?30:t.frameList.length;null===t.cacheInterval&&(t.cacheInterval=window.setInterval((function(){t.cacheYuvBuf.yuvCache.length>=i&&(null!=t.onLoadCacheFinshed&&t.onLoadCacheFinshed(),window.clearInterval(t.cacheInterval),t.cacheInterval=null,t.isCaching===l.CACHE_WITH_PLAY_SIGN&&t.play(t.playParams),t.isCaching=l.CACHE_NO_LOADCACHE)}),40))}}},playFunc:function(){var e=!1;if(t.playParams.seekEvent||r.GetMsTime()-t.calcuteStartTime>=t.frameTime-t.preCostTime){e=!0;var i=!0;if(t.calcuteStartTime=r.GetMsTime(),t.config.audioNone)t.playFrameYUV(i,t.playParams.accurateSeek);else{t.fix_poc_err_skip>0&&(t.fix_poc_err_skip--,i=!1);var n=t.videoPTS-t.audio.getAlignVPTS();if(n>0)return void(t.playParams.seekEvent&&!t.config.audioNone&&t.audio.setVoice(0));if(i){if(!(i=-1*n<=1*t.frameTimeSec)){for(var a=parseInt(n/t.frameTimeSec),s=0;s=i&&(t.playFrameYUV(!0,t.playParams.accurateSeek),i+=1)}),1)}else t.videoPTS>=t.playParams.seekPos&&!t.isNewSeek||0===t.playParams.seekPos||0===t.playParams.seekPos?(t.frameTime=1e3/t.config.fps,t.frameTimeSec=t.frameTime/1e3,0==t.config.audioNone&&t.audio.play(),t.realVolume=t.config.audioNone?0:t.audio.voice,t.playParams.seekEvent&&(t.fix_poc_err_skip=10),t.loop=window.setInterval((function(){var e=r.GetMsTime();t.playFunc(),t.preCostTime=r.GetMsTime()-e}),1)):(t.loop=window.setInterval((function(){t.playFrameYUV(!1,t.playParams.accurateSeek),t.checkFinished(t.playParams.mode)?(window.clearInterval(t.loop),t.loop=null):t.videoPTS>=t.playParams.seekPos&&(window.clearInterval(t.loop),t.loop=null,t.play(t.playParams))}),1),t.isNewSeek=!1)},stop:function(){t.release(),Module.cwrap("initializeDecoder","number",["number"])(t.vcodecerPtr),t.stream=new Uint8Array},release:function(){return t.endAudio(),t.cacheLoop&&window.clearInterval(t.cacheLoop),t.cacheLoop=null,t.loop&&window.clearInterval(t.loop),t.loop=null,t.pause(),null!==t.videoCallback&&Module.removeFunction(t.videoCallback),t.videoCallback=null,Module.cwrap("release","number",["number"])(t.vcodecerPtr),t.stream=null,t.frameList.length=0,t.durationMs=-1,t.videoPTS=0,t.isPlaying=!1,!0},nextNalu:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;if(t.stream.length<=4)return!1;for(var i=-1,n=0;n=t.stream.length){if(-1==i)return!1;var r=t.stream.subarray(i);return t.stream=new Uint8Array,r}var a="0 0 1"==t.stream.slice(0,3).join(" "),s="0 0 0 1"==t.stream.slice(0,4).join(" ");if(a||s){if(-1==i)i=n;else{if(e<=1){var o=t.stream.subarray(i,n);return t.stream=t.stream.subarray(n),o}e-=1}n+=3}}return!1},decodeSendPacket:function(e){var i=Module._malloc(e.length);Module.HEAP8.set(e,i);var n=Module.cwrap("decodeSendPacket","number",["number","number","number"])(t.vcodecerPtr,i,e.length);return Module._free(i),n},decodeRecvFrame:function(){return Module.cwrap("decodeRecv","number",["number"])(t.vcodecerPtr)},playFrameYUV:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],i=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=t.cacheYuvBuf.vYuv();if(null==n)return t.noCacheFrame+=1,e&&!t.playParams.seekEvent&&t.loadCache(),!1;t.noCacheFrame=0;var r=n.pts;return t.videoPTS=r,(!e&&i||e)&&e&&t.drawImage(n.width,n.height,n.imageBufferY,n.imageBufferB,n.imageBufferR),e&&!t.playParams.seekEvent&&t.isPlaying&&t.loadCache(),!0},drawImage:function(e,i,n,r,a){if(t.canvas.width===e&&t.canvas.height==i||(t.canvas.width=e,t.canvas.height=i),t.showScreen&&null!=t.onRender)t.onRender(e,i,n,r,a);else{if(!t.isCheckDisplay)t.checkDisplaySize(e,i);var s=e*i,o=e/2*(i/2),l=new Uint8Array(s+2*o);l.set(n,0),l.set(r,s),l.set(a,s+o),u.renderFrame(t.yuv,n,r,a,e,i)}},debugYUV:function(e){t.debugYUVSwitch=!0,t.debugID=e},checkDisplaySize:function(e,i){var n=e/t.config.width>i/t.config.height,r=(t.config.width/e).toFixed(2),a=(t.config.height/i).toFixed(2),s=n?r:a,o=t.config.fixed,u=o?t.config.width:parseInt(e*s),l=o?t.config.height:parseInt(i*s);if(t.canvas.offsetWidth!=u||t.canvas.offsetHeight!=l){var d=parseInt((t.canvasBox.offsetHeight-l)/2),h=parseInt((t.canvasBox.offsetWidth-u)/2);t.canvas.style.marginTop=d+"px",t.canvas.style.marginLeft=h+"px",t.canvas.style.width=u+"px",t.canvas.style.height=l+"px"}return t.isCheckDisplay=!0,[u,l]},makeWasm:function(){if(null!=t.config.token){t.vcodecerPtr=Module.cwrap("registerPlayer","number",["string","string"])(t.config.token,d.PLAYER_VERSION),t.videoCallback=Module.addFunction((function(e,i,n,r,a,s,u,l,d){var h=Module.HEAPU8.subarray(e,e+r*l),c=Module.HEAPU8.subarray(i,i+a*l/2),f=Module.HEAPU8.subarray(n,n+s*l/2),p=new Uint8Array(h),m=new Uint8Array(c),g=new Uint8Array(f),_=1*d/1e3,y=new o.CacheYuvStruct(_,r,l,p,m,g);t.cacheYuvBuf.appendCacheByCacheYuv(y)})),Module.cwrap("setCodecType","number",["number","number","number"])(t.vcodecerPtr,t.config.videoCodec,t.videoCallback);Module.cwrap("initMissile","number",["number"])(t.vcodecerPtr);Module.cwrap("initializeDecoder","number",["number"])(t.vcodecerPtr)}},makeIt:function(){var e=document.querySelector("div#"+t.config.playerId),i=document.createElement("canvas");i.style.width=e.clientWidth+"px",i.style.height=e.clientHeight+"px",i.style.top="0px",i.style.left="0px",e.appendChild(i),t.canvasBox=e,t.canvas=i,t.yuv=u.setupCanvas(i,{preserveDrawingBuffer:!1}),0==t.config.audioNone&&(t.audio=a({sampleRate:t.config.sampleRate,appendType:t.config.appendHevcType})),t.isPlayLoadingFinish=1}};return t.makeWasm(),t.makeIt(),t.cacheThread(),t}},{"../consts":52,"../render-engine/webgl-420p":77,"../version":80,"./audio-core":53,"./av-common":55,"./cache":59,"./cacheYuv":60}],64:[function(e,t,i){"use strict";var n=e("./bufferFrame");t.exports=function(){var e={videoBuffer:[],audioBuffer:[],idrIdxBuffer:[],appendFrame:function(t,i){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],s=new n.BufferFrame(t,a,i,r),o=parseInt(t);return r?(e.videoBuffer.length-1>=o?e.videoBuffer[o].push(s):e.videoBuffer.push([s]),a&&!e.idrIdxBuffer.includes(t)&&e.idrIdxBuffer.push(t)):e.audioBuffer.length-1>=o&&null!=e.audioBuffer[o]&&null!=e.audioBuffer[o]?e.audioBuffer[o]&&e.audioBuffer[o].push(s):e.audioBuffer.push([s]),!0},appendFrameWithDts:function(t,i,r){var a=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],s=arguments.length>4&&void 0!==arguments[4]&&arguments[4],o=n.ConstructWithDts(t,i,s,r,a),u=parseInt(i);return a?(e.videoBuffer.length-1>=u?e.videoBuffer[u].push(o):e.videoBuffer.push([o]),s&&!e.idrIdxBuffer.includes(i)&&e.idrIdxBuffer.push(i)):e.audioBuffer.length-1>=u&&null!=e.audioBuffer[u]&&null!=e.audioBuffer[u]?e.audioBuffer[u]&&e.audioBuffer[u].push(o):e.audioBuffer.push([o]),!0},appendFrameByBufferFrame:function(t){var i=t.pts,n=parseInt(i);return t.video?(e.videoBuffer.length-1>=n?e.videoBuffer[n].push(t):e.videoBuffer.push([t]),isKey&&!e.idrIdxBuffer.includes(i)&&e.idrIdxBuffer.push(i)):e.audioBuffer.length-1>=n?e.audioBuffer[n].push(t):e.audioBuffer.push([t]),!0},cleanPipeline:function(){e.videoBuffer.length=0,e.audioBuffer.length=0},vFrame:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1;if(!(t<0||t>e.videoBuffer.length-1))return e.videoBuffer[t]},aFrame:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1;if(!(t<0||t>e.audioBuffer.length-1))return e.audioBuffer[t]},seekIDR:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1;if(e.idrIdxBuffer,e.videoBuffer,t<0)return null;if(e.idrIdxBuffer.includes(t))return t;for(var i=0;it||0===i&&e.idrIdxBuffer[i]>=t){for(var n=1;n>=0;n--){var r=i-n;if(r>=0)return e.idrIdxBuffer[r],e.idrIdxBuffer[r]}return e.idrIdxBuffer[i],j,e.idrIdxBuffer[i]}}};return e}},{"./bufferFrame":65}],65:[function(e,t,i){"use strict";function n(e,t){for(var i=0;i0&&i.extensionInfo.vHeight>0&&(i.size.width=i.extensionInfo.vWidth,i.size.height=i.extensionInfo.vHeight)),i.mediaInfo.duration,null!=i.onDemuxed&&i.onDemuxed(i.onReadyOBJ);for(var e=!1;void 0!==i.mpegTsObj&&null!==i.mpegTsObj;){var n=i.mpegTsObj.readPacket();if(n.size<=0)break;var r=n.dtime>0?n.dtime:n.ptime;if(!(r<0)){if(0==n.type){r<=i.vPreFramePTS&&(e=!0);var a=u.PACK_NALU(n.layer),o=1==n.keyframe,l=1==e?r+i.vStartTime:r,d=new s.BufferFrame(l,o,a,!0);i.bufObject.appendFrame(d.pts,d.data,!0,d.isKey),i.vPreFramePTS=l,null!=i.onSamples&&i.onSamples(i.onReadyOBJ,d)}else if(r<=i.aPreFramePTS&&(e=!0),"aac"==i.mediaInfo.aCodec)for(var h=n.data,c=0;c=3?(i._onTsReady(e),window.clearInterval(i.timerTsWasm),i.timerTsWasm=null):(i.mpegTsWasmRetryLoadTimes+=1,i.mpegTsObj.initDemuxer())}),3e3)}},{key:"_onTsReady",value:function(e){var t=this;t.hls.fetchM3u8(e),t.mpegTsWasmState=!0,t.timerFeed=window.setInterval((function(){if(t.tsList.length>0&&0==t.lockWait.state)try{var e=t.tsList.shift();if(null!=e){var i=e.streamURI,n=e.streamDur;t.lockWait.state=!0,t.lockWait.lockMember.dur=n,t.mpegTsObj.isLive=t.hls.isLive(),t.mpegTsObj.demuxURL(i)}else console.error("_onTsReady need wait ")}catch(e){console.error("onTsReady ERROR:",e),t.lockWait.state=!1}}),50)}},{key:"release",value:function(){this.hls&&this.hls.release(),this.hls=null,this.timerFeed&&window.clearInterval(this.timerFeed),this.timerFeed=null,this.timerTsWasm&&window.clearInterval(this.timerTsWasm),this.timerTsWasm=null}},{key:"bindReady",value:function(e){this.onReadyOBJ=e}},{key:"popBuffer",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;return t<0?null:1===e?t+1>this.bufObject.videoBuffer.length?null:this.bufObject.vFrame(t):2===e?t+1>this.bufObject.audioBuffer.length?null:this.bufObject.aFrame(t):void 0}},{key:"getVLen",value:function(){return this.bufObject.videoBuffer.length}},{key:"getALen",value:function(){return this.bufObject.audioBuffer.length}},{key:"getLastIdx",value:function(){return this.bufObject.videoBuffer.length-1}},{key:"getALastIdx",value:function(){return this.bufObject.audioBuffer.length-1}},{key:"getACodec",value:function(){return this.aCodec}},{key:"getVCodec",value:function(){return this.vCodec}},{key:"getDurationMs",value:function(){return this.durationMs}},{key:"getFPS",value:function(){return this.fps}},{key:"getSampleRate",value:function(){return this.sampleRate}},{key:"getSampleChannel",value:function(){return this.aChannel}},{key:"getSize",value:function(){return this.size}},{key:"seek",value:function(e){if(e>=0){var t=this.bufObject.seekIDR(e);this.seekPos=t}}}])&&n(t.prototype,i),d&&n(t,d),e}();i.M3u8=d},{"../consts":52,"../decoder/hevc-imp":62,"./buffer":64,"./bufferFrame":65,"./m3u8base":67,"./mpegts/mpeg.js":71}],67:[function(e,t,i){"use strict";function n(e,t){for(var i=0;i ",t),setTimeout((function(){i.fetchM3u8(e)}),500)}))}},{key:"_uriParse",value:function(e){this._preURI="";var t=e.split("//"),i=null,n=null;if(t.length<1)return!1;t.length>1?(i=t[0],n=t[1].split("/"),this._preURI=i+"//"):n=t[0].split("/");for(var r=0;rp&&(o=p);var m=n[l+=1],g=null;g=m.indexOf("http")>=0?m:this._preURI+m,this._slices.indexOf(g)<0&&(this._slices.push(g),this._slices[this._slices.length-1],null!=this.onTransportStream&&this.onTransportStream(g,p))}}}if(this._slices.length>s.hlsSliceLimit&&this._type==r.PLAYER_IN_TYPE_M3U8_LIVE&&(this._slices=this._slices.slice(-1*s.hlsSliceLimit)),null!=this.onFinished){var _={type:this._type,duration:-1};this.onFinished(_)}return o}},{key:"_readTag",value:function(e){var t=s.tagParse.exec(e);return null!==t?{key:t[1],value:t[3]}:null}}])&&n(t.prototype,i),o&&n(t,o),e}();i.M3u8Base=o},{"../consts":52}],68:[function(e,t,i){"use strict";var n=e("mp4box"),r=e("../decoder/hevc-header"),a=e("../decoder/hevc-imp"),s=e("./buffer"),o=e("../consts"),u={96e3:0,88200:1,64e3:2,48e3:3,44100:4,32e3:5,24e3:6,22050:7,16e3:8,12e3:9,11025:10,8e3:11,7350:12,Reserved:13,"frequency is written explictly":15},l=function(e){for(var t=[],i=0;i1&&void 0!==arguments[1]&&arguments[1],i=null;return t?((i=e)[0]=r.DEFINE_STARTCODE[0],i[1]=r.DEFINE_STARTCODE[1],i[2]=r.DEFINE_STARTCODE[2],i[3]=r.DEFINE_STARTCODE[3]):((i=new Uint8Array(r.DEFINE_STARTCODE.length+e.length)).set(r.DEFINE_STARTCODE,0),i.set(e,r.DEFINE_STARTCODE.length)),i},d.prototype.setAACAdts=function(e){var t=null,i=this.aacProfile,n=u[this.sampleRate],r=new Uint8Array(7),a=r.length+e.length;return r[0]=255,r[1]=241,r[2]=(i-1<<6)+(n<<2)+0,r[3]=128+(a>>11),r[4]=(2047&a)>>3,r[5]=31+((7&a)<<5),r[6]=252,(t=new Uint8Array(a)).set(r,0),t.set(e,r.length),t},d.prototype.demux=function(){var e=this;e.seekPos=-1,e.mp4boxfile=n.createFile(),e.movieInfo=null,e.videoCodec=null,e.durationMs=-1,e.fps=-1,e.sampleRate=-1,e.aacProfile=2,e.size={width:-1,height:-1},e.bufObject=s(),e.audioNone=!1,e.naluHeader={vps:null,sps:null,pps:null,sei:null},e.mp4boxfile.onError=function(e){},this.mp4boxfile.onReady=function(t){for(var i in e.movieInfo=t,t.tracks)"VideoHandler"!==t.tracks[i].name&&"video"!==t.tracks[i].type||(t.tracks[i].codec,t.tracks[i].codec.indexOf("hev")>=0||t.tracks[i].codec.indexOf("hvc")>=0?e.videoCodec=o.CODEC_H265:t.tracks[i].codec.indexOf("avc")>=0&&(e.videoCodec=o.CODEC_H264));var n=-1;if(n=t.videoTracks[0].samples_duration/t.videoTracks[0].timescale,e.durationMs=1e3*n,e.fps=t.videoTracks[0].nb_samples/n,e.seekDiffTime=1/e.fps,e.size.width=t.videoTracks[0].track_width,e.size.height=t.videoTracks[0].track_height,t.audioTracks.length>0){e.sampleRate=t.audioTracks[0].audio.sample_rate;var r=t.audioTracks[0].codec.split(".");e.aacProfile=r[r.length-1]}else e.audioNone=!0;null!=e.onMp4BoxReady&&e.onMp4BoxReady(e.videoCodec),e.videoCodec===o.CODEC_H265?(e.initializeAllSourceBuffers(),e.mp4boxfile.start()):(e.videoCodec,o.CODEC_H264)},e.mp4boxfile.onSamples=function(t,i,n){var s=window.setInterval((function(){for(var i=0;i3?e.naluHeader.sei=e.setStartCode(g[3][0].data,!1):e.naluHeader.sei=new Uint8Array,e.naluHeader}else e.videoCodec==o.CODEC_H264&&(e.naluHeader.vps=new Uint8Array,e.naluHeader.sps=e.setStartCode(f.SPS[0].nalu,!1),e.naluHeader.pps=e.setStartCode(f.PPS[0].nalu,!1),e.naluHeader.sei=new Uint8Array);d[4].toString(16),e.naluHeader.vps[4].toString(16),l(e.naluHeader.vps),l(d);var _=e.setStartCode(d.subarray(0,e.naluHeader.vps.length),!0);if(l(_),d[4]===e.naluHeader.vps[4]){var y=e.naluHeader.vps.length+4,v=e.naluHeader.vps.length+e.naluHeader.sps.length+4,b=e.naluHeader.vps.length+e.naluHeader.sps.length+e.naluHeader.pps.length+4;if(e.naluHeader.sei.length<=0&&e.naluHeader.sps.length>0&&d[y]===e.naluHeader.sps[4]&&e.naluHeader.pps.length>0&&d[v]===e.naluHeader.pps[4]&&78===d[b]){d[e.naluHeader.vps.length+4],e.naluHeader.sps[4],d[e.naluHeader.vps.length+e.naluHeader.sps.length+4],e.naluHeader.pps[4],d[e.naluHeader.vps.length+e.naluHeader.sps.length+e.naluHeader.pps.length+4];for(var T=0,S=0;S4&&d[4]===e.naluHeader.sei[4]){var E=d.subarray(0,10),w=new Uint8Array(e.naluHeader.vps.length+E.length);w.set(E,0),w.set(e.naluHeader.vps,E.length),w[3]=1,e.naluHeader.vps=null,e.naluHeader.vps=new Uint8Array(w),w=null,E=null,(d=d.subarray(10))[4],e.naluHeader.vps[4],e.naluHeader.vps}else if(0===e.naluHeader.sei.length&&78===d[4]){d=e.setStartCode(d,!0);for(var C=0,A=0;A1&&void 0!==arguments[1]?arguments[1]:0;return e.fileStart=t,this.mp4boxfile.appendBuffer(e)},d.prototype.finishBuffer=function(){this.mp4boxfile.flush()},d.prototype.play=function(){},d.prototype.getVideoCoder=function(){return this.videoCodec},d.prototype.getDurationMs=function(){return this.durationMs},d.prototype.getFPS=function(){return this.fps},d.prototype.getSampleRate=function(){return this.sampleRate},d.prototype.getSize=function(){return this.size},d.prototype.seek=function(e){if(e>=0){var t=this.bufObject.seekIDR(e);this.seekPos=t}},d.prototype.popBuffer=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;return t<0?null:1==e?this.bufObject.vFrame(t):2==e?this.bufObject.aFrame(t):void 0},d.prototype.addBuffer=function(e){var t=e.id;this.mp4boxfile.setExtractionOptions(t)},d.prototype.initializeAllSourceBuffers=function(){if(this.movieInfo){for(var e=this.movieInfo,t=0;t>5)}},{key:"sliceAACFrames",value:function(e,t){for(var i=[],n=e,r=0;r>4==15){var a=this._getPktLen(t[r+3],t[r+4],t[r+5]);if(a<=0)continue;var s=t.subarray(r,r+a),o=new Uint8Array(a);o.set(s,0),i.push({ptime:n,data:o}),n+=this.frameDurSec,r+=a}else r+=1;return i}}])&&n(t.prototype,i),r&&n(t,r),e}();i.AACDecoder=r},{}],71:[function(e,t,i){(function(t){"use strict";function n(e,t){for(var i=0;i ",e),n=null})).catch((function(i){console.error("demuxerTsInit ERROR fetch ERROR ==> ",i),t._releaseOffset(),t.onDemuxedFailed&&t.onDemuxedFailed(i,e)}))}},{key:"_releaseOffset",value:function(){void 0!==this.offsetDemux&&null!==this.offsetDemux&&(Module._free(this.offsetDemux),this.offsetDemux=null)}},{key:"_demuxCore",value:function(e){if(this._releaseOffset(),this._refreshDemuxer(),!(e.length<=0)){this.offsetDemux=Module._malloc(e.length),Module.HEAP8.set(e,this.offsetDemux);var t=Module.cwrap("demuxBox","number",["number","number","number"])(this.offsetDemux,e.length,this.isLive);Module._free(this.offsetDemux),this.offsetDemux=null,t>=0&&(this._setMediaInfo(),this._setExtensionInfo(),null!=this.onDemuxed&&this.onDemuxed())}}},{key:"_setMediaInfo",value:function(){var e=Module.cwrap("getMediaInfo","number",[])(),t=Module.HEAPU32[e/4],i=Module.HEAPU32[e/4+1],n=Module.HEAPF64[e/8+1],s=Module.HEAPF64[e/8+1+1],o=Module.HEAPF64[e/8+1+1+1],u=Module.HEAPF64[e/8+1+1+1+1],l=Module.HEAPU32[e/4+2+2+2+2+2];this.mediaAttr.vFps=n,this.mediaAttr.vGop=l,this.mediaAttr.vDuration=s,this.mediaAttr.aDuration=o,this.mediaAttr.duration=u;var d=Module.cwrap("getAudioCodecID","number",[])();d>=0?(this.mediaAttr.aCodec=a.CODEC_OFFSET_TABLE[d],this.mediaAttr.sampleRate=t>0?t:a.DEFAULT_SAMPLERATE,this.mediaAttr.sampleChannel=i>=0?i:a.DEFAULT_CHANNEL):(this.mediaAttr.sampleRate=0,this.mediaAttr.sampleChannel=0,this.mediaAttr.audioNone=!0);var h=Module.cwrap("getVideoCodecID","number",[])();h>=0&&(this.mediaAttr.vCodec=a.CODEC_OFFSET_TABLE[h]),null==this.aacDec?this.aacDec=new r.AACDecoder(this.mediaAttr):this.aacDec.updateConfig(this.mediaAttr)}},{key:"_setExtensionInfo",value:function(){var e=Module.cwrap("getExtensionInfo","number",[])(),t=Module.HEAPU32[e/4],i=Module.HEAPU32[e/4+1];this.extensionInfo.vWidth=t,this.extensionInfo.vHeight=i}},{key:"readMediaInfo",value:function(){return this.mediaAttr}},{key:"readExtensionInfo",value:function(){return this.extensionInfo}},{key:"readAudioNone",value:function(){return this.mediaAttr.audioNone}},{key:"_readLayer",value:function(){var e={vps:null,sps:null,pps:null,sei:null},t={vlc:null},i=Module.cwrap("getSPSLen","number",[])(),n=Module.cwrap("getSPS","number",[])();if(!(i<0)){e.sps=new Uint8Array(i),e.sps.set(Module.HEAPU8.subarray(n,n+i),0);var r=Module.cwrap("getPPSLen","number",[])(),s=Module.cwrap("getPPS","number",[])();e.pps=new Uint8Array(r),e.pps.set(Module.HEAPU8.subarray(s,s+r),0);var o=Module.cwrap("getSEILen","number",[])(),u=Module.cwrap("getSEI","number",[])();e.sei=new Uint8Array(o),e.sei.set(Module.HEAPU8.subarray(u,u+o),0);var l=Module.cwrap("getVLCLen","number",[])(),d=Module.cwrap("getVLC","number",[])();if(t.vlc=new Uint8Array(l),t.vlc.set(Module.HEAPU8.subarray(d,d+l),0),this.mediaAttr.vCodec==a.DEF_HEVC||this.mediaAttr.vCodec==a.DEF_H265){var h=Module.cwrap("getVPSLen","number",[])(),c=Module.cwrap("getVPS","number",[])();e.vps=new Uint8Array(h),e.vps.set(Module.HEAPU8.subarray(c,c+h),0)}else this.mediaAttr.vCodec==a.DEF_AVC||(this.mediaAttr.vCodec,a.DEF_H264);return{nalu:e,vlc:t}}}},{key:"isHEVC",value:function(){return this.mediaAttr.vCodec==a.DEF_HEVC||this.mediaAttr.vCodec==a.DEF_H265}},{key:"readPacket",value:function(){var e=Module.cwrap("getPacket","number",[])(),t=Module.HEAPU32[e/4],i=Module.HEAPU32[e/4+1],n=Module.HEAPF64[e/8+1],r=Module.HEAPF64[e/8+1+1],s=Module.HEAPU32[e/4+1+1+2+2],o=Module.HEAPU32[e/4+1+1+2+2+1],u=Module.HEAPU8.subarray(o,o+i),l=this._readLayer();return{type:t,size:i,ptime:n,dtime:r,keyframe:s,src:u,data:1==t&&this.mediaAttr.aCodec==a.DEF_AAC?this.aacDec.sliceAACFrames(n,u):u,layer:l}}},{key:"_refreshDemuxer",value:function(){this.releaseTsDemuxer(),this._initDemuxer()}},{key:"_initDemuxer",value:function(){Module.cwrap("initTsMissile","number",[])(),Module.cwrap("initializeDemuxer","number",[])()}},{key:"releaseTsDemuxer",value:function(){Module.cwrap("exitTsMissile","number",[])()}}])&&n(i.prototype,s),o&&n(i,o),e}();i.MPEG_JS=s}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./consts":69,"./decoder/aac":70}],72:[function(e,t,i){"use strict";function n(e,t){for(var i=0;i0&&e.extensionInfo.vHeight>0&&(e.size.width=e.extensionInfo.vWidth,e.size.height=e.extensionInfo.vHeight);for(var t=null;!((t=e.mpegTsObj.readPacket()).size<=0);){var i=t.dtime;if(0==t.type){var n=s.PACK_NALU(t.layer),r=1==t.keyframe;e.bufObject.appendFrame(i,n,!0,r)}else if("aac"==e.mediaInfo.aCodec)for(var a=t.data,o=0;o0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;return t<0?null:1==e?this.bufObject.vFrame(t):2==e?this.bufObject.aFrame(t):void 0}},{key:"isHEVC",value:function(){return this.mpegTsObj.isHEVC()}},{key:"getACodec",value:function(){return this.aCodec}},{key:"getVCodec",value:function(){return this.vCodec}},{key:"getAudioNone",value:function(){return this.mpegTsObj.mediaAttr.audioNone}},{key:"getDurationMs",value:function(){return this.durationMs}},{key:"getFPS",value:function(){return this.fps}},{key:"getSampleRate",value:function(){return this.sampleRate}},{key:"getSize",value:function(){return this.size}},{key:"seek",value:function(e){if(e>=0){var t=this.bufObject.seekIDR(e);this.seekPos=t}}}])&&n(t.prototype,i),o&&n(t,o),e}();i.MpegTs=o},{"../decoder/hevc-imp":62,"./buffer":64,"./mpegts/mpeg.js":71}],73:[function(e,t,i){(function(t){"use strict";function n(e,t){for(var i=0;i0&&void 0!==arguments[0]&&arguments[0];return void 0!==this.player&&null!==this.player&&(this.player.setScreen(e),!0)}},{key:"play",value:function(){if(void 0===this.player||null===this.player)return!1;if(this.playParam.videoCodec===m.CODEC_H265){var e={seekPos:this._getSeekTarget(),mode:this.playMode,accurateSeek:this.configFormat.accurateSeek,seekEvent:!1,realPlay:!0};this.player.play(e)}else this.player.play();return!0}},{key:"pause",value:function(){return void 0!==this.player&&null!==this.player&&(this.player.pause(),!0)}},{key:"isPlaying",value:function(){return void 0!==this.player&&null!==this.player&&this.player.isPlayingState()}},{key:"setVoice",value:function(e){return!(e<0||void 0===this.player||null===this.player||(this.volume=e,this.player&&this.player.setVoice(e),0))}},{key:"getVolume",value:function(){return this.volume}},{key:"mediaInfo",value:function(){var e={meta:this.playParam,videoType:this.playMode};return e.meta.isHEVC=0===this.playParam.videoCodec,e}},{key:"_seekHLS",value:function(e,t,i){if(void 0===this.player||null===this.player)return!1;setTimeout((function(){t.player.getCachePTS(),t.player.getCachePTS()>e?i():t._seekHLS(e,t,i)}),100)}},{key:"seek",value:function(e){if(void 0===this.player||null===this.player)return!1;var t=this;this.seekTarget=e,this.onSeekStart&&this.onSeekStart(e),this.timerFeed&&(window.clearInterval(this.timerFeed),this.timerFeed=null);var i=this._getSeekTarget();return this.playParam.videoCodec===m.CODEC_H264?(this.player.seek(e),this.onSeekFinish&&this.onSeekFinish()):this.configFormat.extInfo.core===m.PLAYER_CORE_TYPE_CNATIVE?(this.pause(),this._seekHLS(e,this,(function(){t.player.seek((function(){}),{seekTime:i,mode:t.playMode,accurateSeek:t.configFormat.accurateSeek})}))):this._seekHLS(e,this,(function(){t.player.seek((function(){t.configFormat.type==m.PLAYER_IN_TYPE_MP4?t.mp4Obj.seek(e):t.configFormat.type==m.PLAYER_IN_TYPE_TS||t.configFormat.type==m.PLAYER_IN_TYPE_MPEGTS?t.mpegTsObj.seek(e):t.configFormat.type==m.PLAYER_IN_TYPE_M3U8&&(t.hlsObj.onSamples=null,t.hlsObj.seek(e));var i,n=(i=0,i=t.configFormat.accurateSeek?e:t._getBoxBufSeekIDR(),parseInt(i)),r=parseInt(t._getBoxBufSeekIDR())||0;t._avFeedMP4Data(r,n)}),{seekTime:i,mode:t.playMode,accurateSeek:t.configFormat.accurateSeek})})),!0}},{key:"fullScreen",value:function(){if(this.autoScreenClose=!0,this.player.vCodecID===m.V_CODEC_NAME_HEVC){var e=document.querySelector("#"+this.configFormat.playerId),t=e.getElementsByTagName("canvas")[0];e.style.width=this.screenW+"px",e.style.height=this.screenH+"px";var i=this._checkScreenDisplaySize(this.screenW,this.screenH,this.playParam.size.width,this.playParam.size.height);t.style.marginTop=i[0]+"px",t.style.marginLeft=i[1]+"px",t.style.width=i[2]+"px",t.style.height=i[3]+"px",this._requestFullScreen(e)}else this._requestFullScreen(this.player.videoTag)}},{key:"closeFullScreen",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!1===e&&(this.autoScreenClose=!1,this._exitFull()),this.player.vCodecID===m.V_CODEC_NAME_HEVC){var t=document.querySelector("#"+this.configFormat.playerId),i=t.getElementsByTagName("canvas")[0];t.style.width=this.configFormat.playerW+"px",t.style.height=this.configFormat.playerH+"px";var n=this._checkScreenDisplaySize(this.configFormat.playerW,this.configFormat.playerH,this.playParam.size.width,this.playParam.size.height);i.style.marginTop=n[0]+"px",i.style.marginLeft=n[1]+"px",i.style.width=n[2]+"px",i.style.height=n[3]+"px"}}},{key:"_checkScreenDisplaySize",value:function(e,t,i,n){var r=i/e>n/t,a=(e/i).toFixed(2),s=(t/n).toFixed(2),o=r?a:s,u=this.fixed?e:parseInt(i*o),l=this.fixed?t:parseInt(n*o);return[parseInt((t-l)/2),parseInt((e-u)/2),u,l]}},{key:"_isFullScreen",value:function(){var e=document.fullscreenElement||document.mozFullscreenElement||document.webkitFullscreenElement;return document.fullscreenEnabled||document.mozFullscreenEnabled||document.webkitFullscreenEnabled,null!=e}},{key:"_requestFullScreen",value:function(e){e.requestFullscreen?e.requestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.msRequestFullscreen?e.msRequestFullscreen():e.webkitRequestFullscreen&&e.webkitRequestFullScreen()}},{key:"_exitFull",value:function(){document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.msExitFullscreen&&document.msExitFullscreen()}},{key:"_durationText",value:function(e){if(e<0)return"Play";var t=Math.round(e);return Math.floor(t/3600)+":"+Math.floor(t%3600/60)+":"+Math.floor(t%60)}},{key:"_getSeekTarget",value:function(){return this.configFormat.accurateSeek?this.seekTarget:this._getBoxBufSeekIDR()}},{key:"_getBoxBufSeekIDR",value:function(){return this.configFormat.type==m.PLAYER_IN_TYPE_MP4?this.mp4Obj.seekPos:this.configFormat.type==m.PLAYER_IN_TYPE_TS||this.configFormat.type==m.PLAYER_IN_TYPE_MPEGTS?this.mpegTsObj.seekPos:this.configFormat.type==m.PLAYER_IN_TYPE_M3U8?this.hlsObj.seekPos:void 0}},{key:"_playControl",value:function(){this.isPlaying()?this.pause():this.play()}},{key:"_avFeedMP4Data",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(void 0===this.player||null===this.player)return!1;var r=parseInt(this.playParam.durationMs/1e3);this.player.clearAllCache(),this.timerFeed=window.setInterval((function(){var a=null,s=null,o=!0,u=!0;if(e.configFormat.type==m.PLAYER_IN_TYPE_MP4?(a=e.mp4Obj.popBuffer(1,t),s=e.mp4Obj.audioNone?null:e.mp4Obj.popBuffer(2,i)):e.configFormat.type==m.PLAYER_IN_TYPE_TS||e.configFormat.type==m.PLAYER_IN_TYPE_MPEGTS?(a=e.mpegTsObj.popBuffer(1,t),s=e.mpegTsObj.getAudioNone()?null:e.mpegTsObj.popBuffer(2,i)):e.configFormat.type==m.PLAYER_IN_TYPE_M3U8&&(a=e.hlsObj.popBuffer(1,t),s=e.hlsObj.audioNone?null:e.hlsObj.popBuffer(2,i),t=e.hlsObj.getLastIdx()&&(o=!1),i=e.hlsObj.getALastIdx()&&(u=!1)),!0===o&&null!=a)for(var l=0;lr)return window.clearInterval(e.timerFeed),e.timerFeed=null,e.player.vCachePTS,e.player.aCachePTS,void(null!=n&&n())}),5)}},{key:"_makeMP4Player",value:function(){return this.mediaExtProtocol===m.URI_PROTOCOL_WEBSOCKET_DESC?(this._cWsFLVDecoderEntry(),0):(null!=this.configFormat.extInfo.core&&null!==this.configFormat.extInfo.core&&this.configFormat.extInfo.core===m.PLAYER_CORE_TYPE_CNATIVE?this._cDemuxDecoderEntry():this.configFormat.type==m.PLAYER_IN_TYPE_MP4?this.configFormat.extInfo.moovStartFlag?this._mp4EntryVodStream():this._mp4Entry():this.configFormat.type==m.PLAYER_IN_TYPE_TS||this.configFormat.type==m.PLAYER_IN_TYPE_MPEGTS?this._mpegTsEntry():this.configFormat.type==m.PLAYER_IN_TYPE_M3U8?this._m3u8Entry():this.configFormat.type===m.PLAYER_IN_TYPE_RAW_265&&this._raw265Entry(),0)}},{key:"_makeMP4PlayerViewEvent",value:function(e,t,i,n){var a=this,s=arguments.length>4&&void 0!==arguments[4]&&arguments[4],o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null,u=this;if(this.playParam.durationMs=e,this.playParam.fps=t,this.playParam.sampleRate=i,this.playParam.size=n,this.playParam.audioNone=s,this.playParam.videoCodec=o||m.CODEC_H265,this.playParam,(this.configFormat.type==m.PLAYER_IN_TYPE_M3U8&&this.hlsConf.hlsType==m.PLAYER_IN_TYPE_M3U8_LIVE||this.configFormat.type==m.PLAYER_IN_TYPE_RAW_265)&&(this.playMode=m.PLAYER_MODE_NOTIME_LIVE),u.configFormat.extInfo.autoCrop){var l=document.querySelector("#"+this.configFormat.playerId),d=n.width/n.height,h=this.configFormat.playerW/this.configFormat.playerH;d>h?l.style.height=this.configFormat.playerW/d+"px":d=m.FETCH_FIRST_MAX_TIMES)return;i=new AbortController,n=i.signal,e(s+1)}}),m.FETCH_HTTP_FLV_TIMEOUT_MS),fetch(t.videoURL,{signal:n}).then((function(e){if(a=!0,e.headers.has("Content-Length"))o=e.headers.get("Content-Length"),t.player&&t.player.setProbeSize(o*t.configFormat.extInfo.coreProbePart);else{if(t.mediaExtFormat===m.PLAYER_IN_TYPE_FLV)return i.abort(),t.player.release(),t.player=null,t._cLiveFLVDecoderEntry(r),!0;t.player&&t.player.setProbeSize(4096)}return e.headers.get("Content-Length"),t.configFormat.type,t.mediaExtFormat,function e(i){return i.read().then((function(n){if(!n.done){n.value.buffer;var r=new Uint8Array(n.value.buffer);return t.player&&t.player.pushBuffer(r)<0?(t.player.release(),t.player=null,t._mp4EntryVodStream(),!1):e(i)}t.player&&t.player.pushDone()}))}(e.body.getReader())})).catch((function(e){e.toString().includes("user aborted")||console.error("cdemuxdecoder error",e)}))}(0)}},{key:"_cLiveFLVDecoderEntry",value:function(e){var t=this,i=this;e.probeSize=this.configFormat.extInfo.probeSize,this.player=new o.CHttpLiveCore(e),e.probeSize,this.player.onProbeFinish=function(){i.playParam.fps=i.player.mediaInfo.fps,i.playParam.durationMs=-1,i.playMode=m.PLAYER_MODE_NOTIME_LIVE,i.playParam.sampleRate=i.player.mediaInfo.sampleRate,i.playParam.size={width:i.player.mediaInfo.width,height:i.player.mediaInfo.height},i.playParam.audioNone=i.player.mediaInfo.audioNone,i.player.mediaInfo,i.player.vCodecID===m.V_CODEC_NAME_HEVC?(i.playParam.audioIdx<0&&(i.playParam.audioNone=!0),i.playParam.videoCodec=m.CODEC_H265,i.onLoadFinish&&i.onLoadFinish()):(i.playParam.videoCodec=m.CODEC_H264,i.player.release(),i.player=null,i._flvJsPlayer())},this.player.onNetworkError=function(e){i.onNetworkError&&i.onNetworkError(e)},this.player.onReadyShowDone=function(){i.configFormat.extInfo.readyShow=!1,i.onReadyShowDone&&i.onReadyShowDone()},this.player.onLoadCache=function(){null!=t.onLoadCache&&t.onLoadCache()},this.player.onLoadCacheFinshed=function(){null!=t.onLoadCacheFinshed&&t.onLoadCacheFinshed()},this.player.start(this.videoURL)}},{key:"_cWsFLVDecoderEntry",value:function(){var e=this,t=this,i={width:this.configFormat.playerW,height:this.configFormat.playerH,playerId:this.configFormat.playerId,token:this.configFormat.token,readyShow:this.configFormat.extInfo.readyShow,checkProbe:this.configFormat.extInfo.checkProbe,ignoreAudio:this.configFormat.extInfo.ignoreAudio,playMode:this.playMode};i.probeSize=this.configFormat.extInfo.probeSize,this.player=new u.CWsLiveCore(i),i.probeSize,this.player.onProbeFinish=function(){t.playParam.fps=t.player.mediaInfo.fps,t.playParam.durationMs=-1,t.playMode=m.PLAYER_MODE_NOTIME_LIVE,t.playParam.sampleRate=t.player.mediaInfo.sampleRate,t.playParam.size={width:t.player.mediaInfo.width,height:t.player.mediaInfo.height},t.playParam.audioNone=t.player.mediaInfo.audioNone,t.player.mediaInfo,t.player.vCodecID===m.V_CODEC_NAME_HEVC?(t.playParam.audioIdx<0&&(t.playParam.audioNone=!0),t.playParam.videoCodec=m.CODEC_H265,t.onLoadFinish&&t.onLoadFinish()):(t.playParam.videoCodec=m.CODEC_H264,t.player.release(),t.player=null,t._flvJsPlayer())},this.player.onNetworkError=function(e){t.onNetworkError&&t.onNetworkError(e)},this.player.onReadyShowDone=function(){t.configFormat.extInfo.readyShow=!1,t.onReadyShowDone&&t.onReadyShowDone()},this.player.onLoadCache=function(){null!=e.onLoadCache&&e.onLoadCache()},this.player.onLoadCacheFinshed=function(){null!=e.onLoadCacheFinshed&&e.onLoadCacheFinshed()},this.player.start(this.videoURL)}},{key:"_mpegTsEntry",value:function(){var e=this,t=new AbortController,i=t.signal;this.timerFeed=null,this.mpegTsObj=new f.MpegTs,this.mpegTsObj.bindReady(e),this.mpegTsObj.onDemuxed=this._mpegTsEntryReady.bind(this),this.mpegTsObj.onReady=function(){var n=null;fetch(e.videoURL,{signal:i}).then((function(r){if(r.headers.has("Content-Length"))return function t(i){return i.read().then((function(r){if(!r.done){var a=r.value;if(null===n)n=a;else{var s=a,o=n.length+s.length,u=new Uint8Array(o);u.set(n),u.set(s,n.length),n=new Uint8Array(u),s=null,u=null}return t(i)}e.mpegTsObj.demux(n)}))}(r.body.getReader());t.abort(),i=null,t=null;var a={width:e.configFormat.playerW,height:e.configFormat.playerH,playerId:e.configFormat.playerId,token:e.configFormat.token,readyShow:e.configFormat.extInfo.readyShow,checkProbe:e.configFormat.extInfo.checkProbe,ignoreAudio:e.configFormat.extInfo.ignoreAudio,playMode:e.playMode};e._cLiveFLVDecoderEntry(a)})).catch((function(e){if(!e.toString().includes("user aborted")){var t=" mpegts request error:"+e;console.error(t)}}))},this.mpegTsObj.initMPEG()}},{key:"_mpegTsEntryReady",value:function(e){var t=e,i=(t.mpegTsObj.getVCodec(),t.mpegTsObj.getACodec()),n=t.mpegTsObj.getDurationMs(),r=t.mpegTsObj.getFPS(),a=t.mpegTsObj.getSampleRate(),s=t.mpegTsObj.getSize(),o=this.mpegTsObj.isHEVC();if(!o)return this.mpegTsObj.releaseTsDemuxer(),this.mpegTsObj=null,this.playParam.durationMs=n,this.playParam.fps=r,this.playParam.sampleRate=a,this.playParam.size=s,this.playParam.audioNone=""==i,this.playParam.videoCodec=o?0:1,this.playParam,void(this.onLoadFinish&&this.onLoadFinish());t._makeMP4PlayerViewEvent(n,r,a,s,""==i),parseInt(n/1e3),t._avFeedMP4Data(0,0)}},{key:"_m3u8Entry",value:function(){var e=this,t=this,i=!1,n=0;this.hlsObj=new p.M3u8,this.hlsObj.bindReady(t),this.hlsObj.onFinished=function(e,r){0==i&&(n=t.hlsObj.getDurationMs(),t.hlsConf.hlsType=r.type,i=!0)},this.hlsObj.onCacheProcess=function(t){e.playMode!==m.PLAYER_MODE_NOTIME_LIVE&&e.onCacheProcess&&e.onCacheProcess(t)},this.hlsObj.onDemuxed=function(e){if(null==t.player){var i=t.hlsObj.isHevcParam,r=(t.hlsObj.getVCodec(),t.hlsObj.getACodec()),a=t.hlsObj.getFPS(),s=t.hlsObj.getSampleRate(),o=t.hlsObj.getSize(),u=!1;if(u=t.hlsObj.getSampleChannel()<=0||""===r,!i)return t.hlsObj.release(),t.hlsObj.mpegTsObj&&t.hlsObj.mpegTsObj.releaseTsDemuxer(),t.hlsObj=null,t.playParam.durationMs=-1,t.playParam.fps=a,t.playParam.sampleRate=s,t.playParam.size=o,t.playParam.audioNone=""==r,t.playParam.videoCodec=i?0:1,t.playParam,void t._videoJsPlayer();t._makeMP4PlayerViewEvent(n,a,s,o,u)}},this.hlsObj.onSamples=this._hlsOnSamples.bind(this),this.hlsObj.demux(this.videoURL)}},{key:"_hlsOnSamples",value:function(e,t){1==t.video?this.player.appendHevcFrame(t):!1===this.hlsObj.audioNone&&this.player.appendAACFrame(t)}},{key:"_videoJsPlayer",value:function(){var e=this,t={width:this.configFormat.playerW,height:this.configFormat.playerH,playerId:this.configFormat.playerId,ignoreAudio:this.configFormat.extInfo.ignoreAudio};this.player=new l.NvVideojsCore(t),this.player.onMakeItReady=function(){e.onMakeItReady&&e.onMakeItReady()},this.player.onLoadFinish=function(){e.playParam.size=e.player.getSize(),e.player.duration===1/0||e.player.duration<0?(e.playParam.durationMs=-1,e.playMode=m.PLAYER_MODE_NOTIME_LIVE):(e.playParam.durationMs=1e3*e.player.duration,e.playMode=m.PLAYER_MODE_VOD),e.onLoadFinish&&e.onLoadFinish()},this.player.onReadyShowDone=function(){e.onReadyShowDone&&e.onReadyShowDone()},this.player.onPlayingFinish=function(){e.pause(),e.seek(0),null!=e.onPlayFinish&&e.onPlayFinish()},this.player.onPlayingTime=function(t){e._durationText(t),e._durationText(e.player.duration),null!=e.onPlayTime&&e.onPlayTime(t)},this.player.onSeekFinish=function(){e.onSeekFinish&&e.onSeekFinish()},this.player.makeIt(this.videoURL)}},{key:"_flvJsPlayer",value:function(){var e=this,t={width:this.configFormat.playerW,height:this.configFormat.playerH,playerId:this.configFormat.playerId,ignoreAudio:this.configFormat.extInfo.ignoreAudio};this.player=new d.NvFlvjsCore(t),this.player.onLoadFinish=function(){e.playParam.size=e.player.getSize(),!e.player.duration||NaN===e.player.duration||e.player.duration===1/0||e.player.duration<0?(e.playParam.durationMs=-1,e.playMode=m.PLAYER_MODE_NOTIME_LIVE):(e.playParam.durationMs=1e3*e.player.duration,e.playMode=m.PLAYER_MODE_VOD),e.onLoadFinish&&e.onLoadFinish()},this.player.onReadyShowDone=function(){e.onReadyShowDone&&e.onReadyShowDone()},this.player.onPlayingTime=function(t){e._durationText(t),e._durationText(e.player.duration),null!=e.onPlayTime&&e.onPlayTime(t)},this.player.onPlayingFinish=function(){e.pause(),e.seek(0),null!=e.onPlayFinish&&e.onPlayFinish()},this.player.makeIt(this.videoURL)}},{key:"_raw265Entry",value:function(){this._makeMP4PlayerViewEvent(-1,this.configFormat.extInfo.rawFps,-1,{width:this.configFormat.playerW,height:this.configFormat.playerH},!0,m.CODEC_H265),this.timerFeed&&(window.clearInterval(this.timerFeed),this.timerFeed=null)}},{key:"append265NaluFrame",value:function(e){var t={data:e,pts:this.rawModePts};this.player.appendHevcFrame(t),this.configFormat.extInfo.readyShow&&this.player.cacheYuvBuf.getState()!=CACHE_APPEND_STATUS_CODE.NULL&&(this.player.playFrameYUV(!0,!0),this.configFormat.extInfo.readyShow=!1,this.onReadyShowDone&&this.onReadyShowDone()),this.rawModePts+=1/this.configFormat.extInfo.rawFps}}])&&n(i.prototype,v),b&&n(i,b),e}();i.H265webjs=v,t.new265webjs=function(e,t){return new v(e,t)}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./consts":52,"./decoder/av-common":55,"./decoder/c-httplive-core":56,"./decoder/c-native-core":57,"./decoder/c-wslive-core":58,"./decoder/cache":59,"./decoder/player-core":63,"./demuxer/m3u8":66,"./demuxer/mp4":68,"./demuxer/mpegts/mpeg.js":71,"./demuxer/ts":72,"./native/mp4-player":74,"./native/nv-flvjs-core":75,"./native/nv-videojs-core":76,"./utils/static-mem":78,"./utils/ui/ui":79}],74:[function(e,t,i){"use strict";function n(e,t){for(var i=0;i>1,a>>1,i),e.v.fill(r>>1,a>>1,n),e.drawArrays(e.TRIANGLE_STRIP,0,4)},setupCanvas:function(e,t){var i=e.getContext("webgl")||e.getContext("experimental-webgl");if(!i)return i;var r=i.createProgram(),a=["attribute highp vec4 aVertexPosition;","attribute vec2 aTextureCoord;","varying highp vec2 vTextureCoord;","void main(void) {"," gl_Position = aVertexPosition;"," vTextureCoord = aTextureCoord;","}"].join("\n"),s=i.createShader(i.VERTEX_SHADER);i.shaderSource(s,a),i.compileShader(s);var o=["precision highp float;","varying lowp vec2 vTextureCoord;","uniform sampler2D YTexture;","uniform sampler2D UTexture;","uniform sampler2D VTexture;","const mat4 YUV2RGB = mat4","("," 1.1643828125, 0, 1.59602734375, -.87078515625,"," 1.1643828125, -.39176171875, -.81296875, .52959375,"," 1.1643828125, 2.017234375, 0, -1.081390625,"," 0, 0, 0, 1",");","void main(void) {"," gl_FragColor = vec4( texture2D(YTexture, vTextureCoord).x, texture2D(UTexture, vTextureCoord).x, texture2D(VTexture, vTextureCoord).x, 1) * YUV2RGB;","}"].join("\n"),u=i.createShader(i.FRAGMENT_SHADER);i.shaderSource(u,o),i.compileShader(u),i.attachShader(r,s),i.attachShader(r,u),i.linkProgram(r),i.useProgram(r),i.getProgramParameter(r,i.LINK_STATUS);var l=i.getAttribLocation(r,"aVertexPosition");i.enableVertexAttribArray(l);var d=i.getAttribLocation(r,"aTextureCoord");i.enableVertexAttribArray(d);var h=i.createBuffer();i.bindBuffer(i.ARRAY_BUFFER,h),i.bufferData(i.ARRAY_BUFFER,new Float32Array([1,1,0,-1,1,0,1,-1,0,-1,-1,0]),i.STATIC_DRAW),i.vertexAttribPointer(l,3,i.FLOAT,!1,0,0);var c=i.createBuffer();return i.bindBuffer(i.ARRAY_BUFFER,c),i.bufferData(i.ARRAY_BUFFER,new Float32Array([1,0,0,0,1,1,0,1]),i.STATIC_DRAW),i.vertexAttribPointer(d,2,i.FLOAT,!1,0,0),i.y=new n(i),i.u=new n(i),i.v=new n(i),i.y.bind(0,r,"YTexture"),i.u.bind(1,r,"UTexture"),i.v.bind(2,r,"VTexture"),i}}},{}],78:[function(e,t,i){(function(e){"use strict";e.STATIC_MEM_wasmDecoderState=-1,e.STATICE_MEM_playerCount=-1,e.STATICE_MEM_playerIndexPtr=0}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],79:[function(e,t,i){"use strict";function n(e,t){for(var i=0;i>2),m=new s(Array.prototype.slice.call(t)),g=new Uint8Array(e.byteLength),_=new Int32Array(g.buffer);for(n=i[0],r=i[1],a=i[2],o=i[3],f=0;f=0&&(t="main-desc"),t},Io=function(e,t){e.abort(),e.pause(),t&&t.activePlaylistLoader&&(t.activePlaylistLoader.pause(),t.activePlaylistLoader=null)},Po=function(e,t){t.activePlaylistLoader=e,e.load()},Lo={AUDIO:function(e,t){return function(){var i=t.segmentLoaders[e],n=t.mediaTypes[e],r=t.blacklistCurrentPlaylist;Io(i,n);var a=n.activeTrack(),s=n.activeGroup(),o=(s.filter((function(e){return e.default}))[0]||s[0]).id,u=n.tracks[o];if(a!==u){for(var l in Yr.log.warn("Problem encountered loading the alternate audio track.Switching back to default."),n.tracks)n.tracks[l].enabled=n.tracks[l]===u;n.onTrackChanged()}else r({message:"Problem encountered loading the default audio track."})}},SUBTITLES:function(e,t){return function(){var i=t.segmentLoaders[e],n=t.mediaTypes[e];Yr.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track."),Io(i,n);var r=n.activeTrack();r&&(r.mode="disabled"),n.onTrackChanged()}}},Do={AUDIO:function(e,t,i){if(t){var n=i.tech,r=i.requestOptions,a=i.segmentLoaders[e];t.on("loadedmetadata",(function(){var e=t.media();a.playlist(e,r),(!n.paused()||e.endList&&"none"!==n.preload())&&a.load()})),t.on("loadedplaylist",(function(){a.playlist(t.media(),r),n.paused()||a.load()})),t.on("error",Lo[e](e,i))}},SUBTITLES:function(e,t,i){var n=i.tech,r=i.requestOptions,a=i.segmentLoaders[e],s=i.mediaTypes[e];t.on("loadedmetadata",(function(){var e=t.media();a.playlist(e,r),a.track(s.activeTrack()),(!n.paused()||e.endList&&"none"!==n.preload())&&a.load()})),t.on("loadedplaylist",(function(){a.playlist(t.media(),r),n.paused()||a.load()})),t.on("error",Lo[e](e,i))}},Uo={AUDIO:function(e,t){var i=t.vhs,n=t.sourceType,r=t.segmentLoaders[e],a=t.requestOptions,s=t.master.mediaGroups,o=t.mediaTypes[e],u=o.groups,l=o.tracks,d=o.logger_,h=t.masterPlaylistLoader,c=ba(h.master);for(var f in s[e]&&0!==Object.keys(s[e]).length||(s[e]={main:{default:{default:!0}}},c&&(s[e].main.default.playlists=h.master.playlists)),s[e])for(var p in u[f]||(u[f]=[]),s[e][f]){var m=s[e][f][p],g=void 0;if(c?(d("AUDIO group '"+f+"' label '"+p+"' is a master playlist"),m.isMasterPlaylist=!0,g=null):g="vhs-json"===n&&m.playlists?new Oa(m.playlists[0],i,a):m.resolvedUri?new Oa(m.resolvedUri,i,a):m.playlists&&"dash"===n?new is(m.playlists[0],i,a,h):null,m=Yr.mergeOptions({id:p,playlistLoader:g},m),Do[e](e,m.playlistLoader,t),u[f].push(m),void 0===l[p]){var _=new Yr.AudioTrack({id:p,kind:xo(m),enabled:!1,language:m.language,default:m.default,label:p});l[p]=_}}r.on("error",Lo[e](e,t))},SUBTITLES:function(e,t){var i=t.tech,n=t.vhs,r=t.sourceType,a=t.segmentLoaders[e],s=t.requestOptions,o=t.master.mediaGroups,u=t.mediaTypes[e],l=u.groups,d=u.tracks,h=t.masterPlaylistLoader;for(var c in o[e])for(var f in l[c]||(l[c]=[]),o[e][c])if(!o[e][c][f].forced){var p=o[e][c][f],m=void 0;if("hls"===r)m=new Oa(p.resolvedUri,n,s);else if("dash"===r){if(!p.playlists.filter((function(e){return e.excludeUntil!==1/0})).length)return;m=new is(p.playlists[0],n,s,h)}else"vhs-json"===r&&(m=new Oa(p.playlists?p.playlists[0]:p.resolvedUri,n,s));if(p=Yr.mergeOptions({id:f,playlistLoader:m},p),Do[e](e,p.playlistLoader,t),l[c].push(p),void 0===d[f]){var g=i.addRemoteTextTrack({id:f,kind:"subtitles",default:p.default&&p.autoselect,language:p.language,label:f},!1).track;d[f]=g}}a.on("error",Lo[e](e,t))},"CLOSED-CAPTIONS":function(e,t){var i=t.tech,n=t.master.mediaGroups,r=t.mediaTypes[e],a=r.groups,s=r.tracks;for(var o in n[e])for(var u in a[o]||(a[o]=[]),n[e][o]){var l=n[e][o][u];if(/^(?:CC|SERVICE)/.test(l.instreamId)){var d=i.options_.vhs&&i.options_.vhs.captionServices||{},h={label:u,language:l.language,instreamId:l.instreamId,default:l.default&&l.autoselect};if(d[h.instreamId]&&(h=Yr.mergeOptions(h,d[h.instreamId])),void 0===h.default&&delete h.default,a[o].push(Yr.mergeOptions({id:u},l)),void 0===s[u]){var c=i.addRemoteTextTrack({id:h.instreamId,kind:"captions",default:h.default,language:h.language,label:h.label},!1).track;s[u]=c}}}}},Ro=function e(t,i){for(var n=0;n1&&ba(t.master))for(var u=0;u "+a+" from "+t),this.tech_.trigger({type:"usage",name:"vhs-rendition-change-"+t})),this.masterPlaylistLoader_.media(e,i)},i.startABRTimer_=function(){var e=this;this.stopABRTimer_(),this.abrTimer_=A.default.setInterval((function(){return e.checkABR_()}),250)},i.stopABRTimer_=function(){this.tech_.scrubbing&&this.tech_.scrubbing()||(A.default.clearInterval(this.abrTimer_),this.abrTimer_=null)},i.getAudioTrackPlaylists_=function(){var e=this.master(),t=e&&e.playlists||[];if(!e||!e.mediaGroups||!e.mediaGroups.AUDIO)return t;var i,n=e.mediaGroups.AUDIO,r=Object.keys(n);if(Object.keys(this.mediaTypes_.AUDIO.groups).length)i=this.mediaTypes_.AUDIO.activeTrack();else{var a=n.main||r.length&&n[r[0]];for(var s in a)if(a[s].default){i={label:s};break}}if(!i)return t;var o=[];for(var u in n)if(n[u][i.label]){var l=n[u][i.label];if(l.playlists&&l.playlists.length)o.push.apply(o,l.playlists);else if(l.uri)o.push(l);else if(e.playlists.length)for(var d=0;d1&&(this.tech_.trigger({type:"usage",name:"vhs-alternate-audio"}),this.tech_.trigger({type:"usage",name:"hls-alternate-audio"})),this.useCueTags_&&(this.tech_.trigger({type:"usage",name:"vhs-playlist-cue-tags"}),this.tech_.trigger({type:"usage",name:"hls-playlist-cue-tags"}))},i.shouldSwitchToMedia_=function(e){var t=this.masterPlaylistLoader_.media(),i=this.tech_.buffered();return function(e){var t=e.currentPlaylist,i=e.nextPlaylist,n=e.forwardBuffer,r=e.bufferLowWaterLine,a=e.bufferHighWaterLine,s=e.duration,o=e.experimentalBufferBasedABR,u=e.log;if(!i)return Yr.log.warn("We received no playlist to switch to. Please check your stream."),!1;var l="allowing switch "+(t&&t.id||"null")+" -> "+i.id;if(!t)return u(l+" as current playlist is not set"),!0;if(i.id===t.id)return!1;if(!t.endList)return u(l+" as current playlist is live"),!0;var d=o?ns.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:ns.MAX_BUFFER_LOW_WATER_LINE;if(sc)&&n>=r){var p=l+" as forwardBuffer >= bufferLowWaterLine ("+n+" >= "+r+")";return o&&(p+=" and next bandwidth > current bandwidth ("+h+" > "+c+")"),u(p),!0}return u("not "+l+" as no switching criteria met"),!1}({currentPlaylist:t,nextPlaylist:e,forwardBuffer:i.length?i.end(i.length-1)-this.tech_.currentTime():0,bufferLowWaterLine:this.bufferLowWaterLine(),bufferHighWaterLine:this.bufferHighWaterLine(),duration:this.duration(),experimentalBufferBasedABR:this.experimentalBufferBasedABR,log:this.logger_})},i.setupSegmentLoaderListeners_=function(){var e=this;this.experimentalBufferBasedABR||(this.mainSegmentLoader_.on("bandwidthupdate",(function(){var t=e.selectPlaylist();e.shouldSwitchToMedia_(t)&&e.switchMedia_(t,"bandwidthupdate"),e.tech_.trigger("bandwidthupdate")})),this.mainSegmentLoader_.on("progress",(function(){e.trigger("progress")}))),this.mainSegmentLoader_.on("error",(function(){e.blacklistCurrentPlaylist(e.mainSegmentLoader_.error())})),this.mainSegmentLoader_.on("appenderror",(function(){e.error=e.mainSegmentLoader_.error_,e.trigger("error")})),this.mainSegmentLoader_.on("syncinfoupdate",(function(){e.onSyncInfoUpdate_()})),this.mainSegmentLoader_.on("timestampoffset",(function(){e.tech_.trigger({type:"usage",name:"vhs-timestamp-offset"}),e.tech_.trigger({type:"usage",name:"hls-timestamp-offset"})})),this.audioSegmentLoader_.on("syncinfoupdate",(function(){e.onSyncInfoUpdate_()})),this.audioSegmentLoader_.on("appenderror",(function(){e.error=e.audioSegmentLoader_.error_,e.trigger("error")})),this.mainSegmentLoader_.on("ended",(function(){e.logger_("main segment loader ended"),e.onEndOfStream()})),this.mainSegmentLoader_.on("earlyabort",(function(t){e.experimentalBufferBasedABR||(e.delegateLoaders_("all",["abort"]),e.blacklistCurrentPlaylist({message:"Aborted early because there isn't enough bandwidth to complete the request without rebuffering."},120))}));var t=function(){if(!e.sourceUpdater_.hasCreatedSourceBuffers())return e.tryToCreateSourceBuffers_();var t=e.getCodecsOrExclude_();t&&e.sourceUpdater_.addOrChangeSourceBuffers(t)};this.mainSegmentLoader_.on("trackinfo",t),this.audioSegmentLoader_.on("trackinfo",t),this.mainSegmentLoader_.on("fmp4",(function(){e.triggeredFmp4Usage||(e.tech_.trigger({type:"usage",name:"vhs-fmp4"}),e.tech_.trigger({type:"usage",name:"hls-fmp4"}),e.triggeredFmp4Usage=!0)})),this.audioSegmentLoader_.on("fmp4",(function(){e.triggeredFmp4Usage||(e.tech_.trigger({type:"usage",name:"vhs-fmp4"}),e.tech_.trigger({type:"usage",name:"hls-fmp4"}),e.triggeredFmp4Usage=!0)})),this.audioSegmentLoader_.on("ended",(function(){e.logger_("audioSegmentLoader ended"),e.onEndOfStream()}))},i.mediaSecondsLoaded_=function(){return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded+this.mainSegmentLoader_.mediaSecondsLoaded)},i.load=function(){this.mainSegmentLoader_.load(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.load(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.load()},i.smoothQualityChange_=function(e){void 0===e&&(e=this.selectPlaylist()),this.fastQualityChange_(e)},i.fastQualityChange_=function(e){var t=this;void 0===e&&(e=this.selectPlaylist()),e!==this.masterPlaylistLoader_.media()?(this.switchMedia_(e,"fast-quality"),this.mainSegmentLoader_.resetEverything((function(){Yr.browser.IE_VERSION||Yr.browser.IS_EDGE?t.tech_.setCurrentTime(t.tech_.currentTime()+.04):t.tech_.setCurrentTime(t.tech_.currentTime())}))):this.logger_("skipping fastQualityChange because new media is same as old")},i.play=function(){if(!this.setupFirstPlay()){this.tech_.ended()&&this.tech_.setCurrentTime(0),this.hasPlayed_&&this.load();var e=this.tech_.seekable();return this.tech_.duration()===1/0&&this.tech_.currentTime()this.maxPlaylistRetries?1/0:Date.now()+1e3*t,i.excludeUntil=n,e.reason&&(i.lastExcludeReason_=e.reason),this.tech_.trigger("blacklistplaylist"),this.tech_.trigger({type:"usage",name:"vhs-rendition-blacklisted"}),this.tech_.trigger({type:"usage",name:"hls-rendition-blacklisted"});var u=this.selectPlaylist();if(!u)return this.error="Playback cannot continue. No available working or supported playlists.",void this.trigger("error");var l=e.internal?this.logger_:Yr.log.warn,d=e.message?" "+e.message:"";l((e.internal?"Internal problem":"Problem")+" encountered with playlist "+i.id+"."+d+" Switching to playlist "+u.id+"."),u.attributes.AUDIO!==i.attributes.AUDIO&&this.delegateLoaders_("audio",["abort","pause"]),u.attributes.SUBTITLES!==i.attributes.SUBTITLES&&this.delegateLoaders_("subtitle",["abort","pause"]),this.delegateLoaders_("main",["abort","pause"]);var h=u.targetDuration/2*1e3||5e3,c="number"==typeof u.lastRequest&&Date.now()-u.lastRequest<=h;return this.switchMedia_(u,"exclude",s||c)},i.pauseLoading=function(){this.delegateLoaders_("all",["abort","pause"]),this.stopABRTimer_()},i.delegateLoaders_=function(e,t){var i=this,n=[],r="all"===e;(r||"main"===e)&&n.push(this.masterPlaylistLoader_);var a=[];(r||"audio"===e)&&a.push("AUDIO"),(r||"subtitle"===e)&&(a.push("CLOSED-CAPTIONS"),a.push("SUBTITLES")),a.forEach((function(e){var t=i.mediaTypes_[e]&&i.mediaTypes_[e].activePlaylistLoader;t&&n.push(t)})),["main","audio","subtitle"].forEach((function(t){var r=i[t+"SegmentLoader_"];!r||e!==t&&"all"!==e||n.push(r)})),n.forEach((function(e){return t.forEach((function(t){"function"==typeof e[t]&&e[t]()}))}))},i.setCurrentTime=function(e){var t=Zr(this.tech_.buffered(),e);return this.masterPlaylistLoader_&&this.masterPlaylistLoader_.media()&&this.masterPlaylistLoader_.media().segments?t&&t.length?e:(this.mainSegmentLoader_.resetEverything(),this.mainSegmentLoader_.abort(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.resetEverything(),this.audioSegmentLoader_.abort()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.resetEverything(),this.subtitleSegmentLoader_.abort()),void this.load()):0},i.duration=function(){if(!this.masterPlaylistLoader_)return 0;var e=this.masterPlaylistLoader_.media();return e?e.endList?this.mediaSource?this.mediaSource.duration:Zs.Playlist.duration(e):1/0:0},i.seekable=function(){return this.seekable_},i.onSyncInfoUpdate_=function(){var e;if(this.masterPlaylistLoader_){var t=this.masterPlaylistLoader_.media();if(t){var i=this.syncController_.getExpiredTime(t,this.duration());if(null!==i){var n=this.masterPlaylistLoader_.master,r=Zs.Playlist.seekable(t,i,Zs.Playlist.liveEdgeDelay(n,t));if(0!==r.length){if(this.mediaTypes_.AUDIO.activePlaylistLoader){if(t=this.mediaTypes_.AUDIO.activePlaylistLoader.media(),null===(i=this.syncController_.getExpiredTime(t,this.duration())))return;if(0===(e=Zs.Playlist.seekable(t,i,Zs.Playlist.liveEdgeDelay(n,t))).length)return}var a,s;this.seekable_&&this.seekable_.length&&(a=this.seekable_.end(0),s=this.seekable_.start(0)),e?e.start(0)>r.end(0)||r.start(0)>e.end(0)?this.seekable_=r:this.seekable_=Yr.createTimeRanges([[e.start(0)>r.start(0)?e.start(0):r.start(0),e.end(0)0&&(n=Math.max(n,i.end(i.length-1))),this.mediaSource.duration!==n&&this.sourceUpdater_.setDuration(n)}},i.dispose=function(){var e=this;this.trigger("dispose"),this.decrypter_.terminate(),this.masterPlaylistLoader_.dispose(),this.mainSegmentLoader_.dispose(),this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_),["AUDIO","SUBTITLES"].forEach((function(t){var i=e.mediaTypes_[t].groups;for(var n in i)i[n].forEach((function(e){e.playlistLoader&&e.playlistLoader.dispose()}))})),this.audioSegmentLoader_.dispose(),this.subtitleSegmentLoader_.dispose(),this.sourceUpdater_.dispose(),this.timelineChangeController_.dispose(),this.stopABRTimer_(),this.updateDuration_&&this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.mediaSource.removeEventListener("durationchange",this.handleDurationChange_),this.mediaSource.removeEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.removeEventListener("sourceended",this.handleSourceEnded_),this.off()},i.master=function(){return this.masterPlaylistLoader_.master},i.media=function(){return this.masterPlaylistLoader_.media()||this.initialMedia_},i.areMediaTypesKnown_=function(){var e=!!this.mediaTypes_.AUDIO.activePlaylistLoader,t=!!this.mainSegmentLoader_.getCurrentMediaInfo_(),i=!e||!!this.audioSegmentLoader_.getCurrentMediaInfo_();return!(!t||!i)},i.getCodecsOrExclude_=function(){var e=this,t={main:this.mainSegmentLoader_.getCurrentMediaInfo_()||{},audio:this.audioSegmentLoader_.getCurrentMediaInfo_()||{}};t.video=t.main;var i=Os(this.master(),this.media()),n={},r=!!this.mediaTypes_.AUDIO.activePlaylistLoader;if(t.main.hasVideo&&(n.video=i.video||t.main.videoCodec||g.DEFAULT_VIDEO_CODEC),t.main.isMuxed&&(n.video+=","+(i.audio||t.main.audioCodec||g.DEFAULT_AUDIO_CODEC)),(t.main.hasAudio&&!t.main.isMuxed||t.audio.hasAudio||r)&&(n.audio=i.audio||t.main.audioCodec||t.audio.audioCodec||g.DEFAULT_AUDIO_CODEC,t.audio.isFmp4=t.main.hasAudio&&!t.main.isMuxed?t.main.isFmp4:t.audio.isFmp4),n.audio||n.video){var a,s={};if(["video","audio"].forEach((function(e){if(n.hasOwnProperty(e)&&(r=t[e].isFmp4,o=n[e],!(r?g.browserSupportsCodec(o):g.muxerSupportsCodec(o)))){var i=t[e].isFmp4?"browser":"muxer";s[i]=s[i]||[],s[i].push(n[e]),"audio"===e&&(a=i)}var r,o})),r&&a&&this.media().attributes.AUDIO){var o=this.media().attributes.AUDIO;this.master().playlists.forEach((function(t){(t.attributes&&t.attributes.AUDIO)===o&&t!==e.media()&&(t.excludeUntil=1/0)})),this.logger_("excluding audio group "+o+" as "+a+' does not support codec(s): "'+n.audio+'"')}if(!Object.keys(s).length){if(this.sourceUpdater_.hasCreatedSourceBuffers()&&!this.sourceUpdater_.canChangeType()){var u=[];if(["video","audio"].forEach((function(t){var i=(g.parseCodecs(e.sourceUpdater_.codecs[t]||"")[0]||{}).type,r=(g.parseCodecs(n[t]||"")[0]||{}).type;i&&r&&i.toLowerCase()!==r.toLowerCase()&&u.push('"'+e.sourceUpdater_.codecs[t]+'" -> "'+n[t]+'"')})),u.length)return void this.blacklistCurrentPlaylist({playlist:this.media(),message:"Codec switching not supported: "+u.join(", ")+".",blacklistDuration:1/0,internal:!0})}return n}var l=Object.keys(s).reduce((function(e,t){return e&&(e+=", "),e+=t+' does not support codec(s): "'+s[t].join(",")+'"'}),"")+".";this.blacklistCurrentPlaylist({playlist:this.media(),internal:!0,message:l,blacklistDuration:1/0})}else this.blacklistCurrentPlaylist({playlist:this.media(),message:"Could not determine codecs for playlist.",blacklistDuration:1/0})},i.tryToCreateSourceBuffers_=function(){if("open"===this.mediaSource.readyState&&!this.sourceUpdater_.hasCreatedSourceBuffers()&&this.areMediaTypesKnown_()){var e=this.getCodecsOrExclude_();if(e){this.sourceUpdater_.createSourceBuffers(e);var t=[e.video,e.audio].filter(Boolean).join(",");this.excludeIncompatibleVariants_(t)}}},i.excludeUnsupportedVariants_=function(){var e=this,t=this.master().playlists,i=[];Object.keys(t).forEach((function(n){var r=t[n];if(-1===i.indexOf(r.id)){i.push(r.id);var a=Os(e.master,r),s=[];!a.audio||g.muxerSupportsCodec(a.audio)||g.browserSupportsCodec(a.audio)||s.push("audio codec "+a.audio),!a.video||g.muxerSupportsCodec(a.video)||g.browserSupportsCodec(a.video)||s.push("video codec "+a.video),a.text&&"stpp.ttml.im1t"===a.text&&s.push("text codec "+a.text),s.length&&(r.excludeUntil=1/0,e.logger_("excluding "+r.id+" for unsupported: "+s.join(", ")))}}))},i.excludeIncompatibleVariants_=function(e){var t=this,i=[],n=this.master().playlists,r=Us(g.parseCodecs(e)),a=Rs(r),s=r.video&&g.parseCodecs(r.video)[0]||null,o=r.audio&&g.parseCodecs(r.audio)[0]||null;Object.keys(n).forEach((function(e){var r=n[e];if(-1===i.indexOf(r.id)&&r.excludeUntil!==1/0){i.push(r.id);var u=[],l=Os(t.masterPlaylistLoader_.master,r),d=Rs(l);if(l.audio||l.video){if(d!==a&&u.push('codec count "'+d+'" !== "'+a+'"'),!t.sourceUpdater_.canChangeType()){var h=l.video&&g.parseCodecs(l.video)[0]||null,c=l.audio&&g.parseCodecs(l.audio)[0]||null;h&&s&&h.type.toLowerCase()!==s.type.toLowerCase()&&u.push('video codec "'+h.type+'" !== "'+s.type+'"'),c&&o&&c.type.toLowerCase()!==o.type.toLowerCase()&&u.push('audio codec "'+c.type+'" !== "'+o.type+'"')}u.length&&(r.excludeUntil=1/0,t.logger_("blacklisting "+r.id+": "+u.join(" && ")))}}}))},i.updateAdCues_=function(e){var t=0,i=this.seekable();i.length&&(t=i.start(0)),function(e,t,i){if(void 0===i&&(i=0),e.segments)for(var n,r=i,a=0;a0&&this.logger_("resetting possible stalled download count for "+e+" loader"),this[e+"StalledDownloads_"]=0,this[e+"Buffered_"]=t.buffered_()},t.checkSegmentDownloads_=function(e){var t=this.masterPlaylistController_,i=t[e+"SegmentLoader_"],n=i.buffered_(),r=function(e,t){if(e===t)return!1;if(!e&&t||!t&&e)return!0;if(e.length!==t.length)return!0;for(var i=0;i=t.end(t.length-1)))return this.techWaiting_();this.consecutiveUpdates>=5&&e===this.lastRecordedTime?(this.consecutiveUpdates++,this.waiting_()):e===this.lastRecordedTime?this.consecutiveUpdates++:(this.consecutiveUpdates=0,this.lastRecordedTime=e)}},t.cancelTimer_=function(){this.consecutiveUpdates=0,this.timer_&&(this.logger_("cancelTimer_"),clearTimeout(this.timer_)),this.timer_=null},t.fixesBadSeeks_=function(){if(!this.tech_.seeking())return!1;var e,t=this.seekable(),i=this.tech_.currentTime();this.afterSeekableWindow_(t,i,this.media(),this.allowSeeksWithinUnsafeLiveWindow)&&(e=t.end(t.length-1));if(this.beforeSeekableWindow_(t,i)){var n=t.start(0);e=n+(n===t.end(0)?0:.1)}if(void 0!==e)return this.logger_("Trying to seek outside of seekable at time "+i+" with seekable range "+ta(t)+". Seeking to "+e+"."),this.tech_.setCurrentTime(e),!0;var r=this.tech_.buffered();return!!function(e){var t=e.buffered,i=e.targetDuration,n=e.currentTime;return!!t.length&&(!(t.end(0)-t.start(0)<2*i)&&(!(n>t.start(0))&&t.start(0)-n "+i.end(0)+"]. Attempting to resume playback by seeking to the current time."),this.tech_.trigger({type:"usage",name:"vhs-unknown-waiting"}),void this.tech_.trigger({type:"usage",name:"hls-unknown-waiting"})):void 0}},t.techWaiting_=function(){var e=this.seekable(),t=this.tech_.currentTime();if(this.tech_.seeking()&&this.fixesBadSeeks_())return!0;if(this.tech_.seeking()||null!==this.timer_)return!0;if(this.beforeSeekableWindow_(e,t)){var i=e.end(e.length-1);return this.logger_("Fell out of live window at time "+t+". Seeking to live point (seekable end) "+i),this.cancelTimer_(),this.tech_.setCurrentTime(i),this.tech_.trigger({type:"usage",name:"vhs-live-resync"}),this.tech_.trigger({type:"usage",name:"hls-live-resync"}),!0}var n=this.tech_.vhs.masterPlaylistController_.sourceUpdater_,r=this.tech_.buffered();if(this.videoUnderflow_({audioBuffered:n.audioBuffered(),videoBuffered:n.videoBuffered(),currentTime:t}))return this.cancelTimer_(),this.tech_.setCurrentTime(t),this.tech_.trigger({type:"usage",name:"vhs-video-underflow"}),this.tech_.trigger({type:"usage",name:"hls-video-underflow"}),!0;var a=ea(r,t);if(a.length>0){var s=a.start(0)-t;return this.logger_("Stopped at "+t+", setting timer for "+s+", seeking to "+a.start(0)),this.cancelTimer_(),this.timer_=setTimeout(this.skipTheGap_.bind(this),1e3*s,t),!0}return!1},t.afterSeekableWindow_=function(e,t,i,n){if(void 0===n&&(n=!1),!e.length)return!1;var r=e.end(e.length-1)+.1;return!i.endList&&n&&(r=e.end(e.length-1)+3*i.targetDuration),t>r},t.beforeSeekableWindow_=function(e,t){return!!(e.length&&e.start(0)>0&&t2)return{start:r,end:a}}return null},e}(),zo={errorInterval:30,getSource:function(e){return e(this.tech({IWillNotUseThisInPlugins:!0}).currentSource_||this.currentSource())}},Go=function(e){!function e(t,i){var n=0,r=0,a=Yr.mergeOptions(zo,i);t.ready((function(){t.trigger({type:"usage",name:"vhs-error-reload-initialized"}),t.trigger({type:"usage",name:"hls-error-reload-initialized"})}));var s=function(){r&&t.currentTime(r)},o=function(e){null!=e&&(r=t.duration()!==1/0&&t.currentTime()||0,t.one("loadedmetadata",s),t.src(e),t.trigger({type:"usage",name:"vhs-error-reload"}),t.trigger({type:"usage",name:"hls-error-reload"}),t.play())},u=function(){return Date.now()-n<1e3*a.errorInterval?(t.trigger({type:"usage",name:"vhs-error-reload-canceled"}),void t.trigger({type:"usage",name:"hls-error-reload-canceled"})):a.getSource&&"function"==typeof a.getSource?(n=Date.now(),a.getSource.call(t,o)):void Yr.log.error("ERROR: reloadSourceOnError - The option getSource must be a function!")},l=function e(){t.off("loadedmetadata",s),t.off("error",u),t.off("dispose",e)};t.on("error",u),t.on("dispose",l),t.reloadSourceOnError=function(i){l(),e(t,i)}}(this,e)},Wo={PlaylistLoader:Oa,Playlist:Ta,utils:Ka,STANDARD_PLAYLIST_SELECTOR:Hs,INITIAL_PLAYLIST_SELECTOR:function(){var e=this,t=this.playlists.master.playlists.filter(Ta.isEnabled);return Ns(t,(function(e,t){return js(e,t)})),t.filter((function(t){return!!Os(e.playlists.master,t).video}))[0]||null},lastBandwidthSelector:Hs,movingAverageBandwidthSelector:function(e){var t=-1,i=-1;if(e<0||e>1)throw new Error("Moving average bandwidth decay must be between 0 and 1.");return function(){var n=this.useDevicePixelRatio&&A.default.devicePixelRatio||1;return t<0&&(t=this.systemBandwidth,i=this.systemBandwidth),this.systemBandwidth>0&&this.systemBandwidth!==i&&(t=e*this.systemBandwidth+(1-e)*t,i=this.systemBandwidth),Vs(this.playlists.master,t,parseInt(Bs(this.tech_.el(),"width"),10)*n,parseInt(Bs(this.tech_.el(),"height"),10)*n,this.limitRenditionByPlayerDimensions,this.masterPlaylistController_)}},comparePlaylistBandwidth:js,comparePlaylistResolution:function(e,t){var i,n;return e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width&&(i=e.attributes.RESOLUTION.width),i=i||A.default.Number.MAX_VALUE,t.attributes.RESOLUTION&&t.attributes.RESOLUTION.width&&(n=t.attributes.RESOLUTION.width),i===(n=n||A.default.Number.MAX_VALUE)&&e.attributes.BANDWIDTH&&t.attributes.BANDWIDTH?e.attributes.BANDWIDTH-t.attributes.BANDWIDTH:i-n},xhr:Na()};Object.keys(ns).forEach((function(e){Object.defineProperty(Wo,e,{get:function(){return Yr.log.warn("using Vhs."+e+" is UNSAFE be sure you know what you are doing"),ns[e]},set:function(t){Yr.log.warn("using Vhs."+e+" is UNSAFE be sure you know what you are doing"),"number"!=typeof t||t<0?Yr.log.warn("value of Vhs."+e+" must be greater than or equal to 0"):ns[e]=t}})}));var Yo=function(e,t){for(var i=t.media(),n=-1,r=0;r0?1/this.throughput:0,Math.floor(1/(t+e))},set:function(){Yr.log.error('The "systemBandwidth" property is read-only')}}}),this.options_.bandwidth&&(this.bandwidth=this.options_.bandwidth),this.options_.throughput&&(this.throughput=this.options_.throughput),Object.defineProperties(this.stats,{bandwidth:{get:function(){return i.bandwidth||0},enumerable:!0},mediaRequests:{get:function(){return i.masterPlaylistController_.mediaRequests_()||0},enumerable:!0},mediaRequestsAborted:{get:function(){return i.masterPlaylistController_.mediaRequestsAborted_()||0},enumerable:!0},mediaRequestsTimedout:{get:function(){return i.masterPlaylistController_.mediaRequestsTimedout_()||0},enumerable:!0},mediaRequestsErrored:{get:function(){return i.masterPlaylistController_.mediaRequestsErrored_()||0},enumerable:!0},mediaTransferDuration:{get:function(){return i.masterPlaylistController_.mediaTransferDuration_()||0},enumerable:!0},mediaBytesTransferred:{get:function(){return i.masterPlaylistController_.mediaBytesTransferred_()||0},enumerable:!0},mediaSecondsLoaded:{get:function(){return i.masterPlaylistController_.mediaSecondsLoaded_()||0},enumerable:!0},mediaAppends:{get:function(){return i.masterPlaylistController_.mediaAppends_()||0},enumerable:!0},mainAppendsToLoadedData:{get:function(){return i.masterPlaylistController_.mainAppendsToLoadedData_()||0},enumerable:!0},audioAppendsToLoadedData:{get:function(){return i.masterPlaylistController_.audioAppendsToLoadedData_()||0},enumerable:!0},appendsToLoadedData:{get:function(){return i.masterPlaylistController_.appendsToLoadedData_()||0},enumerable:!0},timeToLoadedData:{get:function(){return i.masterPlaylistController_.timeToLoadedData_()||0},enumerable:!0},buffered:{get:function(){return ia(i.tech_.buffered())},enumerable:!0},currentTime:{get:function(){return i.tech_.currentTime()},enumerable:!0},currentSource:{get:function(){return i.tech_.currentSource_},enumerable:!0},currentTech:{get:function(){return i.tech_.name_},enumerable:!0},duration:{get:function(){return i.tech_.duration()},enumerable:!0},master:{get:function(){return i.playlists.master},enumerable:!0},playerDimensions:{get:function(){return i.tech_.currentDimensions()},enumerable:!0},seekable:{get:function(){return ia(i.tech_.seekable())},enumerable:!0},timestamp:{get:function(){return Date.now()},enumerable:!0},videoPlaybackQuality:{get:function(){return i.tech_.getVideoPlaybackQuality()},enumerable:!0}}),this.tech_.one("canplay",this.masterPlaylistController_.setupFirstPlay.bind(this.masterPlaylistController_)),this.tech_.on("bandwidthupdate",(function(){i.options_.useBandwidthFromLocalStorage&&function(e){if(!A.default.localStorage)return!1;var t=Xo();t=t?Yr.mergeOptions(t,e):e;try{A.default.localStorage.setItem("videojs-vhs",JSON.stringify(t))}catch(e){return!1}}({bandwidth:i.bandwidth,throughput:Math.round(i.throughput)})})),this.masterPlaylistController_.on("selectedinitialmedia",(function(){var e;(e=i).representations=function(){var t=e.masterPlaylistController_.master(),i=ba(t)?e.masterPlaylistController_.getAudioTrackPlaylists_():t.playlists;return i?i.filter((function(e){return!pa(e)})).map((function(t,i){return new jo(e,t,t.id)})):[]}})),this.masterPlaylistController_.sourceUpdater_.on("createdsourcebuffers",(function(){i.setupEme_()})),this.on(this.masterPlaylistController_,"progress",(function(){this.tech_.trigger("progress")})),this.on(this.masterPlaylistController_,"firstplay",(function(){this.ignoreNextSeekingEvent_=!0})),this.setupQualityLevels_(),this.tech_.el()&&(this.mediaSourceUrl_=A.default.URL.createObjectURL(this.masterPlaylistController_.mediaSource),this.tech_.src(this.mediaSourceUrl_))}},i.setupEme_=function(){var e=this,t=this.masterPlaylistController_.mediaTypes_.AUDIO.activePlaylistLoader,i=Ko({player:this.player_,sourceKeySystems:this.source_.keySystems,media:this.playlists.media(),audioMedia:t&&t.media()});this.player_.tech_.on("keystatuschange",(function(t){"output-restricted"===t.status&&e.masterPlaylistController_.blacklistCurrentPlaylist({playlist:e.masterPlaylistController_.media(),message:"DRM keystatus changed to "+t.status+". Playlist will fail to play. Check for HDCP content.",blacklistDuration:1/0})})),11!==Yr.browser.IE_VERSION&&i?(this.logger_("waiting for EME key session creation"),qo({player:this.player_,sourceKeySystems:this.source_.keySystems,audioMedia:t&&t.media(),mainPlaylists:this.playlists.master.playlists}).then((function(){e.logger_("created EME key session"),e.masterPlaylistController_.sourceUpdater_.initializedEme()})).catch((function(t){e.logger_("error while creating EME key session",t),e.player_.error({message:"Failed to initialize media keys for EME",code:3})}))):this.masterPlaylistController_.sourceUpdater_.initializedEme()},i.setupQualityLevels_=function(){var e=this,t=Yr.players[this.tech_.options_.playerId];t&&t.qualityLevels&&!this.qualityLevels_&&(this.qualityLevels_=t.qualityLevels(),this.masterPlaylistController_.on("selectedinitialmedia",(function(){var t,i;t=e.qualityLevels_,(i=e).representations().forEach((function(e){t.addQualityLevel(e)})),Yo(t,i.playlists)})),this.playlists.on("mediachange",(function(){Yo(e.qualityLevels_,e.playlists)})))},t.version=function(){return{"@videojs/http-streaming":"2.10.2","mux.js":"5.13.0","mpd-parser":"0.19.0","m3u8-parser":"4.7.0","aes-decrypter":"3.1.2"}},i.version=function(){return this.constructor.version()},i.canChangeType=function(){return vo.canChangeType()},i.play=function(){this.masterPlaylistController_.play()},i.setCurrentTime=function(e){this.masterPlaylistController_.setCurrentTime(e)},i.duration=function(){return this.masterPlaylistController_.duration()},i.seekable=function(){return this.masterPlaylistController_.seekable()},i.dispose=function(){this.playbackWatcher_&&this.playbackWatcher_.dispose(),this.masterPlaylistController_&&this.masterPlaylistController_.dispose(),this.qualityLevels_&&this.qualityLevels_.dispose(),this.player_&&(delete this.player_.vhs,delete this.player_.dash,delete this.player_.hls),this.tech_&&this.tech_.vhs&&delete this.tech_.vhs,this.tech_&&delete this.tech_.hls,this.mediaSourceUrl_&&A.default.URL.revokeObjectURL&&(A.default.URL.revokeObjectURL(this.mediaSourceUrl_),this.mediaSourceUrl_=null),e.prototype.dispose.call(this)},i.convertToProgramTime=function(e,t){return Xa({playlist:this.masterPlaylistController_.media(),time:e,callback:t})},i.seekToProgramTime=function(e,t,i,n){return void 0===i&&(i=!0),void 0===n&&(n=2),Qa({programTime:e,playlist:this.masterPlaylistController_.media(),retryCount:n,pauseAfterSeek:i,seekTo:this.options_.seekTo,tech:this.options_.tech,callback:t})},t}(Yr.getComponent("Component")),$o={name:"videojs-http-streaming",VERSION:"2.10.2",canHandleSource:function(e,t){void 0===t&&(t={});var i=Yr.mergeOptions(Yr.options,t);return $o.canPlayType(e.type,i)},handleSource:function(e,t,i){void 0===i&&(i={});var n=Yr.mergeOptions(Yr.options,i);return t.vhs=new Qo(e,t,n),Yr.hasOwnProperty("hls")||Object.defineProperty(t,"hls",{get:function(){return Yr.log.warn("player.tech().hls is deprecated. Use player.tech().vhs instead."),t.vhs},configurable:!0}),t.vhs.xhr=Na(),t.vhs.src(e.src,e.type),t.vhs},canPlayType:function(e,t){void 0===t&&(t={});var i=Yr.mergeOptions(Yr.options,t).vhs.overrideNative,n=void 0===i?!Yr.browser.IS_ANY_SAFARI:i,r=_.simpleTypeFromSourceType(e);return r&&(!Wo.supportsTypeNatively(r)||n)?"maybe":""}};g.browserSupportsCodec("avc1.4d400d,mp4a.40.2")&&Yr.getTech("Html5").registerSourceHandler($o,0),Yr.VhsHandler=Qo,Object.defineProperty(Yr,"HlsHandler",{get:function(){return Yr.log.warn("videojs.HlsHandler is deprecated. Use videojs.VhsHandler instead."),Qo},configurable:!0}),Yr.VhsSourceHandler=$o,Object.defineProperty(Yr,"HlsSourceHandler",{get:function(){return Yr.log.warn("videojs.HlsSourceHandler is deprecated. Use videojs.VhsSourceHandler instead."),$o},configurable:!0}),Yr.Vhs=Wo,Object.defineProperty(Yr,"Hls",{get:function(){return Yr.log.warn("videojs.Hls is deprecated. Use videojs.Vhs instead."),Wo},configurable:!0}),Yr.use||(Yr.registerComponent("Hls",Wo),Yr.registerComponent("Vhs",Wo)),Yr.options.vhs=Yr.options.vhs||{},Yr.options.hls=Yr.options.hls||{},Yr.registerPlugin?Yr.registerPlugin("reloadSourceOnError",Go):Yr.plugin("reloadSourceOnError",Go),t.exports=Yr},{"@babel/runtime/helpers/assertThisInitialized":1,"@babel/runtime/helpers/construct":2,"@babel/runtime/helpers/extends":3,"@babel/runtime/helpers/inherits":4,"@babel/runtime/helpers/inheritsLoose":5,"@videojs/vhs-utils/cjs/byte-helpers":9,"@videojs/vhs-utils/cjs/codecs.js":11,"@videojs/vhs-utils/cjs/containers":12,"@videojs/vhs-utils/cjs/id3-helpers":15,"@videojs/vhs-utils/cjs/media-types.js":16,"@videojs/vhs-utils/cjs/resolve-url.js":20,"@videojs/xhr":23,"global/document":34,"global/window":35,keycode:38,"m3u8-parser":39,"mpd-parser":41,"mux.js/lib/tools/parse-sidx":42,"mux.js/lib/utils/clock":43,"safe-json-parse/tuple":45,"videojs-vtt.js":48}],48:[function(e,t,i){var n=e("global/window"),r=t.exports={WebVTT:e("./vtt.js"),VTTCue:e("./vttcue.js"),VTTRegion:e("./vttregion.js")};n.vttjs=r,n.WebVTT=r.WebVTT;var a=r.VTTCue,s=r.VTTRegion,o=n.VTTCue,u=n.VTTRegion;r.shim=function(){n.VTTCue=a,n.VTTRegion=s},r.restore=function(){n.VTTCue=o,n.VTTRegion=u},n.VTTCue||r.shim()},{"./vtt.js":49,"./vttcue.js":50,"./vttregion.js":51,"global/window":35}],49:[function(e,t,i){var n=e("global/document"),r=Object.create||function(){function e(){}return function(t){if(1!==arguments.length)throw new Error("Object.create shim only accepts one parameter.");return e.prototype=t,new e}}();function a(e,t){this.name="ParsingError",this.code=e.code,this.message=t||e.message}function s(e){function t(e,t,i,n){return 3600*(0|e)+60*(0|t)+(0|i)+(0|n)/1e3}var i=e.match(/^(\d+):(\d{1,2})(:\d{1,2})?\.(\d{3})/);return i?i[3]?t(i[1],i[2],i[3].replace(":",""),i[4]):i[1]>59?t(i[1],i[2],0,i[4]):t(0,i[1],i[2],i[4]):null}function o(){this.values=r(null)}function u(e,t,i,n){var r=n?e.split(n):[e];for(var a in r)if("string"==typeof r[a]){var s=r[a].split(i);if(2===s.length)t(s[0],s[1])}}function l(e,t,i){var n=e;function r(){var t=s(e);if(null===t)throw new a(a.Errors.BadTimeStamp,"Malformed timestamp: "+n);return e=e.replace(/^[^\sa-zA-Z-]+/,""),t}function l(){e=e.replace(/^\s+/,"")}if(l(),t.startTime=r(),l(),"--\x3e"!==e.substr(0,3))throw new a(a.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '--\x3e'): "+n);e=e.substr(3),l(),t.endTime=r(),l(),function(e,t){var n=new o;u(e,(function(e,t){switch(e){case"region":for(var r=i.length-1;r>=0;r--)if(i[r].id===t){n.set(e,i[r].region);break}break;case"vertical":n.alt(e,t,["rl","lr"]);break;case"line":var a=t.split(","),s=a[0];n.integer(e,s),n.percent(e,s)&&n.set("snapToLines",!1),n.alt(e,s,["auto"]),2===a.length&&n.alt("lineAlign",a[1],["start","center","end"]);break;case"position":a=t.split(","),n.percent(e,a[0]),2===a.length&&n.alt("positionAlign",a[1],["start","center","end"]);break;case"size":n.percent(e,t);break;case"align":n.alt(e,t,["start","center","end","left","right"])}}),/:/,/\s/),t.region=n.get("region",null),t.vertical=n.get("vertical","");try{t.line=n.get("line","auto")}catch(e){}t.lineAlign=n.get("lineAlign","start"),t.snapToLines=n.get("snapToLines",!0),t.size=n.get("size",100);try{t.align=n.get("align","center")}catch(e){t.align=n.get("align","middle")}try{t.position=n.get("position","auto")}catch(e){t.position=n.get("position",{start:0,left:0,center:50,middle:50,end:100,right:100},t.align)}t.positionAlign=n.get("positionAlign",{start:"start",left:"start",center:"center",middle:"center",end:"end",right:"end"},t.align)}(e,t)}a.prototype=r(Error.prototype),a.prototype.constructor=a,a.Errors={BadSignature:{code:0,message:"Malformed WebVTT signature."},BadTimeStamp:{code:1,message:"Malformed time stamp."}},o.prototype={set:function(e,t){this.get(e)||""===t||(this.values[e]=t)},get:function(e,t,i){return i?this.has(e)?this.values[e]:t[i]:this.has(e)?this.values[e]:t},has:function(e){return e in this.values},alt:function(e,t,i){for(var n=0;n=0&&t<=100)&&(this.set(e,t),!0)}};var d=n.createElement&&n.createElement("textarea"),h={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"},c={white:"rgba(255,255,255,1)",lime:"rgba(0,255,0,1)",cyan:"rgba(0,255,255,1)",red:"rgba(255,0,0,1)",yellow:"rgba(255,255,0,1)",magenta:"rgba(255,0,255,1)",blue:"rgba(0,0,255,1)",black:"rgba(0,0,0,1)"},f={v:"title",lang:"lang"},p={rt:"ruby"};function m(e,t){function i(){if(!t)return null;var e,i=t.match(/^([^<]*)(<[^>]*>?)?/);return e=i[1]?i[1]:i[2],t=t.substr(e.length),e}function n(e,t){return!p[t.localName]||p[t.localName]===e.localName}function r(t,i){var n=h[t];if(!n)return null;var r=e.document.createElement(n),a=f[t];return a&&i&&(r[a]=i.trim()),r}for(var a,o,u=e.document.createElement("div"),l=u,m=[];null!==(a=i());)if("<"!==a[0])l.appendChild(e.document.createTextNode((o=a,d.innerHTML=o,o=d.textContent,d.textContent="",o)));else{if("/"===a[1]){m.length&&m[m.length-1]===a.substr(2).replace(">","")&&(m.pop(),l=l.parentNode);continue}var g,_=s(a.substr(1,a.length-2));if(_){g=e.document.createProcessingInstruction("timestamp",_),l.appendChild(g);continue}var y=a.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!y)continue;if(!(g=r(y[1],y[3])))continue;if(!n(l,g))continue;if(y[2]){var v=y[2].split(".");v.forEach((function(e){var t=/^bg_/.test(e),i=t?e.slice(3):e;if(c.hasOwnProperty(i)){var n=t?"background-color":"color",r=c[i];g.style[n]=r}})),g.className=v.join(" ")}m.push(y[1]),l.appendChild(g),l=g}return u}var g=[[1470,1470],[1472,1472],[1475,1475],[1478,1478],[1488,1514],[1520,1524],[1544,1544],[1547,1547],[1549,1549],[1563,1563],[1566,1610],[1645,1647],[1649,1749],[1765,1766],[1774,1775],[1786,1805],[1807,1808],[1810,1839],[1869,1957],[1969,1969],[1984,2026],[2036,2037],[2042,2042],[2048,2069],[2074,2074],[2084,2084],[2088,2088],[2096,2110],[2112,2136],[2142,2142],[2208,2208],[2210,2220],[8207,8207],[64285,64285],[64287,64296],[64298,64310],[64312,64316],[64318,64318],[64320,64321],[64323,64324],[64326,64449],[64467,64829],[64848,64911],[64914,64967],[65008,65020],[65136,65140],[65142,65276],[67584,67589],[67592,67592],[67594,67637],[67639,67640],[67644,67644],[67647,67669],[67671,67679],[67840,67867],[67872,67897],[67903,67903],[67968,68023],[68030,68031],[68096,68096],[68112,68115],[68117,68119],[68121,68147],[68160,68167],[68176,68184],[68192,68223],[68352,68405],[68416,68437],[68440,68466],[68472,68479],[68608,68680],[126464,126467],[126469,126495],[126497,126498],[126500,126500],[126503,126503],[126505,126514],[126516,126519],[126521,126521],[126523,126523],[126530,126530],[126535,126535],[126537,126537],[126539,126539],[126541,126543],[126545,126546],[126548,126548],[126551,126551],[126553,126553],[126555,126555],[126557,126557],[126559,126559],[126561,126562],[126564,126564],[126567,126570],[126572,126578],[126580,126583],[126585,126588],[126590,126590],[126592,126601],[126603,126619],[126625,126627],[126629,126633],[126635,126651],[1114109,1114109]];function _(e){for(var t=0;t=i[0]&&e<=i[1])return!0}return!1}function y(e){var t=[],i="";if(!e||!e.childNodes)return"ltr";function n(e,t){for(var i=t.childNodes.length-1;i>=0;i--)e.push(t.childNodes[i])}function r(e){if(!e||!e.length)return null;var t=e.pop(),i=t.textContent||t.innerText;if(i){var a=i.match(/^.*(\n|\r)/);return a?(e.length=0,a[0]):i}return"ruby"===t.tagName?r(e):t.childNodes?(n(e,t),r(e)):void 0}for(n(t,e);i=r(t);)for(var a=0;a=0&&e.line<=100))return e.line;if(!e.track||!e.track.textTrackList||!e.track.textTrackList.mediaElement)return-1;for(var t=e.track,i=t.textTrackList,n=0,r=0;rh&&(d=d<0?-1:1,d*=Math.ceil(h/l)*l),s<0&&(d+=""===a.vertical?i.height:i.width,o=o.reverse()),r.move(c,d)}else{var f=r.lineHeight/i.height*100;switch(a.lineAlign){case"center":s-=f/2;break;case"end":s-=f}switch(a.vertical){case"":t.applyStyles({top:t.formatStyle(s,"%")});break;case"rl":t.applyStyles({left:t.formatStyle(s,"%")});break;case"lr":t.applyStyles({right:t.formatStyle(s,"%")})}o=["+y","-x","+x","-y"],r=new T(t)}var p=function(e,t){for(var r,a=new T(e),s=1,o=0;ou&&(r=new T(e),s=u),e=new T(a)}return r||a}(r,o);t.move(p.toCSSCompatValues(i))}function E(){}v.prototype.applyStyles=function(e,t){for(var i in t=t||this.div,e)e.hasOwnProperty(i)&&(t.style[i]=e[i])},v.prototype.formatStyle=function(e,t){return 0===e?0:e+t},b.prototype=r(v.prototype),b.prototype.constructor=b,T.prototype.move=function(e,t){switch(t=void 0!==t?t:this.lineHeight,e){case"+x":this.left+=t,this.right+=t;break;case"-x":this.left-=t,this.right-=t;break;case"+y":this.top+=t,this.bottom+=t;break;case"-y":this.top-=t,this.bottom-=t}},T.prototype.overlaps=function(e){return this.lefte.left&&this.tope.top},T.prototype.overlapsAny=function(e){for(var t=0;t=e.top&&this.bottom<=e.bottom&&this.left>=e.left&&this.right<=e.right},T.prototype.overlapsOppositeAxis=function(e,t){switch(t){case"+x":return this.lefte.right;case"+y":return this.tope.bottom}},T.prototype.intersectPercentage=function(e){return Math.max(0,Math.min(this.right,e.right)-Math.max(this.left,e.left))*Math.max(0,Math.min(this.bottom,e.bottom)-Math.max(this.top,e.top))/(this.height*this.width)},T.prototype.toCSSCompatValues=function(e){return{top:this.top-e.top,bottom:e.bottom-this.bottom,left:this.left-e.left,right:e.right-this.right,height:this.height,width:this.width}},T.getSimpleBoxPosition=function(e){var t=e.div?e.div.offsetHeight:e.tagName?e.offsetHeight:0,i=e.div?e.div.offsetWidth:e.tagName?e.offsetWidth:0,n=e.div?e.div.offsetTop:e.tagName?e.offsetTop:0;return{left:(e=e.div?e.div.getBoundingClientRect():e.tagName?e.getBoundingClientRect():e).left,right:e.right,top:e.top||n,height:e.height||t,bottom:e.bottom||n+(e.height||t),width:e.width||i}},E.StringDecoder=function(){return{decode:function(e){if(!e)return"";if("string"!=typeof e)throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(e))}}},E.convertCueToDOMTree=function(e,t){return e&&t?m(e,t):null};E.processCues=function(e,t,i){if(!e||!t||!i)return null;for(;i.firstChild;)i.removeChild(i.firstChild);var n=e.document.createElement("div");if(n.style.position="absolute",n.style.left="0",n.style.right="0",n.style.top="0",n.style.bottom="0",n.style.margin="1.5%",i.appendChild(n),function(e){for(var t=0;t100)throw new Error("Position must be between 0 and 100.");m=e,this.hasBeenReset=!0}},positionAlign:{enumerable:!0,get:function(){return g},set:function(e){var t=a(e);t&&(g=t,this.hasBeenReset=!0)}},size:{enumerable:!0,get:function(){return _},set:function(e){if(e<0||e>100)throw new Error("Size must be between 0 and 100.");_=e,this.hasBeenReset=!0}},align:{enumerable:!0,get:function(){return y},set:function(e){var t=a(e);if(!t)throw new SyntaxError("align: an invalid or illegal alignment string was specified.");y=t,this.hasBeenReset=!0}}}),this.displayState=void 0}s.prototype.getCueAsHTML=function(){return WebVTT.convertCueToDOMTree(window,this.text)},t.exports=s},{}],51:[function(e,t,i){var n={"":!0,up:!0};function r(e){return"number"==typeof e&&e>=0&&e<=100}t.exports=function(){var e=100,t=3,i=0,a=100,s=0,o=100,u="";Object.defineProperties(this,{width:{enumerable:!0,get:function(){return e},set:function(t){if(!r(t))throw new Error("Width must be between 0 and 100.");e=t}},lines:{enumerable:!0,get:function(){return t},set:function(e){if("number"!=typeof e)throw new TypeError("Lines must be set to a number.");t=e}},regionAnchorY:{enumerable:!0,get:function(){return a},set:function(e){if(!r(e))throw new Error("RegionAnchorX must be between 0 and 100.");a=e}},regionAnchorX:{enumerable:!0,get:function(){return i},set:function(e){if(!r(e))throw new Error("RegionAnchorY must be between 0 and 100.");i=e}},viewportAnchorY:{enumerable:!0,get:function(){return o},set:function(e){if(!r(e))throw new Error("ViewportAnchorY must be between 0 and 100.");o=e}},viewportAnchorX:{enumerable:!0,get:function(){return s},set:function(e){if(!r(e))throw new Error("ViewportAnchorX must be between 0 and 100.");s=e}},scroll:{enumerable:!0,get:function(){return u},set:function(e){var t=function(e){return"string"==typeof e&&(!!n[e.toLowerCase()]&&e.toLowerCase())}(e);!1===t||(u=t)}}})}},{}],52:[function(e,t,i){"use strict";t.exports={DEFAILT_WEBGL_PLAY_ID:"glplayer",PLAYER_IN_TYPE_MP4:"mp4",PLAYER_IN_TYPE_FLV:"flv",PLAYER_IN_TYPE_HTTPFLV:"httpflv",PLAYER_IN_TYPE_RAW_265:"raw265",PLAYER_IN_TYPE_TS:"ts",PLAYER_IN_TYPE_MPEGTS:"mpegts",PLAYER_IN_TYPE_M3U8:"hls",PLAYER_IN_TYPE_M3U8_VOD:"m3u8",PLAYER_IN_TYPE_M3U8_LIVE:"hls",APPEND_TYPE_STREAM:0,APPEND_TYPE_FRAME:1,APPEND_TYPE_SEQUENCE:2,DEFAULT_WIDTH:600,DEFAULT_HEIGHT:600,DEFAULT_FPS:30,DEFAULT_FRAME_DUR:40,DEFAULT_FIXED:!1,DEFAULT_SAMPLERATE:44100,DEFAULT_CHANNELS:2,DEFAULT_CONSU_SAMPLE_LEN:20,PLAYER_MODE_VOD:"vod",PLAYER_MODE_NOTIME_LIVE:"live",AUDIO_MODE_ONCE:"ONCE",AUDIO_MODE_SWAP:"SWAP",DEFAULT_STRING_LIVE:"LIVE",CODEC_H265:0,CODEC_H264:1,PLAYER_CORE_TYPE_DEFAULT:0,PLAYER_CORE_TYPE_CNATIVE:1,URI_PROTOCOL_WEBSOCKET:"ws",URI_PROTOCOL_WEBSOCKET_DESC:"websocket",URI_PROTOCOL_HTTP:"http",URI_PROTOCOL_HTTP_DESC:"http",FETCH_FIRST_MAX_TIMES:5,FETCH_HTTP_FLV_TIMEOUT_MS:7e3,V_CODEC_NAME_HEVC:265,V_CODEC_NAME_AVC:264,V_CODEC_NAME_UNKN:500,A_CODEC_NAME_AAC:112,A_CODEC_NAME_MP3:113,A_CODEC_NAME_UNKN:500,CACHE_NO_LOADCACHE:192,CACHE_WITH_PLAY_SIGN:193,CACHE_WITH_NOPLAY_SIGN:194}},{}],53:[function(e,t,i){"use strict";var n=window.AudioContext||window.webkitAudioContext,r=e("../consts"),a=e("./av-common");t.exports=function(e){var t={options:{sampleRate:e.sampleRate||r.DEFAULT_SAMPLERATE,appendType:e.appendType||r.APPEND_TYPE_STREAM,playMode:e.playMode||r.AUDIO_MODE_SWAP},sourceChannel:-1,audioCtx:new n({latencyHint:"interactive",sampleRate:e.sampleRate}),gainNode:null,sourceList:[],startStatus:!1,sampleQueue:[],nextBuffer:null,playTimestamp:0,playStartTime:0,durationMs:-1,isLIVE:!1,voice:1,onLoadCache:null,resetStartParam:function(){t.playTimestamp=0,t.playStartTime=0},setOnLoadCache:function(e){t.onLoadCache=e},setDurationMs:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1;t.durationMs=e},setVoice:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;t.voice=e,t.gainNode.gain.value=e},getAlignVPTS:function(){return t.playTimestamp+(a.GetMsTime()-t.playStartTime)/1e3},swapSource:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;if(0==t.startStatus)return null;if(e<0||e>=t.sourceList.length)return null;if(i<0||i>=t.sourceList.length)return null;try{t.sourceChannel===e&&null!==t.sourceList[e]&&(t.sourceList[e].disconnect(t.gainNode),t.sourceList[e]=null)}catch(t){console.error("[DEFINE ERROR] audioModule disconnect source Index:"+e+" error happened!",t)}t.sourceChannel=i;var n=t.decodeSample(i,e);-2==n&&t.isLIVE&&(t.getAlignVPTS()>=t.durationMs/1e3-.04?t.pause():null!==t.onLoadCache&&t.onLoadCache())},addSample:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return!(null==e||!e||null==e)&&(0==t.sampleQueue.length&&(t.seekPos=e.pts),t.sampleQueue.push(e),!0)},runNextBuffer:function(){window.setInterval((function(){if(!(null!=t.nextBuffer||t.sampleQueue.length0&&void 0!==arguments[0]?arguments[0]:-1,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;if(e<0||e>=t.sourceList.length)return-1;if(null!=t.sourceList[e]&&null!=t.sourceList[e]&&t.sourceList[e]||(t.sourceList[e]=t.audioCtx.createBufferSource(),t.sourceList[e].onended=function(){t.swapSource(e,i)}),0==t.sampleQueue.length)return t.isLIVE?(t.sourceList[e].connect(t.gainNode),t.sourceList[e].start(),t.sourceList[e].onended=function(){t.swapSource(e,i)},t.sourceList[e].stop(),0):-2;if(t.sourceList[e].buffer)return t.sourceList[e],t.sourceList[i],t.gainNode,t.swapSource(e,i),0;if(null==t.nextBuffer||t.nextBuffer.data.length<1)return t.sourceList[e].connect(t.gainNode),t.sourceList[e].start(),t.sourceList[e].startState=!0,t.sourceList[e].stop(),1;var n=t.nextBuffer.data.buffer;t.playTimestamp=t.nextBuffer.pts,t.playStartTime=a.GetMsTime();try{t.audioCtx.decodeAudioData(n,(function(i){null!==t.sourceList[e]&&(t.sourceList[e].buffer=i,t.sourceList[e].connect(t.gainNode),t.sourceList[e].start(),t.sourceList[e].startState=!0)}),(function(e){}))}catch(e){return t.nextBuffer=null,-3}return t.nextBuffer=null,0},decodeWholeSamples:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1;if(t.sourceChannel=e,e<0||e>=t.sourceList.length)return-1;if(null!=t.sourceList[e]&&null!=t.sourceList[e]&&t.sourceList[e]||(t.sourceList[e]=t.audioCtx.createBufferSource(),t.sourceList[e].onended=function(){}),0==t.sampleQueue.length)return-2;for(var i=null,n=null,a=0;a=2){var s=i.length/2;a=new Float32Array(s);for(var o=0,u=0;u0&&s()-this._start_time>=this._now_seg_dur&&(s(),this._start_time,this._now_seg_dur,this._start_time=-1,this._now_seg_dur=-1),s(),this._start_time<0)if(new Date,null!==this._pcm_array_buf&&this._pcm_array_buf.length>this._push_start_idx){this._swapStartPlay=!1;var e=this._push_start_idx+this._once_pop_len;e>this._pcm_array_buf.length&&(e=this._pcm_array_buf.length);var t=this._pcm_array_buf.slice(this._push_start_idx,e);this._push_start_idx+=t.length,this._now_seg_dur=1*t.length/this._sample_rate*1e3,t.length,this._sample_rate,this._now_seg_dur;var i=this._ctx.createBuffer(1,t.length,this._sample_rate);t.length,new Date,i.copyToChannel(t,0),this._active_node=this._ctx.createBufferSource(),this._active_node.buffer=i,this._active_node.connect(this._gain),this._start_time=s(),this._active_node.start(0)}else setTimeout(this.readingLoopWithF32,1)}}])&&n(t.prototype,i),o&&n(t,o),e}();i.AudioPcmPlayer=o},{"../consts":52}],55:[function(e,t,i){"use strict";var n=e("../consts"),r=[{format:"mp4",value:"mp4",core:n.PLAYER_CORE_TYPE_CNATIVE},{format:"mov",value:"mp4",core:n.PLAYER_CORE_TYPE_CNATIVE},{format:"flv",value:"flv",core:n.PLAYER_CORE_TYPE_CNATIVE},{format:"m3u8",value:"hls",core:n.PLAYER_CORE_TYPE_DEFAULT},{format:"m3u",value:"hls",core:n.PLAYER_CORE_TYPE_DEFAULT},{format:"ts",value:"ts",core:n.PLAYER_CORE_TYPE_DEFAULT},{format:"mpegts",value:"ts",core:n.PLAYER_CORE_TYPE_DEFAULT},{format:"hevc",value:"raw265",core:n.PLAYER_CORE_TYPE_DEFAULT},{format:"h265",value:"raw265",core:n.PLAYER_CORE_TYPE_DEFAULT}],a=[{format:n.URI_PROTOCOL_HTTP,value:n.URI_PROTOCOL_HTTP_DESC},{format:n.URI_PROTOCOL_WEBSOCKET,value:n.URI_PROTOCOL_WEBSOCKET_DESC}];t.exports={frameDataAlignCrop:function(e,t,i,n,r,a,s,o){if(0==e-n)return[a,s,o];for(var u=n*r,l=u/4,d=new Uint8Array(u),h=new Uint8Array(l),c=new Uint8Array(l),f=n,p=n/2,m=0;m=0)return i.value}return r[0].value},GetFormatPlayCore:function(e){for(var t=0;t=0)return i.value}return a[0].value},GetMsTime:function(){return(new Date).getTime()}}},{"../consts":52}],56:[function(e,t,i){"use strict";function n(e,t){for(var i=0;i0&&(t.getPackageTimeMS=a.GetMsTime()),t.pushPkg++,void 0!==t.AVGetInterval&&null!==t.AVGetInterval||(t.AVGetInterval=window.setInterval((function(){Module.cwrap("getBufferLengthApi","number",["number"])(t.AVSniffPtr)>t.config.probeSize?(Module.cwrap("getSniffHttpFlvPkg","number",["number"])(t.AVSniffPtr),t.pushPkg-=1):t.getPackageTimeMS>0&&a.GetMsTime()-t.getPackageTimeMS>=o.FETCH_HTTP_FLV_TIMEOUT_MS&&(t.getPackageTimeMS=a.GetMsTime(),t.workerFetch.postMessage({cmd:"retry",data:null,msg:"retry"}))}),5));break;case"close":t.AVGetInterval&&clearInterval(t.AVGetInterval),t.AVGetInterval=null;case"fetch-fin":break;case"fetch-error":t.onNetworkError&&t.onNetworkError(i.data)}}},{key:"_checkDisplaySize",value:function(e,t,i){var n=t-e,r=this.config.width+Math.ceil(n/2),a=t/this.config.width>i/this.config.height,s=(r/t).toFixed(2),o=(this.config.height/i).toFixed(2),u=a?s:o,l=this.config.fixed,d=l?r:parseInt(t*u),h=l?this.config.height:parseInt(i*u);if(this.CanvasObj.offsetWidth!=d||this.CanvasObj.offsetHeight!=h){var c=parseInt((this.canvasBox.offsetHeight-h)/2),f=parseInt((this.canvasBox.offsetWidth-d)/2);c=c<0?0:c,f=f<0?0:f,this.CanvasObj.style.marginTop=c+"px",this.CanvasObj.style.marginLeft=f+"px",this.CanvasObj.style.width=d+"px",this.CanvasObj.style.height=h+"px"}return this.isCheckDisplay=!0,[d,h]}},{key:"_ptsFixed2",value:function(e){return Math.ceil(100*e)/100}},{key:"_callbackProbe",value:function(e,t,i,n,r,a,u,l,d){for(var h=Module.HEAPU8.subarray(d,d+10),c=0;c100&&(f=o.DEFAULT_FPS,this.mediaInfo.noFPS=!0),this.vCodecID=l,this.config.fps=f,this.mediaInfo.fps=f,this.mediaInfo.size.width=t,this.mediaInfo.size.height=i,this.frameTime=Math.floor(1e3/(this.mediaInfo.fps+2)),this.CanvasObj.width==t&&this.CanvasObj.height==i||(this.CanvasObj.width=t,this.CanvasObj.height=i,this.isCheckDisplay)||this._checkDisplaySize(t,t,i),r>=0&&!1===this.mediaInfo.noFPS&&this.config.ignoreAudio<1?(void 0!==this.audioWAudio&&null!==this.audioWAudio&&(this.audioWAudio.stop(),this.audioWAudio=null),this.config.sampleRate=a,this.mediaInfo.sampleRate=a,this.audioWAudio=s({sampleRate:this.mediaInfo.sampleRate,appendType:o.APPEND_TYPE_FRAME}),this.audioWAudio.isLIVE=!0):this.mediaInfo.audioNone=!0,this.onProbeFinish&&this.onProbeFinish()}},{key:"_callbackYUV",value:function(e,t,i,n,r,a,s,o,u){var l=Module.HEAPU8.subarray(e,e+n*o),d=new Uint8Array(l),h=Module.HEAPU8.subarray(t,t+r*o/2),c=new Uint8Array(h),f=Module.HEAPU8.subarray(i,i+a*o/2),p={bufY:d,bufU:c,bufV:new Uint8Array(f),line_y:n,h:o,pts:u};this.YuvBuf.push(p),this.checkCacheState(),Module._free(l),l=null,Module._free(h),h=null,Module._free(f),f=null,!1===this.readyShowDone&&(this.playYUV(),this.readyShowDone=!0,this.onReadyShowDone&&this.onReadyShowDone(),this.audioWAudio||this.play())}},{key:"_callbackNALU",value:function(e,t,i,n,r,a,s){if(!1===this.readyKeyFrame){if(i<=0)return;this.readyKeyFrame=!0}var o=Module.HEAPU8.subarray(e,e+t),u=new Uint8Array(o);this.NaluBuf.push({bufData:u,len:t,isKey:i,w:n,h:r,pts:1e3*a,dts:1e3*s}),Module._free(o),o=null}},{key:"_callbackPCM",value:function(e){}},{key:"_callbackAAC",value:function(e,t,i,n,r){var a=this._ptsFixed2(r);if(this.audioWAudio){var s=new Uint8Array(7+i),o=Module.HEAPU8.subarray(e,e+7);s.set(o,0);var u=Module.HEAPU8.subarray(t,t+i);s.set(u,7);var l={pts:a,data:s};this.audioWAudio.addSample(l),this.checkCacheState()}}},{key:"_decode",value:function(){var e=this;setTimeout((function(){if(null!==e.workerFetch){var t=e.NaluBuf.shift();if(null!=t){var i=Module._malloc(t.bufData.length);Module.HEAP8.set(t.bufData,i),Module.cwrap("decodeHttpFlvVideoFrame","number",["number","number","number","number","number"])(e.AVSniffPtr,i,t.bufData.length,t.pts,t.dts,0),Module._free(i),i=null}e._decode()}}),1)}},{key:"checkCacheState",value:function(){var e=this.YuvBuf.length>=25&&(!0===this.mediaInfo.audioNone||this.audioWAudio&&this.audioWAudio.sampleQueue.length>=50);return!1===this.cache_status&&e&&(this.playInterval&&this.audioWAudio&&this.audioWAudio.play(),this.onLoadCacheFinshed&&this.onLoadCacheFinshed(),this.cache_status=!0),e}},{key:"setVoice",value:function(e){this.audioVoice=e,this.audioWAudio&&this.audioWAudio.setVoice(e)}},{key:"_removeBindFuncPtr",value:function(){null!==this._ptr_probeCallback&&Module.removeFunction(this._ptr_probeCallback),null!==this._ptr_frameCallback&&Module.removeFunction(this._ptr_frameCallback),null!==this._ptr_naluCallback&&Module.removeFunction(this._ptr_naluCallback),null!==this._ptr_sampleCallback&&Module.removeFunction(this._ptr_sampleCallback),null!==this._ptr_aacCallback&&Module.removeFunction(this._ptr_aacCallback),this._ptr_probeCallback=null,this._ptr_frameCallback=null,this._ptr_naluCallback=null,this._ptr_sampleCallback=null,this._ptr_aacCallback=null}},{key:"release",value:function(){return this.pause(),this.NaluBuf.length=0,this.YuvBuf.length=0,void 0!==this.workerFetch&&null!==this.workerFetch&&this.workerFetch.postMessage({cmd:"stop",data:"stop",msg:"stop"}),this.workerFetch=null,this.AVGetInterval&&clearInterval(this.AVGetInterval),this.AVGetInterval=null,this._removeBindFuncPtr(),Module.cwrap("releaseHttpFLV","number",["number"])(this.AVSniffPtr),this.playInterval&&clearInterval(this.playInterval),this.playInterval=null,this.audioWAudio&&this.audioWAudio.stop(),this.audioWAudio=null,this.CanvasObj&&this.CanvasObj.remove(),this.CanvasObj=null,0}},{key:"isPlayingState",value:function(){return null!==this.playInterval&&void 0!==this.playInterval}},{key:"pause",value:function(){this.audioWAudio&&this.audioWAudio.pause(),this.playInterval&&clearInterval(this.playInterval),this.playInterval=null}},{key:"playYUV",value:function(){if(this.YuvBuf.length>0){var e=this.YuvBuf.shift();return r.renderFrame(this.AVGLObj,e.bufY,e.bufU,e.bufV,e.line_y,e.h),!0}return!1}},{key:"play",value:function(){var e=this,t=this;if(!1===this.checkCacheState())return this.onLoadCache&&this.onLoadCache(),setTimeout((function(){e.play()}),100),!1;if(void 0===this.playInterval||null===this.playInterval){var i=0,n=0,s=0;!1===this.mediaInfo.audioNone&&this.audioWAudio&&!1===this.mediaInfo.noFPS?(this.playInterval=setInterval((function(){if(n=a.GetMsTime(),t.cache_status){if(n-i>=t.frameTime-s){var e=t.YuvBuf.shift();if(null!=e&&null!==e){var o=0;null!==t.audioWAudio&&void 0!==t.audioWAudio&&(o=1e3*(e.pts-t.audioWAudio.getAlignVPTS())),s=t.audioWAudio?o<0&&-1*o<=t.frameTime||o>=0?a.GetMsTime()-n+1:t.frameTime:a.GetMsTime()-n+1,r.renderFrame(t.AVGLObj,e.bufY,e.bufU,e.bufV,e.line_y,e.h)}(t.YuvBuf.length<=0||t.audioWAudio&&t.audioWAudio.sampleQueue.length<=0)&&(t.cache_status=!1,t.onLoadCache&&t.onLoadCache(),t.audioWAudio&&t.audioWAudio.pause()),i=n}}else s=t.frameTime}),1),this.audioWAudio&&this.audioWAudio.play()):this.playInterval=setInterval((function(){var e=t.YuvBuf.shift();null!=e&&null!==e&&r.renderFrame(t.AVGLObj,e.bufY,e.bufU,e.bufV,e.line_y,e.h),t.YuvBuf.length<=0&&(t.cache_status=!1)}),t.frameTime)}}},{key:"start",value:function(e){var t,i,n,a=this;this.workerFetch=new Worker((t=function(){var e=null,t=new AbortController,i=t.signal,n=(self,function(e){var t=!1;t||(t=!0,fetch(e,{signal:i}).then((function(e){return function e(t){return t.read().then((function(i){if(!i.done){var n=i.value;return self.postMessage({cmd:"fetch-chunk",data:n,msg:"fetch-chunk"}),e(t)}self.postMessage({cmd:"fetch-fin",data:null,msg:"fetch-fin"})}))}(e.body.getReader())})).catch((function(e){if(!e.toString().includes("user aborted")){var t=" httplive request error:"+e+" start to retry";console.error(t),self.postMessage({cmd:"fetch-error",data:t,msg:"fetch-error"})}})))});self.onmessage=function(r){var a=r.data;switch(void 0===a.cmd||null===a.cmd?"":a.cmd){case"start":e=a.data,n(e),self.postMessage({cmd:"default",data:"WORKER STARTED",msg:"default"});break;case"stop":t.abort(),self.close(),self.postMessage({cmd:"close",data:"close",msg:"close"});break;case"retry":t.abort(),t=null,i=null,t=new AbortController,i=t.signal,setTimeout((function(){n(e)}),3e3)}}}.toString(),i=t.match(/^\s*function\s*\(\s*\)\s*\{(([\s\S](?!\}$))*[\s\S])/),n=[i[1]],window.URL.createObjectURL(new Blob(n,{type:"text/javascript"})))),this.workerFetch.onmessage=function(e){a._workerFetch_onmessage(e,a)},this.workerFetch,this.AVSniffPtr=Module.cwrap("AVSniffHttpFlvInit","number",["string","string"])("base64:QXV0aG9yOmNoYW5neWFubG9uZ3xudW1iZXJ3b2xmLEdpdGh1YjpodHRwczovL2dpdGh1Yi5jb20vbnVtYmVyd29sZixFbWFpbDpwb3JzY2hlZ3QyM0Bmb3htYWlsLmNvbSxRUTo1MzEzNjU4NzIsSG9tZVBhZ2U6aHR0cDovL3h2aWRlby52aWRlbyxEaXNjb3JkOm51bWJlcndvbGYjODY5NCx3ZWNoYXI6bnVtYmVyd29sZjExLEJlaWppbmcsV29ya0luOkJhaWR1","0.0.0"),this.AVSniffPtr,this._ptr_probeCallback=Module.addFunction(this._callbackProbe.bind(this)),this._ptr_yuvCallback=Module.addFunction(this._callbackYUV.bind(this)),this._ptr_naluCallback=Module.addFunction(this._callbackNALU.bind(this)),this._ptr_sampleCallback=Module.addFunction(this._callbackPCM.bind(this)),this._ptr_aacCallback=Module.addFunction(this._callbackAAC.bind(this)),Module.cwrap("initializeSniffHttpFlvModule","number",["number","number","number","number","number","number"])(this.AVSniffPtr,this._ptr_probeCallback,this._ptr_yuvCallback,this._ptr_naluCallback,this._ptr_sampleCallback,this._ptr_aacCallback),this.AVGLObj=r.setupCanvas(this.CanvasObj,{preserveDrawingBuffer:!1}),this.workerFetch.postMessage({cmd:"start",data:e,msg:"start"}),this._decode()}}])&&n(t.prototype,i),u&&n(t,u),e}();i.CHttpLiveCore=u},{"../consts":52,"../demuxer/buffer":64,"../demuxer/bufferFrame":65,"../render-engine/webgl-420p":77,"../version":80,"./audio-core":53,"./audio-native-core":54,"./av-common":55,"./cache":59,"./cacheYuv":60}],57:[function(e,t,i){"use strict";function n(e,t){for(var i=0;i0&&void 0!==arguments[0]&&arguments[0];this.showScreen=e,this.canvas&&(e?this.canvas.setAttribute("hidden",!0):this.canvas.removeAttribute("hidden"))}},{key:"getCachePTS",value:function(){return 1!==this.config.ignoreAudio&&this.audioWAudio?Math.max(this.vCachePTS,this.aCachePTS):this.vCachePTS}},{key:"getMaxPTS",value:function(){return Math.max(this.vCachePTS,this.aCachePTS)}},{key:"isPlayingState",value:function(){return this.isPlaying}},{key:"pushDone",value:function(){this.pushEOF=!0}},{key:"_clearDecInterval",value:function(){this.decVFrameInterval&&window.clearInterval(this.decVFrameInterval),this.decVFrameInterval=null}},{key:"_checkPlayFinished",value:function(){return!(this.config.playMode!==d.PLAYER_MODE_VOD||!(!0===this.bufRecvStat&&(this.playPTS>=this.bufLastVDTS||this.audioWAudio&&this.playPTS>=this.bufLastADTS)||this.duration-this.playPTS0&&(this.isPlaying=!0);var t=0,i=0,n=0;this.config.playMode===d.PLAYER_MODE_NOTIME_LIVE?this.playFrameInterval=window.setInterval((function(){if(e._videoQueue.length>0){var t=e._videoQueue.shift();t.pts,o.renderFrame(e.yuv,t.data_y,t.data_u,t.data_v,t.line1,t.height)}}),1e3*this.frameDur):this.playFrameInterval=window.setInterval((function(){if(i=u.GetMsTime(),e._videoQueue.length>0&&i-t>=e.frameTime-n){var r=e._videoQueue.shift(),a=0;if(e.isNewSeek||null===e.audioWAudio||void 0===e.audioWAudio||(a=1e3*(r.pts-e.audioWAudio.getAlignVPTS()),e.playPTS=Math.max(e.audioWAudio.getAlignVPTS(),e.playPTS)),t=i,u.GetMsTime(),e.playPTS=Math.max(r.pts,e.playPTS),e.isNewSeek&&e.seekTarget-e.frameDur>r.pts)return void(n=e.frameTime);if(e.isNewSeek&&(e.audioWAudio&&e.audioWAudio.setVoice(e.audioVoice),e.audioWAudio&&e.audioWAudio.play(),n=0,e.isNewSeek=!1,e.seekTarget=0),e.showScreen?e.onRender&&e.onRender(r.line1,r.height,r.data_y,r.data_u,r.data_v):(r.pts,o.renderFrame(e.yuv,r.data_y,r.data_u,r.data_v,r.line1,r.height)),e.onPlayingTime&&e.onPlayingTime(r.pts),!e.isNewSeek&&e.audioWAudio&&(a<0&&-1*a<=e.frameTime||a>=0)){if(e.config.playMode===d.PLAYER_MODE_VOD)if(r.pts>=e.duration)e.onLoadCacheFinshed&&e.onLoadCacheFinshed(),e.onPlayingFinish&&e.onPlayingFinish(),e._clearDecInterval(),e.pause();else if(e._checkPlayFinished())return;n=u.GetMsTime()-i}else!e.isNewSeek&&e.audioWAudio&&(a<0&&e.frameTime,n=e.frameTime)}e._checkPlayFinished()}),1)}this.isNewSeek||this.audioWAudio&&this.audioWAudio.play()}},{key:"pause",value:function(){this.isPlaying=!1,this._pause()}},{key:"_pause",value:function(){this.playFrameInterval&&window.clearInterval(this.playFrameInterval),this.playFrameInterval=null,this.audioWAudio&&this.audioWAudio.pause()}},{key:"seek",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.openFrameCall=!1,this.pause(),this._clearDecInterval(),null!==this.avFeedVideoInterval&&(window.clearInterval(this.avFeedVideoInterval),this.avFeedVideoInterval=null),null!==this.avFeedAudioInterval&&(window.clearInterval(this.avFeedAudioInterval),this.avFeedAudioInterval=null),this.yuvMaxTime=0,this.playVPipe.length=0,this._videoQueue.length=0,this.audioWAudio&&this.audioWAudio.stop(),e&&e(),this.isNewSeek=!0,this.avSeekVState=!0,this.seekTarget=i.seekTime,null!==this.audioWAudio&&void 0!==this.audioWAudio&&(this.audioWAudio.setVoice(0),this.audioWAudio.resetStartParam(),this.audioWAudio.stop()),this._avFeedData(i.seekTime),setTimeout((function(){t.yuvMaxTime=0,t._videoQueue.length=0,t.openFrameCall=!0,t.frameCallTag+=1,t._decVFrameIntervalFunc()}),1e3)}},{key:"setVoice",value:function(e){this.audioVoice=e,this.audioWAudio&&this.audioWAudio.setVoice(e)}},{key:"cacheIsFull",value:function(){return this._videoQueue.length>=50}},{key:"_checkDisplaySize",value:function(e,t,i){var n=t-e,r=this.config.width+Math.ceil(n/2),a=t/this.config.width>i/this.config.height,s=(r/t).toFixed(2),o=(this.config.height/i).toFixed(2),u=a?s:o,l=this.config.fixed,d=l?r:parseInt(t*u),h=l?this.config.height:parseInt(i*u);if(this.canvas.offsetWidth!=d||this.canvas.offsetHeight!=h){var c=parseInt((this.canvasBox.offsetHeight-h)/2),f=parseInt((this.canvasBox.offsetWidth-d)/2);c=c<0?0:c,f=f<0?0:f,this.canvas.style.marginTop=c+"px",this.canvas.style.marginLeft=f+"px",this.canvas.style.width=d+"px",this.canvas.style.height=h+"px"}return this.isCheckDisplay=!0,[d,h]}},{key:"_createYUVCanvas",value:function(){this.canvasBox=document.querySelector("#"+this.config.playerId),this.canvasBox.style.overflow="hidden",this.canvas=document.createElement("canvas"),this.canvas.style.width=this.canvasBox.clientWidth+"px",this.canvas.style.height=this.canvasBox.clientHeight+"px",this.canvas.style.top="0px",this.canvas.style.left="0px",this.canvasBox.appendChild(this.canvas),this.yuv=o.setupCanvas(this.canvas,{preserveDrawingBuffer:!1})}},{key:"_avRecvPackets",value:function(){var e=this;this.bufObject.cleanPipeline(),null!==this.avRecvInterval&&(window.clearInterval(this.avRecvInterval),this.avRecvInterval=null),!0===this.config.checkProbe?this.avRecvInterval=window.setInterval((function(){Module.cwrap("getSniffStreamPkg","number",["number"])(e.corePtr),e._avCheckRecvFinish()}),5):this.avRecvInterval=window.setInterval((function(){Module.cwrap("getSniffStreamPkgNoCheckProbe","number",["number"])(e.corePtr),e._avCheckRecvFinish()}),5),this._avFeedData(0,!1)}},{key:"_avCheckRecvFinish",value:function(){this.config.playMode===d.PLAYER_MODE_VOD&&this.duration-this.getMaxPTS()=50&&(t.onSeekFinish&&t.onSeekFinish(),t.onPlayingTime&&t.onPlayingTime(e),t.play(),window.clearInterval(i),i=null)}),10);return!0}},{key:"_afterAvFeedSeekToStartWithUnFinBuffer",value:function(e){var t=this,i=window.setInterval((function(){t._videoQueue.length,t._videoQueue.length>=50&&(t.onSeekFinish&&t.onSeekFinish(),t.onPlayingTime&&t.onPlayingTime(e),!1===t.reFull?t.play():t.reFull=!1,window.clearInterval(i),i=null)}),10);return!0}},{key:"_avFeedData",value:function(e){var t=this;if(this.playVPipe.length=0,this.audioWAudio&&this.audioWAudio.cleanQueue(),e<=0&&!1===this.bufOK){var i=0;if(this.avFeedVideoInterval=window.setInterval((function(){var n=t.bufObject.videoBuffer.length;if(n-1>i||t.duration-t.getMaxPTS()0){for(var s=0;s0&&t.playVPipe[t.playVPipe.length-1].pts>=t.bufLastVDTS&&(window.clearInterval(t.avFeedVideoInterval),t.avFeedVideoInterval=null,t.playVPipe[t.playVPipe.length-1].pts,t.bufLastVDTS,t.bufObject.videoBuffer,t.playVPipe)}else t.config.playMode===d.PLAYER_MODE_VOD&&t.playVPipe.length>0&&t.playVPipe[t.playVPipe.length-1].pts>=t.duration&&(window.clearInterval(t.avFeedVideoInterval),t.avFeedVideoInterval=null,t.playVPipe[t.playVPipe.length-1].pts,t.duration,t.bufObject.videoBuffer,t.playVPipe);t.avSeekVState&&(t.getMaxPTS(),t.duration,t.config.playMode===d.PLAYER_MODE_VOD&&(t._afterAvFeedSeekToStartWithFinishedBuffer(e),t.avSeekVState=!1))}),5),void 0!==this.audioWAudio&&null!==this.audioWAudio&&this.config.ignoreAudio<1){var n=0;this.avFeedAudioInterval=window.setInterval((function(){var e=t.bufObject.audioBuffer.length;if(e-1>n||t.duration-t.getMaxPTS()0&&t.audioWAudio.sampleQueue[t.audioWAudio.sampleQueue.length-1].pts>=t.bufLastADTS&&(window.clearInterval(t.avFeedAudioInterval),t.avFeedAudioInterval=null,t.audioWAudio.sampleQueue[t.audioWAudio.sampleQueue.length-1].pts,t.bufObject.audioBuffer)}else t.config.playMode===d.PLAYER_MODE_VOD&&t.audioWAudio.sampleQueue.length>0&&t.audioWAudio.sampleQueue[t.audioWAudio.sampleQueue.length-1].pts>=t.duration&&(window.clearInterval(t.avFeedAudioInterval),t.avFeedAudioInterval=null,t.audioWAudio.sampleQueue[t.audioWAudio.sampleQueue.length-1].pts,t.bufObject.audioBuffer)}),5)}}else{var r=this.bufObject.seekIDR(e),s=parseInt(r,10);this.playPTS=0;var o=s;if(this.avFeedVideoInterval=window.setInterval((function(){var i=t.bufObject.videoBuffer.length;if(i-1>o||t.duration-t.getMaxPTS()0){for(var r=0;r0&&t.playVPipe[t.playVPipe.length-1].pts>=t.bufLastVDTS&&(window.clearInterval(t.avFeedVideoInterval),t.avFeedVideoInterval=null)}else t.config.playMode===d.PLAYER_MODE_VOD&&t.playVPipe.length>0&&t.playVPipe[t.playVPipe.length-1].pts>=t.duration&&(window.clearInterval(t.avFeedVideoInterval),t.avFeedVideoInterval=null);t.avSeekVState&&(t.getMaxPTS(),t.duration,t.config.playMode===d.PLAYER_MODE_VOD&&(t._afterAvFeedSeekToStartWithUnFinBuffer(e),t.avSeekVState=!1))}),5),this.audioWAudio&&this.config.ignoreAudio<1){var u=parseInt(e,10);this.avFeedAudioInterval=window.setInterval((function(){var e=t.bufObject.audioBuffer.length;if(e-1>u||t.duration-t.getMaxPTS()0&&t.audioWAudio.sampleQueue[t.audioWAudio.sampleQueue.length-1].pts>=t.bufLastADTS&&(window.clearInterval(t.avFeedAudioInterval),t.avFeedAudioInterval=null)}else t.config.playMode===d.PLAYER_MODE_VOD&&t.audioWAudio.sampleQueue.length>0&&t.audioWAudio.sampleQueue[t.audioWAudio.sampleQueue.length-1].pts>=t.duration&&(window.clearInterval(t.avFeedAudioInterval),t.avFeedAudioInterval=null)}),5)}}}},{key:"_probeFinCallback",value:function(e,t,i,n,r,a,s,o,u){var h=this;this._createYUVCanvas(),d.V_CODEC_NAME_HEVC,this.config.fps=1*n,this.frameTime=1e3/this.config.fps,this.width=t,this.height=i,this.frameDur=1/this.config.fps,this.duration=e-this.frameDur,this.vCodecID=o,this.config.sampleRate=a,this.channels=s,this.audioIdx=r,this.duration<0&&(this.config.playMode=d.PLAYER_MODE_NOTIME_LIVE,this.frameTime,this.frameDur);for(var c=Module.HEAPU8.subarray(u,u+10),f=0;f=0&&this.config.ignoreAudio<1?(void 0!==this.audioWAudio&&null!==this.audioWAudio&&(this.audioWAudio.stop(),this.audioWAudio=null),this.audioWAudio=l({sampleRate:a,appendType:d.APPEND_TYPE_FRAME}),this.audioWAudio.setDurationMs(1e3*e),this.onLoadCache&&this.audioWAudio.setOnLoadCache((function(){if(h.retryAuSampleNo,h.retryAuSampleNo<=5){h.pause(),h.onLoadCache&&h.onLoadCache();var e=window.setInterval((function(){return h.retryAuSampleNo,h.audioWAudio.sampleQueue.length,h.audioWAudio.sampleQueue.length>2?(h.onLoadCacheFinshed&&h.onLoadCacheFinshed(),h.play(),h.retryAuSampleNo=0,window.clearInterval(e),void(e=null)):(h.retryAuSampleNo+=1,h.retryAuSampleNo>5?(h.play(),h.onLoadCacheFinshed&&h.onLoadCacheFinshed(),window.clearInterval(e),void(e=null)):void 0)}),1e3)}}))):this.audioNone=!0,this._avRecvPackets(),this._decVFrameIntervalFunc()),this.onProbeFinish&&this.onProbeFinish()}},{key:"_ptsFixed2",value:function(e){return Math.ceil(100*e)/100}},{key:"_naluCallback",value:function(e,t,i,n,r,a,s){var o=this._ptsFixed2(a),u=Module.HEAPU8.subarray(e,e+t),l=new Uint8Array(u);this.bufObject.appendFrameWithDts(o,s,l,!0,i),this.bufLastVDTS=Math.max(s,this.bufLastVDTS),this.vCachePTS=Math.max(o,this.vCachePTS),this.onCacheProcess&&this.onCacheProcess(this.getCachePTS())}},{key:"_samplesCallback",value:function(e,t,i,n){}},{key:"_aacFrameCallback",value:function(e,t,i,n,r){var a=this._ptsFixed2(r);if(this.audioWAudio){var s=new Uint8Array(7+i),o=Module.HEAPU8.subarray(e,e+7);s.set(o,0);var u=Module.HEAPU8.subarray(t,t+i);s.set(u,7),this.bufObject.appendFrame(a,s,!1,!0),this.bufLastADTS=Math.max(a,this.bufLastADTS),this.aCachePTS=Math.max(a,this.aCachePTS),this.onCacheProcess&&this.onCacheProcess(this.getCachePTS())}}},{key:"_decVFrameIntervalFunc",value:function(){var e=this;null==this.decVFrameInterval&&(this.decVFrameInterval=window.setInterval((function(){if(e._videoQueue.length<50&&e.playVPipe.length>0){var t=e.playVPipe.shift(),i=t.data,n=Module._malloc(i.length);Module.HEAP8.set(i,n);var r=parseInt(1e3*t.pts,10),a=parseInt(1e3*t.dts,10);e.yuvMaxTime=Math.max(t.pts,e.yuvMaxTime),Module.cwrap("decodeVideoFrame","number",["number","number","number","number","number"])(e.corePtr,n,i.length,r,a,e.frameCallTag),Module._free(n),n=null}}),10))}},{key:"_frameCallback",value:function(e,t,i,n,r,a,s,u,l,d){if(this._videoQueue.length,!(!1===this.openFrameCall||d!==this.frameCallTag||l>this.yuvMaxTime+this.frameDur||this.isNewSeek&&this.seekTarget-l>3*this.frameDur)){var h=this._videoQueue.length;if(this.canvas.width==n&&this.canvas.height==u||(this.canvas.width=n,this.canvas.height=u,this.isCheckDisplay)||this._checkDisplaySize(s,n,u),!(this.playPTS>l)){var f=Module.HEAPU8.subarray(e,e+n*u),p=Module.HEAPU8.subarray(t,t+r*u/2),m=Module.HEAPU8.subarray(i,i+a*u/2),g=new Uint8Array(f),_=new Uint8Array(p),y=new Uint8Array(m);this.config.readyShow&&(o.renderFrame(this.yuv,g,_,y,n,u),this.config.readyShow=!1,this.onReadyShowDone&&this.onReadyShowDone());var v=new c(g,_,y,n,r,a,s,u,l);if(h<=0||l>this._videoQueue[h-1].pts)this._videoQueue.push(v);else if(lthis._videoQueue[b].pts&&b+10&&(t.getPackageTimeMS=a.GetMsTime()),t.pushPkg++,void 0!==t.AVGetInterval&&null!==t.AVGetInterval||(t.AVGetInterval=window.setInterval((function(){Module.cwrap("getBufferLengthApi","number",["number"])(t.AVSniffPtr)>t.config.probeSize&&(Module.cwrap("getSniffHttpFlvPkg","number",["number"])(t.AVSniffPtr),t.pushPkg-=1)}),5));break;case"close":t.AVGetInterval&&clearInterval(t.AVGetInterval),t.AVGetInterval=null;case"fetch-fin":break;case"fetch-error":t.onNetworkError&&t.onNetworkError(i.data)}}},{key:"_checkDisplaySize",value:function(e,t,i){var n=t-e,r=this.config.width+Math.ceil(n/2),a=t/this.config.width>i/this.config.height,s=(r/t).toFixed(2),o=(this.config.height/i).toFixed(2),u=a?s:o,l=this.config.fixed,d=l?r:parseInt(t*u),h=l?this.config.height:parseInt(i*u);if(this.CanvasObj.offsetWidth!=d||this.CanvasObj.offsetHeight!=h){var c=parseInt((this.canvasBox.offsetHeight-h)/2),f=parseInt((this.canvasBox.offsetWidth-d)/2);c=c<0?0:c,f=f<0?0:f,this.CanvasObj.style.marginTop=c+"px",this.CanvasObj.style.marginLeft=f+"px",this.CanvasObj.style.width=d+"px",this.CanvasObj.style.height=h+"px"}return this.isCheckDisplay=!0,[d,h]}},{key:"_ptsFixed2",value:function(e){return Math.ceil(100*e)/100}},{key:"_callbackProbe",value:function(e,t,i,n,r,a,u,l,d){for(var h=Module.HEAPU8.subarray(d,d+10),c=0;c100&&(f=o.DEFAULT_FPS,this.mediaInfo.noFPS=!0),this.vCodecID=l,this.config.fps=f,this.mediaInfo.fps=f,this.mediaInfo.size.width=t,this.mediaInfo.size.height=i,this.frameTime=Math.floor(1e3/(this.mediaInfo.fps+2)),this.CanvasObj.width==t&&this.CanvasObj.height==i||(this.CanvasObj.width=t,this.CanvasObj.height=i,this.isCheckDisplay)||this._checkDisplaySize(t,t,i),r>=0&&!1===this.mediaInfo.noFPS&&this.config.ignoreAudio<1?(void 0!==this.audioWAudio&&null!==this.audioWAudio&&(this.audioWAudio.stop(),this.audioWAudio=null),this.config.sampleRate=a,this.mediaInfo.sampleRate=a,this.audioWAudio=s({sampleRate:this.mediaInfo.sampleRate,appendType:o.APPEND_TYPE_FRAME}),this.audioWAudio.isLIVE=!0):this.mediaInfo.audioNone=!0,this.onProbeFinish&&this.onProbeFinish()}},{key:"_callbackYUV",value:function(e,t,i,n,r,a,s,o,u){var l=Module.HEAPU8.subarray(e,e+n*o),d=new Uint8Array(l),h=Module.HEAPU8.subarray(t,t+r*o/2),c=new Uint8Array(h),f=Module.HEAPU8.subarray(i,i+a*o/2),p={bufY:d,bufU:c,bufV:new Uint8Array(f),line_y:n,h:o,pts:u};this.YuvBuf.push(p),this.checkCacheState(),Module._free(l),l=null,Module._free(h),h=null,Module._free(f),f=null,!1===this.readyShowDone&&(this.playYUV(),this.readyShowDone=!0,this.onReadyShowDone&&this.onReadyShowDone(),this.audioWAudio||this.play())}},{key:"_callbackNALU",value:function(e,t,i,n,r,a,s){if(!1===this.readyKeyFrame){if(i<=0)return;this.readyKeyFrame=!0}var o=Module.HEAPU8.subarray(e,e+t),u=new Uint8Array(o);this.NaluBuf.push({bufData:u,len:t,isKey:i,w:n,h:r,pts:1e3*a,dts:1e3*s}),Module._free(o),o=null}},{key:"_callbackPCM",value:function(e){}},{key:"_callbackAAC",value:function(e,t,i,n,r){var a=this._ptsFixed2(r);if(this.audioWAudio){var s=new Uint8Array(7+i),o=Module.HEAPU8.subarray(e,e+7);s.set(o,0);var u=Module.HEAPU8.subarray(t,t+i);s.set(u,7);var l={pts:a,data:s};this.audioWAudio.addSample(l),this.checkCacheState()}}},{key:"_decode",value:function(){var e=this;setTimeout((function(){if(null!==e.workerFetch){var t=e.NaluBuf.shift();if(null!=t){var i=Module._malloc(t.bufData.length);Module.HEAP8.set(t.bufData,i),Module.cwrap("decodeHttpFlvVideoFrame","number",["number","number","number","number","number"])(e.AVSniffPtr,i,t.bufData.length,t.pts,t.dts,0),Module._free(i),i=null}e._decode()}}),1)}},{key:"checkCacheState",value:function(){var e=this.YuvBuf.length>=25&&(!0===this.mediaInfo.audioNone||this.audioWAudio&&this.audioWAudio.sampleQueue.length>=50);return!1===this.cache_status&&e&&(this.playInterval&&this.audioWAudio&&this.audioWAudio.play(),this.onLoadCacheFinshed&&this.onLoadCacheFinshed(),this.cache_status=!0),e}},{key:"setVoice",value:function(e){this.audioVoice=e,this.audioWAudio&&this.audioWAudio.setVoice(e)}},{key:"_removeBindFuncPtr",value:function(){null!==this._ptr_probeCallback&&Module.removeFunction(this._ptr_probeCallback),null!==this._ptr_frameCallback&&Module.removeFunction(this._ptr_frameCallback),null!==this._ptr_naluCallback&&Module.removeFunction(this._ptr_naluCallback),null!==this._ptr_sampleCallback&&Module.removeFunction(this._ptr_sampleCallback),null!==this._ptr_aacCallback&&Module.removeFunction(this._ptr_aacCallback),this._ptr_probeCallback=null,this._ptr_frameCallback=null,this._ptr_naluCallback=null,this._ptr_sampleCallback=null,this._ptr_aacCallback=null}},{key:"release",value:function(){return this.pause(),this.NaluBuf.length=0,this.YuvBuf.length=0,void 0!==this.workerFetch&&null!==this.workerFetch&&this.workerFetch.postMessage({cmd:"stop",data:"stop",msg:"stop"}),this.workerFetch=null,this.AVGetInterval&&clearInterval(this.AVGetInterval),this.AVGetInterval=null,this._removeBindFuncPtr(),Module.cwrap("releaseHttpFLV","number",["number"])(this.AVSniffPtr),this.playInterval&&clearInterval(this.playInterval),this.playInterval=null,this.audioWAudio&&this.audioWAudio.stop(),this.audioWAudio=null,this.CanvasObj&&this.CanvasObj.remove(),this.CanvasObj=null,0}},{key:"isPlayingState",value:function(){return null!==this.playInterval&&void 0!==this.playInterval}},{key:"pause",value:function(){this.audioWAudio&&this.audioWAudio.pause(),this.playInterval&&clearInterval(this.playInterval),this.playInterval=null}},{key:"playYUV",value:function(){if(this.YuvBuf.length>0){var e=this.YuvBuf.shift();return r.renderFrame(this.AVGLObj,e.bufY,e.bufU,e.bufV,e.line_y,e.h),!0}return!1}},{key:"play",value:function(){var e=this,t=this;if(!1===this.checkCacheState())return this.onLoadCache&&this.onLoadCache(),setTimeout((function(){e.play()}),100),!1;if(void 0===this.playInterval||null===this.playInterval){var i=0,n=0,s=0;!1===this.mediaInfo.audioNone&&this.audioWAudio&&!1===this.mediaInfo.noFPS?(this.playInterval=setInterval((function(){if(n=a.GetMsTime(),t.cache_status){if(n-i>=t.frameTime-s){var e=t.YuvBuf.shift();if(null!=e&&null!==e){var o=0;null!==t.audioWAudio&&void 0!==t.audioWAudio&&(o=1e3*(e.pts-t.audioWAudio.getAlignVPTS())),s=t.audioWAudio?o<0&&-1*o<=t.frameTime||o>=0?a.GetMsTime()-n+1:t.frameTime:a.GetMsTime()-n+1,r.renderFrame(t.AVGLObj,e.bufY,e.bufU,e.bufV,e.line_y,e.h)}(t.YuvBuf.length<=0||t.audioWAudio&&t.audioWAudio.sampleQueue.length<=0)&&(t.cache_status=!1,t.onLoadCache&&t.onLoadCache(),t.audioWAudio&&t.audioWAudio.pause()),i=n}}else s=t.frameTime}),1),this.audioWAudio&&this.audioWAudio.play()):this.playInterval=setInterval((function(){var e=t.YuvBuf.shift();null!=e&&null!==e&&r.renderFrame(t.AVGLObj,e.bufY,e.bufU,e.bufV,e.line_y,e.h),t.YuvBuf.length<=0&&(t.cache_status=!1)}),t.frameTime)}}},{key:"start",value:function(e){var t,i,n,a=this;this.workerFetch=new Worker((t=function(){var e=null;self,self.onmessage=function(t){var i=t.data;switch(void 0===i.cmd||null===i.cmd?"":i.cmd){case"start":var n=i.data;(e=new WebSocket(n)).binaryType="arraybuffer",e.onopen=function(t){e.send("Hello WebSockets!")},e.onmessage=function(e){if(e.data instanceof ArrayBuffer){var t=e.data;t.byteLength>0&&postMessage({cmd:"fetch-chunk",data:new Uint8Array(t),msg:"fetch-chunk"})}},e.onclose=function(e){};break;case"stop":e&&e.close(),self.close(),self.postMessage({cmd:"close",data:"close",msg:"close"})}}}.toString(),i=t.match(/^\s*function\s*\(\s*\)\s*\{(([\s\S](?!\}$))*[\s\S])/),n=[i[1]],window.URL.createObjectURL(new Blob(n,{type:"text/javascript"})))),this.workerFetch.onmessage=function(e){a._workerFetch_onmessage(e,a)},this.workerFetch,this.AVSniffPtr=Module.cwrap("AVSniffHttpFlvInit","number",["string","string"])("base64:QXV0aG9yOmNoYW5neWFubG9uZ3xudW1iZXJ3b2xmLEdpdGh1YjpodHRwczovL2dpdGh1Yi5jb20vbnVtYmVyd29sZixFbWFpbDpwb3JzY2hlZ3QyM0Bmb3htYWlsLmNvbSxRUTo1MzEzNjU4NzIsSG9tZVBhZ2U6aHR0cDovL3h2aWRlby52aWRlbyxEaXNjb3JkOm51bWJlcndvbGYjODY5NCx3ZWNoYXI6bnVtYmVyd29sZjExLEJlaWppbmcsV29ya0luOkJhaWR1","0.0.0"),this.AVSniffPtr,this._ptr_probeCallback=Module.addFunction(this._callbackProbe.bind(this)),this._ptr_yuvCallback=Module.addFunction(this._callbackYUV.bind(this)),this._ptr_naluCallback=Module.addFunction(this._callbackNALU.bind(this)),this._ptr_sampleCallback=Module.addFunction(this._callbackPCM.bind(this)),this._ptr_aacCallback=Module.addFunction(this._callbackAAC.bind(this)),Module.cwrap("initializeSniffHttpFlvModule","number",["number","number","number","number","number","number"])(this.AVSniffPtr,this._ptr_probeCallback,this._ptr_yuvCallback,this._ptr_naluCallback,this._ptr_sampleCallback,this._ptr_aacCallback),this.AVGLObj=r.setupCanvas(this.CanvasObj,{preserveDrawingBuffer:!1}),this.workerFetch.postMessage({cmd:"start",data:e,msg:"start"}),this._decode()}}])&&n(t.prototype,i),u&&n(t,u),e}();i.CWsLiveCore=u},{"../consts":52,"../demuxer/buffer":64,"../demuxer/bufferFrame":65,"../render-engine/webgl-420p":77,"../version":80,"./audio-core":53,"./audio-native-core":54,"./av-common":55,"./cache":59,"./cacheYuv":60}],59:[function(e,t,i){(function(i){"use strict";e("./cacheYuv");i.CACHE_APPEND_STATUS_CODE={FAILED:-1,OVERFLOW:-2,OK:0,NOT_FULL:1,FULL:2,NULL:3},t.exports=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:60,t={limit:e,yuvCache:[],appendCacheByCacheYuv:function(e){e.pts;return t.yuvCache.length>=t.limit?CACHE_APPEND_STATUS_CODE.OVERFLOW:(t.yuvCache.push(e),t.yuvCache.length>=t.limit?CACHE_APPEND_STATUS_CODE.FULL:CACHE_APPEND_STATUS_CODE.NOT_FULL)},getState:function(){return t.yuvCache.length<=0?CACHE_APPEND_STATUS_CODE.NULL:t.yuvCache.length>=t.limit?CACHE_APPEND_STATUS_CODE.FULL:CACHE_APPEND_STATUS_CODE.NOT_FULL},cleanPipeline:function(){t.yuvCache.length=0},vYuv:function(){return t.yuvCache.length<=0?null:t.yuvCache.shift()}};return t}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./cacheYuv":60}],60:[function(e,t,i){"use strict";function n(e,t){for(var i=0;i>1;return r.indexOf(t)},GET_NALU_TYPE:function(e){var t=(126&e)>>1;if(t>=1&&t<=9)return n.DEFINE_P_FRAME;if(t>=16&&t<=21)return n.DEFINE_KEY_FRAME;var i=r.indexOf(t);return i>=0?r[i]:n.DEFINE_OTHERS_FRAME},PACK_NALU:function(e){var t=e.nalu,i=e.vlc.vlc;null==t.vps&&(t.vps=new Uint8Array);var n=new Uint8Array(t.vps.length+t.sps.length+t.pps.length+t.sei.length+i.length);return n.set(t.vps,0),n.set(t.sps,t.vps.length),n.set(t.pps,t.vps.length+t.sps.length),n.set(t.sei,t.vps.length+t.sps.length+t.pps.length),n.set(i,t.vps.length+t.sps.length+t.pps.length+t.sei.length),n}}},{"./hevc-header":61}],63:[function(e,t,i){"use strict";function n(e){return function(e){if(Array.isArray(e)){for(var t=0,i=new Array(e.length);t0&&void 0!==arguments[0]&&arguments[0];null!=t&&(t.showScreen=e,t.canvas&&(e?t.canvas.setAttribute("hidden",!0):t.canvas.removeAttribute("hidden")))},setSize:function(e,i){t.config.width=e||l.DEFAULT_WIDTH,t.config.height=i||l.DEFAULT_HEIGHT},setFrameRate:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:25;t.config.fps=e,t.config.frameDurMs=1e3/e},setDurationMs:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1;t.durationMs=e,0==t.config.audioNone&&t.audio.setDurationMs(e)},setPlayingCall:function(e){t.onPlayingTime=e},setVoice:function(e){t.realVolume=e,0==t.config.audioNone&&t.audio.setVoice(t.realVolume)},isPlayingState:function(){return t.isPlaying||t.isCaching===l.CACHE_WITH_PLAY_SIGN},appendAACFrame:function(e){t.audio.addSample(e),t.aCachePTS=Math.max(e.pts,t.aCachePTS)},appendHevcFrame:function(e){var i;t.config.appendHevcType==l.APPEND_TYPE_STREAM?t.stream=new Uint8Array((i=n(t.stream)).concat.apply(i,n(e))):t.config.appendHevcType==l.APPEND_TYPE_FRAME&&(t.frameList.push(e),t.vCachePTS=Math.max(e.pts,t.vCachePTS))},getCachePTS:function(){return Math.max(t.vCachePTS,t.aCachePTS)},endAudio:function(){0==t.config.audioNone&&t.audio.stop()},cleanSample:function(){0==t.config.audioNone&&t.audio.cleanQueue()},cleanVideoQueue:function(){t.config.appendHevcType==l.APPEND_TYPE_STREAM?t.stream=new Uint8Array:t.config.appendHevcType==l.APPEND_TYPE_FRAME&&(t.frameList=[],t.frameList.length=0)},cleanCacheYUV:function(){t.cacheYuvBuf.cleanPipeline()},pause:function(){t.loop&&window.clearInterval(t.loop),t.loop=null,0==t.config.audioNone&&t.audio.pause(),t.isPlaying=!1,t.isCaching===l.CACHE_WITH_PLAY_SIGN&&(t.isCaching=l.CACHE_WITH_NOPLAY_SIGN)},checkFinished:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:l.PLAYER_MODE_VOD;return e==l.PLAYER_MODE_VOD&&t.cacheYuvBuf.yuvCache.length<=0&&(t.videoPTS.toFixed(1)>=(t.durationMs-t.config.frameDurMs)/1e3||t.noCacheFrame>=10)&&(null!=t.onPlayingFinish&&(l.PLAYER_MODE_VOD,t.frameList.length,t.cacheYuvBuf.yuvCache.length,t.videoPTS.toFixed(1),t.durationMs,t.config.frameDurMs,t.noCacheFrame,t.onPlayingFinish()),!0)},clearAllCache:function(){t.nowPacket=null,t.vCachePTS=0,t.aCachePTS=0,t.cleanSample(),t.cleanVideoQueue(),t.cleanCacheYUV()},seek:function(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.isPlaying;t.pause(),t.stopCacheThread(),t.clearAllCache(),e&&e(),t.isNewSeek=!0,t.flushDecoder=1,t.videoPTS=parseInt(i.seekTime);var r={seekPos:i.seekTime||-1,mode:i.mode||l.PLAYER_MODE_VOD,accurateSeek:i.accurateSeek||!0,seekEvent:i.seekEvent||!0,realPlay:n};t.cacheThread(),t.play(r)},getNalu1Packet:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],i=null,n=-1;if(t.config.appendHevcType==l.APPEND_TYPE_STREAM)i=t.nextNalu();else{if(t.config.appendHevcType!=l.APPEND_TYPE_FRAME)return null;var r=t.frameList.shift();if(!r)return null;i=r.data,n=r.pts,e&&(t.videoPTS=n)}return{nalBuf:i,pts:n}},decodeNalu1Frame:function(e,i){var n=Module._malloc(e.length);Module.HEAP8.set(e,n);var r=parseInt(1e3*i);Module.cwrap("decodeCodecContext","number",["number","number","number","number","number"])(t.vcodecerPtr,n,e.length,r,t.flushDecoder);return t.flushDecoder=0,Module._free(n),!1},cacheThread:function(){t.cacheLoop=window.setInterval((function(){if(t.cacheYuvBuf.getState()!=CACHE_APPEND_STATUS_CODE.FULL){var e=t.getNalu1Packet(!1);if(null!=e){var i=e.nalBuf,n=e.pts;t.decodeNalu1Frame(i,n,!0)}}}),10)},stopCacheThread:function(){null!==t.cacheLoop&&(window.clearInterval(t.cacheLoop),t.cacheLoop=null)},loadCache:function(){if(!(t.frameList.length<=3)){var e=t.isPlaying;if(t.cacheYuvBuf.yuvCache.length<=3){t.pause(),null!=t.onLoadCache&&t.onLoadCache(),t.isCaching=e?l.CACHE_WITH_PLAY_SIGN:l.CACHE_WITH_NOPLAY_SIGN;var i=t.frameList.length>30?30:t.frameList.length;null===t.cacheInterval&&(t.cacheInterval=window.setInterval((function(){t.cacheYuvBuf.yuvCache.length>=i&&(null!=t.onLoadCacheFinshed&&t.onLoadCacheFinshed(),window.clearInterval(t.cacheInterval),t.cacheInterval=null,t.isCaching===l.CACHE_WITH_PLAY_SIGN&&t.play(t.playParams),t.isCaching=l.CACHE_NO_LOADCACHE)}),40))}}},playFunc:function(){var e=!1;if(t.playParams.seekEvent||r.GetMsTime()-t.calcuteStartTime>=t.frameTime-t.preCostTime){e=!0;var i=!0;if(t.calcuteStartTime=r.GetMsTime(),t.config.audioNone)t.playFrameYUV(i,t.playParams.accurateSeek);else{t.fix_poc_err_skip>0&&(t.fix_poc_err_skip--,i=!1);var n=t.videoPTS-t.audio.getAlignVPTS();if(n>0)return void(t.playParams.seekEvent&&!t.config.audioNone&&t.audio.setVoice(0));if(i){if(!(i=-1*n<=1*t.frameTimeSec)){for(var a=parseInt(n/t.frameTimeSec),s=0;s=i&&(t.playFrameYUV(!0,t.playParams.accurateSeek),i+=1)}),1)}else t.videoPTS>=t.playParams.seekPos&&!t.isNewSeek||0===t.playParams.seekPos||0===t.playParams.seekPos?(t.frameTime=1e3/t.config.fps,t.frameTimeSec=t.frameTime/1e3,0==t.config.audioNone&&t.audio.play(),t.realVolume=t.config.audioNone?0:t.audio.voice,t.playParams.seekEvent&&(t.fix_poc_err_skip=10),t.loop=window.setInterval((function(){var e=r.GetMsTime();t.playFunc(),t.preCostTime=r.GetMsTime()-e}),1)):(t.loop=window.setInterval((function(){t.playFrameYUV(!1,t.playParams.accurateSeek),t.checkFinished(t.playParams.mode)?(window.clearInterval(t.loop),t.loop=null):t.videoPTS>=t.playParams.seekPos&&(window.clearInterval(t.loop),t.loop=null,t.play(t.playParams))}),1),t.isNewSeek=!1)},stop:function(){t.release(),Module.cwrap("initializeDecoder","number",["number"])(t.vcodecerPtr),t.stream=new Uint8Array},release:function(){return t.endAudio(),t.cacheLoop&&window.clearInterval(t.cacheLoop),t.cacheLoop=null,t.loop&&window.clearInterval(t.loop),t.loop=null,t.pause(),null!==t.videoCallback&&Module.removeFunction(t.videoCallback),t.videoCallback=null,Module.cwrap("release","number",["number"])(t.vcodecerPtr),t.stream=null,t.frameList.length=0,t.durationMs=-1,t.videoPTS=0,t.isPlaying=!1,!0},nextNalu:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;if(t.stream.length<=4)return!1;for(var i=-1,n=0;n=t.stream.length){if(-1==i)return!1;var r=t.stream.subarray(i);return t.stream=new Uint8Array,r}var a="0 0 1"==t.stream.slice(0,3).join(" "),s="0 0 0 1"==t.stream.slice(0,4).join(" ");if(a||s){if(-1==i)i=n;else{if(e<=1){var o=t.stream.subarray(i,n);return t.stream=t.stream.subarray(n),o}e-=1}n+=3}}return!1},decodeSendPacket:function(e){var i=Module._malloc(e.length);Module.HEAP8.set(e,i);var n=Module.cwrap("decodeSendPacket","number",["number","number","number"])(t.vcodecerPtr,i,e.length);return Module._free(i),n},decodeRecvFrame:function(){return Module.cwrap("decodeRecv","number",["number"])(t.vcodecerPtr)},playFrameYUV:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],i=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=t.cacheYuvBuf.vYuv();if(null==n)return t.noCacheFrame+=1,e&&!t.playParams.seekEvent&&t.loadCache(),!1;t.noCacheFrame=0;var r=n.pts;return t.videoPTS=r,(!e&&i||e)&&e&&t.drawImage(n.width,n.height,n.imageBufferY,n.imageBufferB,n.imageBufferR),e&&!t.playParams.seekEvent&&t.isPlaying&&t.loadCache(),!0},drawImage:function(e,i,n,r,a){if(t.canvas.width===e&&t.canvas.height==i||(t.canvas.width=e,t.canvas.height=i),t.showScreen&&null!=t.onRender)t.onRender(e,i,n,r,a);else{if(!t.isCheckDisplay)t.checkDisplaySize(e,i);var s=e*i,o=e/2*(i/2),l=new Uint8Array(s+2*o);l.set(n,0),l.set(r,s),l.set(a,s+o),u.renderFrame(t.yuv,n,r,a,e,i)}},debugYUV:function(e){t.debugYUVSwitch=!0,t.debugID=e},checkDisplaySize:function(e,i){var n=e/t.config.width>i/t.config.height,r=(t.config.width/e).toFixed(2),a=(t.config.height/i).toFixed(2),s=n?r:a,o=t.config.fixed,u=o?t.config.width:parseInt(e*s),l=o?t.config.height:parseInt(i*s);if(t.canvas.offsetWidth!=u||t.canvas.offsetHeight!=l){var d=parseInt((t.canvasBox.offsetHeight-l)/2),h=parseInt((t.canvasBox.offsetWidth-u)/2);t.canvas.style.marginTop=d+"px",t.canvas.style.marginLeft=h+"px",t.canvas.style.width=u+"px",t.canvas.style.height=l+"px"}return t.isCheckDisplay=!0,[u,l]},makeWasm:function(){if(null!=t.config.token){t.vcodecerPtr=Module.cwrap("registerPlayer","number",["string","string"])(t.config.token,d.PLAYER_VERSION),t.videoCallback=Module.addFunction((function(e,i,n,r,a,s,u,l,d){var h=Module.HEAPU8.subarray(e,e+r*l),c=Module.HEAPU8.subarray(i,i+a*l/2),f=Module.HEAPU8.subarray(n,n+s*l/2),p=new Uint8Array(h),m=new Uint8Array(c),g=new Uint8Array(f),_=1*d/1e3,y=new o.CacheYuvStruct(_,r,l,p,m,g);t.cacheYuvBuf.appendCacheByCacheYuv(y)})),Module.cwrap("setCodecType","number",["number","number","number"])(t.vcodecerPtr,t.config.videoCodec,t.videoCallback);Module.cwrap("initMissile","number",["number"])(t.vcodecerPtr);Module.cwrap("initializeDecoder","number",["number"])(t.vcodecerPtr)}},makeIt:function(){var e=document.querySelector("div#"+t.config.playerId),i=document.createElement("canvas");i.style.width=e.clientWidth+"px",i.style.height=e.clientHeight+"px",i.style.top="0px",i.style.left="0px",e.appendChild(i),t.canvasBox=e,t.canvas=i,t.yuv=u.setupCanvas(i,{preserveDrawingBuffer:!1}),0==t.config.audioNone&&(t.audio=a({sampleRate:t.config.sampleRate,appendType:t.config.appendHevcType})),t.isPlayLoadingFinish=1}};return t.makeWasm(),t.makeIt(),t.cacheThread(),t}},{"../consts":52,"../render-engine/webgl-420p":77,"../version":80,"./audio-core":53,"./av-common":55,"./cache":59,"./cacheYuv":60}],64:[function(e,t,i){"use strict";var n=e("./bufferFrame");t.exports=function(){var e={videoBuffer:[],audioBuffer:[],idrIdxBuffer:[],appendFrame:function(t,i){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],s=new n.BufferFrame(t,a,i,r),o=parseInt(t);return r?(e.videoBuffer.length-1>=o?e.videoBuffer[o].push(s):e.videoBuffer.push([s]),a&&!e.idrIdxBuffer.includes(t)&&e.idrIdxBuffer.push(t)):e.audioBuffer.length-1>=o&&null!=e.audioBuffer[o]&&null!=e.audioBuffer[o]?e.audioBuffer[o]&&e.audioBuffer[o].push(s):e.audioBuffer.push([s]),!0},appendFrameWithDts:function(t,i,r){var a=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],s=arguments.length>4&&void 0!==arguments[4]&&arguments[4],o=n.ConstructWithDts(t,i,s,r,a),u=parseInt(i);return a?(e.videoBuffer.length-1>=u?e.videoBuffer[u].push(o):e.videoBuffer.push([o]),s&&!e.idrIdxBuffer.includes(i)&&e.idrIdxBuffer.push(i)):e.audioBuffer.length-1>=u&&null!=e.audioBuffer[u]&&null!=e.audioBuffer[u]?e.audioBuffer[u]&&e.audioBuffer[u].push(o):e.audioBuffer.push([o]),!0},appendFrameByBufferFrame:function(t){var i=t.pts,n=parseInt(i);return t.video?(e.videoBuffer.length-1>=n?e.videoBuffer[n].push(t):e.videoBuffer.push([t]),isKey&&!e.idrIdxBuffer.includes(i)&&e.idrIdxBuffer.push(i)):e.audioBuffer.length-1>=n?e.audioBuffer[n].push(t):e.audioBuffer.push([t]),!0},cleanPipeline:function(){e.videoBuffer.length=0,e.audioBuffer.length=0},vFrame:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1;if(!(t<0||t>e.videoBuffer.length-1))return e.videoBuffer[t]},aFrame:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1;if(!(t<0||t>e.audioBuffer.length-1))return e.audioBuffer[t]},seekIDR:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1;if(e.idrIdxBuffer,e.videoBuffer,t<0)return null;if(e.idrIdxBuffer.includes(t))return t;for(var i=0;it||0===i&&e.idrIdxBuffer[i]>=t){for(var n=1;n>=0;n--){var r=i-n;if(r>=0)return e.idrIdxBuffer[r],e.idrIdxBuffer[r]}return e.idrIdxBuffer[i],j,e.idrIdxBuffer[i]}}};return e}},{"./bufferFrame":65}],65:[function(e,t,i){"use strict";function n(e,t){for(var i=0;i0&&i.extensionInfo.vHeight>0&&(i.size.width=i.extensionInfo.vWidth,i.size.height=i.extensionInfo.vHeight)),i.mediaInfo.duration,null!=i.onDemuxed&&i.onDemuxed(i.onReadyOBJ);for(var e=!1;void 0!==i.mpegTsObj&&null!==i.mpegTsObj;){var n=i.mpegTsObj.readPacket();if(n.size<=0)break;var r=n.dtime>0?n.dtime:n.ptime;if(!(r<0)){if(0==n.type){r<=i.vPreFramePTS&&(e=!0);var a=u.PACK_NALU(n.layer),o=1==n.keyframe,l=1==e?r+i.vStartTime:r,d=new s.BufferFrame(l,o,a,!0);i.bufObject.appendFrame(d.pts,d.data,!0,d.isKey),i.vPreFramePTS=l,null!=i.onSamples&&i.onSamples(i.onReadyOBJ,d)}else if(r<=i.aPreFramePTS&&(e=!0),"aac"==i.mediaInfo.aCodec)for(var h=n.data,c=0;c=3?(i._onTsReady(e),window.clearInterval(i.timerTsWasm),i.timerTsWasm=null):(i.mpegTsWasmRetryLoadTimes+=1,i.mpegTsObj.initDemuxer())}),3e3)}},{key:"_onTsReady",value:function(e){var t=this;t.hls.fetchM3u8(e),t.mpegTsWasmState=!0,t.timerFeed=window.setInterval((function(){if(t.tsList.length>0&&0==t.lockWait.state)try{var e=t.tsList.shift();if(null!=e){var i=e.streamURI,n=e.streamDur;t.lockWait.state=!0,t.lockWait.lockMember.dur=n,t.mpegTsObj.isLive=t.hls.isLive(),t.mpegTsObj.demuxURL(i)}else console.error("_onTsReady need wait ")}catch(e){console.error("onTsReady ERROR:",e),t.lockWait.state=!1}}),50)}},{key:"release",value:function(){this.hls&&this.hls.release(),this.hls=null,this.timerFeed&&window.clearInterval(this.timerFeed),this.timerFeed=null,this.timerTsWasm&&window.clearInterval(this.timerTsWasm),this.timerTsWasm=null}},{key:"bindReady",value:function(e){this.onReadyOBJ=e}},{key:"popBuffer",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;return t<0?null:1===e?t+1>this.bufObject.videoBuffer.length?null:this.bufObject.vFrame(t):2===e?t+1>this.bufObject.audioBuffer.length?null:this.bufObject.aFrame(t):void 0}},{key:"getVLen",value:function(){return this.bufObject.videoBuffer.length}},{key:"getALen",value:function(){return this.bufObject.audioBuffer.length}},{key:"getLastIdx",value:function(){return this.bufObject.videoBuffer.length-1}},{key:"getALastIdx",value:function(){return this.bufObject.audioBuffer.length-1}},{key:"getACodec",value:function(){return this.aCodec}},{key:"getVCodec",value:function(){return this.vCodec}},{key:"getDurationMs",value:function(){return this.durationMs}},{key:"getFPS",value:function(){return this.fps}},{key:"getSampleRate",value:function(){return this.sampleRate}},{key:"getSampleChannel",value:function(){return this.aChannel}},{key:"getSize",value:function(){return this.size}},{key:"seek",value:function(e){if(e>=0){var t=this.bufObject.seekIDR(e);this.seekPos=t}}}])&&n(t.prototype,i),d&&n(t,d),e}();i.M3u8=d},{"../consts":52,"../decoder/hevc-imp":62,"./buffer":64,"./bufferFrame":65,"./m3u8base":67,"./mpegts/mpeg.js":71}],67:[function(e,t,i){"use strict";function n(e,t){for(var i=0;i ",t),setTimeout((function(){i.fetchM3u8(e)}),500)}))}},{key:"_uriParse",value:function(e){this._preURI="";var t=e.split("//"),i=null,n=null;if(t.length<1)return!1;t.length>1?(i=t[0],n=t[1].split("/"),this._preURI=i+"//"):n=t[0].split("/");for(var r=0;rp&&(o=p);var m=n[l+=1],g=null;g=m.indexOf("http")>=0?m:this._preURI+m,this._slices.indexOf(g)<0&&(this._slices.push(g),this._slices[this._slices.length-1],null!=this.onTransportStream&&this.onTransportStream(g,p))}}}if(this._slices.length>s.hlsSliceLimit&&this._type==r.PLAYER_IN_TYPE_M3U8_LIVE&&(this._slices=this._slices.slice(-1*s.hlsSliceLimit)),null!=this.onFinished){var _={type:this._type,duration:-1};this.onFinished(_)}return o}},{key:"_readTag",value:function(e){var t=s.tagParse.exec(e);return null!==t?{key:t[1],value:t[3]}:null}}])&&n(t.prototype,i),o&&n(t,o),e}();i.M3u8Base=o},{"../consts":52}],68:[function(e,t,i){"use strict";var n=e("mp4box"),r=e("../decoder/hevc-header"),a=e("../decoder/hevc-imp"),s=e("./buffer"),o=e("../consts"),u={96e3:0,88200:1,64e3:2,48e3:3,44100:4,32e3:5,24e3:6,22050:7,16e3:8,12e3:9,11025:10,8e3:11,7350:12,Reserved:13,"frequency is written explictly":15},l=function(e){for(var t=[],i=0;i1&&void 0!==arguments[1]&&arguments[1],i=null;return t?((i=e)[0]=r.DEFINE_STARTCODE[0],i[1]=r.DEFINE_STARTCODE[1],i[2]=r.DEFINE_STARTCODE[2],i[3]=r.DEFINE_STARTCODE[3]):((i=new Uint8Array(r.DEFINE_STARTCODE.length+e.length)).set(r.DEFINE_STARTCODE,0),i.set(e,r.DEFINE_STARTCODE.length)),i},d.prototype.setAACAdts=function(e){var t=null,i=this.aacProfile,n=u[this.sampleRate],r=new Uint8Array(7),a=r.length+e.length;return r[0]=255,r[1]=241,r[2]=(i-1<<6)+(n<<2)+0,r[3]=128+(a>>11),r[4]=(2047&a)>>3,r[5]=31+((7&a)<<5),r[6]=252,(t=new Uint8Array(a)).set(r,0),t.set(e,r.length),t},d.prototype.demux=function(){var e=this;e.seekPos=-1,e.mp4boxfile=n.createFile(),e.movieInfo=null,e.videoCodec=null,e.durationMs=-1,e.fps=-1,e.sampleRate=-1,e.aacProfile=2,e.size={width:-1,height:-1},e.bufObject=s(),e.audioNone=!1,e.naluHeader={vps:null,sps:null,pps:null,sei:null},e.mp4boxfile.onError=function(e){},this.mp4boxfile.onReady=function(t){for(var i in e.movieInfo=t,t.tracks)"VideoHandler"!==t.tracks[i].name&&"video"!==t.tracks[i].type||(t.tracks[i].codec,t.tracks[i].codec.indexOf("hev")>=0||t.tracks[i].codec.indexOf("hvc")>=0?e.videoCodec=o.CODEC_H265:t.tracks[i].codec.indexOf("avc")>=0&&(e.videoCodec=o.CODEC_H264));var n=-1;if(n=t.videoTracks[0].samples_duration/t.videoTracks[0].timescale,e.durationMs=1e3*n,e.fps=t.videoTracks[0].nb_samples/n,e.seekDiffTime=1/e.fps,e.size.width=t.videoTracks[0].track_width,e.size.height=t.videoTracks[0].track_height,t.audioTracks.length>0){e.sampleRate=t.audioTracks[0].audio.sample_rate;var r=t.audioTracks[0].codec.split(".");e.aacProfile=r[r.length-1]}else e.audioNone=!0;null!=e.onMp4BoxReady&&e.onMp4BoxReady(e.videoCodec),e.videoCodec===o.CODEC_H265?(e.initializeAllSourceBuffers(),e.mp4boxfile.start()):(e.videoCodec,o.CODEC_H264)},e.mp4boxfile.onSamples=function(t,i,n){var s=window.setInterval((function(){for(var i=0;i3?e.naluHeader.sei=e.setStartCode(g[3][0].data,!1):e.naluHeader.sei=new Uint8Array,e.naluHeader}else e.videoCodec==o.CODEC_H264&&(e.naluHeader.vps=new Uint8Array,e.naluHeader.sps=e.setStartCode(f.SPS[0].nalu,!1),e.naluHeader.pps=e.setStartCode(f.PPS[0].nalu,!1),e.naluHeader.sei=new Uint8Array);d[4].toString(16),e.naluHeader.vps[4].toString(16),l(e.naluHeader.vps),l(d);var _=e.setStartCode(d.subarray(0,e.naluHeader.vps.length),!0);if(l(_),d[4]===e.naluHeader.vps[4]){var y=e.naluHeader.vps.length+4,v=e.naluHeader.vps.length+e.naluHeader.sps.length+4,b=e.naluHeader.vps.length+e.naluHeader.sps.length+e.naluHeader.pps.length+4;if(e.naluHeader.sei.length<=0&&e.naluHeader.sps.length>0&&d[y]===e.naluHeader.sps[4]&&e.naluHeader.pps.length>0&&d[v]===e.naluHeader.pps[4]&&78===d[b]){d[e.naluHeader.vps.length+4],e.naluHeader.sps[4],d[e.naluHeader.vps.length+e.naluHeader.sps.length+4],e.naluHeader.pps[4],d[e.naluHeader.vps.length+e.naluHeader.sps.length+e.naluHeader.pps.length+4];for(var T=0,S=0;S4&&d[4]===e.naluHeader.sei[4]){var E=d.subarray(0,10),w=new Uint8Array(e.naluHeader.vps.length+E.length);w.set(E,0),w.set(e.naluHeader.vps,E.length),w[3]=1,e.naluHeader.vps=null,e.naluHeader.vps=new Uint8Array(w),w=null,E=null,(d=d.subarray(10))[4],e.naluHeader.vps[4],e.naluHeader.vps}else if(0===e.naluHeader.sei.length&&78===d[4]){d=e.setStartCode(d,!0);for(var C=0,A=0;A1&&void 0!==arguments[1]?arguments[1]:0;return e.fileStart=t,this.mp4boxfile.appendBuffer(e)},d.prototype.finishBuffer=function(){this.mp4boxfile.flush()},d.prototype.play=function(){},d.prototype.getVideoCoder=function(){return this.videoCodec},d.prototype.getDurationMs=function(){return this.durationMs},d.prototype.getFPS=function(){return this.fps},d.prototype.getSampleRate=function(){return this.sampleRate},d.prototype.getSize=function(){return this.size},d.prototype.seek=function(e){if(e>=0){var t=this.bufObject.seekIDR(e);this.seekPos=t}},d.prototype.popBuffer=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;return t<0?null:1==e?this.bufObject.vFrame(t):2==e?this.bufObject.aFrame(t):void 0},d.prototype.addBuffer=function(e){var t=e.id;this.mp4boxfile.setExtractionOptions(t)},d.prototype.initializeAllSourceBuffers=function(){if(this.movieInfo){for(var e=this.movieInfo,t=0;t>5)}},{key:"sliceAACFrames",value:function(e,t){for(var i=[],n=e,r=0;r>4==15){var a=this._getPktLen(t[r+3],t[r+4],t[r+5]);if(a<=0)continue;var s=t.subarray(r,r+a),o=new Uint8Array(a);o.set(s,0),i.push({ptime:n,data:o}),n+=this.frameDurSec,r+=a}else r+=1;return i}}])&&n(t.prototype,i),r&&n(t,r),e}();i.AACDecoder=r},{}],71:[function(e,t,i){(function(t){"use strict";function n(e,t){for(var i=0;i ",e),n=null})).catch((function(i){console.error("demuxerTsInit ERROR fetch ERROR ==> ",i),t._releaseOffset(),t.onDemuxedFailed&&t.onDemuxedFailed(i,e)}))}},{key:"_releaseOffset",value:function(){void 0!==this.offsetDemux&&null!==this.offsetDemux&&(Module._free(this.offsetDemux),this.offsetDemux=null)}},{key:"_demuxCore",value:function(e){if(this._releaseOffset(),this._refreshDemuxer(),!(e.length<=0)){this.offsetDemux=Module._malloc(e.length),Module.HEAP8.set(e,this.offsetDemux);var t=Module.cwrap("demuxBox","number",["number","number","number"])(this.offsetDemux,e.length,this.isLive);Module._free(this.offsetDemux),this.offsetDemux=null,t>=0&&(this._setMediaInfo(),this._setExtensionInfo(),null!=this.onDemuxed&&this.onDemuxed())}}},{key:"_setMediaInfo",value:function(){var e=Module.cwrap("getMediaInfo","number",[])(),t=Module.HEAPU32[e/4],i=Module.HEAPU32[e/4+1],n=Module.HEAPF64[e/8+1],s=Module.HEAPF64[e/8+1+1],o=Module.HEAPF64[e/8+1+1+1],u=Module.HEAPF64[e/8+1+1+1+1],l=Module.HEAPU32[e/4+2+2+2+2+2];this.mediaAttr.vFps=n,this.mediaAttr.vGop=l,this.mediaAttr.vDuration=s,this.mediaAttr.aDuration=o,this.mediaAttr.duration=u;var d=Module.cwrap("getAudioCodecID","number",[])();d>=0?(this.mediaAttr.aCodec=a.CODEC_OFFSET_TABLE[d],this.mediaAttr.sampleRate=t>0?t:a.DEFAULT_SAMPLERATE,this.mediaAttr.sampleChannel=i>=0?i:a.DEFAULT_CHANNEL):(this.mediaAttr.sampleRate=0,this.mediaAttr.sampleChannel=0,this.mediaAttr.audioNone=!0);var h=Module.cwrap("getVideoCodecID","number",[])();h>=0&&(this.mediaAttr.vCodec=a.CODEC_OFFSET_TABLE[h]),null==this.aacDec?this.aacDec=new r.AACDecoder(this.mediaAttr):this.aacDec.updateConfig(this.mediaAttr)}},{key:"_setExtensionInfo",value:function(){var e=Module.cwrap("getExtensionInfo","number",[])(),t=Module.HEAPU32[e/4],i=Module.HEAPU32[e/4+1];this.extensionInfo.vWidth=t,this.extensionInfo.vHeight=i}},{key:"readMediaInfo",value:function(){return this.mediaAttr}},{key:"readExtensionInfo",value:function(){return this.extensionInfo}},{key:"readAudioNone",value:function(){return this.mediaAttr.audioNone}},{key:"_readLayer",value:function(){var e={vps:null,sps:null,pps:null,sei:null},t={vlc:null},i=Module.cwrap("getSPSLen","number",[])(),n=Module.cwrap("getSPS","number",[])();if(!(i<0)){e.sps=new Uint8Array(i),e.sps.set(Module.HEAPU8.subarray(n,n+i),0);var r=Module.cwrap("getPPSLen","number",[])(),s=Module.cwrap("getPPS","number",[])();e.pps=new Uint8Array(r),e.pps.set(Module.HEAPU8.subarray(s,s+r),0);var o=Module.cwrap("getSEILen","number",[])(),u=Module.cwrap("getSEI","number",[])();e.sei=new Uint8Array(o),e.sei.set(Module.HEAPU8.subarray(u,u+o),0);var l=Module.cwrap("getVLCLen","number",[])(),d=Module.cwrap("getVLC","number",[])();if(t.vlc=new Uint8Array(l),t.vlc.set(Module.HEAPU8.subarray(d,d+l),0),this.mediaAttr.vCodec==a.DEF_HEVC||this.mediaAttr.vCodec==a.DEF_H265){var h=Module.cwrap("getVPSLen","number",[])(),c=Module.cwrap("getVPS","number",[])();e.vps=new Uint8Array(h),e.vps.set(Module.HEAPU8.subarray(c,c+h),0)}else this.mediaAttr.vCodec==a.DEF_AVC||(this.mediaAttr.vCodec,a.DEF_H264);return{nalu:e,vlc:t}}}},{key:"isHEVC",value:function(){return this.mediaAttr.vCodec==a.DEF_HEVC||this.mediaAttr.vCodec==a.DEF_H265}},{key:"readPacket",value:function(){var e=Module.cwrap("getPacket","number",[])(),t=Module.HEAPU32[e/4],i=Module.HEAPU32[e/4+1],n=Module.HEAPF64[e/8+1],r=Module.HEAPF64[e/8+1+1],s=Module.HEAPU32[e/4+1+1+2+2],o=Module.HEAPU32[e/4+1+1+2+2+1],u=Module.HEAPU8.subarray(o,o+i),l=this._readLayer();return{type:t,size:i,ptime:n,dtime:r,keyframe:s,src:u,data:1==t&&this.mediaAttr.aCodec==a.DEF_AAC?this.aacDec.sliceAACFrames(n,u):u,layer:l}}},{key:"_refreshDemuxer",value:function(){this.releaseTsDemuxer(),this._initDemuxer()}},{key:"_initDemuxer",value:function(){Module.cwrap("initTsMissile","number",[])(),Module.cwrap("initializeDemuxer","number",[])()}},{key:"releaseTsDemuxer",value:function(){Module.cwrap("exitTsMissile","number",[])()}}])&&n(i.prototype,s),o&&n(i,o),e}();i.MPEG_JS=s}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./consts":69,"./decoder/aac":70}],72:[function(e,t,i){"use strict";function n(e,t){for(var i=0;i0&&e.extensionInfo.vHeight>0&&(e.size.width=e.extensionInfo.vWidth,e.size.height=e.extensionInfo.vHeight);for(var t=null;!((t=e.mpegTsObj.readPacket()).size<=0);){var i=t.dtime;if(0==t.type){var n=s.PACK_NALU(t.layer),r=1==t.keyframe;e.bufObject.appendFrame(i,n,!0,r)}else if("aac"==e.mediaInfo.aCodec)for(var a=t.data,o=0;o0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;return t<0?null:1==e?this.bufObject.vFrame(t):2==e?this.bufObject.aFrame(t):void 0}},{key:"isHEVC",value:function(){return this.mpegTsObj.isHEVC()}},{key:"getACodec",value:function(){return this.aCodec}},{key:"getVCodec",value:function(){return this.vCodec}},{key:"getAudioNone",value:function(){return this.mpegTsObj.mediaAttr.audioNone}},{key:"getDurationMs",value:function(){return this.durationMs}},{key:"getFPS",value:function(){return this.fps}},{key:"getSampleRate",value:function(){return this.sampleRate}},{key:"getSize",value:function(){return this.size}},{key:"seek",value:function(e){if(e>=0){var t=this.bufObject.seekIDR(e);this.seekPos=t}}}])&&n(t.prototype,i),o&&n(t,o),e}();i.MpegTs=o},{"../decoder/hevc-imp":62,"./buffer":64,"./mpegts/mpeg.js":71}],73:[function(e,t,i){(function(t){"use strict";function n(e,t){for(var i=0;i0&&void 0!==arguments[0]&&arguments[0];return void 0!==this.player&&null!==this.player&&(this.player.setScreen(e),!0)}},{key:"play",value:function(){if(void 0===this.player||null===this.player)return!1;if(this.playParam.videoCodec===m.CODEC_H265){var e={seekPos:this._getSeekTarget(),mode:this.playMode,accurateSeek:this.configFormat.accurateSeek,seekEvent:!1,realPlay:!0};this.player.play(e)}else this.player.play();return!0}},{key:"pause",value:function(){return void 0!==this.player&&null!==this.player&&(this.player.pause(),!0)}},{key:"isPlaying",value:function(){return void 0!==this.player&&null!==this.player&&this.player.isPlayingState()}},{key:"setVoice",value:function(e){return!(e<0||void 0===this.player||null===this.player||(this.volume=e,this.player&&this.player.setVoice(e),0))}},{key:"getVolume",value:function(){return this.volume}},{key:"mediaInfo",value:function(){var e={meta:this.playParam,videoType:this.playMode};return e.meta.isHEVC=0===this.playParam.videoCodec,e}},{key:"_seekHLS",value:function(e,t,i){if(void 0===this.player||null===this.player)return!1;setTimeout((function(){t.player.getCachePTS(),t.player.getCachePTS()>e?i():t._seekHLS(e,t,i)}),100)}},{key:"seek",value:function(e){if(void 0===this.player||null===this.player)return!1;var t=this;this.seekTarget=e,this.onSeekStart&&this.onSeekStart(e),this.timerFeed&&(window.clearInterval(this.timerFeed),this.timerFeed=null);var i=this._getSeekTarget();return this.playParam.videoCodec===m.CODEC_H264?(this.player.seek(e),this.onSeekFinish&&this.onSeekFinish()):this.configFormat.extInfo.core===m.PLAYER_CORE_TYPE_CNATIVE?(this.pause(),this._seekHLS(e,this,(function(){t.player.seek((function(){}),{seekTime:i,mode:t.playMode,accurateSeek:t.configFormat.accurateSeek})}))):this._seekHLS(e,this,(function(){t.player.seek((function(){t.configFormat.type==m.PLAYER_IN_TYPE_MP4?t.mp4Obj.seek(e):t.configFormat.type==m.PLAYER_IN_TYPE_TS||t.configFormat.type==m.PLAYER_IN_TYPE_MPEGTS?t.mpegTsObj.seek(e):t.configFormat.type==m.PLAYER_IN_TYPE_M3U8&&(t.hlsObj.onSamples=null,t.hlsObj.seek(e));var i,n=(i=0,i=t.configFormat.accurateSeek?e:t._getBoxBufSeekIDR(),parseInt(i)),r=parseInt(t._getBoxBufSeekIDR())||0;t._avFeedMP4Data(r,n)}),{seekTime:i,mode:t.playMode,accurateSeek:t.configFormat.accurateSeek})})),!0}},{key:"fullScreen",value:function(){if(this.autoScreenClose=!0,this.player.vCodecID===m.V_CODEC_NAME_HEVC){var e=document.querySelector("#"+this.configFormat.playerId),t=e.getElementsByTagName("canvas")[0];e.style.width=this.screenW+"px",e.style.height=this.screenH+"px";var i=this._checkScreenDisplaySize(this.screenW,this.screenH,this.playParam.size.width,this.playParam.size.height);t.style.marginTop=i[0]+"px",t.style.marginLeft=i[1]+"px",t.style.width=i[2]+"px",t.style.height=i[3]+"px",this._requestFullScreen(e)}else this._requestFullScreen(this.player.videoTag)}},{key:"closeFullScreen",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!1===e&&(this.autoScreenClose=!1,this._exitFull()),this.player.vCodecID===m.V_CODEC_NAME_HEVC){var t=document.querySelector("#"+this.configFormat.playerId),i=t.getElementsByTagName("canvas")[0];t.style.width=this.configFormat.playerW+"px",t.style.height=this.configFormat.playerH+"px";var n=this._checkScreenDisplaySize(this.configFormat.playerW,this.configFormat.playerH,this.playParam.size.width,this.playParam.size.height);i.style.marginTop=n[0]+"px",i.style.marginLeft=n[1]+"px",i.style.width=n[2]+"px",i.style.height=n[3]+"px"}}},{key:"_checkScreenDisplaySize",value:function(e,t,i,n){var r=i/e>n/t,a=(e/i).toFixed(2),s=(t/n).toFixed(2),o=r?a:s,u=this.fixed?e:parseInt(i*o),l=this.fixed?t:parseInt(n*o);return[parseInt((t-l)/2),parseInt((e-u)/2),u,l]}},{key:"_isFullScreen",value:function(){var e=document.fullscreenElement||document.mozFullscreenElement||document.webkitFullscreenElement;return document.fullscreenEnabled||document.mozFullscreenEnabled||document.webkitFullscreenEnabled,null!=e}},{key:"_requestFullScreen",value:function(e){e.requestFullscreen?e.requestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.msRequestFullscreen?e.msRequestFullscreen():e.webkitRequestFullscreen&&e.webkitRequestFullScreen()}},{key:"_exitFull",value:function(){document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.msExitFullscreen&&document.msExitFullscreen()}},{key:"_durationText",value:function(e){if(e<0)return"Play";var t=Math.round(e);return Math.floor(t/3600)+":"+Math.floor(t%3600/60)+":"+Math.floor(t%60)}},{key:"_getSeekTarget",value:function(){return this.configFormat.accurateSeek?this.seekTarget:this._getBoxBufSeekIDR()}},{key:"_getBoxBufSeekIDR",value:function(){return this.configFormat.type==m.PLAYER_IN_TYPE_MP4?this.mp4Obj.seekPos:this.configFormat.type==m.PLAYER_IN_TYPE_TS||this.configFormat.type==m.PLAYER_IN_TYPE_MPEGTS?this.mpegTsObj.seekPos:this.configFormat.type==m.PLAYER_IN_TYPE_M3U8?this.hlsObj.seekPos:void 0}},{key:"_playControl",value:function(){this.isPlaying()?this.pause():this.play()}},{key:"_avFeedMP4Data",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(void 0===this.player||null===this.player)return!1;var r=parseInt(this.playParam.durationMs/1e3);this.player.clearAllCache(),this.timerFeed=window.setInterval((function(){var a=null,s=null,o=!0,u=!0;if(e.configFormat.type==m.PLAYER_IN_TYPE_MP4?(a=e.mp4Obj.popBuffer(1,t),s=e.mp4Obj.audioNone?null:e.mp4Obj.popBuffer(2,i)):e.configFormat.type==m.PLAYER_IN_TYPE_TS||e.configFormat.type==m.PLAYER_IN_TYPE_MPEGTS?(a=e.mpegTsObj.popBuffer(1,t),s=e.mpegTsObj.getAudioNone()?null:e.mpegTsObj.popBuffer(2,i)):e.configFormat.type==m.PLAYER_IN_TYPE_M3U8&&(a=e.hlsObj.popBuffer(1,t),s=e.hlsObj.audioNone?null:e.hlsObj.popBuffer(2,i),t=e.hlsObj.getLastIdx()&&(o=!1),i=e.hlsObj.getALastIdx()&&(u=!1)),!0===o&&null!=a)for(var l=0;lr)return window.clearInterval(e.timerFeed),e.timerFeed=null,e.player.vCachePTS,e.player.aCachePTS,void(null!=n&&n())}),5)}},{key:"_makeMP4Player",value:function(){return this.mediaExtProtocol===m.URI_PROTOCOL_WEBSOCKET_DESC?(this._cWsFLVDecoderEntry(),0):(null!=this.configFormat.extInfo.core&&null!==this.configFormat.extInfo.core&&this.configFormat.extInfo.core===m.PLAYER_CORE_TYPE_CNATIVE?this._cDemuxDecoderEntry():this.configFormat.type==m.PLAYER_IN_TYPE_MP4?this.configFormat.extInfo.moovStartFlag?this._mp4EntryVodStream():this._mp4Entry():this.configFormat.type==m.PLAYER_IN_TYPE_TS||this.configFormat.type==m.PLAYER_IN_TYPE_MPEGTS?this._mpegTsEntry():this.configFormat.type==m.PLAYER_IN_TYPE_M3U8?this._m3u8Entry():this.configFormat.type===m.PLAYER_IN_TYPE_RAW_265&&this._raw265Entry(),0)}},{key:"_makeMP4PlayerViewEvent",value:function(e,t,i,n){var a=this,s=arguments.length>4&&void 0!==arguments[4]&&arguments[4],o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null,u=this;if(this.playParam.durationMs=e,this.playParam.fps=t,this.playParam.sampleRate=i,this.playParam.size=n,this.playParam.audioNone=s,this.playParam.videoCodec=o||m.CODEC_H265,this.playParam,(this.configFormat.type==m.PLAYER_IN_TYPE_M3U8&&this.hlsConf.hlsType==m.PLAYER_IN_TYPE_M3U8_LIVE||this.configFormat.type==m.PLAYER_IN_TYPE_RAW_265)&&(this.playMode=m.PLAYER_MODE_NOTIME_LIVE),u.configFormat.extInfo.autoCrop){var l=document.querySelector("#"+this.configFormat.playerId),d=n.width/n.height,h=this.configFormat.playerW/this.configFormat.playerH;d>h?l.style.height=this.configFormat.playerW/d+"px":d=m.FETCH_FIRST_MAX_TIMES)return;i=new AbortController,n=i.signal,e(s+1)}}),m.FETCH_HTTP_FLV_TIMEOUT_MS),fetch(t.videoURL,{signal:n}).then((function(e){if(a=!0,e.headers.has("Content-Length"))o=e.headers.get("Content-Length"),t.player&&t.player.setProbeSize(o*t.configFormat.extInfo.coreProbePart);else{if(t.mediaExtFormat===m.PLAYER_IN_TYPE_FLV)return i.abort(),t.player.release(),t.player=null,t._cLiveFLVDecoderEntry(r),!0;t.player&&t.player.setProbeSize(4096)}return e.headers.get("Content-Length"),t.configFormat.type,t.mediaExtFormat,function e(i){return i.read().then((function(n){if(!n.done){n.value.buffer;var r=new Uint8Array(n.value.buffer);return t.player&&t.player.pushBuffer(r)<0?(t.player.release(),t.player=null,t._mp4EntryVodStream(),!1):e(i)}t.player&&t.player.pushDone()}))}(e.body.getReader())})).catch((function(e){e.toString().includes("user aborted")||console.error("cdemuxdecoder error",e)}))}(0)}},{key:"_cLiveFLVDecoderEntry",value:function(e){var t=this,i=this;e.probeSize=this.configFormat.extInfo.probeSize,this.player=new o.CHttpLiveCore(e),e.probeSize,this.player.onProbeFinish=function(){i.playParam.fps=i.player.mediaInfo.fps,i.playParam.durationMs=-1,i.playMode=m.PLAYER_MODE_NOTIME_LIVE,i.playParam.sampleRate=i.player.mediaInfo.sampleRate,i.playParam.size={width:i.player.mediaInfo.width,height:i.player.mediaInfo.height},i.playParam.audioNone=i.player.mediaInfo.audioNone,i.player.mediaInfo,i.player.vCodecID===m.V_CODEC_NAME_HEVC?(i.playParam.audioIdx<0&&(i.playParam.audioNone=!0),i.playParam.videoCodec=m.CODEC_H265,i.onLoadFinish&&i.onLoadFinish()):(i.playParam.videoCodec=m.CODEC_H264,i.player.release(),i.player=null,i._flvJsPlayer())},this.player.onNetworkError=function(e){i.onNetworkError&&i.onNetworkError(e)},this.player.onReadyShowDone=function(){i.configFormat.extInfo.readyShow=!1,i.onReadyShowDone&&i.onReadyShowDone()},this.player.onLoadCache=function(){null!=t.onLoadCache&&t.onLoadCache()},this.player.onLoadCacheFinshed=function(){null!=t.onLoadCacheFinshed&&t.onLoadCacheFinshed()},this.player.start(this.videoURL)}},{key:"_cWsFLVDecoderEntry",value:function(){var e=this,t=this,i={width:this.configFormat.playerW,height:this.configFormat.playerH,playerId:this.configFormat.playerId,token:this.configFormat.token,readyShow:this.configFormat.extInfo.readyShow,checkProbe:this.configFormat.extInfo.checkProbe,ignoreAudio:this.configFormat.extInfo.ignoreAudio,playMode:this.playMode};i.probeSize=this.configFormat.extInfo.probeSize,this.player=new u.CWsLiveCore(i),i.probeSize,this.player.onProbeFinish=function(){t.playParam.fps=t.player.mediaInfo.fps,t.playParam.durationMs=-1,t.playMode=m.PLAYER_MODE_NOTIME_LIVE,t.playParam.sampleRate=t.player.mediaInfo.sampleRate,t.playParam.size={width:t.player.mediaInfo.width,height:t.player.mediaInfo.height},t.playParam.audioNone=t.player.mediaInfo.audioNone,t.player.mediaInfo,t.player.vCodecID===m.V_CODEC_NAME_HEVC?(t.playParam.audioIdx<0&&(t.playParam.audioNone=!0),t.playParam.videoCodec=m.CODEC_H265,t.onLoadFinish&&t.onLoadFinish()):(t.playParam.videoCodec=m.CODEC_H264,t.player.release(),t.player=null,t._flvJsPlayer())},this.player.onNetworkError=function(e){t.onNetworkError&&t.onNetworkError(e)},this.player.onReadyShowDone=function(){t.configFormat.extInfo.readyShow=!1,t.onReadyShowDone&&t.onReadyShowDone()},this.player.onLoadCache=function(){null!=e.onLoadCache&&e.onLoadCache()},this.player.onLoadCacheFinshed=function(){null!=e.onLoadCacheFinshed&&e.onLoadCacheFinshed()},this.player.start(this.videoURL)}},{key:"_mpegTsEntry",value:function(){var e=this,t=new AbortController,i=t.signal;this.timerFeed=null,this.mpegTsObj=new f.MpegTs,this.mpegTsObj.bindReady(e),this.mpegTsObj.onDemuxed=this._mpegTsEntryReady.bind(this),this.mpegTsObj.onReady=function(){var n=null;fetch(e.videoURL,{signal:i}).then((function(r){if(r.headers.has("Content-Length"))return function t(i){return i.read().then((function(r){if(!r.done){var a=r.value;if(null===n)n=a;else{var s=a,o=n.length+s.length,u=new Uint8Array(o);u.set(n),u.set(s,n.length),n=new Uint8Array(u),s=null,u=null}return t(i)}e.mpegTsObj.demux(n)}))}(r.body.getReader());t.abort(),i=null,t=null;var a={width:e.configFormat.playerW,height:e.configFormat.playerH,playerId:e.configFormat.playerId,token:e.configFormat.token,readyShow:e.configFormat.extInfo.readyShow,checkProbe:e.configFormat.extInfo.checkProbe,ignoreAudio:e.configFormat.extInfo.ignoreAudio,playMode:e.playMode};e._cLiveFLVDecoderEntry(a)})).catch((function(e){if(!e.toString().includes("user aborted")){var t=" mpegts request error:"+e;console.error(t)}}))},this.mpegTsObj.initMPEG()}},{key:"_mpegTsEntryReady",value:function(e){var t=e,i=(t.mpegTsObj.getVCodec(),t.mpegTsObj.getACodec()),n=t.mpegTsObj.getDurationMs(),r=t.mpegTsObj.getFPS(),a=t.mpegTsObj.getSampleRate(),s=t.mpegTsObj.getSize(),o=this.mpegTsObj.isHEVC();if(!o)return this.mpegTsObj.releaseTsDemuxer(),this.mpegTsObj=null,this.playParam.durationMs=n,this.playParam.fps=r,this.playParam.sampleRate=a,this.playParam.size=s,this.playParam.audioNone=""==i,this.playParam.videoCodec=o?0:1,this.playParam,void(this.onLoadFinish&&this.onLoadFinish());t._makeMP4PlayerViewEvent(n,r,a,s,""==i),parseInt(n/1e3),t._avFeedMP4Data(0,0)}},{key:"_m3u8Entry",value:function(){var e=this,t=this,i=!1,n=0;this.hlsObj=new p.M3u8,this.hlsObj.bindReady(t),this.hlsObj.onFinished=function(e,r){0==i&&(n=t.hlsObj.getDurationMs(),t.hlsConf.hlsType=r.type,i=!0)},this.hlsObj.onCacheProcess=function(t){e.playMode!==m.PLAYER_MODE_NOTIME_LIVE&&e.onCacheProcess&&e.onCacheProcess(t)},this.hlsObj.onDemuxed=function(e){if(null==t.player){var i=t.hlsObj.isHevcParam,r=(t.hlsObj.getVCodec(),t.hlsObj.getACodec()),a=t.hlsObj.getFPS(),s=t.hlsObj.getSampleRate(),o=t.hlsObj.getSize(),u=!1;if(u=t.hlsObj.getSampleChannel()<=0||""===r,!i)return t.hlsObj.release(),t.hlsObj.mpegTsObj&&t.hlsObj.mpegTsObj.releaseTsDemuxer(),t.hlsObj=null,t.playParam.durationMs=-1,t.playParam.fps=a,t.playParam.sampleRate=s,t.playParam.size=o,t.playParam.audioNone=""==r,t.playParam.videoCodec=i?0:1,t.playParam,void t._videoJsPlayer();t._makeMP4PlayerViewEvent(n,a,s,o,u)}},this.hlsObj.onSamples=this._hlsOnSamples.bind(this),this.hlsObj.demux(this.videoURL)}},{key:"_hlsOnSamples",value:function(e,t){1==t.video?this.player.appendHevcFrame(t):!1===this.hlsObj.audioNone&&this.player.appendAACFrame(t)}},{key:"_videoJsPlayer",value:function(){var e=this,t={width:this.configFormat.playerW,height:this.configFormat.playerH,playerId:this.configFormat.playerId,ignoreAudio:this.configFormat.extInfo.ignoreAudio};this.player=new l.NvVideojsCore(t),this.player.onMakeItReady=function(){e.onMakeItReady&&e.onMakeItReady()},this.player.onLoadFinish=function(){e.playParam.size=e.player.getSize(),e.player.duration===1/0||e.player.duration<0?(e.playParam.durationMs=-1,e.playMode=m.PLAYER_MODE_NOTIME_LIVE):(e.playParam.durationMs=1e3*e.player.duration,e.playMode=m.PLAYER_MODE_VOD),e.onLoadFinish&&e.onLoadFinish()},this.player.onReadyShowDone=function(){e.onReadyShowDone&&e.onReadyShowDone()},this.player.onPlayingFinish=function(){e.pause(),e.seek(0),null!=e.onPlayFinish&&e.onPlayFinish()},this.player.onPlayingTime=function(t){e._durationText(t),e._durationText(e.player.duration),null!=e.onPlayTime&&e.onPlayTime(t)},this.player.onSeekFinish=function(){e.onSeekFinish&&e.onSeekFinish()},this.player.makeIt(this.videoURL)}},{key:"_flvJsPlayer",value:function(){var e=this,t={width:this.configFormat.playerW,height:this.configFormat.playerH,playerId:this.configFormat.playerId,ignoreAudio:this.configFormat.extInfo.ignoreAudio};this.player=new d.NvFlvjsCore(t),this.player.onLoadFinish=function(){e.playParam.size=e.player.getSize(),!e.player.duration||NaN===e.player.duration||e.player.duration===1/0||e.player.duration<0?(e.playParam.durationMs=-1,e.playMode=m.PLAYER_MODE_NOTIME_LIVE):(e.playParam.durationMs=1e3*e.player.duration,e.playMode=m.PLAYER_MODE_VOD),e.onLoadFinish&&e.onLoadFinish()},this.player.onReadyShowDone=function(){e.onReadyShowDone&&e.onReadyShowDone()},this.player.onPlayingTime=function(t){e._durationText(t),e._durationText(e.player.duration),null!=e.onPlayTime&&e.onPlayTime(t)},this.player.onPlayingFinish=function(){e.pause(),e.seek(0),null!=e.onPlayFinish&&e.onPlayFinish()},this.player.makeIt(this.videoURL)}},{key:"_raw265Entry",value:function(){this._makeMP4PlayerViewEvent(-1,this.configFormat.extInfo.rawFps,-1,{width:this.configFormat.playerW,height:this.configFormat.playerH},!0,m.CODEC_H265),this.timerFeed&&(window.clearInterval(this.timerFeed),this.timerFeed=null)}},{key:"append265NaluFrame",value:function(e){var t={data:e,pts:this.rawModePts};this.player.appendHevcFrame(t),this.configFormat.extInfo.readyShow&&this.player.cacheYuvBuf.getState()!=CACHE_APPEND_STATUS_CODE.NULL&&(this.player.playFrameYUV(!0,!0),this.configFormat.extInfo.readyShow=!1,this.onReadyShowDone&&this.onReadyShowDone()),this.rawModePts+=1/this.configFormat.extInfo.rawFps}}])&&n(i.prototype,v),b&&n(i,b),e}();i.H265webjs=v,t.new265webjs=function(e,t){return new v(e,t)}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./consts":52,"./decoder/av-common":55,"./decoder/c-httplive-core":56,"./decoder/c-native-core":57,"./decoder/c-wslive-core":58,"./decoder/cache":59,"./decoder/player-core":63,"./demuxer/m3u8":66,"./demuxer/mp4":68,"./demuxer/mpegts/mpeg.js":71,"./demuxer/ts":72,"./native/mp4-player":74,"./native/nv-flvjs-core":75,"./native/nv-videojs-core":76,"./utils/static-mem":78,"./utils/ui/ui":79}],74:[function(e,t,i){"use strict";function n(e,t){for(var i=0;i>1,a>>1,i),e.v.fill(r>>1,a>>1,n),e.drawArrays(e.TRIANGLE_STRIP,0,4)},setupCanvas:function(e,t){var i=e.getContext("webgl")||e.getContext("experimental-webgl");if(!i)return i;var r=i.createProgram(),a=["attribute highp vec4 aVertexPosition;","attribute vec2 aTextureCoord;","varying highp vec2 vTextureCoord;","void main(void) {"," gl_Position = aVertexPosition;"," vTextureCoord = aTextureCoord;","}"].join("\n"),s=i.createShader(i.VERTEX_SHADER);i.shaderSource(s,a),i.compileShader(s);var o=["precision highp float;","varying lowp vec2 vTextureCoord;","uniform sampler2D YTexture;","uniform sampler2D UTexture;","uniform sampler2D VTexture;","const mat4 YUV2RGB = mat4","("," 1.1643828125, 0, 1.59602734375, -.87078515625,"," 1.1643828125, -.39176171875, -.81296875, .52959375,"," 1.1643828125, 2.017234375, 0, -1.081390625,"," 0, 0, 0, 1",");","void main(void) {"," gl_FragColor = vec4( texture2D(YTexture, vTextureCoord).x, texture2D(UTexture, vTextureCoord).x, texture2D(VTexture, vTextureCoord).x, 1) * YUV2RGB;","}"].join("\n"),u=i.createShader(i.FRAGMENT_SHADER);i.shaderSource(u,o),i.compileShader(u),i.attachShader(r,s),i.attachShader(r,u),i.linkProgram(r),i.useProgram(r),i.getProgramParameter(r,i.LINK_STATUS);var l=i.getAttribLocation(r,"aVertexPosition");i.enableVertexAttribArray(l);var d=i.getAttribLocation(r,"aTextureCoord");i.enableVertexAttribArray(d);var h=i.createBuffer();i.bindBuffer(i.ARRAY_BUFFER,h),i.bufferData(i.ARRAY_BUFFER,new Float32Array([1,1,0,-1,1,0,1,-1,0,-1,-1,0]),i.STATIC_DRAW),i.vertexAttribPointer(l,3,i.FLOAT,!1,0,0);var c=i.createBuffer();return i.bindBuffer(i.ARRAY_BUFFER,c),i.bufferData(i.ARRAY_BUFFER,new Float32Array([1,0,0,0,1,1,0,1]),i.STATIC_DRAW),i.vertexAttribPointer(d,2,i.FLOAT,!1,0,0),i.y=new n(i),i.u=new n(i),i.v=new n(i),i.y.bind(0,r,"YTexture"),i.u.bind(1,r,"UTexture"),i.v.bind(2,r,"VTexture"),i}}},{}],78:[function(e,t,i){(function(e){"use strict";e.STATIC_MEM_wasmDecoderState=-1,e.STATICE_MEM_playerCount=-1,e.STATICE_MEM_playerIndexPtr=0}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],79:[function(e,t,i){"use strict";function n(e,t){for(var i=0;i>7))^e]=e;for(t=i=0;!h[t];t^=n||1,i=p[i]||1)for(a=(a=i^i<<1^i<<2^i<<3^i<<4)>>8^255&a^99,h[t]=a,c[a]=t,o=16843009*f[r=f[n=f[t]]]^65537*r^257*n^16843008*t,s=257*f[a]^16843008*a,e=0;e<4;e++)l[e][t]=s=s<<24^s>>>8,d[e][a]=o=o<<24^o>>>8;for(e=0;e<5;e++)l[e]=l[e].slice(0),d[e]=d[e].slice(0);return u}()),this._tables=[[a[0][0].slice(),a[0][1].slice(),a[0][2].slice(),a[0][3].slice(),a[0][4].slice()],[a[1][0].slice(),a[1][1].slice(),a[1][2].slice(),a[1][3].slice(),a[1][4].slice()]];var r=this._tables[0][4],s=this._tables[1],o=e.length,u=1;if(4!==o&&6!==o&&8!==o)throw new Error("Invalid aes key size");var l=e.slice(0),d=[];for(this._key=[l,d],t=o;t<4*o+28;t++)n=l[t-1],(t%o==0||8===o&&t%o==4)&&(n=r[n>>>24]<<24^r[n>>16&255]<<16^r[n>>8&255]<<8^r[255&n],t%o==0&&(n=n<<8^n>>>24^u<<24,u=u<<1^283*(u>>7))),l[t]=l[t-o]^n;for(i=0;t;i++,t--)n=l[3&i?t:t-4],d[i]=t<=4||i<4?n:s[0][r[n>>>24]]^s[1][r[n>>16&255]]^s[2][r[n>>8&255]]^s[3][r[255&n]]}return e.prototype.decrypt=function(e,t,i,n,r,a){var s,o,u,l,d=this._key[1],h=e^d[0],c=n^d[1],f=i^d[2],p=t^d[3],m=d.length/4-2,g=4,_=this._tables[1],y=_[0],v=_[1],b=_[2],T=_[3],S=_[4];for(l=0;l>>24]^v[c>>16&255]^b[f>>8&255]^T[255&p]^d[g],o=y[c>>>24]^v[f>>16&255]^b[p>>8&255]^T[255&h]^d[g+1],u=y[f>>>24]^v[p>>16&255]^b[h>>8&255]^T[255&c]^d[g+2],p=y[p>>>24]^v[h>>16&255]^b[c>>8&255]^T[255&f]^d[g+3],g+=4,h=s,c=o,f=u;for(l=0;l<4;l++)r[(3&-l)+a]=S[h>>>24]<<24^S[c>>16&255]<<16^S[f>>8&255]<<8^S[255&p]^d[g++],s=h,h=c,c=f,f=p,p=s},e}(),o=function(e){function t(){var t;return(t=e.call(this,r)||this).jobs=[],t.delay=1,t.timeout_=null,t}n(t,e);var i=t.prototype;return i.processJob_=function(){this.jobs.shift()(),this.jobs.length?this.timeout_=setTimeout(this.processJob_.bind(this),this.delay):this.timeout_=null},i.push=function(e){this.jobs.push(e),this.timeout_||(this.timeout_=setTimeout(this.processJob_.bind(this),this.delay))},t}(r),u=function(e){return e<<24|(65280&e)<<8|(16711680&e)>>8|e>>>24},l=function(){function e(t,i,n,r){var a=e.STEP,s=new Int32Array(t.buffer),l=new Uint8Array(t.byteLength),d=0;for(this.asyncStream_=new o,this.asyncStream_.push(this.decryptChunk_(s.subarray(d,d+a),i,n,l)),d=a;d>2),m=new s(Array.prototype.slice.call(t)),g=new Uint8Array(e.byteLength),_=new Int32Array(g.buffer);for(n=i[0],r=i[1],a=i[2],o=i[3],f=0;f=0&&(t="main-desc"),t},Io=function(e,t){e.abort(),e.pause(),t&&t.activePlaylistLoader&&(t.activePlaylistLoader.pause(),t.activePlaylistLoader=null)},Po=function(e,t){t.activePlaylistLoader=e,e.load()},Lo={AUDIO:function(e,t){return function(){var i=t.segmentLoaders[e],n=t.mediaTypes[e],r=t.blacklistCurrentPlaylist;Io(i,n);var a=n.activeTrack(),s=n.activeGroup(),o=(s.filter((function(e){return e.default}))[0]||s[0]).id,u=n.tracks[o];if(a!==u){for(var l in Yr.log.warn("Problem encountered loading the alternate audio track.Switching back to default."),n.tracks)n.tracks[l].enabled=n.tracks[l]===u;n.onTrackChanged()}else r({message:"Problem encountered loading the default audio track."})}},SUBTITLES:function(e,t){return function(){var i=t.segmentLoaders[e],n=t.mediaTypes[e];Yr.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track."),Io(i,n);var r=n.activeTrack();r&&(r.mode="disabled"),n.onTrackChanged()}}},Do={AUDIO:function(e,t,i){if(t){var n=i.tech,r=i.requestOptions,a=i.segmentLoaders[e];t.on("loadedmetadata",(function(){var e=t.media();a.playlist(e,r),(!n.paused()||e.endList&&"none"!==n.preload())&&a.load()})),t.on("loadedplaylist",(function(){a.playlist(t.media(),r),n.paused()||a.load()})),t.on("error",Lo[e](e,i))}},SUBTITLES:function(e,t,i){var n=i.tech,r=i.requestOptions,a=i.segmentLoaders[e],s=i.mediaTypes[e];t.on("loadedmetadata",(function(){var e=t.media();a.playlist(e,r),a.track(s.activeTrack()),(!n.paused()||e.endList&&"none"!==n.preload())&&a.load()})),t.on("loadedplaylist",(function(){a.playlist(t.media(),r),n.paused()||a.load()})),t.on("error",Lo[e](e,i))}},Uo={AUDIO:function(e,t){var i=t.vhs,n=t.sourceType,r=t.segmentLoaders[e],a=t.requestOptions,s=t.master.mediaGroups,o=t.mediaTypes[e],u=o.groups,l=o.tracks,d=o.logger_,h=t.masterPlaylistLoader,c=ba(h.master);for(var f in s[e]&&0!==Object.keys(s[e]).length||(s[e]={main:{default:{default:!0}}},c&&(s[e].main.default.playlists=h.master.playlists)),s[e])for(var p in u[f]||(u[f]=[]),s[e][f]){var m=s[e][f][p],g=void 0;if(c?(d("AUDIO group '"+f+"' label '"+p+"' is a master playlist"),m.isMasterPlaylist=!0,g=null):g="vhs-json"===n&&m.playlists?new Oa(m.playlists[0],i,a):m.resolvedUri?new Oa(m.resolvedUri,i,a):m.playlists&&"dash"===n?new is(m.playlists[0],i,a,h):null,m=Yr.mergeOptions({id:p,playlistLoader:g},m),Do[e](e,m.playlistLoader,t),u[f].push(m),void 0===l[p]){var _=new Yr.AudioTrack({id:p,kind:xo(m),enabled:!1,language:m.language,default:m.default,label:p});l[p]=_}}r.on("error",Lo[e](e,t))},SUBTITLES:function(e,t){var i=t.tech,n=t.vhs,r=t.sourceType,a=t.segmentLoaders[e],s=t.requestOptions,o=t.master.mediaGroups,u=t.mediaTypes[e],l=u.groups,d=u.tracks,h=t.masterPlaylistLoader;for(var c in o[e])for(var f in l[c]||(l[c]=[]),o[e][c])if(!o[e][c][f].forced){var p=o[e][c][f],m=void 0;if("hls"===r)m=new Oa(p.resolvedUri,n,s);else if("dash"===r){if(!p.playlists.filter((function(e){return e.excludeUntil!==1/0})).length)return;m=new is(p.playlists[0],n,s,h)}else"vhs-json"===r&&(m=new Oa(p.playlists?p.playlists[0]:p.resolvedUri,n,s));if(p=Yr.mergeOptions({id:f,playlistLoader:m},p),Do[e](e,p.playlistLoader,t),l[c].push(p),void 0===d[f]){var g=i.addRemoteTextTrack({id:f,kind:"subtitles",default:p.default&&p.autoselect,language:p.language,label:f},!1).track;d[f]=g}}a.on("error",Lo[e](e,t))},"CLOSED-CAPTIONS":function(e,t){var i=t.tech,n=t.master.mediaGroups,r=t.mediaTypes[e],a=r.groups,s=r.tracks;for(var o in n[e])for(var u in a[o]||(a[o]=[]),n[e][o]){var l=n[e][o][u];if(/^(?:CC|SERVICE)/.test(l.instreamId)){var d=i.options_.vhs&&i.options_.vhs.captionServices||{},h={label:u,language:l.language,instreamId:l.instreamId,default:l.default&&l.autoselect};if(d[h.instreamId]&&(h=Yr.mergeOptions(h,d[h.instreamId])),void 0===h.default&&delete h.default,a[o].push(Yr.mergeOptions({id:u},l)),void 0===s[u]){var c=i.addRemoteTextTrack({id:h.instreamId,kind:"captions",default:h.default,language:h.language,label:h.label},!1).track;s[u]=c}}}}},Ro=function e(t,i){for(var n=0;n1&&ba(t.master))for(var u=0;u "+a+" from "+t),this.tech_.trigger({type:"usage",name:"vhs-rendition-change-"+t})),this.masterPlaylistLoader_.media(e,i)},i.startABRTimer_=function(){var e=this;this.stopABRTimer_(),this.abrTimer_=A.default.setInterval((function(){return e.checkABR_()}),250)},i.stopABRTimer_=function(){this.tech_.scrubbing&&this.tech_.scrubbing()||(A.default.clearInterval(this.abrTimer_),this.abrTimer_=null)},i.getAudioTrackPlaylists_=function(){var e=this.master(),t=e&&e.playlists||[];if(!e||!e.mediaGroups||!e.mediaGroups.AUDIO)return t;var i,n=e.mediaGroups.AUDIO,r=Object.keys(n);if(Object.keys(this.mediaTypes_.AUDIO.groups).length)i=this.mediaTypes_.AUDIO.activeTrack();else{var a=n.main||r.length&&n[r[0]];for(var s in a)if(a[s].default){i={label:s};break}}if(!i)return t;var o=[];for(var u in n)if(n[u][i.label]){var l=n[u][i.label];if(l.playlists&&l.playlists.length)o.push.apply(o,l.playlists);else if(l.uri)o.push(l);else if(e.playlists.length)for(var d=0;d1&&(this.tech_.trigger({type:"usage",name:"vhs-alternate-audio"}),this.tech_.trigger({type:"usage",name:"hls-alternate-audio"})),this.useCueTags_&&(this.tech_.trigger({type:"usage",name:"vhs-playlist-cue-tags"}),this.tech_.trigger({type:"usage",name:"hls-playlist-cue-tags"}))},i.shouldSwitchToMedia_=function(e){var t=this.masterPlaylistLoader_.media(),i=this.tech_.buffered();return function(e){var t=e.currentPlaylist,i=e.nextPlaylist,n=e.forwardBuffer,r=e.bufferLowWaterLine,a=e.bufferHighWaterLine,s=e.duration,o=e.experimentalBufferBasedABR,u=e.log;if(!i)return Yr.log.warn("We received no playlist to switch to. Please check your stream."),!1;var l="allowing switch "+(t&&t.id||"null")+" -> "+i.id;if(!t)return u(l+" as current playlist is not set"),!0;if(i.id===t.id)return!1;if(!t.endList)return u(l+" as current playlist is live"),!0;var d=o?ns.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:ns.MAX_BUFFER_LOW_WATER_LINE;if(sc)&&n>=r){var p=l+" as forwardBuffer >= bufferLowWaterLine ("+n+" >= "+r+")";return o&&(p+=" and next bandwidth > current bandwidth ("+h+" > "+c+")"),u(p),!0}return u("not "+l+" as no switching criteria met"),!1}({currentPlaylist:t,nextPlaylist:e,forwardBuffer:i.length?i.end(i.length-1)-this.tech_.currentTime():0,bufferLowWaterLine:this.bufferLowWaterLine(),bufferHighWaterLine:this.bufferHighWaterLine(),duration:this.duration(),experimentalBufferBasedABR:this.experimentalBufferBasedABR,log:this.logger_})},i.setupSegmentLoaderListeners_=function(){var e=this;this.experimentalBufferBasedABR||(this.mainSegmentLoader_.on("bandwidthupdate",(function(){var t=e.selectPlaylist();e.shouldSwitchToMedia_(t)&&e.switchMedia_(t,"bandwidthupdate"),e.tech_.trigger("bandwidthupdate")})),this.mainSegmentLoader_.on("progress",(function(){e.trigger("progress")}))),this.mainSegmentLoader_.on("error",(function(){e.blacklistCurrentPlaylist(e.mainSegmentLoader_.error())})),this.mainSegmentLoader_.on("appenderror",(function(){e.error=e.mainSegmentLoader_.error_,e.trigger("error")})),this.mainSegmentLoader_.on("syncinfoupdate",(function(){e.onSyncInfoUpdate_()})),this.mainSegmentLoader_.on("timestampoffset",(function(){e.tech_.trigger({type:"usage",name:"vhs-timestamp-offset"}),e.tech_.trigger({type:"usage",name:"hls-timestamp-offset"})})),this.audioSegmentLoader_.on("syncinfoupdate",(function(){e.onSyncInfoUpdate_()})),this.audioSegmentLoader_.on("appenderror",(function(){e.error=e.audioSegmentLoader_.error_,e.trigger("error")})),this.mainSegmentLoader_.on("ended",(function(){e.logger_("main segment loader ended"),e.onEndOfStream()})),this.mainSegmentLoader_.on("earlyabort",(function(t){e.experimentalBufferBasedABR||(e.delegateLoaders_("all",["abort"]),e.blacklistCurrentPlaylist({message:"Aborted early because there isn't enough bandwidth to complete the request without rebuffering."},120))}));var t=function(){if(!e.sourceUpdater_.hasCreatedSourceBuffers())return e.tryToCreateSourceBuffers_();var t=e.getCodecsOrExclude_();t&&e.sourceUpdater_.addOrChangeSourceBuffers(t)};this.mainSegmentLoader_.on("trackinfo",t),this.audioSegmentLoader_.on("trackinfo",t),this.mainSegmentLoader_.on("fmp4",(function(){e.triggeredFmp4Usage||(e.tech_.trigger({type:"usage",name:"vhs-fmp4"}),e.tech_.trigger({type:"usage",name:"hls-fmp4"}),e.triggeredFmp4Usage=!0)})),this.audioSegmentLoader_.on("fmp4",(function(){e.triggeredFmp4Usage||(e.tech_.trigger({type:"usage",name:"vhs-fmp4"}),e.tech_.trigger({type:"usage",name:"hls-fmp4"}),e.triggeredFmp4Usage=!0)})),this.audioSegmentLoader_.on("ended",(function(){e.logger_("audioSegmentLoader ended"),e.onEndOfStream()}))},i.mediaSecondsLoaded_=function(){return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded+this.mainSegmentLoader_.mediaSecondsLoaded)},i.load=function(){this.mainSegmentLoader_.load(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.load(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.load()},i.smoothQualityChange_=function(e){void 0===e&&(e=this.selectPlaylist()),this.fastQualityChange_(e)},i.fastQualityChange_=function(e){var t=this;void 0===e&&(e=this.selectPlaylist()),e!==this.masterPlaylistLoader_.media()?(this.switchMedia_(e,"fast-quality"),this.mainSegmentLoader_.resetEverything((function(){Yr.browser.IE_VERSION||Yr.browser.IS_EDGE?t.tech_.setCurrentTime(t.tech_.currentTime()+.04):t.tech_.setCurrentTime(t.tech_.currentTime())}))):this.logger_("skipping fastQualityChange because new media is same as old")},i.play=function(){if(!this.setupFirstPlay()){this.tech_.ended()&&this.tech_.setCurrentTime(0),this.hasPlayed_&&this.load();var e=this.tech_.seekable();return this.tech_.duration()===1/0&&this.tech_.currentTime()this.maxPlaylistRetries?1/0:Date.now()+1e3*t,i.excludeUntil=n,e.reason&&(i.lastExcludeReason_=e.reason),this.tech_.trigger("blacklistplaylist"),this.tech_.trigger({type:"usage",name:"vhs-rendition-blacklisted"}),this.tech_.trigger({type:"usage",name:"hls-rendition-blacklisted"});var u=this.selectPlaylist();if(!u)return this.error="Playback cannot continue. No available working or supported playlists.",void this.trigger("error");var l=e.internal?this.logger_:Yr.log.warn,d=e.message?" "+e.message:"";l((e.internal?"Internal problem":"Problem")+" encountered with playlist "+i.id+"."+d+" Switching to playlist "+u.id+"."),u.attributes.AUDIO!==i.attributes.AUDIO&&this.delegateLoaders_("audio",["abort","pause"]),u.attributes.SUBTITLES!==i.attributes.SUBTITLES&&this.delegateLoaders_("subtitle",["abort","pause"]),this.delegateLoaders_("main",["abort","pause"]);var h=u.targetDuration/2*1e3||5e3,c="number"==typeof u.lastRequest&&Date.now()-u.lastRequest<=h;return this.switchMedia_(u,"exclude",s||c)},i.pauseLoading=function(){this.delegateLoaders_("all",["abort","pause"]),this.stopABRTimer_()},i.delegateLoaders_=function(e,t){var i=this,n=[],r="all"===e;(r||"main"===e)&&n.push(this.masterPlaylistLoader_);var a=[];(r||"audio"===e)&&a.push("AUDIO"),(r||"subtitle"===e)&&(a.push("CLOSED-CAPTIONS"),a.push("SUBTITLES")),a.forEach((function(e){var t=i.mediaTypes_[e]&&i.mediaTypes_[e].activePlaylistLoader;t&&n.push(t)})),["main","audio","subtitle"].forEach((function(t){var r=i[t+"SegmentLoader_"];!r||e!==t&&"all"!==e||n.push(r)})),n.forEach((function(e){return t.forEach((function(t){"function"==typeof e[t]&&e[t]()}))}))},i.setCurrentTime=function(e){var t=Zr(this.tech_.buffered(),e);return this.masterPlaylistLoader_&&this.masterPlaylistLoader_.media()&&this.masterPlaylistLoader_.media().segments?t&&t.length?e:(this.mainSegmentLoader_.resetEverything(),this.mainSegmentLoader_.abort(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.resetEverything(),this.audioSegmentLoader_.abort()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.resetEverything(),this.subtitleSegmentLoader_.abort()),void this.load()):0},i.duration=function(){if(!this.masterPlaylistLoader_)return 0;var e=this.masterPlaylistLoader_.media();return e?e.endList?this.mediaSource?this.mediaSource.duration:Zs.Playlist.duration(e):1/0:0},i.seekable=function(){return this.seekable_},i.onSyncInfoUpdate_=function(){var e;if(this.masterPlaylistLoader_){var t=this.masterPlaylistLoader_.media();if(t){var i=this.syncController_.getExpiredTime(t,this.duration());if(null!==i){var n=this.masterPlaylistLoader_.master,r=Zs.Playlist.seekable(t,i,Zs.Playlist.liveEdgeDelay(n,t));if(0!==r.length){if(this.mediaTypes_.AUDIO.activePlaylistLoader){if(t=this.mediaTypes_.AUDIO.activePlaylistLoader.media(),null===(i=this.syncController_.getExpiredTime(t,this.duration())))return;if(0===(e=Zs.Playlist.seekable(t,i,Zs.Playlist.liveEdgeDelay(n,t))).length)return}var a,s;this.seekable_&&this.seekable_.length&&(a=this.seekable_.end(0),s=this.seekable_.start(0)),e?e.start(0)>r.end(0)||r.start(0)>e.end(0)?this.seekable_=r:this.seekable_=Yr.createTimeRanges([[e.start(0)>r.start(0)?e.start(0):r.start(0),e.end(0)0&&(n=Math.max(n,i.end(i.length-1))),this.mediaSource.duration!==n&&this.sourceUpdater_.setDuration(n)}},i.dispose=function(){var e=this;this.trigger("dispose"),this.decrypter_.terminate(),this.masterPlaylistLoader_.dispose(),this.mainSegmentLoader_.dispose(),this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_),["AUDIO","SUBTITLES"].forEach((function(t){var i=e.mediaTypes_[t].groups;for(var n in i)i[n].forEach((function(e){e.playlistLoader&&e.playlistLoader.dispose()}))})),this.audioSegmentLoader_.dispose(),this.subtitleSegmentLoader_.dispose(),this.sourceUpdater_.dispose(),this.timelineChangeController_.dispose(),this.stopABRTimer_(),this.updateDuration_&&this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.mediaSource.removeEventListener("durationchange",this.handleDurationChange_),this.mediaSource.removeEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.removeEventListener("sourceended",this.handleSourceEnded_),this.off()},i.master=function(){return this.masterPlaylistLoader_.master},i.media=function(){return this.masterPlaylistLoader_.media()||this.initialMedia_},i.areMediaTypesKnown_=function(){var e=!!this.mediaTypes_.AUDIO.activePlaylistLoader,t=!!this.mainSegmentLoader_.getCurrentMediaInfo_(),i=!e||!!this.audioSegmentLoader_.getCurrentMediaInfo_();return!(!t||!i)},i.getCodecsOrExclude_=function(){var e=this,t={main:this.mainSegmentLoader_.getCurrentMediaInfo_()||{},audio:this.audioSegmentLoader_.getCurrentMediaInfo_()||{}};t.video=t.main;var i=Os(this.master(),this.media()),n={},r=!!this.mediaTypes_.AUDIO.activePlaylistLoader;if(t.main.hasVideo&&(n.video=i.video||t.main.videoCodec||g.DEFAULT_VIDEO_CODEC),t.main.isMuxed&&(n.video+=","+(i.audio||t.main.audioCodec||g.DEFAULT_AUDIO_CODEC)),(t.main.hasAudio&&!t.main.isMuxed||t.audio.hasAudio||r)&&(n.audio=i.audio||t.main.audioCodec||t.audio.audioCodec||g.DEFAULT_AUDIO_CODEC,t.audio.isFmp4=t.main.hasAudio&&!t.main.isMuxed?t.main.isFmp4:t.audio.isFmp4),n.audio||n.video){var a,s={};if(["video","audio"].forEach((function(e){if(n.hasOwnProperty(e)&&(r=t[e].isFmp4,o=n[e],!(r?g.browserSupportsCodec(o):g.muxerSupportsCodec(o)))){var i=t[e].isFmp4?"browser":"muxer";s[i]=s[i]||[],s[i].push(n[e]),"audio"===e&&(a=i)}var r,o})),r&&a&&this.media().attributes.AUDIO){var o=this.media().attributes.AUDIO;this.master().playlists.forEach((function(t){(t.attributes&&t.attributes.AUDIO)===o&&t!==e.media()&&(t.excludeUntil=1/0)})),this.logger_("excluding audio group "+o+" as "+a+' does not support codec(s): "'+n.audio+'"')}if(!Object.keys(s).length){if(this.sourceUpdater_.hasCreatedSourceBuffers()&&!this.sourceUpdater_.canChangeType()){var u=[];if(["video","audio"].forEach((function(t){var i=(g.parseCodecs(e.sourceUpdater_.codecs[t]||"")[0]||{}).type,r=(g.parseCodecs(n[t]||"")[0]||{}).type;i&&r&&i.toLowerCase()!==r.toLowerCase()&&u.push('"'+e.sourceUpdater_.codecs[t]+'" -> "'+n[t]+'"')})),u.length)return void this.blacklistCurrentPlaylist({playlist:this.media(),message:"Codec switching not supported: "+u.join(", ")+".",blacklistDuration:1/0,internal:!0})}return n}var l=Object.keys(s).reduce((function(e,t){return e&&(e+=", "),e+=t+' does not support codec(s): "'+s[t].join(",")+'"'}),"")+".";this.blacklistCurrentPlaylist({playlist:this.media(),internal:!0,message:l,blacklistDuration:1/0})}else this.blacklistCurrentPlaylist({playlist:this.media(),message:"Could not determine codecs for playlist.",blacklistDuration:1/0})},i.tryToCreateSourceBuffers_=function(){if("open"===this.mediaSource.readyState&&!this.sourceUpdater_.hasCreatedSourceBuffers()&&this.areMediaTypesKnown_()){var e=this.getCodecsOrExclude_();if(e){this.sourceUpdater_.createSourceBuffers(e);var t=[e.video,e.audio].filter(Boolean).join(",");this.excludeIncompatibleVariants_(t)}}},i.excludeUnsupportedVariants_=function(){var e=this,t=this.master().playlists,i=[];Object.keys(t).forEach((function(n){var r=t[n];if(-1===i.indexOf(r.id)){i.push(r.id);var a=Os(e.master,r),s=[];!a.audio||g.muxerSupportsCodec(a.audio)||g.browserSupportsCodec(a.audio)||s.push("audio codec "+a.audio),!a.video||g.muxerSupportsCodec(a.video)||g.browserSupportsCodec(a.video)||s.push("video codec "+a.video),a.text&&"stpp.ttml.im1t"===a.text&&s.push("text codec "+a.text),s.length&&(r.excludeUntil=1/0,e.logger_("excluding "+r.id+" for unsupported: "+s.join(", ")))}}))},i.excludeIncompatibleVariants_=function(e){var t=this,i=[],n=this.master().playlists,r=Us(g.parseCodecs(e)),a=Rs(r),s=r.video&&g.parseCodecs(r.video)[0]||null,o=r.audio&&g.parseCodecs(r.audio)[0]||null;Object.keys(n).forEach((function(e){var r=n[e];if(-1===i.indexOf(r.id)&&r.excludeUntil!==1/0){i.push(r.id);var u=[],l=Os(t.masterPlaylistLoader_.master,r),d=Rs(l);if(l.audio||l.video){if(d!==a&&u.push('codec count "'+d+'" !== "'+a+'"'),!t.sourceUpdater_.canChangeType()){var h=l.video&&g.parseCodecs(l.video)[0]||null,c=l.audio&&g.parseCodecs(l.audio)[0]||null;h&&s&&h.type.toLowerCase()!==s.type.toLowerCase()&&u.push('video codec "'+h.type+'" !== "'+s.type+'"'),c&&o&&c.type.toLowerCase()!==o.type.toLowerCase()&&u.push('audio codec "'+c.type+'" !== "'+o.type+'"')}u.length&&(r.excludeUntil=1/0,t.logger_("blacklisting "+r.id+": "+u.join(" && ")))}}}))},i.updateAdCues_=function(e){var t=0,i=this.seekable();i.length&&(t=i.start(0)),function(e,t,i){if(void 0===i&&(i=0),e.segments)for(var n,r=i,a=0;a0&&this.logger_("resetting possible stalled download count for "+e+" loader"),this[e+"StalledDownloads_"]=0,this[e+"Buffered_"]=t.buffered_()},t.checkSegmentDownloads_=function(e){var t=this.masterPlaylistController_,i=t[e+"SegmentLoader_"],n=i.buffered_(),r=function(e,t){if(e===t)return!1;if(!e&&t||!t&&e)return!0;if(e.length!==t.length)return!0;for(var i=0;i=t.end(t.length-1)))return this.techWaiting_();this.consecutiveUpdates>=5&&e===this.lastRecordedTime?(this.consecutiveUpdates++,this.waiting_()):e===this.lastRecordedTime?this.consecutiveUpdates++:(this.consecutiveUpdates=0,this.lastRecordedTime=e)}},t.cancelTimer_=function(){this.consecutiveUpdates=0,this.timer_&&(this.logger_("cancelTimer_"),clearTimeout(this.timer_)),this.timer_=null},t.fixesBadSeeks_=function(){if(!this.tech_.seeking())return!1;var e,t=this.seekable(),i=this.tech_.currentTime();this.afterSeekableWindow_(t,i,this.media(),this.allowSeeksWithinUnsafeLiveWindow)&&(e=t.end(t.length-1));if(this.beforeSeekableWindow_(t,i)){var n=t.start(0);e=n+(n===t.end(0)?0:.1)}if(void 0!==e)return this.logger_("Trying to seek outside of seekable at time "+i+" with seekable range "+ta(t)+". Seeking to "+e+"."),this.tech_.setCurrentTime(e),!0;var r=this.tech_.buffered();return!!function(e){var t=e.buffered,i=e.targetDuration,n=e.currentTime;return!!t.length&&(!(t.end(0)-t.start(0)<2*i)&&(!(n>t.start(0))&&t.start(0)-n "+i.end(0)+"]. Attempting to resume playback by seeking to the current time."),this.tech_.trigger({type:"usage",name:"vhs-unknown-waiting"}),void this.tech_.trigger({type:"usage",name:"hls-unknown-waiting"})):void 0}},t.techWaiting_=function(){var e=this.seekable(),t=this.tech_.currentTime();if(this.tech_.seeking()&&this.fixesBadSeeks_())return!0;if(this.tech_.seeking()||null!==this.timer_)return!0;if(this.beforeSeekableWindow_(e,t)){var i=e.end(e.length-1);return this.logger_("Fell out of live window at time "+t+". Seeking to live point (seekable end) "+i),this.cancelTimer_(),this.tech_.setCurrentTime(i),this.tech_.trigger({type:"usage",name:"vhs-live-resync"}),this.tech_.trigger({type:"usage",name:"hls-live-resync"}),!0}var n=this.tech_.vhs.masterPlaylistController_.sourceUpdater_,r=this.tech_.buffered();if(this.videoUnderflow_({audioBuffered:n.audioBuffered(),videoBuffered:n.videoBuffered(),currentTime:t}))return this.cancelTimer_(),this.tech_.setCurrentTime(t),this.tech_.trigger({type:"usage",name:"vhs-video-underflow"}),this.tech_.trigger({type:"usage",name:"hls-video-underflow"}),!0;var a=ea(r,t);if(a.length>0){var s=a.start(0)-t;return this.logger_("Stopped at "+t+", setting timer for "+s+", seeking to "+a.start(0)),this.cancelTimer_(),this.timer_=setTimeout(this.skipTheGap_.bind(this),1e3*s,t),!0}return!1},t.afterSeekableWindow_=function(e,t,i,n){if(void 0===n&&(n=!1),!e.length)return!1;var r=e.end(e.length-1)+.1;return!i.endList&&n&&(r=e.end(e.length-1)+3*i.targetDuration),t>r},t.beforeSeekableWindow_=function(e,t){return!!(e.length&&e.start(0)>0&&t2)return{start:r,end:a}}return null},e}(),zo={errorInterval:30,getSource:function(e){return e(this.tech({IWillNotUseThisInPlugins:!0}).currentSource_||this.currentSource())}},Go=function(e){!function e(t,i){var n=0,r=0,a=Yr.mergeOptions(zo,i);t.ready((function(){t.trigger({type:"usage",name:"vhs-error-reload-initialized"}),t.trigger({type:"usage",name:"hls-error-reload-initialized"})}));var s=function(){r&&t.currentTime(r)},o=function(e){null!=e&&(r=t.duration()!==1/0&&t.currentTime()||0,t.one("loadedmetadata",s),t.src(e),t.trigger({type:"usage",name:"vhs-error-reload"}),t.trigger({type:"usage",name:"hls-error-reload"}),t.play())},u=function(){return Date.now()-n<1e3*a.errorInterval?(t.trigger({type:"usage",name:"vhs-error-reload-canceled"}),void t.trigger({type:"usage",name:"hls-error-reload-canceled"})):a.getSource&&"function"==typeof a.getSource?(n=Date.now(),a.getSource.call(t,o)):void Yr.log.error("ERROR: reloadSourceOnError - The option getSource must be a function!")},l=function e(){t.off("loadedmetadata",s),t.off("error",u),t.off("dispose",e)};t.on("error",u),t.on("dispose",l),t.reloadSourceOnError=function(i){l(),e(t,i)}}(this,e)},Wo={PlaylistLoader:Oa,Playlist:Ta,utils:Ka,STANDARD_PLAYLIST_SELECTOR:Hs,INITIAL_PLAYLIST_SELECTOR:function(){var e=this,t=this.playlists.master.playlists.filter(Ta.isEnabled);return Ns(t,(function(e,t){return js(e,t)})),t.filter((function(t){return!!Os(e.playlists.master,t).video}))[0]||null},lastBandwidthSelector:Hs,movingAverageBandwidthSelector:function(e){var t=-1,i=-1;if(e<0||e>1)throw new Error("Moving average bandwidth decay must be between 0 and 1.");return function(){var n=this.useDevicePixelRatio&&A.default.devicePixelRatio||1;return t<0&&(t=this.systemBandwidth,i=this.systemBandwidth),this.systemBandwidth>0&&this.systemBandwidth!==i&&(t=e*this.systemBandwidth+(1-e)*t,i=this.systemBandwidth),Vs(this.playlists.master,t,parseInt(Bs(this.tech_.el(),"width"),10)*n,parseInt(Bs(this.tech_.el(),"height"),10)*n,this.limitRenditionByPlayerDimensions,this.masterPlaylistController_)}},comparePlaylistBandwidth:js,comparePlaylistResolution:function(e,t){var i,n;return e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width&&(i=e.attributes.RESOLUTION.width),i=i||A.default.Number.MAX_VALUE,t.attributes.RESOLUTION&&t.attributes.RESOLUTION.width&&(n=t.attributes.RESOLUTION.width),i===(n=n||A.default.Number.MAX_VALUE)&&e.attributes.BANDWIDTH&&t.attributes.BANDWIDTH?e.attributes.BANDWIDTH-t.attributes.BANDWIDTH:i-n},xhr:Na()};Object.keys(ns).forEach((function(e){Object.defineProperty(Wo,e,{get:function(){return Yr.log.warn("using Vhs."+e+" is UNSAFE be sure you know what you are doing"),ns[e]},set:function(t){Yr.log.warn("using Vhs."+e+" is UNSAFE be sure you know what you are doing"),"number"!=typeof t||t<0?Yr.log.warn("value of Vhs."+e+" must be greater than or equal to 0"):ns[e]=t}})}));var Yo=function(e,t){for(var i=t.media(),n=-1,r=0;r0?1/this.throughput:0,Math.floor(1/(t+e))},set:function(){Yr.log.error('The "systemBandwidth" property is read-only')}}}),this.options_.bandwidth&&(this.bandwidth=this.options_.bandwidth),this.options_.throughput&&(this.throughput=this.options_.throughput),Object.defineProperties(this.stats,{bandwidth:{get:function(){return i.bandwidth||0},enumerable:!0},mediaRequests:{get:function(){return i.masterPlaylistController_.mediaRequests_()||0},enumerable:!0},mediaRequestsAborted:{get:function(){return i.masterPlaylistController_.mediaRequestsAborted_()||0},enumerable:!0},mediaRequestsTimedout:{get:function(){return i.masterPlaylistController_.mediaRequestsTimedout_()||0},enumerable:!0},mediaRequestsErrored:{get:function(){return i.masterPlaylistController_.mediaRequestsErrored_()||0},enumerable:!0},mediaTransferDuration:{get:function(){return i.masterPlaylistController_.mediaTransferDuration_()||0},enumerable:!0},mediaBytesTransferred:{get:function(){return i.masterPlaylistController_.mediaBytesTransferred_()||0},enumerable:!0},mediaSecondsLoaded:{get:function(){return i.masterPlaylistController_.mediaSecondsLoaded_()||0},enumerable:!0},mediaAppends:{get:function(){return i.masterPlaylistController_.mediaAppends_()||0},enumerable:!0},mainAppendsToLoadedData:{get:function(){return i.masterPlaylistController_.mainAppendsToLoadedData_()||0},enumerable:!0},audioAppendsToLoadedData:{get:function(){return i.masterPlaylistController_.audioAppendsToLoadedData_()||0},enumerable:!0},appendsToLoadedData:{get:function(){return i.masterPlaylistController_.appendsToLoadedData_()||0},enumerable:!0},timeToLoadedData:{get:function(){return i.masterPlaylistController_.timeToLoadedData_()||0},enumerable:!0},buffered:{get:function(){return ia(i.tech_.buffered())},enumerable:!0},currentTime:{get:function(){return i.tech_.currentTime()},enumerable:!0},currentSource:{get:function(){return i.tech_.currentSource_},enumerable:!0},currentTech:{get:function(){return i.tech_.name_},enumerable:!0},duration:{get:function(){return i.tech_.duration()},enumerable:!0},master:{get:function(){return i.playlists.master},enumerable:!0},playerDimensions:{get:function(){return i.tech_.currentDimensions()},enumerable:!0},seekable:{get:function(){return ia(i.tech_.seekable())},enumerable:!0},timestamp:{get:function(){return Date.now()},enumerable:!0},videoPlaybackQuality:{get:function(){return i.tech_.getVideoPlaybackQuality()},enumerable:!0}}),this.tech_.one("canplay",this.masterPlaylistController_.setupFirstPlay.bind(this.masterPlaylistController_)),this.tech_.on("bandwidthupdate",(function(){i.options_.useBandwidthFromLocalStorage&&function(e){if(!A.default.localStorage)return!1;var t=Xo();t=t?Yr.mergeOptions(t,e):e;try{A.default.localStorage.setItem("videojs-vhs",JSON.stringify(t))}catch(e){return!1}}({bandwidth:i.bandwidth,throughput:Math.round(i.throughput)})})),this.masterPlaylistController_.on("selectedinitialmedia",(function(){var e;(e=i).representations=function(){var t=e.masterPlaylistController_.master(),i=ba(t)?e.masterPlaylistController_.getAudioTrackPlaylists_():t.playlists;return i?i.filter((function(e){return!pa(e)})).map((function(t,i){return new jo(e,t,t.id)})):[]}})),this.masterPlaylistController_.sourceUpdater_.on("createdsourcebuffers",(function(){i.setupEme_()})),this.on(this.masterPlaylistController_,"progress",(function(){this.tech_.trigger("progress")})),this.on(this.masterPlaylistController_,"firstplay",(function(){this.ignoreNextSeekingEvent_=!0})),this.setupQualityLevels_(),this.tech_.el()&&(this.mediaSourceUrl_=A.default.URL.createObjectURL(this.masterPlaylistController_.mediaSource),this.tech_.src(this.mediaSourceUrl_))}},i.setupEme_=function(){var e=this,t=this.masterPlaylistController_.mediaTypes_.AUDIO.activePlaylistLoader,i=Ko({player:this.player_,sourceKeySystems:this.source_.keySystems,media:this.playlists.media(),audioMedia:t&&t.media()});this.player_.tech_.on("keystatuschange",(function(t){"output-restricted"===t.status&&e.masterPlaylistController_.blacklistCurrentPlaylist({playlist:e.masterPlaylistController_.media(),message:"DRM keystatus changed to "+t.status+". Playlist will fail to play. Check for HDCP content.",blacklistDuration:1/0})})),11!==Yr.browser.IE_VERSION&&i?(this.logger_("waiting for EME key session creation"),qo({player:this.player_,sourceKeySystems:this.source_.keySystems,audioMedia:t&&t.media(),mainPlaylists:this.playlists.master.playlists}).then((function(){e.logger_("created EME key session"),e.masterPlaylistController_.sourceUpdater_.initializedEme()})).catch((function(t){e.logger_("error while creating EME key session",t),e.player_.error({message:"Failed to initialize media keys for EME",code:3})}))):this.masterPlaylistController_.sourceUpdater_.initializedEme()},i.setupQualityLevels_=function(){var e=this,t=Yr.players[this.tech_.options_.playerId];t&&t.qualityLevels&&!this.qualityLevels_&&(this.qualityLevels_=t.qualityLevels(),this.masterPlaylistController_.on("selectedinitialmedia",(function(){var t,i;t=e.qualityLevels_,(i=e).representations().forEach((function(e){t.addQualityLevel(e)})),Yo(t,i.playlists)})),this.playlists.on("mediachange",(function(){Yo(e.qualityLevels_,e.playlists)})))},t.version=function(){return{"@videojs/http-streaming":"2.10.2","mux.js":"5.13.0","mpd-parser":"0.19.0","m3u8-parser":"4.7.0","aes-decrypter":"3.1.2"}},i.version=function(){return this.constructor.version()},i.canChangeType=function(){return vo.canChangeType()},i.play=function(){this.masterPlaylistController_.play()},i.setCurrentTime=function(e){this.masterPlaylistController_.setCurrentTime(e)},i.duration=function(){return this.masterPlaylistController_.duration()},i.seekable=function(){return this.masterPlaylistController_.seekable()},i.dispose=function(){this.playbackWatcher_&&this.playbackWatcher_.dispose(),this.masterPlaylistController_&&this.masterPlaylistController_.dispose(),this.qualityLevels_&&this.qualityLevels_.dispose(),this.player_&&(delete this.player_.vhs,delete this.player_.dash,delete this.player_.hls),this.tech_&&this.tech_.vhs&&delete this.tech_.vhs,this.tech_&&delete this.tech_.hls,this.mediaSourceUrl_&&A.default.URL.revokeObjectURL&&(A.default.URL.revokeObjectURL(this.mediaSourceUrl_),this.mediaSourceUrl_=null),e.prototype.dispose.call(this)},i.convertToProgramTime=function(e,t){return Xa({playlist:this.masterPlaylistController_.media(),time:e,callback:t})},i.seekToProgramTime=function(e,t,i,n){return void 0===i&&(i=!0),void 0===n&&(n=2),Qa({programTime:e,playlist:this.masterPlaylistController_.media(),retryCount:n,pauseAfterSeek:i,seekTo:this.options_.seekTo,tech:this.options_.tech,callback:t})},t}(Yr.getComponent("Component")),$o={name:"videojs-http-streaming",VERSION:"2.10.2",canHandleSource:function(e,t){void 0===t&&(t={});var i=Yr.mergeOptions(Yr.options,t);return $o.canPlayType(e.type,i)},handleSource:function(e,t,i){void 0===i&&(i={});var n=Yr.mergeOptions(Yr.options,i);return t.vhs=new Qo(e,t,n),Yr.hasOwnProperty("hls")||Object.defineProperty(t,"hls",{get:function(){return Yr.log.warn("player.tech().hls is deprecated. Use player.tech().vhs instead."),t.vhs},configurable:!0}),t.vhs.xhr=Na(),t.vhs.src(e.src,e.type),t.vhs},canPlayType:function(e,t){void 0===t&&(t={});var i=Yr.mergeOptions(Yr.options,t).vhs.overrideNative,n=void 0===i?!Yr.browser.IS_ANY_SAFARI:i,r=_.simpleTypeFromSourceType(e);return r&&(!Wo.supportsTypeNatively(r)||n)?"maybe":""}};g.browserSupportsCodec("avc1.4d400d,mp4a.40.2")&&Yr.getTech("Html5").registerSourceHandler($o,0),Yr.VhsHandler=Qo,Object.defineProperty(Yr,"HlsHandler",{get:function(){return Yr.log.warn("videojs.HlsHandler is deprecated. Use videojs.VhsHandler instead."),Qo},configurable:!0}),Yr.VhsSourceHandler=$o,Object.defineProperty(Yr,"HlsSourceHandler",{get:function(){return Yr.log.warn("videojs.HlsSourceHandler is deprecated. Use videojs.VhsSourceHandler instead."),$o},configurable:!0}),Yr.Vhs=Wo,Object.defineProperty(Yr,"Hls",{get:function(){return Yr.log.warn("videojs.Hls is deprecated. Use videojs.Vhs instead."),Wo},configurable:!0}),Yr.use||(Yr.registerComponent("Hls",Wo),Yr.registerComponent("Vhs",Wo)),Yr.options.vhs=Yr.options.vhs||{},Yr.options.hls=Yr.options.hls||{},Yr.registerPlugin?Yr.registerPlugin("reloadSourceOnError",Go):Yr.plugin("reloadSourceOnError",Go),t.exports=Yr},{"@babel/runtime/helpers/assertThisInitialized":1,"@babel/runtime/helpers/construct":2,"@babel/runtime/helpers/extends":3,"@babel/runtime/helpers/inherits":4,"@babel/runtime/helpers/inheritsLoose":5,"@videojs/vhs-utils/cjs/byte-helpers":9,"@videojs/vhs-utils/cjs/codecs.js":11,"@videojs/vhs-utils/cjs/containers":12,"@videojs/vhs-utils/cjs/id3-helpers":15,"@videojs/vhs-utils/cjs/media-types.js":16,"@videojs/vhs-utils/cjs/resolve-url.js":20,"@videojs/xhr":23,"global/document":34,"global/window":35,keycode:38,"m3u8-parser":39,"mpd-parser":41,"mux.js/lib/tools/parse-sidx":42,"mux.js/lib/utils/clock":43,"safe-json-parse/tuple":45,"videojs-vtt.js":48}],48:[function(e,t,i){var n=e("global/window"),r=t.exports={WebVTT:e("./vtt.js"),VTTCue:e("./vttcue.js"),VTTRegion:e("./vttregion.js")};n.vttjs=r,n.WebVTT=r.WebVTT;var a=r.VTTCue,s=r.VTTRegion,o=n.VTTCue,u=n.VTTRegion;r.shim=function(){n.VTTCue=a,n.VTTRegion=s},r.restore=function(){n.VTTCue=o,n.VTTRegion=u},n.VTTCue||r.shim()},{"./vtt.js":49,"./vttcue.js":50,"./vttregion.js":51,"global/window":35}],49:[function(e,t,i){var n=e("global/document"),r=Object.create||function(){function e(){}return function(t){if(1!==arguments.length)throw new Error("Object.create shim only accepts one parameter.");return e.prototype=t,new e}}();function a(e,t){this.name="ParsingError",this.code=e.code,this.message=t||e.message}function s(e){function t(e,t,i,n){return 3600*(0|e)+60*(0|t)+(0|i)+(0|n)/1e3}var i=e.match(/^(\d+):(\d{1,2})(:\d{1,2})?\.(\d{3})/);return i?i[3]?t(i[1],i[2],i[3].replace(":",""),i[4]):i[1]>59?t(i[1],i[2],0,i[4]):t(0,i[1],i[2],i[4]):null}function o(){this.values=r(null)}function u(e,t,i,n){var r=n?e.split(n):[e];for(var a in r)if("string"==typeof r[a]){var s=r[a].split(i);if(2===s.length)t(s[0],s[1])}}function l(e,t,i){var n=e;function r(){var t=s(e);if(null===t)throw new a(a.Errors.BadTimeStamp,"Malformed timestamp: "+n);return e=e.replace(/^[^\sa-zA-Z-]+/,""),t}function l(){e=e.replace(/^\s+/,"")}if(l(),t.startTime=r(),l(),"--\x3e"!==e.substr(0,3))throw new a(a.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '--\x3e'): "+n);e=e.substr(3),l(),t.endTime=r(),l(),function(e,t){var n=new o;u(e,(function(e,t){switch(e){case"region":for(var r=i.length-1;r>=0;r--)if(i[r].id===t){n.set(e,i[r].region);break}break;case"vertical":n.alt(e,t,["rl","lr"]);break;case"line":var a=t.split(","),s=a[0];n.integer(e,s),n.percent(e,s)&&n.set("snapToLines",!1),n.alt(e,s,["auto"]),2===a.length&&n.alt("lineAlign",a[1],["start","center","end"]);break;case"position":a=t.split(","),n.percent(e,a[0]),2===a.length&&n.alt("positionAlign",a[1],["start","center","end"]);break;case"size":n.percent(e,t);break;case"align":n.alt(e,t,["start","center","end","left","right"])}}),/:/,/\s/),t.region=n.get("region",null),t.vertical=n.get("vertical","");try{t.line=n.get("line","auto")}catch(e){}t.lineAlign=n.get("lineAlign","start"),t.snapToLines=n.get("snapToLines",!0),t.size=n.get("size",100);try{t.align=n.get("align","center")}catch(e){t.align=n.get("align","middle")}try{t.position=n.get("position","auto")}catch(e){t.position=n.get("position",{start:0,left:0,center:50,middle:50,end:100,right:100},t.align)}t.positionAlign=n.get("positionAlign",{start:"start",left:"start",center:"center",middle:"center",end:"end",right:"end"},t.align)}(e,t)}a.prototype=r(Error.prototype),a.prototype.constructor=a,a.Errors={BadSignature:{code:0,message:"Malformed WebVTT signature."},BadTimeStamp:{code:1,message:"Malformed time stamp."}},o.prototype={set:function(e,t){this.get(e)||""===t||(this.values[e]=t)},get:function(e,t,i){return i?this.has(e)?this.values[e]:t[i]:this.has(e)?this.values[e]:t},has:function(e){return e in this.values},alt:function(e,t,i){for(var n=0;n=0&&t<=100)&&(this.set(e,t),!0)}};var d=n.createElement&&n.createElement("textarea"),h={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"},c={white:"rgba(255,255,255,1)",lime:"rgba(0,255,0,1)",cyan:"rgba(0,255,255,1)",red:"rgba(255,0,0,1)",yellow:"rgba(255,255,0,1)",magenta:"rgba(255,0,255,1)",blue:"rgba(0,0,255,1)",black:"rgba(0,0,0,1)"},f={v:"title",lang:"lang"},p={rt:"ruby"};function m(e,t){function i(){if(!t)return null;var e,i=t.match(/^([^<]*)(<[^>]*>?)?/);return e=i[1]?i[1]:i[2],t=t.substr(e.length),e}function n(e,t){return!p[t.localName]||p[t.localName]===e.localName}function r(t,i){var n=h[t];if(!n)return null;var r=e.document.createElement(n),a=f[t];return a&&i&&(r[a]=i.trim()),r}for(var a,o,u=e.document.createElement("div"),l=u,m=[];null!==(a=i());)if("<"!==a[0])l.appendChild(e.document.createTextNode((o=a,d.innerHTML=o,o=d.textContent,d.textContent="",o)));else{if("/"===a[1]){m.length&&m[m.length-1]===a.substr(2).replace(">","")&&(m.pop(),l=l.parentNode);continue}var g,_=s(a.substr(1,a.length-2));if(_){g=e.document.createProcessingInstruction("timestamp",_),l.appendChild(g);continue}var y=a.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!y)continue;if(!(g=r(y[1],y[3])))continue;if(!n(l,g))continue;if(y[2]){var v=y[2].split(".");v.forEach((function(e){var t=/^bg_/.test(e),i=t?e.slice(3):e;if(c.hasOwnProperty(i)){var n=t?"background-color":"color",r=c[i];g.style[n]=r}})),g.className=v.join(" ")}m.push(y[1]),l.appendChild(g),l=g}return u}var g=[[1470,1470],[1472,1472],[1475,1475],[1478,1478],[1488,1514],[1520,1524],[1544,1544],[1547,1547],[1549,1549],[1563,1563],[1566,1610],[1645,1647],[1649,1749],[1765,1766],[1774,1775],[1786,1805],[1807,1808],[1810,1839],[1869,1957],[1969,1969],[1984,2026],[2036,2037],[2042,2042],[2048,2069],[2074,2074],[2084,2084],[2088,2088],[2096,2110],[2112,2136],[2142,2142],[2208,2208],[2210,2220],[8207,8207],[64285,64285],[64287,64296],[64298,64310],[64312,64316],[64318,64318],[64320,64321],[64323,64324],[64326,64449],[64467,64829],[64848,64911],[64914,64967],[65008,65020],[65136,65140],[65142,65276],[67584,67589],[67592,67592],[67594,67637],[67639,67640],[67644,67644],[67647,67669],[67671,67679],[67840,67867],[67872,67897],[67903,67903],[67968,68023],[68030,68031],[68096,68096],[68112,68115],[68117,68119],[68121,68147],[68160,68167],[68176,68184],[68192,68223],[68352,68405],[68416,68437],[68440,68466],[68472,68479],[68608,68680],[126464,126467],[126469,126495],[126497,126498],[126500,126500],[126503,126503],[126505,126514],[126516,126519],[126521,126521],[126523,126523],[126530,126530],[126535,126535],[126537,126537],[126539,126539],[126541,126543],[126545,126546],[126548,126548],[126551,126551],[126553,126553],[126555,126555],[126557,126557],[126559,126559],[126561,126562],[126564,126564],[126567,126570],[126572,126578],[126580,126583],[126585,126588],[126590,126590],[126592,126601],[126603,126619],[126625,126627],[126629,126633],[126635,126651],[1114109,1114109]];function _(e){for(var t=0;t=i[0]&&e<=i[1])return!0}return!1}function y(e){var t=[],i="";if(!e||!e.childNodes)return"ltr";function n(e,t){for(var i=t.childNodes.length-1;i>=0;i--)e.push(t.childNodes[i])}function r(e){if(!e||!e.length)return null;var t=e.pop(),i=t.textContent||t.innerText;if(i){var a=i.match(/^.*(\n|\r)/);return a?(e.length=0,a[0]):i}return"ruby"===t.tagName?r(e):t.childNodes?(n(e,t),r(e)):void 0}for(n(t,e);i=r(t);)for(var a=0;a=0&&e.line<=100))return e.line;if(!e.track||!e.track.textTrackList||!e.track.textTrackList.mediaElement)return-1;for(var t=e.track,i=t.textTrackList,n=0,r=0;rh&&(d=d<0?-1:1,d*=Math.ceil(h/l)*l),s<0&&(d+=""===a.vertical?i.height:i.width,o=o.reverse()),r.move(c,d)}else{var f=r.lineHeight/i.height*100;switch(a.lineAlign){case"center":s-=f/2;break;case"end":s-=f}switch(a.vertical){case"":t.applyStyles({top:t.formatStyle(s,"%")});break;case"rl":t.applyStyles({left:t.formatStyle(s,"%")});break;case"lr":t.applyStyles({right:t.formatStyle(s,"%")})}o=["+y","-x","+x","-y"],r=new T(t)}var p=function(e,t){for(var r,a=new T(e),s=1,o=0;ou&&(r=new T(e),s=u),e=new T(a)}return r||a}(r,o);t.move(p.toCSSCompatValues(i))}function E(){}v.prototype.applyStyles=function(e,t){for(var i in t=t||this.div,e)e.hasOwnProperty(i)&&(t.style[i]=e[i])},v.prototype.formatStyle=function(e,t){return 0===e?0:e+t},b.prototype=r(v.prototype),b.prototype.constructor=b,T.prototype.move=function(e,t){switch(t=void 0!==t?t:this.lineHeight,e){case"+x":this.left+=t,this.right+=t;break;case"-x":this.left-=t,this.right-=t;break;case"+y":this.top+=t,this.bottom+=t;break;case"-y":this.top-=t,this.bottom-=t}},T.prototype.overlaps=function(e){return this.lefte.left&&this.tope.top},T.prototype.overlapsAny=function(e){for(var t=0;t=e.top&&this.bottom<=e.bottom&&this.left>=e.left&&this.right<=e.right},T.prototype.overlapsOppositeAxis=function(e,t){switch(t){case"+x":return this.lefte.right;case"+y":return this.tope.bottom}},T.prototype.intersectPercentage=function(e){return Math.max(0,Math.min(this.right,e.right)-Math.max(this.left,e.left))*Math.max(0,Math.min(this.bottom,e.bottom)-Math.max(this.top,e.top))/(this.height*this.width)},T.prototype.toCSSCompatValues=function(e){return{top:this.top-e.top,bottom:e.bottom-this.bottom,left:this.left-e.left,right:e.right-this.right,height:this.height,width:this.width}},T.getSimpleBoxPosition=function(e){var t=e.div?e.div.offsetHeight:e.tagName?e.offsetHeight:0,i=e.div?e.div.offsetWidth:e.tagName?e.offsetWidth:0,n=e.div?e.div.offsetTop:e.tagName?e.offsetTop:0;return{left:(e=e.div?e.div.getBoundingClientRect():e.tagName?e.getBoundingClientRect():e).left,right:e.right,top:e.top||n,height:e.height||t,bottom:e.bottom||n+(e.height||t),width:e.width||i}},E.StringDecoder=function(){return{decode:function(e){if(!e)return"";if("string"!=typeof e)throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(e))}}},E.convertCueToDOMTree=function(e,t){return e&&t?m(e,t):null};E.processCues=function(e,t,i){if(!e||!t||!i)return null;for(;i.firstChild;)i.removeChild(i.firstChild);var n=e.document.createElement("div");if(n.style.position="absolute",n.style.left="0",n.style.right="0",n.style.top="0",n.style.bottom="0",n.style.margin="1.5%",i.appendChild(n),function(e){for(var t=0;t100)throw new Error("Position must be between 0 and 100.");m=e,this.hasBeenReset=!0}},positionAlign:{enumerable:!0,get:function(){return g},set:function(e){var t=a(e);t&&(g=t,this.hasBeenReset=!0)}},size:{enumerable:!0,get:function(){return _},set:function(e){if(e<0||e>100)throw new Error("Size must be between 0 and 100.");_=e,this.hasBeenReset=!0}},align:{enumerable:!0,get:function(){return y},set:function(e){var t=a(e);if(!t)throw new SyntaxError("align: an invalid or illegal alignment string was specified.");y=t,this.hasBeenReset=!0}}}),this.displayState=void 0}s.prototype.getCueAsHTML=function(){return WebVTT.convertCueToDOMTree(window,this.text)},t.exports=s},{}],51:[function(e,t,i){var n={"":!0,up:!0};function r(e){return"number"==typeof e&&e>=0&&e<=100}t.exports=function(){var e=100,t=3,i=0,a=100,s=0,o=100,u="";Object.defineProperties(this,{width:{enumerable:!0,get:function(){return e},set:function(t){if(!r(t))throw new Error("Width must be between 0 and 100.");e=t}},lines:{enumerable:!0,get:function(){return t},set:function(e){if("number"!=typeof e)throw new TypeError("Lines must be set to a number.");t=e}},regionAnchorY:{enumerable:!0,get:function(){return a},set:function(e){if(!r(e))throw new Error("RegionAnchorX must be between 0 and 100.");a=e}},regionAnchorX:{enumerable:!0,get:function(){return i},set:function(e){if(!r(e))throw new Error("RegionAnchorY must be between 0 and 100.");i=e}},viewportAnchorY:{enumerable:!0,get:function(){return o},set:function(e){if(!r(e))throw new Error("ViewportAnchorY must be between 0 and 100.");o=e}},viewportAnchorX:{enumerable:!0,get:function(){return s},set:function(e){if(!r(e))throw new Error("ViewportAnchorX must be between 0 and 100.");s=e}},scroll:{enumerable:!0,get:function(){return u},set:function(e){var t=function(e){return"string"==typeof e&&(!!n[e.toLowerCase()]&&e.toLowerCase())}(e);!1===t||(u=t)}}})}},{}],52:[function(e,t,i){"use strict";t.exports={DEFAILT_WEBGL_PLAY_ID:"glplayer",PLAYER_IN_TYPE_MP4:"mp4",PLAYER_IN_TYPE_FLV:"flv",PLAYER_IN_TYPE_HTTPFLV:"httpflv",PLAYER_IN_TYPE_RAW_265:"raw265",PLAYER_IN_TYPE_TS:"ts",PLAYER_IN_TYPE_MPEGTS:"mpegts",PLAYER_IN_TYPE_M3U8:"hls",PLAYER_IN_TYPE_M3U8_VOD:"m3u8",PLAYER_IN_TYPE_M3U8_LIVE:"hls",APPEND_TYPE_STREAM:0,APPEND_TYPE_FRAME:1,APPEND_TYPE_SEQUENCE:2,DEFAULT_WIDTH:600,DEFAULT_HEIGHT:600,DEFAULT_FPS:30,DEFAULT_FRAME_DUR:40,DEFAULT_FIXED:!1,DEFAULT_SAMPLERATE:44100,DEFAULT_CHANNELS:2,DEFAULT_CONSU_SAMPLE_LEN:20,PLAYER_MODE_VOD:"vod",PLAYER_MODE_NOTIME_LIVE:"live",AUDIO_MODE_ONCE:"ONCE",AUDIO_MODE_SWAP:"SWAP",DEFAULT_STRING_LIVE:"LIVE",CODEC_H265:0,CODEC_H264:1,PLAYER_CORE_TYPE_DEFAULT:0,PLAYER_CORE_TYPE_CNATIVE:1,URI_PROTOCOL_WEBSOCKET:"ws",URI_PROTOCOL_WEBSOCKET_DESC:"websocket",URI_PROTOCOL_HTTP:"http",URI_PROTOCOL_HTTP_DESC:"http",FETCH_FIRST_MAX_TIMES:5,FETCH_HTTP_FLV_TIMEOUT_MS:7e3,V_CODEC_NAME_HEVC:265,V_CODEC_NAME_AVC:264,V_CODEC_NAME_UNKN:500,A_CODEC_NAME_AAC:112,A_CODEC_NAME_MP3:113,A_CODEC_NAME_UNKN:500,CACHE_NO_LOADCACHE:192,CACHE_WITH_PLAY_SIGN:193,CACHE_WITH_NOPLAY_SIGN:194}},{}],53:[function(e,t,i){"use strict";var n=window.AudioContext||window.webkitAudioContext,r=e("../consts"),a=e("./av-common");t.exports=function(e){var t={options:{sampleRate:e.sampleRate||r.DEFAULT_SAMPLERATE,appendType:e.appendType||r.APPEND_TYPE_STREAM,playMode:e.playMode||r.AUDIO_MODE_SWAP},sourceChannel:-1,audioCtx:new n({latencyHint:"interactive",sampleRate:e.sampleRate}),gainNode:null,sourceList:[],startStatus:!1,sampleQueue:[],nextBuffer:null,playTimestamp:0,playStartTime:0,durationMs:-1,isLIVE:!1,voice:1,onLoadCache:null,resetStartParam:function(){t.playTimestamp=0,t.playStartTime=0},setOnLoadCache:function(e){t.onLoadCache=e},setDurationMs:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1;t.durationMs=e},setVoice:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;t.voice=e,t.gainNode.gain.value=e},getAlignVPTS:function(){return t.playTimestamp+(a.GetMsTime()-t.playStartTime)/1e3},swapSource:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;if(0==t.startStatus)return null;if(e<0||e>=t.sourceList.length)return null;if(i<0||i>=t.sourceList.length)return null;try{t.sourceChannel===e&&null!==t.sourceList[e]&&(t.sourceList[e].disconnect(t.gainNode),t.sourceList[e]=null)}catch(t){console.error("[DEFINE ERROR] audioModule disconnect source Index:"+e+" error happened!",t)}t.sourceChannel=i;var n=t.decodeSample(i,e);-2==n&&t.isLIVE&&(t.getAlignVPTS()>=t.durationMs/1e3-.04?t.pause():null!==t.onLoadCache&&t.onLoadCache())},addSample:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return!(null==e||!e||null==e)&&(0==t.sampleQueue.length&&(t.seekPos=e.pts),t.sampleQueue.push(e),!0)},runNextBuffer:function(){window.setInterval((function(){if(!(null!=t.nextBuffer||t.sampleQueue.length0&&void 0!==arguments[0]?arguments[0]:-1,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;if(e<0||e>=t.sourceList.length)return-1;if(null!=t.sourceList[e]&&null!=t.sourceList[e]&&t.sourceList[e]||(t.sourceList[e]=t.audioCtx.createBufferSource(),t.sourceList[e].onended=function(){t.swapSource(e,i)}),0==t.sampleQueue.length)return t.isLIVE?(t.sourceList[e].connect(t.gainNode),t.sourceList[e].start(),t.sourceList[e].onended=function(){t.swapSource(e,i)},t.sourceList[e].stop(),0):-2;if(t.sourceList[e].buffer)return t.sourceList[e],t.sourceList[i],t.gainNode,t.swapSource(e,i),0;if(null==t.nextBuffer||t.nextBuffer.data.length<1)return t.sourceList[e].connect(t.gainNode),t.sourceList[e].start(),t.sourceList[e].startState=!0,t.sourceList[e].stop(),1;var n=t.nextBuffer.data.buffer;t.playTimestamp=t.nextBuffer.pts,t.playStartTime=a.GetMsTime();try{t.audioCtx.decodeAudioData(n,(function(i){null!==t.sourceList[e]&&(t.sourceList[e].buffer=i,t.sourceList[e].connect(t.gainNode),t.sourceList[e].start(),t.sourceList[e].startState=!0)}),(function(e){}))}catch(e){return t.nextBuffer=null,-3}return t.nextBuffer=null,0},decodeWholeSamples:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1;if(t.sourceChannel=e,e<0||e>=t.sourceList.length)return-1;if(null!=t.sourceList[e]&&null!=t.sourceList[e]&&t.sourceList[e]||(t.sourceList[e]=t.audioCtx.createBufferSource(),t.sourceList[e].onended=function(){}),0==t.sampleQueue.length)return-2;for(var i=null,n=null,a=0;a=2){var s=i.length/2;a=new Float32Array(s);for(var o=0,u=0;u0&&s()-this._start_time>=this._now_seg_dur&&(s(),this._start_time,this._now_seg_dur,this._start_time=-1,this._now_seg_dur=-1),s(),this._start_time<0)if(new Date,null!==this._pcm_array_buf&&this._pcm_array_buf.length>this._push_start_idx){this._swapStartPlay=!1;var e=this._push_start_idx+this._once_pop_len;e>this._pcm_array_buf.length&&(e=this._pcm_array_buf.length);var t=this._pcm_array_buf.slice(this._push_start_idx,e);this._push_start_idx+=t.length,this._now_seg_dur=1*t.length/this._sample_rate*1e3,t.length,this._sample_rate,this._now_seg_dur;var i=this._ctx.createBuffer(1,t.length,this._sample_rate);t.length,new Date,i.copyToChannel(t,0),this._active_node=this._ctx.createBufferSource(),this._active_node.buffer=i,this._active_node.connect(this._gain),this._start_time=s(),this._active_node.start(0)}else setTimeout(this.readingLoopWithF32,1)}}])&&n(t.prototype,i),o&&n(t,o),e}();i.AudioPcmPlayer=o},{"../consts":52}],55:[function(e,t,i){"use strict";var n=e("../consts"),r=[{format:"mp4",value:"mp4",core:n.PLAYER_CORE_TYPE_CNATIVE},{format:"mov",value:"mp4",core:n.PLAYER_CORE_TYPE_CNATIVE},{format:"flv",value:"flv",core:n.PLAYER_CORE_TYPE_CNATIVE},{format:"m3u8",value:"hls",core:n.PLAYER_CORE_TYPE_DEFAULT},{format:"m3u",value:"hls",core:n.PLAYER_CORE_TYPE_DEFAULT},{format:"ts",value:"ts",core:n.PLAYER_CORE_TYPE_DEFAULT},{format:"mpegts",value:"ts",core:n.PLAYER_CORE_TYPE_DEFAULT},{format:"hevc",value:"raw265",core:n.PLAYER_CORE_TYPE_DEFAULT},{format:"h265",value:"raw265",core:n.PLAYER_CORE_TYPE_DEFAULT}],a=[{format:n.URI_PROTOCOL_HTTP,value:n.URI_PROTOCOL_HTTP_DESC},{format:n.URI_PROTOCOL_WEBSOCKET,value:n.URI_PROTOCOL_WEBSOCKET_DESC}];t.exports={frameDataAlignCrop:function(e,t,i,n,r,a,s,o){if(0==e-n)return[a,s,o];for(var u=n*r,l=u/4,d=new Uint8Array(u),h=new Uint8Array(l),c=new Uint8Array(l),f=n,p=n/2,m=0;m=0)return i.value}return r[0].value},GetFormatPlayCore:function(e){for(var t=0;t=0)return i.value}return a[0].value},GetMsTime:function(){return(new Date).getTime()}}},{"../consts":52}],56:[function(e,t,i){"use strict";function n(e,t){for(var i=0;i0&&(t.getPackageTimeMS=a.GetMsTime()),t.pushPkg++,void 0!==t.AVGetInterval&&null!==t.AVGetInterval||(t.AVGetInterval=window.setInterval((function(){Module.cwrap("getBufferLengthApi","number",["number"])(t.AVSniffPtr)>t.config.probeSize?(Module.cwrap("getSniffHttpFlvPkg","number",["number"])(t.AVSniffPtr),t.pushPkg-=1):t.getPackageTimeMS>0&&a.GetMsTime()-t.getPackageTimeMS>=o.FETCH_HTTP_FLV_TIMEOUT_MS&&(t.getPackageTimeMS=a.GetMsTime(),t.workerFetch.postMessage({cmd:"retry",data:null,msg:"retry"}))}),5));break;case"close":t.AVGetInterval&&clearInterval(t.AVGetInterval),t.AVGetInterval=null;case"fetch-fin":break;case"fetch-error":t.onNetworkError&&t.onNetworkError(i.data)}}},{key:"_checkDisplaySize",value:function(e,t,i){var n=t-e,r=this.config.width+Math.ceil(n/2),a=t/this.config.width>i/this.config.height,s=(r/t).toFixed(2),o=(this.config.height/i).toFixed(2),u=a?s:o,l=this.config.fixed,d=l?r:parseInt(t*u),h=l?this.config.height:parseInt(i*u);if(this.CanvasObj.offsetWidth!=d||this.CanvasObj.offsetHeight!=h){var c=parseInt((this.canvasBox.offsetHeight-h)/2),f=parseInt((this.canvasBox.offsetWidth-d)/2);c=c<0?0:c,f=f<0?0:f,this.CanvasObj.style.marginTop=c+"px",this.CanvasObj.style.marginLeft=f+"px",this.CanvasObj.style.width=d+"px",this.CanvasObj.style.height=h+"px"}return this.isCheckDisplay=!0,[d,h]}},{key:"_ptsFixed2",value:function(e){return Math.ceil(100*e)/100}},{key:"_callbackProbe",value:function(e,t,i,n,r,a,u,l,d){for(var h=Module.HEAPU8.subarray(d,d+10),c=0;c100&&(f=o.DEFAULT_FPS,this.mediaInfo.noFPS=!0),this.vCodecID=l,this.config.fps=f,this.mediaInfo.fps=f,this.mediaInfo.size.width=t,this.mediaInfo.size.height=i,this.frameTime=Math.floor(1e3/(this.mediaInfo.fps+2)),this.CanvasObj.width==t&&this.CanvasObj.height==i||(this.CanvasObj.width=t,this.CanvasObj.height=i,this.isCheckDisplay)||this._checkDisplaySize(t,t,i),r>=0&&!1===this.mediaInfo.noFPS?(void 0!==this.audioWAudio&&null!==this.audioWAudio&&(this.audioWAudio.stop(),this.audioWAudio=null),this.config.sampleRate=a,this.mediaInfo.sampleRate=a,this.audioWAudio=s({sampleRate:this.mediaInfo.sampleRate,appendType:o.APPEND_TYPE_FRAME}),this.audioWAudio.isLIVE=!0):this.mediaInfo.audioNone=!0,this.onProbeFinish&&this.onProbeFinish()}},{key:"_callbackYUV",value:function(e,t,i,n,r,a,s,o,u){var l=Module.HEAPU8.subarray(e,e+n*o),d=new Uint8Array(l),h=Module.HEAPU8.subarray(t,t+r*o/2),c=new Uint8Array(h),f=Module.HEAPU8.subarray(i,i+a*o/2),p={bufY:d,bufU:c,bufV:new Uint8Array(f),line_y:n,h:o,pts:u};this.YuvBuf.push(p),this.checkCacheState(),Module._free(l),l=null,Module._free(h),h=null,Module._free(f),f=null,!1===this.readyShowDone&&(this.playYUV(),this.readyShowDone=!0,this.onReadyShowDone&&this.onReadyShowDone(),this.audioWAudio||this.play())}},{key:"_callbackNALU",value:function(e,t,i,n,r,a,s){if(!1===this.readyKeyFrame){if(i<=0)return;this.readyKeyFrame=!0}var o=Module.HEAPU8.subarray(e,e+t),u=new Uint8Array(o);this.NaluBuf.push({bufData:u,len:t,isKey:i,w:n,h:r,pts:1e3*a,dts:1e3*s}),Module._free(o),o=null}},{key:"_callbackPCM",value:function(e){}},{key:"_callbackAAC",value:function(e,t,i,n,r){var a=this._ptsFixed2(r);if(this.audioWAudio){var s=new Uint8Array(7+i),o=Module.HEAPU8.subarray(e,e+7);s.set(o,0);var u=Module.HEAPU8.subarray(t,t+i);s.set(u,7);var l={pts:a,data:s};this.audioWAudio.addSample(l),this.checkCacheState()}}},{key:"_decode",value:function(){var e=this;setTimeout((function(){if(null!==e.workerFetch){var t=e.NaluBuf.shift();if(null!=t){var i=Module._malloc(t.bufData.length);Module.HEAP8.set(t.bufData,i),Module.cwrap("decodeHttpFlvVideoFrame","number",["number","number","number","number","number"])(e.AVSniffPtr,i,t.bufData.length,t.pts,t.dts,0),Module._free(i),i=null}e._decode()}}),1)}},{key:"checkCacheState",value:function(){var e=this.YuvBuf.length>=25&&(!0===this.mediaInfo.audioNone||this.audioWAudio&&this.audioWAudio.sampleQueue.length>=50);return!1===this.cache_status&&e&&(this.playInterval&&this.audioWAudio&&this.audioWAudio.play(),this.onLoadCacheFinshed&&this.onLoadCacheFinshed(),this.cache_status=!0),e}},{key:"setVoice",value:function(e){this.audioVoice=e,this.audioWAudio&&this.audioWAudio.setVoice(e)}},{key:"_removeBindFuncPtr",value:function(){null!==this._ptr_probeCallback&&Module.removeFunction(this._ptr_probeCallback),null!==this._ptr_frameCallback&&Module.removeFunction(this._ptr_frameCallback),null!==this._ptr_naluCallback&&Module.removeFunction(this._ptr_naluCallback),null!==this._ptr_sampleCallback&&Module.removeFunction(this._ptr_sampleCallback),null!==this._ptr_aacCallback&&Module.removeFunction(this._ptr_aacCallback),this._ptr_probeCallback=null,this._ptr_frameCallback=null,this._ptr_naluCallback=null,this._ptr_sampleCallback=null,this._ptr_aacCallback=null}},{key:"release",value:function(){return this.pause(),this.NaluBuf.length=0,this.YuvBuf.length=0,void 0!==this.workerFetch&&null!==this.workerFetch&&this.workerFetch.postMessage({cmd:"stop",data:"stop",msg:"stop"}),this.workerFetch=null,this.AVGetInterval&&clearInterval(this.AVGetInterval),this.AVGetInterval=null,this._removeBindFuncPtr(),Module.cwrap("releaseHttpFLV","number",["number"])(this.AVSniffPtr),this.playInterval&&clearInterval(this.playInterval),this.playInterval=null,this.audioWAudio&&this.audioWAudio.stop(),this.audioWAudio=null,this.CanvasObj&&this.CanvasObj.remove(),this.CanvasObj=null,0}},{key:"isPlayingState",value:function(){return null!==this.playInterval&&void 0!==this.playInterval}},{key:"pause",value:function(){this.audioWAudio&&this.audioWAudio.pause(),this.playInterval&&clearInterval(this.playInterval),this.playInterval=null}},{key:"playYUV",value:function(){if(this.YuvBuf.length>0){var e=this.YuvBuf.shift();return r.renderFrame(this.AVGLObj,e.bufY,e.bufU,e.bufV,e.line_y,e.h),!0}return!1}},{key:"play",value:function(){var e=this,t=this;if(!1===this.checkCacheState())return this.onLoadCache&&this.onLoadCache(),setTimeout((function(){e.play()}),100),!1;if(void 0===this.playInterval||null===this.playInterval){var i=0,n=0,s=0;!1===this.mediaInfo.audioNone&&this.audioWAudio&&!1===this.mediaInfo.noFPS?(this.playInterval=setInterval((function(){if(n=a.GetMsTime(),t.cache_status){if(n-i>=t.frameTime-s){var e=t.YuvBuf.shift();if(null!=e&&null!==e){var o=0;null!==t.audioWAudio&&void 0!==t.audioWAudio&&(o=1e3*(e.pts-t.audioWAudio.getAlignVPTS())),s=t.audioWAudio?o<0&&-1*o<=t.frameTime||o>=0?a.GetMsTime()-n+1:t.frameTime:a.GetMsTime()-n+1,r.renderFrame(t.AVGLObj,e.bufY,e.bufU,e.bufV,e.line_y,e.h)}(t.YuvBuf.length<=0||t.audioWAudio&&t.audioWAudio.sampleQueue.length<=0)&&(t.cache_status=!1,t.onLoadCache&&t.onLoadCache(),t.audioWAudio&&t.audioWAudio.pause()),i=n}}else s=t.frameTime}),1),this.audioWAudio&&this.audioWAudio.play()):this.playInterval=setInterval((function(){var e=t.YuvBuf.shift();null!=e&&null!==e&&r.renderFrame(t.AVGLObj,e.bufY,e.bufU,e.bufV,e.line_y,e.h),t.YuvBuf.length<=0&&(t.cache_status=!1)}),t.frameTime)}}},{key:"start",value:function(e){var t,i,n,a=this;this.workerFetch=new Worker((t=function(){var e=null,t=new AbortController,i=t.signal,n=(self,function(e){var t=!1;t||(t=!0,fetch(e,{signal:i}).then((function(e){return function e(t){return t.read().then((function(i){if(!i.done){var n=i.value;return self.postMessage({cmd:"fetch-chunk",data:n,msg:"fetch-chunk"}),e(t)}self.postMessage({cmd:"fetch-fin",data:null,msg:"fetch-fin"})}))}(e.body.getReader())})).catch((function(e){if(!e.toString().includes("user aborted")){var t=" httplive request error:"+e+" start to retry";console.error(t),self.postMessage({cmd:"fetch-error",data:t,msg:"fetch-error"})}})))});self.onmessage=function(r){var a=r.data;switch(void 0===a.cmd||null===a.cmd?"":a.cmd){case"start":e=a.data,n(e),self.postMessage({cmd:"default",data:"WORKER STARTED",msg:"default"});break;case"stop":t.abort(),self.close(),self.postMessage({cmd:"close",data:"close",msg:"close"});break;case"retry":t.abort(),t=null,i=null,t=new AbortController,i=t.signal,setTimeout((function(){n(e)}),3e3)}}}.toString(),i=t.match(/^\s*function\s*\(\s*\)\s*\{(([\s\S](?!\}$))*[\s\S])/),n=[i[1]],window.URL.createObjectURL(new Blob(n,{type:"text/javascript"})))),this.workerFetch.onmessage=function(e){a._workerFetch_onmessage(e,a)},this.workerFetch,this.AVSniffPtr=Module.cwrap("AVSniffHttpFlvInit","number",["string","string"])("base64:QXV0aG9yOmNoYW5neWFubG9uZ3xudW1iZXJ3b2xmLEdpdGh1YjpodHRwczovL2dpdGh1Yi5jb20vbnVtYmVyd29sZixFbWFpbDpwb3JzY2hlZ3QyM0Bmb3htYWlsLmNvbSxRUTo1MzEzNjU4NzIsSG9tZVBhZ2U6aHR0cDovL3h2aWRlby52aWRlbyxEaXNjb3JkOm51bWJlcndvbGYjODY5NCx3ZWNoYXI6bnVtYmVyd29sZjExLEJlaWppbmcsV29ya0luOkJhaWR1","0.0.0"),this.AVSniffPtr,this._ptr_probeCallback=Module.addFunction(this._callbackProbe.bind(this)),this._ptr_yuvCallback=Module.addFunction(this._callbackYUV.bind(this)),this._ptr_naluCallback=Module.addFunction(this._callbackNALU.bind(this)),this._ptr_sampleCallback=Module.addFunction(this._callbackPCM.bind(this)),this._ptr_aacCallback=Module.addFunction(this._callbackAAC.bind(this)),Module.cwrap("initializeSniffHttpFlvModule","number",["number","number","number","number","number","number"])(this.AVSniffPtr,this._ptr_probeCallback,this._ptr_yuvCallback,this._ptr_naluCallback,this._ptr_sampleCallback,this._ptr_aacCallback),this.AVGLObj=r.setupCanvas(this.CanvasObj,{preserveDrawingBuffer:!1}),this.workerFetch.postMessage({cmd:"start",data:e,msg:"start"}),this._decode()}}])&&n(t.prototype,i),u&&n(t,u),e}();i.CHttpLiveCore=u},{"../consts":52,"../demuxer/buffer":64,"../demuxer/bufferFrame":65,"../render-engine/webgl-420p":77,"../version":80,"./audio-core":53,"./audio-native-core":54,"./av-common":55,"./cache":59,"./cacheYuv":60}],57:[function(e,t,i){"use strict";function n(e,t){for(var i=0;i0&&void 0!==arguments[0]&&arguments[0];this.showScreen=e,this.canvas&&(e?this.canvas.setAttribute("hidden",!0):this.canvas.removeAttribute("hidden"))}},{key:"getCachePTS",value:function(){return 1!==this.config.ignoreAudio&&this.audioWAudio?Math.max(this.vCachePTS,this.aCachePTS):this.vCachePTS}},{key:"getMaxPTS",value:function(){return Math.max(this.vCachePTS,this.aCachePTS)}},{key:"isPlayingState",value:function(){return this.isPlaying}},{key:"pushDone",value:function(){this.pushEOF=!0}},{key:"_clearDecInterval",value:function(){this.decVFrameInterval&&window.clearInterval(this.decVFrameInterval),this.decVFrameInterval=null}},{key:"_checkPlayFinished",value:function(){return!(this.config.playMode!==d.PLAYER_MODE_VOD||!(!0===this.bufRecvStat&&(this.playPTS>=this.bufLastVDTS||this.audioWAudio&&this.playPTS>=this.bufLastADTS)||this.duration-this.playPTS0&&(this.isPlaying=!0);var t=0,i=0,n=0;this.config.playMode===d.PLAYER_MODE_NOTIME_LIVE?this.playFrameInterval=window.setInterval((function(){if(e._videoQueue.length>0){var t=e._videoQueue.shift();t.pts,o.renderFrame(e.yuv,t.data_y,t.data_u,t.data_v,t.line1,t.height)}}),1e3*this.frameDur):this.playFrameInterval=window.setInterval((function(){if(i=u.GetMsTime(),e._videoQueue.length>0&&i-t>=e.frameTime-n){var r=e._videoQueue.shift(),a=0;if(e.isNewSeek||null===e.audioWAudio||void 0===e.audioWAudio||(a=1e3*(r.pts-e.audioWAudio.getAlignVPTS()),e.playPTS=Math.max(e.audioWAudio.getAlignVPTS(),e.playPTS)),t=i,u.GetMsTime(),e.playPTS=Math.max(r.pts,e.playPTS),e.isNewSeek&&e.seekTarget-e.frameDur>r.pts)return void(n=e.frameTime);if(e.isNewSeek&&(e.audioWAudio&&e.audioWAudio.setVoice(e.audioVoice),e.audioWAudio&&e.audioWAudio.play(),n=0,e.isNewSeek=!1,e.seekTarget=0),e.showScreen?e.onRender&&e.onRender(r.line1,r.height,r.data_y,r.data_u,r.data_v):(r.pts,o.renderFrame(e.yuv,r.data_y,r.data_u,r.data_v,r.line1,r.height)),e.onPlayingTime&&e.onPlayingTime(r.pts),!e.isNewSeek&&e.audioWAudio&&(a<0&&-1*a<=e.frameTime||a>=0)){if(e.config.playMode===d.PLAYER_MODE_VOD)if(r.pts>=e.duration)e.onLoadCacheFinshed&&e.onLoadCacheFinshed(),e.onPlayingFinish&&e.onPlayingFinish(),e._clearDecInterval(),e.pause();else if(e._checkPlayFinished())return;n=u.GetMsTime()-i}else!e.isNewSeek&&e.audioWAudio&&(a<0&&e.frameTime,n=e.frameTime)}e._checkPlayFinished()}),1)}this.isNewSeek||this.audioWAudio&&this.audioWAudio.play()}},{key:"pause",value:function(){this.isPlaying=!1,this._pause()}},{key:"_pause",value:function(){this.playFrameInterval&&window.clearInterval(this.playFrameInterval),this.playFrameInterval=null,this.audioWAudio&&this.audioWAudio.pause()}},{key:"seek",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.openFrameCall=!1,this.pause(),this._clearDecInterval(),null!==this.avFeedVideoInterval&&(window.clearInterval(this.avFeedVideoInterval),this.avFeedVideoInterval=null),null!==this.avFeedAudioInterval&&(window.clearInterval(this.avFeedAudioInterval),this.avFeedAudioInterval=null),this.yuvMaxTime=0,this.playVPipe.length=0,this._videoQueue.length=0,this.audioWAudio&&this.audioWAudio.stop(),e&&e(),this.isNewSeek=!0,this.avSeekVState=!0,this.seekTarget=i.seekTime,null!==this.audioWAudio&&void 0!==this.audioWAudio&&(this.audioWAudio.setVoice(0),this.audioWAudio.resetStartParam(),this.audioWAudio.stop()),this._avFeedData(i.seekTime),setTimeout((function(){t.yuvMaxTime=0,t._videoQueue.length=0,t.openFrameCall=!0,t.frameCallTag+=1,t._decVFrameIntervalFunc()}),1e3)}},{key:"setVoice",value:function(e){this.audioVoice=e,this.audioWAudio&&this.audioWAudio.setVoice(e)}},{key:"cacheIsFull",value:function(){return this._videoQueue.length>=50}},{key:"_checkDisplaySize",value:function(e,t,i){var n=t-e,r=this.config.width+Math.ceil(n/2),a=t/this.config.width>i/this.config.height,s=(r/t).toFixed(2),o=(this.config.height/i).toFixed(2),u=a?s:o,l=this.config.fixed,d=l?r:parseInt(t*u),h=l?this.config.height:parseInt(i*u);if(this.canvas.offsetWidth!=d||this.canvas.offsetHeight!=h){var c=parseInt((this.canvasBox.offsetHeight-h)/2),f=parseInt((this.canvasBox.offsetWidth-d)/2);c=c<0?0:c,f=f<0?0:f,this.canvas.style.marginTop=c+"px",this.canvas.style.marginLeft=f+"px",this.canvas.style.width=d+"px",this.canvas.style.height=h+"px"}return this.isCheckDisplay=!0,[d,h]}},{key:"_createYUVCanvas",value:function(){this.canvasBox=document.querySelector("#"+this.config.playerId),this.canvasBox.style.overflow="hidden",this.canvas=document.createElement("canvas"),this.canvas.style.width=this.canvasBox.clientWidth+"px",this.canvas.style.height=this.canvasBox.clientHeight+"px",this.canvas.style.top="0px",this.canvas.style.left="0px",this.canvasBox.appendChild(this.canvas),this.yuv=o.setupCanvas(this.canvas,{preserveDrawingBuffer:!1})}},{key:"_avRecvPackets",value:function(){var e=this;this.bufObject.cleanPipeline(),null!==this.avRecvInterval&&(window.clearInterval(this.avRecvInterval),this.avRecvInterval=null),!0===this.config.checkProbe?this.avRecvInterval=window.setInterval((function(){Module.cwrap("getSniffStreamPkg","number",["number"])(e.corePtr),e._avCheckRecvFinish()}),5):this.avRecvInterval=window.setInterval((function(){Module.cwrap("getSniffStreamPkgNoCheckProbe","number",["number"])(e.corePtr),e._avCheckRecvFinish()}),5),this._avFeedData(0,!1)}},{key:"_avCheckRecvFinish",value:function(){this.config.playMode===d.PLAYER_MODE_VOD&&this.duration-this.getMaxPTS()=50&&(t.onSeekFinish&&t.onSeekFinish(),t.onPlayingTime&&t.onPlayingTime(e),t.play(),window.clearInterval(i),i=null)}),10);return!0}},{key:"_afterAvFeedSeekToStartWithUnFinBuffer",value:function(e){var t=this,i=window.setInterval((function(){t._videoQueue.length,t._videoQueue.length>=50&&(t.onSeekFinish&&t.onSeekFinish(),t.onPlayingTime&&t.onPlayingTime(e),!1===t.reFull?t.play():t.reFull=!1,window.clearInterval(i),i=null)}),10);return!0}},{key:"_avFeedData",value:function(e){var t=this;if(this.playVPipe.length=0,this.audioWAudio&&this.audioWAudio.cleanQueue(),e<=0&&!1===this.bufOK){var i=0;if(this.avFeedVideoInterval=window.setInterval((function(){var n=t.bufObject.videoBuffer.length;if(n-1>i||t.duration-t.getMaxPTS()0){for(var s=0;s0&&t.playVPipe[t.playVPipe.length-1].pts>=t.bufLastVDTS&&(window.clearInterval(t.avFeedVideoInterval),t.avFeedVideoInterval=null,t.playVPipe[t.playVPipe.length-1].pts,t.bufLastVDTS,t.bufObject.videoBuffer,t.playVPipe)}else t.config.playMode===d.PLAYER_MODE_VOD&&t.playVPipe.length>0&&t.playVPipe[t.playVPipe.length-1].pts>=t.duration&&(window.clearInterval(t.avFeedVideoInterval),t.avFeedVideoInterval=null,t.playVPipe[t.playVPipe.length-1].pts,t.duration,t.bufObject.videoBuffer,t.playVPipe);t.avSeekVState&&(t.getMaxPTS(),t.duration,t.config.playMode===d.PLAYER_MODE_VOD&&(t._afterAvFeedSeekToStartWithFinishedBuffer(e),t.avSeekVState=!1))}),5),void 0!==this.audioWAudio&&null!==this.audioWAudio&&this.config.ignoreAudio<1){var n=0;this.avFeedAudioInterval=window.setInterval((function(){var e=t.bufObject.audioBuffer.length;if(e-1>n||t.duration-t.getMaxPTS()0&&t.audioWAudio.sampleQueue[t.audioWAudio.sampleQueue.length-1].pts>=t.bufLastADTS&&(window.clearInterval(t.avFeedAudioInterval),t.avFeedAudioInterval=null,t.audioWAudio.sampleQueue[t.audioWAudio.sampleQueue.length-1].pts,t.bufObject.audioBuffer)}else t.config.playMode===d.PLAYER_MODE_VOD&&t.audioWAudio.sampleQueue.length>0&&t.audioWAudio.sampleQueue[t.audioWAudio.sampleQueue.length-1].pts>=t.duration&&(window.clearInterval(t.avFeedAudioInterval),t.avFeedAudioInterval=null,t.audioWAudio.sampleQueue[t.audioWAudio.sampleQueue.length-1].pts,t.bufObject.audioBuffer)}),5)}}else{var r=this.bufObject.seekIDR(e),s=parseInt(r,10);this.playPTS=0;var o=s;if(this.avFeedVideoInterval=window.setInterval((function(){var i=t.bufObject.videoBuffer.length;if(i-1>o||t.duration-t.getMaxPTS()0){for(var r=0;r0&&t.playVPipe[t.playVPipe.length-1].pts>=t.bufLastVDTS&&(window.clearInterval(t.avFeedVideoInterval),t.avFeedVideoInterval=null)}else t.config.playMode===d.PLAYER_MODE_VOD&&t.playVPipe.length>0&&t.playVPipe[t.playVPipe.length-1].pts>=t.duration&&(window.clearInterval(t.avFeedVideoInterval),t.avFeedVideoInterval=null);t.avSeekVState&&(t.getMaxPTS(),t.duration,t.config.playMode===d.PLAYER_MODE_VOD&&(t._afterAvFeedSeekToStartWithUnFinBuffer(e),t.avSeekVState=!1))}),5),this.audioWAudio&&this.config.ignoreAudio<1){var u=parseInt(e,10);this.avFeedAudioInterval=window.setInterval((function(){var e=t.bufObject.audioBuffer.length;if(e-1>u||t.duration-t.getMaxPTS()0&&t.audioWAudio.sampleQueue[t.audioWAudio.sampleQueue.length-1].pts>=t.bufLastADTS&&(window.clearInterval(t.avFeedAudioInterval),t.avFeedAudioInterval=null)}else t.config.playMode===d.PLAYER_MODE_VOD&&t.audioWAudio.sampleQueue.length>0&&t.audioWAudio.sampleQueue[t.audioWAudio.sampleQueue.length-1].pts>=t.duration&&(window.clearInterval(t.avFeedAudioInterval),t.avFeedAudioInterval=null)}),5)}}}},{key:"_probeFinCallback",value:function(e,t,i,n,r,a,s,o,u){var h=this;this._createYUVCanvas(),d.V_CODEC_NAME_HEVC,this.config.fps=1*n,this.frameTime=1e3/this.config.fps,this.width=t,this.height=i,this.frameDur=1/this.config.fps,this.duration=e-this.frameDur,this.vCodecID=o,this.config.sampleRate=a,this.channels=s,this.audioIdx=r,this.duration<0&&(this.config.playMode=d.PLAYER_MODE_NOTIME_LIVE,this.frameTime,this.frameDur);for(var c=Module.HEAPU8.subarray(u,u+10),f=0;f=0&&this.config.ignoreAudio<1?(void 0!==this.audioWAudio&&null!==this.audioWAudio&&(this.audioWAudio.stop(),this.audioWAudio=null),this.audioWAudio=l({sampleRate:a,appendType:d.APPEND_TYPE_FRAME}),this.audioWAudio.setDurationMs(1e3*e),this.onLoadCache&&this.audioWAudio.setOnLoadCache((function(){if(h.retryAuSampleNo,h.retryAuSampleNo<=5){h.pause(),h.onLoadCache&&h.onLoadCache();var e=window.setInterval((function(){return h.retryAuSampleNo,h.audioWAudio.sampleQueue.length,h.audioWAudio.sampleQueue.length>2?(h.onLoadCacheFinshed&&h.onLoadCacheFinshed(),h.play(),h.retryAuSampleNo=0,window.clearInterval(e),void(e=null)):(h.retryAuSampleNo+=1,h.retryAuSampleNo>5?(h.play(),h.onLoadCacheFinshed&&h.onLoadCacheFinshed(),window.clearInterval(e),void(e=null)):void 0)}),1e3)}}))):this.audioNone=!0,this._avRecvPackets(),this._decVFrameIntervalFunc()),this.onProbeFinish&&this.onProbeFinish()}},{key:"_ptsFixed2",value:function(e){return Math.ceil(100*e)/100}},{key:"_naluCallback",value:function(e,t,i,n,r,a,s){var o=this._ptsFixed2(a),u=Module.HEAPU8.subarray(e,e+t),l=new Uint8Array(u);this.bufObject.appendFrameWithDts(o,s,l,!0,i),this.bufLastVDTS=Math.max(s,this.bufLastVDTS),this.vCachePTS=Math.max(o,this.vCachePTS),this.onCacheProcess&&this.onCacheProcess(this.getCachePTS())}},{key:"_samplesCallback",value:function(e,t,i,n){}},{key:"_aacFrameCallback",value:function(e,t,i,n,r){var a=this._ptsFixed2(r);if(this.audioWAudio){var s=new Uint8Array(7+i),o=Module.HEAPU8.subarray(e,e+7);s.set(o,0);var u=Module.HEAPU8.subarray(t,t+i);s.set(u,7),this.bufObject.appendFrame(a,s,!1,!0),this.bufLastADTS=Math.max(a,this.bufLastADTS),this.aCachePTS=Math.max(a,this.aCachePTS),this.onCacheProcess&&this.onCacheProcess(this.getCachePTS())}}},{key:"_decVFrameIntervalFunc",value:function(){var e=this;null==this.decVFrameInterval&&(this.decVFrameInterval=window.setInterval((function(){if(e._videoQueue.length<50&&e.playVPipe.length>0){var t=e.playVPipe.shift(),i=t.data,n=Module._malloc(i.length);Module.HEAP8.set(i,n);var r=parseInt(1e3*t.pts,10),a=parseInt(1e3*t.dts,10);e.yuvMaxTime=Math.max(t.pts,e.yuvMaxTime),Module.cwrap("decodeVideoFrame","number",["number","number","number","number","number"])(e.corePtr,n,i.length,r,a,e.frameCallTag),Module._free(n),n=null}}),10))}},{key:"_frameCallback",value:function(e,t,i,n,r,a,s,u,l,d){if(this._videoQueue.length,!(!1===this.openFrameCall||d!==this.frameCallTag||l>this.yuvMaxTime+this.frameDur||this.isNewSeek&&this.seekTarget-l>3*this.frameDur)){var h=this._videoQueue.length;if(this.canvas.width==n&&this.canvas.height==u||(this.canvas.width=n,this.canvas.height=u,this.isCheckDisplay)||this._checkDisplaySize(s,n,u),!(this.playPTS>l)){var f=Module.HEAPU8.subarray(e,e+n*u),p=Module.HEAPU8.subarray(t,t+r*u/2),m=Module.HEAPU8.subarray(i,i+a*u/2),g=new Uint8Array(f),_=new Uint8Array(p),y=new Uint8Array(m);this.config.readyShow&&(o.renderFrame(this.yuv,g,_,y,n,u),this.config.readyShow=!1,this.onReadyShowDone&&this.onReadyShowDone());var v=new c(g,_,y,n,r,a,s,u,l);if(h<=0||l>this._videoQueue[h-1].pts)this._videoQueue.push(v);else if(lthis._videoQueue[b].pts&&b+10&&(t.getPackageTimeMS=a.GetMsTime()),t.pushPkg++,void 0!==t.AVGetInterval&&null!==t.AVGetInterval||(t.AVGetInterval=window.setInterval((function(){Module.cwrap("getBufferLengthApi","number",["number"])(t.AVSniffPtr)>t.config.probeSize&&(Module.cwrap("getSniffHttpFlvPkg","number",["number"])(t.AVSniffPtr),t.pushPkg-=1)}),5));break;case"close":t.AVGetInterval&&clearInterval(t.AVGetInterval),t.AVGetInterval=null;case"fetch-fin":break;case"fetch-error":t.onNetworkError&&t.onNetworkError(i.data)}}},{key:"_checkDisplaySize",value:function(e,t,i){var n=t-e,r=this.config.width+Math.ceil(n/2),a=t/this.config.width>i/this.config.height,s=(r/t).toFixed(2),o=(this.config.height/i).toFixed(2),u=a?s:o,l=this.config.fixed,d=l?r:parseInt(t*u),h=l?this.config.height:parseInt(i*u);if(this.CanvasObj.offsetWidth!=d||this.CanvasObj.offsetHeight!=h){var c=parseInt((this.canvasBox.offsetHeight-h)/2),f=parseInt((this.canvasBox.offsetWidth-d)/2);c=c<0?0:c,f=f<0?0:f,this.CanvasObj.style.marginTop=c+"px",this.CanvasObj.style.marginLeft=f+"px",this.CanvasObj.style.width=d+"px",this.CanvasObj.style.height=h+"px"}return this.isCheckDisplay=!0,[d,h]}},{key:"_ptsFixed2",value:function(e){return Math.ceil(100*e)/100}},{key:"_callbackProbe",value:function(e,t,i,n,r,a,u,l,d){for(var h=Module.HEAPU8.subarray(d,d+10),c=0;c100&&(f=o.DEFAULT_FPS,this.mediaInfo.noFPS=!0),this.vCodecID=l,this.config.fps=f,this.mediaInfo.fps=f,this.mediaInfo.size.width=t,this.mediaInfo.size.height=i,this.frameTime=Math.floor(1e3/(this.mediaInfo.fps+2)),this.CanvasObj.width==t&&this.CanvasObj.height==i||(this.CanvasObj.width=t,this.CanvasObj.height=i,this.isCheckDisplay)||this._checkDisplaySize(t,t,i),r>=0&&!1===this.mediaInfo.noFPS?(void 0!==this.audioWAudio&&null!==this.audioWAudio&&(this.audioWAudio.stop(),this.audioWAudio=null),this.config.sampleRate=a,this.mediaInfo.sampleRate=a,this.audioWAudio=s({sampleRate:this.mediaInfo.sampleRate,appendType:o.APPEND_TYPE_FRAME}),this.audioWAudio.isLIVE=!0):this.mediaInfo.audioNone=!0,this.onProbeFinish&&this.onProbeFinish()}},{key:"_callbackYUV",value:function(e,t,i,n,r,a,s,o,u){var l=Module.HEAPU8.subarray(e,e+n*o),d=new Uint8Array(l),h=Module.HEAPU8.subarray(t,t+r*o/2),c=new Uint8Array(h),f=Module.HEAPU8.subarray(i,i+a*o/2),p={bufY:d,bufU:c,bufV:new Uint8Array(f),line_y:n,h:o,pts:u};this.YuvBuf.push(p),this.checkCacheState(),Module._free(l),l=null,Module._free(h),h=null,Module._free(f),f=null,!1===this.readyShowDone&&(this.playYUV(),this.readyShowDone=!0,this.onReadyShowDone&&this.onReadyShowDone(),this.audioWAudio||this.play())}},{key:"_callbackNALU",value:function(e,t,i,n,r,a,s){if(!1===this.readyKeyFrame){if(i<=0)return;this.readyKeyFrame=!0}var o=Module.HEAPU8.subarray(e,e+t),u=new Uint8Array(o);this.NaluBuf.push({bufData:u,len:t,isKey:i,w:n,h:r,pts:1e3*a,dts:1e3*s}),Module._free(o),o=null}},{key:"_callbackPCM",value:function(e){}},{key:"_callbackAAC",value:function(e,t,i,n,r){var a=this._ptsFixed2(r);if(this.audioWAudio){var s=new Uint8Array(7+i),o=Module.HEAPU8.subarray(e,e+7);s.set(o,0);var u=Module.HEAPU8.subarray(t,t+i);s.set(u,7);var l={pts:a,data:s};this.audioWAudio.addSample(l),this.checkCacheState()}}},{key:"_decode",value:function(){var e=this;setTimeout((function(){if(null!==e.workerFetch){var t=e.NaluBuf.shift();if(null!=t){var i=Module._malloc(t.bufData.length);Module.HEAP8.set(t.bufData,i),Module.cwrap("decodeHttpFlvVideoFrame","number",["number","number","number","number","number"])(e.AVSniffPtr,i,t.bufData.length,t.pts,t.dts,0),Module._free(i),i=null}e._decode()}}),1)}},{key:"checkCacheState",value:function(){var e=this.YuvBuf.length>=25&&(!0===this.mediaInfo.audioNone||this.audioWAudio&&this.audioWAudio.sampleQueue.length>=50);return!1===this.cache_status&&e&&(this.playInterval&&this.audioWAudio&&this.audioWAudio.play(),this.onLoadCacheFinshed&&this.onLoadCacheFinshed(),this.cache_status=!0),e}},{key:"setVoice",value:function(e){this.audioVoice=e,this.audioWAudio&&this.audioWAudio.setVoice(e)}},{key:"_removeBindFuncPtr",value:function(){null!==this._ptr_probeCallback&&Module.removeFunction(this._ptr_probeCallback),null!==this._ptr_frameCallback&&Module.removeFunction(this._ptr_frameCallback),null!==this._ptr_naluCallback&&Module.removeFunction(this._ptr_naluCallback),null!==this._ptr_sampleCallback&&Module.removeFunction(this._ptr_sampleCallback),null!==this._ptr_aacCallback&&Module.removeFunction(this._ptr_aacCallback),this._ptr_probeCallback=null,this._ptr_frameCallback=null,this._ptr_naluCallback=null,this._ptr_sampleCallback=null,this._ptr_aacCallback=null}},{key:"release",value:function(){return this.pause(),this.NaluBuf.length=0,this.YuvBuf.length=0,void 0!==this.workerFetch&&null!==this.workerFetch&&this.workerFetch.postMessage({cmd:"stop",data:"stop",msg:"stop"}),this.workerFetch=null,this.AVGetInterval&&clearInterval(this.AVGetInterval),this.AVGetInterval=null,this._removeBindFuncPtr(),Module.cwrap("releaseHttpFLV","number",["number"])(this.AVSniffPtr),this.playInterval&&clearInterval(this.playInterval),this.playInterval=null,this.audioWAudio&&this.audioWAudio.stop(),this.audioWAudio=null,this.CanvasObj&&this.CanvasObj.remove(),this.CanvasObj=null,0}},{key:"isPlayingState",value:function(){return null!==this.playInterval&&void 0!==this.playInterval}},{key:"pause",value:function(){this.audioWAudio&&this.audioWAudio.pause(),this.playInterval&&clearInterval(this.playInterval),this.playInterval=null}},{key:"playYUV",value:function(){if(this.YuvBuf.length>0){var e=this.YuvBuf.shift();return r.renderFrame(this.AVGLObj,e.bufY,e.bufU,e.bufV,e.line_y,e.h),!0}return!1}},{key:"play",value:function(){var e=this,t=this;if(!1===this.checkCacheState())return this.onLoadCache&&this.onLoadCache(),setTimeout((function(){e.play()}),100),!1;if(void 0===this.playInterval||null===this.playInterval){var i=0,n=0,s=0;!1===this.mediaInfo.audioNone&&this.audioWAudio&&!1===this.mediaInfo.noFPS?(this.playInterval=setInterval((function(){if(n=a.GetMsTime(),t.cache_status){if(n-i>=t.frameTime-s){var e=t.YuvBuf.shift();if(null!=e&&null!==e){var o=0;null!==t.audioWAudio&&void 0!==t.audioWAudio&&(o=1e3*(e.pts-t.audioWAudio.getAlignVPTS())),s=t.audioWAudio?o<0&&-1*o<=t.frameTime||o>=0?a.GetMsTime()-n+1:t.frameTime:a.GetMsTime()-n+1,r.renderFrame(t.AVGLObj,e.bufY,e.bufU,e.bufV,e.line_y,e.h)}(t.YuvBuf.length<=0||t.audioWAudio&&t.audioWAudio.sampleQueue.length<=0)&&(t.cache_status=!1,t.onLoadCache&&t.onLoadCache(),t.audioWAudio&&t.audioWAudio.pause()),i=n}}else s=t.frameTime}),1),this.audioWAudio&&this.audioWAudio.play()):this.playInterval=setInterval((function(){var e=t.YuvBuf.shift();null!=e&&null!==e&&r.renderFrame(t.AVGLObj,e.bufY,e.bufU,e.bufV,e.line_y,e.h),t.YuvBuf.length<=0&&(t.cache_status=!1)}),t.frameTime)}}},{key:"start",value:function(e){var t,i,n,a=this;this.workerFetch=new Worker((t=function(){var e=null;self,self.onmessage=function(t){var i=t.data;switch(void 0===i.cmd||null===i.cmd?"":i.cmd){case"start":var n=i.data;(e=new WebSocket(n)).binaryType="arraybuffer",e.onopen=function(t){e.send("Hello WebSockets!")},e.onmessage=function(e){if(e.data instanceof ArrayBuffer){var t=e.data;t.byteLength>0&&postMessage({cmd:"fetch-chunk",data:new Uint8Array(t),msg:"fetch-chunk"})}},e.onclose=function(e){};break;case"stop":e&&e.close(),self.close(),self.postMessage({cmd:"close",data:"close",msg:"close"})}}}.toString(),i=t.match(/^\s*function\s*\(\s*\)\s*\{(([\s\S](?!\}$))*[\s\S])/),n=[i[1]],window.URL.createObjectURL(new Blob(n,{type:"text/javascript"})))),this.workerFetch.onmessage=function(e){a._workerFetch_onmessage(e,a)},this.workerFetch,this.AVSniffPtr=Module.cwrap("AVSniffHttpFlvInit","number",["string","string"])("base64:QXV0aG9yOmNoYW5neWFubG9uZ3xudW1iZXJ3b2xmLEdpdGh1YjpodHRwczovL2dpdGh1Yi5jb20vbnVtYmVyd29sZixFbWFpbDpwb3JzY2hlZ3QyM0Bmb3htYWlsLmNvbSxRUTo1MzEzNjU4NzIsSG9tZVBhZ2U6aHR0cDovL3h2aWRlby52aWRlbyxEaXNjb3JkOm51bWJlcndvbGYjODY5NCx3ZWNoYXI6bnVtYmVyd29sZjExLEJlaWppbmcsV29ya0luOkJhaWR1","0.0.0"),this.AVSniffPtr,this._ptr_probeCallback=Module.addFunction(this._callbackProbe.bind(this)),this._ptr_yuvCallback=Module.addFunction(this._callbackYUV.bind(this)),this._ptr_naluCallback=Module.addFunction(this._callbackNALU.bind(this)),this._ptr_sampleCallback=Module.addFunction(this._callbackPCM.bind(this)),this._ptr_aacCallback=Module.addFunction(this._callbackAAC.bind(this)),Module.cwrap("initializeSniffHttpFlvModule","number",["number","number","number","number","number","number"])(this.AVSniffPtr,this._ptr_probeCallback,this._ptr_yuvCallback,this._ptr_naluCallback,this._ptr_sampleCallback,this._ptr_aacCallback),this.AVGLObj=r.setupCanvas(this.CanvasObj,{preserveDrawingBuffer:!1}),this.workerFetch.postMessage({cmd:"start",data:e,msg:"start"}),this._decode()}}])&&n(t.prototype,i),u&&n(t,u),e}();i.CWsLiveCore=u},{"../consts":52,"../demuxer/buffer":64,"../demuxer/bufferFrame":65,"../render-engine/webgl-420p":77,"../version":80,"./audio-core":53,"./audio-native-core":54,"./av-common":55,"./cache":59,"./cacheYuv":60}],59:[function(e,t,i){(function(i){"use strict";e("./cacheYuv");i.CACHE_APPEND_STATUS_CODE={FAILED:-1,OVERFLOW:-2,OK:0,NOT_FULL:1,FULL:2,NULL:3},t.exports=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:60,t={limit:e,yuvCache:[],appendCacheByCacheYuv:function(e){e.pts;return t.yuvCache.length>=t.limit?CACHE_APPEND_STATUS_CODE.OVERFLOW:(t.yuvCache.push(e),t.yuvCache.length>=t.limit?CACHE_APPEND_STATUS_CODE.FULL:CACHE_APPEND_STATUS_CODE.NOT_FULL)},getState:function(){return t.yuvCache.length<=0?CACHE_APPEND_STATUS_CODE.NULL:t.yuvCache.length>=t.limit?CACHE_APPEND_STATUS_CODE.FULL:CACHE_APPEND_STATUS_CODE.NOT_FULL},cleanPipeline:function(){t.yuvCache.length=0},vYuv:function(){return t.yuvCache.length<=0?null:t.yuvCache.shift()}};return t}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./cacheYuv":60}],60:[function(e,t,i){"use strict";function n(e,t){for(var i=0;i>1;return r.indexOf(t)},GET_NALU_TYPE:function(e){var t=(126&e)>>1;if(t>=1&&t<=9)return n.DEFINE_P_FRAME;if(t>=16&&t<=21)return n.DEFINE_KEY_FRAME;var i=r.indexOf(t);return i>=0?r[i]:n.DEFINE_OTHERS_FRAME},PACK_NALU:function(e){var t=e.nalu,i=e.vlc.vlc;null==t.vps&&(t.vps=new Uint8Array);var n=new Uint8Array(t.vps.length+t.sps.length+t.pps.length+t.sei.length+i.length);return n.set(t.vps,0),n.set(t.sps,t.vps.length),n.set(t.pps,t.vps.length+t.sps.length),n.set(t.sei,t.vps.length+t.sps.length+t.pps.length),n.set(i,t.vps.length+t.sps.length+t.pps.length+t.sei.length),n}}},{"./hevc-header":61}],63:[function(e,t,i){"use strict";function n(e){return function(e){if(Array.isArray(e)){for(var t=0,i=new Array(e.length);t0&&void 0!==arguments[0]&&arguments[0];null!=t&&(t.showScreen=e,t.canvas&&(e?t.canvas.setAttribute("hidden",!0):t.canvas.removeAttribute("hidden")))},setSize:function(e,i){t.config.width=e||l.DEFAULT_WIDTH,t.config.height=i||l.DEFAULT_HEIGHT},setFrameRate:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:25;t.config.fps=e,t.config.frameDurMs=1e3/e},setDurationMs:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1;t.durationMs=e,0==t.config.audioNone&&t.audio.setDurationMs(e)},setPlayingCall:function(e){t.onPlayingTime=e},setVoice:function(e){t.realVolume=e,0==t.config.audioNone&&t.audio.setVoice(t.realVolume)},isPlayingState:function(){return t.isPlaying||t.isCaching===l.CACHE_WITH_PLAY_SIGN},appendAACFrame:function(e){t.audio.addSample(e),t.aCachePTS=Math.max(e.pts,t.aCachePTS)},appendHevcFrame:function(e){var i;t.config.appendHevcType==l.APPEND_TYPE_STREAM?t.stream=new Uint8Array((i=n(t.stream)).concat.apply(i,n(e))):t.config.appendHevcType==l.APPEND_TYPE_FRAME&&(t.frameList.push(e),t.vCachePTS=Math.max(e.pts,t.vCachePTS))},getCachePTS:function(){return Math.max(t.vCachePTS,t.aCachePTS)},endAudio:function(){0==t.config.audioNone&&t.audio.stop()},cleanSample:function(){0==t.config.audioNone&&t.audio.cleanQueue()},cleanVideoQueue:function(){t.config.appendHevcType==l.APPEND_TYPE_STREAM?t.stream=new Uint8Array:t.config.appendHevcType==l.APPEND_TYPE_FRAME&&(t.frameList=[],t.frameList.length=0)},cleanCacheYUV:function(){t.cacheYuvBuf.cleanPipeline()},pause:function(){t.loop&&window.clearInterval(t.loop),t.loop=null,0==t.config.audioNone&&t.audio.pause(),t.isPlaying=!1,t.isCaching===l.CACHE_WITH_PLAY_SIGN&&(t.isCaching=l.CACHE_WITH_NOPLAY_SIGN)},checkFinished:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:l.PLAYER_MODE_VOD;return e==l.PLAYER_MODE_VOD&&t.cacheYuvBuf.yuvCache.length<=0&&(t.videoPTS.toFixed(1)>=(t.durationMs-t.config.frameDurMs)/1e3||t.noCacheFrame>=10)&&(null!=t.onPlayingFinish&&(l.PLAYER_MODE_VOD,t.frameList.length,t.cacheYuvBuf.yuvCache.length,t.videoPTS.toFixed(1),t.durationMs,t.config.frameDurMs,t.noCacheFrame,t.onPlayingFinish()),!0)},clearAllCache:function(){t.nowPacket=null,t.vCachePTS=0,t.aCachePTS=0,t.cleanSample(),t.cleanVideoQueue(),t.cleanCacheYUV()},seek:function(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.isPlaying;t.pause(),t.stopCacheThread(),t.clearAllCache(),e&&e(),t.isNewSeek=!0,t.flushDecoder=1,t.videoPTS=parseInt(i.seekTime);var r={seekPos:i.seekTime||-1,mode:i.mode||l.PLAYER_MODE_VOD,accurateSeek:i.accurateSeek||!0,seekEvent:i.seekEvent||!0,realPlay:n};t.cacheThread(),t.play(r)},getNalu1Packet:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],i=null,n=-1;if(t.config.appendHevcType==l.APPEND_TYPE_STREAM)i=t.nextNalu();else{if(t.config.appendHevcType!=l.APPEND_TYPE_FRAME)return null;var r=t.frameList.shift();if(!r)return null;i=r.data,n=r.pts,e&&(t.videoPTS=n)}return{nalBuf:i,pts:n}},decodeNalu1Frame:function(e,i){var n=Module._malloc(e.length);Module.HEAP8.set(e,n);var r=parseInt(1e3*i);Module.cwrap("decodeCodecContext","number",["number","number","number","number","number"])(t.vcodecerPtr,n,e.length,r,t.flushDecoder);return t.flushDecoder=0,Module._free(n),!1},cacheThread:function(){t.cacheLoop=window.setInterval((function(){if(t.cacheYuvBuf.getState()!=CACHE_APPEND_STATUS_CODE.FULL){var e=t.getNalu1Packet(!1);if(null!=e){var i=e.nalBuf,n=e.pts;t.decodeNalu1Frame(i,n,!0)}}}),10)},stopCacheThread:function(){null!==t.cacheLoop&&(window.clearInterval(t.cacheLoop),t.cacheLoop=null)},loadCache:function(){if(!(t.frameList.length<=3)){var e=t.isPlaying;if(t.cacheYuvBuf.yuvCache.length<=3){t.pause(),null!=t.onLoadCache&&t.onLoadCache(),t.isCaching=e?l.CACHE_WITH_PLAY_SIGN:l.CACHE_WITH_NOPLAY_SIGN;var i=t.frameList.length>30?30:t.frameList.length;null===t.cacheInterval&&(t.cacheInterval=window.setInterval((function(){t.cacheYuvBuf.yuvCache.length>=i&&(null!=t.onLoadCacheFinshed&&t.onLoadCacheFinshed(),window.clearInterval(t.cacheInterval),t.cacheInterval=null,t.isCaching===l.CACHE_WITH_PLAY_SIGN&&t.play(t.playParams),t.isCaching=l.CACHE_NO_LOADCACHE)}),40))}}},playFunc:function(){var e=!1;if(t.playParams.seekEvent||r.GetMsTime()-t.calcuteStartTime>=t.frameTime-t.preCostTime){e=!0;var i=!0;if(t.calcuteStartTime=r.GetMsTime(),t.config.audioNone)t.playFrameYUV(i,t.playParams.accurateSeek);else{t.fix_poc_err_skip>0&&(t.fix_poc_err_skip--,i=!1);var n=t.videoPTS-t.audio.getAlignVPTS();if(n>0)return void(t.playParams.seekEvent&&!t.config.audioNone&&t.audio.setVoice(0));if(i){if(!(i=-1*n<=1*t.frameTimeSec)){for(var a=parseInt(n/t.frameTimeSec),s=0;s=i&&(t.playFrameYUV(!0,t.playParams.accurateSeek),i+=1)}),1)}else t.videoPTS>=t.playParams.seekPos&&!t.isNewSeek||0===t.playParams.seekPos||0===t.playParams.seekPos?(t.frameTime=1e3/t.config.fps,t.frameTimeSec=t.frameTime/1e3,0==t.config.audioNone&&t.audio.play(),t.realVolume=t.config.audioNone?0:t.audio.voice,t.playParams.seekEvent&&(t.fix_poc_err_skip=10),t.loop=window.setInterval((function(){var e=r.GetMsTime();t.playFunc(),t.preCostTime=r.GetMsTime()-e}),1)):(t.loop=window.setInterval((function(){t.playFrameYUV(!1,t.playParams.accurateSeek),t.checkFinished(t.playParams.mode)?(window.clearInterval(t.loop),t.loop=null):t.videoPTS>=t.playParams.seekPos&&(window.clearInterval(t.loop),t.loop=null,t.play(t.playParams))}),1),t.isNewSeek=!1)},stop:function(){t.release(),Module.cwrap("initializeDecoder","number",["number"])(t.vcodecerPtr),t.stream=new Uint8Array},release:function(){return t.endAudio(),t.cacheLoop&&window.clearInterval(t.cacheLoop),t.cacheLoop=null,t.loop&&window.clearInterval(t.loop),t.loop=null,t.pause(),null!==t.videoCallback&&Module.removeFunction(t.videoCallback),t.videoCallback=null,Module.cwrap("release","number",["number"])(t.vcodecerPtr),t.stream=null,t.frameList.length=0,t.durationMs=-1,t.videoPTS=0,t.isPlaying=!1,!0},nextNalu:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;if(t.stream.length<=4)return!1;for(var i=-1,n=0;n=t.stream.length){if(-1==i)return!1;var r=t.stream.subarray(i);return t.stream=new Uint8Array,r}var a="0 0 1"==t.stream.slice(0,3).join(" "),s="0 0 0 1"==t.stream.slice(0,4).join(" ");if(a||s){if(-1==i)i=n;else{if(e<=1){var o=t.stream.subarray(i,n);return t.stream=t.stream.subarray(n),o}e-=1}n+=3}}return!1},decodeSendPacket:function(e){var i=Module._malloc(e.length);Module.HEAP8.set(e,i);var n=Module.cwrap("decodeSendPacket","number",["number","number","number"])(t.vcodecerPtr,i,e.length);return Module._free(i),n},decodeRecvFrame:function(){return Module.cwrap("decodeRecv","number",["number"])(t.vcodecerPtr)},playFrameYUV:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],i=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=t.cacheYuvBuf.vYuv();if(null==n)return t.noCacheFrame+=1,e&&!t.playParams.seekEvent&&t.loadCache(),!1;t.noCacheFrame=0;var r=n.pts;return t.videoPTS=r,(!e&&i||e)&&e&&t.drawImage(n.width,n.height,n.imageBufferY,n.imageBufferB,n.imageBufferR),e&&!t.playParams.seekEvent&&t.isPlaying&&t.loadCache(),!0},drawImage:function(e,i,n,r,a){if(t.canvas.width===e&&t.canvas.height==i||(t.canvas.width=e,t.canvas.height=i),t.showScreen&&null!=t.onRender)t.onRender(e,i,n,r,a);else{if(!t.isCheckDisplay)t.checkDisplaySize(e,i);var s=e*i,o=e/2*(i/2),l=new Uint8Array(s+2*o);l.set(n,0),l.set(r,s),l.set(a,s+o),u.renderFrame(t.yuv,n,r,a,e,i)}},debugYUV:function(e){t.debugYUVSwitch=!0,t.debugID=e},checkDisplaySize:function(e,i){var n=e/t.config.width>i/t.config.height,r=(t.config.width/e).toFixed(2),a=(t.config.height/i).toFixed(2),s=n?r:a,o=t.config.fixed,u=o?t.config.width:parseInt(e*s),l=o?t.config.height:parseInt(i*s);if(t.canvas.offsetWidth!=u||t.canvas.offsetHeight!=l){var d=parseInt((t.canvasBox.offsetHeight-l)/2),h=parseInt((t.canvasBox.offsetWidth-u)/2);t.canvas.style.marginTop=d+"px",t.canvas.style.marginLeft=h+"px",t.canvas.style.width=u+"px",t.canvas.style.height=l+"px"}return t.isCheckDisplay=!0,[u,l]},makeWasm:function(){if(null!=t.config.token){t.vcodecerPtr=Module.cwrap("registerPlayer","number",["string","string"])(t.config.token,d.PLAYER_VERSION),t.videoCallback=Module.addFunction((function(e,i,n,r,a,s,u,l,d){var h=Module.HEAPU8.subarray(e,e+r*l),c=Module.HEAPU8.subarray(i,i+a*l/2),f=Module.HEAPU8.subarray(n,n+s*l/2),p=new Uint8Array(h),m=new Uint8Array(c),g=new Uint8Array(f),_=1*d/1e3,y=new o.CacheYuvStruct(_,r,l,p,m,g);t.cacheYuvBuf.appendCacheByCacheYuv(y)})),Module.cwrap("setCodecType","number",["number","number","number"])(t.vcodecerPtr,t.config.videoCodec,t.videoCallback);Module.cwrap("initMissile","number",["number"])(t.vcodecerPtr);Module.cwrap("initializeDecoder","number",["number"])(t.vcodecerPtr)}},makeIt:function(){var e=document.querySelector("div#"+t.config.playerId),i=document.createElement("canvas");i.style.width=e.clientWidth+"px",i.style.height=e.clientHeight+"px",i.style.top="0px",i.style.left="0px",e.appendChild(i),t.canvasBox=e,t.canvas=i,t.yuv=u.setupCanvas(i,{preserveDrawingBuffer:!1}),0==t.config.audioNone&&(t.audio=a({sampleRate:t.config.sampleRate,appendType:t.config.appendHevcType})),t.isPlayLoadingFinish=1}};return t.makeWasm(),t.makeIt(),t.cacheThread(),t}},{"../consts":52,"../render-engine/webgl-420p":77,"../version":80,"./audio-core":53,"./av-common":55,"./cache":59,"./cacheYuv":60}],64:[function(e,t,i){"use strict";var n=e("./bufferFrame");t.exports=function(){var e={videoBuffer:[],audioBuffer:[],idrIdxBuffer:[],appendFrame:function(t,i){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],s=new n.BufferFrame(t,a,i,r),o=parseInt(t);return r?(e.videoBuffer.length-1>=o?e.videoBuffer[o].push(s):e.videoBuffer.push([s]),a&&!e.idrIdxBuffer.includes(t)&&e.idrIdxBuffer.push(t)):e.audioBuffer.length-1>=o&&null!=e.audioBuffer[o]&&null!=e.audioBuffer[o]?e.audioBuffer[o]&&e.audioBuffer[o].push(s):e.audioBuffer.push([s]),!0},appendFrameWithDts:function(t,i,r){var a=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],s=arguments.length>4&&void 0!==arguments[4]&&arguments[4],o=n.ConstructWithDts(t,i,s,r,a),u=parseInt(i);return a?(e.videoBuffer.length-1>=u?e.videoBuffer[u].push(o):e.videoBuffer.push([o]),s&&!e.idrIdxBuffer.includes(i)&&e.idrIdxBuffer.push(i)):e.audioBuffer.length-1>=u&&null!=e.audioBuffer[u]&&null!=e.audioBuffer[u]?e.audioBuffer[u]&&e.audioBuffer[u].push(o):e.audioBuffer.push([o]),!0},appendFrameByBufferFrame:function(t){var i=t.pts,n=parseInt(i);return t.video?(e.videoBuffer.length-1>=n?e.videoBuffer[n].push(t):e.videoBuffer.push([t]),isKey&&!e.idrIdxBuffer.includes(i)&&e.idrIdxBuffer.push(i)):e.audioBuffer.length-1>=n?e.audioBuffer[n].push(t):e.audioBuffer.push([t]),!0},cleanPipeline:function(){e.videoBuffer.length=0,e.audioBuffer.length=0},vFrame:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1;if(!(t<0||t>e.videoBuffer.length-1))return e.videoBuffer[t]},aFrame:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1;if(!(t<0||t>e.audioBuffer.length-1))return e.audioBuffer[t]},seekIDR:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1;if(e.idrIdxBuffer,e.videoBuffer,t<0)return null;if(e.idrIdxBuffer.includes(t))return t;for(var i=0;it||0===i&&e.idrIdxBuffer[i]>=t){for(var n=1;n>=0;n--){var r=i-n;if(r>=0)return e.idrIdxBuffer[r],e.idrIdxBuffer[r]}return e.idrIdxBuffer[i],j,e.idrIdxBuffer[i]}}};return e}},{"./bufferFrame":65}],65:[function(e,t,i){"use strict";function n(e,t){for(var i=0;i0&&i.extensionInfo.vHeight>0&&(i.size.width=i.extensionInfo.vWidth,i.size.height=i.extensionInfo.vHeight)),i.mediaInfo.duration,null!=i.onDemuxed&&i.onDemuxed(i.onReadyOBJ);for(var e=!1;void 0!==i.mpegTsObj&&null!==i.mpegTsObj;){var n=i.mpegTsObj.readPacket();if(n.size<=0)break;var r=n.dtime>0?n.dtime:n.ptime;if(!(r<0)){if(0==n.type){r<=i.vPreFramePTS&&(e=!0);var a=u.PACK_NALU(n.layer),o=1==n.keyframe,l=1==e?r+i.vStartTime:r,d=new s.BufferFrame(l,o,a,!0);i.bufObject.appendFrame(d.pts,d.data,!0,d.isKey),i.vPreFramePTS=l,null!=i.onSamples&&i.onSamples(i.onReadyOBJ,d)}else if(r<=i.aPreFramePTS&&(e=!0),"aac"==i.mediaInfo.aCodec)for(var h=n.data,c=0;c=3?(i._onTsReady(e),window.clearInterval(i.timerTsWasm),i.timerTsWasm=null):(i.mpegTsWasmRetryLoadTimes+=1,i.mpegTsObj.initDemuxer())}),3e3)}},{key:"_onTsReady",value:function(e){var t=this;t.hls.fetchM3u8(e),t.mpegTsWasmState=!0,t.timerFeed=window.setInterval((function(){if(t.tsList.length>0&&0==t.lockWait.state)try{var e=t.tsList.shift();if(null!=e){var i=e.streamURI,n=e.streamDur;t.lockWait.state=!0,t.lockWait.lockMember.dur=n,t.mpegTsObj.isLive=t.hls.isLive(),t.mpegTsObj.demuxURL(i)}else console.error("_onTsReady need wait ")}catch(e){console.error("onTsReady ERROR:",e),t.lockWait.state=!1}}),50)}},{key:"release",value:function(){this.hls&&this.hls.release(),this.hls=null,this.timerFeed&&window.clearInterval(this.timerFeed),this.timerFeed=null,this.timerTsWasm&&window.clearInterval(this.timerTsWasm),this.timerTsWasm=null}},{key:"bindReady",value:function(e){this.onReadyOBJ=e}},{key:"popBuffer",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;return t<0?null:1===e?t+1>this.bufObject.videoBuffer.length?null:this.bufObject.vFrame(t):2===e?t+1>this.bufObject.audioBuffer.length?null:this.bufObject.aFrame(t):void 0}},{key:"getVLen",value:function(){return this.bufObject.videoBuffer.length}},{key:"getALen",value:function(){return this.bufObject.audioBuffer.length}},{key:"getLastIdx",value:function(){return this.bufObject.videoBuffer.length-1}},{key:"getALastIdx",value:function(){return this.bufObject.audioBuffer.length-1}},{key:"getACodec",value:function(){return this.aCodec}},{key:"getVCodec",value:function(){return this.vCodec}},{key:"getDurationMs",value:function(){return this.durationMs}},{key:"getFPS",value:function(){return this.fps}},{key:"getSampleRate",value:function(){return this.sampleRate}},{key:"getSampleChannel",value:function(){return this.aChannel}},{key:"getSize",value:function(){return this.size}},{key:"seek",value:function(e){if(e>=0){var t=this.bufObject.seekIDR(e);this.seekPos=t}}}])&&n(t.prototype,i),d&&n(t,d),e}();i.M3u8=d},{"../consts":52,"../decoder/hevc-imp":62,"./buffer":64,"./bufferFrame":65,"./m3u8base":67,"./mpegts/mpeg.js":71}],67:[function(e,t,i){"use strict";function n(e,t){for(var i=0;i ",t),setTimeout((function(){i.fetchM3u8(e)}),500)}))}},{key:"_uriParse",value:function(e){this._preURI="";var t=e.split("//"),i=null,n=null;if(t.length<1)return!1;t.length>1?(i=t[0],n=t[1].split("/"),this._preURI=i+"//"):n=t[0].split("/");for(var r=0;rp&&(o=p);var m=n[l+=1],g=null;g=m.indexOf("http")>=0?m:this._preURI+m,this._slices.indexOf(g)<0&&(this._slices.push(g),this._slices[this._slices.length-1],null!=this.onTransportStream&&this.onTransportStream(g,p))}}}if(this._slices.length>s.hlsSliceLimit&&this._type==r.PLAYER_IN_TYPE_M3U8_LIVE&&(this._slices=this._slices.slice(-1*s.hlsSliceLimit)),null!=this.onFinished){var _={type:this._type,duration:-1};this.onFinished(_)}return o}},{key:"_readTag",value:function(e){var t=s.tagParse.exec(e);return null!==t?{key:t[1],value:t[3]}:null}}])&&n(t.prototype,i),o&&n(t,o),e}();i.M3u8Base=o},{"../consts":52}],68:[function(e,t,i){"use strict";var n=e("mp4box"),r=e("../decoder/hevc-header"),a=e("../decoder/hevc-imp"),s=e("./buffer"),o=e("../consts"),u={96e3:0,88200:1,64e3:2,48e3:3,44100:4,32e3:5,24e3:6,22050:7,16e3:8,12e3:9,11025:10,8e3:11,7350:12,Reserved:13,"frequency is written explictly":15},l=function(e){for(var t=[],i=0;i1&&void 0!==arguments[1]&&arguments[1],i=null;return t?((i=e)[0]=r.DEFINE_STARTCODE[0],i[1]=r.DEFINE_STARTCODE[1],i[2]=r.DEFINE_STARTCODE[2],i[3]=r.DEFINE_STARTCODE[3]):((i=new Uint8Array(r.DEFINE_STARTCODE.length+e.length)).set(r.DEFINE_STARTCODE,0),i.set(e,r.DEFINE_STARTCODE.length)),i},d.prototype.setAACAdts=function(e){var t=null,i=this.aacProfile,n=u[this.sampleRate],r=new Uint8Array(7),a=r.length+e.length;return r[0]=255,r[1]=241,r[2]=(i-1<<6)+(n<<2)+0,r[3]=128+(a>>11),r[4]=(2047&a)>>3,r[5]=31+((7&a)<<5),r[6]=252,(t=new Uint8Array(a)).set(r,0),t.set(e,r.length),t},d.prototype.demux=function(){var e=this;e.seekPos=-1,e.mp4boxfile=n.createFile(),e.movieInfo=null,e.videoCodec=null,e.durationMs=-1,e.fps=-1,e.sampleRate=-1,e.aacProfile=2,e.size={width:-1,height:-1},e.bufObject=s(),e.audioNone=!1,e.naluHeader={vps:null,sps:null,pps:null,sei:null},e.mp4boxfile.onError=function(e){},this.mp4boxfile.onReady=function(t){for(var i in e.movieInfo=t,t.tracks)"VideoHandler"!==t.tracks[i].name&&"video"!==t.tracks[i].type||(t.tracks[i].codec,t.tracks[i].codec.indexOf("hev")>=0||t.tracks[i].codec.indexOf("hvc")>=0?e.videoCodec=o.CODEC_H265:t.tracks[i].codec.indexOf("avc")>=0&&(e.videoCodec=o.CODEC_H264));var n=-1;if(n=t.videoTracks[0].samples_duration/t.videoTracks[0].timescale,e.durationMs=1e3*n,e.fps=t.videoTracks[0].nb_samples/n,e.seekDiffTime=1/e.fps,e.size.width=t.videoTracks[0].track_width,e.size.height=t.videoTracks[0].track_height,t.audioTracks.length>0){e.sampleRate=t.audioTracks[0].audio.sample_rate;var r=t.audioTracks[0].codec.split(".");e.aacProfile=r[r.length-1]}else e.audioNone=!0;null!=e.onMp4BoxReady&&e.onMp4BoxReady(e.videoCodec),e.videoCodec===o.CODEC_H265?(e.initializeAllSourceBuffers(),e.mp4boxfile.start()):(e.videoCodec,o.CODEC_H264)},e.mp4boxfile.onSamples=function(t,i,n){var s=window.setInterval((function(){for(var i=0;i3?e.naluHeader.sei=e.setStartCode(g[3][0].data,!1):e.naluHeader.sei=new Uint8Array,e.naluHeader}else e.videoCodec==o.CODEC_H264&&(e.naluHeader.vps=new Uint8Array,e.naluHeader.sps=e.setStartCode(f.SPS[0].nalu,!1),e.naluHeader.pps=e.setStartCode(f.PPS[0].nalu,!1),e.naluHeader.sei=new Uint8Array);d[4].toString(16),e.naluHeader.vps[4].toString(16),l(e.naluHeader.vps),l(d);var _=e.setStartCode(d.subarray(0,e.naluHeader.vps.length),!0);if(l(_),d[4]===e.naluHeader.vps[4]){var y=e.naluHeader.vps.length+4,v=e.naluHeader.vps.length+e.naluHeader.sps.length+4,b=e.naluHeader.vps.length+e.naluHeader.sps.length+e.naluHeader.pps.length+4;if(e.naluHeader.sei.length<=0&&e.naluHeader.sps.length>0&&d[y]===e.naluHeader.sps[4]&&e.naluHeader.pps.length>0&&d[v]===e.naluHeader.pps[4]&&78===d[b]){d[e.naluHeader.vps.length+4],e.naluHeader.sps[4],d[e.naluHeader.vps.length+e.naluHeader.sps.length+4],e.naluHeader.pps[4],d[e.naluHeader.vps.length+e.naluHeader.sps.length+e.naluHeader.pps.length+4];for(var T=0,S=0;S4&&d[4]===e.naluHeader.sei[4]){var E=d.subarray(0,10),w=new Uint8Array(e.naluHeader.vps.length+E.length);w.set(E,0),w.set(e.naluHeader.vps,E.length),w[3]=1,e.naluHeader.vps=null,e.naluHeader.vps=new Uint8Array(w),w=null,E=null,(d=d.subarray(10))[4],e.naluHeader.vps[4],e.naluHeader.vps}else if(0===e.naluHeader.sei.length&&78===d[4]){d=e.setStartCode(d,!0);for(var C=0,A=0;A1&&void 0!==arguments[1]?arguments[1]:0;return e.fileStart=t,this.mp4boxfile.appendBuffer(e)},d.prototype.finishBuffer=function(){this.mp4boxfile.flush()},d.prototype.play=function(){},d.prototype.getVideoCoder=function(){return this.videoCodec},d.prototype.getDurationMs=function(){return this.durationMs},d.prototype.getFPS=function(){return this.fps},d.prototype.getSampleRate=function(){return this.sampleRate},d.prototype.getSize=function(){return this.size},d.prototype.seek=function(e){if(e>=0){var t=this.bufObject.seekIDR(e);this.seekPos=t}},d.prototype.popBuffer=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;return t<0?null:1==e?this.bufObject.vFrame(t):2==e?this.bufObject.aFrame(t):void 0},d.prototype.addBuffer=function(e){var t=e.id;this.mp4boxfile.setExtractionOptions(t)},d.prototype.initializeAllSourceBuffers=function(){if(this.movieInfo){for(var e=this.movieInfo,t=0;t>5)}},{key:"sliceAACFrames",value:function(e,t){for(var i=[],n=e,r=0;r>4==15){var a=this._getPktLen(t[r+3],t[r+4],t[r+5]);if(a<=0)continue;var s=t.subarray(r,r+a),o=new Uint8Array(a);o.set(s,0),i.push({ptime:n,data:o}),n+=this.frameDurSec,r+=a}else r+=1;return i}}])&&n(t.prototype,i),r&&n(t,r),e}();i.AACDecoder=r},{}],71:[function(e,t,i){(function(t){"use strict";function n(e,t){for(var i=0;i ",e),n=null})).catch((function(i){console.error("demuxerTsInit ERROR fetch ERROR ==> ",i),t._releaseOffset(),t.onDemuxedFailed&&t.onDemuxedFailed(i,e)}))}},{key:"_releaseOffset",value:function(){void 0!==this.offsetDemux&&null!==this.offsetDemux&&(Module._free(this.offsetDemux),this.offsetDemux=null)}},{key:"_demuxCore",value:function(e){if(this._releaseOffset(),this._refreshDemuxer(),!(e.length<=0)){this.offsetDemux=Module._malloc(e.length),Module.HEAP8.set(e,this.offsetDemux);var t=Module.cwrap("demuxBox","number",["number","number","number"])(this.offsetDemux,e.length,this.isLive);Module._free(this.offsetDemux),this.offsetDemux=null,t>=0&&(this._setMediaInfo(),this._setExtensionInfo(),null!=this.onDemuxed&&this.onDemuxed())}}},{key:"_setMediaInfo",value:function(){var e=Module.cwrap("getMediaInfo","number",[])(),t=Module.HEAPU32[e/4],i=Module.HEAPU32[e/4+1],n=Module.HEAPF64[e/8+1],s=Module.HEAPF64[e/8+1+1],o=Module.HEAPF64[e/8+1+1+1],u=Module.HEAPF64[e/8+1+1+1+1],l=Module.HEAPU32[e/4+2+2+2+2+2];this.mediaAttr.vFps=n,this.mediaAttr.vGop=l,this.mediaAttr.vDuration=s,this.mediaAttr.aDuration=o,this.mediaAttr.duration=u;var d=Module.cwrap("getAudioCodecID","number",[])();d>=0?(this.mediaAttr.aCodec=a.CODEC_OFFSET_TABLE[d],this.mediaAttr.sampleRate=t>0?t:a.DEFAULT_SAMPLERATE,this.mediaAttr.sampleChannel=i>=0?i:a.DEFAULT_CHANNEL):(this.mediaAttr.sampleRate=0,this.mediaAttr.sampleChannel=0,this.mediaAttr.audioNone=!0);var h=Module.cwrap("getVideoCodecID","number",[])();h>=0&&(this.mediaAttr.vCodec=a.CODEC_OFFSET_TABLE[h]),null==this.aacDec?this.aacDec=new r.AACDecoder(this.mediaAttr):this.aacDec.updateConfig(this.mediaAttr)}},{key:"_setExtensionInfo",value:function(){var e=Module.cwrap("getExtensionInfo","number",[])(),t=Module.HEAPU32[e/4],i=Module.HEAPU32[e/4+1];this.extensionInfo.vWidth=t,this.extensionInfo.vHeight=i}},{key:"readMediaInfo",value:function(){return this.mediaAttr}},{key:"readExtensionInfo",value:function(){return this.extensionInfo}},{key:"readAudioNone",value:function(){return this.mediaAttr.audioNone}},{key:"_readLayer",value:function(){var e={vps:null,sps:null,pps:null,sei:null},t={vlc:null},i=Module.cwrap("getSPSLen","number",[])(),n=Module.cwrap("getSPS","number",[])();if(!(i<0)){e.sps=new Uint8Array(i),e.sps.set(Module.HEAPU8.subarray(n,n+i),0);var r=Module.cwrap("getPPSLen","number",[])(),s=Module.cwrap("getPPS","number",[])();e.pps=new Uint8Array(r),e.pps.set(Module.HEAPU8.subarray(s,s+r),0);var o=Module.cwrap("getSEILen","number",[])(),u=Module.cwrap("getSEI","number",[])();e.sei=new Uint8Array(o),e.sei.set(Module.HEAPU8.subarray(u,u+o),0);var l=Module.cwrap("getVLCLen","number",[])(),d=Module.cwrap("getVLC","number",[])();if(t.vlc=new Uint8Array(l),t.vlc.set(Module.HEAPU8.subarray(d,d+l),0),this.mediaAttr.vCodec==a.DEF_HEVC||this.mediaAttr.vCodec==a.DEF_H265){var h=Module.cwrap("getVPSLen","number",[])(),c=Module.cwrap("getVPS","number",[])();e.vps=new Uint8Array(h),e.vps.set(Module.HEAPU8.subarray(c,c+h),0)}else this.mediaAttr.vCodec==a.DEF_AVC||(this.mediaAttr.vCodec,a.DEF_H264);return{nalu:e,vlc:t}}}},{key:"isHEVC",value:function(){return this.mediaAttr.vCodec==a.DEF_HEVC||this.mediaAttr.vCodec==a.DEF_H265}},{key:"readPacket",value:function(){var e=Module.cwrap("getPacket","number",[])(),t=Module.HEAPU32[e/4],i=Module.HEAPU32[e/4+1],n=Module.HEAPF64[e/8+1],r=Module.HEAPF64[e/8+1+1],s=Module.HEAPU32[e/4+1+1+2+2],o=Module.HEAPU32[e/4+1+1+2+2+1],u=Module.HEAPU8.subarray(o,o+i),l=this._readLayer();return{type:t,size:i,ptime:n,dtime:r,keyframe:s,src:u,data:1==t&&this.mediaAttr.aCodec==a.DEF_AAC?this.aacDec.sliceAACFrames(n,u):u,layer:l}}},{key:"_refreshDemuxer",value:function(){this.releaseTsDemuxer(),this._initDemuxer()}},{key:"_initDemuxer",value:function(){Module.cwrap("initTsMissile","number",[])(),Module.cwrap("initializeDemuxer","number",[])()}},{key:"releaseTsDemuxer",value:function(){Module.cwrap("exitTsMissile","number",[])()}}])&&n(i.prototype,s),o&&n(i,o),e}();i.MPEG_JS=s}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./consts":69,"./decoder/aac":70}],72:[function(e,t,i){"use strict";function n(e,t){for(var i=0;i0&&e.extensionInfo.vHeight>0&&(e.size.width=e.extensionInfo.vWidth,e.size.height=e.extensionInfo.vHeight);for(var t=null;!((t=e.mpegTsObj.readPacket()).size<=0);){var i=t.dtime;if(0==t.type){var n=s.PACK_NALU(t.layer),r=1==t.keyframe;e.bufObject.appendFrame(i,n,!0,r)}else if("aac"==e.mediaInfo.aCodec)for(var a=t.data,o=0;o0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;return t<0?null:1==e?this.bufObject.vFrame(t):2==e?this.bufObject.aFrame(t):void 0}},{key:"isHEVC",value:function(){return this.mpegTsObj.isHEVC()}},{key:"getACodec",value:function(){return this.aCodec}},{key:"getVCodec",value:function(){return this.vCodec}},{key:"getAudioNone",value:function(){return this.mpegTsObj.mediaAttr.audioNone}},{key:"getDurationMs",value:function(){return this.durationMs}},{key:"getFPS",value:function(){return this.fps}},{key:"getSampleRate",value:function(){return this.sampleRate}},{key:"getSize",value:function(){return this.size}},{key:"seek",value:function(e){if(e>=0){var t=this.bufObject.seekIDR(e);this.seekPos=t}}}])&&n(t.prototype,i),o&&n(t,o),e}();i.MpegTs=o},{"../decoder/hevc-imp":62,"./buffer":64,"./mpegts/mpeg.js":71}],73:[function(e,t,i){(function(t){"use strict";function n(e,t){for(var i=0;i0&&void 0!==arguments[0]&&arguments[0];return void 0!==this.player&&null!==this.player&&(this.player.setScreen(e),!0)}},{key:"play",value:function(){if(void 0===this.player||null===this.player)return!1;if(this.playParam.videoCodec===m.CODEC_H265){var e={seekPos:this._getSeekTarget(),mode:this.playMode,accurateSeek:this.configFormat.accurateSeek,seekEvent:!1,realPlay:!0};this.player.play(e)}else this.player.play();return!0}},{key:"pause",value:function(){return void 0!==this.player&&null!==this.player&&(this.player.pause(),!0)}},{key:"isPlaying",value:function(){return void 0!==this.player&&null!==this.player&&this.player.isPlayingState()}},{key:"setVoice",value:function(e){return!(e<0||void 0===this.player||null===this.player||(this.volume=e,this.player&&this.player.setVoice(e),0))}},{key:"getVolume",value:function(){return this.volume}},{key:"mediaInfo",value:function(){var e={meta:this.playParam,videoType:this.playMode};return e.meta.isHEVC=0===this.playParam.videoCodec,e}},{key:"_seekHLS",value:function(e,t,i){if(void 0===this.player||null===this.player)return!1;setTimeout((function(){t.player.getCachePTS(),t.player.getCachePTS()>e?i():t._seekHLS(e,t,i)}),100)}},{key:"seek",value:function(e){if(void 0===this.player||null===this.player)return!1;var t=this;this.seekTarget=e,this.onSeekStart&&this.onSeekStart(e),this.timerFeed&&(window.clearInterval(this.timerFeed),this.timerFeed=null);var i=this._getSeekTarget();return this.playParam.videoCodec===m.CODEC_H264?(this.player.seek(e),this.onSeekFinish&&this.onSeekFinish()):this.configFormat.extInfo.core===m.PLAYER_CORE_TYPE_CNATIVE?(this.pause(),this._seekHLS(e,this,(function(){t.player.seek((function(){}),{seekTime:i,mode:t.playMode,accurateSeek:t.configFormat.accurateSeek})}))):this._seekHLS(e,this,(function(){t.player.seek((function(){t.configFormat.type==m.PLAYER_IN_TYPE_MP4?t.mp4Obj.seek(e):t.configFormat.type==m.PLAYER_IN_TYPE_TS||t.configFormat.type==m.PLAYER_IN_TYPE_MPEGTS?t.mpegTsObj.seek(e):t.configFormat.type==m.PLAYER_IN_TYPE_M3U8&&(t.hlsObj.onSamples=null,t.hlsObj.seek(e));var i,n=(i=0,i=t.configFormat.accurateSeek?e:t._getBoxBufSeekIDR(),parseInt(i)),r=parseInt(t._getBoxBufSeekIDR())||0;t._avFeedMP4Data(r,n)}),{seekTime:i,mode:t.playMode,accurateSeek:t.configFormat.accurateSeek})})),!0}},{key:"fullScreen",value:function(){if(this.autoScreenClose=!0,this.player.vCodecID===m.V_CODEC_NAME_HEVC){var e=document.querySelector("#"+this.configFormat.playerId),t=e.getElementsByTagName("canvas")[0];e.style.width=this.screenW+"px",e.style.height=this.screenH+"px";var i=this._checkScreenDisplaySize(this.screenW,this.screenH,this.playParam.size.width,this.playParam.size.height);t.style.marginTop=i[0]+"px",t.style.marginLeft=i[1]+"px",t.style.width=i[2]+"px",t.style.height=i[3]+"px",this._requestFullScreen(e)}else this._requestFullScreen(this.player.videoTag)}},{key:"closeFullScreen",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!1===e&&(this.autoScreenClose=!1,this._exitFull()),this.player.vCodecID===m.V_CODEC_NAME_HEVC){var t=document.querySelector("#"+this.configFormat.playerId),i=t.getElementsByTagName("canvas")[0];t.style.width=this.configFormat.playerW+"px",t.style.height=this.configFormat.playerH+"px";var n=this._checkScreenDisplaySize(this.configFormat.playerW,this.configFormat.playerH,this.playParam.size.width,this.playParam.size.height);i.style.marginTop=n[0]+"px",i.style.marginLeft=n[1]+"px",i.style.width=n[2]+"px",i.style.height=n[3]+"px"}}},{key:"_checkScreenDisplaySize",value:function(e,t,i,n){var r=i/e>n/t,a=(e/i).toFixed(2),s=(t/n).toFixed(2),o=r?a:s,u=this.fixed?e:parseInt(i*o),l=this.fixed?t:parseInt(n*o);return[parseInt((t-l)/2),parseInt((e-u)/2),u,l]}},{key:"_isFullScreen",value:function(){var e=document.fullscreenElement||document.mozFullscreenElement||document.webkitFullscreenElement;return document.fullscreenEnabled||document.mozFullscreenEnabled||document.webkitFullscreenEnabled,null!=e}},{key:"_requestFullScreen",value:function(e){e.requestFullscreen?e.requestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.msRequestFullscreen?e.msRequestFullscreen():e.webkitRequestFullscreen&&e.webkitRequestFullScreen()}},{key:"_exitFull",value:function(){document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.msExitFullscreen&&document.msExitFullscreen()}},{key:"_durationText",value:function(e){if(e<0)return"Play";var t=Math.round(e);return Math.floor(t/3600)+":"+Math.floor(t%3600/60)+":"+Math.floor(t%60)}},{key:"_getSeekTarget",value:function(){return this.configFormat.accurateSeek?this.seekTarget:this._getBoxBufSeekIDR()}},{key:"_getBoxBufSeekIDR",value:function(){return this.configFormat.type==m.PLAYER_IN_TYPE_MP4?this.mp4Obj.seekPos:this.configFormat.type==m.PLAYER_IN_TYPE_TS||this.configFormat.type==m.PLAYER_IN_TYPE_MPEGTS?this.mpegTsObj.seekPos:this.configFormat.type==m.PLAYER_IN_TYPE_M3U8?this.hlsObj.seekPos:void 0}},{key:"_playControl",value:function(){this.isPlaying()?this.pause():this.play()}},{key:"_avFeedMP4Data",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(void 0===this.player||null===this.player)return!1;var r=parseInt(this.playParam.durationMs/1e3);this.player.clearAllCache(),this.timerFeed=window.setInterval((function(){var a=null,s=null,o=!0,u=!0;if(e.configFormat.type==m.PLAYER_IN_TYPE_MP4?(a=e.mp4Obj.popBuffer(1,t),s=e.mp4Obj.audioNone?null:e.mp4Obj.popBuffer(2,i)):e.configFormat.type==m.PLAYER_IN_TYPE_TS||e.configFormat.type==m.PLAYER_IN_TYPE_MPEGTS?(a=e.mpegTsObj.popBuffer(1,t),s=e.mpegTsObj.getAudioNone()?null:e.mpegTsObj.popBuffer(2,i)):e.configFormat.type==m.PLAYER_IN_TYPE_M3U8&&(a=e.hlsObj.popBuffer(1,t),s=e.hlsObj.audioNone?null:e.hlsObj.popBuffer(2,i),t=e.hlsObj.getLastIdx()&&(o=!1),i=e.hlsObj.getALastIdx()&&(u=!1)),!0===o&&null!=a)for(var l=0;lr)return window.clearInterval(e.timerFeed),e.timerFeed=null,e.player.vCachePTS,e.player.aCachePTS,void(null!=n&&n())}),5)}},{key:"_makeMP4Player",value:function(){return this.mediaExtProtocol===m.URI_PROTOCOL_WEBSOCKET_DESC?(this._cWsFLVDecoderEntry(),0):(null!=this.configFormat.extInfo.core&&null!==this.configFormat.extInfo.core&&this.configFormat.extInfo.core===m.PLAYER_CORE_TYPE_CNATIVE?this._cDemuxDecoderEntry():this.configFormat.type==m.PLAYER_IN_TYPE_MP4?this.configFormat.extInfo.moovStartFlag?this._mp4EntryVodStream():this._mp4Entry():this.configFormat.type==m.PLAYER_IN_TYPE_TS||this.configFormat.type==m.PLAYER_IN_TYPE_MPEGTS?this._mpegTsEntry():this.configFormat.type==m.PLAYER_IN_TYPE_M3U8?this._m3u8Entry():this.configFormat.type===m.PLAYER_IN_TYPE_RAW_265&&this._raw265Entry(),0)}},{key:"_makeMP4PlayerViewEvent",value:function(e,t,i,n){var a=this,s=arguments.length>4&&void 0!==arguments[4]&&arguments[4],o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null,u=this;if(this.playParam.durationMs=e,this.playParam.fps=t,this.playParam.sampleRate=i,this.playParam.size=n,this.playParam.audioNone=s,this.playParam.videoCodec=o||m.CODEC_H265,this.playParam,(this.configFormat.type==m.PLAYER_IN_TYPE_M3U8&&this.hlsConf.hlsType==m.PLAYER_IN_TYPE_M3U8_LIVE||this.configFormat.type==m.PLAYER_IN_TYPE_RAW_265)&&(this.playMode=m.PLAYER_MODE_NOTIME_LIVE),u.configFormat.extInfo.autoCrop){var l=document.querySelector("#"+this.configFormat.playerId),d=n.width/n.height,h=this.configFormat.playerW/this.configFormat.playerH;d>h?l.style.height=this.configFormat.playerW/d+"px":d=m.FETCH_FIRST_MAX_TIMES)return;i=new AbortController,n=i.signal,e(s+1)}}),m.FETCH_HTTP_FLV_TIMEOUT_MS),fetch(t.videoURL,{signal:n}).then((function(e){if(a=!0,e.headers.has("Content-Length"))o=e.headers.get("Content-Length"),t.player&&t.player.setProbeSize(o*t.configFormat.extInfo.coreProbePart);else{if(t.mediaExtFormat===m.PLAYER_IN_TYPE_FLV)return i.abort(),t.player.release(),t.player=null,t._cLiveFLVDecoderEntry(r),!0;t.player&&t.player.setProbeSize(4096)}return e.headers.get("Content-Length"),t.configFormat.type,t.mediaExtFormat,function e(i){return i.read().then((function(n){if(!n.done){n.value.buffer;var r=new Uint8Array(n.value.buffer);return t.player&&t.player.pushBuffer(r)<0?(t.player.release(),t.player=null,t._mp4EntryVodStream(),!1):e(i)}t.player&&t.player.pushDone()}))}(e.body.getReader())})).catch((function(e){e.toString().includes("user aborted")||console.error("cdemuxdecoder error",e)}))}(0)}},{key:"_cLiveFLVDecoderEntry",value:function(e){var t=this,i=this;e.probeSize=this.configFormat.extInfo.probeSize,this.player=new o.CHttpLiveCore(e),e.probeSize,this.player.onProbeFinish=function(){i.playParam.fps=i.player.mediaInfo.fps,i.playParam.durationMs=-1,i.playMode=m.PLAYER_MODE_NOTIME_LIVE,i.playParam.sampleRate=i.player.mediaInfo.sampleRate,i.playParam.size={width:i.player.mediaInfo.width,height:i.player.mediaInfo.height},i.playParam.audioNone=i.player.mediaInfo.audioNone,i.player.mediaInfo,i.player.vCodecID===m.V_CODEC_NAME_HEVC?(i.playParam.audioIdx<0&&(i.playParam.audioNone=!0),i.playParam.videoCodec=m.CODEC_H265,i.onLoadFinish&&i.onLoadFinish()):(i.playParam.videoCodec=m.CODEC_H264,i.player.release(),i.player=null,i._flvJsPlayer())},this.player.onNetworkError=function(e){i.onNetworkError&&i.onNetworkError(e)},this.player.onReadyShowDone=function(){i.configFormat.extInfo.readyShow=!1,i.onReadyShowDone&&i.onReadyShowDone()},this.player.onLoadCache=function(){null!=t.onLoadCache&&t.onLoadCache()},this.player.onLoadCacheFinshed=function(){null!=t.onLoadCacheFinshed&&t.onLoadCacheFinshed()},this.player.start(this.videoURL)}},{key:"_cWsFLVDecoderEntry",value:function(){var e=this,t=this,i={width:this.configFormat.playerW,height:this.configFormat.playerH,playerId:this.configFormat.playerId,token:this.configFormat.token,readyShow:this.configFormat.extInfo.readyShow,checkProbe:this.configFormat.extInfo.checkProbe,ignoreAudio:this.configFormat.extInfo.ignoreAudio,playMode:this.playMode};i.probeSize=this.configFormat.extInfo.probeSize,this.player=new u.CWsLiveCore(i),i.probeSize,this.player.onProbeFinish=function(){t.playParam.fps=t.player.mediaInfo.fps,t.playParam.durationMs=-1,t.playMode=m.PLAYER_MODE_NOTIME_LIVE,t.playParam.sampleRate=t.player.mediaInfo.sampleRate,t.playParam.size={width:t.player.mediaInfo.width,height:t.player.mediaInfo.height},t.playParam.audioNone=t.player.mediaInfo.audioNone,t.player.mediaInfo,t.player.vCodecID===m.V_CODEC_NAME_HEVC?(t.playParam.audioIdx<0&&(t.playParam.audioNone=!0),t.playParam.videoCodec=m.CODEC_H265,t.onLoadFinish&&t.onLoadFinish()):(t.playParam.videoCodec=m.CODEC_H264,t.player.release(),t.player=null,t._flvJsPlayer())},this.player.onNetworkError=function(e){t.onNetworkError&&t.onNetworkError(e)},this.player.onReadyShowDone=function(){t.configFormat.extInfo.readyShow=!1,t.onReadyShowDone&&t.onReadyShowDone()},this.player.onLoadCache=function(){null!=e.onLoadCache&&e.onLoadCache()},this.player.onLoadCacheFinshed=function(){null!=e.onLoadCacheFinshed&&e.onLoadCacheFinshed()},this.player.start(this.videoURL)}},{key:"_mpegTsEntry",value:function(){var e=this,t=new AbortController,i=t.signal;this.timerFeed=null,this.mpegTsObj=new f.MpegTs,this.mpegTsObj.bindReady(e),this.mpegTsObj.onDemuxed=this._mpegTsEntryReady.bind(this),this.mpegTsObj.onReady=function(){var n=null;fetch(e.videoURL,{signal:i}).then((function(r){if(r.headers.has("Content-Length"))return function t(i){return i.read().then((function(r){if(!r.done){var a=r.value;if(null===n)n=a;else{var s=a,o=n.length+s.length,u=new Uint8Array(o);u.set(n),u.set(s,n.length),n=new Uint8Array(u),s=null,u=null}return t(i)}e.mpegTsObj.demux(n)}))}(r.body.getReader());t.abort(),i=null,t=null;var a={width:e.configFormat.playerW,height:e.configFormat.playerH,playerId:e.configFormat.playerId,token:e.configFormat.token,readyShow:e.configFormat.extInfo.readyShow,checkProbe:e.configFormat.extInfo.checkProbe,ignoreAudio:e.configFormat.extInfo.ignoreAudio,playMode:e.playMode};e._cLiveFLVDecoderEntry(a)})).catch((function(e){if(!e.toString().includes("user aborted")){var t=" mpegts request error:"+e;console.error(t)}}))},this.mpegTsObj.initMPEG()}},{key:"_mpegTsEntryReady",value:function(e){var t=e,i=(t.mpegTsObj.getVCodec(),t.mpegTsObj.getACodec()),n=t.mpegTsObj.getDurationMs(),r=t.mpegTsObj.getFPS(),a=t.mpegTsObj.getSampleRate(),s=t.mpegTsObj.getSize(),o=this.mpegTsObj.isHEVC();if(!o)return this.mpegTsObj.releaseTsDemuxer(),this.mpegTsObj=null,this.playParam.durationMs=n,this.playParam.fps=r,this.playParam.sampleRate=a,this.playParam.size=s,this.playParam.audioNone=""==i,this.playParam.videoCodec=o?0:1,this.playParam,void(this.onLoadFinish&&this.onLoadFinish());t._makeMP4PlayerViewEvent(n,r,a,s,""==i),parseInt(n/1e3),t._avFeedMP4Data(0,0)}},{key:"_m3u8Entry",value:function(){var e=this,t=this,i=!1,n=0;this.hlsObj=new p.M3u8,this.hlsObj.bindReady(t),this.hlsObj.onFinished=function(e,r){0==i&&(n=t.hlsObj.getDurationMs(),t.hlsConf.hlsType=r.type,i=!0)},this.hlsObj.onCacheProcess=function(t){e.playMode!==m.PLAYER_MODE_NOTIME_LIVE&&e.onCacheProcess&&e.onCacheProcess(t)},this.hlsObj.onDemuxed=function(e){if(null==t.player){var i=t.hlsObj.isHevcParam,r=(t.hlsObj.getVCodec(),t.hlsObj.getACodec()),a=t.hlsObj.getFPS(),s=t.hlsObj.getSampleRate(),o=t.hlsObj.getSize(),u=!1;if(u=t.hlsObj.getSampleChannel()<=0||""===r,!i)return t.hlsObj.release(),t.hlsObj.mpegTsObj&&t.hlsObj.mpegTsObj.releaseTsDemuxer(),t.hlsObj=null,t.playParam.durationMs=-1,t.playParam.fps=a,t.playParam.sampleRate=s,t.playParam.size=o,t.playParam.audioNone=""==r,t.playParam.videoCodec=i?0:1,t.playParam,void t._videoJsPlayer();t._makeMP4PlayerViewEvent(n,a,s,o,u)}},this.hlsObj.onSamples=this._hlsOnSamples.bind(this),this.hlsObj.demux(this.videoURL)}},{key:"_hlsOnSamples",value:function(e,t){1==t.video?this.player.appendHevcFrame(t):!1===this.hlsObj.audioNone&&this.player.appendAACFrame(t)}},{key:"_videoJsPlayer",value:function(){var e=this,t={width:this.configFormat.playerW,height:this.configFormat.playerH,playerId:this.configFormat.playerId,ignoreAudio:this.configFormat.extInfo.ignoreAudio};this.player=new l.NvVideojsCore(t),this.player.onMakeItReady=function(){e.onMakeItReady&&e.onMakeItReady()},this.player.onLoadFinish=function(){e.playParam.size=e.player.getSize(),e.player.duration===1/0||e.player.duration<0?(e.playParam.durationMs=-1,e.playMode=m.PLAYER_MODE_NOTIME_LIVE):(e.playParam.durationMs=1e3*e.player.duration,e.playMode=m.PLAYER_MODE_VOD),e.onLoadFinish&&e.onLoadFinish()},this.player.onReadyShowDone=function(){e.onReadyShowDone&&e.onReadyShowDone()},this.player.onPlayingFinish=function(){e.pause(),e.seek(0),null!=e.onPlayFinish&&e.onPlayFinish()},this.player.onPlayingTime=function(t){e._durationText(t),e._durationText(e.player.duration),null!=e.onPlayTime&&e.onPlayTime(t)},this.player.onSeekFinish=function(){e.onSeekFinish&&e.onSeekFinish()},this.player.makeIt(this.videoURL)}},{key:"_flvJsPlayer",value:function(){var e=this,t={width:this.configFormat.playerW,height:this.configFormat.playerH,playerId:this.configFormat.playerId,ignoreAudio:this.configFormat.extInfo.ignoreAudio};this.player=new d.NvFlvjsCore(t),this.player.onLoadFinish=function(){e.playParam.size=e.player.getSize(),!e.player.duration||NaN===e.player.duration||e.player.duration===1/0||e.player.duration<0?(e.playParam.durationMs=-1,e.playMode=m.PLAYER_MODE_NOTIME_LIVE):(e.playParam.durationMs=1e3*e.player.duration,e.playMode=m.PLAYER_MODE_VOD),e.onLoadFinish&&e.onLoadFinish()},this.player.onReadyShowDone=function(){e.onReadyShowDone&&e.onReadyShowDone()},this.player.onPlayingTime=function(t){e._durationText(t),e._durationText(e.player.duration),null!=e.onPlayTime&&e.onPlayTime(t)},this.player.onPlayingFinish=function(){e.pause(),e.seek(0),null!=e.onPlayFinish&&e.onPlayFinish()},this.player.makeIt(this.videoURL)}},{key:"_raw265Entry",value:function(){this._makeMP4PlayerViewEvent(-1,this.configFormat.extInfo.rawFps,-1,{width:this.configFormat.playerW,height:this.configFormat.playerH},!0,m.CODEC_H265),this.timerFeed&&(window.clearInterval(this.timerFeed),this.timerFeed=null)}},{key:"append265NaluFrame",value:function(e){var t={data:e,pts:this.rawModePts};this.player.appendHevcFrame(t),this.configFormat.extInfo.readyShow&&this.player.cacheYuvBuf.getState()!=CACHE_APPEND_STATUS_CODE.NULL&&(this.player.playFrameYUV(!0,!0),this.configFormat.extInfo.readyShow=!1,this.onReadyShowDone&&this.onReadyShowDone()),this.rawModePts+=1/this.configFormat.extInfo.rawFps}}])&&n(i.prototype,v),b&&n(i,b),e}();i.H265webjs=v,t.new265webjs=function(e,t){return new v(e,t)}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./consts":52,"./decoder/av-common":55,"./decoder/c-httplive-core":56,"./decoder/c-native-core":57,"./decoder/c-wslive-core":58,"./decoder/cache":59,"./decoder/player-core":63,"./demuxer/m3u8":66,"./demuxer/mp4":68,"./demuxer/mpegts/mpeg.js":71,"./demuxer/ts":72,"./native/mp4-player":74,"./native/nv-flvjs-core":75,"./native/nv-videojs-core":76,"./utils/static-mem":78,"./utils/ui/ui":79}],74:[function(e,t,i){"use strict";function n(e,t){for(var i=0;i>1,a>>1,i),e.v.fill(r>>1,a>>1,n),e.drawArrays(e.TRIANGLE_STRIP,0,4)},setupCanvas:function(e,t){var i=e.getContext("webgl")||e.getContext("experimental-webgl");if(!i)return i;var r=i.createProgram(),a=["attribute highp vec4 aVertexPosition;","attribute vec2 aTextureCoord;","varying highp vec2 vTextureCoord;","void main(void) {"," gl_Position = aVertexPosition;"," vTextureCoord = aTextureCoord;","}"].join("\n"),s=i.createShader(i.VERTEX_SHADER);i.shaderSource(s,a),i.compileShader(s);var o=["precision highp float;","varying lowp vec2 vTextureCoord;","uniform sampler2D YTexture;","uniform sampler2D UTexture;","uniform sampler2D VTexture;","const mat4 YUV2RGB = mat4","("," 1.1643828125, 0, 1.59602734375, -.87078515625,"," 1.1643828125, -.39176171875, -.81296875, .52959375,"," 1.1643828125, 2.017234375, 0, -1.081390625,"," 0, 0, 0, 1",");","void main(void) {"," gl_FragColor = vec4( texture2D(YTexture, vTextureCoord).x, texture2D(UTexture, vTextureCoord).x, texture2D(VTexture, vTextureCoord).x, 1) * YUV2RGB;","}"].join("\n"),u=i.createShader(i.FRAGMENT_SHADER);i.shaderSource(u,o),i.compileShader(u),i.attachShader(r,s),i.attachShader(r,u),i.linkProgram(r),i.useProgram(r),i.getProgramParameter(r,i.LINK_STATUS);var l=i.getAttribLocation(r,"aVertexPosition");i.enableVertexAttribArray(l);var d=i.getAttribLocation(r,"aTextureCoord");i.enableVertexAttribArray(d);var h=i.createBuffer();i.bindBuffer(i.ARRAY_BUFFER,h),i.bufferData(i.ARRAY_BUFFER,new Float32Array([1,1,0,-1,1,0,1,-1,0,-1,-1,0]),i.STATIC_DRAW),i.vertexAttribPointer(l,3,i.FLOAT,!1,0,0);var c=i.createBuffer();return i.bindBuffer(i.ARRAY_BUFFER,c),i.bufferData(i.ARRAY_BUFFER,new Float32Array([1,0,0,0,1,1,0,1]),i.STATIC_DRAW),i.vertexAttribPointer(d,2,i.FLOAT,!1,0,0),i.y=new n(i),i.u=new n(i),i.v=new n(i),i.y.bind(0,r,"YTexture"),i.u.bind(1,r,"UTexture"),i.v.bind(2,r,"VTexture"),i}}},{}],78:[function(e,t,i){(function(e){"use strict";e.STATIC_MEM_wasmDecoderState=-1,e.STATICE_MEM_playerCount=-1,e.STATICE_MEM_playerIndexPtr=0}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],79:[function(e,t,i){"use strict";function n(e,t){for(var i=0;i>2),m=new s(Array.prototype.slice.call(t)),g=new Uint8Array(e.byteLength),_=new Int32Array(g.buffer);for(n=i[0],r=i[1],a=i[2],o=i[3],f=0;f=0&&(t="main-desc"),t},Io=function(e,t){e.abort(),e.pause(),t&&t.activePlaylistLoader&&(t.activePlaylistLoader.pause(),t.activePlaylistLoader=null)},Po=function(e,t){t.activePlaylistLoader=e,e.load()},Lo={AUDIO:function(e,t){return function(){var i=t.segmentLoaders[e],n=t.mediaTypes[e],r=t.blacklistCurrentPlaylist;Io(i,n);var a=n.activeTrack(),s=n.activeGroup(),o=(s.filter((function(e){return e.default}))[0]||s[0]).id,u=n.tracks[o];if(a!==u){for(var l in Yr.log.warn("Problem encountered loading the alternate audio track.Switching back to default."),n.tracks)n.tracks[l].enabled=n.tracks[l]===u;n.onTrackChanged()}else r({message:"Problem encountered loading the default audio track."})}},SUBTITLES:function(e,t){return function(){var i=t.segmentLoaders[e],n=t.mediaTypes[e];Yr.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track."),Io(i,n);var r=n.activeTrack();r&&(r.mode="disabled"),n.onTrackChanged()}}},Do={AUDIO:function(e,t,i){if(t){var n=i.tech,r=i.requestOptions,a=i.segmentLoaders[e];t.on("loadedmetadata",(function(){var e=t.media();a.playlist(e,r),(!n.paused()||e.endList&&"none"!==n.preload())&&a.load()})),t.on("loadedplaylist",(function(){a.playlist(t.media(),r),n.paused()||a.load()})),t.on("error",Lo[e](e,i))}},SUBTITLES:function(e,t,i){var n=i.tech,r=i.requestOptions,a=i.segmentLoaders[e],s=i.mediaTypes[e];t.on("loadedmetadata",(function(){var e=t.media();a.playlist(e,r),a.track(s.activeTrack()),(!n.paused()||e.endList&&"none"!==n.preload())&&a.load()})),t.on("loadedplaylist",(function(){a.playlist(t.media(),r),n.paused()||a.load()})),t.on("error",Lo[e](e,i))}},Uo={AUDIO:function(e,t){var i=t.vhs,n=t.sourceType,r=t.segmentLoaders[e],a=t.requestOptions,s=t.master.mediaGroups,o=t.mediaTypes[e],u=o.groups,l=o.tracks,d=o.logger_,h=t.masterPlaylistLoader,c=ba(h.master);for(var f in s[e]&&0!==Object.keys(s[e]).length||(s[e]={main:{default:{default:!0}}},c&&(s[e].main.default.playlists=h.master.playlists)),s[e])for(var p in u[f]||(u[f]=[]),s[e][f]){var m=s[e][f][p],g=void 0;if(c?(d("AUDIO group '"+f+"' label '"+p+"' is a master playlist"),m.isMasterPlaylist=!0,g=null):g="vhs-json"===n&&m.playlists?new Oa(m.playlists[0],i,a):m.resolvedUri?new Oa(m.resolvedUri,i,a):m.playlists&&"dash"===n?new is(m.playlists[0],i,a,h):null,m=Yr.mergeOptions({id:p,playlistLoader:g},m),Do[e](e,m.playlistLoader,t),u[f].push(m),void 0===l[p]){var _=new Yr.AudioTrack({id:p,kind:xo(m),enabled:!1,language:m.language,default:m.default,label:p});l[p]=_}}r.on("error",Lo[e](e,t))},SUBTITLES:function(e,t){var i=t.tech,n=t.vhs,r=t.sourceType,a=t.segmentLoaders[e],s=t.requestOptions,o=t.master.mediaGroups,u=t.mediaTypes[e],l=u.groups,d=u.tracks,h=t.masterPlaylistLoader;for(var c in o[e])for(var f in l[c]||(l[c]=[]),o[e][c])if(!o[e][c][f].forced){var p=o[e][c][f],m=void 0;if("hls"===r)m=new Oa(p.resolvedUri,n,s);else if("dash"===r){if(!p.playlists.filter((function(e){return e.excludeUntil!==1/0})).length)return;m=new is(p.playlists[0],n,s,h)}else"vhs-json"===r&&(m=new Oa(p.playlists?p.playlists[0]:p.resolvedUri,n,s));if(p=Yr.mergeOptions({id:f,playlistLoader:m},p),Do[e](e,p.playlistLoader,t),l[c].push(p),void 0===d[f]){var g=i.addRemoteTextTrack({id:f,kind:"subtitles",default:p.default&&p.autoselect,language:p.language,label:f},!1).track;d[f]=g}}a.on("error",Lo[e](e,t))},"CLOSED-CAPTIONS":function(e,t){var i=t.tech,n=t.master.mediaGroups,r=t.mediaTypes[e],a=r.groups,s=r.tracks;for(var o in n[e])for(var u in a[o]||(a[o]=[]),n[e][o]){var l=n[e][o][u];if(/^(?:CC|SERVICE)/.test(l.instreamId)){var d=i.options_.vhs&&i.options_.vhs.captionServices||{},h={label:u,language:l.language,instreamId:l.instreamId,default:l.default&&l.autoselect};if(d[h.instreamId]&&(h=Yr.mergeOptions(h,d[h.instreamId])),void 0===h.default&&delete h.default,a[o].push(Yr.mergeOptions({id:u},l)),void 0===s[u]){var c=i.addRemoteTextTrack({id:h.instreamId,kind:"captions",default:h.default,language:h.language,label:h.label},!1).track;s[u]=c}}}}},Ro=function e(t,i){for(var n=0;n1&&ba(t.master))for(var u=0;u "+a+" from "+t),this.tech_.trigger({type:"usage",name:"vhs-rendition-change-"+t})),this.masterPlaylistLoader_.media(e,i)},i.startABRTimer_=function(){var e=this;this.stopABRTimer_(),this.abrTimer_=A.default.setInterval((function(){return e.checkABR_()}),250)},i.stopABRTimer_=function(){this.tech_.scrubbing&&this.tech_.scrubbing()||(A.default.clearInterval(this.abrTimer_),this.abrTimer_=null)},i.getAudioTrackPlaylists_=function(){var e=this.master(),t=e&&e.playlists||[];if(!e||!e.mediaGroups||!e.mediaGroups.AUDIO)return t;var i,n=e.mediaGroups.AUDIO,r=Object.keys(n);if(Object.keys(this.mediaTypes_.AUDIO.groups).length)i=this.mediaTypes_.AUDIO.activeTrack();else{var a=n.main||r.length&&n[r[0]];for(var s in a)if(a[s].default){i={label:s};break}}if(!i)return t;var o=[];for(var u in n)if(n[u][i.label]){var l=n[u][i.label];if(l.playlists&&l.playlists.length)o.push.apply(o,l.playlists);else if(l.uri)o.push(l);else if(e.playlists.length)for(var d=0;d1&&(this.tech_.trigger({type:"usage",name:"vhs-alternate-audio"}),this.tech_.trigger({type:"usage",name:"hls-alternate-audio"})),this.useCueTags_&&(this.tech_.trigger({type:"usage",name:"vhs-playlist-cue-tags"}),this.tech_.trigger({type:"usage",name:"hls-playlist-cue-tags"}))},i.shouldSwitchToMedia_=function(e){var t=this.masterPlaylistLoader_.media(),i=this.tech_.buffered();return function(e){var t=e.currentPlaylist,i=e.nextPlaylist,n=e.forwardBuffer,r=e.bufferLowWaterLine,a=e.bufferHighWaterLine,s=e.duration,o=e.experimentalBufferBasedABR,u=e.log;if(!i)return Yr.log.warn("We received no playlist to switch to. Please check your stream."),!1;var l="allowing switch "+(t&&t.id||"null")+" -> "+i.id;if(!t)return u(l+" as current playlist is not set"),!0;if(i.id===t.id)return!1;if(!t.endList)return u(l+" as current playlist is live"),!0;var d=o?ns.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:ns.MAX_BUFFER_LOW_WATER_LINE;if(sc)&&n>=r){var p=l+" as forwardBuffer >= bufferLowWaterLine ("+n+" >= "+r+")";return o&&(p+=" and next bandwidth > current bandwidth ("+h+" > "+c+")"),u(p),!0}return u("not "+l+" as no switching criteria met"),!1}({currentPlaylist:t,nextPlaylist:e,forwardBuffer:i.length?i.end(i.length-1)-this.tech_.currentTime():0,bufferLowWaterLine:this.bufferLowWaterLine(),bufferHighWaterLine:this.bufferHighWaterLine(),duration:this.duration(),experimentalBufferBasedABR:this.experimentalBufferBasedABR,log:this.logger_})},i.setupSegmentLoaderListeners_=function(){var e=this;this.experimentalBufferBasedABR||(this.mainSegmentLoader_.on("bandwidthupdate",(function(){var t=e.selectPlaylist();e.shouldSwitchToMedia_(t)&&e.switchMedia_(t,"bandwidthupdate"),e.tech_.trigger("bandwidthupdate")})),this.mainSegmentLoader_.on("progress",(function(){e.trigger("progress")}))),this.mainSegmentLoader_.on("error",(function(){e.blacklistCurrentPlaylist(e.mainSegmentLoader_.error())})),this.mainSegmentLoader_.on("appenderror",(function(){e.error=e.mainSegmentLoader_.error_,e.trigger("error")})),this.mainSegmentLoader_.on("syncinfoupdate",(function(){e.onSyncInfoUpdate_()})),this.mainSegmentLoader_.on("timestampoffset",(function(){e.tech_.trigger({type:"usage",name:"vhs-timestamp-offset"}),e.tech_.trigger({type:"usage",name:"hls-timestamp-offset"})})),this.audioSegmentLoader_.on("syncinfoupdate",(function(){e.onSyncInfoUpdate_()})),this.audioSegmentLoader_.on("appenderror",(function(){e.error=e.audioSegmentLoader_.error_,e.trigger("error")})),this.mainSegmentLoader_.on("ended",(function(){e.logger_("main segment loader ended"),e.onEndOfStream()})),this.mainSegmentLoader_.on("earlyabort",(function(t){e.experimentalBufferBasedABR||(e.delegateLoaders_("all",["abort"]),e.blacklistCurrentPlaylist({message:"Aborted early because there isn't enough bandwidth to complete the request without rebuffering."},120))}));var t=function(){if(!e.sourceUpdater_.hasCreatedSourceBuffers())return e.tryToCreateSourceBuffers_();var t=e.getCodecsOrExclude_();t&&e.sourceUpdater_.addOrChangeSourceBuffers(t)};this.mainSegmentLoader_.on("trackinfo",t),this.audioSegmentLoader_.on("trackinfo",t),this.mainSegmentLoader_.on("fmp4",(function(){e.triggeredFmp4Usage||(e.tech_.trigger({type:"usage",name:"vhs-fmp4"}),e.tech_.trigger({type:"usage",name:"hls-fmp4"}),e.triggeredFmp4Usage=!0)})),this.audioSegmentLoader_.on("fmp4",(function(){e.triggeredFmp4Usage||(e.tech_.trigger({type:"usage",name:"vhs-fmp4"}),e.tech_.trigger({type:"usage",name:"hls-fmp4"}),e.triggeredFmp4Usage=!0)})),this.audioSegmentLoader_.on("ended",(function(){e.logger_("audioSegmentLoader ended"),e.onEndOfStream()}))},i.mediaSecondsLoaded_=function(){return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded+this.mainSegmentLoader_.mediaSecondsLoaded)},i.load=function(){this.mainSegmentLoader_.load(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.load(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.load()},i.smoothQualityChange_=function(e){void 0===e&&(e=this.selectPlaylist()),this.fastQualityChange_(e)},i.fastQualityChange_=function(e){var t=this;void 0===e&&(e=this.selectPlaylist()),e!==this.masterPlaylistLoader_.media()?(this.switchMedia_(e,"fast-quality"),this.mainSegmentLoader_.resetEverything((function(){Yr.browser.IE_VERSION||Yr.browser.IS_EDGE?t.tech_.setCurrentTime(t.tech_.currentTime()+.04):t.tech_.setCurrentTime(t.tech_.currentTime())}))):this.logger_("skipping fastQualityChange because new media is same as old")},i.play=function(){if(!this.setupFirstPlay()){this.tech_.ended()&&this.tech_.setCurrentTime(0),this.hasPlayed_&&this.load();var e=this.tech_.seekable();return this.tech_.duration()===1/0&&this.tech_.currentTime()this.maxPlaylistRetries?1/0:Date.now()+1e3*t,i.excludeUntil=n,e.reason&&(i.lastExcludeReason_=e.reason),this.tech_.trigger("blacklistplaylist"),this.tech_.trigger({type:"usage",name:"vhs-rendition-blacklisted"}),this.tech_.trigger({type:"usage",name:"hls-rendition-blacklisted"});var u=this.selectPlaylist();if(!u)return this.error="Playback cannot continue. No available working or supported playlists.",void this.trigger("error");var l=e.internal?this.logger_:Yr.log.warn,d=e.message?" "+e.message:"";l((e.internal?"Internal problem":"Problem")+" encountered with playlist "+i.id+"."+d+" Switching to playlist "+u.id+"."),u.attributes.AUDIO!==i.attributes.AUDIO&&this.delegateLoaders_("audio",["abort","pause"]),u.attributes.SUBTITLES!==i.attributes.SUBTITLES&&this.delegateLoaders_("subtitle",["abort","pause"]),this.delegateLoaders_("main",["abort","pause"]);var h=u.targetDuration/2*1e3||5e3,c="number"==typeof u.lastRequest&&Date.now()-u.lastRequest<=h;return this.switchMedia_(u,"exclude",s||c)},i.pauseLoading=function(){this.delegateLoaders_("all",["abort","pause"]),this.stopABRTimer_()},i.delegateLoaders_=function(e,t){var i=this,n=[],r="all"===e;(r||"main"===e)&&n.push(this.masterPlaylistLoader_);var a=[];(r||"audio"===e)&&a.push("AUDIO"),(r||"subtitle"===e)&&(a.push("CLOSED-CAPTIONS"),a.push("SUBTITLES")),a.forEach((function(e){var t=i.mediaTypes_[e]&&i.mediaTypes_[e].activePlaylistLoader;t&&n.push(t)})),["main","audio","subtitle"].forEach((function(t){var r=i[t+"SegmentLoader_"];!r||e!==t&&"all"!==e||n.push(r)})),n.forEach((function(e){return t.forEach((function(t){"function"==typeof e[t]&&e[t]()}))}))},i.setCurrentTime=function(e){var t=Zr(this.tech_.buffered(),e);return this.masterPlaylistLoader_&&this.masterPlaylistLoader_.media()&&this.masterPlaylistLoader_.media().segments?t&&t.length?e:(this.mainSegmentLoader_.resetEverything(),this.mainSegmentLoader_.abort(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.resetEverything(),this.audioSegmentLoader_.abort()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.resetEverything(),this.subtitleSegmentLoader_.abort()),void this.load()):0},i.duration=function(){if(!this.masterPlaylistLoader_)return 0;var e=this.masterPlaylistLoader_.media();return e?e.endList?this.mediaSource?this.mediaSource.duration:Zs.Playlist.duration(e):1/0:0},i.seekable=function(){return this.seekable_},i.onSyncInfoUpdate_=function(){var e;if(this.masterPlaylistLoader_){var t=this.masterPlaylistLoader_.media();if(t){var i=this.syncController_.getExpiredTime(t,this.duration());if(null!==i){var n=this.masterPlaylistLoader_.master,r=Zs.Playlist.seekable(t,i,Zs.Playlist.liveEdgeDelay(n,t));if(0!==r.length){if(this.mediaTypes_.AUDIO.activePlaylistLoader){if(t=this.mediaTypes_.AUDIO.activePlaylistLoader.media(),null===(i=this.syncController_.getExpiredTime(t,this.duration())))return;if(0===(e=Zs.Playlist.seekable(t,i,Zs.Playlist.liveEdgeDelay(n,t))).length)return}var a,s;this.seekable_&&this.seekable_.length&&(a=this.seekable_.end(0),s=this.seekable_.start(0)),e?e.start(0)>r.end(0)||r.start(0)>e.end(0)?this.seekable_=r:this.seekable_=Yr.createTimeRanges([[e.start(0)>r.start(0)?e.start(0):r.start(0),e.end(0)0&&(n=Math.max(n,i.end(i.length-1))),this.mediaSource.duration!==n&&this.sourceUpdater_.setDuration(n)}},i.dispose=function(){var e=this;this.trigger("dispose"),this.decrypter_.terminate(),this.masterPlaylistLoader_.dispose(),this.mainSegmentLoader_.dispose(),this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_),["AUDIO","SUBTITLES"].forEach((function(t){var i=e.mediaTypes_[t].groups;for(var n in i)i[n].forEach((function(e){e.playlistLoader&&e.playlistLoader.dispose()}))})),this.audioSegmentLoader_.dispose(),this.subtitleSegmentLoader_.dispose(),this.sourceUpdater_.dispose(),this.timelineChangeController_.dispose(),this.stopABRTimer_(),this.updateDuration_&&this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.mediaSource.removeEventListener("durationchange",this.handleDurationChange_),this.mediaSource.removeEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.removeEventListener("sourceended",this.handleSourceEnded_),this.off()},i.master=function(){return this.masterPlaylistLoader_.master},i.media=function(){return this.masterPlaylistLoader_.media()||this.initialMedia_},i.areMediaTypesKnown_=function(){var e=!!this.mediaTypes_.AUDIO.activePlaylistLoader,t=!!this.mainSegmentLoader_.getCurrentMediaInfo_(),i=!e||!!this.audioSegmentLoader_.getCurrentMediaInfo_();return!(!t||!i)},i.getCodecsOrExclude_=function(){var e=this,t={main:this.mainSegmentLoader_.getCurrentMediaInfo_()||{},audio:this.audioSegmentLoader_.getCurrentMediaInfo_()||{}};t.video=t.main;var i=Os(this.master(),this.media()),n={},r=!!this.mediaTypes_.AUDIO.activePlaylistLoader;if(t.main.hasVideo&&(n.video=i.video||t.main.videoCodec||g.DEFAULT_VIDEO_CODEC),t.main.isMuxed&&(n.video+=","+(i.audio||t.main.audioCodec||g.DEFAULT_AUDIO_CODEC)),(t.main.hasAudio&&!t.main.isMuxed||t.audio.hasAudio||r)&&(n.audio=i.audio||t.main.audioCodec||t.audio.audioCodec||g.DEFAULT_AUDIO_CODEC,t.audio.isFmp4=t.main.hasAudio&&!t.main.isMuxed?t.main.isFmp4:t.audio.isFmp4),n.audio||n.video){var a,s={};if(["video","audio"].forEach((function(e){if(n.hasOwnProperty(e)&&(r=t[e].isFmp4,o=n[e],!(r?g.browserSupportsCodec(o):g.muxerSupportsCodec(o)))){var i=t[e].isFmp4?"browser":"muxer";s[i]=s[i]||[],s[i].push(n[e]),"audio"===e&&(a=i)}var r,o})),r&&a&&this.media().attributes.AUDIO){var o=this.media().attributes.AUDIO;this.master().playlists.forEach((function(t){(t.attributes&&t.attributes.AUDIO)===o&&t!==e.media()&&(t.excludeUntil=1/0)})),this.logger_("excluding audio group "+o+" as "+a+' does not support codec(s): "'+n.audio+'"')}if(!Object.keys(s).length){if(this.sourceUpdater_.hasCreatedSourceBuffers()&&!this.sourceUpdater_.canChangeType()){var u=[];if(["video","audio"].forEach((function(t){var i=(g.parseCodecs(e.sourceUpdater_.codecs[t]||"")[0]||{}).type,r=(g.parseCodecs(n[t]||"")[0]||{}).type;i&&r&&i.toLowerCase()!==r.toLowerCase()&&u.push('"'+e.sourceUpdater_.codecs[t]+'" -> "'+n[t]+'"')})),u.length)return void this.blacklistCurrentPlaylist({playlist:this.media(),message:"Codec switching not supported: "+u.join(", ")+".",blacklistDuration:1/0,internal:!0})}return n}var l=Object.keys(s).reduce((function(e,t){return e&&(e+=", "),e+=t+' does not support codec(s): "'+s[t].join(",")+'"'}),"")+".";this.blacklistCurrentPlaylist({playlist:this.media(),internal:!0,message:l,blacklistDuration:1/0})}else this.blacklistCurrentPlaylist({playlist:this.media(),message:"Could not determine codecs for playlist.",blacklistDuration:1/0})},i.tryToCreateSourceBuffers_=function(){if("open"===this.mediaSource.readyState&&!this.sourceUpdater_.hasCreatedSourceBuffers()&&this.areMediaTypesKnown_()){var e=this.getCodecsOrExclude_();if(e){this.sourceUpdater_.createSourceBuffers(e);var t=[e.video,e.audio].filter(Boolean).join(",");this.excludeIncompatibleVariants_(t)}}},i.excludeUnsupportedVariants_=function(){var e=this,t=this.master().playlists,i=[];Object.keys(t).forEach((function(n){var r=t[n];if(-1===i.indexOf(r.id)){i.push(r.id);var a=Os(e.master,r),s=[];!a.audio||g.muxerSupportsCodec(a.audio)||g.browserSupportsCodec(a.audio)||s.push("audio codec "+a.audio),!a.video||g.muxerSupportsCodec(a.video)||g.browserSupportsCodec(a.video)||s.push("video codec "+a.video),a.text&&"stpp.ttml.im1t"===a.text&&s.push("text codec "+a.text),s.length&&(r.excludeUntil=1/0,e.logger_("excluding "+r.id+" for unsupported: "+s.join(", ")))}}))},i.excludeIncompatibleVariants_=function(e){var t=this,i=[],n=this.master().playlists,r=Us(g.parseCodecs(e)),a=Rs(r),s=r.video&&g.parseCodecs(r.video)[0]||null,o=r.audio&&g.parseCodecs(r.audio)[0]||null;Object.keys(n).forEach((function(e){var r=n[e];if(-1===i.indexOf(r.id)&&r.excludeUntil!==1/0){i.push(r.id);var u=[],l=Os(t.masterPlaylistLoader_.master,r),d=Rs(l);if(l.audio||l.video){if(d!==a&&u.push('codec count "'+d+'" !== "'+a+'"'),!t.sourceUpdater_.canChangeType()){var h=l.video&&g.parseCodecs(l.video)[0]||null,c=l.audio&&g.parseCodecs(l.audio)[0]||null;h&&s&&h.type.toLowerCase()!==s.type.toLowerCase()&&u.push('video codec "'+h.type+'" !== "'+s.type+'"'),c&&o&&c.type.toLowerCase()!==o.type.toLowerCase()&&u.push('audio codec "'+c.type+'" !== "'+o.type+'"')}u.length&&(r.excludeUntil=1/0,t.logger_("blacklisting "+r.id+": "+u.join(" && ")))}}}))},i.updateAdCues_=function(e){var t=0,i=this.seekable();i.length&&(t=i.start(0)),function(e,t,i){if(void 0===i&&(i=0),e.segments)for(var n,r=i,a=0;a0&&this.logger_("resetting possible stalled download count for "+e+" loader"),this[e+"StalledDownloads_"]=0,this[e+"Buffered_"]=t.buffered_()},t.checkSegmentDownloads_=function(e){var t=this.masterPlaylistController_,i=t[e+"SegmentLoader_"],n=i.buffered_(),r=function(e,t){if(e===t)return!1;if(!e&&t||!t&&e)return!0;if(e.length!==t.length)return!0;for(var i=0;i=t.end(t.length-1)))return this.techWaiting_();this.consecutiveUpdates>=5&&e===this.lastRecordedTime?(this.consecutiveUpdates++,this.waiting_()):e===this.lastRecordedTime?this.consecutiveUpdates++:(this.consecutiveUpdates=0,this.lastRecordedTime=e)}},t.cancelTimer_=function(){this.consecutiveUpdates=0,this.timer_&&(this.logger_("cancelTimer_"),clearTimeout(this.timer_)),this.timer_=null},t.fixesBadSeeks_=function(){if(!this.tech_.seeking())return!1;var e,t=this.seekable(),i=this.tech_.currentTime();this.afterSeekableWindow_(t,i,this.media(),this.allowSeeksWithinUnsafeLiveWindow)&&(e=t.end(t.length-1));if(this.beforeSeekableWindow_(t,i)){var n=t.start(0);e=n+(n===t.end(0)?0:.1)}if(void 0!==e)return this.logger_("Trying to seek outside of seekable at time "+i+" with seekable range "+ta(t)+". Seeking to "+e+"."),this.tech_.setCurrentTime(e),!0;var r=this.tech_.buffered();return!!function(e){var t=e.buffered,i=e.targetDuration,n=e.currentTime;return!!t.length&&(!(t.end(0)-t.start(0)<2*i)&&(!(n>t.start(0))&&t.start(0)-n "+i.end(0)+"]. Attempting to resume playback by seeking to the current time."),this.tech_.trigger({type:"usage",name:"vhs-unknown-waiting"}),void this.tech_.trigger({type:"usage",name:"hls-unknown-waiting"})):void 0}},t.techWaiting_=function(){var e=this.seekable(),t=this.tech_.currentTime();if(this.tech_.seeking()&&this.fixesBadSeeks_())return!0;if(this.tech_.seeking()||null!==this.timer_)return!0;if(this.beforeSeekableWindow_(e,t)){var i=e.end(e.length-1);return this.logger_("Fell out of live window at time "+t+". Seeking to live point (seekable end) "+i),this.cancelTimer_(),this.tech_.setCurrentTime(i),this.tech_.trigger({type:"usage",name:"vhs-live-resync"}),this.tech_.trigger({type:"usage",name:"hls-live-resync"}),!0}var n=this.tech_.vhs.masterPlaylistController_.sourceUpdater_,r=this.tech_.buffered();if(this.videoUnderflow_({audioBuffered:n.audioBuffered(),videoBuffered:n.videoBuffered(),currentTime:t}))return this.cancelTimer_(),this.tech_.setCurrentTime(t),this.tech_.trigger({type:"usage",name:"vhs-video-underflow"}),this.tech_.trigger({type:"usage",name:"hls-video-underflow"}),!0;var a=ea(r,t);if(a.length>0){var s=a.start(0)-t;return this.logger_("Stopped at "+t+", setting timer for "+s+", seeking to "+a.start(0)),this.cancelTimer_(),this.timer_=setTimeout(this.skipTheGap_.bind(this),1e3*s,t),!0}return!1},t.afterSeekableWindow_=function(e,t,i,n){if(void 0===n&&(n=!1),!e.length)return!1;var r=e.end(e.length-1)+.1;return!i.endList&&n&&(r=e.end(e.length-1)+3*i.targetDuration),t>r},t.beforeSeekableWindow_=function(e,t){return!!(e.length&&e.start(0)>0&&t2)return{start:r,end:a}}return null},e}(),zo={errorInterval:30,getSource:function(e){return e(this.tech({IWillNotUseThisInPlugins:!0}).currentSource_||this.currentSource())}},Go=function(e){!function e(t,i){var n=0,r=0,a=Yr.mergeOptions(zo,i);t.ready((function(){t.trigger({type:"usage",name:"vhs-error-reload-initialized"}),t.trigger({type:"usage",name:"hls-error-reload-initialized"})}));var s=function(){r&&t.currentTime(r)},o=function(e){null!=e&&(r=t.duration()!==1/0&&t.currentTime()||0,t.one("loadedmetadata",s),t.src(e),t.trigger({type:"usage",name:"vhs-error-reload"}),t.trigger({type:"usage",name:"hls-error-reload"}),t.play())},u=function(){return Date.now()-n<1e3*a.errorInterval?(t.trigger({type:"usage",name:"vhs-error-reload-canceled"}),void t.trigger({type:"usage",name:"hls-error-reload-canceled"})):a.getSource&&"function"==typeof a.getSource?(n=Date.now(),a.getSource.call(t,o)):void Yr.log.error("ERROR: reloadSourceOnError - The option getSource must be a function!")},l=function e(){t.off("loadedmetadata",s),t.off("error",u),t.off("dispose",e)};t.on("error",u),t.on("dispose",l),t.reloadSourceOnError=function(i){l(),e(t,i)}}(this,e)},Wo={PlaylistLoader:Oa,Playlist:Ta,utils:Ka,STANDARD_PLAYLIST_SELECTOR:Hs,INITIAL_PLAYLIST_SELECTOR:function(){var e=this,t=this.playlists.master.playlists.filter(Ta.isEnabled);return Ns(t,(function(e,t){return js(e,t)})),t.filter((function(t){return!!Os(e.playlists.master,t).video}))[0]||null},lastBandwidthSelector:Hs,movingAverageBandwidthSelector:function(e){var t=-1,i=-1;if(e<0||e>1)throw new Error("Moving average bandwidth decay must be between 0 and 1.");return function(){var n=this.useDevicePixelRatio&&A.default.devicePixelRatio||1;return t<0&&(t=this.systemBandwidth,i=this.systemBandwidth),this.systemBandwidth>0&&this.systemBandwidth!==i&&(t=e*this.systemBandwidth+(1-e)*t,i=this.systemBandwidth),Vs(this.playlists.master,t,parseInt(Bs(this.tech_.el(),"width"),10)*n,parseInt(Bs(this.tech_.el(),"height"),10)*n,this.limitRenditionByPlayerDimensions,this.masterPlaylistController_)}},comparePlaylistBandwidth:js,comparePlaylistResolution:function(e,t){var i,n;return e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width&&(i=e.attributes.RESOLUTION.width),i=i||A.default.Number.MAX_VALUE,t.attributes.RESOLUTION&&t.attributes.RESOLUTION.width&&(n=t.attributes.RESOLUTION.width),i===(n=n||A.default.Number.MAX_VALUE)&&e.attributes.BANDWIDTH&&t.attributes.BANDWIDTH?e.attributes.BANDWIDTH-t.attributes.BANDWIDTH:i-n},xhr:Na()};Object.keys(ns).forEach((function(e){Object.defineProperty(Wo,e,{get:function(){return Yr.log.warn("using Vhs."+e+" is UNSAFE be sure you know what you are doing"),ns[e]},set:function(t){Yr.log.warn("using Vhs."+e+" is UNSAFE be sure you know what you are doing"),"number"!=typeof t||t<0?Yr.log.warn("value of Vhs."+e+" must be greater than or equal to 0"):ns[e]=t}})}));var Yo=function(e,t){for(var i=t.media(),n=-1,r=0;r0?1/this.throughput:0,Math.floor(1/(t+e))},set:function(){Yr.log.error('The "systemBandwidth" property is read-only')}}}),this.options_.bandwidth&&(this.bandwidth=this.options_.bandwidth),this.options_.throughput&&(this.throughput=this.options_.throughput),Object.defineProperties(this.stats,{bandwidth:{get:function(){return i.bandwidth||0},enumerable:!0},mediaRequests:{get:function(){return i.masterPlaylistController_.mediaRequests_()||0},enumerable:!0},mediaRequestsAborted:{get:function(){return i.masterPlaylistController_.mediaRequestsAborted_()||0},enumerable:!0},mediaRequestsTimedout:{get:function(){return i.masterPlaylistController_.mediaRequestsTimedout_()||0},enumerable:!0},mediaRequestsErrored:{get:function(){return i.masterPlaylistController_.mediaRequestsErrored_()||0},enumerable:!0},mediaTransferDuration:{get:function(){return i.masterPlaylistController_.mediaTransferDuration_()||0},enumerable:!0},mediaBytesTransferred:{get:function(){return i.masterPlaylistController_.mediaBytesTransferred_()||0},enumerable:!0},mediaSecondsLoaded:{get:function(){return i.masterPlaylistController_.mediaSecondsLoaded_()||0},enumerable:!0},mediaAppends:{get:function(){return i.masterPlaylistController_.mediaAppends_()||0},enumerable:!0},mainAppendsToLoadedData:{get:function(){return i.masterPlaylistController_.mainAppendsToLoadedData_()||0},enumerable:!0},audioAppendsToLoadedData:{get:function(){return i.masterPlaylistController_.audioAppendsToLoadedData_()||0},enumerable:!0},appendsToLoadedData:{get:function(){return i.masterPlaylistController_.appendsToLoadedData_()||0},enumerable:!0},timeToLoadedData:{get:function(){return i.masterPlaylistController_.timeToLoadedData_()||0},enumerable:!0},buffered:{get:function(){return ia(i.tech_.buffered())},enumerable:!0},currentTime:{get:function(){return i.tech_.currentTime()},enumerable:!0},currentSource:{get:function(){return i.tech_.currentSource_},enumerable:!0},currentTech:{get:function(){return i.tech_.name_},enumerable:!0},duration:{get:function(){return i.tech_.duration()},enumerable:!0},master:{get:function(){return i.playlists.master},enumerable:!0},playerDimensions:{get:function(){return i.tech_.currentDimensions()},enumerable:!0},seekable:{get:function(){return ia(i.tech_.seekable())},enumerable:!0},timestamp:{get:function(){return Date.now()},enumerable:!0},videoPlaybackQuality:{get:function(){return i.tech_.getVideoPlaybackQuality()},enumerable:!0}}),this.tech_.one("canplay",this.masterPlaylistController_.setupFirstPlay.bind(this.masterPlaylistController_)),this.tech_.on("bandwidthupdate",(function(){i.options_.useBandwidthFromLocalStorage&&function(e){if(!A.default.localStorage)return!1;var t=Xo();t=t?Yr.mergeOptions(t,e):e;try{A.default.localStorage.setItem("videojs-vhs",JSON.stringify(t))}catch(e){return!1}}({bandwidth:i.bandwidth,throughput:Math.round(i.throughput)})})),this.masterPlaylistController_.on("selectedinitialmedia",(function(){var e;(e=i).representations=function(){var t=e.masterPlaylistController_.master(),i=ba(t)?e.masterPlaylistController_.getAudioTrackPlaylists_():t.playlists;return i?i.filter((function(e){return!pa(e)})).map((function(t,i){return new jo(e,t,t.id)})):[]}})),this.masterPlaylistController_.sourceUpdater_.on("createdsourcebuffers",(function(){i.setupEme_()})),this.on(this.masterPlaylistController_,"progress",(function(){this.tech_.trigger("progress")})),this.on(this.masterPlaylistController_,"firstplay",(function(){this.ignoreNextSeekingEvent_=!0})),this.setupQualityLevels_(),this.tech_.el()&&(this.mediaSourceUrl_=A.default.URL.createObjectURL(this.masterPlaylistController_.mediaSource),this.tech_.src(this.mediaSourceUrl_))}},i.setupEme_=function(){var e=this,t=this.masterPlaylistController_.mediaTypes_.AUDIO.activePlaylistLoader,i=Ko({player:this.player_,sourceKeySystems:this.source_.keySystems,media:this.playlists.media(),audioMedia:t&&t.media()});this.player_.tech_.on("keystatuschange",(function(t){"output-restricted"===t.status&&e.masterPlaylistController_.blacklistCurrentPlaylist({playlist:e.masterPlaylistController_.media(),message:"DRM keystatus changed to "+t.status+". Playlist will fail to play. Check for HDCP content.",blacklistDuration:1/0})})),11!==Yr.browser.IE_VERSION&&i?(this.logger_("waiting for EME key session creation"),qo({player:this.player_,sourceKeySystems:this.source_.keySystems,audioMedia:t&&t.media(),mainPlaylists:this.playlists.master.playlists}).then((function(){e.logger_("created EME key session"),e.masterPlaylistController_.sourceUpdater_.initializedEme()})).catch((function(t){e.logger_("error while creating EME key session",t),e.player_.error({message:"Failed to initialize media keys for EME",code:3})}))):this.masterPlaylistController_.sourceUpdater_.initializedEme()},i.setupQualityLevels_=function(){var e=this,t=Yr.players[this.tech_.options_.playerId];t&&t.qualityLevels&&!this.qualityLevels_&&(this.qualityLevels_=t.qualityLevels(),this.masterPlaylistController_.on("selectedinitialmedia",(function(){var t,i;t=e.qualityLevels_,(i=e).representations().forEach((function(e){t.addQualityLevel(e)})),Yo(t,i.playlists)})),this.playlists.on("mediachange",(function(){Yo(e.qualityLevels_,e.playlists)})))},t.version=function(){return{"@videojs/http-streaming":"2.10.2","mux.js":"5.13.0","mpd-parser":"0.19.0","m3u8-parser":"4.7.0","aes-decrypter":"3.1.2"}},i.version=function(){return this.constructor.version()},i.canChangeType=function(){return vo.canChangeType()},i.play=function(){this.masterPlaylistController_.play()},i.setCurrentTime=function(e){this.masterPlaylistController_.setCurrentTime(e)},i.duration=function(){return this.masterPlaylistController_.duration()},i.seekable=function(){return this.masterPlaylistController_.seekable()},i.dispose=function(){this.playbackWatcher_&&this.playbackWatcher_.dispose(),this.masterPlaylistController_&&this.masterPlaylistController_.dispose(),this.qualityLevels_&&this.qualityLevels_.dispose(),this.player_&&(delete this.player_.vhs,delete this.player_.dash,delete this.player_.hls),this.tech_&&this.tech_.vhs&&delete this.tech_.vhs,this.tech_&&delete this.tech_.hls,this.mediaSourceUrl_&&A.default.URL.revokeObjectURL&&(A.default.URL.revokeObjectURL(this.mediaSourceUrl_),this.mediaSourceUrl_=null),e.prototype.dispose.call(this)},i.convertToProgramTime=function(e,t){return Xa({playlist:this.masterPlaylistController_.media(),time:e,callback:t})},i.seekToProgramTime=function(e,t,i,n){return void 0===i&&(i=!0),void 0===n&&(n=2),Qa({programTime:e,playlist:this.masterPlaylistController_.media(),retryCount:n,pauseAfterSeek:i,seekTo:this.options_.seekTo,tech:this.options_.tech,callback:t})},t}(Yr.getComponent("Component")),$o={name:"videojs-http-streaming",VERSION:"2.10.2",canHandleSource:function(e,t){void 0===t&&(t={});var i=Yr.mergeOptions(Yr.options,t);return $o.canPlayType(e.type,i)},handleSource:function(e,t,i){void 0===i&&(i={});var n=Yr.mergeOptions(Yr.options,i);return t.vhs=new Qo(e,t,n),Yr.hasOwnProperty("hls")||Object.defineProperty(t,"hls",{get:function(){return Yr.log.warn("player.tech().hls is deprecated. Use player.tech().vhs instead."),t.vhs},configurable:!0}),t.vhs.xhr=Na(),t.vhs.src(e.src,e.type),t.vhs},canPlayType:function(e,t){void 0===t&&(t={});var i=Yr.mergeOptions(Yr.options,t).vhs.overrideNative,n=void 0===i?!Yr.browser.IS_ANY_SAFARI:i,r=_.simpleTypeFromSourceType(e);return r&&(!Wo.supportsTypeNatively(r)||n)?"maybe":""}};g.browserSupportsCodec("avc1.4d400d,mp4a.40.2")&&Yr.getTech("Html5").registerSourceHandler($o,0),Yr.VhsHandler=Qo,Object.defineProperty(Yr,"HlsHandler",{get:function(){return Yr.log.warn("videojs.HlsHandler is deprecated. Use videojs.VhsHandler instead."),Qo},configurable:!0}),Yr.VhsSourceHandler=$o,Object.defineProperty(Yr,"HlsSourceHandler",{get:function(){return Yr.log.warn("videojs.HlsSourceHandler is deprecated. Use videojs.VhsSourceHandler instead."),$o},configurable:!0}),Yr.Vhs=Wo,Object.defineProperty(Yr,"Hls",{get:function(){return Yr.log.warn("videojs.Hls is deprecated. Use videojs.Vhs instead."),Wo},configurable:!0}),Yr.use||(Yr.registerComponent("Hls",Wo),Yr.registerComponent("Vhs",Wo)),Yr.options.vhs=Yr.options.vhs||{},Yr.options.hls=Yr.options.hls||{},Yr.registerPlugin?Yr.registerPlugin("reloadSourceOnError",Go):Yr.plugin("reloadSourceOnError",Go),t.exports=Yr},{"@babel/runtime/helpers/assertThisInitialized":1,"@babel/runtime/helpers/construct":2,"@babel/runtime/helpers/extends":3,"@babel/runtime/helpers/inherits":4,"@babel/runtime/helpers/inheritsLoose":5,"@videojs/vhs-utils/cjs/byte-helpers":9,"@videojs/vhs-utils/cjs/codecs.js":11,"@videojs/vhs-utils/cjs/containers":12,"@videojs/vhs-utils/cjs/id3-helpers":15,"@videojs/vhs-utils/cjs/media-types.js":16,"@videojs/vhs-utils/cjs/resolve-url.js":20,"@videojs/xhr":23,"global/document":34,"global/window":35,keycode:38,"m3u8-parser":39,"mpd-parser":41,"mux.js/lib/tools/parse-sidx":42,"mux.js/lib/utils/clock":43,"safe-json-parse/tuple":45,"videojs-vtt.js":48}],48:[function(e,t,i){var n=e("global/window"),r=t.exports={WebVTT:e("./vtt.js"),VTTCue:e("./vttcue.js"),VTTRegion:e("./vttregion.js")};n.vttjs=r,n.WebVTT=r.WebVTT;var a=r.VTTCue,s=r.VTTRegion,o=n.VTTCue,u=n.VTTRegion;r.shim=function(){n.VTTCue=a,n.VTTRegion=s},r.restore=function(){n.VTTCue=o,n.VTTRegion=u},n.VTTCue||r.shim()},{"./vtt.js":49,"./vttcue.js":50,"./vttregion.js":51,"global/window":35}],49:[function(e,t,i){var n=e("global/document"),r=Object.create||function(){function e(){}return function(t){if(1!==arguments.length)throw new Error("Object.create shim only accepts one parameter.");return e.prototype=t,new e}}();function a(e,t){this.name="ParsingError",this.code=e.code,this.message=t||e.message}function s(e){function t(e,t,i,n){return 3600*(0|e)+60*(0|t)+(0|i)+(0|n)/1e3}var i=e.match(/^(\d+):(\d{1,2})(:\d{1,2})?\.(\d{3})/);return i?i[3]?t(i[1],i[2],i[3].replace(":",""),i[4]):i[1]>59?t(i[1],i[2],0,i[4]):t(0,i[1],i[2],i[4]):null}function o(){this.values=r(null)}function u(e,t,i,n){var r=n?e.split(n):[e];for(var a in r)if("string"==typeof r[a]){var s=r[a].split(i);if(2===s.length)t(s[0],s[1])}}function l(e,t,i){var n=e;function r(){var t=s(e);if(null===t)throw new a(a.Errors.BadTimeStamp,"Malformed timestamp: "+n);return e=e.replace(/^[^\sa-zA-Z-]+/,""),t}function l(){e=e.replace(/^\s+/,"")}if(l(),t.startTime=r(),l(),"--\x3e"!==e.substr(0,3))throw new a(a.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '--\x3e'): "+n);e=e.substr(3),l(),t.endTime=r(),l(),function(e,t){var n=new o;u(e,(function(e,t){switch(e){case"region":for(var r=i.length-1;r>=0;r--)if(i[r].id===t){n.set(e,i[r].region);break}break;case"vertical":n.alt(e,t,["rl","lr"]);break;case"line":var a=t.split(","),s=a[0];n.integer(e,s),n.percent(e,s)&&n.set("snapToLines",!1),n.alt(e,s,["auto"]),2===a.length&&n.alt("lineAlign",a[1],["start","center","end"]);break;case"position":a=t.split(","),n.percent(e,a[0]),2===a.length&&n.alt("positionAlign",a[1],["start","center","end"]);break;case"size":n.percent(e,t);break;case"align":n.alt(e,t,["start","center","end","left","right"])}}),/:/,/\s/),t.region=n.get("region",null),t.vertical=n.get("vertical","");try{t.line=n.get("line","auto")}catch(e){}t.lineAlign=n.get("lineAlign","start"),t.snapToLines=n.get("snapToLines",!0),t.size=n.get("size",100);try{t.align=n.get("align","center")}catch(e){t.align=n.get("align","middle")}try{t.position=n.get("position","auto")}catch(e){t.position=n.get("position",{start:0,left:0,center:50,middle:50,end:100,right:100},t.align)}t.positionAlign=n.get("positionAlign",{start:"start",left:"start",center:"center",middle:"center",end:"end",right:"end"},t.align)}(e,t)}a.prototype=r(Error.prototype),a.prototype.constructor=a,a.Errors={BadSignature:{code:0,message:"Malformed WebVTT signature."},BadTimeStamp:{code:1,message:"Malformed time stamp."}},o.prototype={set:function(e,t){this.get(e)||""===t||(this.values[e]=t)},get:function(e,t,i){return i?this.has(e)?this.values[e]:t[i]:this.has(e)?this.values[e]:t},has:function(e){return e in this.values},alt:function(e,t,i){for(var n=0;n=0&&t<=100)&&(this.set(e,t),!0)}};var d=n.createElement&&n.createElement("textarea"),h={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"},c={white:"rgba(255,255,255,1)",lime:"rgba(0,255,0,1)",cyan:"rgba(0,255,255,1)",red:"rgba(255,0,0,1)",yellow:"rgba(255,255,0,1)",magenta:"rgba(255,0,255,1)",blue:"rgba(0,0,255,1)",black:"rgba(0,0,0,1)"},f={v:"title",lang:"lang"},p={rt:"ruby"};function m(e,t){function i(){if(!t)return null;var e,i=t.match(/^([^<]*)(<[^>]*>?)?/);return e=i[1]?i[1]:i[2],t=t.substr(e.length),e}function n(e,t){return!p[t.localName]||p[t.localName]===e.localName}function r(t,i){var n=h[t];if(!n)return null;var r=e.document.createElement(n),a=f[t];return a&&i&&(r[a]=i.trim()),r}for(var a,o,u=e.document.createElement("div"),l=u,m=[];null!==(a=i());)if("<"!==a[0])l.appendChild(e.document.createTextNode((o=a,d.innerHTML=o,o=d.textContent,d.textContent="",o)));else{if("/"===a[1]){m.length&&m[m.length-1]===a.substr(2).replace(">","")&&(m.pop(),l=l.parentNode);continue}var g,_=s(a.substr(1,a.length-2));if(_){g=e.document.createProcessingInstruction("timestamp",_),l.appendChild(g);continue}var y=a.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!y)continue;if(!(g=r(y[1],y[3])))continue;if(!n(l,g))continue;if(y[2]){var v=y[2].split(".");v.forEach((function(e){var t=/^bg_/.test(e),i=t?e.slice(3):e;if(c.hasOwnProperty(i)){var n=t?"background-color":"color",r=c[i];g.style[n]=r}})),g.className=v.join(" ")}m.push(y[1]),l.appendChild(g),l=g}return u}var g=[[1470,1470],[1472,1472],[1475,1475],[1478,1478],[1488,1514],[1520,1524],[1544,1544],[1547,1547],[1549,1549],[1563,1563],[1566,1610],[1645,1647],[1649,1749],[1765,1766],[1774,1775],[1786,1805],[1807,1808],[1810,1839],[1869,1957],[1969,1969],[1984,2026],[2036,2037],[2042,2042],[2048,2069],[2074,2074],[2084,2084],[2088,2088],[2096,2110],[2112,2136],[2142,2142],[2208,2208],[2210,2220],[8207,8207],[64285,64285],[64287,64296],[64298,64310],[64312,64316],[64318,64318],[64320,64321],[64323,64324],[64326,64449],[64467,64829],[64848,64911],[64914,64967],[65008,65020],[65136,65140],[65142,65276],[67584,67589],[67592,67592],[67594,67637],[67639,67640],[67644,67644],[67647,67669],[67671,67679],[67840,67867],[67872,67897],[67903,67903],[67968,68023],[68030,68031],[68096,68096],[68112,68115],[68117,68119],[68121,68147],[68160,68167],[68176,68184],[68192,68223],[68352,68405],[68416,68437],[68440,68466],[68472,68479],[68608,68680],[126464,126467],[126469,126495],[126497,126498],[126500,126500],[126503,126503],[126505,126514],[126516,126519],[126521,126521],[126523,126523],[126530,126530],[126535,126535],[126537,126537],[126539,126539],[126541,126543],[126545,126546],[126548,126548],[126551,126551],[126553,126553],[126555,126555],[126557,126557],[126559,126559],[126561,126562],[126564,126564],[126567,126570],[126572,126578],[126580,126583],[126585,126588],[126590,126590],[126592,126601],[126603,126619],[126625,126627],[126629,126633],[126635,126651],[1114109,1114109]];function _(e){for(var t=0;t=i[0]&&e<=i[1])return!0}return!1}function y(e){var t=[],i="";if(!e||!e.childNodes)return"ltr";function n(e,t){for(var i=t.childNodes.length-1;i>=0;i--)e.push(t.childNodes[i])}function r(e){if(!e||!e.length)return null;var t=e.pop(),i=t.textContent||t.innerText;if(i){var a=i.match(/^.*(\n|\r)/);return a?(e.length=0,a[0]):i}return"ruby"===t.tagName?r(e):t.childNodes?(n(e,t),r(e)):void 0}for(n(t,e);i=r(t);)for(var a=0;a=0&&e.line<=100))return e.line;if(!e.track||!e.track.textTrackList||!e.track.textTrackList.mediaElement)return-1;for(var t=e.track,i=t.textTrackList,n=0,r=0;rh&&(d=d<0?-1:1,d*=Math.ceil(h/l)*l),s<0&&(d+=""===a.vertical?i.height:i.width,o=o.reverse()),r.move(c,d)}else{var f=r.lineHeight/i.height*100;switch(a.lineAlign){case"center":s-=f/2;break;case"end":s-=f}switch(a.vertical){case"":t.applyStyles({top:t.formatStyle(s,"%")});break;case"rl":t.applyStyles({left:t.formatStyle(s,"%")});break;case"lr":t.applyStyles({right:t.formatStyle(s,"%")})}o=["+y","-x","+x","-y"],r=new T(t)}var p=function(e,t){for(var r,a=new T(e),s=1,o=0;ou&&(r=new T(e),s=u),e=new T(a)}return r||a}(r,o);t.move(p.toCSSCompatValues(i))}function E(){}v.prototype.applyStyles=function(e,t){for(var i in t=t||this.div,e)e.hasOwnProperty(i)&&(t.style[i]=e[i])},v.prototype.formatStyle=function(e,t){return 0===e?0:e+t},b.prototype=r(v.prototype),b.prototype.constructor=b,T.prototype.move=function(e,t){switch(t=void 0!==t?t:this.lineHeight,e){case"+x":this.left+=t,this.right+=t;break;case"-x":this.left-=t,this.right-=t;break;case"+y":this.top+=t,this.bottom+=t;break;case"-y":this.top-=t,this.bottom-=t}},T.prototype.overlaps=function(e){return this.lefte.left&&this.tope.top},T.prototype.overlapsAny=function(e){for(var t=0;t=e.top&&this.bottom<=e.bottom&&this.left>=e.left&&this.right<=e.right},T.prototype.overlapsOppositeAxis=function(e,t){switch(t){case"+x":return this.lefte.right;case"+y":return this.tope.bottom}},T.prototype.intersectPercentage=function(e){return Math.max(0,Math.min(this.right,e.right)-Math.max(this.left,e.left))*Math.max(0,Math.min(this.bottom,e.bottom)-Math.max(this.top,e.top))/(this.height*this.width)},T.prototype.toCSSCompatValues=function(e){return{top:this.top-e.top,bottom:e.bottom-this.bottom,left:this.left-e.left,right:e.right-this.right,height:this.height,width:this.width}},T.getSimpleBoxPosition=function(e){var t=e.div?e.div.offsetHeight:e.tagName?e.offsetHeight:0,i=e.div?e.div.offsetWidth:e.tagName?e.offsetWidth:0,n=e.div?e.div.offsetTop:e.tagName?e.offsetTop:0;return{left:(e=e.div?e.div.getBoundingClientRect():e.tagName?e.getBoundingClientRect():e).left,right:e.right,top:e.top||n,height:e.height||t,bottom:e.bottom||n+(e.height||t),width:e.width||i}},E.StringDecoder=function(){return{decode:function(e){if(!e)return"";if("string"!=typeof e)throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(e))}}},E.convertCueToDOMTree=function(e,t){return e&&t?m(e,t):null};E.processCues=function(e,t,i){if(!e||!t||!i)return null;for(;i.firstChild;)i.removeChild(i.firstChild);var n=e.document.createElement("div");if(n.style.position="absolute",n.style.left="0",n.style.right="0",n.style.top="0",n.style.bottom="0",n.style.margin="1.5%",i.appendChild(n),function(e){for(var t=0;t100)throw new Error("Position must be between 0 and 100.");m=e,this.hasBeenReset=!0}},positionAlign:{enumerable:!0,get:function(){return g},set:function(e){var t=a(e);t&&(g=t,this.hasBeenReset=!0)}},size:{enumerable:!0,get:function(){return _},set:function(e){if(e<0||e>100)throw new Error("Size must be between 0 and 100.");_=e,this.hasBeenReset=!0}},align:{enumerable:!0,get:function(){return y},set:function(e){var t=a(e);if(!t)throw new SyntaxError("align: an invalid or illegal alignment string was specified.");y=t,this.hasBeenReset=!0}}}),this.displayState=void 0}s.prototype.getCueAsHTML=function(){return WebVTT.convertCueToDOMTree(window,this.text)},t.exports=s},{}],51:[function(e,t,i){var n={"":!0,up:!0};function r(e){return"number"==typeof e&&e>=0&&e<=100}t.exports=function(){var e=100,t=3,i=0,a=100,s=0,o=100,u="";Object.defineProperties(this,{width:{enumerable:!0,get:function(){return e},set:function(t){if(!r(t))throw new Error("Width must be between 0 and 100.");e=t}},lines:{enumerable:!0,get:function(){return t},set:function(e){if("number"!=typeof e)throw new TypeError("Lines must be set to a number.");t=e}},regionAnchorY:{enumerable:!0,get:function(){return a},set:function(e){if(!r(e))throw new Error("RegionAnchorX must be between 0 and 100.");a=e}},regionAnchorX:{enumerable:!0,get:function(){return i},set:function(e){if(!r(e))throw new Error("RegionAnchorY must be between 0 and 100.");i=e}},viewportAnchorY:{enumerable:!0,get:function(){return o},set:function(e){if(!r(e))throw new Error("ViewportAnchorY must be between 0 and 100.");o=e}},viewportAnchorX:{enumerable:!0,get:function(){return s},set:function(e){if(!r(e))throw new Error("ViewportAnchorX must be between 0 and 100.");s=e}},scroll:{enumerable:!0,get:function(){return u},set:function(e){var t=function(e){return"string"==typeof e&&(!!n[e.toLowerCase()]&&e.toLowerCase())}(e);!1===t||(u=t)}}})}},{}],52:[function(e,t,i){"use strict";t.exports={DEFAILT_WEBGL_PLAY_ID:"glplayer",PLAYER_IN_TYPE_MP4:"mp4",PLAYER_IN_TYPE_FLV:"flv",PLAYER_IN_TYPE_HTTPFLV:"httpflv",PLAYER_IN_TYPE_RAW_265:"raw265",PLAYER_IN_TYPE_TS:"ts",PLAYER_IN_TYPE_MPEGTS:"mpegts",PLAYER_IN_TYPE_M3U8:"hls",PLAYER_IN_TYPE_M3U8_VOD:"m3u8",PLAYER_IN_TYPE_M3U8_LIVE:"hls",APPEND_TYPE_STREAM:0,APPEND_TYPE_FRAME:1,APPEND_TYPE_SEQUENCE:2,DEFAULT_WIDTH:600,DEFAULT_HEIGHT:600,DEFAULT_FPS:30,DEFAULT_FRAME_DUR:40,DEFAULT_FIXED:!1,DEFAULT_SAMPLERATE:44100,DEFAULT_CHANNELS:2,DEFAULT_CONSU_SAMPLE_LEN:20,PLAYER_MODE_VOD:"vod",PLAYER_MODE_NOTIME_LIVE:"live",AUDIO_MODE_ONCE:"ONCE",AUDIO_MODE_SWAP:"SWAP",DEFAULT_STRING_LIVE:"LIVE",CODEC_H265:0,CODEC_H264:1,PLAYER_CORE_TYPE_DEFAULT:0,PLAYER_CORE_TYPE_CNATIVE:1,URI_PROTOCOL_WEBSOCKET:"ws",URI_PROTOCOL_WEBSOCKET_DESC:"websocket",URI_PROTOCOL_HTTP:"http",URI_PROTOCOL_HTTP_DESC:"http",FETCH_FIRST_MAX_TIMES:5,FETCH_HTTP_FLV_TIMEOUT_MS:7e3,V_CODEC_NAME_HEVC:265,V_CODEC_NAME_AVC:264,V_CODEC_NAME_UNKN:500,A_CODEC_NAME_AAC:112,A_CODEC_NAME_MP3:113,A_CODEC_NAME_UNKN:500,CACHE_NO_LOADCACHE:192,CACHE_WITH_PLAY_SIGN:193,CACHE_WITH_NOPLAY_SIGN:194}},{}],53:[function(e,t,i){"use strict";var n=window.AudioContext||window.webkitAudioContext,r=e("../consts"),a=e("./av-common");t.exports=function(e){var t={options:{sampleRate:e.sampleRate||r.DEFAULT_SAMPLERATE,appendType:e.appendType||r.APPEND_TYPE_STREAM,playMode:e.playMode||r.AUDIO_MODE_SWAP},sourceChannel:-1,audioCtx:new n({latencyHint:"interactive",sampleRate:e.sampleRate}),gainNode:null,sourceList:[],startStatus:!1,sampleQueue:[],nextBuffer:null,playTimestamp:0,playStartTime:0,durationMs:-1,isLIVE:!1,voice:1,onLoadCache:null,resetStartParam:function(){t.playTimestamp=0,t.playStartTime=0},setOnLoadCache:function(e){t.onLoadCache=e},setDurationMs:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1;t.durationMs=e},setVoice:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;t.voice=e,t.gainNode.gain.value=e},getAlignVPTS:function(){return t.playTimestamp+(a.GetMsTime()-t.playStartTime)/1e3},swapSource:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;if(0==t.startStatus)return null;if(e<0||e>=t.sourceList.length)return null;if(i<0||i>=t.sourceList.length)return null;try{t.sourceChannel===e&&null!==t.sourceList[e]&&(t.sourceList[e].disconnect(t.gainNode),t.sourceList[e]=null)}catch(t){console.error("[DEFINE ERROR] audioModule disconnect source Index:"+e+" error happened!",t)}t.sourceChannel=i;var n=t.decodeSample(i,e);-2==n&&t.isLIVE&&(t.getAlignVPTS()>=t.durationMs/1e3-.04?t.pause():null!==t.onLoadCache&&t.onLoadCache())},addSample:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return!(null==e||!e||null==e)&&(0==t.sampleQueue.length&&(t.seekPos=e.pts),t.sampleQueue.push(e),!0)},runNextBuffer:function(){window.setInterval((function(){if(!(null!=t.nextBuffer||t.sampleQueue.length0&&void 0!==arguments[0]?arguments[0]:-1,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;if(e<0||e>=t.sourceList.length)return-1;if(null!=t.sourceList[e]&&null!=t.sourceList[e]&&t.sourceList[e]||(t.sourceList[e]=t.audioCtx.createBufferSource(),t.sourceList[e].onended=function(){t.swapSource(e,i)}),0==t.sampleQueue.length)return t.isLIVE?(t.sourceList[e].connect(t.gainNode),t.sourceList[e].start(),t.sourceList[e].onended=function(){t.swapSource(e,i)},t.sourceList[e].stop(),0):-2;if(t.sourceList[e].buffer)return t.sourceList[e],t.sourceList[i],t.gainNode,t.swapSource(e,i),0;if(null==t.nextBuffer||t.nextBuffer.data.length<1)return t.sourceList[e].connect(t.gainNode),t.sourceList[e].start(),t.sourceList[e].startState=!0,t.sourceList[e].stop(),1;var n=t.nextBuffer.data.buffer;t.playTimestamp=t.nextBuffer.pts,t.playStartTime=a.GetMsTime();try{t.audioCtx.decodeAudioData(n,(function(i){null!==t.sourceList[e]&&(t.sourceList[e].buffer=i,t.sourceList[e].connect(t.gainNode),t.sourceList[e].start(),t.sourceList[e].startState=!0)}),(function(e){}))}catch(e){return t.nextBuffer=null,-3}return t.nextBuffer=null,0},decodeWholeSamples:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1;if(t.sourceChannel=e,e<0||e>=t.sourceList.length)return-1;if(null!=t.sourceList[e]&&null!=t.sourceList[e]&&t.sourceList[e]||(t.sourceList[e]=t.audioCtx.createBufferSource(),t.sourceList[e].onended=function(){}),0==t.sampleQueue.length)return-2;for(var i=null,n=null,a=0;a=2){var s=i.length/2;a=new Float32Array(s);for(var o=0,u=0;u0&&s()-this._start_time>=this._now_seg_dur&&(s(),this._start_time,this._now_seg_dur,this._start_time=-1,this._now_seg_dur=-1),s(),this._start_time<0)if(new Date,null!==this._pcm_array_buf&&this._pcm_array_buf.length>this._push_start_idx){this._swapStartPlay=!1;var e=this._push_start_idx+this._once_pop_len;e>this._pcm_array_buf.length&&(e=this._pcm_array_buf.length);var t=this._pcm_array_buf.slice(this._push_start_idx,e);this._push_start_idx+=t.length,this._now_seg_dur=1*t.length/this._sample_rate*1e3,t.length,this._sample_rate,this._now_seg_dur;var i=this._ctx.createBuffer(1,t.length,this._sample_rate);t.length,new Date,i.copyToChannel(t,0),this._active_node=this._ctx.createBufferSource(),this._active_node.buffer=i,this._active_node.connect(this._gain),this._start_time=s(),this._active_node.start(0)}else setTimeout(this.readingLoopWithF32,1)}}])&&n(t.prototype,i),o&&n(t,o),e}();i.AudioPcmPlayer=o},{"../consts":52}],55:[function(e,t,i){"use strict";var n=e("../consts"),r=[{format:"mp4",value:"mp4",core:n.PLAYER_CORE_TYPE_CNATIVE},{format:"mov",value:"mp4",core:n.PLAYER_CORE_TYPE_CNATIVE},{format:"flv",value:"flv",core:n.PLAYER_CORE_TYPE_CNATIVE},{format:"m3u8",value:"hls",core:n.PLAYER_CORE_TYPE_DEFAULT},{format:"m3u",value:"hls",core:n.PLAYER_CORE_TYPE_DEFAULT},{format:"ts",value:"ts",core:n.PLAYER_CORE_TYPE_DEFAULT},{format:"mpegts",value:"ts",core:n.PLAYER_CORE_TYPE_DEFAULT},{format:"hevc",value:"raw265",core:n.PLAYER_CORE_TYPE_DEFAULT},{format:"h265",value:"raw265",core:n.PLAYER_CORE_TYPE_DEFAULT}],a=[{format:n.URI_PROTOCOL_HTTP,value:n.URI_PROTOCOL_HTTP_DESC},{format:n.URI_PROTOCOL_WEBSOCKET,value:n.URI_PROTOCOL_WEBSOCKET_DESC}];t.exports={frameDataAlignCrop:function(e,t,i,n,r,a,s,o){if(0==e-n)return[a,s,o];for(var u=n*r,l=u/4,d=new Uint8Array(u),h=new Uint8Array(l),c=new Uint8Array(l),f=n,p=n/2,m=0;m=0)return i.value}return r[0].value},GetFormatPlayCore:function(e){for(var t=0;t=0)return i.value}return a[0].value},GetMsTime:function(){return(new Date).getTime()}}},{"../consts":52}],56:[function(e,t,i){"use strict";function n(e,t){for(var i=0;i0&&(t.getPackageTimeMS=a.GetMsTime()),t.pushPkg++,void 0!==t.AVGetInterval&&null!==t.AVGetInterval||(t.AVGetInterval=window.setInterval((function(){Module.cwrap("getBufferLengthApi","number",["number"])(t.AVSniffPtr)>t.config.probeSize?(Module.cwrap("getSniffHttpFlvPkg","number",["number"])(t.AVSniffPtr),t.pushPkg-=1):t.getPackageTimeMS>0&&a.GetMsTime()-t.getPackageTimeMS>=o.FETCH_HTTP_FLV_TIMEOUT_MS&&(t.getPackageTimeMS=a.GetMsTime(),t.workerFetch.postMessage({cmd:"retry",data:null,msg:"retry"}))}),5));break;case"close":t.AVGetInterval&&clearInterval(t.AVGetInterval),t.AVGetInterval=null;case"fetch-fin":break;case"fetch-error":t.onNetworkError&&t.onNetworkError(i.data)}}},{key:"_checkDisplaySize",value:function(e,t,i){var n=t-e,r=this.config.width+Math.ceil(n/2),a=t/this.config.width>i/this.config.height,s=(r/t).toFixed(2),o=(this.config.height/i).toFixed(2),u=a?s:o,l=this.config.fixed,d=l?r:parseInt(t*u),h=l?this.config.height:parseInt(i*u);if(this.CanvasObj.offsetWidth!=d||this.CanvasObj.offsetHeight!=h){var c=parseInt((this.canvasBox.offsetHeight-h)/2),f=parseInt((this.canvasBox.offsetWidth-d)/2);c=c<0?0:c,f=f<0?0:f,this.CanvasObj.style.marginTop=c+"px",this.CanvasObj.style.marginLeft=f+"px",this.CanvasObj.style.width=d+"px",this.CanvasObj.style.height=h+"px"}return this.isCheckDisplay=!0,[d,h]}},{key:"_ptsFixed2",value:function(e){return Math.ceil(100*e)/100}},{key:"_callbackProbe",value:function(e,t,i,n,r,a,u,l,d){for(var h=Module.HEAPU8.subarray(d,d+10),c=0;c100&&(f=o.DEFAULT_FPS,this.mediaInfo.noFPS=!0),this.vCodecID=l,this.config.fps=f,this.mediaInfo.fps=f,this.mediaInfo.size.width=t,this.mediaInfo.size.height=i,this.frameTime=Math.floor(1e3/(this.mediaInfo.fps+2)),this.CanvasObj.width==t&&this.CanvasObj.height==i||(this.CanvasObj.width=t,this.CanvasObj.height=i,this.isCheckDisplay)||this._checkDisplaySize(t,t,i),r>=0&&!1===this.mediaInfo.noFPS&&this.config.ignoreAudio<1?(void 0!==this.audioWAudio&&null!==this.audioWAudio&&(this.audioWAudio.stop(),this.audioWAudio=null),this.config.sampleRate=a,this.mediaInfo.sampleRate=a,this.audioWAudio=s({sampleRate:this.mediaInfo.sampleRate,appendType:o.APPEND_TYPE_FRAME}),this.audioWAudio.isLIVE=!0):this.mediaInfo.audioNone=!0,this.onProbeFinish&&this.onProbeFinish()}},{key:"_callbackYUV",value:function(e,t,i,n,r,a,s,o,u){var l=Module.HEAPU8.subarray(e,e+n*o),d=new Uint8Array(l),h=Module.HEAPU8.subarray(t,t+r*o/2),c=new Uint8Array(h),f=Module.HEAPU8.subarray(i,i+a*o/2),p={bufY:d,bufU:c,bufV:new Uint8Array(f),line_y:n,h:o,pts:u};this.YuvBuf.push(p),this.checkCacheState(),Module._free(l),l=null,Module._free(h),h=null,Module._free(f),f=null,!1===this.readyShowDone&&(this.playYUV(),this.readyShowDone=!0,this.onReadyShowDone&&this.onReadyShowDone(),this.audioWAudio||this.play())}},{key:"_callbackNALU",value:function(e,t,i,n,r,a,s){if(!1===this.readyKeyFrame){if(i<=0)return;this.readyKeyFrame=!0}var o=Module.HEAPU8.subarray(e,e+t),u=new Uint8Array(o);this.NaluBuf.push({bufData:u,len:t,isKey:i,w:n,h:r,pts:1e3*a,dts:1e3*s}),Module._free(o),o=null}},{key:"_callbackPCM",value:function(e){}},{key:"_callbackAAC",value:function(e,t,i,n,r){var a=this._ptsFixed2(r);if(this.audioWAudio){var s=new Uint8Array(7+i),o=Module.HEAPU8.subarray(e,e+7);s.set(o,0);var u=Module.HEAPU8.subarray(t,t+i);s.set(u,7);var l={pts:a,data:s};this.audioWAudio.addSample(l),this.checkCacheState()}}},{key:"_decode",value:function(){var e=this;setTimeout((function(){if(null!==e.workerFetch){var t=e.NaluBuf.shift();if(null!=t){var i=Module._malloc(t.bufData.length);Module.HEAP8.set(t.bufData,i),Module.cwrap("decodeHttpFlvVideoFrame","number",["number","number","number","number","number"])(e.AVSniffPtr,i,t.bufData.length,t.pts,t.dts,0),Module._free(i),i=null}e._decode()}}),1)}},{key:"checkCacheState",value:function(){var e=this.YuvBuf.length>=25&&(!0===this.mediaInfo.audioNone||this.audioWAudio&&this.audioWAudio.sampleQueue.length>=50);return!1===this.cache_status&&e&&(this.playInterval&&this.audioWAudio&&this.audioWAudio.play(),this.onLoadCacheFinshed&&this.onLoadCacheFinshed(),this.cache_status=!0),e}},{key:"setVoice",value:function(e){this.audioVoice=e,this.audioWAudio&&this.audioWAudio.setVoice(e)}},{key:"_removeBindFuncPtr",value:function(){null!==this._ptr_probeCallback&&Module.removeFunction(this._ptr_probeCallback),null!==this._ptr_frameCallback&&Module.removeFunction(this._ptr_frameCallback),null!==this._ptr_naluCallback&&Module.removeFunction(this._ptr_naluCallback),null!==this._ptr_sampleCallback&&Module.removeFunction(this._ptr_sampleCallback),null!==this._ptr_aacCallback&&Module.removeFunction(this._ptr_aacCallback),this._ptr_probeCallback=null,this._ptr_frameCallback=null,this._ptr_naluCallback=null,this._ptr_sampleCallback=null,this._ptr_aacCallback=null}},{key:"release",value:function(){return this.pause(),this.NaluBuf.length=0,this.YuvBuf.length=0,void 0!==this.workerFetch&&null!==this.workerFetch&&this.workerFetch.postMessage({cmd:"stop",data:"stop",msg:"stop"}),this.workerFetch=null,this.AVGetInterval&&clearInterval(this.AVGetInterval),this.AVGetInterval=null,this._removeBindFuncPtr(),Module.cwrap("releaseHttpFLV","number",["number"])(this.AVSniffPtr),this.playInterval&&clearInterval(this.playInterval),this.playInterval=null,this.audioWAudio&&this.audioWAudio.stop(),this.audioWAudio=null,this.CanvasObj&&this.CanvasObj.remove(),this.CanvasObj=null,0}},{key:"isPlayingState",value:function(){return null!==this.playInterval&&void 0!==this.playInterval}},{key:"pause",value:function(){this.audioWAudio&&this.audioWAudio.pause(),this.playInterval&&clearInterval(this.playInterval),this.playInterval=null}},{key:"playYUV",value:function(){if(this.YuvBuf.length>0){var e=this.YuvBuf.shift();return r.renderFrame(this.AVGLObj,e.bufY,e.bufU,e.bufV,e.line_y,e.h),!0}return!1}},{key:"play",value:function(){var e=this,t=this;if(!1===this.checkCacheState())return this.onLoadCache&&this.onLoadCache(),setTimeout((function(){e.play()}),100),!1;if(void 0===this.playInterval||null===this.playInterval){var i=0,n=0,s=0;!1===this.mediaInfo.audioNone&&this.audioWAudio&&!1===this.mediaInfo.noFPS?(this.playInterval=setInterval((function(){if(n=a.GetMsTime(),t.cache_status){if(n-i>=t.frameTime-s){var e=t.YuvBuf.shift();if(null!=e&&null!==e){var o=0;null!==t.audioWAudio&&void 0!==t.audioWAudio&&(o=1e3*(e.pts-t.audioWAudio.getAlignVPTS())),s=t.audioWAudio?o<0&&-1*o<=t.frameTime||o>=0?a.GetMsTime()-n+1:t.frameTime:a.GetMsTime()-n+1,r.renderFrame(t.AVGLObj,e.bufY,e.bufU,e.bufV,e.line_y,e.h)}(t.YuvBuf.length<=0||t.audioWAudio&&t.audioWAudio.sampleQueue.length<=0)&&(t.cache_status=!1,t.onLoadCache&&t.onLoadCache(),t.audioWAudio&&t.audioWAudio.pause()),i=n}}else s=t.frameTime}),1),this.audioWAudio&&this.audioWAudio.play()):this.playInterval=setInterval((function(){var e=t.YuvBuf.shift();null!=e&&null!==e&&r.renderFrame(t.AVGLObj,e.bufY,e.bufU,e.bufV,e.line_y,e.h),t.YuvBuf.length<=0&&(t.cache_status=!1)}),t.frameTime)}}},{key:"start",value:function(e){var t,i,n,a=this;this.workerFetch=new Worker((t=function(){var e=null,t=new AbortController,i=t.signal,n=(self,function(e){var t=!1;t||(t=!0,fetch(e,{signal:i}).then((function(e){return function e(t){return t.read().then((function(i){if(!i.done){var n=i.value;return self.postMessage({cmd:"fetch-chunk",data:n,msg:"fetch-chunk"}),e(t)}self.postMessage({cmd:"fetch-fin",data:null,msg:"fetch-fin"})}))}(e.body.getReader())})).catch((function(e){if(!e.toString().includes("user aborted")){var t=" httplive request error:"+e+" start to retry";console.error(t),self.postMessage({cmd:"fetch-error",data:t,msg:"fetch-error"})}})))});self.onmessage=function(r){var a=r.data;switch(void 0===a.cmd||null===a.cmd?"":a.cmd){case"start":e=a.data,n(e),self.postMessage({cmd:"default",data:"WORKER STARTED",msg:"default"});break;case"stop":t.abort(),self.close(),self.postMessage({cmd:"close",data:"close",msg:"close"});break;case"retry":t.abort(),t=null,i=null,t=new AbortController,i=t.signal,setTimeout((function(){n(e)}),3e3)}}}.toString(),i=t.match(/^\s*function\s*\(\s*\)\s*\{(([\s\S](?!\}$))*[\s\S])/),n=[i[1]],window.URL.createObjectURL(new Blob(n,{type:"text/javascript"})))),this.workerFetch.onmessage=function(e){a._workerFetch_onmessage(e,a)},this.workerFetch,this.AVSniffPtr=Module.cwrap("AVSniffHttpFlvInit","number",["string","string"])("base64:QXV0aG9yOmNoYW5neWFubG9uZ3xudW1iZXJ3b2xmLEdpdGh1YjpodHRwczovL2dpdGh1Yi5jb20vbnVtYmVyd29sZixFbWFpbDpwb3JzY2hlZ3QyM0Bmb3htYWlsLmNvbSxRUTo1MzEzNjU4NzIsSG9tZVBhZ2U6aHR0cDovL3h2aWRlby52aWRlbyxEaXNjb3JkOm51bWJlcndvbGYjODY5NCx3ZWNoYXI6bnVtYmVyd29sZjExLEJlaWppbmcsV29ya0luOkJhaWR1","0.0.0"),this.AVSniffPtr,this._ptr_probeCallback=Module.addFunction(this._callbackProbe.bind(this)),this._ptr_yuvCallback=Module.addFunction(this._callbackYUV.bind(this)),this._ptr_naluCallback=Module.addFunction(this._callbackNALU.bind(this)),this._ptr_sampleCallback=Module.addFunction(this._callbackPCM.bind(this)),this._ptr_aacCallback=Module.addFunction(this._callbackAAC.bind(this)),Module.cwrap("initializeSniffHttpFlvModule","number",["number","number","number","number","number","number"])(this.AVSniffPtr,this._ptr_probeCallback,this._ptr_yuvCallback,this._ptr_naluCallback,this._ptr_sampleCallback,this._ptr_aacCallback),this.AVGLObj=r.setupCanvas(this.CanvasObj,{preserveDrawingBuffer:!1}),this.workerFetch.postMessage({cmd:"start",data:e,msg:"start"}),this._decode()}}])&&n(t.prototype,i),u&&n(t,u),e}();i.CHttpLiveCore=u},{"../consts":52,"../demuxer/buffer":64,"../demuxer/bufferFrame":65,"../render-engine/webgl-420p":77,"../version":80,"./audio-core":53,"./audio-native-core":54,"./av-common":55,"./cache":59,"./cacheYuv":60}],57:[function(e,t,i){"use strict";function n(e,t){for(var i=0;i0&&void 0!==arguments[0]&&arguments[0];this.showScreen=e,this.canvas&&(e?this.canvas.setAttribute("hidden",!0):this.canvas.removeAttribute("hidden"))}},{key:"getCachePTS",value:function(){return 1!==this.config.ignoreAudio&&this.audioWAudio?Math.max(this.vCachePTS,this.aCachePTS):this.vCachePTS}},{key:"getMaxPTS",value:function(){return Math.max(this.vCachePTS,this.aCachePTS)}},{key:"isPlayingState",value:function(){return this.isPlaying}},{key:"pushDone",value:function(){this.pushEOF=!0}},{key:"_clearDecInterval",value:function(){this.decVFrameInterval&&window.clearInterval(this.decVFrameInterval),this.decVFrameInterval=null}},{key:"_checkPlayFinished",value:function(){return!(this.config.playMode!==d.PLAYER_MODE_VOD||!(!0===this.bufRecvStat&&(this.playPTS>=this.bufLastVDTS||this.audioWAudio&&this.playPTS>=this.bufLastADTS)||this.duration-this.playPTS0&&(this.isPlaying=!0);var t=0,i=0,n=0;this.config.playMode===d.PLAYER_MODE_NOTIME_LIVE?this.playFrameInterval=window.setInterval((function(){if(e._videoQueue.length>0){var t=e._videoQueue.shift();t.pts,o.renderFrame(e.yuv,t.data_y,t.data_u,t.data_v,t.line1,t.height)}}),1e3*this.frameDur):this.playFrameInterval=window.setInterval((function(){if(i=u.GetMsTime(),e._videoQueue.length>0&&i-t>=e.frameTime-n){var r=e._videoQueue.shift(),a=0;if(e.isNewSeek||null===e.audioWAudio||void 0===e.audioWAudio||(a=1e3*(r.pts-e.audioWAudio.getAlignVPTS()),e.playPTS=Math.max(e.audioWAudio.getAlignVPTS(),e.playPTS)),t=i,u.GetMsTime(),e.playPTS=Math.max(r.pts,e.playPTS),e.isNewSeek&&e.seekTarget-e.frameDur>r.pts)return void(n=e.frameTime);if(e.isNewSeek&&(e.audioWAudio&&e.audioWAudio.setVoice(e.audioVoice),e.audioWAudio&&e.audioWAudio.play(),n=0,e.isNewSeek=!1,e.seekTarget=0),e.showScreen?e.onRender&&e.onRender(r.line1,r.height,r.data_y,r.data_u,r.data_v):(r.pts,o.renderFrame(e.yuv,r.data_y,r.data_u,r.data_v,r.line1,r.height)),e.onPlayingTime&&e.onPlayingTime(r.pts),!e.isNewSeek&&e.audioWAudio&&(a<0&&-1*a<=e.frameTime||a>=0)){if(e.config.playMode===d.PLAYER_MODE_VOD)if(r.pts>=e.duration)e.onLoadCacheFinshed&&e.onLoadCacheFinshed(),e.onPlayingFinish&&e.onPlayingFinish(),e._clearDecInterval(),e.pause();else if(e._checkPlayFinished())return;n=u.GetMsTime()-i}else!e.isNewSeek&&e.audioWAudio&&(a<0&&e.frameTime,n=e.frameTime)}e._checkPlayFinished()}),1)}this.isNewSeek||this.audioWAudio&&this.audioWAudio.play()}},{key:"pause",value:function(){this.isPlaying=!1,this._pause()}},{key:"_pause",value:function(){this.playFrameInterval&&window.clearInterval(this.playFrameInterval),this.playFrameInterval=null,this.audioWAudio&&this.audioWAudio.pause()}},{key:"seek",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.openFrameCall=!1,this.pause(),this._clearDecInterval(),null!==this.avFeedVideoInterval&&(window.clearInterval(this.avFeedVideoInterval),this.avFeedVideoInterval=null),null!==this.avFeedAudioInterval&&(window.clearInterval(this.avFeedAudioInterval),this.avFeedAudioInterval=null),this.yuvMaxTime=0,this.playVPipe.length=0,this._videoQueue.length=0,this.audioWAudio&&this.audioWAudio.stop(),e&&e(),this.isNewSeek=!0,this.avSeekVState=!0,this.seekTarget=i.seekTime,null!==this.audioWAudio&&void 0!==this.audioWAudio&&(this.audioWAudio.setVoice(0),this.audioWAudio.resetStartParam(),this.audioWAudio.stop()),this._avFeedData(i.seekTime),setTimeout((function(){t.yuvMaxTime=0,t._videoQueue.length=0,t.openFrameCall=!0,t.frameCallTag+=1,t._decVFrameIntervalFunc()}),1e3)}},{key:"setVoice",value:function(e){this.audioVoice=e,this.audioWAudio&&this.audioWAudio.setVoice(e)}},{key:"cacheIsFull",value:function(){return this._videoQueue.length>=50}},{key:"_checkDisplaySize",value:function(e,t,i){var n=t-e,r=this.config.width+Math.ceil(n/2),a=t/this.config.width>i/this.config.height,s=(r/t).toFixed(2),o=(this.config.height/i).toFixed(2),u=a?s:o,l=this.config.fixed,d=l?r:parseInt(t*u),h=l?this.config.height:parseInt(i*u);if(this.canvas.offsetWidth!=d||this.canvas.offsetHeight!=h){var c=parseInt((this.canvasBox.offsetHeight-h)/2),f=parseInt((this.canvasBox.offsetWidth-d)/2);c=c<0?0:c,f=f<0?0:f,this.canvas.style.marginTop=c+"px",this.canvas.style.marginLeft=f+"px",this.canvas.style.width=d+"px",this.canvas.style.height=h+"px"}return this.isCheckDisplay=!0,[d,h]}},{key:"_createYUVCanvas",value:function(){this.canvasBox=document.querySelector("#"+this.config.playerId),this.canvasBox.style.overflow="hidden",this.canvas=document.createElement("canvas"),this.canvas.style.width=this.canvasBox.clientWidth+"px",this.canvas.style.height=this.canvasBox.clientHeight+"px",this.canvas.style.top="0px",this.canvas.style.left="0px",this.canvasBox.appendChild(this.canvas),this.yuv=o.setupCanvas(this.canvas,{preserveDrawingBuffer:!1})}},{key:"_avRecvPackets",value:function(){var e=this;this.bufObject.cleanPipeline(),null!==this.avRecvInterval&&(window.clearInterval(this.avRecvInterval),this.avRecvInterval=null),!0===this.config.checkProbe?this.avRecvInterval=window.setInterval((function(){Module.cwrap("getSniffStreamPkg","number",["number"])(e.corePtr),e._avCheckRecvFinish()}),5):this.avRecvInterval=window.setInterval((function(){Module.cwrap("getSniffStreamPkgNoCheckProbe","number",["number"])(e.corePtr),e._avCheckRecvFinish()}),5),this._avFeedData(0,!1)}},{key:"_avCheckRecvFinish",value:function(){this.config.playMode===d.PLAYER_MODE_VOD&&this.duration-this.getMaxPTS()=50&&(t.onSeekFinish&&t.onSeekFinish(),t.onPlayingTime&&t.onPlayingTime(e),t.play(),window.clearInterval(i),i=null)}),10);return!0}},{key:"_afterAvFeedSeekToStartWithUnFinBuffer",value:function(e){var t=this,i=window.setInterval((function(){t._videoQueue.length,t._videoQueue.length>=50&&(t.onSeekFinish&&t.onSeekFinish(),t.onPlayingTime&&t.onPlayingTime(e),!1===t.reFull?t.play():t.reFull=!1,window.clearInterval(i),i=null)}),10);return!0}},{key:"_avFeedData",value:function(e){var t=this;if(this.playVPipe.length=0,this.audioWAudio&&this.audioWAudio.cleanQueue(),e<=0&&!1===this.bufOK){var i=0;if(this.avFeedVideoInterval=window.setInterval((function(){var n=t.bufObject.videoBuffer.length;if(n-1>i||t.duration-t.getMaxPTS()0){for(var s=0;s0&&t.playVPipe[t.playVPipe.length-1].pts>=t.bufLastVDTS&&(window.clearInterval(t.avFeedVideoInterval),t.avFeedVideoInterval=null,t.playVPipe[t.playVPipe.length-1].pts,t.bufLastVDTS,t.bufObject.videoBuffer,t.playVPipe)}else t.config.playMode===d.PLAYER_MODE_VOD&&t.playVPipe.length>0&&t.playVPipe[t.playVPipe.length-1].pts>=t.duration&&(window.clearInterval(t.avFeedVideoInterval),t.avFeedVideoInterval=null,t.playVPipe[t.playVPipe.length-1].pts,t.duration,t.bufObject.videoBuffer,t.playVPipe);t.avSeekVState&&(t.getMaxPTS(),t.duration,t.config.playMode===d.PLAYER_MODE_VOD&&(t._afterAvFeedSeekToStartWithFinishedBuffer(e),t.avSeekVState=!1))}),5),void 0!==this.audioWAudio&&null!==this.audioWAudio&&this.config.ignoreAudio<1){var n=0;this.avFeedAudioInterval=window.setInterval((function(){var e=t.bufObject.audioBuffer.length;if(e-1>n||t.duration-t.getMaxPTS()0&&t.audioWAudio.sampleQueue[t.audioWAudio.sampleQueue.length-1].pts>=t.bufLastADTS&&(window.clearInterval(t.avFeedAudioInterval),t.avFeedAudioInterval=null,t.audioWAudio.sampleQueue[t.audioWAudio.sampleQueue.length-1].pts,t.bufObject.audioBuffer)}else t.config.playMode===d.PLAYER_MODE_VOD&&t.audioWAudio.sampleQueue.length>0&&t.audioWAudio.sampleQueue[t.audioWAudio.sampleQueue.length-1].pts>=t.duration&&(window.clearInterval(t.avFeedAudioInterval),t.avFeedAudioInterval=null,t.audioWAudio.sampleQueue[t.audioWAudio.sampleQueue.length-1].pts,t.bufObject.audioBuffer)}),5)}}else{var r=this.bufObject.seekIDR(e),s=parseInt(r,10);this.playPTS=0;var o=s;if(this.avFeedVideoInterval=window.setInterval((function(){var i=t.bufObject.videoBuffer.length;if(i-1>o||t.duration-t.getMaxPTS()0){for(var r=0;r0&&t.playVPipe[t.playVPipe.length-1].pts>=t.bufLastVDTS&&(window.clearInterval(t.avFeedVideoInterval),t.avFeedVideoInterval=null)}else t.config.playMode===d.PLAYER_MODE_VOD&&t.playVPipe.length>0&&t.playVPipe[t.playVPipe.length-1].pts>=t.duration&&(window.clearInterval(t.avFeedVideoInterval),t.avFeedVideoInterval=null);t.avSeekVState&&(t.getMaxPTS(),t.duration,t.config.playMode===d.PLAYER_MODE_VOD&&(t._afterAvFeedSeekToStartWithUnFinBuffer(e),t.avSeekVState=!1))}),5),this.audioWAudio&&this.config.ignoreAudio<1){var u=parseInt(e,10);this.avFeedAudioInterval=window.setInterval((function(){var e=t.bufObject.audioBuffer.length;if(e-1>u||t.duration-t.getMaxPTS()0&&t.audioWAudio.sampleQueue[t.audioWAudio.sampleQueue.length-1].pts>=t.bufLastADTS&&(window.clearInterval(t.avFeedAudioInterval),t.avFeedAudioInterval=null)}else t.config.playMode===d.PLAYER_MODE_VOD&&t.audioWAudio.sampleQueue.length>0&&t.audioWAudio.sampleQueue[t.audioWAudio.sampleQueue.length-1].pts>=t.duration&&(window.clearInterval(t.avFeedAudioInterval),t.avFeedAudioInterval=null)}),5)}}}},{key:"_probeFinCallback",value:function(e,t,i,n,r,a,s,o,u){var h=this;this._createYUVCanvas(),d.V_CODEC_NAME_HEVC,this.config.fps=1*n,this.frameTime=1e3/this.config.fps,this.width=t,this.height=i,this.frameDur=1/this.config.fps,this.duration=e-this.frameDur,this.vCodecID=o,this.config.sampleRate=a,this.channels=s,this.audioIdx=r,this.duration<0&&(this.config.playMode=d.PLAYER_MODE_NOTIME_LIVE,this.frameTime,this.frameDur);for(var c=Module.HEAPU8.subarray(u,u+10),f=0;f=0&&this.config.ignoreAudio<1?(void 0!==this.audioWAudio&&null!==this.audioWAudio&&(this.audioWAudio.stop(),this.audioWAudio=null),this.audioWAudio=l({sampleRate:a,appendType:d.APPEND_TYPE_FRAME}),this.audioWAudio.setDurationMs(1e3*e),this.onLoadCache&&this.audioWAudio.setOnLoadCache((function(){if(h.retryAuSampleNo,h.retryAuSampleNo<=5){h.pause(),h.onLoadCache&&h.onLoadCache();var e=window.setInterval((function(){return h.retryAuSampleNo,h.audioWAudio.sampleQueue.length,h.audioWAudio.sampleQueue.length>2?(h.onLoadCacheFinshed&&h.onLoadCacheFinshed(),h.play(),h.retryAuSampleNo=0,window.clearInterval(e),void(e=null)):(h.retryAuSampleNo+=1,h.retryAuSampleNo>5?(h.play(),h.onLoadCacheFinshed&&h.onLoadCacheFinshed(),window.clearInterval(e),void(e=null)):void 0)}),1e3)}}))):this.audioNone=!0,this._avRecvPackets(),this._decVFrameIntervalFunc()),this.onProbeFinish&&this.onProbeFinish()}},{key:"_ptsFixed2",value:function(e){return Math.ceil(100*e)/100}},{key:"_naluCallback",value:function(e,t,i,n,r,a,s){var o=this._ptsFixed2(a),u=Module.HEAPU8.subarray(e,e+t),l=new Uint8Array(u);this.bufObject.appendFrameWithDts(o,s,l,!0,i),this.bufLastVDTS=Math.max(s,this.bufLastVDTS),this.vCachePTS=Math.max(o,this.vCachePTS),this.onCacheProcess&&this.onCacheProcess(this.getCachePTS())}},{key:"_samplesCallback",value:function(e,t,i,n){}},{key:"_aacFrameCallback",value:function(e,t,i,n,r){var a=this._ptsFixed2(r);if(this.audioWAudio){var s=new Uint8Array(7+i),o=Module.HEAPU8.subarray(e,e+7);s.set(o,0);var u=Module.HEAPU8.subarray(t,t+i);s.set(u,7),this.bufObject.appendFrame(a,s,!1,!0),this.bufLastADTS=Math.max(a,this.bufLastADTS),this.aCachePTS=Math.max(a,this.aCachePTS),this.onCacheProcess&&this.onCacheProcess(this.getCachePTS())}}},{key:"_decVFrameIntervalFunc",value:function(){var e=this;null==this.decVFrameInterval&&(this.decVFrameInterval=window.setInterval((function(){if(e._videoQueue.length<50&&e.playVPipe.length>0){var t=e.playVPipe.shift(),i=t.data,n=Module._malloc(i.length);Module.HEAP8.set(i,n);var r=parseInt(1e3*t.pts,10),a=parseInt(1e3*t.dts,10);e.yuvMaxTime=Math.max(t.pts,e.yuvMaxTime),Module.cwrap("decodeVideoFrame","number",["number","number","number","number","number"])(e.corePtr,n,i.length,r,a,e.frameCallTag),Module._free(n),n=null}}),10))}},{key:"_frameCallback",value:function(e,t,i,n,r,a,s,u,l,d){if(this._videoQueue.length,!(!1===this.openFrameCall||d!==this.frameCallTag||l>this.yuvMaxTime+this.frameDur||this.isNewSeek&&this.seekTarget-l>3*this.frameDur)){var h=this._videoQueue.length;if(this.canvas.width==n&&this.canvas.height==u||(this.canvas.width=n,this.canvas.height=u,this.isCheckDisplay)||this._checkDisplaySize(s,n,u),!(this.playPTS>l)){var f=Module.HEAPU8.subarray(e,e+n*u),p=Module.HEAPU8.subarray(t,t+r*u/2),m=Module.HEAPU8.subarray(i,i+a*u/2),g=new Uint8Array(f),_=new Uint8Array(p),y=new Uint8Array(m);this.config.readyShow&&(o.renderFrame(this.yuv,g,_,y,n,u),this.config.readyShow=!1,this.onReadyShowDone&&this.onReadyShowDone());var v=new c(g,_,y,n,r,a,s,u,l);if(h<=0||l>this._videoQueue[h-1].pts)this._videoQueue.push(v);else if(lthis._videoQueue[b].pts&&b+10&&(t.getPackageTimeMS=a.GetMsTime()),t.pushPkg++,void 0!==t.AVGetInterval&&null!==t.AVGetInterval||(t.AVGetInterval=window.setInterval((function(){Module.cwrap("getBufferLengthApi","number",["number"])(t.AVSniffPtr)>t.config.probeSize&&(Module.cwrap("getSniffHttpFlvPkg","number",["number"])(t.AVSniffPtr),t.pushPkg-=1)}),5));break;case"close":t.AVGetInterval&&clearInterval(t.AVGetInterval),t.AVGetInterval=null;case"fetch-fin":break;case"fetch-error":t.onNetworkError&&t.onNetworkError(i.data)}}},{key:"_checkDisplaySize",value:function(e,t,i){var n=t-e,r=this.config.width+Math.ceil(n/2),a=t/this.config.width>i/this.config.height,s=(r/t).toFixed(2),o=(this.config.height/i).toFixed(2),u=a?s:o,l=this.config.fixed,d=l?r:parseInt(t*u),h=l?this.config.height:parseInt(i*u);if(this.CanvasObj.offsetWidth!=d||this.CanvasObj.offsetHeight!=h){var c=parseInt((this.canvasBox.offsetHeight-h)/2),f=parseInt((this.canvasBox.offsetWidth-d)/2);c=c<0?0:c,f=f<0?0:f,this.CanvasObj.style.marginTop=c+"px",this.CanvasObj.style.marginLeft=f+"px",this.CanvasObj.style.width=d+"px",this.CanvasObj.style.height=h+"px"}return this.isCheckDisplay=!0,[d,h]}},{key:"_ptsFixed2",value:function(e){return Math.ceil(100*e)/100}},{key:"_callbackProbe",value:function(e,t,i,n,r,a,u,l,d){for(var h=Module.HEAPU8.subarray(d,d+10),c=0;c100&&(f=o.DEFAULT_FPS,this.mediaInfo.noFPS=!0),this.vCodecID=l,this.config.fps=f,this.mediaInfo.fps=f,this.mediaInfo.size.width=t,this.mediaInfo.size.height=i,this.frameTime=Math.floor(1e3/(this.mediaInfo.fps+2)),this.CanvasObj.width==t&&this.CanvasObj.height==i||(this.CanvasObj.width=t,this.CanvasObj.height=i,this.isCheckDisplay)||this._checkDisplaySize(t,t,i),r>=0&&!1===this.mediaInfo.noFPS&&this.config.ignoreAudio<1?(void 0!==this.audioWAudio&&null!==this.audioWAudio&&(this.audioWAudio.stop(),this.audioWAudio=null),this.config.sampleRate=a,this.mediaInfo.sampleRate=a,this.audioWAudio=s({sampleRate:this.mediaInfo.sampleRate,appendType:o.APPEND_TYPE_FRAME}),this.audioWAudio.isLIVE=!0):this.mediaInfo.audioNone=!0,this.onProbeFinish&&this.onProbeFinish()}},{key:"_callbackYUV",value:function(e,t,i,n,r,a,s,o,u){var l=Module.HEAPU8.subarray(e,e+n*o),d=new Uint8Array(l),h=Module.HEAPU8.subarray(t,t+r*o/2),c=new Uint8Array(h),f=Module.HEAPU8.subarray(i,i+a*o/2),p={bufY:d,bufU:c,bufV:new Uint8Array(f),line_y:n,h:o,pts:u};this.YuvBuf.push(p),this.checkCacheState(),Module._free(l),l=null,Module._free(h),h=null,Module._free(f),f=null,!1===this.readyShowDone&&(this.playYUV(),this.readyShowDone=!0,this.onReadyShowDone&&this.onReadyShowDone(),this.audioWAudio||this.play())}},{key:"_callbackNALU",value:function(e,t,i,n,r,a,s){if(!1===this.readyKeyFrame){if(i<=0)return;this.readyKeyFrame=!0}var o=Module.HEAPU8.subarray(e,e+t),u=new Uint8Array(o);this.NaluBuf.push({bufData:u,len:t,isKey:i,w:n,h:r,pts:1e3*a,dts:1e3*s}),Module._free(o),o=null}},{key:"_callbackPCM",value:function(e){}},{key:"_callbackAAC",value:function(e,t,i,n,r){var a=this._ptsFixed2(r);if(this.audioWAudio){var s=new Uint8Array(7+i),o=Module.HEAPU8.subarray(e,e+7);s.set(o,0);var u=Module.HEAPU8.subarray(t,t+i);s.set(u,7);var l={pts:a,data:s};this.audioWAudio.addSample(l),this.checkCacheState()}}},{key:"_decode",value:function(){var e=this;setTimeout((function(){if(null!==e.workerFetch){var t=e.NaluBuf.shift();if(null!=t){var i=Module._malloc(t.bufData.length);Module.HEAP8.set(t.bufData,i),Module.cwrap("decodeHttpFlvVideoFrame","number",["number","number","number","number","number"])(e.AVSniffPtr,i,t.bufData.length,t.pts,t.dts,0),Module._free(i),i=null}e._decode()}}),1)}},{key:"checkCacheState",value:function(){var e=this.YuvBuf.length>=25&&(!0===this.mediaInfo.audioNone||this.audioWAudio&&this.audioWAudio.sampleQueue.length>=50);return!1===this.cache_status&&e&&(this.playInterval&&this.audioWAudio&&this.audioWAudio.play(),this.onLoadCacheFinshed&&this.onLoadCacheFinshed(),this.cache_status=!0),e}},{key:"setVoice",value:function(e){this.audioVoice=e,this.audioWAudio&&this.audioWAudio.setVoice(e)}},{key:"_removeBindFuncPtr",value:function(){null!==this._ptr_probeCallback&&Module.removeFunction(this._ptr_probeCallback),null!==this._ptr_frameCallback&&Module.removeFunction(this._ptr_frameCallback),null!==this._ptr_naluCallback&&Module.removeFunction(this._ptr_naluCallback),null!==this._ptr_sampleCallback&&Module.removeFunction(this._ptr_sampleCallback),null!==this._ptr_aacCallback&&Module.removeFunction(this._ptr_aacCallback),this._ptr_probeCallback=null,this._ptr_frameCallback=null,this._ptr_naluCallback=null,this._ptr_sampleCallback=null,this._ptr_aacCallback=null}},{key:"release",value:function(){return this.pause(),this.NaluBuf.length=0,this.YuvBuf.length=0,void 0!==this.workerFetch&&null!==this.workerFetch&&this.workerFetch.postMessage({cmd:"stop",data:"stop",msg:"stop"}),this.workerFetch=null,this.AVGetInterval&&clearInterval(this.AVGetInterval),this.AVGetInterval=null,this._removeBindFuncPtr(),Module.cwrap("releaseHttpFLV","number",["number"])(this.AVSniffPtr),this.playInterval&&clearInterval(this.playInterval),this.playInterval=null,this.audioWAudio&&this.audioWAudio.stop(),this.audioWAudio=null,this.CanvasObj&&this.CanvasObj.remove(),this.CanvasObj=null,0}},{key:"isPlayingState",value:function(){return null!==this.playInterval&&void 0!==this.playInterval}},{key:"pause",value:function(){this.audioWAudio&&this.audioWAudio.pause(),this.playInterval&&clearInterval(this.playInterval),this.playInterval=null}},{key:"playYUV",value:function(){if(this.YuvBuf.length>0){var e=this.YuvBuf.shift();return r.renderFrame(this.AVGLObj,e.bufY,e.bufU,e.bufV,e.line_y,e.h),!0}return!1}},{key:"play",value:function(){var e=this,t=this;if(!1===this.checkCacheState())return this.onLoadCache&&this.onLoadCache(),setTimeout((function(){e.play()}),100),!1;if(void 0===this.playInterval||null===this.playInterval){var i=0,n=0,s=0;!1===this.mediaInfo.audioNone&&this.audioWAudio&&!1===this.mediaInfo.noFPS?(this.playInterval=setInterval((function(){if(n=a.GetMsTime(),t.cache_status){if(n-i>=t.frameTime-s){var e=t.YuvBuf.shift();if(null!=e&&null!==e){var o=0;null!==t.audioWAudio&&void 0!==t.audioWAudio&&(o=1e3*(e.pts-t.audioWAudio.getAlignVPTS())),s=t.audioWAudio?o<0&&-1*o<=t.frameTime||o>=0?a.GetMsTime()-n+1:t.frameTime:a.GetMsTime()-n+1,r.renderFrame(t.AVGLObj,e.bufY,e.bufU,e.bufV,e.line_y,e.h)}(t.YuvBuf.length<=0||t.audioWAudio&&t.audioWAudio.sampleQueue.length<=0)&&(t.cache_status=!1,t.onLoadCache&&t.onLoadCache(),t.audioWAudio&&t.audioWAudio.pause()),i=n}}else s=t.frameTime}),1),this.audioWAudio&&this.audioWAudio.play()):this.playInterval=setInterval((function(){var e=t.YuvBuf.shift();null!=e&&null!==e&&r.renderFrame(t.AVGLObj,e.bufY,e.bufU,e.bufV,e.line_y,e.h),t.YuvBuf.length<=0&&(t.cache_status=!1)}),t.frameTime)}}},{key:"start",value:function(e){var t,i,n,a=this;this.workerFetch=new Worker((t=function(){var e=null;self,self.onmessage=function(t){var i=t.data;switch(void 0===i.cmd||null===i.cmd?"":i.cmd){case"start":var n=i.data;(e=new WebSocket(n)).binaryType="arraybuffer",e.onopen=function(t){e.send("Hello WebSockets!")},e.onmessage=function(e){if(e.data instanceof ArrayBuffer){var t=e.data;t.byteLength>0&&postMessage({cmd:"fetch-chunk",data:new Uint8Array(t),msg:"fetch-chunk"})}},e.onclose=function(e){};break;case"stop":e&&e.close(),self.close(),self.postMessage({cmd:"close",data:"close",msg:"close"})}}}.toString(),i=t.match(/^\s*function\s*\(\s*\)\s*\{(([\s\S](?!\}$))*[\s\S])/),n=[i[1]],window.URL.createObjectURL(new Blob(n,{type:"text/javascript"})))),this.workerFetch.onmessage=function(e){a._workerFetch_onmessage(e,a)},this.workerFetch,this.AVSniffPtr=Module.cwrap("AVSniffHttpFlvInit","number",["string","string"])("base64:QXV0aG9yOmNoYW5neWFubG9uZ3xudW1iZXJ3b2xmLEdpdGh1YjpodHRwczovL2dpdGh1Yi5jb20vbnVtYmVyd29sZixFbWFpbDpwb3JzY2hlZ3QyM0Bmb3htYWlsLmNvbSxRUTo1MzEzNjU4NzIsSG9tZVBhZ2U6aHR0cDovL3h2aWRlby52aWRlbyxEaXNjb3JkOm51bWJlcndvbGYjODY5NCx3ZWNoYXI6bnVtYmVyd29sZjExLEJlaWppbmcsV29ya0luOkJhaWR1","0.0.0"),this.AVSniffPtr,this._ptr_probeCallback=Module.addFunction(this._callbackProbe.bind(this)),this._ptr_yuvCallback=Module.addFunction(this._callbackYUV.bind(this)),this._ptr_naluCallback=Module.addFunction(this._callbackNALU.bind(this)),this._ptr_sampleCallback=Module.addFunction(this._callbackPCM.bind(this)),this._ptr_aacCallback=Module.addFunction(this._callbackAAC.bind(this)),Module.cwrap("initializeSniffHttpFlvModule","number",["number","number","number","number","number","number"])(this.AVSniffPtr,this._ptr_probeCallback,this._ptr_yuvCallback,this._ptr_naluCallback,this._ptr_sampleCallback,this._ptr_aacCallback),this.AVGLObj=r.setupCanvas(this.CanvasObj,{preserveDrawingBuffer:!1}),this.workerFetch.postMessage({cmd:"start",data:e,msg:"start"}),this._decode()}}])&&n(t.prototype,i),u&&n(t,u),e}();i.CWsLiveCore=u},{"../consts":52,"../demuxer/buffer":64,"../demuxer/bufferFrame":65,"../render-engine/webgl-420p":77,"../version":80,"./audio-core":53,"./audio-native-core":54,"./av-common":55,"./cache":59,"./cacheYuv":60}],59:[function(e,t,i){(function(i){"use strict";e("./cacheYuv");i.CACHE_APPEND_STATUS_CODE={FAILED:-1,OVERFLOW:-2,OK:0,NOT_FULL:1,FULL:2,NULL:3},t.exports=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:60,t={limit:e,yuvCache:[],appendCacheByCacheYuv:function(e){e.pts;return t.yuvCache.length>=t.limit?CACHE_APPEND_STATUS_CODE.OVERFLOW:(t.yuvCache.push(e),t.yuvCache.length>=t.limit?CACHE_APPEND_STATUS_CODE.FULL:CACHE_APPEND_STATUS_CODE.NOT_FULL)},getState:function(){return t.yuvCache.length<=0?CACHE_APPEND_STATUS_CODE.NULL:t.yuvCache.length>=t.limit?CACHE_APPEND_STATUS_CODE.FULL:CACHE_APPEND_STATUS_CODE.NOT_FULL},cleanPipeline:function(){t.yuvCache.length=0},vYuv:function(){return t.yuvCache.length<=0?null:t.yuvCache.shift()}};return t}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./cacheYuv":60}],60:[function(e,t,i){"use strict";function n(e,t){for(var i=0;i>1;return r.indexOf(t)},GET_NALU_TYPE:function(e){var t=(126&e)>>1;if(t>=1&&t<=9)return n.DEFINE_P_FRAME;if(t>=16&&t<=21)return n.DEFINE_KEY_FRAME;var i=r.indexOf(t);return i>=0?r[i]:n.DEFINE_OTHERS_FRAME},PACK_NALU:function(e){var t=e.nalu,i=e.vlc.vlc;null==t.vps&&(t.vps=new Uint8Array);var n=new Uint8Array(t.vps.length+t.sps.length+t.pps.length+t.sei.length+i.length);return n.set(t.vps,0),n.set(t.sps,t.vps.length),n.set(t.pps,t.vps.length+t.sps.length),n.set(t.sei,t.vps.length+t.sps.length+t.pps.length),n.set(i,t.vps.length+t.sps.length+t.pps.length+t.sei.length),n}}},{"./hevc-header":61}],63:[function(e,t,i){"use strict";function n(e){return function(e){if(Array.isArray(e)){for(var t=0,i=new Array(e.length);t0&&void 0!==arguments[0]&&arguments[0];null!=t&&(t.showScreen=e,t.canvas&&(e?t.canvas.setAttribute("hidden",!0):t.canvas.removeAttribute("hidden")))},setSize:function(e,i){t.config.width=e||l.DEFAULT_WIDTH,t.config.height=i||l.DEFAULT_HEIGHT},setFrameRate:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:25;t.config.fps=e,t.config.frameDurMs=1e3/e},setDurationMs:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1;t.durationMs=e,0==t.config.audioNone&&t.audio.setDurationMs(e)},setPlayingCall:function(e){t.onPlayingTime=e},setVoice:function(e){t.realVolume=e,0==t.config.audioNone&&t.audio.setVoice(t.realVolume)},isPlayingState:function(){return t.isPlaying||t.isCaching===l.CACHE_WITH_PLAY_SIGN},appendAACFrame:function(e){t.audio.addSample(e),t.aCachePTS=Math.max(e.pts,t.aCachePTS)},appendHevcFrame:function(e){var i;t.config.appendHevcType==l.APPEND_TYPE_STREAM?t.stream=new Uint8Array((i=n(t.stream)).concat.apply(i,n(e))):t.config.appendHevcType==l.APPEND_TYPE_FRAME&&(t.frameList.push(e),t.vCachePTS=Math.max(e.pts,t.vCachePTS))},getCachePTS:function(){return Math.max(t.vCachePTS,t.aCachePTS)},endAudio:function(){0==t.config.audioNone&&t.audio.stop()},cleanSample:function(){0==t.config.audioNone&&t.audio.cleanQueue()},cleanVideoQueue:function(){t.config.appendHevcType==l.APPEND_TYPE_STREAM?t.stream=new Uint8Array:t.config.appendHevcType==l.APPEND_TYPE_FRAME&&(t.frameList=[],t.frameList.length=0)},cleanCacheYUV:function(){t.cacheYuvBuf.cleanPipeline()},pause:function(){t.loop&&window.clearInterval(t.loop),t.loop=null,0==t.config.audioNone&&t.audio.pause(),t.isPlaying=!1,t.isCaching===l.CACHE_WITH_PLAY_SIGN&&(t.isCaching=l.CACHE_WITH_NOPLAY_SIGN)},checkFinished:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:l.PLAYER_MODE_VOD;return e==l.PLAYER_MODE_VOD&&t.cacheYuvBuf.yuvCache.length<=0&&(t.videoPTS.toFixed(1)>=(t.durationMs-t.config.frameDurMs)/1e3||t.noCacheFrame>=10)&&(null!=t.onPlayingFinish&&(l.PLAYER_MODE_VOD,t.frameList.length,t.cacheYuvBuf.yuvCache.length,t.videoPTS.toFixed(1),t.durationMs,t.config.frameDurMs,t.noCacheFrame,t.onPlayingFinish()),!0)},clearAllCache:function(){t.nowPacket=null,t.vCachePTS=0,t.aCachePTS=0,t.cleanSample(),t.cleanVideoQueue(),t.cleanCacheYUV()},seek:function(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.isPlaying;t.pause(),t.stopCacheThread(),t.clearAllCache(),e&&e(),t.isNewSeek=!0,t.flushDecoder=1,t.videoPTS=parseInt(i.seekTime);var r={seekPos:i.seekTime||-1,mode:i.mode||l.PLAYER_MODE_VOD,accurateSeek:i.accurateSeek||!0,seekEvent:i.seekEvent||!0,realPlay:n};t.cacheThread(),t.play(r)},getNalu1Packet:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],i=null,n=-1;if(t.config.appendHevcType==l.APPEND_TYPE_STREAM)i=t.nextNalu();else{if(t.config.appendHevcType!=l.APPEND_TYPE_FRAME)return null;var r=t.frameList.shift();if(!r)return null;i=r.data,n=r.pts,e&&(t.videoPTS=n)}return{nalBuf:i,pts:n}},decodeNalu1Frame:function(e,i){var n=Module._malloc(e.length);Module.HEAP8.set(e,n);var r=parseInt(1e3*i);Module.cwrap("decodeCodecContext","number",["number","number","number","number","number"])(t.vcodecerPtr,n,e.length,r,t.flushDecoder);return t.flushDecoder=0,Module._free(n),!1},cacheThread:function(){t.cacheLoop=window.setInterval((function(){if(t.cacheYuvBuf.getState()!=CACHE_APPEND_STATUS_CODE.FULL){var e=t.getNalu1Packet(!1);if(null!=e){var i=e.nalBuf,n=e.pts;t.decodeNalu1Frame(i,n,!0)}}}),10)},stopCacheThread:function(){null!==t.cacheLoop&&(window.clearInterval(t.cacheLoop),t.cacheLoop=null)},loadCache:function(){if(!(t.frameList.length<=3)){var e=t.isPlaying;if(t.cacheYuvBuf.yuvCache.length<=3){t.pause(),null!=t.onLoadCache&&t.onLoadCache(),t.isCaching=e?l.CACHE_WITH_PLAY_SIGN:l.CACHE_WITH_NOPLAY_SIGN;var i=t.frameList.length>30?30:t.frameList.length;null===t.cacheInterval&&(t.cacheInterval=window.setInterval((function(){t.cacheYuvBuf.yuvCache.length>=i&&(null!=t.onLoadCacheFinshed&&t.onLoadCacheFinshed(),window.clearInterval(t.cacheInterval),t.cacheInterval=null,t.isCaching===l.CACHE_WITH_PLAY_SIGN&&t.play(t.playParams),t.isCaching=l.CACHE_NO_LOADCACHE)}),40))}}},playFunc:function(){var e=!1;if(t.playParams.seekEvent||r.GetMsTime()-t.calcuteStartTime>=t.frameTime-t.preCostTime){e=!0;var i=!0;if(t.calcuteStartTime=r.GetMsTime(),t.config.audioNone)t.playFrameYUV(i,t.playParams.accurateSeek);else{t.fix_poc_err_skip>0&&(t.fix_poc_err_skip--,i=!1);var n=t.videoPTS-t.audio.getAlignVPTS();if(n>0)return void(t.playParams.seekEvent&&!t.config.audioNone&&t.audio.setVoice(0));if(i){if(!(i=-1*n<=1*t.frameTimeSec)){for(var a=parseInt(n/t.frameTimeSec),s=0;s=i&&(t.playFrameYUV(!0,t.playParams.accurateSeek),i+=1)}),1)}else t.videoPTS>=t.playParams.seekPos&&!t.isNewSeek||0===t.playParams.seekPos||0===t.playParams.seekPos?(t.frameTime=1e3/t.config.fps,t.frameTimeSec=t.frameTime/1e3,0==t.config.audioNone&&t.audio.play(),t.realVolume=t.config.audioNone?0:t.audio.voice,t.playParams.seekEvent&&(t.fix_poc_err_skip=10),t.loop=window.setInterval((function(){var e=r.GetMsTime();t.playFunc(),t.preCostTime=r.GetMsTime()-e}),1)):(t.loop=window.setInterval((function(){t.playFrameYUV(!1,t.playParams.accurateSeek),t.checkFinished(t.playParams.mode)?(window.clearInterval(t.loop),t.loop=null):t.videoPTS>=t.playParams.seekPos&&(window.clearInterval(t.loop),t.loop=null,t.play(t.playParams))}),1),t.isNewSeek=!1)},stop:function(){t.release(),Module.cwrap("initializeDecoder","number",["number"])(t.vcodecerPtr),t.stream=new Uint8Array},release:function(){return t.endAudio(),t.cacheLoop&&window.clearInterval(t.cacheLoop),t.cacheLoop=null,t.loop&&window.clearInterval(t.loop),t.loop=null,t.pause(),null!==t.videoCallback&&Module.removeFunction(t.videoCallback),t.videoCallback=null,Module.cwrap("release","number",["number"])(t.vcodecerPtr),t.stream=null,t.frameList.length=0,t.durationMs=-1,t.videoPTS=0,t.isPlaying=!1,!0},nextNalu:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;if(t.stream.length<=4)return!1;for(var i=-1,n=0;n=t.stream.length){if(-1==i)return!1;var r=t.stream.subarray(i);return t.stream=new Uint8Array,r}var a="0 0 1"==t.stream.slice(0,3).join(" "),s="0 0 0 1"==t.stream.slice(0,4).join(" ");if(a||s){if(-1==i)i=n;else{if(e<=1){var o=t.stream.subarray(i,n);return t.stream=t.stream.subarray(n),o}e-=1}n+=3}}return!1},decodeSendPacket:function(e){var i=Module._malloc(e.length);Module.HEAP8.set(e,i);var n=Module.cwrap("decodeSendPacket","number",["number","number","number"])(t.vcodecerPtr,i,e.length);return Module._free(i),n},decodeRecvFrame:function(){return Module.cwrap("decodeRecv","number",["number"])(t.vcodecerPtr)},playFrameYUV:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],i=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=t.cacheYuvBuf.vYuv();if(null==n)return t.noCacheFrame+=1,e&&!t.playParams.seekEvent&&t.loadCache(),!1;t.noCacheFrame=0;var r=n.pts;return t.videoPTS=r,(!e&&i||e)&&e&&t.drawImage(n.width,n.height,n.imageBufferY,n.imageBufferB,n.imageBufferR),e&&!t.playParams.seekEvent&&t.isPlaying&&t.loadCache(),!0},drawImage:function(e,i,n,r,a){if(t.canvas.width===e&&t.canvas.height==i||(t.canvas.width=e,t.canvas.height=i),t.showScreen&&null!=t.onRender)t.onRender(e,i,n,r,a);else{if(!t.isCheckDisplay)t.checkDisplaySize(e,i);var s=e*i,o=e/2*(i/2),l=new Uint8Array(s+2*o);l.set(n,0),l.set(r,s),l.set(a,s+o),u.renderFrame(t.yuv,n,r,a,e,i)}},debugYUV:function(e){t.debugYUVSwitch=!0,t.debugID=e},checkDisplaySize:function(e,i){var n=e/t.config.width>i/t.config.height,r=(t.config.width/e).toFixed(2),a=(t.config.height/i).toFixed(2),s=n?r:a,o=t.config.fixed,u=o?t.config.width:parseInt(e*s),l=o?t.config.height:parseInt(i*s);if(t.canvas.offsetWidth!=u||t.canvas.offsetHeight!=l){var d=parseInt((t.canvasBox.offsetHeight-l)/2),h=parseInt((t.canvasBox.offsetWidth-u)/2);t.canvas.style.marginTop=d+"px",t.canvas.style.marginLeft=h+"px",t.canvas.style.width=u+"px",t.canvas.style.height=l+"px"}return t.isCheckDisplay=!0,[u,l]},makeWasm:function(){if(null!=t.config.token){t.vcodecerPtr=Module.cwrap("registerPlayer","number",["string","string"])(t.config.token,d.PLAYER_VERSION),t.videoCallback=Module.addFunction((function(e,i,n,r,a,s,u,l,d){var h=Module.HEAPU8.subarray(e,e+r*l),c=Module.HEAPU8.subarray(i,i+a*l/2),f=Module.HEAPU8.subarray(n,n+s*l/2),p=new Uint8Array(h),m=new Uint8Array(c),g=new Uint8Array(f),_=1*d/1e3,y=new o.CacheYuvStruct(_,r,l,p,m,g);t.cacheYuvBuf.appendCacheByCacheYuv(y)})),Module.cwrap("setCodecType","number",["number","number","number"])(t.vcodecerPtr,t.config.videoCodec,t.videoCallback);Module.cwrap("initMissile","number",["number"])(t.vcodecerPtr);Module.cwrap("initializeDecoder","number",["number"])(t.vcodecerPtr)}},makeIt:function(){var e=document.querySelector("div#"+t.config.playerId),i=document.createElement("canvas");i.style.width=e.clientWidth+"px",i.style.height=e.clientHeight+"px",i.style.top="0px",i.style.left="0px",e.appendChild(i),t.canvasBox=e,t.canvas=i,t.yuv=u.setupCanvas(i,{preserveDrawingBuffer:!1}),0==t.config.audioNone&&(t.audio=a({sampleRate:t.config.sampleRate,appendType:t.config.appendHevcType})),t.isPlayLoadingFinish=1}};return t.makeWasm(),t.makeIt(),t.cacheThread(),t}},{"../consts":52,"../render-engine/webgl-420p":77,"../version":80,"./audio-core":53,"./av-common":55,"./cache":59,"./cacheYuv":60}],64:[function(e,t,i){"use strict";var n=e("./bufferFrame");t.exports=function(){var e={videoBuffer:[],audioBuffer:[],idrIdxBuffer:[],appendFrame:function(t,i){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],s=new n.BufferFrame(t,a,i,r),o=parseInt(t);return r?(e.videoBuffer.length-1>=o?e.videoBuffer[o].push(s):e.videoBuffer.push([s]),a&&!e.idrIdxBuffer.includes(t)&&e.idrIdxBuffer.push(t)):e.audioBuffer.length-1>=o&&null!=e.audioBuffer[o]&&null!=e.audioBuffer[o]?e.audioBuffer[o]&&e.audioBuffer[o].push(s):e.audioBuffer.push([s]),!0},appendFrameWithDts:function(t,i,r){var a=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],s=arguments.length>4&&void 0!==arguments[4]&&arguments[4],o=n.ConstructWithDts(t,i,s,r,a),u=parseInt(i);return a?(e.videoBuffer.length-1>=u?e.videoBuffer[u].push(o):e.videoBuffer.push([o]),s&&!e.idrIdxBuffer.includes(i)&&e.idrIdxBuffer.push(i)):e.audioBuffer.length-1>=u&&null!=e.audioBuffer[u]&&null!=e.audioBuffer[u]?e.audioBuffer[u]&&e.audioBuffer[u].push(o):e.audioBuffer.push([o]),!0},appendFrameByBufferFrame:function(t){var i=t.pts,n=parseInt(i);return t.video?(e.videoBuffer.length-1>=n?e.videoBuffer[n].push(t):e.videoBuffer.push([t]),isKey&&!e.idrIdxBuffer.includes(i)&&e.idrIdxBuffer.push(i)):e.audioBuffer.length-1>=n?e.audioBuffer[n].push(t):e.audioBuffer.push([t]),!0},cleanPipeline:function(){e.videoBuffer.length=0,e.audioBuffer.length=0},vFrame:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1;if(!(t<0||t>e.videoBuffer.length-1))return e.videoBuffer[t]},aFrame:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1;if(!(t<0||t>e.audioBuffer.length-1))return e.audioBuffer[t]},seekIDR:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1;if(e.idrIdxBuffer,e.videoBuffer,t<0)return null;if(e.idrIdxBuffer.includes(t))return t;for(var i=0;it||0===i&&e.idrIdxBuffer[i]>=t){for(var n=1;n>=0;n--){var r=i-n;if(r>=0)return e.idrIdxBuffer[r],e.idrIdxBuffer[r]}return e.idrIdxBuffer[i],j,e.idrIdxBuffer[i]}}};return e}},{"./bufferFrame":65}],65:[function(e,t,i){"use strict";function n(e,t){for(var i=0;i0&&i.extensionInfo.vHeight>0&&(i.size.width=i.extensionInfo.vWidth,i.size.height=i.extensionInfo.vHeight)),i.mediaInfo.duration,null!=i.onDemuxed&&i.onDemuxed(i.onReadyOBJ);for(var e=!1;void 0!==i.mpegTsObj&&null!==i.mpegTsObj;){var n=i.mpegTsObj.readPacket();if(n.size<=0)break;var r=n.dtime>0?n.dtime:n.ptime;if(!(r<0)){if(0==n.type){r<=i.vPreFramePTS&&(e=!0);var a=u.PACK_NALU(n.layer),o=1==n.keyframe,l=1==e?r+i.vStartTime:r,d=new s.BufferFrame(l,o,a,!0);i.bufObject.appendFrame(d.pts,d.data,!0,d.isKey),i.vPreFramePTS=l,null!=i.onSamples&&i.onSamples(i.onReadyOBJ,d)}else if(r<=i.aPreFramePTS&&(e=!0),"aac"==i.mediaInfo.aCodec)for(var h=n.data,c=0;c=3?(i._onTsReady(e),window.clearInterval(i.timerTsWasm),i.timerTsWasm=null):(i.mpegTsWasmRetryLoadTimes+=1,i.mpegTsObj.initDemuxer())}),3e3)}},{key:"_onTsReady",value:function(e){var t=this;t.hls.fetchM3u8(e),t.mpegTsWasmState=!0,t.timerFeed=window.setInterval((function(){if(t.tsList.length>0&&0==t.lockWait.state)try{var e=t.tsList.shift();if(null!=e){var i=e.streamURI,n=e.streamDur;t.lockWait.state=!0,t.lockWait.lockMember.dur=n,t.mpegTsObj.isLive=t.hls.isLive(),t.mpegTsObj.demuxURL(i)}else console.error("_onTsReady need wait ")}catch(e){console.error("onTsReady ERROR:",e),t.lockWait.state=!1}}),50)}},{key:"release",value:function(){this.hls&&this.hls.release(),this.hls=null,this.timerFeed&&window.clearInterval(this.timerFeed),this.timerFeed=null,this.timerTsWasm&&window.clearInterval(this.timerTsWasm),this.timerTsWasm=null}},{key:"bindReady",value:function(e){this.onReadyOBJ=e}},{key:"popBuffer",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;return t<0?null:1===e?t+1>this.bufObject.videoBuffer.length?null:this.bufObject.vFrame(t):2===e?t+1>this.bufObject.audioBuffer.length?null:this.bufObject.aFrame(t):void 0}},{key:"getVLen",value:function(){return this.bufObject.videoBuffer.length}},{key:"getALen",value:function(){return this.bufObject.audioBuffer.length}},{key:"getLastIdx",value:function(){return this.bufObject.videoBuffer.length-1}},{key:"getALastIdx",value:function(){return this.bufObject.audioBuffer.length-1}},{key:"getACodec",value:function(){return this.aCodec}},{key:"getVCodec",value:function(){return this.vCodec}},{key:"getDurationMs",value:function(){return this.durationMs}},{key:"getFPS",value:function(){return this.fps}},{key:"getSampleRate",value:function(){return this.sampleRate}},{key:"getSampleChannel",value:function(){return this.aChannel}},{key:"getSize",value:function(){return this.size}},{key:"seek",value:function(e){if(e>=0){var t=this.bufObject.seekIDR(e);this.seekPos=t}}}])&&n(t.prototype,i),d&&n(t,d),e}();i.M3u8=d},{"../consts":52,"../decoder/hevc-imp":62,"./buffer":64,"./bufferFrame":65,"./m3u8base":67,"./mpegts/mpeg.js":71}],67:[function(e,t,i){"use strict";function n(e,t){for(var i=0;i ",t),setTimeout((function(){i.fetchM3u8(e)}),500)}))}},{key:"_uriParse",value:function(e){this._preURI="";var t=e.split("//"),i=null,n=null;if(t.length<1)return!1;t.length>1?(i=t[0],n=t[1].split("/"),this._preURI=i+"//"):n=t[0].split("/");for(var r=0;rp&&(o=p);var m=n[l+=1],g=null;g=m.indexOf("http")>=0?m:this._preURI+m,this._slices.indexOf(g)<0&&(this._slices.push(g),this._slices[this._slices.length-1],null!=this.onTransportStream&&this.onTransportStream(g,p))}}}if(this._slices.length>s.hlsSliceLimit&&this._type==r.PLAYER_IN_TYPE_M3U8_LIVE&&(this._slices=this._slices.slice(-1*s.hlsSliceLimit)),null!=this.onFinished){var _={type:this._type,duration:-1};this.onFinished(_)}return o}},{key:"_readTag",value:function(e){var t=s.tagParse.exec(e);return null!==t?{key:t[1],value:t[3]}:null}}])&&n(t.prototype,i),o&&n(t,o),e}();i.M3u8Base=o},{"../consts":52}],68:[function(e,t,i){"use strict";var n=e("mp4box"),r=e("../decoder/hevc-header"),a=e("../decoder/hevc-imp"),s=e("./buffer"),o=e("../consts"),u={96e3:0,88200:1,64e3:2,48e3:3,44100:4,32e3:5,24e3:6,22050:7,16e3:8,12e3:9,11025:10,8e3:11,7350:12,Reserved:13,"frequency is written explictly":15},l=function(e){for(var t=[],i=0;i1&&void 0!==arguments[1]&&arguments[1],i=null;return t?((i=e)[0]=r.DEFINE_STARTCODE[0],i[1]=r.DEFINE_STARTCODE[1],i[2]=r.DEFINE_STARTCODE[2],i[3]=r.DEFINE_STARTCODE[3]):((i=new Uint8Array(r.DEFINE_STARTCODE.length+e.length)).set(r.DEFINE_STARTCODE,0),i.set(e,r.DEFINE_STARTCODE.length)),i},d.prototype.setAACAdts=function(e){var t=null,i=this.aacProfile,n=u[this.sampleRate],r=new Uint8Array(7),a=r.length+e.length;return r[0]=255,r[1]=241,r[2]=(i-1<<6)+(n<<2)+0,r[3]=128+(a>>11),r[4]=(2047&a)>>3,r[5]=31+((7&a)<<5),r[6]=252,(t=new Uint8Array(a)).set(r,0),t.set(e,r.length),t},d.prototype.demux=function(){var e=this;e.seekPos=-1,e.mp4boxfile=n.createFile(),e.movieInfo=null,e.videoCodec=null,e.durationMs=-1,e.fps=-1,e.sampleRate=-1,e.aacProfile=2,e.size={width:-1,height:-1},e.bufObject=s(),e.audioNone=!1,e.naluHeader={vps:null,sps:null,pps:null,sei:null},e.mp4boxfile.onError=function(e){},this.mp4boxfile.onReady=function(t){for(var i in e.movieInfo=t,t.tracks)"VideoHandler"!==t.tracks[i].name&&"video"!==t.tracks[i].type||(t.tracks[i].codec,t.tracks[i].codec.indexOf("hev")>=0||t.tracks[i].codec.indexOf("hvc")>=0?e.videoCodec=o.CODEC_H265:t.tracks[i].codec.indexOf("avc")>=0&&(e.videoCodec=o.CODEC_H264));var n=-1;if(n=t.videoTracks[0].samples_duration/t.videoTracks[0].timescale,e.durationMs=1e3*n,e.fps=t.videoTracks[0].nb_samples/n,e.seekDiffTime=1/e.fps,e.size.width=t.videoTracks[0].track_width,e.size.height=t.videoTracks[0].track_height,t.audioTracks.length>0){e.sampleRate=t.audioTracks[0].audio.sample_rate;var r=t.audioTracks[0].codec.split(".");e.aacProfile=r[r.length-1]}else e.audioNone=!0;null!=e.onMp4BoxReady&&e.onMp4BoxReady(e.videoCodec),e.videoCodec===o.CODEC_H265?(e.initializeAllSourceBuffers(),e.mp4boxfile.start()):(e.videoCodec,o.CODEC_H264)},e.mp4boxfile.onSamples=function(t,i,n){var s=window.setInterval((function(){for(var i=0;i3?e.naluHeader.sei=e.setStartCode(g[3][0].data,!1):e.naluHeader.sei=new Uint8Array,e.naluHeader}else e.videoCodec==o.CODEC_H264&&(e.naluHeader.vps=new Uint8Array,e.naluHeader.sps=e.setStartCode(f.SPS[0].nalu,!1),e.naluHeader.pps=e.setStartCode(f.PPS[0].nalu,!1),e.naluHeader.sei=new Uint8Array);d[4].toString(16),e.naluHeader.vps[4].toString(16),l(e.naluHeader.vps),l(d);var _=e.setStartCode(d.subarray(0,e.naluHeader.vps.length),!0);if(l(_),d[4]===e.naluHeader.vps[4]){var y=e.naluHeader.vps.length+4,v=e.naluHeader.vps.length+e.naluHeader.sps.length+4,b=e.naluHeader.vps.length+e.naluHeader.sps.length+e.naluHeader.pps.length+4;if(e.naluHeader.sei.length<=0&&e.naluHeader.sps.length>0&&d[y]===e.naluHeader.sps[4]&&e.naluHeader.pps.length>0&&d[v]===e.naluHeader.pps[4]&&78===d[b]){d[e.naluHeader.vps.length+4],e.naluHeader.sps[4],d[e.naluHeader.vps.length+e.naluHeader.sps.length+4],e.naluHeader.pps[4],d[e.naluHeader.vps.length+e.naluHeader.sps.length+e.naluHeader.pps.length+4];for(var T=0,S=0;S4&&d[4]===e.naluHeader.sei[4]){var E=d.subarray(0,10),w=new Uint8Array(e.naluHeader.vps.length+E.length);w.set(E,0),w.set(e.naluHeader.vps,E.length),w[3]=1,e.naluHeader.vps=null,e.naluHeader.vps=new Uint8Array(w),w=null,E=null,(d=d.subarray(10))[4],e.naluHeader.vps[4],e.naluHeader.vps}else if(0===e.naluHeader.sei.length&&78===d[4]){d=e.setStartCode(d,!0);for(var C=0,A=0;A1&&void 0!==arguments[1]?arguments[1]:0;return e.fileStart=t,this.mp4boxfile.appendBuffer(e)},d.prototype.finishBuffer=function(){this.mp4boxfile.flush()},d.prototype.play=function(){},d.prototype.getVideoCoder=function(){return this.videoCodec},d.prototype.getDurationMs=function(){return this.durationMs},d.prototype.getFPS=function(){return this.fps},d.prototype.getSampleRate=function(){return this.sampleRate},d.prototype.getSize=function(){return this.size},d.prototype.seek=function(e){if(e>=0){var t=this.bufObject.seekIDR(e);this.seekPos=t}},d.prototype.popBuffer=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;return t<0?null:1==e?this.bufObject.vFrame(t):2==e?this.bufObject.aFrame(t):void 0},d.prototype.addBuffer=function(e){var t=e.id;this.mp4boxfile.setExtractionOptions(t)},d.prototype.initializeAllSourceBuffers=function(){if(this.movieInfo){for(var e=this.movieInfo,t=0;t>5)}},{key:"sliceAACFrames",value:function(e,t){for(var i=[],n=e,r=0;r>4==15){var a=this._getPktLen(t[r+3],t[r+4],t[r+5]);if(a<=0)continue;var s=t.subarray(r,r+a),o=new Uint8Array(a);o.set(s,0),i.push({ptime:n,data:o}),n+=this.frameDurSec,r+=a}else r+=1;return i}}])&&n(t.prototype,i),r&&n(t,r),e}();i.AACDecoder=r},{}],71:[function(e,t,i){(function(t){"use strict";function n(e,t){for(var i=0;i ",e),n=null})).catch((function(i){console.error("demuxerTsInit ERROR fetch ERROR ==> ",i),t._releaseOffset(),t.onDemuxedFailed&&t.onDemuxedFailed(i,e)}))}},{key:"_releaseOffset",value:function(){void 0!==this.offsetDemux&&null!==this.offsetDemux&&(Module._free(this.offsetDemux),this.offsetDemux=null)}},{key:"_demuxCore",value:function(e){if(this._releaseOffset(),this._refreshDemuxer(),!(e.length<=0)){this.offsetDemux=Module._malloc(e.length),Module.HEAP8.set(e,this.offsetDemux);var t=Module.cwrap("demuxBox","number",["number","number","number"])(this.offsetDemux,e.length,this.isLive);Module._free(this.offsetDemux),this.offsetDemux=null,t>=0&&(this._setMediaInfo(),this._setExtensionInfo(),null!=this.onDemuxed&&this.onDemuxed())}}},{key:"_setMediaInfo",value:function(){var e=Module.cwrap("getMediaInfo","number",[])(),t=Module.HEAPU32[e/4],i=Module.HEAPU32[e/4+1],n=Module.HEAPF64[e/8+1],s=Module.HEAPF64[e/8+1+1],o=Module.HEAPF64[e/8+1+1+1],u=Module.HEAPF64[e/8+1+1+1+1],l=Module.HEAPU32[e/4+2+2+2+2+2];this.mediaAttr.vFps=n,this.mediaAttr.vGop=l,this.mediaAttr.vDuration=s,this.mediaAttr.aDuration=o,this.mediaAttr.duration=u;var d=Module.cwrap("getAudioCodecID","number",[])();d>=0?(this.mediaAttr.aCodec=a.CODEC_OFFSET_TABLE[d],this.mediaAttr.sampleRate=t>0?t:a.DEFAULT_SAMPLERATE,this.mediaAttr.sampleChannel=i>=0?i:a.DEFAULT_CHANNEL):(this.mediaAttr.sampleRate=0,this.mediaAttr.sampleChannel=0,this.mediaAttr.audioNone=!0);var h=Module.cwrap("getVideoCodecID","number",[])();h>=0&&(this.mediaAttr.vCodec=a.CODEC_OFFSET_TABLE[h]),null==this.aacDec?this.aacDec=new r.AACDecoder(this.mediaAttr):this.aacDec.updateConfig(this.mediaAttr)}},{key:"_setExtensionInfo",value:function(){var e=Module.cwrap("getExtensionInfo","number",[])(),t=Module.HEAPU32[e/4],i=Module.HEAPU32[e/4+1];this.extensionInfo.vWidth=t,this.extensionInfo.vHeight=i}},{key:"readMediaInfo",value:function(){return this.mediaAttr}},{key:"readExtensionInfo",value:function(){return this.extensionInfo}},{key:"readAudioNone",value:function(){return this.mediaAttr.audioNone}},{key:"_readLayer",value:function(){var e={vps:null,sps:null,pps:null,sei:null},t={vlc:null},i=Module.cwrap("getSPSLen","number",[])(),n=Module.cwrap("getSPS","number",[])();if(!(i<0)){e.sps=new Uint8Array(i),e.sps.set(Module.HEAPU8.subarray(n,n+i),0);var r=Module.cwrap("getPPSLen","number",[])(),s=Module.cwrap("getPPS","number",[])();e.pps=new Uint8Array(r),e.pps.set(Module.HEAPU8.subarray(s,s+r),0);var o=Module.cwrap("getSEILen","number",[])(),u=Module.cwrap("getSEI","number",[])();e.sei=new Uint8Array(o),e.sei.set(Module.HEAPU8.subarray(u,u+o),0);var l=Module.cwrap("getVLCLen","number",[])(),d=Module.cwrap("getVLC","number",[])();if(t.vlc=new Uint8Array(l),t.vlc.set(Module.HEAPU8.subarray(d,d+l),0),this.mediaAttr.vCodec==a.DEF_HEVC||this.mediaAttr.vCodec==a.DEF_H265){var h=Module.cwrap("getVPSLen","number",[])(),c=Module.cwrap("getVPS","number",[])();e.vps=new Uint8Array(h),e.vps.set(Module.HEAPU8.subarray(c,c+h),0)}else this.mediaAttr.vCodec==a.DEF_AVC||(this.mediaAttr.vCodec,a.DEF_H264);return{nalu:e,vlc:t}}}},{key:"isHEVC",value:function(){return this.mediaAttr.vCodec==a.DEF_HEVC||this.mediaAttr.vCodec==a.DEF_H265}},{key:"readPacket",value:function(){var e=Module.cwrap("getPacket","number",[])(),t=Module.HEAPU32[e/4],i=Module.HEAPU32[e/4+1],n=Module.HEAPF64[e/8+1],r=Module.HEAPF64[e/8+1+1],s=Module.HEAPU32[e/4+1+1+2+2],o=Module.HEAPU32[e/4+1+1+2+2+1],u=Module.HEAPU8.subarray(o,o+i),l=this._readLayer();return{type:t,size:i,ptime:n,dtime:r,keyframe:s,src:u,data:1==t&&this.mediaAttr.aCodec==a.DEF_AAC?this.aacDec.sliceAACFrames(n,u):u,layer:l}}},{key:"_refreshDemuxer",value:function(){this.releaseTsDemuxer(),this._initDemuxer()}},{key:"_initDemuxer",value:function(){Module.cwrap("initTsMissile","number",[])(),Module.cwrap("initializeDemuxer","number",[])()}},{key:"releaseTsDemuxer",value:function(){Module.cwrap("exitTsMissile","number",[])()}}])&&n(i.prototype,s),o&&n(i,o),e}();i.MPEG_JS=s}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./consts":69,"./decoder/aac":70}],72:[function(e,t,i){"use strict";function n(e,t){for(var i=0;i0&&e.extensionInfo.vHeight>0&&(e.size.width=e.extensionInfo.vWidth,e.size.height=e.extensionInfo.vHeight);for(var t=null;!((t=e.mpegTsObj.readPacket()).size<=0);){var i=t.dtime;if(0==t.type){var n=s.PACK_NALU(t.layer),r=1==t.keyframe;e.bufObject.appendFrame(i,n,!0,r)}else if("aac"==e.mediaInfo.aCodec)for(var a=t.data,o=0;o0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;return t<0?null:1==e?this.bufObject.vFrame(t):2==e?this.bufObject.aFrame(t):void 0}},{key:"isHEVC",value:function(){return this.mpegTsObj.isHEVC()}},{key:"getACodec",value:function(){return this.aCodec}},{key:"getVCodec",value:function(){return this.vCodec}},{key:"getAudioNone",value:function(){return this.mpegTsObj.mediaAttr.audioNone}},{key:"getDurationMs",value:function(){return this.durationMs}},{key:"getFPS",value:function(){return this.fps}},{key:"getSampleRate",value:function(){return this.sampleRate}},{key:"getSize",value:function(){return this.size}},{key:"seek",value:function(e){if(e>=0){var t=this.bufObject.seekIDR(e);this.seekPos=t}}}])&&n(t.prototype,i),o&&n(t,o),e}();i.MpegTs=o},{"../decoder/hevc-imp":62,"./buffer":64,"./mpegts/mpeg.js":71}],73:[function(e,t,i){(function(t){"use strict";function n(e,t){for(var i=0;i0&&void 0!==arguments[0]&&arguments[0];return void 0!==this.player&&null!==this.player&&(this.player.setScreen(e),!0)}},{key:"play",value:function(){if(void 0===this.player||null===this.player)return!1;if(this.playParam.videoCodec===m.CODEC_H265){var e={seekPos:this._getSeekTarget(),mode:this.playMode,accurateSeek:this.configFormat.accurateSeek,seekEvent:!1,realPlay:!0};this.player.play(e)}else this.player.play();return!0}},{key:"pause",value:function(){return void 0!==this.player&&null!==this.player&&(this.player.pause(),!0)}},{key:"isPlaying",value:function(){return void 0!==this.player&&null!==this.player&&this.player.isPlayingState()}},{key:"setVoice",value:function(e){return!(e<0||void 0===this.player||null===this.player||(this.volume=e,this.player&&this.player.setVoice(e),0))}},{key:"getVolume",value:function(){return this.volume}},{key:"mediaInfo",value:function(){var e={meta:this.playParam,videoType:this.playMode};return e.meta.isHEVC=0===this.playParam.videoCodec,e}},{key:"_seekHLS",value:function(e,t,i){if(void 0===this.player||null===this.player)return!1;setTimeout((function(){t.player.getCachePTS(),t.player.getCachePTS()>e?i():t._seekHLS(e,t,i)}),100)}},{key:"seek",value:function(e){if(void 0===this.player||null===this.player)return!1;var t=this;this.seekTarget=e,this.onSeekStart&&this.onSeekStart(e),this.timerFeed&&(window.clearInterval(this.timerFeed),this.timerFeed=null);var i=this._getSeekTarget();return this.playParam.videoCodec===m.CODEC_H264?(this.player.seek(e),this.onSeekFinish&&this.onSeekFinish()):this.configFormat.extInfo.core===m.PLAYER_CORE_TYPE_CNATIVE?(this.pause(),this._seekHLS(e,this,(function(){t.player.seek((function(){}),{seekTime:i,mode:t.playMode,accurateSeek:t.configFormat.accurateSeek})}))):this._seekHLS(e,this,(function(){t.player.seek((function(){t.configFormat.type==m.PLAYER_IN_TYPE_MP4?t.mp4Obj.seek(e):t.configFormat.type==m.PLAYER_IN_TYPE_TS||t.configFormat.type==m.PLAYER_IN_TYPE_MPEGTS?t.mpegTsObj.seek(e):t.configFormat.type==m.PLAYER_IN_TYPE_M3U8&&(t.hlsObj.onSamples=null,t.hlsObj.seek(e));var i,n=(i=0,i=t.configFormat.accurateSeek?e:t._getBoxBufSeekIDR(),parseInt(i)),r=parseInt(t._getBoxBufSeekIDR())||0;t._avFeedMP4Data(r,n)}),{seekTime:i,mode:t.playMode,accurateSeek:t.configFormat.accurateSeek})})),!0}},{key:"fullScreen",value:function(){if(this.autoScreenClose=!0,this.player.vCodecID===m.V_CODEC_NAME_HEVC){var e=document.querySelector("#"+this.configFormat.playerId),t=e.getElementsByTagName("canvas")[0];e.style.width=this.screenW+"px",e.style.height=this.screenH+"px";var i=this._checkScreenDisplaySize(this.screenW,this.screenH,this.playParam.size.width,this.playParam.size.height);t.style.marginTop=i[0]+"px",t.style.marginLeft=i[1]+"px",t.style.width=i[2]+"px",t.style.height=i[3]+"px",this._requestFullScreen(e)}else this._requestFullScreen(this.player.videoTag)}},{key:"closeFullScreen",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!1===e&&(this.autoScreenClose=!1,this._exitFull()),this.player.vCodecID===m.V_CODEC_NAME_HEVC){var t=document.querySelector("#"+this.configFormat.playerId),i=t.getElementsByTagName("canvas")[0];t.style.width=this.configFormat.playerW+"px",t.style.height=this.configFormat.playerH+"px";var n=this._checkScreenDisplaySize(this.configFormat.playerW,this.configFormat.playerH,this.playParam.size.width,this.playParam.size.height);i.style.marginTop=n[0]+"px",i.style.marginLeft=n[1]+"px",i.style.width=n[2]+"px",i.style.height=n[3]+"px"}}},{key:"_checkScreenDisplaySize",value:function(e,t,i,n){var r=i/e>n/t,a=(e/i).toFixed(2),s=(t/n).toFixed(2),o=r?a:s,u=this.fixed?e:parseInt(i*o),l=this.fixed?t:parseInt(n*o);return[parseInt((t-l)/2),parseInt((e-u)/2),u,l]}},{key:"_isFullScreen",value:function(){var e=document.fullscreenElement||document.mozFullscreenElement||document.webkitFullscreenElement;return document.fullscreenEnabled||document.mozFullscreenEnabled||document.webkitFullscreenEnabled,null!=e}},{key:"_requestFullScreen",value:function(e){e.requestFullscreen?e.requestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.msRequestFullscreen?e.msRequestFullscreen():e.webkitRequestFullscreen&&e.webkitRequestFullScreen()}},{key:"_exitFull",value:function(){document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.msExitFullscreen&&document.msExitFullscreen()}},{key:"_durationText",value:function(e){if(e<0)return"Play";var t=Math.round(e);return Math.floor(t/3600)+":"+Math.floor(t%3600/60)+":"+Math.floor(t%60)}},{key:"_getSeekTarget",value:function(){return this.configFormat.accurateSeek?this.seekTarget:this._getBoxBufSeekIDR()}},{key:"_getBoxBufSeekIDR",value:function(){return this.configFormat.type==m.PLAYER_IN_TYPE_MP4?this.mp4Obj.seekPos:this.configFormat.type==m.PLAYER_IN_TYPE_TS||this.configFormat.type==m.PLAYER_IN_TYPE_MPEGTS?this.mpegTsObj.seekPos:this.configFormat.type==m.PLAYER_IN_TYPE_M3U8?this.hlsObj.seekPos:void 0}},{key:"_playControl",value:function(){this.isPlaying()?this.pause():this.play()}},{key:"_avFeedMP4Data",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(void 0===this.player||null===this.player)return!1;var r=parseInt(this.playParam.durationMs/1e3);this.player.clearAllCache(),this.timerFeed=window.setInterval((function(){var a=null,s=null,o=!0,u=!0;if(e.configFormat.type==m.PLAYER_IN_TYPE_MP4?(a=e.mp4Obj.popBuffer(1,t),s=e.mp4Obj.audioNone?null:e.mp4Obj.popBuffer(2,i)):e.configFormat.type==m.PLAYER_IN_TYPE_TS||e.configFormat.type==m.PLAYER_IN_TYPE_MPEGTS?(a=e.mpegTsObj.popBuffer(1,t),s=e.mpegTsObj.getAudioNone()?null:e.mpegTsObj.popBuffer(2,i)):e.configFormat.type==m.PLAYER_IN_TYPE_M3U8&&(a=e.hlsObj.popBuffer(1,t),s=e.hlsObj.audioNone?null:e.hlsObj.popBuffer(2,i),t=e.hlsObj.getLastIdx()&&(o=!1),i=e.hlsObj.getALastIdx()&&(u=!1)),!0===o&&null!=a)for(var l=0;lr)return window.clearInterval(e.timerFeed),e.timerFeed=null,e.player.vCachePTS,e.player.aCachePTS,void(null!=n&&n())}),5)}},{key:"_makeMP4Player",value:function(){return this.mediaExtProtocol===m.URI_PROTOCOL_WEBSOCKET_DESC?(this._cWsFLVDecoderEntry(),0):(null!=this.configFormat.extInfo.core&&null!==this.configFormat.extInfo.core&&this.configFormat.extInfo.core===m.PLAYER_CORE_TYPE_CNATIVE?this._cDemuxDecoderEntry():this.configFormat.type==m.PLAYER_IN_TYPE_MP4?this.configFormat.extInfo.moovStartFlag?this._mp4EntryVodStream():this._mp4Entry():this.configFormat.type==m.PLAYER_IN_TYPE_TS||this.configFormat.type==m.PLAYER_IN_TYPE_MPEGTS?this._mpegTsEntry():this.configFormat.type==m.PLAYER_IN_TYPE_M3U8?this._m3u8Entry():this.configFormat.type===m.PLAYER_IN_TYPE_RAW_265&&this._raw265Entry(),0)}},{key:"_makeMP4PlayerViewEvent",value:function(e,t,i,n){var a=this,s=arguments.length>4&&void 0!==arguments[4]&&arguments[4],o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null,u=this;if(this.playParam.durationMs=e,this.playParam.fps=t,this.playParam.sampleRate=i,this.playParam.size=n,this.playParam.audioNone=s,this.playParam.videoCodec=o||m.CODEC_H265,this.playParam,(this.configFormat.type==m.PLAYER_IN_TYPE_M3U8&&this.hlsConf.hlsType==m.PLAYER_IN_TYPE_M3U8_LIVE||this.configFormat.type==m.PLAYER_IN_TYPE_RAW_265)&&(this.playMode=m.PLAYER_MODE_NOTIME_LIVE),u.configFormat.extInfo.autoCrop){var l=document.querySelector("#"+this.configFormat.playerId),d=n.width/n.height,h=this.configFormat.playerW/this.configFormat.playerH;d>h?l.style.height=this.configFormat.playerW/d+"px":d=m.FETCH_FIRST_MAX_TIMES)return;i=new AbortController,n=i.signal,e(s+1)}}),m.FETCH_HTTP_FLV_TIMEOUT_MS),fetch(t.videoURL,{signal:n}).then((function(e){if(a=!0,e.headers.has("Content-Length"))o=e.headers.get("Content-Length"),t.player&&t.player.setProbeSize(o*t.configFormat.extInfo.coreProbePart);else{if(t.mediaExtFormat===m.PLAYER_IN_TYPE_FLV)return i.abort(),t.player.release(),t.player=null,t._cLiveFLVDecoderEntry(r),!0;t.player&&t.player.setProbeSize(4096)}return e.headers.get("Content-Length"),t.configFormat.type,t.mediaExtFormat,function e(i){return i.read().then((function(n){if(!n.done){n.value.buffer;var r=new Uint8Array(n.value.buffer);return t.player&&t.player.pushBuffer(r)<0?(t.player.release(),t.player=null,t._mp4EntryVodStream(),!1):e(i)}t.player&&t.player.pushDone()}))}(e.body.getReader())})).catch((function(e){e.toString().includes("user aborted")||console.error("cdemuxdecoder error",e)}))}(0)}},{key:"_cLiveFLVDecoderEntry",value:function(e){var t=this,i=this;e.probeSize=this.configFormat.extInfo.probeSize,this.player=new o.CHttpLiveCore(e),e.probeSize,this.player.onProbeFinish=function(){i.playParam.fps=i.player.mediaInfo.fps,i.playParam.durationMs=-1,i.playMode=m.PLAYER_MODE_NOTIME_LIVE,i.playParam.sampleRate=i.player.mediaInfo.sampleRate,i.playParam.size={width:i.player.mediaInfo.width,height:i.player.mediaInfo.height},i.playParam.audioNone=i.player.mediaInfo.audioNone,i.player.mediaInfo,i.player.vCodecID===m.V_CODEC_NAME_HEVC?(i.playParam.audioIdx<0&&(i.playParam.audioNone=!0),i.playParam.videoCodec=m.CODEC_H265,i.onLoadFinish&&i.onLoadFinish()):(i.playParam.videoCodec=m.CODEC_H264,i.player.release(),i.player=null,i._flvJsPlayer())},this.player.onNetworkError=function(e){i.onNetworkError&&i.onNetworkError(e)},this.player.onReadyShowDone=function(){i.configFormat.extInfo.readyShow=!1,i.onReadyShowDone&&i.onReadyShowDone()},this.player.onLoadCache=function(){null!=t.onLoadCache&&t.onLoadCache()},this.player.onLoadCacheFinshed=function(){null!=t.onLoadCacheFinshed&&t.onLoadCacheFinshed()},this.player.start(this.videoURL)}},{key:"_cWsFLVDecoderEntry",value:function(){var e=this,t=this,i={width:this.configFormat.playerW,height:this.configFormat.playerH,playerId:this.configFormat.playerId,token:this.configFormat.token,readyShow:this.configFormat.extInfo.readyShow,checkProbe:this.configFormat.extInfo.checkProbe,ignoreAudio:this.configFormat.extInfo.ignoreAudio,playMode:this.playMode};i.probeSize=this.configFormat.extInfo.probeSize,this.player=new u.CWsLiveCore(i),i.probeSize,this.player.onProbeFinish=function(){t.playParam.fps=t.player.mediaInfo.fps,t.playParam.durationMs=-1,t.playMode=m.PLAYER_MODE_NOTIME_LIVE,t.playParam.sampleRate=t.player.mediaInfo.sampleRate,t.playParam.size={width:t.player.mediaInfo.width,height:t.player.mediaInfo.height},t.playParam.audioNone=t.player.mediaInfo.audioNone,t.player.mediaInfo,t.player.vCodecID===m.V_CODEC_NAME_HEVC?(t.playParam.audioIdx<0&&(t.playParam.audioNone=!0),t.playParam.videoCodec=m.CODEC_H265,t.onLoadFinish&&t.onLoadFinish()):(t.playParam.videoCodec=m.CODEC_H264,t.player.release(),t.player=null,t._flvJsPlayer())},this.player.onNetworkError=function(e){t.onNetworkError&&t.onNetworkError(e)},this.player.onReadyShowDone=function(){t.configFormat.extInfo.readyShow=!1,t.onReadyShowDone&&t.onReadyShowDone()},this.player.onLoadCache=function(){null!=e.onLoadCache&&e.onLoadCache()},this.player.onLoadCacheFinshed=function(){null!=e.onLoadCacheFinshed&&e.onLoadCacheFinshed()},this.player.start(this.videoURL)}},{key:"_mpegTsEntry",value:function(){var e=this,t=new AbortController,i=t.signal;this.timerFeed=null,this.mpegTsObj=new f.MpegTs,this.mpegTsObj.bindReady(e),this.mpegTsObj.onDemuxed=this._mpegTsEntryReady.bind(this),this.mpegTsObj.onReady=function(){var n=null;fetch(e.videoURL,{signal:i}).then((function(r){if(r.headers.has("Content-Length"))return function t(i){return i.read().then((function(r){if(!r.done){var a=r.value;if(null===n)n=a;else{var s=a,o=n.length+s.length,u=new Uint8Array(o);u.set(n),u.set(s,n.length),n=new Uint8Array(u),s=null,u=null}return t(i)}e.mpegTsObj.demux(n)}))}(r.body.getReader());t.abort(),i=null,t=null;var a={width:e.configFormat.playerW,height:e.configFormat.playerH,playerId:e.configFormat.playerId,token:e.configFormat.token,readyShow:e.configFormat.extInfo.readyShow,checkProbe:e.configFormat.extInfo.checkProbe,ignoreAudio:e.configFormat.extInfo.ignoreAudio,playMode:e.playMode};e._cLiveFLVDecoderEntry(a)})).catch((function(e){if(!e.toString().includes("user aborted")){var t=" mpegts request error:"+e;console.error(t)}}))},this.mpegTsObj.initMPEG()}},{key:"_mpegTsEntryReady",value:function(e){var t=e,i=(t.mpegTsObj.getVCodec(),t.mpegTsObj.getACodec()),n=t.mpegTsObj.getDurationMs(),r=t.mpegTsObj.getFPS(),a=t.mpegTsObj.getSampleRate(),s=t.mpegTsObj.getSize(),o=this.mpegTsObj.isHEVC();if(!o)return this.mpegTsObj.releaseTsDemuxer(),this.mpegTsObj=null,this.playParam.durationMs=n,this.playParam.fps=r,this.playParam.sampleRate=a,this.playParam.size=s,this.playParam.audioNone=""==i,this.playParam.videoCodec=o?0:1,this.playParam,void(this.onLoadFinish&&this.onLoadFinish());t._makeMP4PlayerViewEvent(n,r,a,s,""==i),parseInt(n/1e3),t._avFeedMP4Data(0,0)}},{key:"_m3u8Entry",value:function(){var e=this,t=this,i=!1,n=0;this.hlsObj=new p.M3u8,this.hlsObj.bindReady(t),this.hlsObj.onFinished=function(e,r){0==i&&(n=t.hlsObj.getDurationMs(),t.hlsConf.hlsType=r.type,i=!0)},this.hlsObj.onCacheProcess=function(t){e.playMode!==m.PLAYER_MODE_NOTIME_LIVE&&e.onCacheProcess&&e.onCacheProcess(t)},this.hlsObj.onDemuxed=function(e){if(null==t.player){var i=t.hlsObj.isHevcParam,r=(t.hlsObj.getVCodec(),t.hlsObj.getACodec()),a=t.hlsObj.getFPS(),s=t.hlsObj.getSampleRate(),o=t.hlsObj.getSize(),u=!1;if(u=t.hlsObj.getSampleChannel()<=0||""===r,!i)return t.hlsObj.release(),t.hlsObj.mpegTsObj&&t.hlsObj.mpegTsObj.releaseTsDemuxer(),t.hlsObj=null,t.playParam.durationMs=-1,t.playParam.fps=a,t.playParam.sampleRate=s,t.playParam.size=o,t.playParam.audioNone=""==r,t.playParam.videoCodec=i?0:1,t.playParam,void t._videoJsPlayer();t._makeMP4PlayerViewEvent(n,a,s,o,u)}},this.hlsObj.onSamples=this._hlsOnSamples.bind(this),this.hlsObj.demux(this.videoURL)}},{key:"_hlsOnSamples",value:function(e,t){1==t.video?this.player.appendHevcFrame(t):!1===this.hlsObj.audioNone&&this.player.appendAACFrame(t)}},{key:"_videoJsPlayer",value:function(){var e=this,t={width:this.configFormat.playerW,height:this.configFormat.playerH,playerId:this.configFormat.playerId,ignoreAudio:this.configFormat.extInfo.ignoreAudio};this.player=new l.NvVideojsCore(t),this.player.onMakeItReady=function(){e.onMakeItReady&&e.onMakeItReady()},this.player.onLoadFinish=function(){e.playParam.size=e.player.getSize(),e.player.duration===1/0||e.player.duration<0?(e.playParam.durationMs=-1,e.playMode=m.PLAYER_MODE_NOTIME_LIVE):(e.playParam.durationMs=1e3*e.player.duration,e.playMode=m.PLAYER_MODE_VOD),e.onLoadFinish&&e.onLoadFinish()},this.player.onReadyShowDone=function(){e.onReadyShowDone&&e.onReadyShowDone()},this.player.onPlayingFinish=function(){e.pause(),e.seek(0),null!=e.onPlayFinish&&e.onPlayFinish()},this.player.onPlayingTime=function(t){e._durationText(t),e._durationText(e.player.duration),null!=e.onPlayTime&&e.onPlayTime(t)},this.player.onSeekFinish=function(){e.onSeekFinish&&e.onSeekFinish()},this.player.makeIt(this.videoURL)}},{key:"_flvJsPlayer",value:function(){var e=this,t={width:this.configFormat.playerW,height:this.configFormat.playerH,playerId:this.configFormat.playerId,ignoreAudio:this.configFormat.extInfo.ignoreAudio};this.player=new d.NvFlvjsCore(t),this.player.onLoadFinish=function(){e.playParam.size=e.player.getSize(),!e.player.duration||NaN===e.player.duration||e.player.duration===1/0||e.player.duration<0?(e.playParam.durationMs=-1,e.playMode=m.PLAYER_MODE_NOTIME_LIVE):(e.playParam.durationMs=1e3*e.player.duration,e.playMode=m.PLAYER_MODE_VOD),e.onLoadFinish&&e.onLoadFinish()},this.player.onReadyShowDone=function(){e.onReadyShowDone&&e.onReadyShowDone()},this.player.onPlayingTime=function(t){e._durationText(t),e._durationText(e.player.duration),null!=e.onPlayTime&&e.onPlayTime(t)},this.player.onPlayingFinish=function(){e.pause(),e.seek(0),null!=e.onPlayFinish&&e.onPlayFinish()},this.player.makeIt(this.videoURL)}},{key:"_raw265Entry",value:function(){this._makeMP4PlayerViewEvent(-1,this.configFormat.extInfo.rawFps,-1,{width:this.configFormat.playerW,height:this.configFormat.playerH},!0,m.CODEC_H265),this.timerFeed&&(window.clearInterval(this.timerFeed),this.timerFeed=null)}},{key:"append265NaluFrame",value:function(e){var t={data:e,pts:this.rawModePts};this.player.appendHevcFrame(t),this.configFormat.extInfo.readyShow&&this.player.cacheYuvBuf.getState()!=CACHE_APPEND_STATUS_CODE.NULL&&(this.player.playFrameYUV(!0,!0),this.configFormat.extInfo.readyShow=!1,this.onReadyShowDone&&this.onReadyShowDone()),this.rawModePts+=1/this.configFormat.extInfo.rawFps}}])&&n(i.prototype,v),b&&n(i,b),e}();i.H265webjs=v,t.new265webjs=function(e,t){return new v(e,t)}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./consts":52,"./decoder/av-common":55,"./decoder/c-httplive-core":56,"./decoder/c-native-core":57,"./decoder/c-wslive-core":58,"./decoder/cache":59,"./decoder/player-core":63,"./demuxer/m3u8":66,"./demuxer/mp4":68,"./demuxer/mpegts/mpeg.js":71,"./demuxer/ts":72,"./native/mp4-player":74,"./native/nv-flvjs-core":75,"./native/nv-videojs-core":76,"./utils/static-mem":78,"./utils/ui/ui":79}],74:[function(e,t,i){"use strict";function n(e,t){for(var i=0;i>1,a>>1,i),e.v.fill(r>>1,a>>1,n),e.drawArrays(e.TRIANGLE_STRIP,0,4)},setupCanvas:function(e,t){var i=e.getContext("webgl")||e.getContext("experimental-webgl");if(!i)return i;var r=i.createProgram(),a=["attribute highp vec4 aVertexPosition;","attribute vec2 aTextureCoord;","varying highp vec2 vTextureCoord;","void main(void) {"," gl_Position = aVertexPosition;"," vTextureCoord = aTextureCoord;","}"].join("\n"),s=i.createShader(i.VERTEX_SHADER);i.shaderSource(s,a),i.compileShader(s);var o=["precision highp float;","varying lowp vec2 vTextureCoord;","uniform sampler2D YTexture;","uniform sampler2D UTexture;","uniform sampler2D VTexture;","const mat4 YUV2RGB = mat4","("," 1.1643828125, 0, 1.59602734375, -.87078515625,"," 1.1643828125, -.39176171875, -.81296875, .52959375,"," 1.1643828125, 2.017234375, 0, -1.081390625,"," 0, 0, 0, 1",");","void main(void) {"," gl_FragColor = vec4( texture2D(YTexture, vTextureCoord).x, texture2D(UTexture, vTextureCoord).x, texture2D(VTexture, vTextureCoord).x, 1) * YUV2RGB;","}"].join("\n"),u=i.createShader(i.FRAGMENT_SHADER);i.shaderSource(u,o),i.compileShader(u),i.attachShader(r,s),i.attachShader(r,u),i.linkProgram(r),i.useProgram(r),i.getProgramParameter(r,i.LINK_STATUS);var l=i.getAttribLocation(r,"aVertexPosition");i.enableVertexAttribArray(l);var d=i.getAttribLocation(r,"aTextureCoord");i.enableVertexAttribArray(d);var h=i.createBuffer();i.bindBuffer(i.ARRAY_BUFFER,h),i.bufferData(i.ARRAY_BUFFER,new Float32Array([1,1,0,-1,1,0,1,-1,0,-1,-1,0]),i.STATIC_DRAW),i.vertexAttribPointer(l,3,i.FLOAT,!1,0,0);var c=i.createBuffer();return i.bindBuffer(i.ARRAY_BUFFER,c),i.bufferData(i.ARRAY_BUFFER,new Float32Array([1,0,0,0,1,1,0,1]),i.STATIC_DRAW),i.vertexAttribPointer(d,2,i.FLOAT,!1,0,0),i.y=new n(i),i.u=new n(i),i.v=new n(i),i.y.bind(0,r,"YTexture"),i.u.bind(1,r,"UTexture"),i.v.bind(2,r,"VTexture"),i}}},{}],78:[function(e,t,i){(function(e){"use strict";e.STATIC_MEM_wasmDecoderState=-1,e.STATICE_MEM_playerCount=-1,e.STATICE_MEM_playerIndexPtr=0}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],79:[function(e,t,i){"use strict";function n(e,t){for(var i=0;i - + diff --git a/src/src/decoder/c-httplive-core.js b/src/src/decoder/c-httplive-core.js index 36bb3179..348acca0 100644 --- a/src/src/decoder/c-httplive-core.js +++ b/src/src/decoder/c-httplive-core.js @@ -80,9 +80,10 @@ class CHttpLiveCoreModule { // export default playerId: config.playerId || def.DEFAILT_WEBGL_PLAY_ID, token: config.token || null, probeSize: config.probeSize || 4096, + ignoreAudio : config.ignoreAudio || 0 }; // end this.config - alert("this.config.probeSize" + this.config.probeSize); + alert("this.config.probeSize" + this.config.probeSize + " ignoreAudio:" + this.config.ignoreAudio); this.mediaInfo = { noFPS : false, @@ -340,7 +341,7 @@ class CHttpLiveCoreModule { // export default } } // end set canvas size - if (audioIdx >= 0 && this.mediaInfo.noFPS === false) { + if (audioIdx >= 0 && this.mediaInfo.noFPS === false && this.config.ignoreAudio < 1) { if (undefined !== this.audioWAudio && null !== this.audioWAudio) { this.audioWAudio.stop(); this.audioWAudio = null; diff --git a/src/src/decoder/c-wslive-core.js b/src/src/decoder/c-wslive-core.js index 77d7b66c..c83ad7b9 100644 --- a/src/src/decoder/c-wslive-core.js +++ b/src/src/decoder/c-wslive-core.js @@ -80,9 +80,10 @@ class CWsLiveCoreModule { // export default playerId: config.playerId || def.DEFAILT_WEBGL_PLAY_ID, token: config.token || null, probeSize: config.probeSize || 4096, + ignoreAudio : config.ignoreAudio || 0 }; // end this.config - alert("this.config.probeSize" + this.config.probeSize); + alert("this.config.probeSize" + this.config.probeSize + " ignoreAudio:" + this.config.ignoreAudio); this.mediaInfo = { noFPS : false, @@ -340,7 +341,8 @@ class CWsLiveCoreModule { // export default } } // end set canvas size - if (audioIdx >= 0 && this.mediaInfo.noFPS === false) { + if (audioIdx >= 0 && this.mediaInfo.noFPS === false && this.config.ignoreAudio < 1) + { if (undefined !== this.audioWAudio && null !== this.audioWAudio) { this.audioWAudio.stop(); this.audioWAudio = null; diff --git a/src/src/decoder/missile-256mb.js b/src/src/decoder/missile-256mb.js deleted file mode 100644 index ee44eda1..00000000 --- a/src/src/decoder/missile-256mb.js +++ /dev/null @@ -1,2 +0,0 @@ -var ENVIRONMENT_IS_PTHREAD = true; -var Module=typeof Module!=="undefined"?Module:{};var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var arguments_=[];var thisProgram="./this.program";var quit_=function(status,toThrow){throw toThrow};var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_HAS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_HAS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";ENVIRONMENT_IS_NODE=ENVIRONMENT_HAS_NODE&&!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_WORKER;ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;if(Module["ENVIRONMENT"]){throw new Error("Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -s ENVIRONMENT=web or -s ENVIRONMENT=node)")}var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;if(ENVIRONMENT_IS_NODE){scriptDirectory=__dirname+"/";var nodeFS;var nodePath;read_=function shell_read(filename,binary){var ret;if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);ret=nodeFS["readFileSync"](filename);return binary?ret:ret.toString()};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};if(process["argv"].length>1){thisProgram=process["argv"][1].replace(/\\/g,"/")}arguments_=process["argv"].slice(2);if(typeof module!=="undefined"){module["exports"]=Module}process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",abort);quit_=function(status){process["exit"](status)};Module["inspect"]=function(){return"[Emscripten Module object]"}}else if(ENVIRONMENT_IS_SHELL){if(typeof read!="undefined"){read_=function shell_read(f){return read(f)}}readBinary=function readBinary(f){var data;if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){arguments_=scriptArgs}else if(typeof arguments!="undefined"){arguments_=arguments}if(typeof quit==="function"){quit_=function(status){quit(status)}}if(typeof print!=="undefined"){if(typeof console==="undefined")console={};console.log=print;console.warn=console.error=typeof printErr!=="undefined"?printErr:print}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(document.currentScript){scriptDirectory=document.currentScript.src}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf("/")+1)}else{scriptDirectory=""}read_=function shell_read(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=function readBinary(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=function readAsync(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function xhr_onload(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)};setWindowTitle=function(title){document.title=title}}else{throw new Error("environment detection error")}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(!Object.getOwnPropertyDescriptor(Module,"arguments"))Object.defineProperty(Module,"arguments",{configurable:true,get:function(){abort("Module.arguments has been replaced with plain arguments_")}});if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(!Object.getOwnPropertyDescriptor(Module,"thisProgram"))Object.defineProperty(Module,"thisProgram",{configurable:true,get:function(){abort("Module.thisProgram has been replaced with plain thisProgram")}});if(Module["quit"])quit_=Module["quit"];if(!Object.getOwnPropertyDescriptor(Module,"quit"))Object.defineProperty(Module,"quit",{configurable:true,get:function(){abort("Module.quit has been replaced with plain quit_")}});assert(typeof Module["memoryInitializerPrefixURL"]==="undefined","Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead");assert(typeof Module["pthreadMainPrefixURL"]==="undefined","Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead");assert(typeof Module["cdInitializerPrefixURL"]==="undefined","Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead");assert(typeof Module["filePackagePrefixURL"]==="undefined","Module.filePackagePrefixURL option was removed, use Module.locateFile instead");assert(typeof Module["read"]==="undefined","Module.read option was removed (modify read_ in JS)");assert(typeof Module["readAsync"]==="undefined","Module.readAsync option was removed (modify readAsync in JS)");assert(typeof Module["readBinary"]==="undefined","Module.readBinary option was removed (modify readBinary in JS)");assert(typeof Module["setWindowTitle"]==="undefined","Module.setWindowTitle option was removed (modify setWindowTitle in JS)");if(!Object.getOwnPropertyDescriptor(Module,"read"))Object.defineProperty(Module,"read",{configurable:true,get:function(){abort("Module.read has been replaced with plain read_")}});if(!Object.getOwnPropertyDescriptor(Module,"readAsync"))Object.defineProperty(Module,"readAsync",{configurable:true,get:function(){abort("Module.readAsync has been replaced with plain readAsync")}});if(!Object.getOwnPropertyDescriptor(Module,"readBinary"))Object.defineProperty(Module,"readBinary",{configurable:true,get:function(){abort("Module.readBinary has been replaced with plain readBinary")}});stackSave=stackRestore=stackAlloc=function(){abort("cannot use the stack before compiled code is ready to run, and has provided stack access")};function dynamicAlloc(size){assert(DYNAMICTOP_PTR);var ret=HEAP32[DYNAMICTOP_PTR>>2];var end=ret+size+15&-16;if(end>_emscripten_get_heap_size()){abort("failure to dynamicAlloc - memory growth etc. is not supported there, call malloc/sbrk directly")}HEAP32[DYNAMICTOP_PTR>>2]=end;return ret}function getNativeTypeSize(type){switch(type){case"i1":case"i8":return 1;case"i16":return 2;case"i32":return 4;case"i64":return 8;case"float":return 4;case"double":return 8;default:{if(type[type.length-1]==="*"){return 4}else if(type[0]==="i"){var bits=parseInt(type.substr(1));assert(bits%8===0,"getNativeTypeSize invalid bits "+bits+", type "+type);return bits/8}else{return 0}}}}function warnOnce(text){if(!warnOnce.shown)warnOnce.shown={};if(!warnOnce.shown[text]){warnOnce.shown[text]=1;err(text)}}var asm2wasmImports={"f64-rem":function(x,y){return x%y},"debugger":function(){debugger}};var jsCallStartIndex=1;var functionPointers=new Array(35);function addFunction(func,sig){assert(typeof func!=="undefined");var base=0;for(var i=base;i>0]=value;break;case"i8":HEAP8[ptr>>0]=value;break;case"i16":HEAP16[ptr>>1]=value;break;case"i32":HEAP32[ptr>>2]=value;break;case"i64":tempI64=[value>>>0,(tempDouble=value,+Math_abs(tempDouble)>=1?tempDouble>0?(Math_min(+Math_floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math_ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[ptr>>2]=tempI64[0],HEAP32[ptr+4>>2]=tempI64[1];break;case"float":HEAPF32[ptr>>2]=value;break;case"double":HEAPF64[ptr>>3]=value;break;default:abort("invalid type for setValue: "+type)}}var wasmMemory;var wasmTable=new WebAssembly.Table({"initial":4416,"element":"anyfunc"});var ABORT=false;var EXITSTATUS=0;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}function getCFunc(ident){var func=Module["_"+ident];assert(func,"Cannot call unknown function "+ident+", make sure it is exported");return func}function ccall(ident,returnType,argTypes,args,opts){var toC={"string":function(str){var ret=0;if(str!==null&&str!==undefined&&str!==0){var len=(str.length<<2)+1;ret=stackAlloc(len);stringToUTF8(str,ret,len)}return ret},"array":function(arr){var ret=stackAlloc(arr.length);writeArrayToMemory(arr,ret);return ret}};function convertReturnValue(ret){if(returnType==="string")return UTF8ToString(ret);if(returnType==="boolean")return Boolean(ret);return ret}var func=getCFunc(ident);var cArgs=[];var stack=0;assert(returnType!=="array",'Return type should not be "array".');if(args){for(var i=0;i>2]=0}stop=ret+size;while(ptr>0]=0}return ret}if(singleType==="i8"){if(slab.subarray||slab.slice){HEAPU8.set(slab,ret)}else{HEAPU8.set(new Uint8Array(slab),ret)}return ret}var i=0,type,typeSize,previousType;while(i=endIdx))++endPtr;if(endPtr-idx>16&&u8Array.subarray&&UTF8Decoder){return UTF8Decoder.decode(u8Array.subarray(idx,endPtr))}else{var str="";while(idx>10,56320|ch&1023)}}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""}function stringToUTF8Array(str,outU8Array,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;outU8Array[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;outU8Array[outIdx++]=192|u>>6;outU8Array[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;outU8Array[outIdx++]=224|u>>12;outU8Array[outIdx++]=128|u>>6&63;outU8Array[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;if(u>=2097152)warnOnce("Invalid Unicode code point 0x"+u.toString(16)+" encountered when serializing a JS string to an UTF-8 string on the asm.js/wasm heap! (Valid unicode code points should be in range 0-0x1FFFFF).");outU8Array[outIdx++]=240|u>>18;outU8Array[outIdx++]=128|u>>12&63;outU8Array[outIdx++]=128|u>>6&63;outU8Array[outIdx++]=128|u&63}}outU8Array[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){assert(typeof maxBytesToWrite=="number","stringToUTF8(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!");return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127)++len;else if(u<=2047)len+=2;else if(u<=65535)len+=3;else len+=4}return len}var UTF16Decoder=typeof TextDecoder!=="undefined"?new TextDecoder("utf-16le"):undefined;function allocateUTF8(str){var size=lengthBytesUTF8(str)+1;var ret=_malloc(size);if(ret)stringToUTF8Array(str,HEAP8,ret,size);return ret}function allocateUTF8OnStack(str){var size=lengthBytesUTF8(str)+1;var ret=stackAlloc(size);stringToUTF8Array(str,HEAP8,ret,size);return ret}function writeArrayToMemory(array,buffer){assert(array.length>=0,"writeArrayToMemory array must have a length (should be an array or typed array)");HEAP8.set(array,buffer)}function writeAsciiToMemory(str,buffer,dontAddNull){for(var i=0;i>0]=str.charCodeAt(i)}if(!dontAddNull)HEAP8[buffer>>0]=0}var PAGE_SIZE=16384;var WASM_PAGE_SIZE=65536;function alignUp(x,multiple){if(x%multiple>0){x+=multiple-x%multiple}return x}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;function updateGlobalBufferAndViews(buf){buffer=buf;Module["HEAP8"]=HEAP8=new Int8Array(buf);Module["HEAP16"]=HEAP16=new Int16Array(buf);Module["HEAP32"]=HEAP32=new Int32Array(buf);Module["HEAPU8"]=HEAPU8=new Uint8Array(buf);Module["HEAPU16"]=HEAPU16=new Uint16Array(buf);Module["HEAPU32"]=HEAPU32=new Uint32Array(buf);Module["HEAPF32"]=HEAPF32=new Float32Array(buf);Module["HEAPF64"]=HEAPF64=new Float64Array(buf)}var STACK_BASE=1128400,STACK_MAX=6371280,DYNAMIC_BASE=6371280,DYNAMICTOP_PTR=1128176;assert(STACK_BASE%16===0,"stack must start aligned");assert(DYNAMIC_BASE%16===0,"heap must start aligned");var TOTAL_STACK=5242880;if(Module["TOTAL_STACK"])assert(TOTAL_STACK===Module["TOTAL_STACK"],"the stack size can no longer be determined at runtime");var INITIAL_TOTAL_MEMORY=Module["TOTAL_MEMORY"]||268435456;if(!Object.getOwnPropertyDescriptor(Module,"TOTAL_MEMORY"))Object.defineProperty(Module,"TOTAL_MEMORY",{configurable:true,get:function(){abort("Module.TOTAL_MEMORY has been replaced with plain INITIAL_TOTAL_MEMORY")}});assert(INITIAL_TOTAL_MEMORY>=TOTAL_STACK,"TOTAL_MEMORY should be larger than TOTAL_STACK, was "+INITIAL_TOTAL_MEMORY+"! (TOTAL_STACK="+TOTAL_STACK+")");assert(typeof Int32Array!=="undefined"&&typeof Float64Array!=="undefined"&&Int32Array.prototype.subarray!==undefined&&Int32Array.prototype.set!==undefined,"JS engine does not provide full typed array support");if(Module["wasmMemory"]){wasmMemory=Module["wasmMemory"]}else{wasmMemory=new WebAssembly.Memory({"initial":INITIAL_TOTAL_MEMORY/WASM_PAGE_SIZE})}if(wasmMemory){buffer=wasmMemory.buffer}INITIAL_TOTAL_MEMORY=buffer.byteLength;assert(INITIAL_TOTAL_MEMORY%WASM_PAGE_SIZE===0);updateGlobalBufferAndViews(buffer);HEAP32[DYNAMICTOP_PTR>>2]=DYNAMIC_BASE;function writeStackCookie(){assert((STACK_MAX&3)==0);HEAPU32[(STACK_MAX>>2)-1]=34821223;HEAPU32[(STACK_MAX>>2)-2]=2310721022;HEAP32[0]=1668509029}function checkStackCookie(){var cookie1=HEAPU32[(STACK_MAX>>2)-1];var cookie2=HEAPU32[(STACK_MAX>>2)-2];if(cookie1!=34821223||cookie2!=2310721022){abort("Stack overflow! Stack cookie has been overwritten, expected hex dwords 0x89BACDFE and 0x02135467, but received 0x"+cookie2.toString(16)+" "+cookie1.toString(16))}if(HEAP32[0]!==1668509029)abort("Runtime error: The application has corrupted its heap memory area (address zero)!")}function abortStackOverflow(allocSize){abort("Stack overflow! Attempted to allocate "+allocSize+" bytes on the stack, but stack has only "+(STACK_MAX-stackSave()+allocSize)+" bytes available!")}(function(){var h16=new Int16Array(1);var h8=new Int8Array(h16.buffer);h16[0]=25459;if(h8[0]!==115||h8[1]!==99)throw"Runtime error: expected the system to be little-endian!"})();function abortFnPtrError(ptr,sig){var possibleSig="";for(var x in debug_tables){var tbl=debug_tables[x];if(tbl[ptr]){possibleSig+='as sig "'+x+'" pointing to function '+tbl[ptr]+", "}}abort("Invalid function pointer "+ptr+" called with signature '"+sig+"'. Perhaps this is an invalid value (e.g. caused by calling a virtual method on a NULL pointer)? Or calling a function with an incorrect type, which will fail? (it is worth building your source files with -Werror (warnings are errors), as warnings can indicate undefined behavior which can cause this). This pointer might make sense in another type signature: "+possibleSig)}function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback=="function"){callback();continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){Module["dynCall_v"](func)}else{Module["dynCall_vi"](func,callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;var runtimeExited=false;function preRun(){if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){checkStackCookie();assert(!runtimeInitialized);runtimeInitialized=true;if(!Module["noFSInit"]&&!FS.init.initialized)FS.init();TTY.init();callRuntimeCallbacks(__ATINIT__)}function preMain(){checkStackCookie();FS.ignorePermissions=false;callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){checkStackCookie();runtimeExited=true}function postRun(){checkStackCookie();if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}assert(Math.imul,"This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");assert(Math.fround,"This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");assert(Math.clz32,"This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");assert(Math.trunc,"This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");var Math_abs=Math.abs;var Math_ceil=Math.ceil;var Math_floor=Math.floor;var Math_min=Math.min;var Math_trunc=Math.trunc;var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;var runDependencyTracking={};function getUniqueRunDependency(id){var orig=id;while(1){if(!runDependencyTracking[id])return id;id=orig+Math.random()}return id}function addRunDependency(id){runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(id){assert(!runDependencyTracking[id]);runDependencyTracking[id]=1;if(runDependencyWatcher===null&&typeof setInterval!=="undefined"){runDependencyWatcher=setInterval(function(){if(ABORT){clearInterval(runDependencyWatcher);runDependencyWatcher=null;return}var shown=false;for(var dep in runDependencyTracking){if(!shown){shown=true;err("still waiting on run dependencies:")}err("dependency: "+dep)}if(shown){err("(end of list)")}},1e4)}}else{err("warning: run dependency added without ID")}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(id){assert(runDependencyTracking[id]);delete runDependencyTracking[id]}else{err("warning: run dependency removed without ID")}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}what+="";out(what);err(what);ABORT=true;EXITSTATUS=1;var extra="";var output="abort("+what+") at "+stackTrace()+extra;throw output}if(!ENVIRONMENT_IS_PTHREAD)addOnPreRun(function(){if(typeof SharedArrayBuffer!=="undefined"){addRunDependency("pthreads");PThread.allocateUnusedWorkers(5,function(){removeRunDependency("pthreads")})}});var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return String.prototype.startsWith?filename.startsWith(dataURIPrefix):filename.indexOf(dataURIPrefix)===0}var wasmBinaryFile="missile-256mb-v20211120.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(){try{if(wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(wasmBinaryFile)}else{throw"both async and sync fetching of the wasm failed"}}catch(err){abort(err)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)&&typeof fetch==="function"){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw"failed to load wasm binary file at '"+wasmBinaryFile+"'"}return response["arrayBuffer"]()}).catch(function(){return getBinary()})}return new Promise(function(resolve,reject){resolve(getBinary())})}function createWasm(){var info={"env":asmLibraryArg,"wasi_unstable":asmLibraryArg,"global":{"NaN":NaN,Infinity:Infinity},"global.Math":Math,"asm2wasm":asm2wasmImports};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;removeRunDependency("wasm-instantiate")}addRunDependency("wasm-instantiate");var trueModule=Module;function receiveInstantiatedSource(output){assert(Module===trueModule,"the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?");trueModule=null;receiveInstance(output["instance"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){return WebAssembly.instantiate(binary,info)}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming==="function"&&!isDataURI(wasmBinaryFile)&&typeof fetch==="function"){fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiatedSource,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");instantiateArrayBuffer(receiveInstantiatedSource)})})}else{return instantiateArrayBuffer(receiveInstantiatedSource)}}if(Module["instantiateWasm"]){try{var exports=Module["instantiateWasm"](info,receiveInstance);return exports}catch(e){err("Module.instantiateWasm callback failed with error: "+e);return false}}instantiateAsync();return{}}Module["asm"]=createWasm;var tempDouble;var tempI64;var ASM_CONSTS=[function(){if(typeof window!="undefined"){window.dispatchEvent(new CustomEvent("wasmLoaded"))}else{global.onWASMLoaded&&global.onWASMLoaded()}}];function _emscripten_asm_const_i(code){return ASM_CONSTS[code]()}__ATINIT__.push({func:function(){___emscripten_environ_constructor()}});var tempDoublePtr=1128384;assert(tempDoublePtr%8==0);function demangle(func){warnOnce("warning: build with -s DEMANGLE_SUPPORT=1 to link in libcxxabi demangling");return func}function demangleAll(text){var regex=/\b__Z[\w\d_]+/g;return text.replace(regex,function(x){var y=demangle(x);return x===y?x:y+" ["+x+"]"})}function jsStackTrace(){var err=new Error;if(!err.stack){try{throw new Error(0)}catch(e){err=e}if(!err.stack){return"(no stack trace available)"}}return err.stack.toString()}function stackTrace(){var js=jsStackTrace();if(Module["extraStackTrace"])js+="\n"+Module["extraStackTrace"]();return demangleAll(js)}var ENV={};function ___buildEnvironment(environ){var MAX_ENV_VALUES=64;var TOTAL_ENV_SIZE=1024;var poolPtr;var envPtr;if(!___buildEnvironment.called){___buildEnvironment.called=true;ENV["USER"]="web_user";ENV["LOGNAME"]="web_user";ENV["PATH"]="/";ENV["PWD"]="/";ENV["HOME"]="/home/web_user";ENV["LANG"]=(typeof navigator==="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8";ENV["_"]=thisProgram;poolPtr=getMemory(TOTAL_ENV_SIZE);envPtr=getMemory(MAX_ENV_VALUES*4);HEAP32[envPtr>>2]=poolPtr;HEAP32[environ>>2]=envPtr}else{envPtr=HEAP32[environ>>2];poolPtr=HEAP32[envPtr>>2]}var strings=[];var totalSize=0;for(var key in ENV){if(typeof ENV[key]==="string"){var line=key+"="+ENV[key];strings.push(line);totalSize+=line.length}}if(totalSize>TOTAL_ENV_SIZE){throw new Error("Environment size exceeded TOTAL_ENV_SIZE!")}var ptrSize=4;for(var i=0;i>2]=poolPtr;poolPtr+=line.length+1}HEAP32[envPtr+strings.length*ptrSize>>2]=0}function ___lock(){}function ___setErrNo(value){if(Module["___errno_location"])HEAP32[Module["___errno_location"]()>>2]=value;else err("failed to set errno from JS");return value}var PATH={splitPath:function(filename){var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)},normalizeArray:function(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up;up--){parts.unshift("..")}}return parts},normalize:function(path){var isAbsolute=path.charAt(0)==="/",trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path},dirname:function(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir},basename:function(path){if(path==="/")return"/";var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)},extname:function(path){return PATH.splitPath(path)[3]},join:function(){var paths=Array.prototype.slice.call(arguments,0);return PATH.normalize(paths.join("/"))},join2:function(l,r){return PATH.normalize(l+"/"+r)}};var PATH_FS={resolve:function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:FS.cwd();if(typeof path!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){return""}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/"}resolvedPath=PATH.normalizeArray(resolvedPath.split("/").filter(function(p){return!!p}),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."},relative:function(from,to){from=PATH_FS.resolve(from).substr(1);to=PATH_FS.resolve(to).substr(1);function trim(arr){var start=0;for(;start=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i0){result=buf.slice(0,bytesRead).toString("utf-8")}else{result=null}}else if(typeof window!="undefined"&&typeof window.prompt=="function"){result=window.prompt("Input: ");if(result!==null){result+="\n"}}else if(typeof readline=="function"){result=readline();if(result!==null){result+="\n"}}if(!result){return null}tty.input=intArrayFromString(result,true)}return tty.input.shift()},put_char:function(tty,val){if(val===null||val===10){out(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){out(UTF8ArrayToString(tty.output,0));tty.output=[]}}},default_tty1_ops:{put_char:function(tty,val){if(val===null||val===10){err(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){err(UTF8ArrayToString(tty.output,0));tty.output=[]}}}};var MEMFS={ops_table:null,mount:function(mount){return MEMFS.createNode(null,"/",16384|511,0)},createNode:function(parent,name,mode,dev){if(FS.isBlkdev(mode)||FS.isFIFO(mode)){throw new FS.ErrnoError(63)}if(!MEMFS.ops_table){MEMFS.ops_table={dir:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr,lookup:MEMFS.node_ops.lookup,mknod:MEMFS.node_ops.mknod,rename:MEMFS.node_ops.rename,unlink:MEMFS.node_ops.unlink,rmdir:MEMFS.node_ops.rmdir,readdir:MEMFS.node_ops.readdir,symlink:MEMFS.node_ops.symlink},stream:{llseek:MEMFS.stream_ops.llseek}},file:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr},stream:{llseek:MEMFS.stream_ops.llseek,read:MEMFS.stream_ops.read,write:MEMFS.stream_ops.write,allocate:MEMFS.stream_ops.allocate,mmap:MEMFS.stream_ops.mmap,msync:MEMFS.stream_ops.msync}},link:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr,readlink:MEMFS.node_ops.readlink},stream:{}},chrdev:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr},stream:FS.chrdev_stream_ops}}}var node=FS.createNode(parent,name,mode,dev);if(FS.isDir(node.mode)){node.node_ops=MEMFS.ops_table.dir.node;node.stream_ops=MEMFS.ops_table.dir.stream;node.contents={}}else if(FS.isFile(node.mode)){node.node_ops=MEMFS.ops_table.file.node;node.stream_ops=MEMFS.ops_table.file.stream;node.usedBytes=0;node.contents=null}else if(FS.isLink(node.mode)){node.node_ops=MEMFS.ops_table.link.node;node.stream_ops=MEMFS.ops_table.link.stream}else if(FS.isChrdev(node.mode)){node.node_ops=MEMFS.ops_table.chrdev.node;node.stream_ops=MEMFS.ops_table.chrdev.stream}node.timestamp=Date.now();if(parent){parent.contents[name]=node}return node},getFileDataAsRegularArray:function(node){if(node.contents&&node.contents.subarray){var arr=[];for(var i=0;i=newCapacity)return;var CAPACITY_DOUBLING_MAX=1024*1024;newCapacity=Math.max(newCapacity,prevCapacity*(prevCapacity0)node.contents.set(oldContents.subarray(0,node.usedBytes),0);return},resizeFileStorage:function(node,newSize){if(node.usedBytes==newSize)return;if(newSize==0){node.contents=null;node.usedBytes=0;return}if(!node.contents||node.contents.subarray){var oldContents=node.contents;node.contents=new Uint8Array(new ArrayBuffer(newSize));if(oldContents){node.contents.set(oldContents.subarray(0,Math.min(newSize,node.usedBytes)))}node.usedBytes=newSize;return}if(!node.contents)node.contents=[];if(node.contents.length>newSize)node.contents.length=newSize;else while(node.contents.length=stream.node.usedBytes)return 0;var size=Math.min(stream.node.usedBytes-position,length);assert(size>=0);if(size>8&&contents.subarray){buffer.set(contents.subarray(position,position+size),offset)}else{for(var i=0;i0||position+lengthe2.timestamp){create.push(key);total++}});var remove=[];Object.keys(dst.entries).forEach(function(key){var e=dst.entries[key];var e2=src.entries[key];if(!e2){remove.push(key);total++}});if(!total){return callback(null)}var errored=false;var db=src.type==="remote"?src.db:dst.db;var transaction=db.transaction([IDBFS.DB_STORE_NAME],"readwrite");var store=transaction.objectStore(IDBFS.DB_STORE_NAME);function done(err){if(err&&!errored){errored=true;return callback(err)}}transaction.onerror=function(e){done(this.error);e.preventDefault()};transaction.oncomplete=function(e){if(!errored){callback(null)}};create.sort().forEach(function(path){if(dst.type==="local"){IDBFS.loadRemoteEntry(store,path,function(err,entry){if(err)return done(err);IDBFS.storeLocalEntry(path,entry,done)})}else{IDBFS.loadLocalEntry(path,function(err,entry){if(err)return done(err);IDBFS.storeRemoteEntry(store,path,entry,done)})}});remove.sort().reverse().forEach(function(path){if(dst.type==="local"){IDBFS.removeLocalEntry(path,done)}else{IDBFS.removeRemoteEntry(store,path,done)}})}};var ERRNO_CODES={EPERM:63,ENOENT:44,ESRCH:71,EINTR:27,EIO:29,ENXIO:60,E2BIG:1,ENOEXEC:45,EBADF:8,ECHILD:12,EAGAIN:6,EWOULDBLOCK:6,ENOMEM:48,EACCES:2,EFAULT:21,ENOTBLK:105,EBUSY:10,EEXIST:20,EXDEV:75,ENODEV:43,ENOTDIR:54,EISDIR:31,EINVAL:28,ENFILE:41,EMFILE:33,ENOTTY:59,ETXTBSY:74,EFBIG:22,ENOSPC:51,ESPIPE:70,EROFS:69,EMLINK:34,EPIPE:64,EDOM:18,ERANGE:68,ENOMSG:49,EIDRM:24,ECHRNG:106,EL2NSYNC:156,EL3HLT:107,EL3RST:108,ELNRNG:109,EUNATCH:110,ENOCSI:111,EL2HLT:112,EDEADLK:16,ENOLCK:46,EBADE:113,EBADR:114,EXFULL:115,ENOANO:104,EBADRQC:103,EBADSLT:102,EDEADLOCK:16,EBFONT:101,ENOSTR:100,ENODATA:116,ETIME:117,ENOSR:118,ENONET:119,ENOPKG:120,EREMOTE:121,ENOLINK:47,EADV:122,ESRMNT:123,ECOMM:124,EPROTO:65,EMULTIHOP:36,EDOTDOT:125,EBADMSG:9,ENOTUNIQ:126,EBADFD:127,EREMCHG:128,ELIBACC:129,ELIBBAD:130,ELIBSCN:131,ELIBMAX:132,ELIBEXEC:133,ENOSYS:52,ENOTEMPTY:55,ENAMETOOLONG:37,ELOOP:32,EOPNOTSUPP:138,EPFNOSUPPORT:139,ECONNRESET:15,ENOBUFS:42,EAFNOSUPPORT:5,EPROTOTYPE:67,ENOTSOCK:57,ENOPROTOOPT:50,ESHUTDOWN:140,ECONNREFUSED:14,EADDRINUSE:3,ECONNABORTED:13,ENETUNREACH:40,ENETDOWN:38,ETIMEDOUT:73,EHOSTDOWN:142,EHOSTUNREACH:23,EINPROGRESS:26,EALREADY:7,EDESTADDRREQ:17,EMSGSIZE:35,EPROTONOSUPPORT:66,ESOCKTNOSUPPORT:137,EADDRNOTAVAIL:4,ENETRESET:39,EISCONN:30,ENOTCONN:53,ETOOMANYREFS:141,EUSERS:136,EDQUOT:19,ESTALE:72,ENOTSUP:138,ENOMEDIUM:148,EILSEQ:25,EOVERFLOW:61,ECANCELED:11,ENOTRECOVERABLE:56,EOWNERDEAD:62,ESTRPIPE:135};var NODEFS={isWindows:false,staticInit:function(){NODEFS.isWindows=!!process.platform.match(/^win/);var flags=process["binding"]("constants");if(flags["fs"]){flags=flags["fs"]}NODEFS.flagsForNodeMap={1024:flags["O_APPEND"],64:flags["O_CREAT"],128:flags["O_EXCL"],0:flags["O_RDONLY"],2:flags["O_RDWR"],4096:flags["O_SYNC"],512:flags["O_TRUNC"],1:flags["O_WRONLY"]}},bufferFrom:function(arrayBuffer){return Buffer["alloc"]?Buffer.from(arrayBuffer):new Buffer(arrayBuffer)},convertNodeCode:function(e){var code=e.code;assert(code in ERRNO_CODES);return ERRNO_CODES[code]},mount:function(mount){assert(ENVIRONMENT_HAS_NODE);return NODEFS.createNode(null,"/",NODEFS.getMode(mount.opts.root),0)},createNode:function(parent,name,mode,dev){if(!FS.isDir(mode)&&!FS.isFile(mode)&&!FS.isLink(mode)){throw new FS.ErrnoError(28)}var node=FS.createNode(parent,name,mode);node.node_ops=NODEFS.node_ops;node.stream_ops=NODEFS.stream_ops;return node},getMode:function(path){var stat;try{stat=fs.lstatSync(path);if(NODEFS.isWindows){stat.mode=stat.mode|(stat.mode&292)>>2}}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(NODEFS.convertNodeCode(e))}return stat.mode},realPath:function(node){var parts=[];while(node.parent!==node){parts.push(node.name);node=node.parent}parts.push(node.mount.opts.root);parts.reverse();return PATH.join.apply(null,parts)},flagsForNode:function(flags){flags&=~2097152;flags&=~2048;flags&=~32768;flags&=~524288;var newFlags=0;for(var k in NODEFS.flagsForNodeMap){if(flags&k){newFlags|=NODEFS.flagsForNodeMap[k];flags^=k}}if(!flags){return newFlags}else{throw new FS.ErrnoError(28)}},node_ops:{getattr:function(node){var path=NODEFS.realPath(node);var stat;try{stat=fs.lstatSync(path)}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(NODEFS.convertNodeCode(e))}if(NODEFS.isWindows&&!stat.blksize){stat.blksize=4096}if(NODEFS.isWindows&&!stat.blocks){stat.blocks=(stat.size+stat.blksize-1)/stat.blksize|0}return{dev:stat.dev,ino:stat.ino,mode:stat.mode,nlink:stat.nlink,uid:stat.uid,gid:stat.gid,rdev:stat.rdev,size:stat.size,atime:stat.atime,mtime:stat.mtime,ctime:stat.ctime,blksize:stat.blksize,blocks:stat.blocks}},setattr:function(node,attr){var path=NODEFS.realPath(node);try{if(attr.mode!==undefined){fs.chmodSync(path,attr.mode);node.mode=attr.mode}if(attr.timestamp!==undefined){var date=new Date(attr.timestamp);fs.utimesSync(path,date,date)}if(attr.size!==undefined){fs.truncateSync(path,attr.size)}}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(NODEFS.convertNodeCode(e))}},lookup:function(parent,name){var path=PATH.join2(NODEFS.realPath(parent),name);var mode=NODEFS.getMode(path);return NODEFS.createNode(parent,name,mode)},mknod:function(parent,name,mode,dev){var node=NODEFS.createNode(parent,name,mode,dev);var path=NODEFS.realPath(node);try{if(FS.isDir(node.mode)){fs.mkdirSync(path,node.mode)}else{fs.writeFileSync(path,"",{mode:node.mode})}}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(NODEFS.convertNodeCode(e))}return node},rename:function(oldNode,newDir,newName){var oldPath=NODEFS.realPath(oldNode);var newPath=PATH.join2(NODEFS.realPath(newDir),newName);try{fs.renameSync(oldPath,newPath)}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(NODEFS.convertNodeCode(e))}},unlink:function(parent,name){var path=PATH.join2(NODEFS.realPath(parent),name);try{fs.unlinkSync(path)}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(NODEFS.convertNodeCode(e))}},rmdir:function(parent,name){var path=PATH.join2(NODEFS.realPath(parent),name);try{fs.rmdirSync(path)}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(NODEFS.convertNodeCode(e))}},readdir:function(node){var path=NODEFS.realPath(node);try{return fs.readdirSync(path)}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(NODEFS.convertNodeCode(e))}},symlink:function(parent,newName,oldPath){var newPath=PATH.join2(NODEFS.realPath(parent),newName);try{fs.symlinkSync(oldPath,newPath)}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(NODEFS.convertNodeCode(e))}},readlink:function(node){var path=NODEFS.realPath(node);try{path=fs.readlinkSync(path);path=NODEJS_PATH.relative(NODEJS_PATH.resolve(node.mount.opts.root),path);return path}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(NODEFS.convertNodeCode(e))}}},stream_ops:{open:function(stream){var path=NODEFS.realPath(stream.node);try{if(FS.isFile(stream.node.mode)){stream.nfd=fs.openSync(path,NODEFS.flagsForNode(stream.flags))}}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(NODEFS.convertNodeCode(e))}},close:function(stream){try{if(FS.isFile(stream.node.mode)&&stream.nfd){fs.closeSync(stream.nfd)}}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(NODEFS.convertNodeCode(e))}},read:function(stream,buffer,offset,length,position){if(length===0)return 0;try{return fs.readSync(stream.nfd,NODEFS.bufferFrom(buffer.buffer),offset,length,position)}catch(e){throw new FS.ErrnoError(NODEFS.convertNodeCode(e))}},write:function(stream,buffer,offset,length,position){try{return fs.writeSync(stream.nfd,NODEFS.bufferFrom(buffer.buffer),offset,length,position)}catch(e){throw new FS.ErrnoError(NODEFS.convertNodeCode(e))}},llseek:function(stream,offset,whence){var position=offset;if(whence===1){position+=stream.position}else if(whence===2){if(FS.isFile(stream.node.mode)){try{var stat=fs.fstatSync(stream.nfd);position+=stat.size}catch(e){throw new FS.ErrnoError(NODEFS.convertNodeCode(e))}}}if(position<0){throw new FS.ErrnoError(28)}return position}}};var WORKERFS={DIR_MODE:16895,FILE_MODE:33279,reader:null,mount:function(mount){assert(ENVIRONMENT_IS_WORKER);if(!WORKERFS.reader)WORKERFS.reader=new FileReaderSync;var root=WORKERFS.createNode(null,"/",WORKERFS.DIR_MODE,0);var createdParents={};function ensureParent(path){var parts=path.split("/");var parent=root;for(var i=0;i=stream.node.size)return 0;var chunk=stream.node.contents.slice(position,position+length);var ab=WORKERFS.reader.readAsArrayBuffer(chunk);buffer.set(new Uint8Array(ab),offset);return chunk.size},write:function(stream,buffer,offset,length,position){throw new FS.ErrnoError(29)},llseek:function(stream,offset,whence){var position=offset;if(whence===1){position+=stream.position}else if(whence===2){if(FS.isFile(stream.node.mode)){position+=stream.node.size}}if(position<0){throw new FS.ErrnoError(28)}return position}}};var ERRNO_MESSAGES={0:"Success",1:"Arg list too long",2:"Permission denied",3:"Address already in use",4:"Address not available",5:"Address family not supported by protocol family",6:"No more processes",7:"Socket already connected",8:"Bad file number",9:"Trying to read unreadable message",10:"Mount device busy",11:"Operation canceled",12:"No children",13:"Connection aborted",14:"Connection refused",15:"Connection reset by peer",16:"File locking deadlock error",17:"Destination address required",18:"Math arg out of domain of func",19:"Quota exceeded",20:"File exists",21:"Bad address",22:"File too large",23:"Host is unreachable",24:"Identifier removed",25:"Illegal byte sequence",26:"Connection already in progress",27:"Interrupted system call",28:"Invalid argument",29:"I/O error",30:"Socket is already connected",31:"Is a directory",32:"Too many symbolic links",33:"Too many open files",34:"Too many links",35:"Message too long",36:"Multihop attempted",37:"File or path name too long",38:"Network interface is not configured",39:"Connection reset by network",40:"Network is unreachable",41:"Too many open files in system",42:"No buffer space available",43:"No such device",44:"No such file or directory",45:"Exec format error",46:"No record locks available",47:"The link has been severed",48:"Not enough core",49:"No message of desired type",50:"Protocol not available",51:"No space left on device",52:"Function not implemented",53:"Socket is not connected",54:"Not a directory",55:"Directory not empty",56:"State not recoverable",57:"Socket operation on non-socket",59:"Not a typewriter",60:"No such device or address",61:"Value too large for defined data type",62:"Previous owner died",63:"Not super-user",64:"Broken pipe",65:"Protocol error",66:"Unknown protocol",67:"Protocol wrong type for socket",68:"Math result not representable",69:"Read only file system",70:"Illegal seek",71:"No such process",72:"Stale file handle",73:"Connection timed out",74:"Text file busy",75:"Cross-device link",100:"Device not a stream",101:"Bad font file fmt",102:"Invalid slot",103:"Invalid request code",104:"No anode",105:"Block device required",106:"Channel number out of range",107:"Level 3 halted",108:"Level 3 reset",109:"Link number out of range",110:"Protocol driver not attached",111:"No CSI structure available",112:"Level 2 halted",113:"Invalid exchange",114:"Invalid request descriptor",115:"Exchange full",116:"No data (for no delay io)",117:"Timer expired",118:"Out of streams resources",119:"Machine is not on the network",120:"Package not installed",121:"The object is remote",122:"Advertise error",123:"Srmount error",124:"Communication error on send",125:"Cross mount point (not really error)",126:"Given log. name not unique",127:"f.d. invalid for this operation",128:"Remote address changed",129:"Can access a needed shared lib",130:"Accessing a corrupted shared lib",131:".lib section in a.out corrupted",132:"Attempting to link in too many libs",133:"Attempting to exec a shared library",135:"Streams pipe error",136:"Too many users",137:"Socket type not supported",138:"Not supported",139:"Protocol family not supported",140:"Can't send after socket shutdown",141:"Too many references",142:"Host is down",148:"No medium (in tape drive)",156:"Level 2 not synchronized"};var FS={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:false,ignorePermissions:true,trackingDelegate:{},tracking:{openFlags:{READ:1,WRITE:2}},ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,handleFSError:function(e){if(!(e instanceof FS.ErrnoError))throw e+" : "+stackTrace();return ___setErrNo(e.errno)},lookupPath:function(path,opts){path=PATH_FS.resolve(FS.cwd(),path);opts=opts||{};if(!path)return{path:"",node:null};var defaults={follow_mount:true,recurse_count:0};for(var key in defaults){if(opts[key]===undefined){opts[key]=defaults[key]}}if(opts.recurse_count>8){throw new FS.ErrnoError(32)}var parts=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),false);var current=FS.root;var current_path="/";for(var i=0;i40){throw new FS.ErrnoError(32)}}}}return{path:current_path,node:current}},getPath:function(node){var path;while(true){if(FS.isRoot(node)){var mount=node.mount.mountpoint;if(!path)return mount;return mount[mount.length-1]!=="/"?mount+"/"+path:mount+path}path=path?node.name+"/"+path:node.name;node=node.parent}},hashName:function(parentid,name){var hash=0;for(var i=0;i>>0)%FS.nameTable.length},hashAddNode:function(node){var hash=FS.hashName(node.parent.id,node.name);node.name_next=FS.nameTable[hash];FS.nameTable[hash]=node},hashRemoveNode:function(node){var hash=FS.hashName(node.parent.id,node.name);if(FS.nameTable[hash]===node){FS.nameTable[hash]=node.name_next}else{var current=FS.nameTable[hash];while(current){if(current.name_next===node){current.name_next=node.name_next;break}current=current.name_next}}},lookupNode:function(parent,name){var err=FS.mayLookup(parent);if(err){throw new FS.ErrnoError(err,parent)}var hash=FS.hashName(parent.id,name);for(var node=FS.nameTable[hash];node;node=node.name_next){var nodeName=node.name;if(node.parent.id===parent.id&&nodeName===name){return node}}return FS.lookup(parent,name)},createNode:function(parent,name,mode,rdev){if(!FS.FSNode){FS.FSNode=function(parent,name,mode,rdev){if(!parent){parent=this}this.parent=parent;this.mount=parent.mount;this.mounted=null;this.id=FS.nextInode++;this.name=name;this.mode=mode;this.node_ops={};this.stream_ops={};this.rdev=rdev};FS.FSNode.prototype={};var readMode=292|73;var writeMode=146;Object.defineProperties(FS.FSNode.prototype,{read:{get:function(){return(this.mode&readMode)===readMode},set:function(val){val?this.mode|=readMode:this.mode&=~readMode}},write:{get:function(){return(this.mode&writeMode)===writeMode},set:function(val){val?this.mode|=writeMode:this.mode&=~writeMode}},isFolder:{get:function(){return FS.isDir(this.mode)}},isDevice:{get:function(){return FS.isChrdev(this.mode)}}})}var node=new FS.FSNode(parent,name,mode,rdev);FS.hashAddNode(node);return node},destroyNode:function(node){FS.hashRemoveNode(node)},isRoot:function(node){return node===node.parent},isMountpoint:function(node){return!!node.mounted},isFile:function(mode){return(mode&61440)===32768},isDir:function(mode){return(mode&61440)===16384},isLink:function(mode){return(mode&61440)===40960},isChrdev:function(mode){return(mode&61440)===8192},isBlkdev:function(mode){return(mode&61440)===24576},isFIFO:function(mode){return(mode&61440)===4096},isSocket:function(mode){return(mode&49152)===49152},flagModes:{"r":0,"rs":1052672,"r+":2,"w":577,"wx":705,"xw":705,"w+":578,"wx+":706,"xw+":706,"a":1089,"ax":1217,"xa":1217,"a+":1090,"ax+":1218,"xa+":1218},modeStringToFlags:function(str){var flags=FS.flagModes[str];if(typeof flags==="undefined"){throw new Error("Unknown file open mode: "+str)}return flags},flagsToPermissionString:function(flag){var perms=["r","w","rw"][flag&3];if(flag&512){perms+="w"}return perms},nodePermissions:function(node,perms){if(FS.ignorePermissions){return 0}if(perms.indexOf("r")!==-1&&!(node.mode&292)){return 2}else if(perms.indexOf("w")!==-1&&!(node.mode&146)){return 2}else if(perms.indexOf("x")!==-1&&!(node.mode&73)){return 2}return 0},mayLookup:function(dir){var err=FS.nodePermissions(dir,"x");if(err)return err;if(!dir.node_ops.lookup)return 2;return 0},mayCreate:function(dir,name){try{var node=FS.lookupNode(dir,name);return 20}catch(e){}return FS.nodePermissions(dir,"wx")},mayDelete:function(dir,name,isdir){var node;try{node=FS.lookupNode(dir,name)}catch(e){return e.errno}var err=FS.nodePermissions(dir,"wx");if(err){return err}if(isdir){if(!FS.isDir(node.mode)){return 54}if(FS.isRoot(node)||FS.getPath(node)===FS.cwd()){return 10}}else{if(FS.isDir(node.mode)){return 31}}return 0},mayOpen:function(node,flags){if(!node){return 44}if(FS.isLink(node.mode)){return 32}else if(FS.isDir(node.mode)){if(FS.flagsToPermissionString(flags)!=="r"||flags&512){return 31}}return FS.nodePermissions(node,FS.flagsToPermissionString(flags))},MAX_OPEN_FDS:4096,nextfd:function(fd_start,fd_end){fd_start=fd_start||0;fd_end=fd_end||FS.MAX_OPEN_FDS;for(var fd=fd_start;fd<=fd_end;fd++){if(!FS.streams[fd]){return fd}}throw new FS.ErrnoError(33)},getStream:function(fd){return FS.streams[fd]},createStream:function(stream,fd_start,fd_end){if(!FS.FSStream){FS.FSStream=function(){};FS.FSStream.prototype={};Object.defineProperties(FS.FSStream.prototype,{object:{get:function(){return this.node},set:function(val){this.node=val}},isRead:{get:function(){return(this.flags&2097155)!==1}},isWrite:{get:function(){return(this.flags&2097155)!==0}},isAppend:{get:function(){return this.flags&1024}}})}var newStream=new FS.FSStream;for(var p in stream){newStream[p]=stream[p]}stream=newStream;var fd=FS.nextfd(fd_start,fd_end);stream.fd=fd;FS.streams[fd]=stream;return stream},closeStream:function(fd){FS.streams[fd]=null},chrdev_stream_ops:{open:function(stream){var device=FS.getDevice(stream.node.rdev);stream.stream_ops=device.stream_ops;if(stream.stream_ops.open){stream.stream_ops.open(stream)}},llseek:function(){throw new FS.ErrnoError(70)}},major:function(dev){return dev>>8},minor:function(dev){return dev&255},makedev:function(ma,mi){return ma<<8|mi},registerDevice:function(dev,ops){FS.devices[dev]={stream_ops:ops}},getDevice:function(dev){return FS.devices[dev]},getMounts:function(mount){var mounts=[];var check=[mount];while(check.length){var m=check.pop();mounts.push(m);check.push.apply(check,m.mounts)}return mounts},syncfs:function(populate,callback){if(typeof populate==="function"){callback=populate;populate=false}FS.syncFSRequests++;if(FS.syncFSRequests>1){console.log("warning: "+FS.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work")}var mounts=FS.getMounts(FS.root.mount);var completed=0;function doCallback(err){assert(FS.syncFSRequests>0);FS.syncFSRequests--;return callback(err)}function done(err){if(err){if(!done.errored){done.errored=true;return doCallback(err)}return}if(++completed>=mounts.length){doCallback(null)}}mounts.forEach(function(mount){if(!mount.type.syncfs){return done(null)}mount.type.syncfs(mount,populate,done)})},mount:function(type,opts,mountpoint){var root=mountpoint==="/";var pseudo=!mountpoint;var node;if(root&&FS.root){throw new FS.ErrnoError(10)}else if(!root&&!pseudo){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});mountpoint=lookup.path;node=lookup.node;if(FS.isMountpoint(node)){throw new FS.ErrnoError(10)}if(!FS.isDir(node.mode)){throw new FS.ErrnoError(54)}}var mount={type:type,opts:opts,mountpoint:mountpoint,mounts:[]};var mountRoot=type.mount(mount);mountRoot.mount=mount;mount.root=mountRoot;if(root){FS.root=mountRoot}else if(node){node.mounted=mount;if(node.mount){node.mount.mounts.push(mount)}}return mountRoot},unmount:function(mountpoint){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});if(!FS.isMountpoint(lookup.node)){throw new FS.ErrnoError(28)}var node=lookup.node;var mount=node.mounted;var mounts=FS.getMounts(mount);Object.keys(FS.nameTable).forEach(function(hash){var current=FS.nameTable[hash];while(current){var next=current.name_next;if(mounts.indexOf(current.mount)!==-1){FS.destroyNode(current)}current=next}});node.mounted=null;var idx=node.mount.mounts.indexOf(mount);assert(idx!==-1);node.mount.mounts.splice(idx,1)},lookup:function(parent,name){return parent.node_ops.lookup(parent,name)},mknod:function(path,mode,dev){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);if(!name||name==="."||name===".."){throw new FS.ErrnoError(28)}var err=FS.mayCreate(parent,name);if(err){throw new FS.ErrnoError(err)}if(!parent.node_ops.mknod){throw new FS.ErrnoError(63)}return parent.node_ops.mknod(parent,name,mode,dev)},create:function(path,mode){mode=mode!==undefined?mode:438;mode&=4095;mode|=32768;return FS.mknod(path,mode,0)},mkdir:function(path,mode){mode=mode!==undefined?mode:511;mode&=511|512;mode|=16384;return FS.mknod(path,mode,0)},mkdirTree:function(path,mode){var dirs=path.split("/");var d="";for(var i=0;ithis.length-1||idx<0){return undefined}var chunkOffset=idx%this.chunkSize;var chunkNum=idx/this.chunkSize|0;return this.getter(chunkNum)[chunkOffset]};LazyUint8Array.prototype.setDataGetter=function LazyUint8Array_setDataGetter(getter){this.getter=getter};LazyUint8Array.prototype.cacheLength=function LazyUint8Array_cacheLength(){var xhr=new XMLHttpRequest;xhr.open("HEAD",url,false);xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);var datalength=Number(xhr.getResponseHeader("Content-length"));var header;var hasByteServing=(header=xhr.getResponseHeader("Accept-Ranges"))&&header==="bytes";var usesGzip=(header=xhr.getResponseHeader("Content-Encoding"))&&header==="gzip";var chunkSize=1024*1024;if(!hasByteServing)chunkSize=datalength;var doXHR=function(from,to){if(from>to)throw new Error("invalid range ("+from+", "+to+") or no bytes requested!");if(to>datalength-1)throw new Error("only "+datalength+" bytes available! programmer error!");var xhr=new XMLHttpRequest;xhr.open("GET",url,false);if(datalength!==chunkSize)xhr.setRequestHeader("Range","bytes="+from+"-"+to);if(typeof Uint8Array!="undefined")xhr.responseType="arraybuffer";if(xhr.overrideMimeType){xhr.overrideMimeType("text/plain; charset=x-user-defined")}xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);if(xhr.response!==undefined){return new Uint8Array(xhr.response||[])}else{return intArrayFromString(xhr.responseText||"",true)}};var lazyArray=this;lazyArray.setDataGetter(function(chunkNum){var start=chunkNum*chunkSize;var end=(chunkNum+1)*chunkSize-1;end=Math.min(end,datalength-1);if(typeof lazyArray.chunks[chunkNum]==="undefined"){lazyArray.chunks[chunkNum]=doXHR(start,end)}if(typeof lazyArray.chunks[chunkNum]==="undefined")throw new Error("doXHR failed!");return lazyArray.chunks[chunkNum]});if(usesGzip||!datalength){chunkSize=datalength=1;datalength=this.getter(0).length;chunkSize=datalength;console.log("LazyFiles on gzip forces download of the whole file when length is accessed")}this._length=datalength;this._chunkSize=chunkSize;this.lengthKnown=true};if(typeof XMLHttpRequest!=="undefined"){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var lazyArray=new LazyUint8Array;Object.defineProperties(lazyArray,{length:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._length}},chunkSize:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._chunkSize}}});var properties={isDevice:false,contents:lazyArray}}else{var properties={isDevice:false,url:url}}var node=FS.createFile(parent,name,properties,canRead,canWrite);if(properties.contents){node.contents=properties.contents}else if(properties.url){node.contents=null;node.url=properties.url}Object.defineProperties(node,{usedBytes:{get:function(){return this.contents.length}}});var stream_ops={};var keys=Object.keys(node.stream_ops);keys.forEach(function(key){var fn=node.stream_ops[key];stream_ops[key]=function forceLoadLazyFile(){if(!FS.forceLoadFile(node)){throw new FS.ErrnoError(29)}return fn.apply(null,arguments)}});stream_ops.read=function stream_ops_read(stream,buffer,offset,length,position){if(!FS.forceLoadFile(node)){throw new FS.ErrnoError(29)}var contents=stream.node.contents;if(position>=contents.length)return 0;var size=Math.min(contents.length-position,length);assert(size>=0);if(contents.slice){for(var i=0;i>2]=stat.dev;HEAP32[buf+4>>2]=0;HEAP32[buf+8>>2]=stat.ino;HEAP32[buf+12>>2]=stat.mode;HEAP32[buf+16>>2]=stat.nlink;HEAP32[buf+20>>2]=stat.uid;HEAP32[buf+24>>2]=stat.gid;HEAP32[buf+28>>2]=stat.rdev;HEAP32[buf+32>>2]=0;tempI64=[stat.size>>>0,(tempDouble=stat.size,+Math_abs(tempDouble)>=1?tempDouble>0?(Math_min(+Math_floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math_ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+40>>2]=tempI64[0],HEAP32[buf+44>>2]=tempI64[1];HEAP32[buf+48>>2]=4096;HEAP32[buf+52>>2]=stat.blocks;HEAP32[buf+56>>2]=stat.atime.getTime()/1e3|0;HEAP32[buf+60>>2]=0;HEAP32[buf+64>>2]=stat.mtime.getTime()/1e3|0;HEAP32[buf+68>>2]=0;HEAP32[buf+72>>2]=stat.ctime.getTime()/1e3|0;HEAP32[buf+76>>2]=0;tempI64=[stat.ino>>>0,(tempDouble=stat.ino,+Math_abs(tempDouble)>=1?tempDouble>0?(Math_min(+Math_floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math_ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+80>>2]=tempI64[0],HEAP32[buf+84>>2]=tempI64[1];return 0},doMsync:function(addr,stream,len,flags){var buffer=new Uint8Array(HEAPU8.subarray(addr,addr+len));FS.msync(stream,buffer,0,len,flags)},doMkdir:function(path,mode){path=PATH.normalize(path);if(path[path.length-1]==="/")path=path.substr(0,path.length-1);FS.mkdir(path,mode,0);return 0},doMknod:function(path,mode,dev){switch(mode&61440){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}FS.mknod(path,mode,dev);return 0},doReadlink:function(path,buf,bufsize){if(bufsize<=0)return-28;var ret=FS.readlink(path);var len=Math.min(bufsize,lengthBytesUTF8(ret));var endChar=HEAP8[buf+len];stringToUTF8(ret,buf,bufsize+1);HEAP8[buf+len]=endChar;return len},doAccess:function(path,amode){if(amode&~7){return-28}var node;var lookup=FS.lookupPath(path,{follow:true});node=lookup.node;if(!node){return-44}var perms="";if(amode&4)perms+="r";if(amode&2)perms+="w";if(amode&1)perms+="x";if(perms&&FS.nodePermissions(node,perms)){return-2}return 0},doDup:function(path,flags,suggestFD){var suggest=FS.getStream(suggestFD);if(suggest)FS.close(suggest);return FS.open(path,flags,0,suggestFD,suggestFD).fd},doReadv:function(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.read(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(curr>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.write(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr}return ret},varargs:0,get:function(varargs){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret},getStr:function(){var ret=UTF8ToString(SYSCALLS.get());return ret},getStreamFromFD:function(fd){if(fd===undefined)fd=SYSCALLS.get();var stream=FS.getStream(fd);if(!stream)throw new FS.ErrnoError(8);return stream},get64:function(){var low=SYSCALLS.get(),high=SYSCALLS.get();if(low>=0)assert(high===0);else assert(high===-1);return low},getZero:function(){assert(SYSCALLS.get()===0)}};function ___syscall221(which,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(),cmd=SYSCALLS.get();switch(cmd){case 0:{var arg=SYSCALLS.get();if(arg<0){return-28}var newStream;newStream=FS.open(stream.path,stream.flags,0,arg);return newStream.fd}case 1:case 2:return 0;case 3:return stream.flags;case 4:{var arg=SYSCALLS.get();stream.flags|=arg;return 0}case 12:{var arg=SYSCALLS.get();var offset=0;HEAP16[arg+offset>>1]=2;return 0}case 13:case 14:return 0;case 16:case 8:return-28;case 9:___setErrNo(28);return-1;default:{return-28}}}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall3(which,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(),buf=SYSCALLS.get(),count=SYSCALLS.get();return FS.read(stream,HEAP8,buf,count)}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall5(which,varargs){SYSCALLS.varargs=varargs;try{var pathname=SYSCALLS.getStr(),flags=SYSCALLS.get(),mode=SYSCALLS.get();var stream=FS.open(pathname,flags,mode);return stream.fd}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___unlock(){}function _fd_close(fd){try{var stream=SYSCALLS.getStreamFromFD(fd);FS.close(stream);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function ___wasi_fd_close(){return _fd_close.apply(null,arguments)}function _fd_fdstat_get(fd,pbuf){try{var stream=SYSCALLS.getStreamFromFD(fd);var type=stream.tty?2:FS.isDir(stream.mode)?3:FS.isLink(stream.mode)?7:4;HEAP8[pbuf>>0]=type;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function ___wasi_fd_fdstat_get(){return _fd_fdstat_get.apply(null,arguments)}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){try{var stream=SYSCALLS.getStreamFromFD(fd);var HIGH_OFFSET=4294967296;var offset=offset_high*HIGH_OFFSET+(offset_low>>>0);var DOUBLE_LIMIT=9007199254740992;if(offset<=-DOUBLE_LIMIT||offset>=DOUBLE_LIMIT){return-61}FS.llseek(stream,offset,whence);tempI64=[stream.position>>>0,(tempDouble=stream.position,+Math_abs(tempDouble)>=1?tempDouble>0?(Math_min(+Math_floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math_ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[newOffset>>2]=tempI64[0],HEAP32[newOffset+4>>2]=tempI64[1];if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function ___wasi_fd_seek(){return _fd_seek.apply(null,arguments)}function _fd_write(fd,iov,iovcnt,pnum){try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doWritev(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function ___wasi_fd_write(){return _fd_write.apply(null,arguments)}function __emscripten_fetch_free(id){delete Fetch.xhrs[id-1]}function _abort(){abort()}function _clock(){if(_clock.start===undefined)_clock.start=Date.now();return(Date.now()-_clock.start)*(1e6/1e3)|0}function _emscripten_get_now(){abort()}function _emscripten_get_now_is_monotonic(){return 0||ENVIRONMENT_IS_NODE||typeof dateNow!=="undefined"||typeof performance==="object"&&performance&&typeof performance["now"]==="function"}function _clock_gettime(clk_id,tp){var now;if(clk_id===0){now=Date.now()}else if(clk_id===1&&_emscripten_get_now_is_monotonic()){now=_emscripten_get_now()}else{___setErrNo(28);return-1}HEAP32[tp>>2]=now/1e3|0;HEAP32[tp+4>>2]=now%1e3*1e3*1e3|0;return 0}function _emscripten_get_heap_size(){return HEAP8.length}function _emscripten_is_main_browser_thread(){return!ENVIRONMENT_IS_WORKER}function emscripten_realloc_buffer(size){try{wasmMemory.grow(size-buffer.byteLength+65535>>16);updateGlobalBufferAndViews(wasmMemory.buffer);return 1}catch(e){console.error("emscripten_realloc_buffer: Attempted to grow heap from "+buffer.byteLength+" bytes to "+size+" bytes, but got error: "+e)}}function _emscripten_resize_heap(requestedSize){var oldSize=_emscripten_get_heap_size();assert(requestedSize>oldSize);var PAGE_MULTIPLE=65536;var LIMIT=2147483648-PAGE_MULTIPLE;if(requestedSize>LIMIT){err("Cannot enlarge memory, asked to go up to "+requestedSize+" bytes, but the limit is "+LIMIT+" bytes!");return false}var MIN_TOTAL_MEMORY=16777216;var newSize=Math.max(oldSize,MIN_TOTAL_MEMORY);while(newSize>2]=val;HEAPU32[addr+4>>2]=val/4294967296|0},openDatabase:function(dbname,dbversion,onsuccess,onerror){try{var openRequest=indexedDB.open(dbname,dbversion)}catch(e){return onerror(e)}openRequest.onupgradeneeded=function(event){var db=event.target.result;if(db.objectStoreNames.contains("FILES")){db.deleteObjectStore("FILES")}db.createObjectStore("FILES")};openRequest.onsuccess=function(event){onsuccess(event.target.result)};openRequest.onerror=function(error){onerror(error)}},staticInit:function(){var isMainThread=typeof ENVIRONMENT_IS_FETCH_WORKER==="undefined";var onsuccess=function(db){Fetch.dbInstance=db;if(isMainThread){removeRunDependency("library_fetch_init")}};var onerror=function(){Fetch.dbInstance=false;if(isMainThread){removeRunDependency("library_fetch_init")}};Fetch.openDatabase("emscripten_filesystem",1,onsuccess,onerror);if(typeof ENVIRONMENT_IS_FETCH_WORKER==="undefined"||!ENVIRONMENT_IS_FETCH_WORKER)addRunDependency("library_fetch_init")}};function __emscripten_fetch_xhr(fetch,onsuccess,onerror,onprogress,onreadystatechange){var url=HEAPU32[fetch+8>>2];if(!url){onerror(fetch,0,"no url specified!");return}var url_=UTF8ToString(url);var fetch_attr=fetch+112;var requestMethod=UTF8ToString(fetch_attr);if(!requestMethod)requestMethod="GET";var userData=HEAPU32[fetch_attr+32>>2];var fetchAttributes=HEAPU32[fetch_attr+52>>2];var timeoutMsecs=HEAPU32[fetch_attr+56>>2];var withCredentials=!!HEAPU32[fetch_attr+60>>2];var destinationPath=HEAPU32[fetch_attr+64>>2];var userName=HEAPU32[fetch_attr+68>>2];var password=HEAPU32[fetch_attr+72>>2];var requestHeaders=HEAPU32[fetch_attr+76>>2];var overriddenMimeType=HEAPU32[fetch_attr+80>>2];var dataPtr=HEAPU32[fetch_attr+84>>2];var dataLength=HEAPU32[fetch_attr+88>>2];var fetchAttrLoadToMemory=!!(fetchAttributes&1);var fetchAttrStreamData=!!(fetchAttributes&2);var fetchAttrPersistFile=!!(fetchAttributes&4);var fetchAttrAppend=!!(fetchAttributes&8);var fetchAttrReplace=!!(fetchAttributes&16);var fetchAttrSynchronous=!!(fetchAttributes&64);var fetchAttrWaitable=!!(fetchAttributes&128);var userNameStr=userName?UTF8ToString(userName):undefined;var passwordStr=password?UTF8ToString(password):undefined;var overriddenMimeTypeStr=overriddenMimeType?UTF8ToString(overriddenMimeType):undefined;var xhr=new XMLHttpRequest;xhr.withCredentials=withCredentials;xhr.open(requestMethod,url_,!fetchAttrSynchronous,userNameStr,passwordStr);if(!fetchAttrSynchronous)xhr.timeout=timeoutMsecs;xhr.url_=url_;assert(!fetchAttrStreamData,"streaming uses moz-chunked-arraybuffer which is no longer supported; TODO: rewrite using fetch()");xhr.responseType="arraybuffer";if(overriddenMimeType){xhr.overrideMimeType(overriddenMimeTypeStr)}if(requestHeaders){for(;;){var key=HEAPU32[requestHeaders>>2];if(!key)break;var value=HEAPU32[requestHeaders+4>>2];if(!value)break;requestHeaders+=8;var keyStr=UTF8ToString(key);var valueStr=UTF8ToString(value);xhr.setRequestHeader(keyStr,valueStr)}}Fetch.xhrs.push(xhr);var id=Fetch.xhrs.length;HEAPU32[fetch+0>>2]=id;var data=dataPtr&&dataLength?HEAPU8.slice(dataPtr,dataPtr+dataLength):null;xhr.onload=function(e){var len=xhr.response?xhr.response.byteLength:0;var ptr=0;var ptrLen=0;if(fetchAttrLoadToMemory&&!fetchAttrStreamData){ptrLen=len;ptr=_malloc(ptrLen);HEAPU8.set(new Uint8Array(xhr.response),ptr)}HEAPU32[fetch+12>>2]=ptr;Fetch.setu64(fetch+16,ptrLen);Fetch.setu64(fetch+24,0);if(len){Fetch.setu64(fetch+32,len)}HEAPU16[fetch+40>>1]=xhr.readyState;if(xhr.readyState===4&&xhr.status===0){if(len>0)xhr.status=200;else xhr.status=404}HEAPU16[fetch+42>>1]=xhr.status;if(xhr.statusText)stringToUTF8(xhr.statusText,fetch+44,64);if(xhr.status>=200&&xhr.status<300){if(onsuccess)onsuccess(fetch,xhr,e)}else{if(onerror)onerror(fetch,xhr,e)}};xhr.onerror=function(e){var status=xhr.status;if(xhr.readyState===4&&status===0)status=404;HEAPU32[fetch+12>>2]=0;Fetch.setu64(fetch+16,0);Fetch.setu64(fetch+24,0);Fetch.setu64(fetch+32,0);HEAPU16[fetch+40>>1]=xhr.readyState;HEAPU16[fetch+42>>1]=status;if(onerror)onerror(fetch,xhr,e)};xhr.ontimeout=function(e){if(onerror)onerror(fetch,xhr,e)};xhr.onprogress=function(e){var ptrLen=fetchAttrLoadToMemory&&fetchAttrStreamData&&xhr.response?xhr.response.byteLength:0;var ptr=0;if(fetchAttrLoadToMemory&&fetchAttrStreamData){ptr=_malloc(ptrLen);HEAPU8.set(new Uint8Array(xhr.response),ptr)}HEAPU32[fetch+12>>2]=ptr;Fetch.setu64(fetch+16,ptrLen);Fetch.setu64(fetch+24,e.loaded-ptrLen);Fetch.setu64(fetch+32,e.total);HEAPU16[fetch+40>>1]=xhr.readyState;if(xhr.readyState>=3&&xhr.status===0&&e.loaded>0)xhr.status=200;HEAPU16[fetch+42>>1]=xhr.status;if(xhr.statusText)stringToUTF8(xhr.statusText,fetch+44,64);if(onprogress)onprogress(fetch,xhr,e)};xhr.onreadystatechange=function(e){HEAPU16[fetch+40>>1]=xhr.readyState;if(xhr.readyState>=2){HEAPU16[fetch+42>>1]=xhr.status}if(onreadystatechange)onreadystatechange(fetch,xhr,e)};try{xhr.send(data)}catch(e){if(onerror)onerror(fetch,xhr,e)}}function __emscripten_fetch_cache_data(db,fetch,data,onsuccess,onerror){if(!db){onerror(fetch,0,"IndexedDB not available!");return}var fetch_attr=fetch+112;var destinationPath=HEAPU32[fetch_attr+64>>2];if(!destinationPath)destinationPath=HEAPU32[fetch+8>>2];var destinationPathStr=UTF8ToString(destinationPath);try{var transaction=db.transaction(["FILES"],"readwrite");var packages=transaction.objectStore("FILES");var putRequest=packages.put(data,destinationPathStr);putRequest.onsuccess=function(event){HEAPU16[fetch+40>>1]=4;HEAPU16[fetch+42>>1]=200;stringToUTF8("OK",fetch+44,64);onsuccess(fetch,0,destinationPathStr)};putRequest.onerror=function(error){HEAPU16[fetch+40>>1]=4;HEAPU16[fetch+42>>1]=413;stringToUTF8("Payload Too Large",fetch+44,64);onerror(fetch,0,error)}}catch(e){onerror(fetch,0,e)}}function __emscripten_fetch_load_cached_data(db,fetch,onsuccess,onerror){if(!db){onerror(fetch,0,"IndexedDB not available!");return}var fetch_attr=fetch+112;var path=HEAPU32[fetch_attr+64>>2];if(!path)path=HEAPU32[fetch+8>>2];var pathStr=UTF8ToString(path);try{var transaction=db.transaction(["FILES"],"readonly");var packages=transaction.objectStore("FILES");var getRequest=packages.get(pathStr);getRequest.onsuccess=function(event){if(event.target.result){var value=event.target.result;var len=value.byteLength||value.length;var ptr=_malloc(len);HEAPU8.set(new Uint8Array(value),ptr);HEAPU32[fetch+12>>2]=ptr;Fetch.setu64(fetch+16,len);Fetch.setu64(fetch+24,0);Fetch.setu64(fetch+32,len);HEAPU16[fetch+40>>1]=4;HEAPU16[fetch+42>>1]=200;stringToUTF8("OK",fetch+44,64);onsuccess(fetch,0,value)}else{HEAPU16[fetch+40>>1]=4;HEAPU16[fetch+42>>1]=404;stringToUTF8("Not Found",fetch+44,64);onerror(fetch,0,"no data")}};getRequest.onerror=function(error){HEAPU16[fetch+40>>1]=4;HEAPU16[fetch+42>>1]=404;stringToUTF8("Not Found",fetch+44,64);onerror(fetch,0,error)}}catch(e){onerror(fetch,0,e)}}function __emscripten_fetch_delete_cached_data(db,fetch,onsuccess,onerror){if(!db){onerror(fetch,0,"IndexedDB not available!");return}var fetch_attr=fetch+112;var path=HEAPU32[fetch_attr+64>>2];if(!path)path=HEAPU32[fetch+8>>2];var pathStr=UTF8ToString(path);try{var transaction=db.transaction(["FILES"],"readwrite");var packages=transaction.objectStore("FILES");var request=packages.delete(pathStr);request.onsuccess=function(event){var value=event.target.result;HEAPU32[fetch+12>>2]=0;Fetch.setu64(fetch+16,0);Fetch.setu64(fetch+24,0);Fetch.setu64(fetch+32,0);HEAPU16[fetch+40>>1]=4;HEAPU16[fetch+42>>1]=200;stringToUTF8("OK",fetch+44,64);onsuccess(fetch,0,value)};request.onerror=function(error){HEAPU16[fetch+40>>1]=4;HEAPU16[fetch+42>>1]=404;stringToUTF8("Not Found",fetch+44,64);onerror(fetch,0,error)}}catch(e){onerror(fetch,0,e)}}function _emscripten_start_fetch(fetch,successcb,errorcb,progresscb,readystatechangecb){if(typeof noExitRuntime!=="undefined")noExitRuntime=true;var fetch_attr=fetch+112;var requestMethod=UTF8ToString(fetch_attr);var onsuccess=HEAPU32[fetch_attr+36>>2];var onerror=HEAPU32[fetch_attr+40>>2];var onprogress=HEAPU32[fetch_attr+44>>2];var onreadystatechange=HEAPU32[fetch_attr+48>>2];var fetchAttributes=HEAPU32[fetch_attr+52>>2];var fetchAttrLoadToMemory=!!(fetchAttributes&1);var fetchAttrStreamData=!!(fetchAttributes&2);var fetchAttrPersistFile=!!(fetchAttributes&4);var fetchAttrNoDownload=!!(fetchAttributes&32);var fetchAttrAppend=!!(fetchAttributes&8);var fetchAttrReplace=!!(fetchAttributes&16);var reportSuccess=function(fetch,xhr,e){if(onsuccess)dynCall_vi(onsuccess,fetch);else if(successcb)successcb(fetch)};var reportProgress=function(fetch,xhr,e){if(onprogress)dynCall_vi(onprogress,fetch);else if(progresscb)progresscb(fetch)};var reportError=function(fetch,xhr,e){if(onerror)dynCall_vi(onerror,fetch);else if(errorcb)errorcb(fetch)};var reportReadyStateChange=function(fetch,xhr,e){if(onreadystatechange)dynCall_vi(onreadystatechange,fetch);else if(readystatechangecb)readystatechangecb(fetch)};var performUncachedXhr=function(fetch,xhr,e){__emscripten_fetch_xhr(fetch,reportSuccess,reportError,reportProgress,reportReadyStateChange)};var cacheResultAndReportSuccess=function(fetch,xhr,e){var storeSuccess=function(fetch,xhr,e){if(onsuccess)dynCall_vi(onsuccess,fetch);else if(successcb)successcb(fetch)};var storeError=function(fetch,xhr,e){if(onsuccess)dynCall_vi(onsuccess,fetch);else if(successcb)successcb(fetch)};__emscripten_fetch_cache_data(Fetch.dbInstance,fetch,xhr.response,storeSuccess,storeError)};var performCachedXhr=function(fetch,xhr,e){__emscripten_fetch_xhr(fetch,cacheResultAndReportSuccess,reportError,reportProgress,reportReadyStateChange)};if(requestMethod==="EM_IDB_STORE"){var ptr=HEAPU32[fetch_attr+84>>2];__emscripten_fetch_cache_data(Fetch.dbInstance,fetch,HEAPU8.slice(ptr,ptr+HEAPU32[fetch_attr+88>>2]),reportSuccess,reportError)}else if(requestMethod==="EM_IDB_DELETE"){__emscripten_fetch_delete_cached_data(Fetch.dbInstance,fetch,reportSuccess,reportError)}else if(!fetchAttrReplace){__emscripten_fetch_load_cached_data(Fetch.dbInstance,fetch,reportSuccess,fetchAttrNoDownload?reportError:fetchAttrPersistFile?performCachedXhr:performUncachedXhr)}else if(!fetchAttrNoDownload){__emscripten_fetch_xhr(fetch,fetchAttrPersistFile?cacheResultAndReportSuccess:reportSuccess,reportError,reportProgress,reportReadyStateChange)}else{return 0}return fetch}var _fabs=Math_abs;function _getenv(name){if(name===0)return 0;name=UTF8ToString(name);if(!ENV.hasOwnProperty(name))return 0;if(_getenv.ret)_free(_getenv.ret);_getenv.ret=allocateUTF8(ENV[name]);return _getenv.ret}function _gettimeofday(ptr){var now=Date.now();HEAP32[ptr>>2]=now/1e3|0;HEAP32[ptr+4>>2]=now%1e3*1e3|0;return 0}var ___tm_timezone=(stringToUTF8("GMT",1128272,4),1128272);function _gmtime_r(time,tmPtr){var date=new Date(HEAP32[time>>2]*1e3);HEAP32[tmPtr>>2]=date.getUTCSeconds();HEAP32[tmPtr+4>>2]=date.getUTCMinutes();HEAP32[tmPtr+8>>2]=date.getUTCHours();HEAP32[tmPtr+12>>2]=date.getUTCDate();HEAP32[tmPtr+16>>2]=date.getUTCMonth();HEAP32[tmPtr+20>>2]=date.getUTCFullYear()-1900;HEAP32[tmPtr+24>>2]=date.getUTCDay();HEAP32[tmPtr+36>>2]=0;HEAP32[tmPtr+32>>2]=0;var start=Date.UTC(date.getUTCFullYear(),0,1,0,0,0,0);var yday=(date.getTime()-start)/(1e3*60*60*24)|0;HEAP32[tmPtr+28>>2]=yday;HEAP32[tmPtr+40>>2]=___tm_timezone;return tmPtr}function _llvm_exp2_f32(x){return Math.pow(2,x)}function _llvm_exp2_f64(a0){return _llvm_exp2_f32(a0)}function _llvm_log2_f32(x){return Math.log(x)/Math.LN2}function _llvm_stackrestore(p){var self=_llvm_stacksave;var ret=self.LLVM_SAVEDSTACKS[p];self.LLVM_SAVEDSTACKS.splice(p,1);stackRestore(ret)}function _llvm_stacksave(){var self=_llvm_stacksave;if(!self.LLVM_SAVEDSTACKS){self.LLVM_SAVEDSTACKS=[]}self.LLVM_SAVEDSTACKS.push(stackSave());return self.LLVM_SAVEDSTACKS.length-1}var _llvm_trunc_f64=Math_trunc;function _tzset(){if(_tzset.called)return;_tzset.called=true;HEAP32[__get_timezone()>>2]=(new Date).getTimezoneOffset()*60;var currentYear=(new Date).getFullYear();var winter=new Date(currentYear,0,1);var summer=new Date(currentYear,6,1);HEAP32[__get_daylight()>>2]=Number(winter.getTimezoneOffset()!=summer.getTimezoneOffset());function extractZone(date){var match=date.toTimeString().match(/\(([A-Za-z ]+)\)$/);return match?match[1]:"GMT"}var winterName=extractZone(winter);var summerName=extractZone(summer);var winterNamePtr=allocate(intArrayFromString(winterName),"i8",ALLOC_NORMAL);var summerNamePtr=allocate(intArrayFromString(summerName),"i8",ALLOC_NORMAL);if(summer.getTimezoneOffset()>2]=winterNamePtr;HEAP32[__get_tzname()+4>>2]=summerNamePtr}else{HEAP32[__get_tzname()>>2]=summerNamePtr;HEAP32[__get_tzname()+4>>2]=winterNamePtr}}function _localtime_r(time,tmPtr){_tzset();var date=new Date(HEAP32[time>>2]*1e3);HEAP32[tmPtr>>2]=date.getSeconds();HEAP32[tmPtr+4>>2]=date.getMinutes();HEAP32[tmPtr+8>>2]=date.getHours();HEAP32[tmPtr+12>>2]=date.getDate();HEAP32[tmPtr+16>>2]=date.getMonth();HEAP32[tmPtr+20>>2]=date.getFullYear()-1900;HEAP32[tmPtr+24>>2]=date.getDay();var start=new Date(date.getFullYear(),0,1);var yday=(date.getTime()-start.getTime())/(1e3*60*60*24)|0;HEAP32[tmPtr+28>>2]=yday;HEAP32[tmPtr+36>>2]=-(date.getTimezoneOffset()*60);var summerOffset=new Date(date.getFullYear(),6,1).getTimezoneOffset();var winterOffset=start.getTimezoneOffset();var dst=(summerOffset!=winterOffset&&date.getTimezoneOffset()==Math.min(winterOffset,summerOffset))|0;HEAP32[tmPtr+32>>2]=dst;var zonePtr=HEAP32[__get_tzname()+(dst?4:0)>>2];HEAP32[tmPtr+40>>2]=zonePtr;return tmPtr}function _emscripten_memcpy_big(dest,src,num){HEAPU8.set(HEAPU8.subarray(src,src+num),dest)}function _usleep(useconds){var msec=useconds/1e3;if((ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)&&self["performance"]&&self["performance"]["now"]){var start=self["performance"]["now"]();while(self["performance"]["now"]()-start>2];var nanoseconds=HEAP32[rqtp+4>>2];if(nanoseconds<0||nanoseconds>999999999||seconds<0){___setErrNo(28);return-1}if(rmtp!==0){HEAP32[rmtp>>2]=0;HEAP32[rmtp+4>>2]=0}return _usleep(seconds*1e6+nanoseconds/1e3)}function _pthread_cond_destroy(){return 0}function _pthread_cond_init(){return 0}function _pthread_create(){return 6}function _pthread_join(){}function __isLeapYear(year){return year%4===0&&(year%100!==0||year%400===0)}function __arraySum(array,index){var sum=0;for(var i=0;i<=index;sum+=array[i++]);return sum}var __MONTH_DAYS_LEAP=[31,29,31,30,31,30,31,31,30,31,30,31];var __MONTH_DAYS_REGULAR=[31,28,31,30,31,30,31,31,30,31,30,31];function __addDays(date,days){var newDate=new Date(date.getTime());while(days>0){var leap=__isLeapYear(newDate.getFullYear());var currentMonth=newDate.getMonth();var daysInCurrentMonth=(leap?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR)[currentMonth];if(days>daysInCurrentMonth-newDate.getDate()){days-=daysInCurrentMonth-newDate.getDate()+1;newDate.setDate(1);if(currentMonth<11){newDate.setMonth(currentMonth+1)}else{newDate.setMonth(0);newDate.setFullYear(newDate.getFullYear()+1)}}else{newDate.setDate(newDate.getDate()+days);return newDate}}return newDate}function _strftime(s,maxsize,format,tm){var tm_zone=HEAP32[tm+40>>2];var date={tm_sec:HEAP32[tm>>2],tm_min:HEAP32[tm+4>>2],tm_hour:HEAP32[tm+8>>2],tm_mday:HEAP32[tm+12>>2],tm_mon:HEAP32[tm+16>>2],tm_year:HEAP32[tm+20>>2],tm_wday:HEAP32[tm+24>>2],tm_yday:HEAP32[tm+28>>2],tm_isdst:HEAP32[tm+32>>2],tm_gmtoff:HEAP32[tm+36>>2],tm_zone:tm_zone?UTF8ToString(tm_zone):""};var pattern=UTF8ToString(format);var EXPANSION_RULES_1={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var rule in EXPANSION_RULES_1){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_1[rule])}var WEEKDAYS=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var MONTHS=["January","February","March","April","May","June","July","August","September","October","November","December"];function leadingSomething(value,digits,character){var str=typeof value==="number"?value.toString():value||"";while(str.length0?1:0}var compare;if((compare=sgn(date1.getFullYear()-date2.getFullYear()))===0){if((compare=sgn(date1.getMonth()-date2.getMonth()))===0){compare=sgn(date1.getDate()-date2.getDate())}}return compare}function getFirstWeekStartDate(janFourth){switch(janFourth.getDay()){case 0:return new Date(janFourth.getFullYear()-1,11,29);case 1:return janFourth;case 2:return new Date(janFourth.getFullYear(),0,3);case 3:return new Date(janFourth.getFullYear(),0,2);case 4:return new Date(janFourth.getFullYear(),0,1);case 5:return new Date(janFourth.getFullYear()-1,11,31);case 6:return new Date(janFourth.getFullYear()-1,11,30)}}function getWeekBasedYear(date){var thisDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);var janFourthThisYear=new Date(thisDate.getFullYear(),0,4);var janFourthNextYear=new Date(thisDate.getFullYear()+1,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);if(compareByDay(firstWeekStartThisYear,thisDate)<=0){if(compareByDay(firstWeekStartNextYear,thisDate)<=0){return thisDate.getFullYear()+1}else{return thisDate.getFullYear()}}else{return thisDate.getFullYear()-1}}var EXPANSION_RULES_2={"%a":function(date){return WEEKDAYS[date.tm_wday].substring(0,3)},"%A":function(date){return WEEKDAYS[date.tm_wday]},"%b":function(date){return MONTHS[date.tm_mon].substring(0,3)},"%B":function(date){return MONTHS[date.tm_mon]},"%C":function(date){var year=date.tm_year+1900;return leadingNulls(year/100|0,2)},"%d":function(date){return leadingNulls(date.tm_mday,2)},"%e":function(date){return leadingSomething(date.tm_mday,2," ")},"%g":function(date){return getWeekBasedYear(date).toString().substring(2)},"%G":function(date){return getWeekBasedYear(date)},"%H":function(date){return leadingNulls(date.tm_hour,2)},"%I":function(date){var twelveHour=date.tm_hour;if(twelveHour==0)twelveHour=12;else if(twelveHour>12)twelveHour-=12;return leadingNulls(twelveHour,2)},"%j":function(date){return leadingNulls(date.tm_mday+__arraySum(__isLeapYear(date.tm_year+1900)?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,date.tm_mon-1),3)},"%m":function(date){return leadingNulls(date.tm_mon+1,2)},"%M":function(date){return leadingNulls(date.tm_min,2)},"%n":function(){return"\n"},"%p":function(date){if(date.tm_hour>=0&&date.tm_hour<12){return"AM"}else{return"PM"}},"%S":function(date){return leadingNulls(date.tm_sec,2)},"%t":function(){return"\t"},"%u":function(date){return date.tm_wday||7},"%U":function(date){var janFirst=new Date(date.tm_year+1900,0,1);var firstSunday=janFirst.getDay()===0?janFirst:__addDays(janFirst,7-janFirst.getDay());var endDate=new Date(date.tm_year+1900,date.tm_mon,date.tm_mday);if(compareByDay(firstSunday,endDate)<0){var februaryFirstUntilEndMonth=__arraySum(__isLeapYear(endDate.getFullYear())?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,endDate.getMonth()-1)-31;var firstSundayUntilEndJanuary=31-firstSunday.getDate();var days=firstSundayUntilEndJanuary+februaryFirstUntilEndMonth+endDate.getDate();return leadingNulls(Math.ceil(days/7),2)}return compareByDay(firstSunday,janFirst)===0?"01":"00"},"%V":function(date){var janFourthThisYear=new Date(date.tm_year+1900,0,4);var janFourthNextYear=new Date(date.tm_year+1901,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);var endDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);if(compareByDay(endDate,firstWeekStartThisYear)<0){return"53"}if(compareByDay(firstWeekStartNextYear,endDate)<=0){return"01"}var daysDifference;if(firstWeekStartThisYear.getFullYear()=0;off=Math.abs(off)/60;off=off/60*100+off%60;return(ahead?"+":"-")+String("0000"+off).slice(-4)},"%Z":function(date){return date.tm_zone},"%%":function(){return"%"}};for(var rule in EXPANSION_RULES_2){if(pattern.indexOf(rule)>=0){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_2[rule](date))}}var bytes=intArrayFromString(pattern,false);if(bytes.length>maxsize){return 0}writeArrayToMemory(bytes,s);return bytes.length-1}function _sysconf(name){switch(name){case 30:return PAGE_SIZE;case 85:var maxHeapSize=2*1024*1024*1024-65536;return maxHeapSize/PAGE_SIZE;case 132:case 133:case 12:case 137:case 138:case 15:case 235:case 16:case 17:case 18:case 19:case 20:case 149:case 13:case 10:case 236:case 153:case 9:case 21:case 22:case 159:case 154:case 14:case 77:case 78:case 139:case 80:case 81:case 82:case 68:case 67:case 164:case 11:case 29:case 47:case 48:case 95:case 52:case 51:case 46:return 200809;case 79:return 0;case 27:case 246:case 127:case 128:case 23:case 24:case 160:case 161:case 181:case 182:case 242:case 183:case 184:case 243:case 244:case 245:case 165:case 178:case 179:case 49:case 50:case 168:case 169:case 175:case 170:case 171:case 172:case 97:case 76:case 32:case 173:case 35:return-1;case 176:case 177:case 7:case 155:case 8:case 157:case 125:case 126:case 92:case 93:case 129:case 130:case 131:case 94:case 91:return 1;case 74:case 60:case 69:case 70:case 4:return 1024;case 31:case 42:case 72:return 32;case 87:case 26:case 33:return 2147483647;case 34:case 1:return 47839;case 38:case 36:return 99;case 43:case 37:return 2048;case 0:return 2097152;case 3:return 65536;case 28:return 32768;case 44:return 32767;case 75:return 16384;case 39:return 1e3;case 89:return 700;case 71:return 256;case 40:return 255;case 2:return 100;case 180:return 64;case 25:return 20;case 5:return 16;case 6:return 6;case 73:return 4;case 84:{if(typeof navigator==="object")return navigator["hardwareConcurrency"]||1;return 1}}___setErrNo(28);return-1}function _time(ptr){var ret=Date.now()/1e3|0;if(ptr){HEAP32[ptr>>2]=ret}return ret}FS.staticInit();if(ENVIRONMENT_HAS_NODE){var fs=require("fs");var NODEJS_PATH=require("path");NODEFS.staticInit()}if(ENVIRONMENT_IS_NODE){_emscripten_get_now=function _emscripten_get_now_actual(){var t=process["hrtime"]();return t[0]*1e3+t[1]/1e6}}else if(typeof dateNow!=="undefined"){_emscripten_get_now=dateNow}else if(typeof performance==="object"&&performance&&typeof performance["now"]==="function"){_emscripten_get_now=function(){return performance["now"]()}}else{_emscripten_get_now=Date.now}Fetch.staticInit();function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array}var debug_table_dd=[0,"jsCall_dd_0","jsCall_dd_1","jsCall_dd_2","jsCall_dd_3","jsCall_dd_4","jsCall_dd_5","jsCall_dd_6","jsCall_dd_7","jsCall_dd_8","jsCall_dd_9","jsCall_dd_10","jsCall_dd_11","jsCall_dd_12","jsCall_dd_13","jsCall_dd_14","jsCall_dd_15","jsCall_dd_16","jsCall_dd_17","jsCall_dd_18","jsCall_dd_19","jsCall_dd_20","jsCall_dd_21","jsCall_dd_22","jsCall_dd_23","jsCall_dd_24","jsCall_dd_25","jsCall_dd_26","jsCall_dd_27","jsCall_dd_28","jsCall_dd_29","jsCall_dd_30","jsCall_dd_31","jsCall_dd_32","jsCall_dd_33","jsCall_dd_34","_sinh","_cosh","_tanh","_sin","_cos","_tan","_atan","_asin","_acos","_exp","_log","_fabs","_etime",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];var debug_table_did=[0,"jsCall_did_0","jsCall_did_1","jsCall_did_2","jsCall_did_3","jsCall_did_4","jsCall_did_5","jsCall_did_6","jsCall_did_7","jsCall_did_8","jsCall_did_9","jsCall_did_10","jsCall_did_11","jsCall_did_12","jsCall_did_13","jsCall_did_14","jsCall_did_15","jsCall_did_16","jsCall_did_17","jsCall_did_18","jsCall_did_19","jsCall_did_20","jsCall_did_21","jsCall_did_22","jsCall_did_23","jsCall_did_24","jsCall_did_25","jsCall_did_26","jsCall_did_27","jsCall_did_28","jsCall_did_29","jsCall_did_30","jsCall_did_31","jsCall_did_32","jsCall_did_33","jsCall_did_34",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,0];var debug_table_didd=[0,"jsCall_didd_0","jsCall_didd_1","jsCall_didd_2","jsCall_didd_3","jsCall_didd_4","jsCall_didd_5","jsCall_didd_6","jsCall_didd_7","jsCall_didd_8","jsCall_didd_9","jsCall_didd_10","jsCall_didd_11","jsCall_didd_12","jsCall_didd_13","jsCall_didd_14","jsCall_didd_15","jsCall_didd_16","jsCall_didd_17","jsCall_didd_18","jsCall_didd_19","jsCall_didd_20","jsCall_didd_21","jsCall_didd_22","jsCall_didd_23","jsCall_didd_24","jsCall_didd_25","jsCall_didd_26","jsCall_didd_27","jsCall_didd_28","jsCall_didd_29","jsCall_didd_30","jsCall_didd_31","jsCall_didd_32","jsCall_didd_33","jsCall_didd_34",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,0];var debug_table_fii=[0,"jsCall_fii_0","jsCall_fii_1","jsCall_fii_2","jsCall_fii_3","jsCall_fii_4","jsCall_fii_5","jsCall_fii_6","jsCall_fii_7","jsCall_fii_8","jsCall_fii_9","jsCall_fii_10","jsCall_fii_11","jsCall_fii_12","jsCall_fii_13","jsCall_fii_14","jsCall_fii_15","jsCall_fii_16","jsCall_fii_17","jsCall_fii_18","jsCall_fii_19","jsCall_fii_20","jsCall_fii_21","jsCall_fii_22","jsCall_fii_23","jsCall_fii_24","jsCall_fii_25","jsCall_fii_26","jsCall_fii_27","jsCall_fii_28","jsCall_fii_29","jsCall_fii_30","jsCall_fii_31","jsCall_fii_32","jsCall_fii_33","jsCall_fii_34","_sbr_sum_square_c",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];var debug_table_fiii=[0,"jsCall_fiii_0","jsCall_fiii_1","jsCall_fiii_2","jsCall_fiii_3","jsCall_fiii_4","jsCall_fiii_5","jsCall_fiii_6","jsCall_fiii_7","jsCall_fiii_8","jsCall_fiii_9","jsCall_fiii_10","jsCall_fiii_11","jsCall_fiii_12","jsCall_fiii_13","jsCall_fiii_14","jsCall_fiii_15","jsCall_fiii_16","jsCall_fiii_17","jsCall_fiii_18","jsCall_fiii_19","jsCall_fiii_20","jsCall_fiii_21","jsCall_fiii_22","jsCall_fiii_23","jsCall_fiii_24","jsCall_fiii_25","jsCall_fiii_26","jsCall_fiii_27","jsCall_fiii_28","jsCall_fiii_29","jsCall_fiii_30","jsCall_fiii_31","jsCall_fiii_32","jsCall_fiii_33","jsCall_fiii_34","_avpriv_scalarproduct_float_c",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];var debug_table_ii=[0,"jsCall_ii_0","jsCall_ii_1","jsCall_ii_2","jsCall_ii_3","jsCall_ii_4","jsCall_ii_5","jsCall_ii_6","jsCall_ii_7","jsCall_ii_8","jsCall_ii_9","jsCall_ii_10","jsCall_ii_11","jsCall_ii_12","jsCall_ii_13","jsCall_ii_14","jsCall_ii_15","jsCall_ii_16","jsCall_ii_17","jsCall_ii_18","jsCall_ii_19","jsCall_ii_20","jsCall_ii_21","jsCall_ii_22","jsCall_ii_23","jsCall_ii_24","jsCall_ii_25","jsCall_ii_26","jsCall_ii_27","jsCall_ii_28","jsCall_ii_29","jsCall_ii_30","jsCall_ii_31","jsCall_ii_32","jsCall_ii_33","jsCall_ii_34","_av_default_item_name","_ff_avio_child_class_next","_flv_probe","_flv_read_header","_flv_read_close","_live_flv_probe","_mov_probe","_mov_read_header","_mov_read_close","_mpegts_probe","_mpegts_read_header","_mpegts_read_close","_format_to_name","_format_child_class_next","_get_category","_urlcontext_to_name","_ff_urlcontext_child_class_next","_sws_context_to_name","_ff_bsf_child_class_next","_hevc_mp4toannexb_init","_hevc_init_thread_copy","_hevc_decode_init","_hevc_decode_free","_context_to_name","_codec_child_class_next","_get_category_2293","_aac_decode_init","_aac_decode_close","_init","___stdio_close","___emscripten_stdout_close","_releaseSniffStreamFunc","_hflv_releaseFunc","_hflv_getBufferLength","_initializeDecoderFunc","__getFrame","_closeVideoFunc","_releaseFunc","_initializeDemuxerFunc","_getPacketFunc","_releaseDemuxerFunc","_io_short_seek","_avio_rb16","_avio_rl16","_av_buffer_allocz","_frame_worker_thread","_av_buffer_alloc","_thread_worker",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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];var debug_table_iid=[0,"jsCall_iid_0","jsCall_iid_1","jsCall_iid_2","jsCall_iid_3","jsCall_iid_4","jsCall_iid_5","jsCall_iid_6","jsCall_iid_7","jsCall_iid_8","jsCall_iid_9","jsCall_iid_10","jsCall_iid_11","jsCall_iid_12","jsCall_iid_13","jsCall_iid_14","jsCall_iid_15","jsCall_iid_16","jsCall_iid_17","jsCall_iid_18","jsCall_iid_19","jsCall_iid_20","jsCall_iid_21","jsCall_iid_22","jsCall_iid_23","jsCall_iid_24","jsCall_iid_25","jsCall_iid_26","jsCall_iid_27","jsCall_iid_28","jsCall_iid_29","jsCall_iid_30","jsCall_iid_31","jsCall_iid_32","jsCall_iid_33","jsCall_iid_34","_seekBufferFunc",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];var debug_table_iidiiii=[0,"jsCall_iidiiii_0","jsCall_iidiiii_1","jsCall_iidiiii_2","jsCall_iidiiii_3","jsCall_iidiiii_4","jsCall_iidiiii_5","jsCall_iidiiii_6","jsCall_iidiiii_7","jsCall_iidiiii_8","jsCall_iidiiii_9","jsCall_iidiiii_10","jsCall_iidiiii_11","jsCall_iidiiii_12","jsCall_iidiiii_13","jsCall_iidiiii_14","jsCall_iidiiii_15","jsCall_iidiiii_16","jsCall_iidiiii_17","jsCall_iidiiii_18","jsCall_iidiiii_19","jsCall_iidiiii_20","jsCall_iidiiii_21","jsCall_iidiiii_22","jsCall_iidiiii_23","jsCall_iidiiii_24","jsCall_iidiiii_25","jsCall_iidiiii_26","jsCall_iidiiii_27","jsCall_iidiiii_28","jsCall_iidiiii_29","jsCall_iidiiii_30","jsCall_iidiiii_31","jsCall_iidiiii_32","jsCall_iidiiii_33","jsCall_iidiiii_34","_fmt_fp",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];var debug_table_iii=[0,"jsCall_iii_0","jsCall_iii_1","jsCall_iii_2","jsCall_iii_3","jsCall_iii_4","jsCall_iii_5","jsCall_iii_6","jsCall_iii_7","jsCall_iii_8","jsCall_iii_9","jsCall_iii_10","jsCall_iii_11","jsCall_iii_12","jsCall_iii_13","jsCall_iii_14","jsCall_iii_15","jsCall_iii_16","jsCall_iii_17","jsCall_iii_18","jsCall_iii_19","jsCall_iii_20","jsCall_iii_21","jsCall_iii_22","jsCall_iii_23","jsCall_iii_24","jsCall_iii_25","jsCall_iii_26","jsCall_iii_27","jsCall_iii_28","jsCall_iii_29","jsCall_iii_30","jsCall_iii_31","jsCall_iii_32","jsCall_iii_33","jsCall_iii_34","_ff_avio_child_next","_flv_read_packet","_mov_read_packet","_mpegts_read_packet","_mpegts_raw_read_packet","_format_child_next","_urlcontext_child_next","_bsf_child_next","_hevc_mp4toannexb_filter","_hevc_update_thread_context","_null_filter","_codec_child_next","_initSniffStreamFunc","_hflv_initFunc","_hflv_getPacketFunc","_io_read_pause","_descriptor_compare","_hls_decode_entry","_avcodec_default_get_format","_ff_startcode_find_candidate_c","_color_table_compare",0,0,0,0,0,0,0];var debug_table_iiii=[0,"jsCall_iiii_0","jsCall_iiii_1","jsCall_iiii_2","jsCall_iiii_3","jsCall_iiii_4","jsCall_iiii_5","jsCall_iiii_6","jsCall_iiii_7","jsCall_iiii_8","jsCall_iiii_9","jsCall_iiii_10","jsCall_iiii_11","jsCall_iiii_12","jsCall_iiii_13","jsCall_iiii_14","jsCall_iiii_15","jsCall_iiii_16","jsCall_iiii_17","jsCall_iiii_18","jsCall_iiii_19","jsCall_iiii_20","jsCall_iiii_21","jsCall_iiii_22","jsCall_iiii_23","jsCall_iiii_24","jsCall_iiii_25","jsCall_iiii_26","jsCall_iiii_27","jsCall_iiii_28","jsCall_iiii_29","jsCall_iiii_30","jsCall_iiii_31","jsCall_iiii_32","jsCall_iiii_33","jsCall_iiii_34","_mov_read_aclr","_mov_read_avid","_mov_read_ares","_mov_read_avss","_mov_read_av1c","_mov_read_chpl","_mov_read_stco","_mov_read_colr","_mov_read_ctts","_mov_read_default","_mov_read_dpxe","_mov_read_dref","_mov_read_elst","_mov_read_enda","_mov_read_fiel","_mov_read_adrm","_mov_read_ftyp","_mov_read_glbl","_mov_read_hdlr","_mov_read_ilst","_mov_read_jp2h","_mov_read_mdat","_mov_read_mdhd","_mov_read_meta","_mov_read_moof","_mov_read_moov","_mov_read_mvhd","_mov_read_svq3","_mov_read_alac","_mov_read_pasp","_mov_read_sidx","_mov_read_stps","_mov_read_strf","_mov_read_stsc","_mov_read_stsd","_mov_read_stss","_mov_read_stsz","_mov_read_stts","_mov_read_tkhd","_mov_read_tfdt","_mov_read_tfhd","_mov_read_trak","_mov_read_tmcd","_mov_read_chap","_mov_read_trex","_mov_read_trun","_mov_read_wave","_mov_read_esds","_mov_read_dac3","_mov_read_dec3","_mov_read_ddts","_mov_read_wide","_mov_read_wfex","_mov_read_cmov","_mov_read_chan","_mov_read_dvc1","_mov_read_sbgp","_mov_read_uuid","_mov_read_targa_y216","_mov_read_free","_mov_read_custom","_mov_read_frma","_mov_read_senc","_mov_read_saiz","_mov_read_saio","_mov_read_pssh","_mov_read_schm","_mov_read_tenc","_mov_read_dfla","_mov_read_st3d","_mov_read_sv3d","_mov_read_dops","_mov_read_smdm","_mov_read_coll","_mov_read_vpcc","_mov_read_mdcv","_mov_read_clli","_h264_split","_hevc_split","___stdio_write","_sn_write","_read_stream_live","_read_stream_vod","_getSniffStreamPacketFunc","_hflv_read_stream_live","_setCodecTypeFunc","_read_packet","_io_write_packet","_io_read_packet","_dyn_buf_write","_mov_read_keys","_mov_read_udta_string","_avcodec_default_get_buffer2","_do_read",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,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,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,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];var debug_table_iiiii=[0,"jsCall_iiiii_0","jsCall_iiiii_1","jsCall_iiiii_2","jsCall_iiiii_3","jsCall_iiiii_4","jsCall_iiiii_5","jsCall_iiiii_6","jsCall_iiiii_7","jsCall_iiiii_8","jsCall_iiiii_9","jsCall_iiiii_10","jsCall_iiiii_11","jsCall_iiiii_12","jsCall_iiiii_13","jsCall_iiiii_14","jsCall_iiiii_15","jsCall_iiiii_16","jsCall_iiiii_17","jsCall_iiiii_18","jsCall_iiiii_19","jsCall_iiiii_20","jsCall_iiiii_21","jsCall_iiiii_22","jsCall_iiiii_23","jsCall_iiiii_24","jsCall_iiiii_25","jsCall_iiiii_26","jsCall_iiiii_27","jsCall_iiiii_28","jsCall_iiiii_29","jsCall_iiiii_30","jsCall_iiiii_31","jsCall_iiiii_32","jsCall_iiiii_33","jsCall_iiiii_34","_hevc_decode_frame","_aac_decode_frame","_hflv_pushBufferFunc","_demuxBoxFunc","_mov_metadata_int8_no_padding","_mov_metadata_track_or_disc_number","_mov_metadata_gnre","_mov_metadata_int8_bypass_padding","_lum_planar_vscale","_chr_planar_vscale","_any_vscale","_packed_vscale","_gamma_convert","_lum_convert","_lum_h_scale","_chr_convert","_chr_h_scale","_no_chr_scale","_hls_decode_entry_wpp",0,0,0,0,0,0,0,0,0];var debug_table_iiiiii=[0,"jsCall_iiiiii_0","jsCall_iiiiii_1","jsCall_iiiiii_2","jsCall_iiiiii_3","jsCall_iiiiii_4","jsCall_iiiiii_5","jsCall_iiiiii_6","jsCall_iiiiii_7","jsCall_iiiiii_8","jsCall_iiiiii_9","jsCall_iiiiii_10","jsCall_iiiiii_11","jsCall_iiiiii_12","jsCall_iiiiii_13","jsCall_iiiiii_14","jsCall_iiiiii_15","jsCall_iiiiii_16","jsCall_iiiiii_17","jsCall_iiiiii_18","jsCall_iiiiii_19","jsCall_iiiiii_20","jsCall_iiiiii_21","jsCall_iiiiii_22","jsCall_iiiiii_23","jsCall_iiiiii_24","jsCall_iiiiii_25","jsCall_iiiiii_26","jsCall_iiiiii_27","jsCall_iiiiii_28","jsCall_iiiiii_29","jsCall_iiiiii_30","jsCall_iiiiii_31","jsCall_iiiiii_32","jsCall_iiiiii_33","jsCall_iiiiii_34","_pushBufferFunc","_decodeCodecContextFunc","_io_open_default","_avcodec_default_execute2","_thread_execute2","_sbr_lf_gen",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];var debug_table_iiiiiii=[0,"jsCall_iiiiiii_0","jsCall_iiiiiii_1","jsCall_iiiiiii_2","jsCall_iiiiiii_3","jsCall_iiiiiii_4","jsCall_iiiiiii_5","jsCall_iiiiiii_6","jsCall_iiiiiii_7","jsCall_iiiiiii_8","jsCall_iiiiiii_9","jsCall_iiiiiii_10","jsCall_iiiiiii_11","jsCall_iiiiiii_12","jsCall_iiiiiii_13","jsCall_iiiiiii_14","jsCall_iiiiiii_15","jsCall_iiiiiii_16","jsCall_iiiiiii_17","jsCall_iiiiiii_18","jsCall_iiiiiii_19","jsCall_iiiiiii_20","jsCall_iiiiiii_21","jsCall_iiiiiii_22","jsCall_iiiiiii_23","jsCall_iiiiiii_24","jsCall_iiiiiii_25","jsCall_iiiiiii_26","jsCall_iiiiiii_27","jsCall_iiiiiii_28","jsCall_iiiiiii_29","jsCall_iiiiiii_30","jsCall_iiiiiii_31","jsCall_iiiiiii_32","jsCall_iiiiiii_33","jsCall_iiiiiii_34","_h264_parse","_hevc_parse","_hflv_decodeVideoFrameFunc","_avcodec_default_execute","_thread_execute","_sbr_x_gen",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];var debug_table_iiiiiiii=[0,"jsCall_iiiiiiii_0","jsCall_iiiiiiii_1","jsCall_iiiiiiii_2","jsCall_iiiiiiii_3","jsCall_iiiiiiii_4","jsCall_iiiiiiii_5","jsCall_iiiiiiii_6","jsCall_iiiiiiii_7","jsCall_iiiiiiii_8","jsCall_iiiiiiii_9","jsCall_iiiiiiii_10","jsCall_iiiiiiii_11","jsCall_iiiiiiii_12","jsCall_iiiiiiii_13","jsCall_iiiiiiii_14","jsCall_iiiiiiii_15","jsCall_iiiiiiii_16","jsCall_iiiiiiii_17","jsCall_iiiiiiii_18","jsCall_iiiiiiii_19","jsCall_iiiiiiii_20","jsCall_iiiiiiii_21","jsCall_iiiiiiii_22","jsCall_iiiiiiii_23","jsCall_iiiiiiii_24","jsCall_iiiiiiii_25","jsCall_iiiiiiii_26","jsCall_iiiiiiii_27","jsCall_iiiiiiii_28","jsCall_iiiiiiii_29","jsCall_iiiiiiii_30","jsCall_iiiiiiii_31","jsCall_iiiiiiii_32","jsCall_iiiiiiii_33","jsCall_iiiiiiii_34","_decodeVideoFrameFunc","_setSniffStreamCodecTypeFunc","_hflv_setSniffStreamCodecTypeFunc","_swscale","_ff_sws_alphablendaway","_yuv2rgb_c_32","_yuva2rgba_c","_yuv2rgb_c_bgr48","_yuv2rgb_c_48","_yuva2argb_c","_yuv2rgb_c_24_rgb","_yuv2rgb_c_24_bgr","_yuv2rgb_c_16_ordered_dither","_yuv2rgb_c_15_ordered_dither","_yuv2rgb_c_12_ordered_dither","_yuv2rgb_c_8_ordered_dither","_yuv2rgb_c_4_ordered_dither","_yuv2rgb_c_4b_ordered_dither","_yuv2rgb_c_1_ordered_dither","_planarToP01xWrapper","_planar8ToP01xleWrapper","_yvu9ToYv12Wrapper","_bgr24ToYv12Wrapper","_rgbToRgbWrapper","_planarRgbToplanarRgbWrapper","_planarRgbToRgbWrapper","_planarRgbaToRgbWrapper","_Rgb16ToPlanarRgb16Wrapper","_planarRgb16ToRgb16Wrapper","_rgbToPlanarRgbWrapper","_bayer_to_rgb24_wrapper","_bayer_to_yv12_wrapper","_bswap_16bpc","_palToRgbWrapper","_yuv422pToYuy2Wrapper","_yuv422pToUyvyWrapper","_uint_y_to_float_y_wrapper","_float_y_to_uint_y_wrapper","_planarToYuy2Wrapper","_planarToUyvyWrapper","_yuyvToYuv420Wrapper","_uyvyToYuv420Wrapper","_yuyvToYuv422Wrapper","_uyvyToYuv422Wrapper","_packedCopyWrapper","_planarCopyWrapper","_planarToNv12Wrapper","_planarToNv24Wrapper","_nv12ToPlanarWrapper","_nv24ToPlanarWrapper",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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];var debug_table_iiiiij=[0,"jsCall_iiiiij_0","jsCall_iiiiij_1","jsCall_iiiiij_2","jsCall_iiiiij_3","jsCall_iiiiij_4","jsCall_iiiiij_5","jsCall_iiiiij_6","jsCall_iiiiij_7","jsCall_iiiiij_8","jsCall_iiiiij_9","jsCall_iiiiij_10","jsCall_iiiiij_11","jsCall_iiiiij_12","jsCall_iiiiij_13","jsCall_iiiiij_14","jsCall_iiiiij_15","jsCall_iiiiij_16","jsCall_iiiiij_17","jsCall_iiiiij_18","jsCall_iiiiij_19","jsCall_iiiiij_20","jsCall_iiiiij_21","jsCall_iiiiij_22","jsCall_iiiiij_23","jsCall_iiiiij_24","jsCall_iiiiij_25","jsCall_iiiiij_26","jsCall_iiiiij_27","jsCall_iiiiij_28","jsCall_iiiiij_29","jsCall_iiiiij_30","jsCall_iiiiij_31","jsCall_iiiiij_32","jsCall_iiiiij_33","jsCall_iiiiij_34","_mpegts_push_data",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];var debug_table_iiiji=[0,"jsCall_iiiji_0","jsCall_iiiji_1","jsCall_iiiji_2","jsCall_iiiji_3","jsCall_iiiji_4","jsCall_iiiji_5","jsCall_iiiji_6","jsCall_iiiji_7","jsCall_iiiji_8","jsCall_iiiji_9","jsCall_iiiji_10","jsCall_iiiji_11","jsCall_iiiji_12","jsCall_iiiji_13","jsCall_iiiji_14","jsCall_iiiji_15","jsCall_iiiji_16","jsCall_iiiji_17","jsCall_iiiji_18","jsCall_iiiji_19","jsCall_iiiji_20","jsCall_iiiji_21","jsCall_iiiji_22","jsCall_iiiji_23","jsCall_iiiji_24","jsCall_iiiji_25","jsCall_iiiji_26","jsCall_iiiji_27","jsCall_iiiji_28","jsCall_iiiji_29","jsCall_iiiji_30","jsCall_iiiji_31","jsCall_iiiji_32","jsCall_iiiji_33","jsCall_iiiji_34","_flv_read_seek","_mov_read_seek",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];var debug_table_iiijjji=[0,"jsCall_iiijjji_0","jsCall_iiijjji_1","jsCall_iiijjji_2","jsCall_iiijjji_3","jsCall_iiijjji_4","jsCall_iiijjji_5","jsCall_iiijjji_6","jsCall_iiijjji_7","jsCall_iiijjji_8","jsCall_iiijjji_9","jsCall_iiijjji_10","jsCall_iiijjji_11","jsCall_iiijjji_12","jsCall_iiijjji_13","jsCall_iiijjji_14","jsCall_iiijjji_15","jsCall_iiijjji_16","jsCall_iiijjji_17","jsCall_iiijjji_18","jsCall_iiijjji_19","jsCall_iiijjji_20","jsCall_iiijjji_21","jsCall_iiijjji_22","jsCall_iiijjji_23","jsCall_iiijjji_24","jsCall_iiijjji_25","jsCall_iiijjji_26","jsCall_iiijjji_27","jsCall_iiijjji_28","jsCall_iiijjji_29","jsCall_iiijjji_30","jsCall_iiijjji_31","jsCall_iiijjji_32","jsCall_iiijjji_33","jsCall_iiijjji_34",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,0];var debug_table_jiiij=[0,"jsCall_jiiij_0","jsCall_jiiij_1","jsCall_jiiij_2","jsCall_jiiij_3","jsCall_jiiij_4","jsCall_jiiij_5","jsCall_jiiij_6","jsCall_jiiij_7","jsCall_jiiij_8","jsCall_jiiij_9","jsCall_jiiij_10","jsCall_jiiij_11","jsCall_jiiij_12","jsCall_jiiij_13","jsCall_jiiij_14","jsCall_jiiij_15","jsCall_jiiij_16","jsCall_jiiij_17","jsCall_jiiij_18","jsCall_jiiij_19","jsCall_jiiij_20","jsCall_jiiij_21","jsCall_jiiij_22","jsCall_jiiij_23","jsCall_jiiij_24","jsCall_jiiij_25","jsCall_jiiij_26","jsCall_jiiij_27","jsCall_jiiij_28","jsCall_jiiij_29","jsCall_jiiij_30","jsCall_jiiij_31","jsCall_jiiij_32","jsCall_jiiij_33","jsCall_jiiij_34","_mpegts_get_dts",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];var debug_table_jiiji=[0,"jsCall_jiiji_0","jsCall_jiiji_1","jsCall_jiiji_2","jsCall_jiiji_3","jsCall_jiiji_4","jsCall_jiiji_5","jsCall_jiiji_6","jsCall_jiiji_7","jsCall_jiiji_8","jsCall_jiiji_9","jsCall_jiiji_10","jsCall_jiiji_11","jsCall_jiiji_12","jsCall_jiiji_13","jsCall_jiiji_14","jsCall_jiiji_15","jsCall_jiiji_16","jsCall_jiiji_17","jsCall_jiiji_18","jsCall_jiiji_19","jsCall_jiiji_20","jsCall_jiiji_21","jsCall_jiiji_22","jsCall_jiiji_23","jsCall_jiiji_24","jsCall_jiiji_25","jsCall_jiiji_26","jsCall_jiiji_27","jsCall_jiiji_28","jsCall_jiiji_29","jsCall_jiiji_30","jsCall_jiiji_31","jsCall_jiiji_32","jsCall_jiiji_33","jsCall_jiiji_34","_io_read_seek",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];var debug_table_jiji=[0,"jsCall_jiji_0","jsCall_jiji_1","jsCall_jiji_2","jsCall_jiji_3","jsCall_jiji_4","jsCall_jiji_5","jsCall_jiji_6","jsCall_jiji_7","jsCall_jiji_8","jsCall_jiji_9","jsCall_jiji_10","jsCall_jiji_11","jsCall_jiji_12","jsCall_jiji_13","jsCall_jiji_14","jsCall_jiji_15","jsCall_jiji_16","jsCall_jiji_17","jsCall_jiji_18","jsCall_jiji_19","jsCall_jiji_20","jsCall_jiji_21","jsCall_jiji_22","jsCall_jiji_23","jsCall_jiji_24","jsCall_jiji_25","jsCall_jiji_26","jsCall_jiji_27","jsCall_jiji_28","jsCall_jiji_29","jsCall_jiji_30","jsCall_jiji_31","jsCall_jiji_32","jsCall_jiji_33","jsCall_jiji_34","___stdio_seek","___emscripten_stdout_seek","_seek_in_buffer","_io_seek","_dyn_buf_seek",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];var debug_table_v=[0,"jsCall_v_0","jsCall_v_1","jsCall_v_2","jsCall_v_3","jsCall_v_4","jsCall_v_5","jsCall_v_6","jsCall_v_7","jsCall_v_8","jsCall_v_9","jsCall_v_10","jsCall_v_11","jsCall_v_12","jsCall_v_13","jsCall_v_14","jsCall_v_15","jsCall_v_16","jsCall_v_17","jsCall_v_18","jsCall_v_19","jsCall_v_20","jsCall_v_21","jsCall_v_22","jsCall_v_23","jsCall_v_24","jsCall_v_25","jsCall_v_26","jsCall_v_27","jsCall_v_28","jsCall_v_29","jsCall_v_30","jsCall_v_31","jsCall_v_32","jsCall_v_33","jsCall_v_34","_init_ff_cos_tabs_16","_init_ff_cos_tabs_32","_init_ff_cos_tabs_64","_init_ff_cos_tabs_128","_init_ff_cos_tabs_256","_init_ff_cos_tabs_512","_init_ff_cos_tabs_1024","_init_ff_cos_tabs_2048","_init_ff_cos_tabs_4096","_init_ff_cos_tabs_8192","_init_ff_cos_tabs_16384","_init_ff_cos_tabs_32768","_init_ff_cos_tabs_65536","_init_ff_cos_tabs_131072","_introduce_mine","_introduceMineFunc","_av_format_init_next","_av_codec_init_static","_av_codec_init_next","_aac_static_table_init","_AV_CRC_8_ATM_init_table_once","_AV_CRC_8_EBU_init_table_once","_AV_CRC_16_ANSI_init_table_once","_AV_CRC_16_CCITT_init_table_once","_AV_CRC_24_IEEE_init_table_once","_AV_CRC_32_IEEE_init_table_once","_AV_CRC_32_IEEE_LE_init_table_once","_AV_CRC_16_ANSI_LE_init_table_once"];var debug_table_vdiidiiiii=[0,"jsCall_vdiidiiiii_0","jsCall_vdiidiiiii_1","jsCall_vdiidiiiii_2","jsCall_vdiidiiiii_3","jsCall_vdiidiiiii_4","jsCall_vdiidiiiii_5","jsCall_vdiidiiiii_6","jsCall_vdiidiiiii_7","jsCall_vdiidiiiii_8","jsCall_vdiidiiiii_9","jsCall_vdiidiiiii_10","jsCall_vdiidiiiii_11","jsCall_vdiidiiiii_12","jsCall_vdiidiiiii_13","jsCall_vdiidiiiii_14","jsCall_vdiidiiiii_15","jsCall_vdiidiiiii_16","jsCall_vdiidiiiii_17","jsCall_vdiidiiiii_18","jsCall_vdiidiiiii_19","jsCall_vdiidiiiii_20","jsCall_vdiidiiiii_21","jsCall_vdiidiiiii_22","jsCall_vdiidiiiii_23","jsCall_vdiidiiiii_24","jsCall_vdiidiiiii_25","jsCall_vdiidiiiii_26","jsCall_vdiidiiiii_27","jsCall_vdiidiiiii_28","jsCall_vdiidiiiii_29","jsCall_vdiidiiiii_30","jsCall_vdiidiiiii_31","jsCall_vdiidiiiii_32","jsCall_vdiidiiiii_33","jsCall_vdiidiiiii_34",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,0];var debug_table_vi=[0,"jsCall_vi_0","jsCall_vi_1","jsCall_vi_2","jsCall_vi_3","jsCall_vi_4","jsCall_vi_5","jsCall_vi_6","jsCall_vi_7","jsCall_vi_8","jsCall_vi_9","jsCall_vi_10","jsCall_vi_11","jsCall_vi_12","jsCall_vi_13","jsCall_vi_14","jsCall_vi_15","jsCall_vi_16","jsCall_vi_17","jsCall_vi_18","jsCall_vi_19","jsCall_vi_20","jsCall_vi_21","jsCall_vi_22","jsCall_vi_23","jsCall_vi_24","jsCall_vi_25","jsCall_vi_26","jsCall_vi_27","jsCall_vi_28","jsCall_vi_29","jsCall_vi_30","jsCall_vi_31","jsCall_vi_32","jsCall_vi_33","jsCall_vi_34","_free_geobtag","_free_apic","_free_chapter","_free_priv","_hevc_decode_flush","_flush","_h264_close","_hevc_parser_close","_fft4","_fft8","_fft16","_fft32","_fft64","_fft128","_fft256","_fft512","_fft1024","_fft2048","_fft4096","_fft8192","_fft16384","_fft32768","_fft65536","_fft131072","_logRequest_downloadSucceeded","_logRequest_downloadFailed","_downloadSucceeded","_downloadFailed","_transform_4x4_luma_9","_idct_4x4_dc_9","_idct_8x8_dc_9","_idct_16x16_dc_9","_idct_32x32_dc_9","_transform_4x4_luma_10","_idct_4x4_dc_10","_idct_8x8_dc_10","_idct_16x16_dc_10","_idct_32x32_dc_10","_transform_4x4_luma_12","_idct_4x4_dc_12","_idct_8x8_dc_12","_idct_16x16_dc_12","_idct_32x32_dc_12","_transform_4x4_luma_8","_idct_4x4_dc_8","_idct_8x8_dc_8","_idct_16x16_dc_8","_idct_32x32_dc_8","_main_function","_sbr_sum64x5_c","_sbr_neg_odd_64_c","_sbr_qmf_pre_shuffle_c",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,0,0,0,0,0,0,0,0,0,0,0,0,0];var debug_table_vii=[0,"jsCall_vii_0","jsCall_vii_1","jsCall_vii_2","jsCall_vii_3","jsCall_vii_4","jsCall_vii_5","jsCall_vii_6","jsCall_vii_7","jsCall_vii_8","jsCall_vii_9","jsCall_vii_10","jsCall_vii_11","jsCall_vii_12","jsCall_vii_13","jsCall_vii_14","jsCall_vii_15","jsCall_vii_16","jsCall_vii_17","jsCall_vii_18","jsCall_vii_19","jsCall_vii_20","jsCall_vii_21","jsCall_vii_22","jsCall_vii_23","jsCall_vii_24","jsCall_vii_25","jsCall_vii_26","jsCall_vii_27","jsCall_vii_28","jsCall_vii_29","jsCall_vii_30","jsCall_vii_31","jsCall_vii_32","jsCall_vii_33","jsCall_vii_34","_io_close_default","_lumRangeFromJpeg_c","_lumRangeToJpeg_c","_lumRangeFromJpeg16_c","_lumRangeToJpeg16_c","_decode_data_free","_dequant_9","_idct_4x4_9","_idct_8x8_9","_idct_16x16_9","_idct_32x32_9","_dequant_10","_idct_4x4_10","_idct_8x8_10","_idct_16x16_10","_idct_32x32_10","_dequant_12","_idct_4x4_12","_idct_8x8_12","_idct_16x16_12","_idct_32x32_12","_dequant_8","_idct_4x4_8","_idct_8x8_8","_idct_16x16_8","_idct_32x32_8","_imdct_and_windowing","_apply_ltp","_update_ltp","_imdct_and_windowing_ld","_imdct_and_windowing_eld","_imdct_and_windowing_960","_ff_h264_chroma_dc_dequant_idct_9_c","_ff_h264_chroma422_dc_dequant_idct_9_c","_ff_h264_chroma_dc_dequant_idct_10_c","_ff_h264_chroma422_dc_dequant_idct_10_c","_ff_h264_chroma_dc_dequant_idct_12_c","_ff_h264_chroma422_dc_dequant_idct_12_c","_ff_h264_chroma_dc_dequant_idct_14_c","_ff_h264_chroma422_dc_dequant_idct_14_c","_ff_h264_chroma_dc_dequant_idct_8_c","_ff_h264_chroma422_dc_dequant_idct_8_c","_hevc_pps_free","_sbr_qmf_post_shuffle_c","_sbr_qmf_deint_neg_c","_sbr_autocorrelate_c","_fft_permute_c","_fft_calc_c","_av_buffer_default_free","_pool_release_buffer","_sha1_transform","_sha256_transform","_pop_arg_long_double",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,0,0,0,0,0,0,0,0,0,0,0,0];var debug_table_viidi=[0,"jsCall_viidi_0","jsCall_viidi_1","jsCall_viidi_2","jsCall_viidi_3","jsCall_viidi_4","jsCall_viidi_5","jsCall_viidi_6","jsCall_viidi_7","jsCall_viidi_8","jsCall_viidi_9","jsCall_viidi_10","jsCall_viidi_11","jsCall_viidi_12","jsCall_viidi_13","jsCall_viidi_14","jsCall_viidi_15","jsCall_viidi_16","jsCall_viidi_17","jsCall_viidi_18","jsCall_viidi_19","jsCall_viidi_20","jsCall_viidi_21","jsCall_viidi_22","jsCall_viidi_23","jsCall_viidi_24","jsCall_viidi_25","jsCall_viidi_26","jsCall_viidi_27","jsCall_viidi_28","jsCall_viidi_29","jsCall_viidi_30","jsCall_viidi_31","jsCall_viidi_32","jsCall_viidi_33","jsCall_viidi_34","_vector_dmac_scalar_c","_vector_dmul_scalar_c",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];var debug_table_viifi=[0,"jsCall_viifi_0","jsCall_viifi_1","jsCall_viifi_2","jsCall_viifi_3","jsCall_viifi_4","jsCall_viifi_5","jsCall_viifi_6","jsCall_viifi_7","jsCall_viifi_8","jsCall_viifi_9","jsCall_viifi_10","jsCall_viifi_11","jsCall_viifi_12","jsCall_viifi_13","jsCall_viifi_14","jsCall_viifi_15","jsCall_viifi_16","jsCall_viifi_17","jsCall_viifi_18","jsCall_viifi_19","jsCall_viifi_20","jsCall_viifi_21","jsCall_viifi_22","jsCall_viifi_23","jsCall_viifi_24","jsCall_viifi_25","jsCall_viifi_26","jsCall_viifi_27","jsCall_viifi_28","jsCall_viifi_29","jsCall_viifi_30","jsCall_viifi_31","jsCall_viifi_32","jsCall_viifi_33","jsCall_viifi_34","_vector_fmac_scalar_c","_vector_fmul_scalar_c",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];var debug_table_viii=[0,"jsCall_viii_0","jsCall_viii_1","jsCall_viii_2","jsCall_viii_3","jsCall_viii_4","jsCall_viii_5","jsCall_viii_6","jsCall_viii_7","jsCall_viii_8","jsCall_viii_9","jsCall_viii_10","jsCall_viii_11","jsCall_viii_12","jsCall_viii_13","jsCall_viii_14","jsCall_viii_15","jsCall_viii_16","jsCall_viii_17","jsCall_viii_18","jsCall_viii_19","jsCall_viii_20","jsCall_viii_21","jsCall_viii_22","jsCall_viii_23","jsCall_viii_24","jsCall_viii_25","jsCall_viii_26","jsCall_viii_27","jsCall_viii_28","jsCall_viii_29","jsCall_viii_30","jsCall_viii_31","jsCall_viii_32","jsCall_viii_33","jsCall_viii_34","_avcHandleFrame","_handleFrame","_sdt_cb","_pat_cb","_pmt_cb","_scte_data_cb","_m4sl_cb","_chrRangeFromJpeg_c","_chrRangeToJpeg_c","_chrRangeFromJpeg16_c","_chrRangeToJpeg16_c","_rgb15to16_c","_rgb15tobgr24_c","_rgb15to32_c","_rgb16tobgr24_c","_rgb16to32_c","_rgb16to15_c","_rgb24tobgr16_c","_rgb24tobgr15_c","_rgb24tobgr32_c","_rgb32to16_c","_rgb32to15_c","_rgb32tobgr24_c","_rgb24to15_c","_rgb24to16_c","_rgb24tobgr24_c","_shuffle_bytes_0321_c","_shuffle_bytes_2103_c","_shuffle_bytes_1230_c","_shuffle_bytes_3012_c","_shuffle_bytes_3210_c","_rgb32tobgr16_c","_rgb32tobgr15_c","_rgb48tobgr48_bswap","_rgb48tobgr64_bswap","_rgb48to64_bswap","_rgb64to48_bswap","_rgb48tobgr48_nobswap","_rgb48tobgr64_nobswap","_rgb48to64_nobswap","_rgb64tobgr48_nobswap","_rgb64tobgr48_bswap","_rgb64to48_nobswap","_rgb12to15","_rgb15to24","_rgb16to24","_rgb32to24","_rgb24to32","_rgb12tobgr12","_rgb15tobgr15","_rgb16tobgr15","_rgb15tobgr16","_rgb16tobgr16","_rgb15tobgr32","_rgb16tobgr32","_add_residual4x4_9","_add_residual8x8_9","_add_residual16x16_9","_add_residual32x32_9","_transform_rdpcm_9","_add_residual4x4_10","_add_residual8x8_10","_add_residual16x16_10","_add_residual32x32_10","_transform_rdpcm_10","_add_residual4x4_12","_add_residual8x8_12","_add_residual16x16_12","_add_residual32x32_12","_transform_rdpcm_12","_add_residual4x4_8","_add_residual8x8_8","_add_residual16x16_8","_add_residual32x32_8","_transform_rdpcm_8","_just_return","_bswap_buf","_bswap16_buf","_ff_h264_add_pixels4_16_c","_ff_h264_add_pixels4_8_c","_ff_h264_add_pixels8_16_c","_ff_h264_add_pixels8_8_c","_ff_h264_idct_add_9_c","_ff_h264_idct8_add_9_c","_ff_h264_idct_dc_add_9_c","_ff_h264_idct8_dc_add_9_c","_ff_h264_luma_dc_dequant_idct_9_c","_ff_h264_idct_add_10_c","_ff_h264_idct8_add_10_c","_ff_h264_idct_dc_add_10_c","_ff_h264_idct8_dc_add_10_c","_ff_h264_luma_dc_dequant_idct_10_c","_ff_h264_idct_add_12_c","_ff_h264_idct8_add_12_c","_ff_h264_idct_dc_add_12_c","_ff_h264_idct8_dc_add_12_c","_ff_h264_luma_dc_dequant_idct_12_c","_ff_h264_idct_add_14_c","_ff_h264_idct8_add_14_c","_ff_h264_idct_dc_add_14_c","_ff_h264_idct8_dc_add_14_c","_ff_h264_luma_dc_dequant_idct_14_c","_ff_h264_idct_add_8_c","_ff_h264_idct8_add_8_c","_ff_h264_idct_dc_add_8_c","_ff_h264_idct8_dc_add_8_c","_ff_h264_luma_dc_dequant_idct_8_c","_sbr_qmf_deint_bfly_c","_ps_add_squares_c","_ff_imdct_calc_c","_ff_imdct_half_c","_ff_mdct_calc_c","_butterflies_float_c",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,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,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,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];var debug_table_viiii=[0,"jsCall_viiii_0","jsCall_viiii_1","jsCall_viiii_2","jsCall_viiii_3","jsCall_viiii_4","jsCall_viiii_5","jsCall_viiii_6","jsCall_viiii_7","jsCall_viiii_8","jsCall_viiii_9","jsCall_viiii_10","jsCall_viiii_11","jsCall_viiii_12","jsCall_viiii_13","jsCall_viiii_14","jsCall_viiii_15","jsCall_viiii_16","jsCall_viiii_17","jsCall_viiii_18","jsCall_viiii_19","jsCall_viiii_20","jsCall_viiii_21","jsCall_viiii_22","jsCall_viiii_23","jsCall_viiii_24","jsCall_viiii_25","jsCall_viiii_26","jsCall_viiii_27","jsCall_viiii_28","jsCall_viiii_29","jsCall_viiii_30","jsCall_viiii_31","jsCall_viiii_32","jsCall_viiii_33","jsCall_viiii_34","_planar_rgb9le_to_y","_planar_rgb10le_to_a","_planar_rgb10le_to_y","_planar_rgb12le_to_a","_planar_rgb12le_to_y","_planar_rgb14le_to_y","_planar_rgb16le_to_a","_planar_rgb16le_to_y","_planar_rgb9be_to_y","_planar_rgb10be_to_a","_planar_rgb10be_to_y","_planar_rgb12be_to_a","_planar_rgb12be_to_y","_planar_rgb14be_to_y","_planar_rgb16be_to_a","_planar_rgb16be_to_y","_planar_rgb_to_a","_planar_rgb_to_y","_gray8aToPacked32","_gray8aToPacked32_1","_gray8aToPacked24","_sws_convertPalette8ToPacked32","_sws_convertPalette8ToPacked24","_intra_pred_2_9","_intra_pred_3_9","_intra_pred_4_9","_intra_pred_5_9","_pred_planar_0_9","_pred_planar_1_9","_pred_planar_2_9","_pred_planar_3_9","_intra_pred_2_10","_intra_pred_3_10","_intra_pred_4_10","_intra_pred_5_10","_pred_planar_0_10","_pred_planar_1_10","_pred_planar_2_10","_pred_planar_3_10","_intra_pred_2_12","_intra_pred_3_12","_intra_pred_4_12","_intra_pred_5_12","_pred_planar_0_12","_pred_planar_1_12","_pred_planar_2_12","_pred_planar_3_12","_intra_pred_2_8","_intra_pred_3_8","_intra_pred_4_8","_intra_pred_5_8","_pred_planar_0_8","_pred_planar_1_8","_pred_planar_2_8","_pred_planar_3_8","_apply_tns","_windowing_and_mdct_ltp","_h264_v_loop_filter_luma_intra_9_c","_h264_h_loop_filter_luma_intra_9_c","_h264_h_loop_filter_luma_mbaff_intra_9_c","_h264_v_loop_filter_chroma_intra_9_c","_h264_h_loop_filter_chroma_intra_9_c","_h264_h_loop_filter_chroma422_intra_9_c","_h264_h_loop_filter_chroma_mbaff_intra_9_c","_h264_h_loop_filter_chroma422_mbaff_intra_9_c","_h264_v_loop_filter_luma_intra_10_c","_h264_h_loop_filter_luma_intra_10_c","_h264_h_loop_filter_luma_mbaff_intra_10_c","_h264_v_loop_filter_chroma_intra_10_c","_h264_h_loop_filter_chroma_intra_10_c","_h264_h_loop_filter_chroma422_intra_10_c","_h264_h_loop_filter_chroma_mbaff_intra_10_c","_h264_h_loop_filter_chroma422_mbaff_intra_10_c","_h264_v_loop_filter_luma_intra_12_c","_h264_h_loop_filter_luma_intra_12_c","_h264_h_loop_filter_luma_mbaff_intra_12_c","_h264_v_loop_filter_chroma_intra_12_c","_h264_h_loop_filter_chroma_intra_12_c","_h264_h_loop_filter_chroma422_intra_12_c","_h264_h_loop_filter_chroma_mbaff_intra_12_c","_h264_h_loop_filter_chroma422_mbaff_intra_12_c","_h264_v_loop_filter_luma_intra_14_c","_h264_h_loop_filter_luma_intra_14_c","_h264_h_loop_filter_luma_mbaff_intra_14_c","_h264_v_loop_filter_chroma_intra_14_c","_h264_h_loop_filter_chroma_intra_14_c","_h264_h_loop_filter_chroma422_intra_14_c","_h264_h_loop_filter_chroma_mbaff_intra_14_c","_h264_h_loop_filter_chroma422_mbaff_intra_14_c","_h264_v_loop_filter_luma_intra_8_c","_h264_h_loop_filter_luma_intra_8_c","_h264_h_loop_filter_luma_mbaff_intra_8_c","_h264_v_loop_filter_chroma_intra_8_c","_h264_h_loop_filter_chroma_intra_8_c","_h264_h_loop_filter_chroma422_intra_8_c","_h264_h_loop_filter_chroma_mbaff_intra_8_c","_h264_h_loop_filter_chroma422_mbaff_intra_8_c","_fft15_c","_mdct15","_imdct15_half","_ps_mul_pair_single_c","_ps_hybrid_analysis_ileave_c","_ps_hybrid_synthesis_deint_c","_vector_fmul_c","_vector_dmul_c","_vector_fmul_reverse_c","_av_log_default_callback",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,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,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,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,0,0,0,0,0];var debug_table_viiiid=[0,"jsCall_viiiid_0","jsCall_viiiid_1","jsCall_viiiid_2","jsCall_viiiid_3","jsCall_viiiid_4","jsCall_viiiid_5","jsCall_viiiid_6","jsCall_viiiid_7","jsCall_viiiid_8","jsCall_viiiid_9","jsCall_viiiid_10","jsCall_viiiid_11","jsCall_viiiid_12","jsCall_viiiid_13","jsCall_viiiid_14","jsCall_viiiid_15","jsCall_viiiid_16","jsCall_viiiid_17","jsCall_viiiid_18","jsCall_viiiid_19","jsCall_viiiid_20","jsCall_viiiid_21","jsCall_viiiid_22","jsCall_viiiid_23","jsCall_viiiid_24","jsCall_viiiid_25","jsCall_viiiid_26","jsCall_viiiid_27","jsCall_viiiid_28","jsCall_viiiid_29","jsCall_viiiid_30","jsCall_viiiid_31","jsCall_viiiid_32","jsCall_viiiid_33","jsCall_viiiid_34",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,0];var debug_table_viiiifii=[0,"jsCall_viiiifii_0","jsCall_viiiifii_1","jsCall_viiiifii_2","jsCall_viiiifii_3","jsCall_viiiifii_4","jsCall_viiiifii_5","jsCall_viiiifii_6","jsCall_viiiifii_7","jsCall_viiiifii_8","jsCall_viiiifii_9","jsCall_viiiifii_10","jsCall_viiiifii_11","jsCall_viiiifii_12","jsCall_viiiifii_13","jsCall_viiiifii_14","jsCall_viiiifii_15","jsCall_viiiifii_16","jsCall_viiiifii_17","jsCall_viiiifii_18","jsCall_viiiifii_19","jsCall_viiiifii_20","jsCall_viiiifii_21","jsCall_viiiifii_22","jsCall_viiiifii_23","jsCall_viiiifii_24","jsCall_viiiifii_25","jsCall_viiiifii_26","jsCall_viiiifii_27","jsCall_viiiifii_28","jsCall_viiiifii_29","jsCall_viiiifii_30","jsCall_viiiifii_31","jsCall_viiiifii_32","jsCall_viiiifii_33","jsCall_viiiifii_34","_sbr_hf_gen_c",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];var debug_table_viiiii=[0,"jsCall_viiiii_0","jsCall_viiiii_1","jsCall_viiiii_2","jsCall_viiiii_3","jsCall_viiiii_4","jsCall_viiiii_5","jsCall_viiiii_6","jsCall_viiiii_7","jsCall_viiiii_8","jsCall_viiiii_9","jsCall_viiiii_10","jsCall_viiiii_11","jsCall_viiiii_12","jsCall_viiiii_13","jsCall_viiiii_14","jsCall_viiiii_15","jsCall_viiiii_16","jsCall_viiiii_17","jsCall_viiiii_18","jsCall_viiiii_19","jsCall_viiiii_20","jsCall_viiiii_21","jsCall_viiiii_22","jsCall_viiiii_23","jsCall_viiiii_24","jsCall_viiiii_25","jsCall_viiiii_26","jsCall_viiiii_27","jsCall_viiiii_28","jsCall_viiiii_29","jsCall_viiiii_30","jsCall_viiiii_31","jsCall_viiiii_32","jsCall_viiiii_33","jsCall_viiiii_34","_planar_rgb9le_to_uv","_planar_rgb10le_to_uv","_planar_rgb12le_to_uv","_planar_rgb14le_to_uv","_planar_rgb16le_to_uv","_planar_rgb9be_to_uv","_planar_rgb10be_to_uv","_planar_rgb12be_to_uv","_planar_rgb14be_to_uv","_planar_rgb16be_to_uv","_planar_rgb_to_uv","_yuv2p010l1_LE_c","_yuv2p010l1_BE_c","_yuv2plane1_16LE_c","_yuv2plane1_16BE_c","_yuv2plane1_9LE_c","_yuv2plane1_9BE_c","_yuv2plane1_10LE_c","_yuv2plane1_10BE_c","_yuv2plane1_12LE_c","_yuv2plane1_12BE_c","_yuv2plane1_14LE_c","_yuv2plane1_14BE_c","_yuv2plane1_floatBE_c","_yuv2plane1_floatLE_c","_yuv2plane1_8_c","_bayer_bggr8_to_rgb24_copy","_bayer_bggr8_to_rgb24_interpolate","_bayer_bggr16le_to_rgb24_copy","_bayer_bggr16le_to_rgb24_interpolate","_bayer_bggr16be_to_rgb24_copy","_bayer_bggr16be_to_rgb24_interpolate","_bayer_rggb8_to_rgb24_copy","_bayer_rggb8_to_rgb24_interpolate","_bayer_rggb16le_to_rgb24_copy","_bayer_rggb16le_to_rgb24_interpolate","_bayer_rggb16be_to_rgb24_copy","_bayer_rggb16be_to_rgb24_interpolate","_bayer_gbrg8_to_rgb24_copy","_bayer_gbrg8_to_rgb24_interpolate","_bayer_gbrg16le_to_rgb24_copy","_bayer_gbrg16le_to_rgb24_interpolate","_bayer_gbrg16be_to_rgb24_copy","_bayer_gbrg16be_to_rgb24_interpolate","_bayer_grbg8_to_rgb24_copy","_bayer_grbg8_to_rgb24_interpolate","_bayer_grbg16le_to_rgb24_copy","_bayer_grbg16le_to_rgb24_interpolate","_bayer_grbg16be_to_rgb24_copy","_bayer_grbg16be_to_rgb24_interpolate","_hevc_h_loop_filter_chroma_9","_hevc_v_loop_filter_chroma_9","_hevc_h_loop_filter_chroma_10","_hevc_v_loop_filter_chroma_10","_hevc_h_loop_filter_chroma_12","_hevc_v_loop_filter_chroma_12","_hevc_h_loop_filter_chroma_8","_hevc_v_loop_filter_chroma_8","_worker_func","_sbr_hf_assemble","_sbr_hf_inverse_filter","_ff_h264_idct_add16_9_c","_ff_h264_idct8_add4_9_c","_ff_h264_idct_add8_9_c","_ff_h264_idct_add8_422_9_c","_ff_h264_idct_add16intra_9_c","_h264_v_loop_filter_luma_9_c","_h264_h_loop_filter_luma_9_c","_h264_h_loop_filter_luma_mbaff_9_c","_h264_v_loop_filter_chroma_9_c","_h264_h_loop_filter_chroma_9_c","_h264_h_loop_filter_chroma422_9_c","_h264_h_loop_filter_chroma_mbaff_9_c","_h264_h_loop_filter_chroma422_mbaff_9_c","_ff_h264_idct_add16_10_c","_ff_h264_idct8_add4_10_c","_ff_h264_idct_add8_10_c","_ff_h264_idct_add8_422_10_c","_ff_h264_idct_add16intra_10_c","_h264_v_loop_filter_luma_10_c","_h264_h_loop_filter_luma_10_c","_h264_h_loop_filter_luma_mbaff_10_c","_h264_v_loop_filter_chroma_10_c","_h264_h_loop_filter_chroma_10_c","_h264_h_loop_filter_chroma422_10_c","_h264_h_loop_filter_chroma_mbaff_10_c","_h264_h_loop_filter_chroma422_mbaff_10_c","_ff_h264_idct_add16_12_c","_ff_h264_idct8_add4_12_c","_ff_h264_idct_add8_12_c","_ff_h264_idct_add8_422_12_c","_ff_h264_idct_add16intra_12_c","_h264_v_loop_filter_luma_12_c","_h264_h_loop_filter_luma_12_c","_h264_h_loop_filter_luma_mbaff_12_c","_h264_v_loop_filter_chroma_12_c","_h264_h_loop_filter_chroma_12_c","_h264_h_loop_filter_chroma422_12_c","_h264_h_loop_filter_chroma_mbaff_12_c","_h264_h_loop_filter_chroma422_mbaff_12_c","_ff_h264_idct_add16_14_c","_ff_h264_idct8_add4_14_c","_ff_h264_idct_add8_14_c","_ff_h264_idct_add8_422_14_c","_ff_h264_idct_add16intra_14_c","_h264_v_loop_filter_luma_14_c","_h264_h_loop_filter_luma_14_c","_h264_h_loop_filter_luma_mbaff_14_c","_h264_v_loop_filter_chroma_14_c","_h264_h_loop_filter_chroma_14_c","_h264_h_loop_filter_chroma422_14_c","_h264_h_loop_filter_chroma_mbaff_14_c","_h264_h_loop_filter_chroma422_mbaff_14_c","_ff_h264_idct_add16_8_c","_ff_h264_idct8_add4_8_c","_ff_h264_idct_add8_8_c","_ff_h264_idct_add8_422_8_c","_ff_h264_idct_add16intra_8_c","_h264_v_loop_filter_luma_8_c","_h264_h_loop_filter_luma_8_c","_h264_h_loop_filter_luma_mbaff_8_c","_h264_v_loop_filter_chroma_8_c","_h264_h_loop_filter_chroma_8_c","_h264_h_loop_filter_chroma422_8_c","_h264_h_loop_filter_chroma_mbaff_8_c","_h264_h_loop_filter_chroma422_mbaff_8_c","_postrotate_c","_sbr_hf_g_filt_c","_ps_hybrid_analysis_c","_ps_stereo_interpolate_c","_ps_stereo_interpolate_ipdopd_c","_vector_fmul_window_c","_vector_fmul_add_c",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,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,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,0,0,0,0,0,0];var debug_table_viiiiidd=[0,"jsCall_viiiiidd_0","jsCall_viiiiidd_1","jsCall_viiiiidd_2","jsCall_viiiiidd_3","jsCall_viiiiidd_4","jsCall_viiiiidd_5","jsCall_viiiiidd_6","jsCall_viiiiidd_7","jsCall_viiiiidd_8","jsCall_viiiiidd_9","jsCall_viiiiidd_10","jsCall_viiiiidd_11","jsCall_viiiiidd_12","jsCall_viiiiidd_13","jsCall_viiiiidd_14","jsCall_viiiiidd_15","jsCall_viiiiidd_16","jsCall_viiiiidd_17","jsCall_viiiiidd_18","jsCall_viiiiidd_19","jsCall_viiiiidd_20","jsCall_viiiiidd_21","jsCall_viiiiidd_22","jsCall_viiiiidd_23","jsCall_viiiiidd_24","jsCall_viiiiidd_25","jsCall_viiiiidd_26","jsCall_viiiiidd_27","jsCall_viiiiidd_28","jsCall_viiiiidd_29","jsCall_viiiiidd_30","jsCall_viiiiidd_31","jsCall_viiiiidd_32","jsCall_viiiiidd_33","jsCall_viiiiidd_34",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,0];var debug_table_viiiiii=[0,"jsCall_viiiiii_0","jsCall_viiiiii_1","jsCall_viiiiii_2","jsCall_viiiiii_3","jsCall_viiiiii_4","jsCall_viiiiii_5","jsCall_viiiiii_6","jsCall_viiiiii_7","jsCall_viiiiii_8","jsCall_viiiiii_9","jsCall_viiiiii_10","jsCall_viiiiii_11","jsCall_viiiiii_12","jsCall_viiiiii_13","jsCall_viiiiii_14","jsCall_viiiiii_15","jsCall_viiiiii_16","jsCall_viiiiii_17","jsCall_viiiiii_18","jsCall_viiiiii_19","jsCall_viiiiii_20","jsCall_viiiiii_21","jsCall_viiiiii_22","jsCall_viiiiii_23","jsCall_viiiiii_24","jsCall_viiiiii_25","jsCall_viiiiii_26","jsCall_viiiiii_27","jsCall_viiiiii_28","jsCall_viiiiii_29","jsCall_viiiiii_30","jsCall_viiiiii_31","jsCall_viiiiii_32","jsCall_viiiiii_33","jsCall_viiiiii_34","_read_geobtag","_read_apic","_read_chapter","_read_priv","_ff_hyscale_fast_c","_bswap16Y_c","_read_ya16le_gray_c","_read_ya16be_gray_c","_read_ayuv64le_Y_c","_yuy2ToY_c","_uyvyToY_c","_bgr24ToY_c","_bgr16leToY_c","_bgr16beToY_c","_bgr15leToY_c","_bgr15beToY_c","_bgr12leToY_c","_bgr12beToY_c","_rgb24ToY_c","_rgb16leToY_c","_rgb16beToY_c","_rgb15leToY_c","_rgb15beToY_c","_rgb12leToY_c","_rgb12beToY_c","_palToY_c","_monoblack2Y_c","_monowhite2Y_c","_bgr32ToY_c","_bgr321ToY_c","_rgb32ToY_c","_rgb321ToY_c","_rgb48BEToY_c","_rgb48LEToY_c","_bgr48BEToY_c","_bgr48LEToY_c","_rgb64BEToY_c","_rgb64LEToY_c","_bgr64BEToY_c","_bgr64LEToY_c","_p010LEToY_c","_p010BEToY_c","_grayf32ToY16_c","_grayf32ToY16_bswap_c","_rgba64leToA_c","_rgba64beToA_c","_rgbaToA_c","_abgrToA_c","_read_ya16le_alpha_c","_read_ya16be_alpha_c","_read_ayuv64le_A_c","_palToA_c","_put_pcm_9","_hevc_h_loop_filter_luma_9","_hevc_v_loop_filter_luma_9","_put_pcm_10","_hevc_h_loop_filter_luma_10","_hevc_v_loop_filter_luma_10","_put_pcm_12","_hevc_h_loop_filter_luma_12","_hevc_v_loop_filter_luma_12","_put_pcm_8","_hevc_h_loop_filter_luma_8","_hevc_v_loop_filter_luma_8","_pred_dc_9","_pred_angular_0_9","_pred_angular_1_9","_pred_angular_2_9","_pred_angular_3_9","_pred_dc_10","_pred_angular_0_10","_pred_angular_1_10","_pred_angular_2_10","_pred_angular_3_10","_pred_dc_12","_pred_angular_0_12","_pred_angular_1_12","_pred_angular_2_12","_pred_angular_3_12","_pred_dc_8","_pred_angular_0_8","_pred_angular_1_8","_pred_angular_2_8","_pred_angular_3_8","_weight_h264_pixels16_9_c","_weight_h264_pixels8_9_c","_weight_h264_pixels4_9_c","_weight_h264_pixels2_9_c","_weight_h264_pixels16_10_c","_weight_h264_pixels8_10_c","_weight_h264_pixels4_10_c","_weight_h264_pixels2_10_c","_weight_h264_pixels16_12_c","_weight_h264_pixels8_12_c","_weight_h264_pixels4_12_c","_weight_h264_pixels2_12_c","_weight_h264_pixels16_14_c","_weight_h264_pixels8_14_c","_weight_h264_pixels4_14_c","_weight_h264_pixels2_14_c","_weight_h264_pixels16_8_c","_weight_h264_pixels8_8_c","_weight_h264_pixels4_8_c","_weight_h264_pixels2_8_c","_sbr_hf_apply_noise_0","_sbr_hf_apply_noise_1","_sbr_hf_apply_noise_2","_sbr_hf_apply_noise_3","_aes_decrypt","_aes_encrypt","_image_copy_plane",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,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,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,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,0];var debug_table_viiiiiifi=[0,"jsCall_viiiiiifi_0","jsCall_viiiiiifi_1","jsCall_viiiiiifi_2","jsCall_viiiiiifi_3","jsCall_viiiiiifi_4","jsCall_viiiiiifi_5","jsCall_viiiiiifi_6","jsCall_viiiiiifi_7","jsCall_viiiiiifi_8","jsCall_viiiiiifi_9","jsCall_viiiiiifi_10","jsCall_viiiiiifi_11","jsCall_viiiiiifi_12","jsCall_viiiiiifi_13","jsCall_viiiiiifi_14","jsCall_viiiiiifi_15","jsCall_viiiiiifi_16","jsCall_viiiiiifi_17","jsCall_viiiiiifi_18","jsCall_viiiiiifi_19","jsCall_viiiiiifi_20","jsCall_viiiiiifi_21","jsCall_viiiiiifi_22","jsCall_viiiiiifi_23","jsCall_viiiiiifi_24","jsCall_viiiiiifi_25","jsCall_viiiiiifi_26","jsCall_viiiiiifi_27","jsCall_viiiiiifi_28","jsCall_viiiiiifi_29","jsCall_viiiiiifi_30","jsCall_viiiiiifi_31","jsCall_viiiiiifi_32","jsCall_viiiiiifi_33","jsCall_viiiiiifi_34","_ps_decorrelate_c",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];var debug_table_viiiiiii=[0,"jsCall_viiiiiii_0","jsCall_viiiiiii_1","jsCall_viiiiiii_2","jsCall_viiiiiii_3","jsCall_viiiiiii_4","jsCall_viiiiiii_5","jsCall_viiiiiii_6","jsCall_viiiiiii_7","jsCall_viiiiiii_8","jsCall_viiiiiii_9","jsCall_viiiiiii_10","jsCall_viiiiiii_11","jsCall_viiiiiii_12","jsCall_viiiiiii_13","jsCall_viiiiiii_14","jsCall_viiiiiii_15","jsCall_viiiiiii_16","jsCall_viiiiiii_17","jsCall_viiiiiii_18","jsCall_viiiiiii_19","jsCall_viiiiiii_20","jsCall_viiiiiii_21","jsCall_viiiiiii_22","jsCall_viiiiiii_23","jsCall_viiiiiii_24","jsCall_viiiiiii_25","jsCall_viiiiiii_26","jsCall_viiiiiii_27","jsCall_viiiiiii_28","jsCall_viiiiiii_29","jsCall_viiiiiii_30","jsCall_viiiiiii_31","jsCall_viiiiiii_32","jsCall_viiiiiii_33","jsCall_viiiiiii_34","_hScale8To15_c","_hScale8To19_c","_hScale16To19_c","_hScale16To15_c","_yuy2ToUV_c","_yvy2ToUV_c","_uyvyToUV_c","_nv12ToUV_c","_nv21ToUV_c","_palToUV_c","_bswap16UV_c","_read_ayuv64le_UV_c","_p010LEToUV_c","_p010BEToUV_c","_p016LEToUV_c","_p016BEToUV_c","_gbr24pToUV_half_c","_rgb64BEToUV_half_c","_rgb64LEToUV_half_c","_bgr64BEToUV_half_c","_bgr64LEToUV_half_c","_rgb48BEToUV_half_c","_rgb48LEToUV_half_c","_bgr48BEToUV_half_c","_bgr48LEToUV_half_c","_bgr32ToUV_half_c","_bgr321ToUV_half_c","_bgr24ToUV_half_c","_bgr16leToUV_half_c","_bgr16beToUV_half_c","_bgr15leToUV_half_c","_bgr15beToUV_half_c","_bgr12leToUV_half_c","_bgr12beToUV_half_c","_rgb32ToUV_half_c","_rgb321ToUV_half_c","_rgb24ToUV_half_c","_rgb16leToUV_half_c","_rgb16beToUV_half_c","_rgb15leToUV_half_c","_rgb15beToUV_half_c","_rgb12leToUV_half_c","_rgb12beToUV_half_c","_rgb64BEToUV_c","_rgb64LEToUV_c","_bgr64BEToUV_c","_bgr64LEToUV_c","_rgb48BEToUV_c","_rgb48LEToUV_c","_bgr48BEToUV_c","_bgr48LEToUV_c","_bgr32ToUV_c","_bgr321ToUV_c","_bgr24ToUV_c","_bgr16leToUV_c","_bgr16beToUV_c","_bgr15leToUV_c","_bgr15beToUV_c","_bgr12leToUV_c","_bgr12beToUV_c","_rgb32ToUV_c","_rgb321ToUV_c","_rgb24ToUV_c","_rgb16leToUV_c","_rgb16beToUV_c","_rgb15leToUV_c","_rgb15beToUV_c","_rgb12leToUV_c","_rgb12beToUV_c","_yuv2p010lX_LE_c","_yuv2p010lX_BE_c","_yuv2p010cX_c","_yuv2planeX_16LE_c","_yuv2planeX_16BE_c","_yuv2p016cX_c","_yuv2planeX_9LE_c","_yuv2planeX_9BE_c","_yuv2planeX_10LE_c","_yuv2planeX_10BE_c","_yuv2planeX_12LE_c","_yuv2planeX_12BE_c","_yuv2planeX_14LE_c","_yuv2planeX_14BE_c","_yuv2planeX_floatBE_c","_yuv2planeX_floatLE_c","_yuv2planeX_8_c","_yuv2nv12cX_c","_sao_edge_filter_9","_put_hevc_pel_pixels_9","_put_hevc_qpel_h_9","_put_hevc_qpel_v_9","_put_hevc_qpel_hv_9","_put_hevc_epel_h_9","_put_hevc_epel_v_9","_put_hevc_epel_hv_9","_sao_edge_filter_10","_put_hevc_pel_pixels_10","_put_hevc_qpel_h_10","_put_hevc_qpel_v_10","_put_hevc_qpel_hv_10","_put_hevc_epel_h_10","_put_hevc_epel_v_10","_put_hevc_epel_hv_10","_sao_edge_filter_12","_put_hevc_pel_pixels_12","_put_hevc_qpel_h_12","_put_hevc_qpel_v_12","_put_hevc_qpel_hv_12","_put_hevc_epel_h_12","_put_hevc_epel_v_12","_put_hevc_epel_hv_12","_sao_edge_filter_8","_put_hevc_pel_pixels_8","_put_hevc_qpel_h_8","_put_hevc_qpel_v_8","_put_hevc_qpel_hv_8","_put_hevc_epel_h_8","_put_hevc_epel_v_8","_put_hevc_epel_hv_8",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,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,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];var debug_table_viiiiiiii=[0,"jsCall_viiiiiiii_0","jsCall_viiiiiiii_1","jsCall_viiiiiiii_2","jsCall_viiiiiiii_3","jsCall_viiiiiiii_4","jsCall_viiiiiiii_5","jsCall_viiiiiiii_6","jsCall_viiiiiiii_7","jsCall_viiiiiiii_8","jsCall_viiiiiiii_9","jsCall_viiiiiiii_10","jsCall_viiiiiiii_11","jsCall_viiiiiiii_12","jsCall_viiiiiiii_13","jsCall_viiiiiiii_14","jsCall_viiiiiiii_15","jsCall_viiiiiiii_16","jsCall_viiiiiiii_17","jsCall_viiiiiiii_18","jsCall_viiiiiiii_19","jsCall_viiiiiiii_20","jsCall_viiiiiiii_21","jsCall_viiiiiiii_22","jsCall_viiiiiiii_23","jsCall_viiiiiiii_24","jsCall_viiiiiiii_25","jsCall_viiiiiiii_26","jsCall_viiiiiiii_27","jsCall_viiiiiiii_28","jsCall_viiiiiiii_29","jsCall_viiiiiiii_30","jsCall_viiiiiiii_31","jsCall_viiiiiiii_32","jsCall_viiiiiiii_33","jsCall_viiiiiiii_34","_ff_hcscale_fast_c","_bayer_bggr8_to_yv12_copy","_bayer_bggr8_to_yv12_interpolate","_bayer_bggr16le_to_yv12_copy","_bayer_bggr16le_to_yv12_interpolate","_bayer_bggr16be_to_yv12_copy","_bayer_bggr16be_to_yv12_interpolate","_bayer_rggb8_to_yv12_copy","_bayer_rggb8_to_yv12_interpolate","_bayer_rggb16le_to_yv12_copy","_bayer_rggb16le_to_yv12_interpolate","_bayer_rggb16be_to_yv12_copy","_bayer_rggb16be_to_yv12_interpolate","_bayer_gbrg8_to_yv12_copy","_bayer_gbrg8_to_yv12_interpolate","_bayer_gbrg16le_to_yv12_copy","_bayer_gbrg16le_to_yv12_interpolate","_bayer_gbrg16be_to_yv12_copy","_bayer_gbrg16be_to_yv12_interpolate","_bayer_grbg8_to_yv12_copy","_bayer_grbg8_to_yv12_interpolate","_bayer_grbg16le_to_yv12_copy","_bayer_grbg16le_to_yv12_interpolate","_bayer_grbg16be_to_yv12_copy","_bayer_grbg16be_to_yv12_interpolate","_sao_band_filter_9","_put_hevc_pel_uni_pixels_9","_put_hevc_qpel_uni_h_9","_put_hevc_qpel_uni_v_9","_put_hevc_qpel_uni_hv_9","_put_hevc_epel_uni_h_9","_put_hevc_epel_uni_v_9","_put_hevc_epel_uni_hv_9","_sao_band_filter_10","_put_hevc_pel_uni_pixels_10","_put_hevc_qpel_uni_h_10","_put_hevc_qpel_uni_v_10","_put_hevc_qpel_uni_hv_10","_put_hevc_epel_uni_h_10","_put_hevc_epel_uni_v_10","_put_hevc_epel_uni_hv_10","_sao_band_filter_12","_put_hevc_pel_uni_pixels_12","_put_hevc_qpel_uni_h_12","_put_hevc_qpel_uni_v_12","_put_hevc_qpel_uni_hv_12","_put_hevc_epel_uni_h_12","_put_hevc_epel_uni_v_12","_put_hevc_epel_uni_hv_12","_sao_band_filter_8","_put_hevc_pel_uni_pixels_8","_put_hevc_qpel_uni_h_8","_put_hevc_qpel_uni_v_8","_put_hevc_qpel_uni_hv_8","_put_hevc_epel_uni_h_8","_put_hevc_epel_uni_v_8","_put_hevc_epel_uni_hv_8","_biweight_h264_pixels16_9_c","_biweight_h264_pixels8_9_c","_biweight_h264_pixels4_9_c","_biweight_h264_pixels2_9_c","_biweight_h264_pixels16_10_c","_biweight_h264_pixels8_10_c","_biweight_h264_pixels4_10_c","_biweight_h264_pixels2_10_c","_biweight_h264_pixels16_12_c","_biweight_h264_pixels8_12_c","_biweight_h264_pixels4_12_c","_biweight_h264_pixels2_12_c","_biweight_h264_pixels16_14_c","_biweight_h264_pixels8_14_c","_biweight_h264_pixels4_14_c","_biweight_h264_pixels2_14_c","_biweight_h264_pixels16_8_c","_biweight_h264_pixels8_8_c","_biweight_h264_pixels4_8_c","_biweight_h264_pixels2_8_c",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];var debug_table_viiiiiiiid=[0,"jsCall_viiiiiiiid_0","jsCall_viiiiiiiid_1","jsCall_viiiiiiiid_2","jsCall_viiiiiiiid_3","jsCall_viiiiiiiid_4","jsCall_viiiiiiiid_5","jsCall_viiiiiiiid_6","jsCall_viiiiiiiid_7","jsCall_viiiiiiiid_8","jsCall_viiiiiiiid_9","jsCall_viiiiiiiid_10","jsCall_viiiiiiiid_11","jsCall_viiiiiiiid_12","jsCall_viiiiiiiid_13","jsCall_viiiiiiiid_14","jsCall_viiiiiiiid_15","jsCall_viiiiiiiid_16","jsCall_viiiiiiiid_17","jsCall_viiiiiiiid_18","jsCall_viiiiiiiid_19","jsCall_viiiiiiiid_20","jsCall_viiiiiiiid_21","jsCall_viiiiiiiid_22","jsCall_viiiiiiiid_23","jsCall_viiiiiiiid_24","jsCall_viiiiiiiid_25","jsCall_viiiiiiiid_26","jsCall_viiiiiiiid_27","jsCall_viiiiiiiid_28","jsCall_viiiiiiiid_29","jsCall_viiiiiiiid_30","jsCall_viiiiiiiid_31","jsCall_viiiiiiiid_32","jsCall_viiiiiiiid_33","jsCall_viiiiiiiid_34",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,0];var debug_table_viiiiiiiidi=[0,"jsCall_viiiiiiiidi_0","jsCall_viiiiiiiidi_1","jsCall_viiiiiiiidi_2","jsCall_viiiiiiiidi_3","jsCall_viiiiiiiidi_4","jsCall_viiiiiiiidi_5","jsCall_viiiiiiiidi_6","jsCall_viiiiiiiidi_7","jsCall_viiiiiiiidi_8","jsCall_viiiiiiiidi_9","jsCall_viiiiiiiidi_10","jsCall_viiiiiiiidi_11","jsCall_viiiiiiiidi_12","jsCall_viiiiiiiidi_13","jsCall_viiiiiiiidi_14","jsCall_viiiiiiiidi_15","jsCall_viiiiiiiidi_16","jsCall_viiiiiiiidi_17","jsCall_viiiiiiiidi_18","jsCall_viiiiiiiidi_19","jsCall_viiiiiiiidi_20","jsCall_viiiiiiiidi_21","jsCall_viiiiiiiidi_22","jsCall_viiiiiiiidi_23","jsCall_viiiiiiiidi_24","jsCall_viiiiiiiidi_25","jsCall_viiiiiiiidi_26","jsCall_viiiiiiiidi_27","jsCall_viiiiiiiidi_28","jsCall_viiiiiiiidi_29","jsCall_viiiiiiiidi_30","jsCall_viiiiiiiidi_31","jsCall_viiiiiiiidi_32","jsCall_viiiiiiiidi_33","jsCall_viiiiiiiidi_34",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,0];var debug_table_viiiiiiiii=[0,"jsCall_viiiiiiiii_0","jsCall_viiiiiiiii_1","jsCall_viiiiiiiii_2","jsCall_viiiiiiiii_3","jsCall_viiiiiiiii_4","jsCall_viiiiiiiii_5","jsCall_viiiiiiiii_6","jsCall_viiiiiiiii_7","jsCall_viiiiiiiii_8","jsCall_viiiiiiiii_9","jsCall_viiiiiiiii_10","jsCall_viiiiiiiii_11","jsCall_viiiiiiiii_12","jsCall_viiiiiiiii_13","jsCall_viiiiiiiii_14","jsCall_viiiiiiiii_15","jsCall_viiiiiiiii_16","jsCall_viiiiiiiii_17","jsCall_viiiiiiiii_18","jsCall_viiiiiiiii_19","jsCall_viiiiiiiii_20","jsCall_viiiiiiiii_21","jsCall_viiiiiiiii_22","jsCall_viiiiiiiii_23","jsCall_viiiiiiiii_24","jsCall_viiiiiiiii_25","jsCall_viiiiiiiii_26","jsCall_viiiiiiiii_27","jsCall_viiiiiiiii_28","jsCall_viiiiiiiii_29","jsCall_viiiiiiiii_30","jsCall_viiiiiiiii_31","jsCall_viiiiiiiii_32","jsCall_viiiiiiiii_33","jsCall_viiiiiiiii_34","_yuv2rgba32_full_1_c","_yuv2rgbx32_full_1_c","_yuv2argb32_full_1_c","_yuv2xrgb32_full_1_c","_yuv2bgra32_full_1_c","_yuv2bgrx32_full_1_c","_yuv2abgr32_full_1_c","_yuv2xbgr32_full_1_c","_yuv2rgba64le_full_1_c","_yuv2rgbx64le_full_1_c","_yuv2rgba64be_full_1_c","_yuv2rgbx64be_full_1_c","_yuv2bgra64le_full_1_c","_yuv2bgrx64le_full_1_c","_yuv2bgra64be_full_1_c","_yuv2bgrx64be_full_1_c","_yuv2rgb24_full_1_c","_yuv2bgr24_full_1_c","_yuv2rgb48le_full_1_c","_yuv2bgr48le_full_1_c","_yuv2rgb48be_full_1_c","_yuv2bgr48be_full_1_c","_yuv2bgr4_byte_full_1_c","_yuv2rgb4_byte_full_1_c","_yuv2bgr8_full_1_c","_yuv2rgb8_full_1_c","_yuv2rgbx64le_1_c","_yuv2rgba64le_1_c","_yuv2rgbx64be_1_c","_yuv2rgba64be_1_c","_yuv2bgrx64le_1_c","_yuv2bgra64le_1_c","_yuv2bgrx64be_1_c","_yuv2bgra64be_1_c","_yuv2rgba32_1_c","_yuv2rgbx32_1_c","_yuv2rgba32_1_1_c","_yuv2rgbx32_1_1_c","_yuv2rgb16_1_c","_yuv2rgb15_1_c","_yuv2rgb12_1_c","_yuv2rgb8_1_c","_yuv2rgb4_1_c","_yuv2rgb4b_1_c","_yuv2rgb48le_1_c","_yuv2rgb48be_1_c","_yuv2bgr48le_1_c","_yuv2bgr48be_1_c","_yuv2rgb24_1_c","_yuv2bgr24_1_c","_yuv2monowhite_1_c","_yuv2monoblack_1_c","_yuv2yuyv422_1_c","_yuv2yvyu422_1_c","_yuv2uyvy422_1_c","_yuv2ya8_1_c","_yuv2ya16le_1_c","_yuv2ya16be_1_c","_yuy2toyv12_c","_put_hevc_pel_bi_pixels_9","_put_hevc_qpel_bi_h_9","_put_hevc_qpel_bi_v_9","_put_hevc_qpel_bi_hv_9","_put_hevc_epel_bi_h_9","_put_hevc_epel_bi_v_9","_put_hevc_epel_bi_hv_9","_put_hevc_pel_bi_pixels_10","_put_hevc_qpel_bi_h_10","_put_hevc_qpel_bi_v_10","_put_hevc_qpel_bi_hv_10","_put_hevc_epel_bi_h_10","_put_hevc_epel_bi_v_10","_put_hevc_epel_bi_hv_10","_put_hevc_pel_bi_pixels_12","_put_hevc_qpel_bi_h_12","_put_hevc_qpel_bi_v_12","_put_hevc_qpel_bi_hv_12","_put_hevc_epel_bi_h_12","_put_hevc_epel_bi_v_12","_put_hevc_epel_bi_hv_12","_put_hevc_pel_bi_pixels_8","_put_hevc_qpel_bi_h_8","_put_hevc_qpel_bi_v_8","_put_hevc_qpel_bi_hv_8","_put_hevc_epel_bi_h_8","_put_hevc_epel_bi_v_8","_put_hevc_epel_bi_hv_8",0,0,0,0,0];var debug_table_viiiiiiiiii=[0,"jsCall_viiiiiiiiii_0","jsCall_viiiiiiiiii_1","jsCall_viiiiiiiiii_2","jsCall_viiiiiiiiii_3","jsCall_viiiiiiiiii_4","jsCall_viiiiiiiiii_5","jsCall_viiiiiiiiii_6","jsCall_viiiiiiiiii_7","jsCall_viiiiiiiiii_8","jsCall_viiiiiiiiii_9","jsCall_viiiiiiiiii_10","jsCall_viiiiiiiiii_11","jsCall_viiiiiiiiii_12","jsCall_viiiiiiiiii_13","jsCall_viiiiiiiiii_14","jsCall_viiiiiiiiii_15","jsCall_viiiiiiiiii_16","jsCall_viiiiiiiiii_17","jsCall_viiiiiiiiii_18","jsCall_viiiiiiiiii_19","jsCall_viiiiiiiiii_20","jsCall_viiiiiiiiii_21","jsCall_viiiiiiiiii_22","jsCall_viiiiiiiiii_23","jsCall_viiiiiiiiii_24","jsCall_viiiiiiiiii_25","jsCall_viiiiiiiiii_26","jsCall_viiiiiiiiii_27","jsCall_viiiiiiiiii_28","jsCall_viiiiiiiiii_29","jsCall_viiiiiiiiii_30","jsCall_viiiiiiiiii_31","jsCall_viiiiiiiiii_32","jsCall_viiiiiiiiii_33","jsCall_viiiiiiiiii_34","_yuv2rgba32_full_2_c","_yuv2rgbx32_full_2_c","_yuv2argb32_full_2_c","_yuv2xrgb32_full_2_c","_yuv2bgra32_full_2_c","_yuv2bgrx32_full_2_c","_yuv2abgr32_full_2_c","_yuv2xbgr32_full_2_c","_yuv2rgba64le_full_2_c","_yuv2rgbx64le_full_2_c","_yuv2rgba64be_full_2_c","_yuv2rgbx64be_full_2_c","_yuv2bgra64le_full_2_c","_yuv2bgrx64le_full_2_c","_yuv2bgra64be_full_2_c","_yuv2bgrx64be_full_2_c","_yuv2rgb24_full_2_c","_yuv2bgr24_full_2_c","_yuv2rgb48le_full_2_c","_yuv2bgr48le_full_2_c","_yuv2rgb48be_full_2_c","_yuv2bgr48be_full_2_c","_yuv2bgr4_byte_full_2_c","_yuv2rgb4_byte_full_2_c","_yuv2bgr8_full_2_c","_yuv2rgb8_full_2_c","_yuv2rgbx64le_2_c","_yuv2rgba64le_2_c","_yuv2rgbx64be_2_c","_yuv2rgba64be_2_c","_yuv2bgrx64le_2_c","_yuv2bgra64le_2_c","_yuv2bgrx64be_2_c","_yuv2bgra64be_2_c","_yuv2rgba32_2_c","_yuv2rgbx32_2_c","_yuv2rgba32_1_2_c","_yuv2rgbx32_1_2_c","_yuv2rgb16_2_c","_yuv2rgb15_2_c","_yuv2rgb12_2_c","_yuv2rgb8_2_c","_yuv2rgb4_2_c","_yuv2rgb4b_2_c","_yuv2rgb48le_2_c","_yuv2rgb48be_2_c","_yuv2bgr48le_2_c","_yuv2bgr48be_2_c","_yuv2rgb24_2_c","_yuv2bgr24_2_c","_yuv2monowhite_2_c","_yuv2monoblack_2_c","_yuv2yuyv422_2_c","_yuv2yvyu422_2_c","_yuv2uyvy422_2_c","_yuv2ya8_2_c","_yuv2ya16le_2_c","_yuv2ya16be_2_c","_vu9_to_vu12_c","_yvu9_to_yuy2_c","_ff_emulated_edge_mc_8","_ff_emulated_edge_mc_16",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,0,0,0];var debug_table_viiiiiiiiiii=[0,"jsCall_viiiiiiiiiii_0","jsCall_viiiiiiiiiii_1","jsCall_viiiiiiiiiii_2","jsCall_viiiiiiiiiii_3","jsCall_viiiiiiiiiii_4","jsCall_viiiiiiiiiii_5","jsCall_viiiiiiiiiii_6","jsCall_viiiiiiiiiii_7","jsCall_viiiiiiiiiii_8","jsCall_viiiiiiiiiii_9","jsCall_viiiiiiiiiii_10","jsCall_viiiiiiiiiii_11","jsCall_viiiiiiiiiii_12","jsCall_viiiiiiiiiii_13","jsCall_viiiiiiiiiii_14","jsCall_viiiiiiiiiii_15","jsCall_viiiiiiiiiii_16","jsCall_viiiiiiiiiii_17","jsCall_viiiiiiiiiii_18","jsCall_viiiiiiiiiii_19","jsCall_viiiiiiiiiii_20","jsCall_viiiiiiiiiii_21","jsCall_viiiiiiiiiii_22","jsCall_viiiiiiiiiii_23","jsCall_viiiiiiiiiii_24","jsCall_viiiiiiiiiii_25","jsCall_viiiiiiiiiii_26","jsCall_viiiiiiiiiii_27","jsCall_viiiiiiiiiii_28","jsCall_viiiiiiiiiii_29","jsCall_viiiiiiiiiii_30","jsCall_viiiiiiiiiii_31","jsCall_viiiiiiiiiii_32","jsCall_viiiiiiiiiii_33","jsCall_viiiiiiiiiii_34","_put_hevc_pel_uni_w_pixels_9","_put_hevc_qpel_uni_w_h_9","_put_hevc_qpel_uni_w_v_9","_put_hevc_qpel_uni_w_hv_9","_put_hevc_epel_uni_w_h_9","_put_hevc_epel_uni_w_v_9","_put_hevc_epel_uni_w_hv_9","_put_hevc_pel_uni_w_pixels_10","_put_hevc_qpel_uni_w_h_10","_put_hevc_qpel_uni_w_v_10","_put_hevc_qpel_uni_w_hv_10","_put_hevc_epel_uni_w_h_10","_put_hevc_epel_uni_w_v_10","_put_hevc_epel_uni_w_hv_10","_put_hevc_pel_uni_w_pixels_12","_put_hevc_qpel_uni_w_h_12","_put_hevc_qpel_uni_w_v_12","_put_hevc_qpel_uni_w_hv_12","_put_hevc_epel_uni_w_h_12","_put_hevc_epel_uni_w_v_12","_put_hevc_epel_uni_w_hv_12","_put_hevc_pel_uni_w_pixels_8","_put_hevc_qpel_uni_w_h_8","_put_hevc_qpel_uni_w_v_8","_put_hevc_qpel_uni_w_hv_8","_put_hevc_epel_uni_w_h_8","_put_hevc_epel_uni_w_v_8","_put_hevc_epel_uni_w_hv_8"];var debug_table_viiiiiiiiiiii=[0,"jsCall_viiiiiiiiiiii_0","jsCall_viiiiiiiiiiii_1","jsCall_viiiiiiiiiiii_2","jsCall_viiiiiiiiiiii_3","jsCall_viiiiiiiiiiii_4","jsCall_viiiiiiiiiiii_5","jsCall_viiiiiiiiiiii_6","jsCall_viiiiiiiiiiii_7","jsCall_viiiiiiiiiiii_8","jsCall_viiiiiiiiiiii_9","jsCall_viiiiiiiiiiii_10","jsCall_viiiiiiiiiiii_11","jsCall_viiiiiiiiiiii_12","jsCall_viiiiiiiiiiii_13","jsCall_viiiiiiiiiiii_14","jsCall_viiiiiiiiiiii_15","jsCall_viiiiiiiiiiii_16","jsCall_viiiiiiiiiiii_17","jsCall_viiiiiiiiiiii_18","jsCall_viiiiiiiiiiii_19","jsCall_viiiiiiiiiiii_20","jsCall_viiiiiiiiiiii_21","jsCall_viiiiiiiiiiii_22","jsCall_viiiiiiiiiiii_23","jsCall_viiiiiiiiiiii_24","jsCall_viiiiiiiiiiii_25","jsCall_viiiiiiiiiiii_26","jsCall_viiiiiiiiiiii_27","jsCall_viiiiiiiiiiii_28","jsCall_viiiiiiiiiiii_29","jsCall_viiiiiiiiiiii_30","jsCall_viiiiiiiiiiii_31","jsCall_viiiiiiiiiiii_32","jsCall_viiiiiiiiiiii_33","jsCall_viiiiiiiiiiii_34","_yuv2rgba32_full_X_c","_yuv2rgbx32_full_X_c","_yuv2argb32_full_X_c","_yuv2xrgb32_full_X_c","_yuv2bgra32_full_X_c","_yuv2bgrx32_full_X_c","_yuv2abgr32_full_X_c","_yuv2xbgr32_full_X_c","_yuv2rgba64le_full_X_c","_yuv2rgbx64le_full_X_c","_yuv2rgba64be_full_X_c","_yuv2rgbx64be_full_X_c","_yuv2bgra64le_full_X_c","_yuv2bgrx64le_full_X_c","_yuv2bgra64be_full_X_c","_yuv2bgrx64be_full_X_c","_yuv2rgb24_full_X_c","_yuv2bgr24_full_X_c","_yuv2rgb48le_full_X_c","_yuv2bgr48le_full_X_c","_yuv2rgb48be_full_X_c","_yuv2bgr48be_full_X_c","_yuv2bgr4_byte_full_X_c","_yuv2rgb4_byte_full_X_c","_yuv2bgr8_full_X_c","_yuv2rgb8_full_X_c","_yuv2gbrp_full_X_c","_yuv2gbrp16_full_X_c","_yuv2rgbx64le_X_c","_yuv2rgba64le_X_c","_yuv2rgbx64be_X_c","_yuv2rgba64be_X_c","_yuv2bgrx64le_X_c","_yuv2bgra64le_X_c","_yuv2bgrx64be_X_c","_yuv2bgra64be_X_c","_yuv2rgba32_X_c","_yuv2rgbx32_X_c","_yuv2rgba32_1_X_c","_yuv2rgbx32_1_X_c","_yuv2rgb16_X_c","_yuv2rgb15_X_c","_yuv2rgb12_X_c","_yuv2rgb8_X_c","_yuv2rgb4_X_c","_yuv2rgb4b_X_c","_yuv2rgb48le_X_c","_yuv2rgb48be_X_c","_yuv2bgr48le_X_c","_yuv2bgr48be_X_c","_yuv2rgb24_X_c","_yuv2bgr24_X_c","_yuv2monowhite_X_c","_yuv2ayuv64le_X_c","_yuv2monoblack_X_c","_yuv2yuyv422_X_c","_yuv2yvyu422_X_c","_yuv2uyvy422_X_c","_yuv2ya8_X_c","_yuv2ya16le_X_c","_yuv2ya16be_X_c","_sao_edge_restore_0_9","_sao_edge_restore_1_9","_sao_edge_restore_0_10","_sao_edge_restore_1_10","_sao_edge_restore_0_12","_sao_edge_restore_1_12","_sao_edge_restore_0_8","_sao_edge_restore_1_8",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];var debug_table_viiiiiiiiiiiiii=[0,"jsCall_viiiiiiiiiiiiii_0","jsCall_viiiiiiiiiiiiii_1","jsCall_viiiiiiiiiiiiii_2","jsCall_viiiiiiiiiiiiii_3","jsCall_viiiiiiiiiiiiii_4","jsCall_viiiiiiiiiiiiii_5","jsCall_viiiiiiiiiiiiii_6","jsCall_viiiiiiiiiiiiii_7","jsCall_viiiiiiiiiiiiii_8","jsCall_viiiiiiiiiiiiii_9","jsCall_viiiiiiiiiiiiii_10","jsCall_viiiiiiiiiiiiii_11","jsCall_viiiiiiiiiiiiii_12","jsCall_viiiiiiiiiiiiii_13","jsCall_viiiiiiiiiiiiii_14","jsCall_viiiiiiiiiiiiii_15","jsCall_viiiiiiiiiiiiii_16","jsCall_viiiiiiiiiiiiii_17","jsCall_viiiiiiiiiiiiii_18","jsCall_viiiiiiiiiiiiii_19","jsCall_viiiiiiiiiiiiii_20","jsCall_viiiiiiiiiiiiii_21","jsCall_viiiiiiiiiiiiii_22","jsCall_viiiiiiiiiiiiii_23","jsCall_viiiiiiiiiiiiii_24","jsCall_viiiiiiiiiiiiii_25","jsCall_viiiiiiiiiiiiii_26","jsCall_viiiiiiiiiiiiii_27","jsCall_viiiiiiiiiiiiii_28","jsCall_viiiiiiiiiiiiii_29","jsCall_viiiiiiiiiiiiii_30","jsCall_viiiiiiiiiiiiii_31","jsCall_viiiiiiiiiiiiii_32","jsCall_viiiiiiiiiiiiii_33","jsCall_viiiiiiiiiiiiii_34","_put_hevc_pel_bi_w_pixels_9","_put_hevc_qpel_bi_w_h_9","_put_hevc_qpel_bi_w_v_9","_put_hevc_qpel_bi_w_hv_9","_put_hevc_epel_bi_w_h_9","_put_hevc_epel_bi_w_v_9","_put_hevc_epel_bi_w_hv_9","_put_hevc_pel_bi_w_pixels_10","_put_hevc_qpel_bi_w_h_10","_put_hevc_qpel_bi_w_v_10","_put_hevc_qpel_bi_w_hv_10","_put_hevc_epel_bi_w_h_10","_put_hevc_epel_bi_w_v_10","_put_hevc_epel_bi_w_hv_10","_put_hevc_pel_bi_w_pixels_12","_put_hevc_qpel_bi_w_h_12","_put_hevc_qpel_bi_w_v_12","_put_hevc_qpel_bi_w_hv_12","_put_hevc_epel_bi_w_h_12","_put_hevc_epel_bi_w_v_12","_put_hevc_epel_bi_w_hv_12","_put_hevc_pel_bi_w_pixels_8","_put_hevc_qpel_bi_w_h_8","_put_hevc_qpel_bi_w_v_8","_put_hevc_qpel_bi_w_hv_8","_put_hevc_epel_bi_w_h_8","_put_hevc_epel_bi_w_v_8","_put_hevc_epel_bi_w_hv_8"];var debug_tables={"dd":debug_table_dd,"did":debug_table_did,"didd":debug_table_didd,"fii":debug_table_fii,"fiii":debug_table_fiii,"ii":debug_table_ii,"iid":debug_table_iid,"iidiiii":debug_table_iidiiii,"iii":debug_table_iii,"iiii":debug_table_iiii,"iiiii":debug_table_iiiii,"iiiiii":debug_table_iiiiii,"iiiiiii":debug_table_iiiiiii,"iiiiiiii":debug_table_iiiiiiii,"iiiiij":debug_table_iiiiij,"iiiji":debug_table_iiiji,"iiijjji":debug_table_iiijjji,"jiiij":debug_table_jiiij,"jiiji":debug_table_jiiji,"jiji":debug_table_jiji,"v":debug_table_v,"vdiidiiiii":debug_table_vdiidiiiii,"vi":debug_table_vi,"vii":debug_table_vii,"viidi":debug_table_viidi,"viifi":debug_table_viifi,"viii":debug_table_viii,"viiii":debug_table_viiii,"viiiid":debug_table_viiiid,"viiiifii":debug_table_viiiifii,"viiiii":debug_table_viiiii,"viiiiidd":debug_table_viiiiidd,"viiiiii":debug_table_viiiiii,"viiiiiifi":debug_table_viiiiiifi,"viiiiiii":debug_table_viiiiiii,"viiiiiiii":debug_table_viiiiiiii,"viiiiiiiid":debug_table_viiiiiiiid,"viiiiiiiidi":debug_table_viiiiiiiidi,"viiiiiiiii":debug_table_viiiiiiiii,"viiiiiiiiii":debug_table_viiiiiiiiii,"viiiiiiiiiii":debug_table_viiiiiiiiiii,"viiiiiiiiiiii":debug_table_viiiiiiiiiiii,"viiiiiiiiiiiiii":debug_table_viiiiiiiiiiiiii};function nullFunc_dd(x){abortFnPtrError(x,"dd")}function nullFunc_did(x){abortFnPtrError(x,"did")}function nullFunc_didd(x){abortFnPtrError(x,"didd")}function nullFunc_fii(x){abortFnPtrError(x,"fii")}function nullFunc_fiii(x){abortFnPtrError(x,"fiii")}function nullFunc_ii(x){abortFnPtrError(x,"ii")}function nullFunc_iid(x){abortFnPtrError(x,"iid")}function nullFunc_iidiiii(x){abortFnPtrError(x,"iidiiii")}function nullFunc_iii(x){abortFnPtrError(x,"iii")}function nullFunc_iiii(x){abortFnPtrError(x,"iiii")}function nullFunc_iiiii(x){abortFnPtrError(x,"iiiii")}function nullFunc_iiiiii(x){abortFnPtrError(x,"iiiiii")}function nullFunc_iiiiiii(x){abortFnPtrError(x,"iiiiiii")}function nullFunc_iiiiiiii(x){abortFnPtrError(x,"iiiiiiii")}function nullFunc_iiiiij(x){abortFnPtrError(x,"iiiiij")}function nullFunc_iiiji(x){abortFnPtrError(x,"iiiji")}function nullFunc_iiijjji(x){abortFnPtrError(x,"iiijjji")}function nullFunc_jiiij(x){abortFnPtrError(x,"jiiij")}function nullFunc_jiiji(x){abortFnPtrError(x,"jiiji")}function nullFunc_jiji(x){abortFnPtrError(x,"jiji")}function nullFunc_v(x){abortFnPtrError(x,"v")}function nullFunc_vdiidiiiii(x){abortFnPtrError(x,"vdiidiiiii")}function nullFunc_vi(x){abortFnPtrError(x,"vi")}function nullFunc_vii(x){abortFnPtrError(x,"vii")}function nullFunc_viidi(x){abortFnPtrError(x,"viidi")}function nullFunc_viifi(x){abortFnPtrError(x,"viifi")}function nullFunc_viii(x){abortFnPtrError(x,"viii")}function nullFunc_viiii(x){abortFnPtrError(x,"viiii")}function nullFunc_viiiid(x){abortFnPtrError(x,"viiiid")}function nullFunc_viiiifii(x){abortFnPtrError(x,"viiiifii")}function nullFunc_viiiii(x){abortFnPtrError(x,"viiiii")}function nullFunc_viiiiidd(x){abortFnPtrError(x,"viiiiidd")}function nullFunc_viiiiii(x){abortFnPtrError(x,"viiiiii")}function nullFunc_viiiiiifi(x){abortFnPtrError(x,"viiiiiifi")}function nullFunc_viiiiiii(x){abortFnPtrError(x,"viiiiiii")}function nullFunc_viiiiiiii(x){abortFnPtrError(x,"viiiiiiii")}function nullFunc_viiiiiiiid(x){abortFnPtrError(x,"viiiiiiiid")}function nullFunc_viiiiiiiidi(x){abortFnPtrError(x,"viiiiiiiidi")}function nullFunc_viiiiiiiii(x){abortFnPtrError(x,"viiiiiiiii")}function nullFunc_viiiiiiiiii(x){abortFnPtrError(x,"viiiiiiiiii")}function nullFunc_viiiiiiiiiii(x){abortFnPtrError(x,"viiiiiiiiiii")}function nullFunc_viiiiiiiiiiii(x){abortFnPtrError(x,"viiiiiiiiiiii")}function nullFunc_viiiiiiiiiiiiii(x){abortFnPtrError(x,"viiiiiiiiiiiiii")}function jsCall_dd(index,a1){return functionPointers[index](a1)}function jsCall_did(index,a1,a2){return functionPointers[index](a1,a2)}function jsCall_didd(index,a1,a2,a3){return functionPointers[index](a1,a2,a3)}function jsCall_fii(index,a1,a2){return functionPointers[index](a1,a2)}function jsCall_fiii(index,a1,a2,a3){return functionPointers[index](a1,a2,a3)}function jsCall_ii(index,a1){return functionPointers[index](a1)}function jsCall_iid(index,a1,a2){return functionPointers[index](a1,a2)}function jsCall_iidiiii(index,a1,a2,a3,a4,a5,a6){return functionPointers[index](a1,a2,a3,a4,a5,a6)}function jsCall_iii(index,a1,a2){return functionPointers[index](a1,a2)}function jsCall_iiii(index,a1,a2,a3){return functionPointers[index](a1,a2,a3)}function jsCall_iiiii(index,a1,a2,a3,a4){return functionPointers[index](a1,a2,a3,a4)}function jsCall_iiiiii(index,a1,a2,a3,a4,a5){return functionPointers[index](a1,a2,a3,a4,a5)}function jsCall_iiiiiii(index,a1,a2,a3,a4,a5,a6){return functionPointers[index](a1,a2,a3,a4,a5,a6)}function jsCall_iiiiiiii(index,a1,a2,a3,a4,a5,a6,a7){return functionPointers[index](a1,a2,a3,a4,a5,a6,a7)}function jsCall_iiiiij(index,a1,a2,a3,a4,a5){return functionPointers[index](a1,a2,a3,a4,a5)}function jsCall_iiiji(index,a1,a2,a3,a4){return functionPointers[index](a1,a2,a3,a4)}function jsCall_iiijjji(index,a1,a2,a3,a4,a5,a6){return functionPointers[index](a1,a2,a3,a4,a5,a6)}function jsCall_jiiij(index,a1,a2,a3,a4){return functionPointers[index](a1,a2,a3,a4)}function jsCall_jiiji(index,a1,a2,a3,a4){return functionPointers[index](a1,a2,a3,a4)}function jsCall_jiji(index,a1,a2,a3){return functionPointers[index](a1,a2,a3)}function jsCall_v(index){functionPointers[index]()}function jsCall_vdiidiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9){functionPointers[index](a1,a2,a3,a4,a5,a6,a7,a8,a9)}function jsCall_vi(index,a1){functionPointers[index](a1)}function jsCall_vii(index,a1,a2){functionPointers[index](a1,a2)}function jsCall_viidi(index,a1,a2,a3,a4){functionPointers[index](a1,a2,a3,a4)}function jsCall_viifi(index,a1,a2,a3,a4){functionPointers[index](a1,a2,a3,a4)}function jsCall_viii(index,a1,a2,a3){functionPointers[index](a1,a2,a3)}function jsCall_viiii(index,a1,a2,a3,a4){functionPointers[index](a1,a2,a3,a4)}function jsCall_viiiid(index,a1,a2,a3,a4,a5){functionPointers[index](a1,a2,a3,a4,a5)}function jsCall_viiiifii(index,a1,a2,a3,a4,a5,a6,a7){functionPointers[index](a1,a2,a3,a4,a5,a6,a7)}function jsCall_viiiii(index,a1,a2,a3,a4,a5){functionPointers[index](a1,a2,a3,a4,a5)}function jsCall_viiiiidd(index,a1,a2,a3,a4,a5,a6,a7){functionPointers[index](a1,a2,a3,a4,a5,a6,a7)}function jsCall_viiiiii(index,a1,a2,a3,a4,a5,a6){functionPointers[index](a1,a2,a3,a4,a5,a6)}function jsCall_viiiiiifi(index,a1,a2,a3,a4,a5,a6,a7,a8){functionPointers[index](a1,a2,a3,a4,a5,a6,a7,a8)}function jsCall_viiiiiii(index,a1,a2,a3,a4,a5,a6,a7){functionPointers[index](a1,a2,a3,a4,a5,a6,a7)}function jsCall_viiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8){functionPointers[index](a1,a2,a3,a4,a5,a6,a7,a8)}function jsCall_viiiiiiiid(index,a1,a2,a3,a4,a5,a6,a7,a8,a9){functionPointers[index](a1,a2,a3,a4,a5,a6,a7,a8,a9)}function jsCall_viiiiiiiidi(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10){functionPointers[index](a1,a2,a3,a4,a5,a6,a7,a8,a9,a10)}function jsCall_viiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9){functionPointers[index](a1,a2,a3,a4,a5,a6,a7,a8,a9)}function jsCall_viiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10){functionPointers[index](a1,a2,a3,a4,a5,a6,a7,a8,a9,a10)}function jsCall_viiiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11){functionPointers[index](a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11)}function jsCall_viiiiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12){functionPointers[index](a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12)}function jsCall_viiiiiiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14){functionPointers[index](a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14)}var asmGlobalArg={};var asmLibraryArg={"___buildEnvironment":___buildEnvironment,"___lock":___lock,"___syscall221":___syscall221,"___syscall3":___syscall3,"___syscall5":___syscall5,"___unlock":___unlock,"___wasi_fd_close":___wasi_fd_close,"___wasi_fd_fdstat_get":___wasi_fd_fdstat_get,"___wasi_fd_seek":___wasi_fd_seek,"___wasi_fd_write":___wasi_fd_write,"__emscripten_fetch_free":__emscripten_fetch_free,"__memory_base":1024,"__table_base":0,"_abort":_abort,"_clock":_clock,"_clock_gettime":_clock_gettime,"_emscripten_asm_const_i":_emscripten_asm_const_i,"_emscripten_get_heap_size":_emscripten_get_heap_size,"_emscripten_is_main_browser_thread":_emscripten_is_main_browser_thread,"_emscripten_memcpy_big":_emscripten_memcpy_big,"_emscripten_resize_heap":_emscripten_resize_heap,"_emscripten_start_fetch":_emscripten_start_fetch,"_fabs":_fabs,"_getenv":_getenv,"_gettimeofday":_gettimeofday,"_gmtime_r":_gmtime_r,"_llvm_exp2_f64":_llvm_exp2_f64,"_llvm_log2_f32":_llvm_log2_f32,"_llvm_stackrestore":_llvm_stackrestore,"_llvm_stacksave":_llvm_stacksave,"_llvm_trunc_f64":_llvm_trunc_f64,"_localtime_r":_localtime_r,"_nanosleep":_nanosleep,"_pthread_cond_destroy":_pthread_cond_destroy,"_pthread_cond_init":_pthread_cond_init,"_pthread_create":_pthread_create,"_pthread_join":_pthread_join,"_strftime":_strftime,"_sysconf":_sysconf,"_time":_time,"abortStackOverflow":abortStackOverflow,"getTempRet0":getTempRet0,"jsCall_dd":jsCall_dd,"jsCall_did":jsCall_did,"jsCall_didd":jsCall_didd,"jsCall_fii":jsCall_fii,"jsCall_fiii":jsCall_fiii,"jsCall_ii":jsCall_ii,"jsCall_iid":jsCall_iid,"jsCall_iidiiii":jsCall_iidiiii,"jsCall_iii":jsCall_iii,"jsCall_iiii":jsCall_iiii,"jsCall_iiiii":jsCall_iiiii,"jsCall_iiiiii":jsCall_iiiiii,"jsCall_iiiiiii":jsCall_iiiiiii,"jsCall_iiiiiiii":jsCall_iiiiiiii,"jsCall_iiiiij":jsCall_iiiiij,"jsCall_iiiji":jsCall_iiiji,"jsCall_iiijjji":jsCall_iiijjji,"jsCall_jiiij":jsCall_jiiij,"jsCall_jiiji":jsCall_jiiji,"jsCall_jiji":jsCall_jiji,"jsCall_v":jsCall_v,"jsCall_vdiidiiiii":jsCall_vdiidiiiii,"jsCall_vi":jsCall_vi,"jsCall_vii":jsCall_vii,"jsCall_viidi":jsCall_viidi,"jsCall_viifi":jsCall_viifi,"jsCall_viii":jsCall_viii,"jsCall_viiii":jsCall_viiii,"jsCall_viiiid":jsCall_viiiid,"jsCall_viiiifii":jsCall_viiiifii,"jsCall_viiiii":jsCall_viiiii,"jsCall_viiiiidd":jsCall_viiiiidd,"jsCall_viiiiii":jsCall_viiiiii,"jsCall_viiiiiifi":jsCall_viiiiiifi,"jsCall_viiiiiii":jsCall_viiiiiii,"jsCall_viiiiiiii":jsCall_viiiiiiii,"jsCall_viiiiiiiid":jsCall_viiiiiiiid,"jsCall_viiiiiiiidi":jsCall_viiiiiiiidi,"jsCall_viiiiiiiii":jsCall_viiiiiiiii,"jsCall_viiiiiiiiii":jsCall_viiiiiiiiii,"jsCall_viiiiiiiiiii":jsCall_viiiiiiiiiii,"jsCall_viiiiiiiiiiii":jsCall_viiiiiiiiiiii,"jsCall_viiiiiiiiiiiiii":jsCall_viiiiiiiiiiiiii,"memory":wasmMemory,"nullFunc_dd":nullFunc_dd,"nullFunc_did":nullFunc_did,"nullFunc_didd":nullFunc_didd,"nullFunc_fii":nullFunc_fii,"nullFunc_fiii":nullFunc_fiii,"nullFunc_ii":nullFunc_ii,"nullFunc_iid":nullFunc_iid,"nullFunc_iidiiii":nullFunc_iidiiii,"nullFunc_iii":nullFunc_iii,"nullFunc_iiii":nullFunc_iiii,"nullFunc_iiiii":nullFunc_iiiii,"nullFunc_iiiiii":nullFunc_iiiiii,"nullFunc_iiiiiii":nullFunc_iiiiiii,"nullFunc_iiiiiiii":nullFunc_iiiiiiii,"nullFunc_iiiiij":nullFunc_iiiiij,"nullFunc_iiiji":nullFunc_iiiji,"nullFunc_iiijjji":nullFunc_iiijjji,"nullFunc_jiiij":nullFunc_jiiij,"nullFunc_jiiji":nullFunc_jiiji,"nullFunc_jiji":nullFunc_jiji,"nullFunc_v":nullFunc_v,"nullFunc_vdiidiiiii":nullFunc_vdiidiiiii,"nullFunc_vi":nullFunc_vi,"nullFunc_vii":nullFunc_vii,"nullFunc_viidi":nullFunc_viidi,"nullFunc_viifi":nullFunc_viifi,"nullFunc_viii":nullFunc_viii,"nullFunc_viiii":nullFunc_viiii,"nullFunc_viiiid":nullFunc_viiiid,"nullFunc_viiiifii":nullFunc_viiiifii,"nullFunc_viiiii":nullFunc_viiiii,"nullFunc_viiiiidd":nullFunc_viiiiidd,"nullFunc_viiiiii":nullFunc_viiiiii,"nullFunc_viiiiiifi":nullFunc_viiiiiifi,"nullFunc_viiiiiii":nullFunc_viiiiiii,"nullFunc_viiiiiiii":nullFunc_viiiiiiii,"nullFunc_viiiiiiiid":nullFunc_viiiiiiiid,"nullFunc_viiiiiiiidi":nullFunc_viiiiiiiidi,"nullFunc_viiiiiiiii":nullFunc_viiiiiiiii,"nullFunc_viiiiiiiiii":nullFunc_viiiiiiiiii,"nullFunc_viiiiiiiiiii":nullFunc_viiiiiiiiiii,"nullFunc_viiiiiiiiiiii":nullFunc_viiiiiiiiiiii,"nullFunc_viiiiiiiiiiiiii":nullFunc_viiiiiiiiiiiiii,"table":wasmTable};var asm=Module["asm"](asmGlobalArg,asmLibraryArg,buffer);Module["asm"]=asm;var _AVSniffHttpFlvInit=Module["_AVSniffHttpFlvInit"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["_AVSniffHttpFlvInit"].apply(null,arguments)};var _AVSniffStreamInit=Module["_AVSniffStreamInit"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["_AVSniffStreamInit"].apply(null,arguments)};var ___emscripten_environ_constructor=Module["___emscripten_environ_constructor"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["___emscripten_environ_constructor"].apply(null,arguments)};var ___errno_location=Module["___errno_location"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["___errno_location"].apply(null,arguments)};var __get_daylight=Module["__get_daylight"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["__get_daylight"].apply(null,arguments)};var __get_timezone=Module["__get_timezone"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["__get_timezone"].apply(null,arguments)};var __get_tzname=Module["__get_tzname"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["__get_tzname"].apply(null,arguments)};var _closeVideo=Module["_closeVideo"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["_closeVideo"].apply(null,arguments)};var _decodeCodecContext=Module["_decodeCodecContext"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["_decodeCodecContext"].apply(null,arguments)};var _decodeHttpFlvVideoFrame=Module["_decodeHttpFlvVideoFrame"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["_decodeHttpFlvVideoFrame"].apply(null,arguments)};var _decodeVideoFrame=Module["_decodeVideoFrame"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["_decodeVideoFrame"].apply(null,arguments)};var _demuxBox=Module["_demuxBox"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["_demuxBox"].apply(null,arguments)};var _exitMissile=Module["_exitMissile"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["_exitMissile"].apply(null,arguments)};var _exitTsMissile=Module["_exitTsMissile"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["_exitTsMissile"].apply(null,arguments)};var _fflush=Module["_fflush"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["_fflush"].apply(null,arguments)};var _free=Module["_free"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["_free"].apply(null,arguments)};var _getAudioCodecID=Module["_getAudioCodecID"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["_getAudioCodecID"].apply(null,arguments)};var _getBufferLengthApi=Module["_getBufferLengthApi"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["_getBufferLengthApi"].apply(null,arguments)};var _getExtensionInfo=Module["_getExtensionInfo"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["_getExtensionInfo"].apply(null,arguments)};var _getMediaInfo=Module["_getMediaInfo"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["_getMediaInfo"].apply(null,arguments)};var _getPPS=Module["_getPPS"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["_getPPS"].apply(null,arguments)};var _getPPSLen=Module["_getPPSLen"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["_getPPSLen"].apply(null,arguments)};var _getPacket=Module["_getPacket"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["_getPacket"].apply(null,arguments)};var _getSEI=Module["_getSEI"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["_getSEI"].apply(null,arguments)};var _getSEILen=Module["_getSEILen"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["_getSEILen"].apply(null,arguments)};var _getSPS=Module["_getSPS"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["_getSPS"].apply(null,arguments)};var _getSPSLen=Module["_getSPSLen"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["_getSPSLen"].apply(null,arguments)};var _getSniffHttpFlvPkg=Module["_getSniffHttpFlvPkg"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["_getSniffHttpFlvPkg"].apply(null,arguments)};var _getSniffHttpFlvPkgNoCheckProbe=Module["_getSniffHttpFlvPkgNoCheckProbe"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["_getSniffHttpFlvPkgNoCheckProbe"].apply(null,arguments)};var _getSniffStreamPkg=Module["_getSniffStreamPkg"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["_getSniffStreamPkg"].apply(null,arguments)};var _getSniffStreamPkgNoCheckProbe=Module["_getSniffStreamPkgNoCheckProbe"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["_getSniffStreamPkgNoCheckProbe"].apply(null,arguments)};var _getVLC=Module["_getVLC"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["_getVLC"].apply(null,arguments)};var _getVLCLen=Module["_getVLCLen"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["_getVLCLen"].apply(null,arguments)};var _getVPS=Module["_getVPS"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["_getVPS"].apply(null,arguments)};var _getVPSLen=Module["_getVPSLen"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["_getVPSLen"].apply(null,arguments)};var _getVideoCodecID=Module["_getVideoCodecID"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["_getVideoCodecID"].apply(null,arguments)};var _initMissile=Module["_initMissile"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["_initMissile"].apply(null,arguments)};var _initTsMissile=Module["_initTsMissile"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["_initTsMissile"].apply(null,arguments)};var _initializeDecoder=Module["_initializeDecoder"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["_initializeDecoder"].apply(null,arguments)};var _initializeDemuxer=Module["_initializeDemuxer"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["_initializeDemuxer"].apply(null,arguments)};var _initializeSniffHttpFlvModule=Module["_initializeSniffHttpFlvModule"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["_initializeSniffHttpFlvModule"].apply(null,arguments)};var _initializeSniffHttpFlvModuleWithAOpt=Module["_initializeSniffHttpFlvModuleWithAOpt"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["_initializeSniffHttpFlvModuleWithAOpt"].apply(null,arguments)};var _initializeSniffStreamModule=Module["_initializeSniffStreamModule"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["_initializeSniffStreamModule"].apply(null,arguments)};var _initializeSniffStreamModuleWithAOpt=Module["_initializeSniffStreamModuleWithAOpt"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["_initializeSniffStreamModuleWithAOpt"].apply(null,arguments)};var _main=Module["_main"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["_main"].apply(null,arguments)};var _malloc=Module["_malloc"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["_malloc"].apply(null,arguments)};var _pushSniffHttpFlvData=Module["_pushSniffHttpFlvData"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["_pushSniffHttpFlvData"].apply(null,arguments)};var _pushSniffStreamData=Module["_pushSniffStreamData"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["_pushSniffStreamData"].apply(null,arguments)};var _registerPlayer=Module["_registerPlayer"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["_registerPlayer"].apply(null,arguments)};var _release=Module["_release"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["_release"].apply(null,arguments)};var _releaseHttpFLV=Module["_releaseHttpFLV"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["_releaseHttpFLV"].apply(null,arguments)};var _releaseSniffHttpFlv=Module["_releaseSniffHttpFlv"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["_releaseSniffHttpFlv"].apply(null,arguments)};var _releaseSniffStream=Module["_releaseSniffStream"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["_releaseSniffStream"].apply(null,arguments)};var _setCodecType=Module["_setCodecType"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["_setCodecType"].apply(null,arguments)};var establishStackSpace=Module["establishStackSpace"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["establishStackSpace"].apply(null,arguments)};var stackAlloc=Module["stackAlloc"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["stackAlloc"].apply(null,arguments)};var stackRestore=Module["stackRestore"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["stackRestore"].apply(null,arguments)};var stackSave=Module["stackSave"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["stackSave"].apply(null,arguments)};var dynCall_v=Module["dynCall_v"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["dynCall_v"].apply(null,arguments)};var dynCall_vi=Module["dynCall_vi"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["dynCall_vi"].apply(null,arguments)};Module["asm"]=asm;if(!Object.getOwnPropertyDescriptor(Module,"intArrayFromString"))Module["intArrayFromString"]=function(){abort("'intArrayFromString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"intArrayToString"))Module["intArrayToString"]=function(){abort("'intArrayToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};Module["ccall"]=ccall;Module["cwrap"]=cwrap;if(!Object.getOwnPropertyDescriptor(Module,"setValue"))Module["setValue"]=function(){abort("'setValue' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"getValue"))Module["getValue"]=function(){abort("'getValue' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"allocate"))Module["allocate"]=function(){abort("'allocate' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"getMemory"))Module["getMemory"]=function(){abort("'getMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"AsciiToString"))Module["AsciiToString"]=function(){abort("'AsciiToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stringToAscii"))Module["stringToAscii"]=function(){abort("'stringToAscii' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"UTF8ArrayToString"))Module["UTF8ArrayToString"]=function(){abort("'UTF8ArrayToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"UTF8ToString"))Module["UTF8ToString"]=function(){abort("'UTF8ToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stringToUTF8Array"))Module["stringToUTF8Array"]=function(){abort("'stringToUTF8Array' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stringToUTF8"))Module["stringToUTF8"]=function(){abort("'stringToUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"lengthBytesUTF8"))Module["lengthBytesUTF8"]=function(){abort("'lengthBytesUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"UTF16ToString"))Module["UTF16ToString"]=function(){abort("'UTF16ToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stringToUTF16"))Module["stringToUTF16"]=function(){abort("'stringToUTF16' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"lengthBytesUTF16"))Module["lengthBytesUTF16"]=function(){abort("'lengthBytesUTF16' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"UTF32ToString"))Module["UTF32ToString"]=function(){abort("'UTF32ToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stringToUTF32"))Module["stringToUTF32"]=function(){abort("'stringToUTF32' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"lengthBytesUTF32"))Module["lengthBytesUTF32"]=function(){abort("'lengthBytesUTF32' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"allocateUTF8"))Module["allocateUTF8"]=function(){abort("'allocateUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stackTrace"))Module["stackTrace"]=function(){abort("'stackTrace' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"addOnPreRun"))Module["addOnPreRun"]=function(){abort("'addOnPreRun' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"addOnInit"))Module["addOnInit"]=function(){abort("'addOnInit' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"addOnPreMain"))Module["addOnPreMain"]=function(){abort("'addOnPreMain' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"addOnExit"))Module["addOnExit"]=function(){abort("'addOnExit' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"addOnPostRun"))Module["addOnPostRun"]=function(){abort("'addOnPostRun' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"writeStringToMemory"))Module["writeStringToMemory"]=function(){abort("'writeStringToMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"writeArrayToMemory"))Module["writeArrayToMemory"]=function(){abort("'writeArrayToMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"writeAsciiToMemory"))Module["writeAsciiToMemory"]=function(){abort("'writeAsciiToMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"addRunDependency"))Module["addRunDependency"]=function(){abort("'addRunDependency' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"removeRunDependency"))Module["removeRunDependency"]=function(){abort("'removeRunDependency' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"ENV"))Module["ENV"]=function(){abort("'ENV' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"FS"))Module["FS"]=function(){abort("'FS' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"FS_createFolder"))Module["FS_createFolder"]=function(){abort("'FS_createFolder' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"FS_createPath"))Module["FS_createPath"]=function(){abort("'FS_createPath' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"FS_createDataFile"))Module["FS_createDataFile"]=function(){abort("'FS_createDataFile' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"FS_createPreloadedFile"))Module["FS_createPreloadedFile"]=function(){abort("'FS_createPreloadedFile' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"FS_createLazyFile"))Module["FS_createLazyFile"]=function(){abort("'FS_createLazyFile' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"FS_createLink"))Module["FS_createLink"]=function(){abort("'FS_createLink' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"FS_createDevice"))Module["FS_createDevice"]=function(){abort("'FS_createDevice' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"FS_unlink"))Module["FS_unlink"]=function(){abort("'FS_unlink' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"GL"))Module["GL"]=function(){abort("'GL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"dynamicAlloc"))Module["dynamicAlloc"]=function(){abort("'dynamicAlloc' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"loadDynamicLibrary"))Module["loadDynamicLibrary"]=function(){abort("'loadDynamicLibrary' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"loadWebAssemblyModule"))Module["loadWebAssemblyModule"]=function(){abort("'loadWebAssemblyModule' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"getLEB"))Module["getLEB"]=function(){abort("'getLEB' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"getFunctionTables"))Module["getFunctionTables"]=function(){abort("'getFunctionTables' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"alignFunctionTables"))Module["alignFunctionTables"]=function(){abort("'alignFunctionTables' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"registerFunctions"))Module["registerFunctions"]=function(){abort("'registerFunctions' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};Module["addFunction"]=addFunction;Module["removeFunction"]=removeFunction;if(!Object.getOwnPropertyDescriptor(Module,"getFuncWrapper"))Module["getFuncWrapper"]=function(){abort("'getFuncWrapper' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"prettyPrint"))Module["prettyPrint"]=function(){abort("'prettyPrint' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"makeBigInt"))Module["makeBigInt"]=function(){abort("'makeBigInt' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"dynCall"))Module["dynCall"]=function(){abort("'dynCall' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"getCompilerSetting"))Module["getCompilerSetting"]=function(){abort("'getCompilerSetting' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stackSave"))Module["stackSave"]=function(){abort("'stackSave' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stackRestore"))Module["stackRestore"]=function(){abort("'stackRestore' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stackAlloc"))Module["stackAlloc"]=function(){abort("'stackAlloc' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"establishStackSpace"))Module["establishStackSpace"]=function(){abort("'establishStackSpace' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"print"))Module["print"]=function(){abort("'print' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"printErr"))Module["printErr"]=function(){abort("'printErr' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"getTempRet0"))Module["getTempRet0"]=function(){abort("'getTempRet0' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"setTempRet0"))Module["setTempRet0"]=function(){abort("'setTempRet0' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"callMain"))Module["callMain"]=function(){abort("'callMain' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"abort"))Module["abort"]=function(){abort("'abort' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"Pointer_stringify"))Module["Pointer_stringify"]=function(){abort("'Pointer_stringify' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"warnOnce"))Module["warnOnce"]=function(){abort("'warnOnce' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"ALLOC_NORMAL"))Object.defineProperty(Module,"ALLOC_NORMAL",{configurable:true,get:function(){abort("'ALLOC_NORMAL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}});if(!Object.getOwnPropertyDescriptor(Module,"ALLOC_STACK"))Object.defineProperty(Module,"ALLOC_STACK",{configurable:true,get:function(){abort("'ALLOC_STACK' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}});if(!Object.getOwnPropertyDescriptor(Module,"ALLOC_DYNAMIC"))Object.defineProperty(Module,"ALLOC_DYNAMIC",{configurable:true,get:function(){abort("'ALLOC_DYNAMIC' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}});if(!Object.getOwnPropertyDescriptor(Module,"ALLOC_NONE"))Object.defineProperty(Module,"ALLOC_NONE",{configurable:true,get:function(){abort("'ALLOC_NONE' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}});if(!Object.getOwnPropertyDescriptor(Module,"calledRun"))Object.defineProperty(Module,"calledRun",{configurable:true,get:function(){abort("'calledRun' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")}});var calledRun;function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}var calledMain=false;dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function callMain(args){assert(runDependencies==0,'cannot call main when async dependencies remain! (listen on Module["onRuntimeInitialized"])');assert(__ATPRERUN__.length==0,"cannot call main when preRun functions remain to be called");args=args||[];var argc=args.length+1;var argv=stackAlloc((argc+1)*4);HEAP32[argv>>2]=allocateUTF8OnStack(thisProgram);for(var i=1;i>2)+i]=allocateUTF8OnStack(args[i-1])}HEAP32[(argv>>2)+argc]=0;try{var ret=Module["_main"](argc,argv);exit(ret,true)}catch(e){if(e instanceof ExitStatus){return}else if(e=="SimulateInfiniteLoop"){noExitRuntime=true;return}else{var toLog=e;if(e&&typeof e==="object"&&e.stack){toLog=[e,e.stack]}err("exception thrown: "+toLog);quit_(1,e)}}finally{calledMain=true}}function run(args){args=args||arguments_;if(runDependencies>0){return}writeStackCookie();preRun();if(runDependencies>0)return;function doRun(){if(calledRun)return;calledRun=true;if(ABORT)return;initRuntime();preMain();if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();if(shouldRunNow)callMain(args);postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}checkStackCookie()}Module["run"]=run;function checkUnflushedContent(){var print=out;var printErr=err;var has=false;out=err=function(x){has=true};try{var flush=Module["_fflush"];if(flush)flush(0);["stdout","stderr"].forEach(function(name){var info=FS.analyzePath("/dev/"+name);if(!info)return;var stream=info.object;var rdev=stream.rdev;var tty=TTY.ttys[rdev];if(tty&&tty.output&&tty.output.length){has=true}})}catch(e){}out=print;err=printErr;if(has){warnOnce("stdio streams had content in them that was not flushed. you should set EXIT_RUNTIME to 1 (see the FAQ), or make sure to emit a newline when you printf etc.")}}function exit(status,implicit){checkUnflushedContent();if(implicit&&noExitRuntime&&status===0){return}if(noExitRuntime){if(!implicit){err("exit("+status+") called, but EXIT_RUNTIME is not set, so halting execution but not exiting the runtime or preventing further async execution (build with EXIT_RUNTIME=1, if you want a true shutdown)")}}else{ABORT=true;EXITSTATUS=status;exitRuntime();if(Module["onExit"])Module["onExit"](status)}quit_(status,new ExitStatus(status))}if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}var shouldRunNow=true;if(Module["noInitialRun"])shouldRunNow=false;noExitRuntime=true;run(); diff --git a/src/src/decoder/missile-512mb.js b/src/src/decoder/missile-512mb.js deleted file mode 100644 index 2642ae69..00000000 --- a/src/src/decoder/missile-512mb.js +++ /dev/null @@ -1,2 +0,0 @@ -var ENVIRONMENT_IS_PTHREAD = true; -var Module=typeof Module!=="undefined"?Module:{};var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var arguments_=[];var thisProgram="./this.program";var quit_=function(status,toThrow){throw toThrow};var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_HAS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_HAS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";ENVIRONMENT_IS_NODE=ENVIRONMENT_HAS_NODE&&!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_WORKER;ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;if(Module["ENVIRONMENT"]){throw new Error("Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -s ENVIRONMENT=web or -s ENVIRONMENT=node)")}var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;if(ENVIRONMENT_IS_NODE){scriptDirectory=__dirname+"/";var nodeFS;var nodePath;read_=function shell_read(filename,binary){var ret;if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);ret=nodeFS["readFileSync"](filename);return binary?ret:ret.toString()};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};if(process["argv"].length>1){thisProgram=process["argv"][1].replace(/\\/g,"/")}arguments_=process["argv"].slice(2);if(typeof module!=="undefined"){module["exports"]=Module}process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",abort);quit_=function(status){process["exit"](status)};Module["inspect"]=function(){return"[Emscripten Module object]"}}else if(ENVIRONMENT_IS_SHELL){if(typeof read!="undefined"){read_=function shell_read(f){return read(f)}}readBinary=function readBinary(f){var data;if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){arguments_=scriptArgs}else if(typeof arguments!="undefined"){arguments_=arguments}if(typeof quit==="function"){quit_=function(status){quit(status)}}if(typeof print!=="undefined"){if(typeof console==="undefined")console={};console.log=print;console.warn=console.error=typeof printErr!=="undefined"?printErr:print}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(document.currentScript){scriptDirectory=document.currentScript.src}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf("/")+1)}else{scriptDirectory=""}read_=function shell_read(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=function readBinary(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=function readAsync(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function xhr_onload(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)};setWindowTitle=function(title){document.title=title}}else{throw new Error("environment detection error")}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(!Object.getOwnPropertyDescriptor(Module,"arguments"))Object.defineProperty(Module,"arguments",{configurable:true,get:function(){abort("Module.arguments has been replaced with plain arguments_")}});if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(!Object.getOwnPropertyDescriptor(Module,"thisProgram"))Object.defineProperty(Module,"thisProgram",{configurable:true,get:function(){abort("Module.thisProgram has been replaced with plain thisProgram")}});if(Module["quit"])quit_=Module["quit"];if(!Object.getOwnPropertyDescriptor(Module,"quit"))Object.defineProperty(Module,"quit",{configurable:true,get:function(){abort("Module.quit has been replaced with plain quit_")}});assert(typeof Module["memoryInitializerPrefixURL"]==="undefined","Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead");assert(typeof Module["pthreadMainPrefixURL"]==="undefined","Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead");assert(typeof Module["cdInitializerPrefixURL"]==="undefined","Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead");assert(typeof Module["filePackagePrefixURL"]==="undefined","Module.filePackagePrefixURL option was removed, use Module.locateFile instead");assert(typeof Module["read"]==="undefined","Module.read option was removed (modify read_ in JS)");assert(typeof Module["readAsync"]==="undefined","Module.readAsync option was removed (modify readAsync in JS)");assert(typeof Module["readBinary"]==="undefined","Module.readBinary option was removed (modify readBinary in JS)");assert(typeof Module["setWindowTitle"]==="undefined","Module.setWindowTitle option was removed (modify setWindowTitle in JS)");if(!Object.getOwnPropertyDescriptor(Module,"read"))Object.defineProperty(Module,"read",{configurable:true,get:function(){abort("Module.read has been replaced with plain read_")}});if(!Object.getOwnPropertyDescriptor(Module,"readAsync"))Object.defineProperty(Module,"readAsync",{configurable:true,get:function(){abort("Module.readAsync has been replaced with plain readAsync")}});if(!Object.getOwnPropertyDescriptor(Module,"readBinary"))Object.defineProperty(Module,"readBinary",{configurable:true,get:function(){abort("Module.readBinary has been replaced with plain readBinary")}});stackSave=stackRestore=stackAlloc=function(){abort("cannot use the stack before compiled code is ready to run, and has provided stack access")};function dynamicAlloc(size){assert(DYNAMICTOP_PTR);var ret=HEAP32[DYNAMICTOP_PTR>>2];var end=ret+size+15&-16;if(end>_emscripten_get_heap_size()){abort("failure to dynamicAlloc - memory growth etc. is not supported there, call malloc/sbrk directly")}HEAP32[DYNAMICTOP_PTR>>2]=end;return ret}function getNativeTypeSize(type){switch(type){case"i1":case"i8":return 1;case"i16":return 2;case"i32":return 4;case"i64":return 8;case"float":return 4;case"double":return 8;default:{if(type[type.length-1]==="*"){return 4}else if(type[0]==="i"){var bits=parseInt(type.substr(1));assert(bits%8===0,"getNativeTypeSize invalid bits "+bits+", type "+type);return bits/8}else{return 0}}}}function warnOnce(text){if(!warnOnce.shown)warnOnce.shown={};if(!warnOnce.shown[text]){warnOnce.shown[text]=1;err(text)}}var asm2wasmImports={"f64-rem":function(x,y){return x%y},"debugger":function(){debugger}};var jsCallStartIndex=1;var functionPointers=new Array(35);function addFunction(func,sig){assert(typeof func!=="undefined");var base=0;for(var i=base;i>0]=value;break;case"i8":HEAP8[ptr>>0]=value;break;case"i16":HEAP16[ptr>>1]=value;break;case"i32":HEAP32[ptr>>2]=value;break;case"i64":tempI64=[value>>>0,(tempDouble=value,+Math_abs(tempDouble)>=1?tempDouble>0?(Math_min(+Math_floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math_ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[ptr>>2]=tempI64[0],HEAP32[ptr+4>>2]=tempI64[1];break;case"float":HEAPF32[ptr>>2]=value;break;case"double":HEAPF64[ptr>>3]=value;break;default:abort("invalid type for setValue: "+type)}}var wasmMemory;var wasmTable=new WebAssembly.Table({"initial":4416,"element":"anyfunc"});var ABORT=false;var EXITSTATUS=0;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}function getCFunc(ident){var func=Module["_"+ident];assert(func,"Cannot call unknown function "+ident+", make sure it is exported");return func}function ccall(ident,returnType,argTypes,args,opts){var toC={"string":function(str){var ret=0;if(str!==null&&str!==undefined&&str!==0){var len=(str.length<<2)+1;ret=stackAlloc(len);stringToUTF8(str,ret,len)}return ret},"array":function(arr){var ret=stackAlloc(arr.length);writeArrayToMemory(arr,ret);return ret}};function convertReturnValue(ret){if(returnType==="string")return UTF8ToString(ret);if(returnType==="boolean")return Boolean(ret);return ret}var func=getCFunc(ident);var cArgs=[];var stack=0;assert(returnType!=="array",'Return type should not be "array".');if(args){for(var i=0;i>2]=0}stop=ret+size;while(ptr>0]=0}return ret}if(singleType==="i8"){if(slab.subarray||slab.slice){HEAPU8.set(slab,ret)}else{HEAPU8.set(new Uint8Array(slab),ret)}return ret}var i=0,type,typeSize,previousType;while(i=endIdx))++endPtr;if(endPtr-idx>16&&u8Array.subarray&&UTF8Decoder){return UTF8Decoder.decode(u8Array.subarray(idx,endPtr))}else{var str="";while(idx>10,56320|ch&1023)}}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""}function stringToUTF8Array(str,outU8Array,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;outU8Array[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;outU8Array[outIdx++]=192|u>>6;outU8Array[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;outU8Array[outIdx++]=224|u>>12;outU8Array[outIdx++]=128|u>>6&63;outU8Array[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;if(u>=2097152)warnOnce("Invalid Unicode code point 0x"+u.toString(16)+" encountered when serializing a JS string to an UTF-8 string on the asm.js/wasm heap! (Valid unicode code points should be in range 0-0x1FFFFF).");outU8Array[outIdx++]=240|u>>18;outU8Array[outIdx++]=128|u>>12&63;outU8Array[outIdx++]=128|u>>6&63;outU8Array[outIdx++]=128|u&63}}outU8Array[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){assert(typeof maxBytesToWrite=="number","stringToUTF8(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!");return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127)++len;else if(u<=2047)len+=2;else if(u<=65535)len+=3;else len+=4}return len}var UTF16Decoder=typeof TextDecoder!=="undefined"?new TextDecoder("utf-16le"):undefined;function allocateUTF8(str){var size=lengthBytesUTF8(str)+1;var ret=_malloc(size);if(ret)stringToUTF8Array(str,HEAP8,ret,size);return ret}function allocateUTF8OnStack(str){var size=lengthBytesUTF8(str)+1;var ret=stackAlloc(size);stringToUTF8Array(str,HEAP8,ret,size);return ret}function writeArrayToMemory(array,buffer){assert(array.length>=0,"writeArrayToMemory array must have a length (should be an array or typed array)");HEAP8.set(array,buffer)}function writeAsciiToMemory(str,buffer,dontAddNull){for(var i=0;i>0]=str.charCodeAt(i)}if(!dontAddNull)HEAP8[buffer>>0]=0}var PAGE_SIZE=16384;var WASM_PAGE_SIZE=65536;function alignUp(x,multiple){if(x%multiple>0){x+=multiple-x%multiple}return x}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;function updateGlobalBufferAndViews(buf){buffer=buf;Module["HEAP8"]=HEAP8=new Int8Array(buf);Module["HEAP16"]=HEAP16=new Int16Array(buf);Module["HEAP32"]=HEAP32=new Int32Array(buf);Module["HEAPU8"]=HEAPU8=new Uint8Array(buf);Module["HEAPU16"]=HEAPU16=new Uint16Array(buf);Module["HEAPU32"]=HEAPU32=new Uint32Array(buf);Module["HEAPF32"]=HEAPF32=new Float32Array(buf);Module["HEAPF64"]=HEAPF64=new Float64Array(buf)}var STACK_BASE=1128400,STACK_MAX=6371280,DYNAMIC_BASE=6371280,DYNAMICTOP_PTR=1128176;assert(STACK_BASE%16===0,"stack must start aligned");assert(DYNAMIC_BASE%16===0,"heap must start aligned");var TOTAL_STACK=5242880;if(Module["TOTAL_STACK"])assert(TOTAL_STACK===Module["TOTAL_STACK"],"the stack size can no longer be determined at runtime");var INITIAL_TOTAL_MEMORY=Module["TOTAL_MEMORY"]||536870912;if(!Object.getOwnPropertyDescriptor(Module,"TOTAL_MEMORY"))Object.defineProperty(Module,"TOTAL_MEMORY",{configurable:true,get:function(){abort("Module.TOTAL_MEMORY has been replaced with plain INITIAL_TOTAL_MEMORY")}});assert(INITIAL_TOTAL_MEMORY>=TOTAL_STACK,"TOTAL_MEMORY should be larger than TOTAL_STACK, was "+INITIAL_TOTAL_MEMORY+"! (TOTAL_STACK="+TOTAL_STACK+")");assert(typeof Int32Array!=="undefined"&&typeof Float64Array!=="undefined"&&Int32Array.prototype.subarray!==undefined&&Int32Array.prototype.set!==undefined,"JS engine does not provide full typed array support");if(Module["wasmMemory"]){wasmMemory=Module["wasmMemory"]}else{wasmMemory=new WebAssembly.Memory({"initial":INITIAL_TOTAL_MEMORY/WASM_PAGE_SIZE})}if(wasmMemory){buffer=wasmMemory.buffer}INITIAL_TOTAL_MEMORY=buffer.byteLength;assert(INITIAL_TOTAL_MEMORY%WASM_PAGE_SIZE===0);updateGlobalBufferAndViews(buffer);HEAP32[DYNAMICTOP_PTR>>2]=DYNAMIC_BASE;function writeStackCookie(){assert((STACK_MAX&3)==0);HEAPU32[(STACK_MAX>>2)-1]=34821223;HEAPU32[(STACK_MAX>>2)-2]=2310721022;HEAP32[0]=1668509029}function checkStackCookie(){var cookie1=HEAPU32[(STACK_MAX>>2)-1];var cookie2=HEAPU32[(STACK_MAX>>2)-2];if(cookie1!=34821223||cookie2!=2310721022){abort("Stack overflow! Stack cookie has been overwritten, expected hex dwords 0x89BACDFE and 0x02135467, but received 0x"+cookie2.toString(16)+" "+cookie1.toString(16))}if(HEAP32[0]!==1668509029)abort("Runtime error: The application has corrupted its heap memory area (address zero)!")}function abortStackOverflow(allocSize){abort("Stack overflow! Attempted to allocate "+allocSize+" bytes on the stack, but stack has only "+(STACK_MAX-stackSave()+allocSize)+" bytes available!")}(function(){var h16=new Int16Array(1);var h8=new Int8Array(h16.buffer);h16[0]=25459;if(h8[0]!==115||h8[1]!==99)throw"Runtime error: expected the system to be little-endian!"})();function abortFnPtrError(ptr,sig){var possibleSig="";for(var x in debug_tables){var tbl=debug_tables[x];if(tbl[ptr]){possibleSig+='as sig "'+x+'" pointing to function '+tbl[ptr]+", "}}abort("Invalid function pointer "+ptr+" called with signature '"+sig+"'. Perhaps this is an invalid value (e.g. caused by calling a virtual method on a NULL pointer)? Or calling a function with an incorrect type, which will fail? (it is worth building your source files with -Werror (warnings are errors), as warnings can indicate undefined behavior which can cause this). This pointer might make sense in another type signature: "+possibleSig)}function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback=="function"){callback();continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){Module["dynCall_v"](func)}else{Module["dynCall_vi"](func,callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;var runtimeExited=false;function preRun(){if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){checkStackCookie();assert(!runtimeInitialized);runtimeInitialized=true;if(!Module["noFSInit"]&&!FS.init.initialized)FS.init();TTY.init();callRuntimeCallbacks(__ATINIT__)}function preMain(){checkStackCookie();FS.ignorePermissions=false;callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){checkStackCookie();runtimeExited=true}function postRun(){checkStackCookie();if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}assert(Math.imul,"This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");assert(Math.fround,"This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");assert(Math.clz32,"This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");assert(Math.trunc,"This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");var Math_abs=Math.abs;var Math_ceil=Math.ceil;var Math_floor=Math.floor;var Math_min=Math.min;var Math_trunc=Math.trunc;var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;var runDependencyTracking={};function getUniqueRunDependency(id){var orig=id;while(1){if(!runDependencyTracking[id])return id;id=orig+Math.random()}return id}function addRunDependency(id){runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(id){assert(!runDependencyTracking[id]);runDependencyTracking[id]=1;if(runDependencyWatcher===null&&typeof setInterval!=="undefined"){runDependencyWatcher=setInterval(function(){if(ABORT){clearInterval(runDependencyWatcher);runDependencyWatcher=null;return}var shown=false;for(var dep in runDependencyTracking){if(!shown){shown=true;err("still waiting on run dependencies:")}err("dependency: "+dep)}if(shown){err("(end of list)")}},1e4)}}else{err("warning: run dependency added without ID")}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(id){assert(runDependencyTracking[id]);delete runDependencyTracking[id]}else{err("warning: run dependency removed without ID")}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}what+="";out(what);err(what);ABORT=true;EXITSTATUS=1;var extra="";var output="abort("+what+") at "+stackTrace()+extra;throw output}if(!ENVIRONMENT_IS_PTHREAD)addOnPreRun(function(){if(typeof SharedArrayBuffer!=="undefined"){addRunDependency("pthreads");PThread.allocateUnusedWorkers(5,function(){removeRunDependency("pthreads")})}});var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return String.prototype.startsWith?filename.startsWith(dataURIPrefix):filename.indexOf(dataURIPrefix)===0}var wasmBinaryFile="missile-512mb-v20211120.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(){try{if(wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(wasmBinaryFile)}else{throw"both async and sync fetching of the wasm failed"}}catch(err){abort(err)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)&&typeof fetch==="function"){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw"failed to load wasm binary file at '"+wasmBinaryFile+"'"}return response["arrayBuffer"]()}).catch(function(){return getBinary()})}return new Promise(function(resolve,reject){resolve(getBinary())})}function createWasm(){var info={"env":asmLibraryArg,"wasi_unstable":asmLibraryArg,"global":{"NaN":NaN,Infinity:Infinity},"global.Math":Math,"asm2wasm":asm2wasmImports};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;removeRunDependency("wasm-instantiate")}addRunDependency("wasm-instantiate");var trueModule=Module;function receiveInstantiatedSource(output){assert(Module===trueModule,"the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?");trueModule=null;receiveInstance(output["instance"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){return WebAssembly.instantiate(binary,info)}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming==="function"&&!isDataURI(wasmBinaryFile)&&typeof fetch==="function"){fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiatedSource,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");instantiateArrayBuffer(receiveInstantiatedSource)})})}else{return instantiateArrayBuffer(receiveInstantiatedSource)}}if(Module["instantiateWasm"]){try{var exports=Module["instantiateWasm"](info,receiveInstance);return exports}catch(e){err("Module.instantiateWasm callback failed with error: "+e);return false}}instantiateAsync();return{}}Module["asm"]=createWasm;var tempDouble;var tempI64;var ASM_CONSTS=[function(){if(typeof window!="undefined"){window.dispatchEvent(new CustomEvent("wasmLoaded"))}else{global.onWASMLoaded&&global.onWASMLoaded()}}];function _emscripten_asm_const_i(code){return ASM_CONSTS[code]()}__ATINIT__.push({func:function(){___emscripten_environ_constructor()}});var tempDoublePtr=1128384;assert(tempDoublePtr%8==0);function demangle(func){warnOnce("warning: build with -s DEMANGLE_SUPPORT=1 to link in libcxxabi demangling");return func}function demangleAll(text){var regex=/\b__Z[\w\d_]+/g;return text.replace(regex,function(x){var y=demangle(x);return x===y?x:y+" ["+x+"]"})}function jsStackTrace(){var err=new Error;if(!err.stack){try{throw new Error(0)}catch(e){err=e}if(!err.stack){return"(no stack trace available)"}}return err.stack.toString()}function stackTrace(){var js=jsStackTrace();if(Module["extraStackTrace"])js+="\n"+Module["extraStackTrace"]();return demangleAll(js)}var ENV={};function ___buildEnvironment(environ){var MAX_ENV_VALUES=64;var TOTAL_ENV_SIZE=1024;var poolPtr;var envPtr;if(!___buildEnvironment.called){___buildEnvironment.called=true;ENV["USER"]="web_user";ENV["LOGNAME"]="web_user";ENV["PATH"]="/";ENV["PWD"]="/";ENV["HOME"]="/home/web_user";ENV["LANG"]=(typeof navigator==="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8";ENV["_"]=thisProgram;poolPtr=getMemory(TOTAL_ENV_SIZE);envPtr=getMemory(MAX_ENV_VALUES*4);HEAP32[envPtr>>2]=poolPtr;HEAP32[environ>>2]=envPtr}else{envPtr=HEAP32[environ>>2];poolPtr=HEAP32[envPtr>>2]}var strings=[];var totalSize=0;for(var key in ENV){if(typeof ENV[key]==="string"){var line=key+"="+ENV[key];strings.push(line);totalSize+=line.length}}if(totalSize>TOTAL_ENV_SIZE){throw new Error("Environment size exceeded TOTAL_ENV_SIZE!")}var ptrSize=4;for(var i=0;i>2]=poolPtr;poolPtr+=line.length+1}HEAP32[envPtr+strings.length*ptrSize>>2]=0}function ___lock(){}function ___setErrNo(value){if(Module["___errno_location"])HEAP32[Module["___errno_location"]()>>2]=value;else err("failed to set errno from JS");return value}var PATH={splitPath:function(filename){var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)},normalizeArray:function(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up;up--){parts.unshift("..")}}return parts},normalize:function(path){var isAbsolute=path.charAt(0)==="/",trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path},dirname:function(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir},basename:function(path){if(path==="/")return"/";var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)},extname:function(path){return PATH.splitPath(path)[3]},join:function(){var paths=Array.prototype.slice.call(arguments,0);return PATH.normalize(paths.join("/"))},join2:function(l,r){return PATH.normalize(l+"/"+r)}};var PATH_FS={resolve:function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:FS.cwd();if(typeof path!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){return""}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/"}resolvedPath=PATH.normalizeArray(resolvedPath.split("/").filter(function(p){return!!p}),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."},relative:function(from,to){from=PATH_FS.resolve(from).substr(1);to=PATH_FS.resolve(to).substr(1);function trim(arr){var start=0;for(;start=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i0){result=buf.slice(0,bytesRead).toString("utf-8")}else{result=null}}else if(typeof window!="undefined"&&typeof window.prompt=="function"){result=window.prompt("Input: ");if(result!==null){result+="\n"}}else if(typeof readline=="function"){result=readline();if(result!==null){result+="\n"}}if(!result){return null}tty.input=intArrayFromString(result,true)}return tty.input.shift()},put_char:function(tty,val){if(val===null||val===10){out(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){out(UTF8ArrayToString(tty.output,0));tty.output=[]}}},default_tty1_ops:{put_char:function(tty,val){if(val===null||val===10){err(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){err(UTF8ArrayToString(tty.output,0));tty.output=[]}}}};var MEMFS={ops_table:null,mount:function(mount){return MEMFS.createNode(null,"/",16384|511,0)},createNode:function(parent,name,mode,dev){if(FS.isBlkdev(mode)||FS.isFIFO(mode)){throw new FS.ErrnoError(63)}if(!MEMFS.ops_table){MEMFS.ops_table={dir:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr,lookup:MEMFS.node_ops.lookup,mknod:MEMFS.node_ops.mknod,rename:MEMFS.node_ops.rename,unlink:MEMFS.node_ops.unlink,rmdir:MEMFS.node_ops.rmdir,readdir:MEMFS.node_ops.readdir,symlink:MEMFS.node_ops.symlink},stream:{llseek:MEMFS.stream_ops.llseek}},file:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr},stream:{llseek:MEMFS.stream_ops.llseek,read:MEMFS.stream_ops.read,write:MEMFS.stream_ops.write,allocate:MEMFS.stream_ops.allocate,mmap:MEMFS.stream_ops.mmap,msync:MEMFS.stream_ops.msync}},link:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr,readlink:MEMFS.node_ops.readlink},stream:{}},chrdev:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr},stream:FS.chrdev_stream_ops}}}var node=FS.createNode(parent,name,mode,dev);if(FS.isDir(node.mode)){node.node_ops=MEMFS.ops_table.dir.node;node.stream_ops=MEMFS.ops_table.dir.stream;node.contents={}}else if(FS.isFile(node.mode)){node.node_ops=MEMFS.ops_table.file.node;node.stream_ops=MEMFS.ops_table.file.stream;node.usedBytes=0;node.contents=null}else if(FS.isLink(node.mode)){node.node_ops=MEMFS.ops_table.link.node;node.stream_ops=MEMFS.ops_table.link.stream}else if(FS.isChrdev(node.mode)){node.node_ops=MEMFS.ops_table.chrdev.node;node.stream_ops=MEMFS.ops_table.chrdev.stream}node.timestamp=Date.now();if(parent){parent.contents[name]=node}return node},getFileDataAsRegularArray:function(node){if(node.contents&&node.contents.subarray){var arr=[];for(var i=0;i=newCapacity)return;var CAPACITY_DOUBLING_MAX=1024*1024;newCapacity=Math.max(newCapacity,prevCapacity*(prevCapacity0)node.contents.set(oldContents.subarray(0,node.usedBytes),0);return},resizeFileStorage:function(node,newSize){if(node.usedBytes==newSize)return;if(newSize==0){node.contents=null;node.usedBytes=0;return}if(!node.contents||node.contents.subarray){var oldContents=node.contents;node.contents=new Uint8Array(new ArrayBuffer(newSize));if(oldContents){node.contents.set(oldContents.subarray(0,Math.min(newSize,node.usedBytes)))}node.usedBytes=newSize;return}if(!node.contents)node.contents=[];if(node.contents.length>newSize)node.contents.length=newSize;else while(node.contents.length=stream.node.usedBytes)return 0;var size=Math.min(stream.node.usedBytes-position,length);assert(size>=0);if(size>8&&contents.subarray){buffer.set(contents.subarray(position,position+size),offset)}else{for(var i=0;i0||position+lengthe2.timestamp){create.push(key);total++}});var remove=[];Object.keys(dst.entries).forEach(function(key){var e=dst.entries[key];var e2=src.entries[key];if(!e2){remove.push(key);total++}});if(!total){return callback(null)}var errored=false;var db=src.type==="remote"?src.db:dst.db;var transaction=db.transaction([IDBFS.DB_STORE_NAME],"readwrite");var store=transaction.objectStore(IDBFS.DB_STORE_NAME);function done(err){if(err&&!errored){errored=true;return callback(err)}}transaction.onerror=function(e){done(this.error);e.preventDefault()};transaction.oncomplete=function(e){if(!errored){callback(null)}};create.sort().forEach(function(path){if(dst.type==="local"){IDBFS.loadRemoteEntry(store,path,function(err,entry){if(err)return done(err);IDBFS.storeLocalEntry(path,entry,done)})}else{IDBFS.loadLocalEntry(path,function(err,entry){if(err)return done(err);IDBFS.storeRemoteEntry(store,path,entry,done)})}});remove.sort().reverse().forEach(function(path){if(dst.type==="local"){IDBFS.removeLocalEntry(path,done)}else{IDBFS.removeRemoteEntry(store,path,done)}})}};var ERRNO_CODES={EPERM:63,ENOENT:44,ESRCH:71,EINTR:27,EIO:29,ENXIO:60,E2BIG:1,ENOEXEC:45,EBADF:8,ECHILD:12,EAGAIN:6,EWOULDBLOCK:6,ENOMEM:48,EACCES:2,EFAULT:21,ENOTBLK:105,EBUSY:10,EEXIST:20,EXDEV:75,ENODEV:43,ENOTDIR:54,EISDIR:31,EINVAL:28,ENFILE:41,EMFILE:33,ENOTTY:59,ETXTBSY:74,EFBIG:22,ENOSPC:51,ESPIPE:70,EROFS:69,EMLINK:34,EPIPE:64,EDOM:18,ERANGE:68,ENOMSG:49,EIDRM:24,ECHRNG:106,EL2NSYNC:156,EL3HLT:107,EL3RST:108,ELNRNG:109,EUNATCH:110,ENOCSI:111,EL2HLT:112,EDEADLK:16,ENOLCK:46,EBADE:113,EBADR:114,EXFULL:115,ENOANO:104,EBADRQC:103,EBADSLT:102,EDEADLOCK:16,EBFONT:101,ENOSTR:100,ENODATA:116,ETIME:117,ENOSR:118,ENONET:119,ENOPKG:120,EREMOTE:121,ENOLINK:47,EADV:122,ESRMNT:123,ECOMM:124,EPROTO:65,EMULTIHOP:36,EDOTDOT:125,EBADMSG:9,ENOTUNIQ:126,EBADFD:127,EREMCHG:128,ELIBACC:129,ELIBBAD:130,ELIBSCN:131,ELIBMAX:132,ELIBEXEC:133,ENOSYS:52,ENOTEMPTY:55,ENAMETOOLONG:37,ELOOP:32,EOPNOTSUPP:138,EPFNOSUPPORT:139,ECONNRESET:15,ENOBUFS:42,EAFNOSUPPORT:5,EPROTOTYPE:67,ENOTSOCK:57,ENOPROTOOPT:50,ESHUTDOWN:140,ECONNREFUSED:14,EADDRINUSE:3,ECONNABORTED:13,ENETUNREACH:40,ENETDOWN:38,ETIMEDOUT:73,EHOSTDOWN:142,EHOSTUNREACH:23,EINPROGRESS:26,EALREADY:7,EDESTADDRREQ:17,EMSGSIZE:35,EPROTONOSUPPORT:66,ESOCKTNOSUPPORT:137,EADDRNOTAVAIL:4,ENETRESET:39,EISCONN:30,ENOTCONN:53,ETOOMANYREFS:141,EUSERS:136,EDQUOT:19,ESTALE:72,ENOTSUP:138,ENOMEDIUM:148,EILSEQ:25,EOVERFLOW:61,ECANCELED:11,ENOTRECOVERABLE:56,EOWNERDEAD:62,ESTRPIPE:135};var NODEFS={isWindows:false,staticInit:function(){NODEFS.isWindows=!!process.platform.match(/^win/);var flags=process["binding"]("constants");if(flags["fs"]){flags=flags["fs"]}NODEFS.flagsForNodeMap={1024:flags["O_APPEND"],64:flags["O_CREAT"],128:flags["O_EXCL"],0:flags["O_RDONLY"],2:flags["O_RDWR"],4096:flags["O_SYNC"],512:flags["O_TRUNC"],1:flags["O_WRONLY"]}},bufferFrom:function(arrayBuffer){return Buffer["alloc"]?Buffer.from(arrayBuffer):new Buffer(arrayBuffer)},convertNodeCode:function(e){var code=e.code;assert(code in ERRNO_CODES);return ERRNO_CODES[code]},mount:function(mount){assert(ENVIRONMENT_HAS_NODE);return NODEFS.createNode(null,"/",NODEFS.getMode(mount.opts.root),0)},createNode:function(parent,name,mode,dev){if(!FS.isDir(mode)&&!FS.isFile(mode)&&!FS.isLink(mode)){throw new FS.ErrnoError(28)}var node=FS.createNode(parent,name,mode);node.node_ops=NODEFS.node_ops;node.stream_ops=NODEFS.stream_ops;return node},getMode:function(path){var stat;try{stat=fs.lstatSync(path);if(NODEFS.isWindows){stat.mode=stat.mode|(stat.mode&292)>>2}}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(NODEFS.convertNodeCode(e))}return stat.mode},realPath:function(node){var parts=[];while(node.parent!==node){parts.push(node.name);node=node.parent}parts.push(node.mount.opts.root);parts.reverse();return PATH.join.apply(null,parts)},flagsForNode:function(flags){flags&=~2097152;flags&=~2048;flags&=~32768;flags&=~524288;var newFlags=0;for(var k in NODEFS.flagsForNodeMap){if(flags&k){newFlags|=NODEFS.flagsForNodeMap[k];flags^=k}}if(!flags){return newFlags}else{throw new FS.ErrnoError(28)}},node_ops:{getattr:function(node){var path=NODEFS.realPath(node);var stat;try{stat=fs.lstatSync(path)}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(NODEFS.convertNodeCode(e))}if(NODEFS.isWindows&&!stat.blksize){stat.blksize=4096}if(NODEFS.isWindows&&!stat.blocks){stat.blocks=(stat.size+stat.blksize-1)/stat.blksize|0}return{dev:stat.dev,ino:stat.ino,mode:stat.mode,nlink:stat.nlink,uid:stat.uid,gid:stat.gid,rdev:stat.rdev,size:stat.size,atime:stat.atime,mtime:stat.mtime,ctime:stat.ctime,blksize:stat.blksize,blocks:stat.blocks}},setattr:function(node,attr){var path=NODEFS.realPath(node);try{if(attr.mode!==undefined){fs.chmodSync(path,attr.mode);node.mode=attr.mode}if(attr.timestamp!==undefined){var date=new Date(attr.timestamp);fs.utimesSync(path,date,date)}if(attr.size!==undefined){fs.truncateSync(path,attr.size)}}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(NODEFS.convertNodeCode(e))}},lookup:function(parent,name){var path=PATH.join2(NODEFS.realPath(parent),name);var mode=NODEFS.getMode(path);return NODEFS.createNode(parent,name,mode)},mknod:function(parent,name,mode,dev){var node=NODEFS.createNode(parent,name,mode,dev);var path=NODEFS.realPath(node);try{if(FS.isDir(node.mode)){fs.mkdirSync(path,node.mode)}else{fs.writeFileSync(path,"",{mode:node.mode})}}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(NODEFS.convertNodeCode(e))}return node},rename:function(oldNode,newDir,newName){var oldPath=NODEFS.realPath(oldNode);var newPath=PATH.join2(NODEFS.realPath(newDir),newName);try{fs.renameSync(oldPath,newPath)}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(NODEFS.convertNodeCode(e))}},unlink:function(parent,name){var path=PATH.join2(NODEFS.realPath(parent),name);try{fs.unlinkSync(path)}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(NODEFS.convertNodeCode(e))}},rmdir:function(parent,name){var path=PATH.join2(NODEFS.realPath(parent),name);try{fs.rmdirSync(path)}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(NODEFS.convertNodeCode(e))}},readdir:function(node){var path=NODEFS.realPath(node);try{return fs.readdirSync(path)}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(NODEFS.convertNodeCode(e))}},symlink:function(parent,newName,oldPath){var newPath=PATH.join2(NODEFS.realPath(parent),newName);try{fs.symlinkSync(oldPath,newPath)}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(NODEFS.convertNodeCode(e))}},readlink:function(node){var path=NODEFS.realPath(node);try{path=fs.readlinkSync(path);path=NODEJS_PATH.relative(NODEJS_PATH.resolve(node.mount.opts.root),path);return path}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(NODEFS.convertNodeCode(e))}}},stream_ops:{open:function(stream){var path=NODEFS.realPath(stream.node);try{if(FS.isFile(stream.node.mode)){stream.nfd=fs.openSync(path,NODEFS.flagsForNode(stream.flags))}}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(NODEFS.convertNodeCode(e))}},close:function(stream){try{if(FS.isFile(stream.node.mode)&&stream.nfd){fs.closeSync(stream.nfd)}}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(NODEFS.convertNodeCode(e))}},read:function(stream,buffer,offset,length,position){if(length===0)return 0;try{return fs.readSync(stream.nfd,NODEFS.bufferFrom(buffer.buffer),offset,length,position)}catch(e){throw new FS.ErrnoError(NODEFS.convertNodeCode(e))}},write:function(stream,buffer,offset,length,position){try{return fs.writeSync(stream.nfd,NODEFS.bufferFrom(buffer.buffer),offset,length,position)}catch(e){throw new FS.ErrnoError(NODEFS.convertNodeCode(e))}},llseek:function(stream,offset,whence){var position=offset;if(whence===1){position+=stream.position}else if(whence===2){if(FS.isFile(stream.node.mode)){try{var stat=fs.fstatSync(stream.nfd);position+=stat.size}catch(e){throw new FS.ErrnoError(NODEFS.convertNodeCode(e))}}}if(position<0){throw new FS.ErrnoError(28)}return position}}};var WORKERFS={DIR_MODE:16895,FILE_MODE:33279,reader:null,mount:function(mount){assert(ENVIRONMENT_IS_WORKER);if(!WORKERFS.reader)WORKERFS.reader=new FileReaderSync;var root=WORKERFS.createNode(null,"/",WORKERFS.DIR_MODE,0);var createdParents={};function ensureParent(path){var parts=path.split("/");var parent=root;for(var i=0;i=stream.node.size)return 0;var chunk=stream.node.contents.slice(position,position+length);var ab=WORKERFS.reader.readAsArrayBuffer(chunk);buffer.set(new Uint8Array(ab),offset);return chunk.size},write:function(stream,buffer,offset,length,position){throw new FS.ErrnoError(29)},llseek:function(stream,offset,whence){var position=offset;if(whence===1){position+=stream.position}else if(whence===2){if(FS.isFile(stream.node.mode)){position+=stream.node.size}}if(position<0){throw new FS.ErrnoError(28)}return position}}};var ERRNO_MESSAGES={0:"Success",1:"Arg list too long",2:"Permission denied",3:"Address already in use",4:"Address not available",5:"Address family not supported by protocol family",6:"No more processes",7:"Socket already connected",8:"Bad file number",9:"Trying to read unreadable message",10:"Mount device busy",11:"Operation canceled",12:"No children",13:"Connection aborted",14:"Connection refused",15:"Connection reset by peer",16:"File locking deadlock error",17:"Destination address required",18:"Math arg out of domain of func",19:"Quota exceeded",20:"File exists",21:"Bad address",22:"File too large",23:"Host is unreachable",24:"Identifier removed",25:"Illegal byte sequence",26:"Connection already in progress",27:"Interrupted system call",28:"Invalid argument",29:"I/O error",30:"Socket is already connected",31:"Is a directory",32:"Too many symbolic links",33:"Too many open files",34:"Too many links",35:"Message too long",36:"Multihop attempted",37:"File or path name too long",38:"Network interface is not configured",39:"Connection reset by network",40:"Network is unreachable",41:"Too many open files in system",42:"No buffer space available",43:"No such device",44:"No such file or directory",45:"Exec format error",46:"No record locks available",47:"The link has been severed",48:"Not enough core",49:"No message of desired type",50:"Protocol not available",51:"No space left on device",52:"Function not implemented",53:"Socket is not connected",54:"Not a directory",55:"Directory not empty",56:"State not recoverable",57:"Socket operation on non-socket",59:"Not a typewriter",60:"No such device or address",61:"Value too large for defined data type",62:"Previous owner died",63:"Not super-user",64:"Broken pipe",65:"Protocol error",66:"Unknown protocol",67:"Protocol wrong type for socket",68:"Math result not representable",69:"Read only file system",70:"Illegal seek",71:"No such process",72:"Stale file handle",73:"Connection timed out",74:"Text file busy",75:"Cross-device link",100:"Device not a stream",101:"Bad font file fmt",102:"Invalid slot",103:"Invalid request code",104:"No anode",105:"Block device required",106:"Channel number out of range",107:"Level 3 halted",108:"Level 3 reset",109:"Link number out of range",110:"Protocol driver not attached",111:"No CSI structure available",112:"Level 2 halted",113:"Invalid exchange",114:"Invalid request descriptor",115:"Exchange full",116:"No data (for no delay io)",117:"Timer expired",118:"Out of streams resources",119:"Machine is not on the network",120:"Package not installed",121:"The object is remote",122:"Advertise error",123:"Srmount error",124:"Communication error on send",125:"Cross mount point (not really error)",126:"Given log. name not unique",127:"f.d. invalid for this operation",128:"Remote address changed",129:"Can access a needed shared lib",130:"Accessing a corrupted shared lib",131:".lib section in a.out corrupted",132:"Attempting to link in too many libs",133:"Attempting to exec a shared library",135:"Streams pipe error",136:"Too many users",137:"Socket type not supported",138:"Not supported",139:"Protocol family not supported",140:"Can't send after socket shutdown",141:"Too many references",142:"Host is down",148:"No medium (in tape drive)",156:"Level 2 not synchronized"};var FS={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:false,ignorePermissions:true,trackingDelegate:{},tracking:{openFlags:{READ:1,WRITE:2}},ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,handleFSError:function(e){if(!(e instanceof FS.ErrnoError))throw e+" : "+stackTrace();return ___setErrNo(e.errno)},lookupPath:function(path,opts){path=PATH_FS.resolve(FS.cwd(),path);opts=opts||{};if(!path)return{path:"",node:null};var defaults={follow_mount:true,recurse_count:0};for(var key in defaults){if(opts[key]===undefined){opts[key]=defaults[key]}}if(opts.recurse_count>8){throw new FS.ErrnoError(32)}var parts=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),false);var current=FS.root;var current_path="/";for(var i=0;i40){throw new FS.ErrnoError(32)}}}}return{path:current_path,node:current}},getPath:function(node){var path;while(true){if(FS.isRoot(node)){var mount=node.mount.mountpoint;if(!path)return mount;return mount[mount.length-1]!=="/"?mount+"/"+path:mount+path}path=path?node.name+"/"+path:node.name;node=node.parent}},hashName:function(parentid,name){var hash=0;for(var i=0;i>>0)%FS.nameTable.length},hashAddNode:function(node){var hash=FS.hashName(node.parent.id,node.name);node.name_next=FS.nameTable[hash];FS.nameTable[hash]=node},hashRemoveNode:function(node){var hash=FS.hashName(node.parent.id,node.name);if(FS.nameTable[hash]===node){FS.nameTable[hash]=node.name_next}else{var current=FS.nameTable[hash];while(current){if(current.name_next===node){current.name_next=node.name_next;break}current=current.name_next}}},lookupNode:function(parent,name){var err=FS.mayLookup(parent);if(err){throw new FS.ErrnoError(err,parent)}var hash=FS.hashName(parent.id,name);for(var node=FS.nameTable[hash];node;node=node.name_next){var nodeName=node.name;if(node.parent.id===parent.id&&nodeName===name){return node}}return FS.lookup(parent,name)},createNode:function(parent,name,mode,rdev){if(!FS.FSNode){FS.FSNode=function(parent,name,mode,rdev){if(!parent){parent=this}this.parent=parent;this.mount=parent.mount;this.mounted=null;this.id=FS.nextInode++;this.name=name;this.mode=mode;this.node_ops={};this.stream_ops={};this.rdev=rdev};FS.FSNode.prototype={};var readMode=292|73;var writeMode=146;Object.defineProperties(FS.FSNode.prototype,{read:{get:function(){return(this.mode&readMode)===readMode},set:function(val){val?this.mode|=readMode:this.mode&=~readMode}},write:{get:function(){return(this.mode&writeMode)===writeMode},set:function(val){val?this.mode|=writeMode:this.mode&=~writeMode}},isFolder:{get:function(){return FS.isDir(this.mode)}},isDevice:{get:function(){return FS.isChrdev(this.mode)}}})}var node=new FS.FSNode(parent,name,mode,rdev);FS.hashAddNode(node);return node},destroyNode:function(node){FS.hashRemoveNode(node)},isRoot:function(node){return node===node.parent},isMountpoint:function(node){return!!node.mounted},isFile:function(mode){return(mode&61440)===32768},isDir:function(mode){return(mode&61440)===16384},isLink:function(mode){return(mode&61440)===40960},isChrdev:function(mode){return(mode&61440)===8192},isBlkdev:function(mode){return(mode&61440)===24576},isFIFO:function(mode){return(mode&61440)===4096},isSocket:function(mode){return(mode&49152)===49152},flagModes:{"r":0,"rs":1052672,"r+":2,"w":577,"wx":705,"xw":705,"w+":578,"wx+":706,"xw+":706,"a":1089,"ax":1217,"xa":1217,"a+":1090,"ax+":1218,"xa+":1218},modeStringToFlags:function(str){var flags=FS.flagModes[str];if(typeof flags==="undefined"){throw new Error("Unknown file open mode: "+str)}return flags},flagsToPermissionString:function(flag){var perms=["r","w","rw"][flag&3];if(flag&512){perms+="w"}return perms},nodePermissions:function(node,perms){if(FS.ignorePermissions){return 0}if(perms.indexOf("r")!==-1&&!(node.mode&292)){return 2}else if(perms.indexOf("w")!==-1&&!(node.mode&146)){return 2}else if(perms.indexOf("x")!==-1&&!(node.mode&73)){return 2}return 0},mayLookup:function(dir){var err=FS.nodePermissions(dir,"x");if(err)return err;if(!dir.node_ops.lookup)return 2;return 0},mayCreate:function(dir,name){try{var node=FS.lookupNode(dir,name);return 20}catch(e){}return FS.nodePermissions(dir,"wx")},mayDelete:function(dir,name,isdir){var node;try{node=FS.lookupNode(dir,name)}catch(e){return e.errno}var err=FS.nodePermissions(dir,"wx");if(err){return err}if(isdir){if(!FS.isDir(node.mode)){return 54}if(FS.isRoot(node)||FS.getPath(node)===FS.cwd()){return 10}}else{if(FS.isDir(node.mode)){return 31}}return 0},mayOpen:function(node,flags){if(!node){return 44}if(FS.isLink(node.mode)){return 32}else if(FS.isDir(node.mode)){if(FS.flagsToPermissionString(flags)!=="r"||flags&512){return 31}}return FS.nodePermissions(node,FS.flagsToPermissionString(flags))},MAX_OPEN_FDS:4096,nextfd:function(fd_start,fd_end){fd_start=fd_start||0;fd_end=fd_end||FS.MAX_OPEN_FDS;for(var fd=fd_start;fd<=fd_end;fd++){if(!FS.streams[fd]){return fd}}throw new FS.ErrnoError(33)},getStream:function(fd){return FS.streams[fd]},createStream:function(stream,fd_start,fd_end){if(!FS.FSStream){FS.FSStream=function(){};FS.FSStream.prototype={};Object.defineProperties(FS.FSStream.prototype,{object:{get:function(){return this.node},set:function(val){this.node=val}},isRead:{get:function(){return(this.flags&2097155)!==1}},isWrite:{get:function(){return(this.flags&2097155)!==0}},isAppend:{get:function(){return this.flags&1024}}})}var newStream=new FS.FSStream;for(var p in stream){newStream[p]=stream[p]}stream=newStream;var fd=FS.nextfd(fd_start,fd_end);stream.fd=fd;FS.streams[fd]=stream;return stream},closeStream:function(fd){FS.streams[fd]=null},chrdev_stream_ops:{open:function(stream){var device=FS.getDevice(stream.node.rdev);stream.stream_ops=device.stream_ops;if(stream.stream_ops.open){stream.stream_ops.open(stream)}},llseek:function(){throw new FS.ErrnoError(70)}},major:function(dev){return dev>>8},minor:function(dev){return dev&255},makedev:function(ma,mi){return ma<<8|mi},registerDevice:function(dev,ops){FS.devices[dev]={stream_ops:ops}},getDevice:function(dev){return FS.devices[dev]},getMounts:function(mount){var mounts=[];var check=[mount];while(check.length){var m=check.pop();mounts.push(m);check.push.apply(check,m.mounts)}return mounts},syncfs:function(populate,callback){if(typeof populate==="function"){callback=populate;populate=false}FS.syncFSRequests++;if(FS.syncFSRequests>1){console.log("warning: "+FS.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work")}var mounts=FS.getMounts(FS.root.mount);var completed=0;function doCallback(err){assert(FS.syncFSRequests>0);FS.syncFSRequests--;return callback(err)}function done(err){if(err){if(!done.errored){done.errored=true;return doCallback(err)}return}if(++completed>=mounts.length){doCallback(null)}}mounts.forEach(function(mount){if(!mount.type.syncfs){return done(null)}mount.type.syncfs(mount,populate,done)})},mount:function(type,opts,mountpoint){var root=mountpoint==="/";var pseudo=!mountpoint;var node;if(root&&FS.root){throw new FS.ErrnoError(10)}else if(!root&&!pseudo){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});mountpoint=lookup.path;node=lookup.node;if(FS.isMountpoint(node)){throw new FS.ErrnoError(10)}if(!FS.isDir(node.mode)){throw new FS.ErrnoError(54)}}var mount={type:type,opts:opts,mountpoint:mountpoint,mounts:[]};var mountRoot=type.mount(mount);mountRoot.mount=mount;mount.root=mountRoot;if(root){FS.root=mountRoot}else if(node){node.mounted=mount;if(node.mount){node.mount.mounts.push(mount)}}return mountRoot},unmount:function(mountpoint){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});if(!FS.isMountpoint(lookup.node)){throw new FS.ErrnoError(28)}var node=lookup.node;var mount=node.mounted;var mounts=FS.getMounts(mount);Object.keys(FS.nameTable).forEach(function(hash){var current=FS.nameTable[hash];while(current){var next=current.name_next;if(mounts.indexOf(current.mount)!==-1){FS.destroyNode(current)}current=next}});node.mounted=null;var idx=node.mount.mounts.indexOf(mount);assert(idx!==-1);node.mount.mounts.splice(idx,1)},lookup:function(parent,name){return parent.node_ops.lookup(parent,name)},mknod:function(path,mode,dev){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);if(!name||name==="."||name===".."){throw new FS.ErrnoError(28)}var err=FS.mayCreate(parent,name);if(err){throw new FS.ErrnoError(err)}if(!parent.node_ops.mknod){throw new FS.ErrnoError(63)}return parent.node_ops.mknod(parent,name,mode,dev)},create:function(path,mode){mode=mode!==undefined?mode:438;mode&=4095;mode|=32768;return FS.mknod(path,mode,0)},mkdir:function(path,mode){mode=mode!==undefined?mode:511;mode&=511|512;mode|=16384;return FS.mknod(path,mode,0)},mkdirTree:function(path,mode){var dirs=path.split("/");var d="";for(var i=0;ithis.length-1||idx<0){return undefined}var chunkOffset=idx%this.chunkSize;var chunkNum=idx/this.chunkSize|0;return this.getter(chunkNum)[chunkOffset]};LazyUint8Array.prototype.setDataGetter=function LazyUint8Array_setDataGetter(getter){this.getter=getter};LazyUint8Array.prototype.cacheLength=function LazyUint8Array_cacheLength(){var xhr=new XMLHttpRequest;xhr.open("HEAD",url,false);xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);var datalength=Number(xhr.getResponseHeader("Content-length"));var header;var hasByteServing=(header=xhr.getResponseHeader("Accept-Ranges"))&&header==="bytes";var usesGzip=(header=xhr.getResponseHeader("Content-Encoding"))&&header==="gzip";var chunkSize=1024*1024;if(!hasByteServing)chunkSize=datalength;var doXHR=function(from,to){if(from>to)throw new Error("invalid range ("+from+", "+to+") or no bytes requested!");if(to>datalength-1)throw new Error("only "+datalength+" bytes available! programmer error!");var xhr=new XMLHttpRequest;xhr.open("GET",url,false);if(datalength!==chunkSize)xhr.setRequestHeader("Range","bytes="+from+"-"+to);if(typeof Uint8Array!="undefined")xhr.responseType="arraybuffer";if(xhr.overrideMimeType){xhr.overrideMimeType("text/plain; charset=x-user-defined")}xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);if(xhr.response!==undefined){return new Uint8Array(xhr.response||[])}else{return intArrayFromString(xhr.responseText||"",true)}};var lazyArray=this;lazyArray.setDataGetter(function(chunkNum){var start=chunkNum*chunkSize;var end=(chunkNum+1)*chunkSize-1;end=Math.min(end,datalength-1);if(typeof lazyArray.chunks[chunkNum]==="undefined"){lazyArray.chunks[chunkNum]=doXHR(start,end)}if(typeof lazyArray.chunks[chunkNum]==="undefined")throw new Error("doXHR failed!");return lazyArray.chunks[chunkNum]});if(usesGzip||!datalength){chunkSize=datalength=1;datalength=this.getter(0).length;chunkSize=datalength;console.log("LazyFiles on gzip forces download of the whole file when length is accessed")}this._length=datalength;this._chunkSize=chunkSize;this.lengthKnown=true};if(typeof XMLHttpRequest!=="undefined"){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var lazyArray=new LazyUint8Array;Object.defineProperties(lazyArray,{length:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._length}},chunkSize:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._chunkSize}}});var properties={isDevice:false,contents:lazyArray}}else{var properties={isDevice:false,url:url}}var node=FS.createFile(parent,name,properties,canRead,canWrite);if(properties.contents){node.contents=properties.contents}else if(properties.url){node.contents=null;node.url=properties.url}Object.defineProperties(node,{usedBytes:{get:function(){return this.contents.length}}});var stream_ops={};var keys=Object.keys(node.stream_ops);keys.forEach(function(key){var fn=node.stream_ops[key];stream_ops[key]=function forceLoadLazyFile(){if(!FS.forceLoadFile(node)){throw new FS.ErrnoError(29)}return fn.apply(null,arguments)}});stream_ops.read=function stream_ops_read(stream,buffer,offset,length,position){if(!FS.forceLoadFile(node)){throw new FS.ErrnoError(29)}var contents=stream.node.contents;if(position>=contents.length)return 0;var size=Math.min(contents.length-position,length);assert(size>=0);if(contents.slice){for(var i=0;i>2]=stat.dev;HEAP32[buf+4>>2]=0;HEAP32[buf+8>>2]=stat.ino;HEAP32[buf+12>>2]=stat.mode;HEAP32[buf+16>>2]=stat.nlink;HEAP32[buf+20>>2]=stat.uid;HEAP32[buf+24>>2]=stat.gid;HEAP32[buf+28>>2]=stat.rdev;HEAP32[buf+32>>2]=0;tempI64=[stat.size>>>0,(tempDouble=stat.size,+Math_abs(tempDouble)>=1?tempDouble>0?(Math_min(+Math_floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math_ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+40>>2]=tempI64[0],HEAP32[buf+44>>2]=tempI64[1];HEAP32[buf+48>>2]=4096;HEAP32[buf+52>>2]=stat.blocks;HEAP32[buf+56>>2]=stat.atime.getTime()/1e3|0;HEAP32[buf+60>>2]=0;HEAP32[buf+64>>2]=stat.mtime.getTime()/1e3|0;HEAP32[buf+68>>2]=0;HEAP32[buf+72>>2]=stat.ctime.getTime()/1e3|0;HEAP32[buf+76>>2]=0;tempI64=[stat.ino>>>0,(tempDouble=stat.ino,+Math_abs(tempDouble)>=1?tempDouble>0?(Math_min(+Math_floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math_ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+80>>2]=tempI64[0],HEAP32[buf+84>>2]=tempI64[1];return 0},doMsync:function(addr,stream,len,flags){var buffer=new Uint8Array(HEAPU8.subarray(addr,addr+len));FS.msync(stream,buffer,0,len,flags)},doMkdir:function(path,mode){path=PATH.normalize(path);if(path[path.length-1]==="/")path=path.substr(0,path.length-1);FS.mkdir(path,mode,0);return 0},doMknod:function(path,mode,dev){switch(mode&61440){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}FS.mknod(path,mode,dev);return 0},doReadlink:function(path,buf,bufsize){if(bufsize<=0)return-28;var ret=FS.readlink(path);var len=Math.min(bufsize,lengthBytesUTF8(ret));var endChar=HEAP8[buf+len];stringToUTF8(ret,buf,bufsize+1);HEAP8[buf+len]=endChar;return len},doAccess:function(path,amode){if(amode&~7){return-28}var node;var lookup=FS.lookupPath(path,{follow:true});node=lookup.node;if(!node){return-44}var perms="";if(amode&4)perms+="r";if(amode&2)perms+="w";if(amode&1)perms+="x";if(perms&&FS.nodePermissions(node,perms)){return-2}return 0},doDup:function(path,flags,suggestFD){var suggest=FS.getStream(suggestFD);if(suggest)FS.close(suggest);return FS.open(path,flags,0,suggestFD,suggestFD).fd},doReadv:function(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.read(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(curr>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.write(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr}return ret},varargs:0,get:function(varargs){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret},getStr:function(){var ret=UTF8ToString(SYSCALLS.get());return ret},getStreamFromFD:function(fd){if(fd===undefined)fd=SYSCALLS.get();var stream=FS.getStream(fd);if(!stream)throw new FS.ErrnoError(8);return stream},get64:function(){var low=SYSCALLS.get(),high=SYSCALLS.get();if(low>=0)assert(high===0);else assert(high===-1);return low},getZero:function(){assert(SYSCALLS.get()===0)}};function ___syscall221(which,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(),cmd=SYSCALLS.get();switch(cmd){case 0:{var arg=SYSCALLS.get();if(arg<0){return-28}var newStream;newStream=FS.open(stream.path,stream.flags,0,arg);return newStream.fd}case 1:case 2:return 0;case 3:return stream.flags;case 4:{var arg=SYSCALLS.get();stream.flags|=arg;return 0}case 12:{var arg=SYSCALLS.get();var offset=0;HEAP16[arg+offset>>1]=2;return 0}case 13:case 14:return 0;case 16:case 8:return-28;case 9:___setErrNo(28);return-1;default:{return-28}}}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall3(which,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(),buf=SYSCALLS.get(),count=SYSCALLS.get();return FS.read(stream,HEAP8,buf,count)}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall5(which,varargs){SYSCALLS.varargs=varargs;try{var pathname=SYSCALLS.getStr(),flags=SYSCALLS.get(),mode=SYSCALLS.get();var stream=FS.open(pathname,flags,mode);return stream.fd}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___unlock(){}function _fd_close(fd){try{var stream=SYSCALLS.getStreamFromFD(fd);FS.close(stream);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function ___wasi_fd_close(){return _fd_close.apply(null,arguments)}function _fd_fdstat_get(fd,pbuf){try{var stream=SYSCALLS.getStreamFromFD(fd);var type=stream.tty?2:FS.isDir(stream.mode)?3:FS.isLink(stream.mode)?7:4;HEAP8[pbuf>>0]=type;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function ___wasi_fd_fdstat_get(){return _fd_fdstat_get.apply(null,arguments)}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){try{var stream=SYSCALLS.getStreamFromFD(fd);var HIGH_OFFSET=4294967296;var offset=offset_high*HIGH_OFFSET+(offset_low>>>0);var DOUBLE_LIMIT=9007199254740992;if(offset<=-DOUBLE_LIMIT||offset>=DOUBLE_LIMIT){return-61}FS.llseek(stream,offset,whence);tempI64=[stream.position>>>0,(tempDouble=stream.position,+Math_abs(tempDouble)>=1?tempDouble>0?(Math_min(+Math_floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math_ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[newOffset>>2]=tempI64[0],HEAP32[newOffset+4>>2]=tempI64[1];if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function ___wasi_fd_seek(){return _fd_seek.apply(null,arguments)}function _fd_write(fd,iov,iovcnt,pnum){try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doWritev(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function ___wasi_fd_write(){return _fd_write.apply(null,arguments)}function __emscripten_fetch_free(id){delete Fetch.xhrs[id-1]}function _abort(){abort()}function _clock(){if(_clock.start===undefined)_clock.start=Date.now();return(Date.now()-_clock.start)*(1e6/1e3)|0}function _emscripten_get_now(){abort()}function _emscripten_get_now_is_monotonic(){return 0||ENVIRONMENT_IS_NODE||typeof dateNow!=="undefined"||typeof performance==="object"&&performance&&typeof performance["now"]==="function"}function _clock_gettime(clk_id,tp){var now;if(clk_id===0){now=Date.now()}else if(clk_id===1&&_emscripten_get_now_is_monotonic()){now=_emscripten_get_now()}else{___setErrNo(28);return-1}HEAP32[tp>>2]=now/1e3|0;HEAP32[tp+4>>2]=now%1e3*1e3*1e3|0;return 0}function _emscripten_get_heap_size(){return HEAP8.length}function _emscripten_is_main_browser_thread(){return!ENVIRONMENT_IS_WORKER}function emscripten_realloc_buffer(size){try{wasmMemory.grow(size-buffer.byteLength+65535>>16);updateGlobalBufferAndViews(wasmMemory.buffer);return 1}catch(e){console.error("emscripten_realloc_buffer: Attempted to grow heap from "+buffer.byteLength+" bytes to "+size+" bytes, but got error: "+e)}}function _emscripten_resize_heap(requestedSize){var oldSize=_emscripten_get_heap_size();assert(requestedSize>oldSize);var PAGE_MULTIPLE=65536;var LIMIT=2147483648-PAGE_MULTIPLE;if(requestedSize>LIMIT){err("Cannot enlarge memory, asked to go up to "+requestedSize+" bytes, but the limit is "+LIMIT+" bytes!");return false}var MIN_TOTAL_MEMORY=16777216;var newSize=Math.max(oldSize,MIN_TOTAL_MEMORY);while(newSize>2]=val;HEAPU32[addr+4>>2]=val/4294967296|0},openDatabase:function(dbname,dbversion,onsuccess,onerror){try{var openRequest=indexedDB.open(dbname,dbversion)}catch(e){return onerror(e)}openRequest.onupgradeneeded=function(event){var db=event.target.result;if(db.objectStoreNames.contains("FILES")){db.deleteObjectStore("FILES")}db.createObjectStore("FILES")};openRequest.onsuccess=function(event){onsuccess(event.target.result)};openRequest.onerror=function(error){onerror(error)}},staticInit:function(){var isMainThread=typeof ENVIRONMENT_IS_FETCH_WORKER==="undefined";var onsuccess=function(db){Fetch.dbInstance=db;if(isMainThread){removeRunDependency("library_fetch_init")}};var onerror=function(){Fetch.dbInstance=false;if(isMainThread){removeRunDependency("library_fetch_init")}};Fetch.openDatabase("emscripten_filesystem",1,onsuccess,onerror);if(typeof ENVIRONMENT_IS_FETCH_WORKER==="undefined"||!ENVIRONMENT_IS_FETCH_WORKER)addRunDependency("library_fetch_init")}};function __emscripten_fetch_xhr(fetch,onsuccess,onerror,onprogress,onreadystatechange){var url=HEAPU32[fetch+8>>2];if(!url){onerror(fetch,0,"no url specified!");return}var url_=UTF8ToString(url);var fetch_attr=fetch+112;var requestMethod=UTF8ToString(fetch_attr);if(!requestMethod)requestMethod="GET";var userData=HEAPU32[fetch_attr+32>>2];var fetchAttributes=HEAPU32[fetch_attr+52>>2];var timeoutMsecs=HEAPU32[fetch_attr+56>>2];var withCredentials=!!HEAPU32[fetch_attr+60>>2];var destinationPath=HEAPU32[fetch_attr+64>>2];var userName=HEAPU32[fetch_attr+68>>2];var password=HEAPU32[fetch_attr+72>>2];var requestHeaders=HEAPU32[fetch_attr+76>>2];var overriddenMimeType=HEAPU32[fetch_attr+80>>2];var dataPtr=HEAPU32[fetch_attr+84>>2];var dataLength=HEAPU32[fetch_attr+88>>2];var fetchAttrLoadToMemory=!!(fetchAttributes&1);var fetchAttrStreamData=!!(fetchAttributes&2);var fetchAttrPersistFile=!!(fetchAttributes&4);var fetchAttrAppend=!!(fetchAttributes&8);var fetchAttrReplace=!!(fetchAttributes&16);var fetchAttrSynchronous=!!(fetchAttributes&64);var fetchAttrWaitable=!!(fetchAttributes&128);var userNameStr=userName?UTF8ToString(userName):undefined;var passwordStr=password?UTF8ToString(password):undefined;var overriddenMimeTypeStr=overriddenMimeType?UTF8ToString(overriddenMimeType):undefined;var xhr=new XMLHttpRequest;xhr.withCredentials=withCredentials;xhr.open(requestMethod,url_,!fetchAttrSynchronous,userNameStr,passwordStr);if(!fetchAttrSynchronous)xhr.timeout=timeoutMsecs;xhr.url_=url_;assert(!fetchAttrStreamData,"streaming uses moz-chunked-arraybuffer which is no longer supported; TODO: rewrite using fetch()");xhr.responseType="arraybuffer";if(overriddenMimeType){xhr.overrideMimeType(overriddenMimeTypeStr)}if(requestHeaders){for(;;){var key=HEAPU32[requestHeaders>>2];if(!key)break;var value=HEAPU32[requestHeaders+4>>2];if(!value)break;requestHeaders+=8;var keyStr=UTF8ToString(key);var valueStr=UTF8ToString(value);xhr.setRequestHeader(keyStr,valueStr)}}Fetch.xhrs.push(xhr);var id=Fetch.xhrs.length;HEAPU32[fetch+0>>2]=id;var data=dataPtr&&dataLength?HEAPU8.slice(dataPtr,dataPtr+dataLength):null;xhr.onload=function(e){var len=xhr.response?xhr.response.byteLength:0;var ptr=0;var ptrLen=0;if(fetchAttrLoadToMemory&&!fetchAttrStreamData){ptrLen=len;ptr=_malloc(ptrLen);HEAPU8.set(new Uint8Array(xhr.response),ptr)}HEAPU32[fetch+12>>2]=ptr;Fetch.setu64(fetch+16,ptrLen);Fetch.setu64(fetch+24,0);if(len){Fetch.setu64(fetch+32,len)}HEAPU16[fetch+40>>1]=xhr.readyState;if(xhr.readyState===4&&xhr.status===0){if(len>0)xhr.status=200;else xhr.status=404}HEAPU16[fetch+42>>1]=xhr.status;if(xhr.statusText)stringToUTF8(xhr.statusText,fetch+44,64);if(xhr.status>=200&&xhr.status<300){if(onsuccess)onsuccess(fetch,xhr,e)}else{if(onerror)onerror(fetch,xhr,e)}};xhr.onerror=function(e){var status=xhr.status;if(xhr.readyState===4&&status===0)status=404;HEAPU32[fetch+12>>2]=0;Fetch.setu64(fetch+16,0);Fetch.setu64(fetch+24,0);Fetch.setu64(fetch+32,0);HEAPU16[fetch+40>>1]=xhr.readyState;HEAPU16[fetch+42>>1]=status;if(onerror)onerror(fetch,xhr,e)};xhr.ontimeout=function(e){if(onerror)onerror(fetch,xhr,e)};xhr.onprogress=function(e){var ptrLen=fetchAttrLoadToMemory&&fetchAttrStreamData&&xhr.response?xhr.response.byteLength:0;var ptr=0;if(fetchAttrLoadToMemory&&fetchAttrStreamData){ptr=_malloc(ptrLen);HEAPU8.set(new Uint8Array(xhr.response),ptr)}HEAPU32[fetch+12>>2]=ptr;Fetch.setu64(fetch+16,ptrLen);Fetch.setu64(fetch+24,e.loaded-ptrLen);Fetch.setu64(fetch+32,e.total);HEAPU16[fetch+40>>1]=xhr.readyState;if(xhr.readyState>=3&&xhr.status===0&&e.loaded>0)xhr.status=200;HEAPU16[fetch+42>>1]=xhr.status;if(xhr.statusText)stringToUTF8(xhr.statusText,fetch+44,64);if(onprogress)onprogress(fetch,xhr,e)};xhr.onreadystatechange=function(e){HEAPU16[fetch+40>>1]=xhr.readyState;if(xhr.readyState>=2){HEAPU16[fetch+42>>1]=xhr.status}if(onreadystatechange)onreadystatechange(fetch,xhr,e)};try{xhr.send(data)}catch(e){if(onerror)onerror(fetch,xhr,e)}}function __emscripten_fetch_cache_data(db,fetch,data,onsuccess,onerror){if(!db){onerror(fetch,0,"IndexedDB not available!");return}var fetch_attr=fetch+112;var destinationPath=HEAPU32[fetch_attr+64>>2];if(!destinationPath)destinationPath=HEAPU32[fetch+8>>2];var destinationPathStr=UTF8ToString(destinationPath);try{var transaction=db.transaction(["FILES"],"readwrite");var packages=transaction.objectStore("FILES");var putRequest=packages.put(data,destinationPathStr);putRequest.onsuccess=function(event){HEAPU16[fetch+40>>1]=4;HEAPU16[fetch+42>>1]=200;stringToUTF8("OK",fetch+44,64);onsuccess(fetch,0,destinationPathStr)};putRequest.onerror=function(error){HEAPU16[fetch+40>>1]=4;HEAPU16[fetch+42>>1]=413;stringToUTF8("Payload Too Large",fetch+44,64);onerror(fetch,0,error)}}catch(e){onerror(fetch,0,e)}}function __emscripten_fetch_load_cached_data(db,fetch,onsuccess,onerror){if(!db){onerror(fetch,0,"IndexedDB not available!");return}var fetch_attr=fetch+112;var path=HEAPU32[fetch_attr+64>>2];if(!path)path=HEAPU32[fetch+8>>2];var pathStr=UTF8ToString(path);try{var transaction=db.transaction(["FILES"],"readonly");var packages=transaction.objectStore("FILES");var getRequest=packages.get(pathStr);getRequest.onsuccess=function(event){if(event.target.result){var value=event.target.result;var len=value.byteLength||value.length;var ptr=_malloc(len);HEAPU8.set(new Uint8Array(value),ptr);HEAPU32[fetch+12>>2]=ptr;Fetch.setu64(fetch+16,len);Fetch.setu64(fetch+24,0);Fetch.setu64(fetch+32,len);HEAPU16[fetch+40>>1]=4;HEAPU16[fetch+42>>1]=200;stringToUTF8("OK",fetch+44,64);onsuccess(fetch,0,value)}else{HEAPU16[fetch+40>>1]=4;HEAPU16[fetch+42>>1]=404;stringToUTF8("Not Found",fetch+44,64);onerror(fetch,0,"no data")}};getRequest.onerror=function(error){HEAPU16[fetch+40>>1]=4;HEAPU16[fetch+42>>1]=404;stringToUTF8("Not Found",fetch+44,64);onerror(fetch,0,error)}}catch(e){onerror(fetch,0,e)}}function __emscripten_fetch_delete_cached_data(db,fetch,onsuccess,onerror){if(!db){onerror(fetch,0,"IndexedDB not available!");return}var fetch_attr=fetch+112;var path=HEAPU32[fetch_attr+64>>2];if(!path)path=HEAPU32[fetch+8>>2];var pathStr=UTF8ToString(path);try{var transaction=db.transaction(["FILES"],"readwrite");var packages=transaction.objectStore("FILES");var request=packages.delete(pathStr);request.onsuccess=function(event){var value=event.target.result;HEAPU32[fetch+12>>2]=0;Fetch.setu64(fetch+16,0);Fetch.setu64(fetch+24,0);Fetch.setu64(fetch+32,0);HEAPU16[fetch+40>>1]=4;HEAPU16[fetch+42>>1]=200;stringToUTF8("OK",fetch+44,64);onsuccess(fetch,0,value)};request.onerror=function(error){HEAPU16[fetch+40>>1]=4;HEAPU16[fetch+42>>1]=404;stringToUTF8("Not Found",fetch+44,64);onerror(fetch,0,error)}}catch(e){onerror(fetch,0,e)}}function _emscripten_start_fetch(fetch,successcb,errorcb,progresscb,readystatechangecb){if(typeof noExitRuntime!=="undefined")noExitRuntime=true;var fetch_attr=fetch+112;var requestMethod=UTF8ToString(fetch_attr);var onsuccess=HEAPU32[fetch_attr+36>>2];var onerror=HEAPU32[fetch_attr+40>>2];var onprogress=HEAPU32[fetch_attr+44>>2];var onreadystatechange=HEAPU32[fetch_attr+48>>2];var fetchAttributes=HEAPU32[fetch_attr+52>>2];var fetchAttrLoadToMemory=!!(fetchAttributes&1);var fetchAttrStreamData=!!(fetchAttributes&2);var fetchAttrPersistFile=!!(fetchAttributes&4);var fetchAttrNoDownload=!!(fetchAttributes&32);var fetchAttrAppend=!!(fetchAttributes&8);var fetchAttrReplace=!!(fetchAttributes&16);var reportSuccess=function(fetch,xhr,e){if(onsuccess)dynCall_vi(onsuccess,fetch);else if(successcb)successcb(fetch)};var reportProgress=function(fetch,xhr,e){if(onprogress)dynCall_vi(onprogress,fetch);else if(progresscb)progresscb(fetch)};var reportError=function(fetch,xhr,e){if(onerror)dynCall_vi(onerror,fetch);else if(errorcb)errorcb(fetch)};var reportReadyStateChange=function(fetch,xhr,e){if(onreadystatechange)dynCall_vi(onreadystatechange,fetch);else if(readystatechangecb)readystatechangecb(fetch)};var performUncachedXhr=function(fetch,xhr,e){__emscripten_fetch_xhr(fetch,reportSuccess,reportError,reportProgress,reportReadyStateChange)};var cacheResultAndReportSuccess=function(fetch,xhr,e){var storeSuccess=function(fetch,xhr,e){if(onsuccess)dynCall_vi(onsuccess,fetch);else if(successcb)successcb(fetch)};var storeError=function(fetch,xhr,e){if(onsuccess)dynCall_vi(onsuccess,fetch);else if(successcb)successcb(fetch)};__emscripten_fetch_cache_data(Fetch.dbInstance,fetch,xhr.response,storeSuccess,storeError)};var performCachedXhr=function(fetch,xhr,e){__emscripten_fetch_xhr(fetch,cacheResultAndReportSuccess,reportError,reportProgress,reportReadyStateChange)};if(requestMethod==="EM_IDB_STORE"){var ptr=HEAPU32[fetch_attr+84>>2];__emscripten_fetch_cache_data(Fetch.dbInstance,fetch,HEAPU8.slice(ptr,ptr+HEAPU32[fetch_attr+88>>2]),reportSuccess,reportError)}else if(requestMethod==="EM_IDB_DELETE"){__emscripten_fetch_delete_cached_data(Fetch.dbInstance,fetch,reportSuccess,reportError)}else if(!fetchAttrReplace){__emscripten_fetch_load_cached_data(Fetch.dbInstance,fetch,reportSuccess,fetchAttrNoDownload?reportError:fetchAttrPersistFile?performCachedXhr:performUncachedXhr)}else if(!fetchAttrNoDownload){__emscripten_fetch_xhr(fetch,fetchAttrPersistFile?cacheResultAndReportSuccess:reportSuccess,reportError,reportProgress,reportReadyStateChange)}else{return 0}return fetch}var _fabs=Math_abs;function _getenv(name){if(name===0)return 0;name=UTF8ToString(name);if(!ENV.hasOwnProperty(name))return 0;if(_getenv.ret)_free(_getenv.ret);_getenv.ret=allocateUTF8(ENV[name]);return _getenv.ret}function _gettimeofday(ptr){var now=Date.now();HEAP32[ptr>>2]=now/1e3|0;HEAP32[ptr+4>>2]=now%1e3*1e3|0;return 0}var ___tm_timezone=(stringToUTF8("GMT",1128272,4),1128272);function _gmtime_r(time,tmPtr){var date=new Date(HEAP32[time>>2]*1e3);HEAP32[tmPtr>>2]=date.getUTCSeconds();HEAP32[tmPtr+4>>2]=date.getUTCMinutes();HEAP32[tmPtr+8>>2]=date.getUTCHours();HEAP32[tmPtr+12>>2]=date.getUTCDate();HEAP32[tmPtr+16>>2]=date.getUTCMonth();HEAP32[tmPtr+20>>2]=date.getUTCFullYear()-1900;HEAP32[tmPtr+24>>2]=date.getUTCDay();HEAP32[tmPtr+36>>2]=0;HEAP32[tmPtr+32>>2]=0;var start=Date.UTC(date.getUTCFullYear(),0,1,0,0,0,0);var yday=(date.getTime()-start)/(1e3*60*60*24)|0;HEAP32[tmPtr+28>>2]=yday;HEAP32[tmPtr+40>>2]=___tm_timezone;return tmPtr}function _llvm_exp2_f32(x){return Math.pow(2,x)}function _llvm_exp2_f64(a0){return _llvm_exp2_f32(a0)}function _llvm_log2_f32(x){return Math.log(x)/Math.LN2}function _llvm_stackrestore(p){var self=_llvm_stacksave;var ret=self.LLVM_SAVEDSTACKS[p];self.LLVM_SAVEDSTACKS.splice(p,1);stackRestore(ret)}function _llvm_stacksave(){var self=_llvm_stacksave;if(!self.LLVM_SAVEDSTACKS){self.LLVM_SAVEDSTACKS=[]}self.LLVM_SAVEDSTACKS.push(stackSave());return self.LLVM_SAVEDSTACKS.length-1}var _llvm_trunc_f64=Math_trunc;function _tzset(){if(_tzset.called)return;_tzset.called=true;HEAP32[__get_timezone()>>2]=(new Date).getTimezoneOffset()*60;var currentYear=(new Date).getFullYear();var winter=new Date(currentYear,0,1);var summer=new Date(currentYear,6,1);HEAP32[__get_daylight()>>2]=Number(winter.getTimezoneOffset()!=summer.getTimezoneOffset());function extractZone(date){var match=date.toTimeString().match(/\(([A-Za-z ]+)\)$/);return match?match[1]:"GMT"}var winterName=extractZone(winter);var summerName=extractZone(summer);var winterNamePtr=allocate(intArrayFromString(winterName),"i8",ALLOC_NORMAL);var summerNamePtr=allocate(intArrayFromString(summerName),"i8",ALLOC_NORMAL);if(summer.getTimezoneOffset()>2]=winterNamePtr;HEAP32[__get_tzname()+4>>2]=summerNamePtr}else{HEAP32[__get_tzname()>>2]=summerNamePtr;HEAP32[__get_tzname()+4>>2]=winterNamePtr}}function _localtime_r(time,tmPtr){_tzset();var date=new Date(HEAP32[time>>2]*1e3);HEAP32[tmPtr>>2]=date.getSeconds();HEAP32[tmPtr+4>>2]=date.getMinutes();HEAP32[tmPtr+8>>2]=date.getHours();HEAP32[tmPtr+12>>2]=date.getDate();HEAP32[tmPtr+16>>2]=date.getMonth();HEAP32[tmPtr+20>>2]=date.getFullYear()-1900;HEAP32[tmPtr+24>>2]=date.getDay();var start=new Date(date.getFullYear(),0,1);var yday=(date.getTime()-start.getTime())/(1e3*60*60*24)|0;HEAP32[tmPtr+28>>2]=yday;HEAP32[tmPtr+36>>2]=-(date.getTimezoneOffset()*60);var summerOffset=new Date(date.getFullYear(),6,1).getTimezoneOffset();var winterOffset=start.getTimezoneOffset();var dst=(summerOffset!=winterOffset&&date.getTimezoneOffset()==Math.min(winterOffset,summerOffset))|0;HEAP32[tmPtr+32>>2]=dst;var zonePtr=HEAP32[__get_tzname()+(dst?4:0)>>2];HEAP32[tmPtr+40>>2]=zonePtr;return tmPtr}function _emscripten_memcpy_big(dest,src,num){HEAPU8.set(HEAPU8.subarray(src,src+num),dest)}function _usleep(useconds){var msec=useconds/1e3;if((ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)&&self["performance"]&&self["performance"]["now"]){var start=self["performance"]["now"]();while(self["performance"]["now"]()-start>2];var nanoseconds=HEAP32[rqtp+4>>2];if(nanoseconds<0||nanoseconds>999999999||seconds<0){___setErrNo(28);return-1}if(rmtp!==0){HEAP32[rmtp>>2]=0;HEAP32[rmtp+4>>2]=0}return _usleep(seconds*1e6+nanoseconds/1e3)}function _pthread_cond_destroy(){return 0}function _pthread_cond_init(){return 0}function _pthread_create(){return 6}function _pthread_join(){}function __isLeapYear(year){return year%4===0&&(year%100!==0||year%400===0)}function __arraySum(array,index){var sum=0;for(var i=0;i<=index;sum+=array[i++]);return sum}var __MONTH_DAYS_LEAP=[31,29,31,30,31,30,31,31,30,31,30,31];var __MONTH_DAYS_REGULAR=[31,28,31,30,31,30,31,31,30,31,30,31];function __addDays(date,days){var newDate=new Date(date.getTime());while(days>0){var leap=__isLeapYear(newDate.getFullYear());var currentMonth=newDate.getMonth();var daysInCurrentMonth=(leap?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR)[currentMonth];if(days>daysInCurrentMonth-newDate.getDate()){days-=daysInCurrentMonth-newDate.getDate()+1;newDate.setDate(1);if(currentMonth<11){newDate.setMonth(currentMonth+1)}else{newDate.setMonth(0);newDate.setFullYear(newDate.getFullYear()+1)}}else{newDate.setDate(newDate.getDate()+days);return newDate}}return newDate}function _strftime(s,maxsize,format,tm){var tm_zone=HEAP32[tm+40>>2];var date={tm_sec:HEAP32[tm>>2],tm_min:HEAP32[tm+4>>2],tm_hour:HEAP32[tm+8>>2],tm_mday:HEAP32[tm+12>>2],tm_mon:HEAP32[tm+16>>2],tm_year:HEAP32[tm+20>>2],tm_wday:HEAP32[tm+24>>2],tm_yday:HEAP32[tm+28>>2],tm_isdst:HEAP32[tm+32>>2],tm_gmtoff:HEAP32[tm+36>>2],tm_zone:tm_zone?UTF8ToString(tm_zone):""};var pattern=UTF8ToString(format);var EXPANSION_RULES_1={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var rule in EXPANSION_RULES_1){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_1[rule])}var WEEKDAYS=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var MONTHS=["January","February","March","April","May","June","July","August","September","October","November","December"];function leadingSomething(value,digits,character){var str=typeof value==="number"?value.toString():value||"";while(str.length0?1:0}var compare;if((compare=sgn(date1.getFullYear()-date2.getFullYear()))===0){if((compare=sgn(date1.getMonth()-date2.getMonth()))===0){compare=sgn(date1.getDate()-date2.getDate())}}return compare}function getFirstWeekStartDate(janFourth){switch(janFourth.getDay()){case 0:return new Date(janFourth.getFullYear()-1,11,29);case 1:return janFourth;case 2:return new Date(janFourth.getFullYear(),0,3);case 3:return new Date(janFourth.getFullYear(),0,2);case 4:return new Date(janFourth.getFullYear(),0,1);case 5:return new Date(janFourth.getFullYear()-1,11,31);case 6:return new Date(janFourth.getFullYear()-1,11,30)}}function getWeekBasedYear(date){var thisDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);var janFourthThisYear=new Date(thisDate.getFullYear(),0,4);var janFourthNextYear=new Date(thisDate.getFullYear()+1,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);if(compareByDay(firstWeekStartThisYear,thisDate)<=0){if(compareByDay(firstWeekStartNextYear,thisDate)<=0){return thisDate.getFullYear()+1}else{return thisDate.getFullYear()}}else{return thisDate.getFullYear()-1}}var EXPANSION_RULES_2={"%a":function(date){return WEEKDAYS[date.tm_wday].substring(0,3)},"%A":function(date){return WEEKDAYS[date.tm_wday]},"%b":function(date){return MONTHS[date.tm_mon].substring(0,3)},"%B":function(date){return MONTHS[date.tm_mon]},"%C":function(date){var year=date.tm_year+1900;return leadingNulls(year/100|0,2)},"%d":function(date){return leadingNulls(date.tm_mday,2)},"%e":function(date){return leadingSomething(date.tm_mday,2," ")},"%g":function(date){return getWeekBasedYear(date).toString().substring(2)},"%G":function(date){return getWeekBasedYear(date)},"%H":function(date){return leadingNulls(date.tm_hour,2)},"%I":function(date){var twelveHour=date.tm_hour;if(twelveHour==0)twelveHour=12;else if(twelveHour>12)twelveHour-=12;return leadingNulls(twelveHour,2)},"%j":function(date){return leadingNulls(date.tm_mday+__arraySum(__isLeapYear(date.tm_year+1900)?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,date.tm_mon-1),3)},"%m":function(date){return leadingNulls(date.tm_mon+1,2)},"%M":function(date){return leadingNulls(date.tm_min,2)},"%n":function(){return"\n"},"%p":function(date){if(date.tm_hour>=0&&date.tm_hour<12){return"AM"}else{return"PM"}},"%S":function(date){return leadingNulls(date.tm_sec,2)},"%t":function(){return"\t"},"%u":function(date){return date.tm_wday||7},"%U":function(date){var janFirst=new Date(date.tm_year+1900,0,1);var firstSunday=janFirst.getDay()===0?janFirst:__addDays(janFirst,7-janFirst.getDay());var endDate=new Date(date.tm_year+1900,date.tm_mon,date.tm_mday);if(compareByDay(firstSunday,endDate)<0){var februaryFirstUntilEndMonth=__arraySum(__isLeapYear(endDate.getFullYear())?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,endDate.getMonth()-1)-31;var firstSundayUntilEndJanuary=31-firstSunday.getDate();var days=firstSundayUntilEndJanuary+februaryFirstUntilEndMonth+endDate.getDate();return leadingNulls(Math.ceil(days/7),2)}return compareByDay(firstSunday,janFirst)===0?"01":"00"},"%V":function(date){var janFourthThisYear=new Date(date.tm_year+1900,0,4);var janFourthNextYear=new Date(date.tm_year+1901,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);var endDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);if(compareByDay(endDate,firstWeekStartThisYear)<0){return"53"}if(compareByDay(firstWeekStartNextYear,endDate)<=0){return"01"}var daysDifference;if(firstWeekStartThisYear.getFullYear()=0;off=Math.abs(off)/60;off=off/60*100+off%60;return(ahead?"+":"-")+String("0000"+off).slice(-4)},"%Z":function(date){return date.tm_zone},"%%":function(){return"%"}};for(var rule in EXPANSION_RULES_2){if(pattern.indexOf(rule)>=0){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_2[rule](date))}}var bytes=intArrayFromString(pattern,false);if(bytes.length>maxsize){return 0}writeArrayToMemory(bytes,s);return bytes.length-1}function _sysconf(name){switch(name){case 30:return PAGE_SIZE;case 85:var maxHeapSize=2*1024*1024*1024-65536;return maxHeapSize/PAGE_SIZE;case 132:case 133:case 12:case 137:case 138:case 15:case 235:case 16:case 17:case 18:case 19:case 20:case 149:case 13:case 10:case 236:case 153:case 9:case 21:case 22:case 159:case 154:case 14:case 77:case 78:case 139:case 80:case 81:case 82:case 68:case 67:case 164:case 11:case 29:case 47:case 48:case 95:case 52:case 51:case 46:return 200809;case 79:return 0;case 27:case 246:case 127:case 128:case 23:case 24:case 160:case 161:case 181:case 182:case 242:case 183:case 184:case 243:case 244:case 245:case 165:case 178:case 179:case 49:case 50:case 168:case 169:case 175:case 170:case 171:case 172:case 97:case 76:case 32:case 173:case 35:return-1;case 176:case 177:case 7:case 155:case 8:case 157:case 125:case 126:case 92:case 93:case 129:case 130:case 131:case 94:case 91:return 1;case 74:case 60:case 69:case 70:case 4:return 1024;case 31:case 42:case 72:return 32;case 87:case 26:case 33:return 2147483647;case 34:case 1:return 47839;case 38:case 36:return 99;case 43:case 37:return 2048;case 0:return 2097152;case 3:return 65536;case 28:return 32768;case 44:return 32767;case 75:return 16384;case 39:return 1e3;case 89:return 700;case 71:return 256;case 40:return 255;case 2:return 100;case 180:return 64;case 25:return 20;case 5:return 16;case 6:return 6;case 73:return 4;case 84:{if(typeof navigator==="object")return navigator["hardwareConcurrency"]||1;return 1}}___setErrNo(28);return-1}function _time(ptr){var ret=Date.now()/1e3|0;if(ptr){HEAP32[ptr>>2]=ret}return ret}FS.staticInit();if(ENVIRONMENT_HAS_NODE){var fs=require("fs");var NODEJS_PATH=require("path");NODEFS.staticInit()}if(ENVIRONMENT_IS_NODE){_emscripten_get_now=function _emscripten_get_now_actual(){var t=process["hrtime"]();return t[0]*1e3+t[1]/1e6}}else if(typeof dateNow!=="undefined"){_emscripten_get_now=dateNow}else if(typeof performance==="object"&&performance&&typeof performance["now"]==="function"){_emscripten_get_now=function(){return performance["now"]()}}else{_emscripten_get_now=Date.now}Fetch.staticInit();function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array}var debug_table_dd=[0,"jsCall_dd_0","jsCall_dd_1","jsCall_dd_2","jsCall_dd_3","jsCall_dd_4","jsCall_dd_5","jsCall_dd_6","jsCall_dd_7","jsCall_dd_8","jsCall_dd_9","jsCall_dd_10","jsCall_dd_11","jsCall_dd_12","jsCall_dd_13","jsCall_dd_14","jsCall_dd_15","jsCall_dd_16","jsCall_dd_17","jsCall_dd_18","jsCall_dd_19","jsCall_dd_20","jsCall_dd_21","jsCall_dd_22","jsCall_dd_23","jsCall_dd_24","jsCall_dd_25","jsCall_dd_26","jsCall_dd_27","jsCall_dd_28","jsCall_dd_29","jsCall_dd_30","jsCall_dd_31","jsCall_dd_32","jsCall_dd_33","jsCall_dd_34","_sinh","_cosh","_tanh","_sin","_cos","_tan","_atan","_asin","_acos","_exp","_log","_fabs","_etime",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];var debug_table_did=[0,"jsCall_did_0","jsCall_did_1","jsCall_did_2","jsCall_did_3","jsCall_did_4","jsCall_did_5","jsCall_did_6","jsCall_did_7","jsCall_did_8","jsCall_did_9","jsCall_did_10","jsCall_did_11","jsCall_did_12","jsCall_did_13","jsCall_did_14","jsCall_did_15","jsCall_did_16","jsCall_did_17","jsCall_did_18","jsCall_did_19","jsCall_did_20","jsCall_did_21","jsCall_did_22","jsCall_did_23","jsCall_did_24","jsCall_did_25","jsCall_did_26","jsCall_did_27","jsCall_did_28","jsCall_did_29","jsCall_did_30","jsCall_did_31","jsCall_did_32","jsCall_did_33","jsCall_did_34",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,0];var debug_table_didd=[0,"jsCall_didd_0","jsCall_didd_1","jsCall_didd_2","jsCall_didd_3","jsCall_didd_4","jsCall_didd_5","jsCall_didd_6","jsCall_didd_7","jsCall_didd_8","jsCall_didd_9","jsCall_didd_10","jsCall_didd_11","jsCall_didd_12","jsCall_didd_13","jsCall_didd_14","jsCall_didd_15","jsCall_didd_16","jsCall_didd_17","jsCall_didd_18","jsCall_didd_19","jsCall_didd_20","jsCall_didd_21","jsCall_didd_22","jsCall_didd_23","jsCall_didd_24","jsCall_didd_25","jsCall_didd_26","jsCall_didd_27","jsCall_didd_28","jsCall_didd_29","jsCall_didd_30","jsCall_didd_31","jsCall_didd_32","jsCall_didd_33","jsCall_didd_34",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,0];var debug_table_fii=[0,"jsCall_fii_0","jsCall_fii_1","jsCall_fii_2","jsCall_fii_3","jsCall_fii_4","jsCall_fii_5","jsCall_fii_6","jsCall_fii_7","jsCall_fii_8","jsCall_fii_9","jsCall_fii_10","jsCall_fii_11","jsCall_fii_12","jsCall_fii_13","jsCall_fii_14","jsCall_fii_15","jsCall_fii_16","jsCall_fii_17","jsCall_fii_18","jsCall_fii_19","jsCall_fii_20","jsCall_fii_21","jsCall_fii_22","jsCall_fii_23","jsCall_fii_24","jsCall_fii_25","jsCall_fii_26","jsCall_fii_27","jsCall_fii_28","jsCall_fii_29","jsCall_fii_30","jsCall_fii_31","jsCall_fii_32","jsCall_fii_33","jsCall_fii_34","_sbr_sum_square_c",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];var debug_table_fiii=[0,"jsCall_fiii_0","jsCall_fiii_1","jsCall_fiii_2","jsCall_fiii_3","jsCall_fiii_4","jsCall_fiii_5","jsCall_fiii_6","jsCall_fiii_7","jsCall_fiii_8","jsCall_fiii_9","jsCall_fiii_10","jsCall_fiii_11","jsCall_fiii_12","jsCall_fiii_13","jsCall_fiii_14","jsCall_fiii_15","jsCall_fiii_16","jsCall_fiii_17","jsCall_fiii_18","jsCall_fiii_19","jsCall_fiii_20","jsCall_fiii_21","jsCall_fiii_22","jsCall_fiii_23","jsCall_fiii_24","jsCall_fiii_25","jsCall_fiii_26","jsCall_fiii_27","jsCall_fiii_28","jsCall_fiii_29","jsCall_fiii_30","jsCall_fiii_31","jsCall_fiii_32","jsCall_fiii_33","jsCall_fiii_34","_avpriv_scalarproduct_float_c",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];var debug_table_ii=[0,"jsCall_ii_0","jsCall_ii_1","jsCall_ii_2","jsCall_ii_3","jsCall_ii_4","jsCall_ii_5","jsCall_ii_6","jsCall_ii_7","jsCall_ii_8","jsCall_ii_9","jsCall_ii_10","jsCall_ii_11","jsCall_ii_12","jsCall_ii_13","jsCall_ii_14","jsCall_ii_15","jsCall_ii_16","jsCall_ii_17","jsCall_ii_18","jsCall_ii_19","jsCall_ii_20","jsCall_ii_21","jsCall_ii_22","jsCall_ii_23","jsCall_ii_24","jsCall_ii_25","jsCall_ii_26","jsCall_ii_27","jsCall_ii_28","jsCall_ii_29","jsCall_ii_30","jsCall_ii_31","jsCall_ii_32","jsCall_ii_33","jsCall_ii_34","_av_default_item_name","_ff_avio_child_class_next","_flv_probe","_flv_read_header","_flv_read_close","_live_flv_probe","_mov_probe","_mov_read_header","_mov_read_close","_mpegts_probe","_mpegts_read_header","_mpegts_read_close","_format_to_name","_format_child_class_next","_get_category","_urlcontext_to_name","_ff_urlcontext_child_class_next","_sws_context_to_name","_ff_bsf_child_class_next","_hevc_mp4toannexb_init","_hevc_init_thread_copy","_hevc_decode_init","_hevc_decode_free","_context_to_name","_codec_child_class_next","_get_category_2293","_aac_decode_init","_aac_decode_close","_init","___stdio_close","___emscripten_stdout_close","_releaseSniffStreamFunc","_hflv_releaseFunc","_hflv_getBufferLength","_initializeDecoderFunc","__getFrame","_closeVideoFunc","_releaseFunc","_initializeDemuxerFunc","_getPacketFunc","_releaseDemuxerFunc","_io_short_seek","_avio_rb16","_avio_rl16","_av_buffer_allocz","_frame_worker_thread","_av_buffer_alloc","_thread_worker",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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];var debug_table_iid=[0,"jsCall_iid_0","jsCall_iid_1","jsCall_iid_2","jsCall_iid_3","jsCall_iid_4","jsCall_iid_5","jsCall_iid_6","jsCall_iid_7","jsCall_iid_8","jsCall_iid_9","jsCall_iid_10","jsCall_iid_11","jsCall_iid_12","jsCall_iid_13","jsCall_iid_14","jsCall_iid_15","jsCall_iid_16","jsCall_iid_17","jsCall_iid_18","jsCall_iid_19","jsCall_iid_20","jsCall_iid_21","jsCall_iid_22","jsCall_iid_23","jsCall_iid_24","jsCall_iid_25","jsCall_iid_26","jsCall_iid_27","jsCall_iid_28","jsCall_iid_29","jsCall_iid_30","jsCall_iid_31","jsCall_iid_32","jsCall_iid_33","jsCall_iid_34","_seekBufferFunc",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];var debug_table_iidiiii=[0,"jsCall_iidiiii_0","jsCall_iidiiii_1","jsCall_iidiiii_2","jsCall_iidiiii_3","jsCall_iidiiii_4","jsCall_iidiiii_5","jsCall_iidiiii_6","jsCall_iidiiii_7","jsCall_iidiiii_8","jsCall_iidiiii_9","jsCall_iidiiii_10","jsCall_iidiiii_11","jsCall_iidiiii_12","jsCall_iidiiii_13","jsCall_iidiiii_14","jsCall_iidiiii_15","jsCall_iidiiii_16","jsCall_iidiiii_17","jsCall_iidiiii_18","jsCall_iidiiii_19","jsCall_iidiiii_20","jsCall_iidiiii_21","jsCall_iidiiii_22","jsCall_iidiiii_23","jsCall_iidiiii_24","jsCall_iidiiii_25","jsCall_iidiiii_26","jsCall_iidiiii_27","jsCall_iidiiii_28","jsCall_iidiiii_29","jsCall_iidiiii_30","jsCall_iidiiii_31","jsCall_iidiiii_32","jsCall_iidiiii_33","jsCall_iidiiii_34","_fmt_fp",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];var debug_table_iii=[0,"jsCall_iii_0","jsCall_iii_1","jsCall_iii_2","jsCall_iii_3","jsCall_iii_4","jsCall_iii_5","jsCall_iii_6","jsCall_iii_7","jsCall_iii_8","jsCall_iii_9","jsCall_iii_10","jsCall_iii_11","jsCall_iii_12","jsCall_iii_13","jsCall_iii_14","jsCall_iii_15","jsCall_iii_16","jsCall_iii_17","jsCall_iii_18","jsCall_iii_19","jsCall_iii_20","jsCall_iii_21","jsCall_iii_22","jsCall_iii_23","jsCall_iii_24","jsCall_iii_25","jsCall_iii_26","jsCall_iii_27","jsCall_iii_28","jsCall_iii_29","jsCall_iii_30","jsCall_iii_31","jsCall_iii_32","jsCall_iii_33","jsCall_iii_34","_ff_avio_child_next","_flv_read_packet","_mov_read_packet","_mpegts_read_packet","_mpegts_raw_read_packet","_format_child_next","_urlcontext_child_next","_bsf_child_next","_hevc_mp4toannexb_filter","_hevc_update_thread_context","_null_filter","_codec_child_next","_initSniffStreamFunc","_hflv_initFunc","_hflv_getPacketFunc","_io_read_pause","_descriptor_compare","_hls_decode_entry","_avcodec_default_get_format","_ff_startcode_find_candidate_c","_color_table_compare",0,0,0,0,0,0,0];var debug_table_iiii=[0,"jsCall_iiii_0","jsCall_iiii_1","jsCall_iiii_2","jsCall_iiii_3","jsCall_iiii_4","jsCall_iiii_5","jsCall_iiii_6","jsCall_iiii_7","jsCall_iiii_8","jsCall_iiii_9","jsCall_iiii_10","jsCall_iiii_11","jsCall_iiii_12","jsCall_iiii_13","jsCall_iiii_14","jsCall_iiii_15","jsCall_iiii_16","jsCall_iiii_17","jsCall_iiii_18","jsCall_iiii_19","jsCall_iiii_20","jsCall_iiii_21","jsCall_iiii_22","jsCall_iiii_23","jsCall_iiii_24","jsCall_iiii_25","jsCall_iiii_26","jsCall_iiii_27","jsCall_iiii_28","jsCall_iiii_29","jsCall_iiii_30","jsCall_iiii_31","jsCall_iiii_32","jsCall_iiii_33","jsCall_iiii_34","_mov_read_aclr","_mov_read_avid","_mov_read_ares","_mov_read_avss","_mov_read_av1c","_mov_read_chpl","_mov_read_stco","_mov_read_colr","_mov_read_ctts","_mov_read_default","_mov_read_dpxe","_mov_read_dref","_mov_read_elst","_mov_read_enda","_mov_read_fiel","_mov_read_adrm","_mov_read_ftyp","_mov_read_glbl","_mov_read_hdlr","_mov_read_ilst","_mov_read_jp2h","_mov_read_mdat","_mov_read_mdhd","_mov_read_meta","_mov_read_moof","_mov_read_moov","_mov_read_mvhd","_mov_read_svq3","_mov_read_alac","_mov_read_pasp","_mov_read_sidx","_mov_read_stps","_mov_read_strf","_mov_read_stsc","_mov_read_stsd","_mov_read_stss","_mov_read_stsz","_mov_read_stts","_mov_read_tkhd","_mov_read_tfdt","_mov_read_tfhd","_mov_read_trak","_mov_read_tmcd","_mov_read_chap","_mov_read_trex","_mov_read_trun","_mov_read_wave","_mov_read_esds","_mov_read_dac3","_mov_read_dec3","_mov_read_ddts","_mov_read_wide","_mov_read_wfex","_mov_read_cmov","_mov_read_chan","_mov_read_dvc1","_mov_read_sbgp","_mov_read_uuid","_mov_read_targa_y216","_mov_read_free","_mov_read_custom","_mov_read_frma","_mov_read_senc","_mov_read_saiz","_mov_read_saio","_mov_read_pssh","_mov_read_schm","_mov_read_tenc","_mov_read_dfla","_mov_read_st3d","_mov_read_sv3d","_mov_read_dops","_mov_read_smdm","_mov_read_coll","_mov_read_vpcc","_mov_read_mdcv","_mov_read_clli","_h264_split","_hevc_split","___stdio_write","_sn_write","_read_stream_live","_read_stream_vod","_getSniffStreamPacketFunc","_hflv_read_stream_live","_setCodecTypeFunc","_read_packet","_io_write_packet","_io_read_packet","_dyn_buf_write","_mov_read_keys","_mov_read_udta_string","_avcodec_default_get_buffer2","_do_read",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,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,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,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];var debug_table_iiiii=[0,"jsCall_iiiii_0","jsCall_iiiii_1","jsCall_iiiii_2","jsCall_iiiii_3","jsCall_iiiii_4","jsCall_iiiii_5","jsCall_iiiii_6","jsCall_iiiii_7","jsCall_iiiii_8","jsCall_iiiii_9","jsCall_iiiii_10","jsCall_iiiii_11","jsCall_iiiii_12","jsCall_iiiii_13","jsCall_iiiii_14","jsCall_iiiii_15","jsCall_iiiii_16","jsCall_iiiii_17","jsCall_iiiii_18","jsCall_iiiii_19","jsCall_iiiii_20","jsCall_iiiii_21","jsCall_iiiii_22","jsCall_iiiii_23","jsCall_iiiii_24","jsCall_iiiii_25","jsCall_iiiii_26","jsCall_iiiii_27","jsCall_iiiii_28","jsCall_iiiii_29","jsCall_iiiii_30","jsCall_iiiii_31","jsCall_iiiii_32","jsCall_iiiii_33","jsCall_iiiii_34","_hevc_decode_frame","_aac_decode_frame","_hflv_pushBufferFunc","_demuxBoxFunc","_mov_metadata_int8_no_padding","_mov_metadata_track_or_disc_number","_mov_metadata_gnre","_mov_metadata_int8_bypass_padding","_lum_planar_vscale","_chr_planar_vscale","_any_vscale","_packed_vscale","_gamma_convert","_lum_convert","_lum_h_scale","_chr_convert","_chr_h_scale","_no_chr_scale","_hls_decode_entry_wpp",0,0,0,0,0,0,0,0,0];var debug_table_iiiiii=[0,"jsCall_iiiiii_0","jsCall_iiiiii_1","jsCall_iiiiii_2","jsCall_iiiiii_3","jsCall_iiiiii_4","jsCall_iiiiii_5","jsCall_iiiiii_6","jsCall_iiiiii_7","jsCall_iiiiii_8","jsCall_iiiiii_9","jsCall_iiiiii_10","jsCall_iiiiii_11","jsCall_iiiiii_12","jsCall_iiiiii_13","jsCall_iiiiii_14","jsCall_iiiiii_15","jsCall_iiiiii_16","jsCall_iiiiii_17","jsCall_iiiiii_18","jsCall_iiiiii_19","jsCall_iiiiii_20","jsCall_iiiiii_21","jsCall_iiiiii_22","jsCall_iiiiii_23","jsCall_iiiiii_24","jsCall_iiiiii_25","jsCall_iiiiii_26","jsCall_iiiiii_27","jsCall_iiiiii_28","jsCall_iiiiii_29","jsCall_iiiiii_30","jsCall_iiiiii_31","jsCall_iiiiii_32","jsCall_iiiiii_33","jsCall_iiiiii_34","_pushBufferFunc","_decodeCodecContextFunc","_io_open_default","_avcodec_default_execute2","_thread_execute2","_sbr_lf_gen",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];var debug_table_iiiiiii=[0,"jsCall_iiiiiii_0","jsCall_iiiiiii_1","jsCall_iiiiiii_2","jsCall_iiiiiii_3","jsCall_iiiiiii_4","jsCall_iiiiiii_5","jsCall_iiiiiii_6","jsCall_iiiiiii_7","jsCall_iiiiiii_8","jsCall_iiiiiii_9","jsCall_iiiiiii_10","jsCall_iiiiiii_11","jsCall_iiiiiii_12","jsCall_iiiiiii_13","jsCall_iiiiiii_14","jsCall_iiiiiii_15","jsCall_iiiiiii_16","jsCall_iiiiiii_17","jsCall_iiiiiii_18","jsCall_iiiiiii_19","jsCall_iiiiiii_20","jsCall_iiiiiii_21","jsCall_iiiiiii_22","jsCall_iiiiiii_23","jsCall_iiiiiii_24","jsCall_iiiiiii_25","jsCall_iiiiiii_26","jsCall_iiiiiii_27","jsCall_iiiiiii_28","jsCall_iiiiiii_29","jsCall_iiiiiii_30","jsCall_iiiiiii_31","jsCall_iiiiiii_32","jsCall_iiiiiii_33","jsCall_iiiiiii_34","_h264_parse","_hevc_parse","_hflv_decodeVideoFrameFunc","_avcodec_default_execute","_thread_execute","_sbr_x_gen",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];var debug_table_iiiiiiii=[0,"jsCall_iiiiiiii_0","jsCall_iiiiiiii_1","jsCall_iiiiiiii_2","jsCall_iiiiiiii_3","jsCall_iiiiiiii_4","jsCall_iiiiiiii_5","jsCall_iiiiiiii_6","jsCall_iiiiiiii_7","jsCall_iiiiiiii_8","jsCall_iiiiiiii_9","jsCall_iiiiiiii_10","jsCall_iiiiiiii_11","jsCall_iiiiiiii_12","jsCall_iiiiiiii_13","jsCall_iiiiiiii_14","jsCall_iiiiiiii_15","jsCall_iiiiiiii_16","jsCall_iiiiiiii_17","jsCall_iiiiiiii_18","jsCall_iiiiiiii_19","jsCall_iiiiiiii_20","jsCall_iiiiiiii_21","jsCall_iiiiiiii_22","jsCall_iiiiiiii_23","jsCall_iiiiiiii_24","jsCall_iiiiiiii_25","jsCall_iiiiiiii_26","jsCall_iiiiiiii_27","jsCall_iiiiiiii_28","jsCall_iiiiiiii_29","jsCall_iiiiiiii_30","jsCall_iiiiiiii_31","jsCall_iiiiiiii_32","jsCall_iiiiiiii_33","jsCall_iiiiiiii_34","_decodeVideoFrameFunc","_setSniffStreamCodecTypeFunc","_hflv_setSniffStreamCodecTypeFunc","_swscale","_ff_sws_alphablendaway","_yuv2rgb_c_32","_yuva2rgba_c","_yuv2rgb_c_bgr48","_yuv2rgb_c_48","_yuva2argb_c","_yuv2rgb_c_24_rgb","_yuv2rgb_c_24_bgr","_yuv2rgb_c_16_ordered_dither","_yuv2rgb_c_15_ordered_dither","_yuv2rgb_c_12_ordered_dither","_yuv2rgb_c_8_ordered_dither","_yuv2rgb_c_4_ordered_dither","_yuv2rgb_c_4b_ordered_dither","_yuv2rgb_c_1_ordered_dither","_planarToP01xWrapper","_planar8ToP01xleWrapper","_yvu9ToYv12Wrapper","_bgr24ToYv12Wrapper","_rgbToRgbWrapper","_planarRgbToplanarRgbWrapper","_planarRgbToRgbWrapper","_planarRgbaToRgbWrapper","_Rgb16ToPlanarRgb16Wrapper","_planarRgb16ToRgb16Wrapper","_rgbToPlanarRgbWrapper","_bayer_to_rgb24_wrapper","_bayer_to_yv12_wrapper","_bswap_16bpc","_palToRgbWrapper","_yuv422pToYuy2Wrapper","_yuv422pToUyvyWrapper","_uint_y_to_float_y_wrapper","_float_y_to_uint_y_wrapper","_planarToYuy2Wrapper","_planarToUyvyWrapper","_yuyvToYuv420Wrapper","_uyvyToYuv420Wrapper","_yuyvToYuv422Wrapper","_uyvyToYuv422Wrapper","_packedCopyWrapper","_planarCopyWrapper","_planarToNv12Wrapper","_planarToNv24Wrapper","_nv12ToPlanarWrapper","_nv24ToPlanarWrapper",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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];var debug_table_iiiiij=[0,"jsCall_iiiiij_0","jsCall_iiiiij_1","jsCall_iiiiij_2","jsCall_iiiiij_3","jsCall_iiiiij_4","jsCall_iiiiij_5","jsCall_iiiiij_6","jsCall_iiiiij_7","jsCall_iiiiij_8","jsCall_iiiiij_9","jsCall_iiiiij_10","jsCall_iiiiij_11","jsCall_iiiiij_12","jsCall_iiiiij_13","jsCall_iiiiij_14","jsCall_iiiiij_15","jsCall_iiiiij_16","jsCall_iiiiij_17","jsCall_iiiiij_18","jsCall_iiiiij_19","jsCall_iiiiij_20","jsCall_iiiiij_21","jsCall_iiiiij_22","jsCall_iiiiij_23","jsCall_iiiiij_24","jsCall_iiiiij_25","jsCall_iiiiij_26","jsCall_iiiiij_27","jsCall_iiiiij_28","jsCall_iiiiij_29","jsCall_iiiiij_30","jsCall_iiiiij_31","jsCall_iiiiij_32","jsCall_iiiiij_33","jsCall_iiiiij_34","_mpegts_push_data",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];var debug_table_iiiji=[0,"jsCall_iiiji_0","jsCall_iiiji_1","jsCall_iiiji_2","jsCall_iiiji_3","jsCall_iiiji_4","jsCall_iiiji_5","jsCall_iiiji_6","jsCall_iiiji_7","jsCall_iiiji_8","jsCall_iiiji_9","jsCall_iiiji_10","jsCall_iiiji_11","jsCall_iiiji_12","jsCall_iiiji_13","jsCall_iiiji_14","jsCall_iiiji_15","jsCall_iiiji_16","jsCall_iiiji_17","jsCall_iiiji_18","jsCall_iiiji_19","jsCall_iiiji_20","jsCall_iiiji_21","jsCall_iiiji_22","jsCall_iiiji_23","jsCall_iiiji_24","jsCall_iiiji_25","jsCall_iiiji_26","jsCall_iiiji_27","jsCall_iiiji_28","jsCall_iiiji_29","jsCall_iiiji_30","jsCall_iiiji_31","jsCall_iiiji_32","jsCall_iiiji_33","jsCall_iiiji_34","_flv_read_seek","_mov_read_seek",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];var debug_table_iiijjji=[0,"jsCall_iiijjji_0","jsCall_iiijjji_1","jsCall_iiijjji_2","jsCall_iiijjji_3","jsCall_iiijjji_4","jsCall_iiijjji_5","jsCall_iiijjji_6","jsCall_iiijjji_7","jsCall_iiijjji_8","jsCall_iiijjji_9","jsCall_iiijjji_10","jsCall_iiijjji_11","jsCall_iiijjji_12","jsCall_iiijjji_13","jsCall_iiijjji_14","jsCall_iiijjji_15","jsCall_iiijjji_16","jsCall_iiijjji_17","jsCall_iiijjji_18","jsCall_iiijjji_19","jsCall_iiijjji_20","jsCall_iiijjji_21","jsCall_iiijjji_22","jsCall_iiijjji_23","jsCall_iiijjji_24","jsCall_iiijjji_25","jsCall_iiijjji_26","jsCall_iiijjji_27","jsCall_iiijjji_28","jsCall_iiijjji_29","jsCall_iiijjji_30","jsCall_iiijjji_31","jsCall_iiijjji_32","jsCall_iiijjji_33","jsCall_iiijjji_34",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,0];var debug_table_jiiij=[0,"jsCall_jiiij_0","jsCall_jiiij_1","jsCall_jiiij_2","jsCall_jiiij_3","jsCall_jiiij_4","jsCall_jiiij_5","jsCall_jiiij_6","jsCall_jiiij_7","jsCall_jiiij_8","jsCall_jiiij_9","jsCall_jiiij_10","jsCall_jiiij_11","jsCall_jiiij_12","jsCall_jiiij_13","jsCall_jiiij_14","jsCall_jiiij_15","jsCall_jiiij_16","jsCall_jiiij_17","jsCall_jiiij_18","jsCall_jiiij_19","jsCall_jiiij_20","jsCall_jiiij_21","jsCall_jiiij_22","jsCall_jiiij_23","jsCall_jiiij_24","jsCall_jiiij_25","jsCall_jiiij_26","jsCall_jiiij_27","jsCall_jiiij_28","jsCall_jiiij_29","jsCall_jiiij_30","jsCall_jiiij_31","jsCall_jiiij_32","jsCall_jiiij_33","jsCall_jiiij_34","_mpegts_get_dts",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];var debug_table_jiiji=[0,"jsCall_jiiji_0","jsCall_jiiji_1","jsCall_jiiji_2","jsCall_jiiji_3","jsCall_jiiji_4","jsCall_jiiji_5","jsCall_jiiji_6","jsCall_jiiji_7","jsCall_jiiji_8","jsCall_jiiji_9","jsCall_jiiji_10","jsCall_jiiji_11","jsCall_jiiji_12","jsCall_jiiji_13","jsCall_jiiji_14","jsCall_jiiji_15","jsCall_jiiji_16","jsCall_jiiji_17","jsCall_jiiji_18","jsCall_jiiji_19","jsCall_jiiji_20","jsCall_jiiji_21","jsCall_jiiji_22","jsCall_jiiji_23","jsCall_jiiji_24","jsCall_jiiji_25","jsCall_jiiji_26","jsCall_jiiji_27","jsCall_jiiji_28","jsCall_jiiji_29","jsCall_jiiji_30","jsCall_jiiji_31","jsCall_jiiji_32","jsCall_jiiji_33","jsCall_jiiji_34","_io_read_seek",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];var debug_table_jiji=[0,"jsCall_jiji_0","jsCall_jiji_1","jsCall_jiji_2","jsCall_jiji_3","jsCall_jiji_4","jsCall_jiji_5","jsCall_jiji_6","jsCall_jiji_7","jsCall_jiji_8","jsCall_jiji_9","jsCall_jiji_10","jsCall_jiji_11","jsCall_jiji_12","jsCall_jiji_13","jsCall_jiji_14","jsCall_jiji_15","jsCall_jiji_16","jsCall_jiji_17","jsCall_jiji_18","jsCall_jiji_19","jsCall_jiji_20","jsCall_jiji_21","jsCall_jiji_22","jsCall_jiji_23","jsCall_jiji_24","jsCall_jiji_25","jsCall_jiji_26","jsCall_jiji_27","jsCall_jiji_28","jsCall_jiji_29","jsCall_jiji_30","jsCall_jiji_31","jsCall_jiji_32","jsCall_jiji_33","jsCall_jiji_34","___stdio_seek","___emscripten_stdout_seek","_seek_in_buffer","_io_seek","_dyn_buf_seek",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];var debug_table_v=[0,"jsCall_v_0","jsCall_v_1","jsCall_v_2","jsCall_v_3","jsCall_v_4","jsCall_v_5","jsCall_v_6","jsCall_v_7","jsCall_v_8","jsCall_v_9","jsCall_v_10","jsCall_v_11","jsCall_v_12","jsCall_v_13","jsCall_v_14","jsCall_v_15","jsCall_v_16","jsCall_v_17","jsCall_v_18","jsCall_v_19","jsCall_v_20","jsCall_v_21","jsCall_v_22","jsCall_v_23","jsCall_v_24","jsCall_v_25","jsCall_v_26","jsCall_v_27","jsCall_v_28","jsCall_v_29","jsCall_v_30","jsCall_v_31","jsCall_v_32","jsCall_v_33","jsCall_v_34","_init_ff_cos_tabs_16","_init_ff_cos_tabs_32","_init_ff_cos_tabs_64","_init_ff_cos_tabs_128","_init_ff_cos_tabs_256","_init_ff_cos_tabs_512","_init_ff_cos_tabs_1024","_init_ff_cos_tabs_2048","_init_ff_cos_tabs_4096","_init_ff_cos_tabs_8192","_init_ff_cos_tabs_16384","_init_ff_cos_tabs_32768","_init_ff_cos_tabs_65536","_init_ff_cos_tabs_131072","_introduce_mine","_introduceMineFunc","_av_format_init_next","_av_codec_init_static","_av_codec_init_next","_aac_static_table_init","_AV_CRC_8_ATM_init_table_once","_AV_CRC_8_EBU_init_table_once","_AV_CRC_16_ANSI_init_table_once","_AV_CRC_16_CCITT_init_table_once","_AV_CRC_24_IEEE_init_table_once","_AV_CRC_32_IEEE_init_table_once","_AV_CRC_32_IEEE_LE_init_table_once","_AV_CRC_16_ANSI_LE_init_table_once"];var debug_table_vdiidiiiii=[0,"jsCall_vdiidiiiii_0","jsCall_vdiidiiiii_1","jsCall_vdiidiiiii_2","jsCall_vdiidiiiii_3","jsCall_vdiidiiiii_4","jsCall_vdiidiiiii_5","jsCall_vdiidiiiii_6","jsCall_vdiidiiiii_7","jsCall_vdiidiiiii_8","jsCall_vdiidiiiii_9","jsCall_vdiidiiiii_10","jsCall_vdiidiiiii_11","jsCall_vdiidiiiii_12","jsCall_vdiidiiiii_13","jsCall_vdiidiiiii_14","jsCall_vdiidiiiii_15","jsCall_vdiidiiiii_16","jsCall_vdiidiiiii_17","jsCall_vdiidiiiii_18","jsCall_vdiidiiiii_19","jsCall_vdiidiiiii_20","jsCall_vdiidiiiii_21","jsCall_vdiidiiiii_22","jsCall_vdiidiiiii_23","jsCall_vdiidiiiii_24","jsCall_vdiidiiiii_25","jsCall_vdiidiiiii_26","jsCall_vdiidiiiii_27","jsCall_vdiidiiiii_28","jsCall_vdiidiiiii_29","jsCall_vdiidiiiii_30","jsCall_vdiidiiiii_31","jsCall_vdiidiiiii_32","jsCall_vdiidiiiii_33","jsCall_vdiidiiiii_34",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,0];var debug_table_vi=[0,"jsCall_vi_0","jsCall_vi_1","jsCall_vi_2","jsCall_vi_3","jsCall_vi_4","jsCall_vi_5","jsCall_vi_6","jsCall_vi_7","jsCall_vi_8","jsCall_vi_9","jsCall_vi_10","jsCall_vi_11","jsCall_vi_12","jsCall_vi_13","jsCall_vi_14","jsCall_vi_15","jsCall_vi_16","jsCall_vi_17","jsCall_vi_18","jsCall_vi_19","jsCall_vi_20","jsCall_vi_21","jsCall_vi_22","jsCall_vi_23","jsCall_vi_24","jsCall_vi_25","jsCall_vi_26","jsCall_vi_27","jsCall_vi_28","jsCall_vi_29","jsCall_vi_30","jsCall_vi_31","jsCall_vi_32","jsCall_vi_33","jsCall_vi_34","_free_geobtag","_free_apic","_free_chapter","_free_priv","_hevc_decode_flush","_flush","_h264_close","_hevc_parser_close","_fft4","_fft8","_fft16","_fft32","_fft64","_fft128","_fft256","_fft512","_fft1024","_fft2048","_fft4096","_fft8192","_fft16384","_fft32768","_fft65536","_fft131072","_logRequest_downloadSucceeded","_logRequest_downloadFailed","_downloadSucceeded","_downloadFailed","_transform_4x4_luma_9","_idct_4x4_dc_9","_idct_8x8_dc_9","_idct_16x16_dc_9","_idct_32x32_dc_9","_transform_4x4_luma_10","_idct_4x4_dc_10","_idct_8x8_dc_10","_idct_16x16_dc_10","_idct_32x32_dc_10","_transform_4x4_luma_12","_idct_4x4_dc_12","_idct_8x8_dc_12","_idct_16x16_dc_12","_idct_32x32_dc_12","_transform_4x4_luma_8","_idct_4x4_dc_8","_idct_8x8_dc_8","_idct_16x16_dc_8","_idct_32x32_dc_8","_main_function","_sbr_sum64x5_c","_sbr_neg_odd_64_c","_sbr_qmf_pre_shuffle_c",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,0,0,0,0,0,0,0,0,0,0,0,0,0];var debug_table_vii=[0,"jsCall_vii_0","jsCall_vii_1","jsCall_vii_2","jsCall_vii_3","jsCall_vii_4","jsCall_vii_5","jsCall_vii_6","jsCall_vii_7","jsCall_vii_8","jsCall_vii_9","jsCall_vii_10","jsCall_vii_11","jsCall_vii_12","jsCall_vii_13","jsCall_vii_14","jsCall_vii_15","jsCall_vii_16","jsCall_vii_17","jsCall_vii_18","jsCall_vii_19","jsCall_vii_20","jsCall_vii_21","jsCall_vii_22","jsCall_vii_23","jsCall_vii_24","jsCall_vii_25","jsCall_vii_26","jsCall_vii_27","jsCall_vii_28","jsCall_vii_29","jsCall_vii_30","jsCall_vii_31","jsCall_vii_32","jsCall_vii_33","jsCall_vii_34","_io_close_default","_lumRangeFromJpeg_c","_lumRangeToJpeg_c","_lumRangeFromJpeg16_c","_lumRangeToJpeg16_c","_decode_data_free","_dequant_9","_idct_4x4_9","_idct_8x8_9","_idct_16x16_9","_idct_32x32_9","_dequant_10","_idct_4x4_10","_idct_8x8_10","_idct_16x16_10","_idct_32x32_10","_dequant_12","_idct_4x4_12","_idct_8x8_12","_idct_16x16_12","_idct_32x32_12","_dequant_8","_idct_4x4_8","_idct_8x8_8","_idct_16x16_8","_idct_32x32_8","_imdct_and_windowing","_apply_ltp","_update_ltp","_imdct_and_windowing_ld","_imdct_and_windowing_eld","_imdct_and_windowing_960","_ff_h264_chroma_dc_dequant_idct_9_c","_ff_h264_chroma422_dc_dequant_idct_9_c","_ff_h264_chroma_dc_dequant_idct_10_c","_ff_h264_chroma422_dc_dequant_idct_10_c","_ff_h264_chroma_dc_dequant_idct_12_c","_ff_h264_chroma422_dc_dequant_idct_12_c","_ff_h264_chroma_dc_dequant_idct_14_c","_ff_h264_chroma422_dc_dequant_idct_14_c","_ff_h264_chroma_dc_dequant_idct_8_c","_ff_h264_chroma422_dc_dequant_idct_8_c","_hevc_pps_free","_sbr_qmf_post_shuffle_c","_sbr_qmf_deint_neg_c","_sbr_autocorrelate_c","_fft_permute_c","_fft_calc_c","_av_buffer_default_free","_pool_release_buffer","_sha1_transform","_sha256_transform","_pop_arg_long_double",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,0,0,0,0,0,0,0,0,0,0,0,0];var debug_table_viidi=[0,"jsCall_viidi_0","jsCall_viidi_1","jsCall_viidi_2","jsCall_viidi_3","jsCall_viidi_4","jsCall_viidi_5","jsCall_viidi_6","jsCall_viidi_7","jsCall_viidi_8","jsCall_viidi_9","jsCall_viidi_10","jsCall_viidi_11","jsCall_viidi_12","jsCall_viidi_13","jsCall_viidi_14","jsCall_viidi_15","jsCall_viidi_16","jsCall_viidi_17","jsCall_viidi_18","jsCall_viidi_19","jsCall_viidi_20","jsCall_viidi_21","jsCall_viidi_22","jsCall_viidi_23","jsCall_viidi_24","jsCall_viidi_25","jsCall_viidi_26","jsCall_viidi_27","jsCall_viidi_28","jsCall_viidi_29","jsCall_viidi_30","jsCall_viidi_31","jsCall_viidi_32","jsCall_viidi_33","jsCall_viidi_34","_vector_dmac_scalar_c","_vector_dmul_scalar_c",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];var debug_table_viifi=[0,"jsCall_viifi_0","jsCall_viifi_1","jsCall_viifi_2","jsCall_viifi_3","jsCall_viifi_4","jsCall_viifi_5","jsCall_viifi_6","jsCall_viifi_7","jsCall_viifi_8","jsCall_viifi_9","jsCall_viifi_10","jsCall_viifi_11","jsCall_viifi_12","jsCall_viifi_13","jsCall_viifi_14","jsCall_viifi_15","jsCall_viifi_16","jsCall_viifi_17","jsCall_viifi_18","jsCall_viifi_19","jsCall_viifi_20","jsCall_viifi_21","jsCall_viifi_22","jsCall_viifi_23","jsCall_viifi_24","jsCall_viifi_25","jsCall_viifi_26","jsCall_viifi_27","jsCall_viifi_28","jsCall_viifi_29","jsCall_viifi_30","jsCall_viifi_31","jsCall_viifi_32","jsCall_viifi_33","jsCall_viifi_34","_vector_fmac_scalar_c","_vector_fmul_scalar_c",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];var debug_table_viii=[0,"jsCall_viii_0","jsCall_viii_1","jsCall_viii_2","jsCall_viii_3","jsCall_viii_4","jsCall_viii_5","jsCall_viii_6","jsCall_viii_7","jsCall_viii_8","jsCall_viii_9","jsCall_viii_10","jsCall_viii_11","jsCall_viii_12","jsCall_viii_13","jsCall_viii_14","jsCall_viii_15","jsCall_viii_16","jsCall_viii_17","jsCall_viii_18","jsCall_viii_19","jsCall_viii_20","jsCall_viii_21","jsCall_viii_22","jsCall_viii_23","jsCall_viii_24","jsCall_viii_25","jsCall_viii_26","jsCall_viii_27","jsCall_viii_28","jsCall_viii_29","jsCall_viii_30","jsCall_viii_31","jsCall_viii_32","jsCall_viii_33","jsCall_viii_34","_avcHandleFrame","_handleFrame","_sdt_cb","_pat_cb","_pmt_cb","_scte_data_cb","_m4sl_cb","_chrRangeFromJpeg_c","_chrRangeToJpeg_c","_chrRangeFromJpeg16_c","_chrRangeToJpeg16_c","_rgb15to16_c","_rgb15tobgr24_c","_rgb15to32_c","_rgb16tobgr24_c","_rgb16to32_c","_rgb16to15_c","_rgb24tobgr16_c","_rgb24tobgr15_c","_rgb24tobgr32_c","_rgb32to16_c","_rgb32to15_c","_rgb32tobgr24_c","_rgb24to15_c","_rgb24to16_c","_rgb24tobgr24_c","_shuffle_bytes_0321_c","_shuffle_bytes_2103_c","_shuffle_bytes_1230_c","_shuffle_bytes_3012_c","_shuffle_bytes_3210_c","_rgb32tobgr16_c","_rgb32tobgr15_c","_rgb48tobgr48_bswap","_rgb48tobgr64_bswap","_rgb48to64_bswap","_rgb64to48_bswap","_rgb48tobgr48_nobswap","_rgb48tobgr64_nobswap","_rgb48to64_nobswap","_rgb64tobgr48_nobswap","_rgb64tobgr48_bswap","_rgb64to48_nobswap","_rgb12to15","_rgb15to24","_rgb16to24","_rgb32to24","_rgb24to32","_rgb12tobgr12","_rgb15tobgr15","_rgb16tobgr15","_rgb15tobgr16","_rgb16tobgr16","_rgb15tobgr32","_rgb16tobgr32","_add_residual4x4_9","_add_residual8x8_9","_add_residual16x16_9","_add_residual32x32_9","_transform_rdpcm_9","_add_residual4x4_10","_add_residual8x8_10","_add_residual16x16_10","_add_residual32x32_10","_transform_rdpcm_10","_add_residual4x4_12","_add_residual8x8_12","_add_residual16x16_12","_add_residual32x32_12","_transform_rdpcm_12","_add_residual4x4_8","_add_residual8x8_8","_add_residual16x16_8","_add_residual32x32_8","_transform_rdpcm_8","_just_return","_bswap_buf","_bswap16_buf","_ff_h264_add_pixels4_16_c","_ff_h264_add_pixels4_8_c","_ff_h264_add_pixels8_16_c","_ff_h264_add_pixels8_8_c","_ff_h264_idct_add_9_c","_ff_h264_idct8_add_9_c","_ff_h264_idct_dc_add_9_c","_ff_h264_idct8_dc_add_9_c","_ff_h264_luma_dc_dequant_idct_9_c","_ff_h264_idct_add_10_c","_ff_h264_idct8_add_10_c","_ff_h264_idct_dc_add_10_c","_ff_h264_idct8_dc_add_10_c","_ff_h264_luma_dc_dequant_idct_10_c","_ff_h264_idct_add_12_c","_ff_h264_idct8_add_12_c","_ff_h264_idct_dc_add_12_c","_ff_h264_idct8_dc_add_12_c","_ff_h264_luma_dc_dequant_idct_12_c","_ff_h264_idct_add_14_c","_ff_h264_idct8_add_14_c","_ff_h264_idct_dc_add_14_c","_ff_h264_idct8_dc_add_14_c","_ff_h264_luma_dc_dequant_idct_14_c","_ff_h264_idct_add_8_c","_ff_h264_idct8_add_8_c","_ff_h264_idct_dc_add_8_c","_ff_h264_idct8_dc_add_8_c","_ff_h264_luma_dc_dequant_idct_8_c","_sbr_qmf_deint_bfly_c","_ps_add_squares_c","_ff_imdct_calc_c","_ff_imdct_half_c","_ff_mdct_calc_c","_butterflies_float_c",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,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,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,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];var debug_table_viiii=[0,"jsCall_viiii_0","jsCall_viiii_1","jsCall_viiii_2","jsCall_viiii_3","jsCall_viiii_4","jsCall_viiii_5","jsCall_viiii_6","jsCall_viiii_7","jsCall_viiii_8","jsCall_viiii_9","jsCall_viiii_10","jsCall_viiii_11","jsCall_viiii_12","jsCall_viiii_13","jsCall_viiii_14","jsCall_viiii_15","jsCall_viiii_16","jsCall_viiii_17","jsCall_viiii_18","jsCall_viiii_19","jsCall_viiii_20","jsCall_viiii_21","jsCall_viiii_22","jsCall_viiii_23","jsCall_viiii_24","jsCall_viiii_25","jsCall_viiii_26","jsCall_viiii_27","jsCall_viiii_28","jsCall_viiii_29","jsCall_viiii_30","jsCall_viiii_31","jsCall_viiii_32","jsCall_viiii_33","jsCall_viiii_34","_planar_rgb9le_to_y","_planar_rgb10le_to_a","_planar_rgb10le_to_y","_planar_rgb12le_to_a","_planar_rgb12le_to_y","_planar_rgb14le_to_y","_planar_rgb16le_to_a","_planar_rgb16le_to_y","_planar_rgb9be_to_y","_planar_rgb10be_to_a","_planar_rgb10be_to_y","_planar_rgb12be_to_a","_planar_rgb12be_to_y","_planar_rgb14be_to_y","_planar_rgb16be_to_a","_planar_rgb16be_to_y","_planar_rgb_to_a","_planar_rgb_to_y","_gray8aToPacked32","_gray8aToPacked32_1","_gray8aToPacked24","_sws_convertPalette8ToPacked32","_sws_convertPalette8ToPacked24","_intra_pred_2_9","_intra_pred_3_9","_intra_pred_4_9","_intra_pred_5_9","_pred_planar_0_9","_pred_planar_1_9","_pred_planar_2_9","_pred_planar_3_9","_intra_pred_2_10","_intra_pred_3_10","_intra_pred_4_10","_intra_pred_5_10","_pred_planar_0_10","_pred_planar_1_10","_pred_planar_2_10","_pred_planar_3_10","_intra_pred_2_12","_intra_pred_3_12","_intra_pred_4_12","_intra_pred_5_12","_pred_planar_0_12","_pred_planar_1_12","_pred_planar_2_12","_pred_planar_3_12","_intra_pred_2_8","_intra_pred_3_8","_intra_pred_4_8","_intra_pred_5_8","_pred_planar_0_8","_pred_planar_1_8","_pred_planar_2_8","_pred_planar_3_8","_apply_tns","_windowing_and_mdct_ltp","_h264_v_loop_filter_luma_intra_9_c","_h264_h_loop_filter_luma_intra_9_c","_h264_h_loop_filter_luma_mbaff_intra_9_c","_h264_v_loop_filter_chroma_intra_9_c","_h264_h_loop_filter_chroma_intra_9_c","_h264_h_loop_filter_chroma422_intra_9_c","_h264_h_loop_filter_chroma_mbaff_intra_9_c","_h264_h_loop_filter_chroma422_mbaff_intra_9_c","_h264_v_loop_filter_luma_intra_10_c","_h264_h_loop_filter_luma_intra_10_c","_h264_h_loop_filter_luma_mbaff_intra_10_c","_h264_v_loop_filter_chroma_intra_10_c","_h264_h_loop_filter_chroma_intra_10_c","_h264_h_loop_filter_chroma422_intra_10_c","_h264_h_loop_filter_chroma_mbaff_intra_10_c","_h264_h_loop_filter_chroma422_mbaff_intra_10_c","_h264_v_loop_filter_luma_intra_12_c","_h264_h_loop_filter_luma_intra_12_c","_h264_h_loop_filter_luma_mbaff_intra_12_c","_h264_v_loop_filter_chroma_intra_12_c","_h264_h_loop_filter_chroma_intra_12_c","_h264_h_loop_filter_chroma422_intra_12_c","_h264_h_loop_filter_chroma_mbaff_intra_12_c","_h264_h_loop_filter_chroma422_mbaff_intra_12_c","_h264_v_loop_filter_luma_intra_14_c","_h264_h_loop_filter_luma_intra_14_c","_h264_h_loop_filter_luma_mbaff_intra_14_c","_h264_v_loop_filter_chroma_intra_14_c","_h264_h_loop_filter_chroma_intra_14_c","_h264_h_loop_filter_chroma422_intra_14_c","_h264_h_loop_filter_chroma_mbaff_intra_14_c","_h264_h_loop_filter_chroma422_mbaff_intra_14_c","_h264_v_loop_filter_luma_intra_8_c","_h264_h_loop_filter_luma_intra_8_c","_h264_h_loop_filter_luma_mbaff_intra_8_c","_h264_v_loop_filter_chroma_intra_8_c","_h264_h_loop_filter_chroma_intra_8_c","_h264_h_loop_filter_chroma422_intra_8_c","_h264_h_loop_filter_chroma_mbaff_intra_8_c","_h264_h_loop_filter_chroma422_mbaff_intra_8_c","_fft15_c","_mdct15","_imdct15_half","_ps_mul_pair_single_c","_ps_hybrid_analysis_ileave_c","_ps_hybrid_synthesis_deint_c","_vector_fmul_c","_vector_dmul_c","_vector_fmul_reverse_c","_av_log_default_callback",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,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,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,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,0,0,0,0,0];var debug_table_viiiid=[0,"jsCall_viiiid_0","jsCall_viiiid_1","jsCall_viiiid_2","jsCall_viiiid_3","jsCall_viiiid_4","jsCall_viiiid_5","jsCall_viiiid_6","jsCall_viiiid_7","jsCall_viiiid_8","jsCall_viiiid_9","jsCall_viiiid_10","jsCall_viiiid_11","jsCall_viiiid_12","jsCall_viiiid_13","jsCall_viiiid_14","jsCall_viiiid_15","jsCall_viiiid_16","jsCall_viiiid_17","jsCall_viiiid_18","jsCall_viiiid_19","jsCall_viiiid_20","jsCall_viiiid_21","jsCall_viiiid_22","jsCall_viiiid_23","jsCall_viiiid_24","jsCall_viiiid_25","jsCall_viiiid_26","jsCall_viiiid_27","jsCall_viiiid_28","jsCall_viiiid_29","jsCall_viiiid_30","jsCall_viiiid_31","jsCall_viiiid_32","jsCall_viiiid_33","jsCall_viiiid_34",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,0];var debug_table_viiiifii=[0,"jsCall_viiiifii_0","jsCall_viiiifii_1","jsCall_viiiifii_2","jsCall_viiiifii_3","jsCall_viiiifii_4","jsCall_viiiifii_5","jsCall_viiiifii_6","jsCall_viiiifii_7","jsCall_viiiifii_8","jsCall_viiiifii_9","jsCall_viiiifii_10","jsCall_viiiifii_11","jsCall_viiiifii_12","jsCall_viiiifii_13","jsCall_viiiifii_14","jsCall_viiiifii_15","jsCall_viiiifii_16","jsCall_viiiifii_17","jsCall_viiiifii_18","jsCall_viiiifii_19","jsCall_viiiifii_20","jsCall_viiiifii_21","jsCall_viiiifii_22","jsCall_viiiifii_23","jsCall_viiiifii_24","jsCall_viiiifii_25","jsCall_viiiifii_26","jsCall_viiiifii_27","jsCall_viiiifii_28","jsCall_viiiifii_29","jsCall_viiiifii_30","jsCall_viiiifii_31","jsCall_viiiifii_32","jsCall_viiiifii_33","jsCall_viiiifii_34","_sbr_hf_gen_c",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];var debug_table_viiiii=[0,"jsCall_viiiii_0","jsCall_viiiii_1","jsCall_viiiii_2","jsCall_viiiii_3","jsCall_viiiii_4","jsCall_viiiii_5","jsCall_viiiii_6","jsCall_viiiii_7","jsCall_viiiii_8","jsCall_viiiii_9","jsCall_viiiii_10","jsCall_viiiii_11","jsCall_viiiii_12","jsCall_viiiii_13","jsCall_viiiii_14","jsCall_viiiii_15","jsCall_viiiii_16","jsCall_viiiii_17","jsCall_viiiii_18","jsCall_viiiii_19","jsCall_viiiii_20","jsCall_viiiii_21","jsCall_viiiii_22","jsCall_viiiii_23","jsCall_viiiii_24","jsCall_viiiii_25","jsCall_viiiii_26","jsCall_viiiii_27","jsCall_viiiii_28","jsCall_viiiii_29","jsCall_viiiii_30","jsCall_viiiii_31","jsCall_viiiii_32","jsCall_viiiii_33","jsCall_viiiii_34","_planar_rgb9le_to_uv","_planar_rgb10le_to_uv","_planar_rgb12le_to_uv","_planar_rgb14le_to_uv","_planar_rgb16le_to_uv","_planar_rgb9be_to_uv","_planar_rgb10be_to_uv","_planar_rgb12be_to_uv","_planar_rgb14be_to_uv","_planar_rgb16be_to_uv","_planar_rgb_to_uv","_yuv2p010l1_LE_c","_yuv2p010l1_BE_c","_yuv2plane1_16LE_c","_yuv2plane1_16BE_c","_yuv2plane1_9LE_c","_yuv2plane1_9BE_c","_yuv2plane1_10LE_c","_yuv2plane1_10BE_c","_yuv2plane1_12LE_c","_yuv2plane1_12BE_c","_yuv2plane1_14LE_c","_yuv2plane1_14BE_c","_yuv2plane1_floatBE_c","_yuv2plane1_floatLE_c","_yuv2plane1_8_c","_bayer_bggr8_to_rgb24_copy","_bayer_bggr8_to_rgb24_interpolate","_bayer_bggr16le_to_rgb24_copy","_bayer_bggr16le_to_rgb24_interpolate","_bayer_bggr16be_to_rgb24_copy","_bayer_bggr16be_to_rgb24_interpolate","_bayer_rggb8_to_rgb24_copy","_bayer_rggb8_to_rgb24_interpolate","_bayer_rggb16le_to_rgb24_copy","_bayer_rggb16le_to_rgb24_interpolate","_bayer_rggb16be_to_rgb24_copy","_bayer_rggb16be_to_rgb24_interpolate","_bayer_gbrg8_to_rgb24_copy","_bayer_gbrg8_to_rgb24_interpolate","_bayer_gbrg16le_to_rgb24_copy","_bayer_gbrg16le_to_rgb24_interpolate","_bayer_gbrg16be_to_rgb24_copy","_bayer_gbrg16be_to_rgb24_interpolate","_bayer_grbg8_to_rgb24_copy","_bayer_grbg8_to_rgb24_interpolate","_bayer_grbg16le_to_rgb24_copy","_bayer_grbg16le_to_rgb24_interpolate","_bayer_grbg16be_to_rgb24_copy","_bayer_grbg16be_to_rgb24_interpolate","_hevc_h_loop_filter_chroma_9","_hevc_v_loop_filter_chroma_9","_hevc_h_loop_filter_chroma_10","_hevc_v_loop_filter_chroma_10","_hevc_h_loop_filter_chroma_12","_hevc_v_loop_filter_chroma_12","_hevc_h_loop_filter_chroma_8","_hevc_v_loop_filter_chroma_8","_worker_func","_sbr_hf_assemble","_sbr_hf_inverse_filter","_ff_h264_idct_add16_9_c","_ff_h264_idct8_add4_9_c","_ff_h264_idct_add8_9_c","_ff_h264_idct_add8_422_9_c","_ff_h264_idct_add16intra_9_c","_h264_v_loop_filter_luma_9_c","_h264_h_loop_filter_luma_9_c","_h264_h_loop_filter_luma_mbaff_9_c","_h264_v_loop_filter_chroma_9_c","_h264_h_loop_filter_chroma_9_c","_h264_h_loop_filter_chroma422_9_c","_h264_h_loop_filter_chroma_mbaff_9_c","_h264_h_loop_filter_chroma422_mbaff_9_c","_ff_h264_idct_add16_10_c","_ff_h264_idct8_add4_10_c","_ff_h264_idct_add8_10_c","_ff_h264_idct_add8_422_10_c","_ff_h264_idct_add16intra_10_c","_h264_v_loop_filter_luma_10_c","_h264_h_loop_filter_luma_10_c","_h264_h_loop_filter_luma_mbaff_10_c","_h264_v_loop_filter_chroma_10_c","_h264_h_loop_filter_chroma_10_c","_h264_h_loop_filter_chroma422_10_c","_h264_h_loop_filter_chroma_mbaff_10_c","_h264_h_loop_filter_chroma422_mbaff_10_c","_ff_h264_idct_add16_12_c","_ff_h264_idct8_add4_12_c","_ff_h264_idct_add8_12_c","_ff_h264_idct_add8_422_12_c","_ff_h264_idct_add16intra_12_c","_h264_v_loop_filter_luma_12_c","_h264_h_loop_filter_luma_12_c","_h264_h_loop_filter_luma_mbaff_12_c","_h264_v_loop_filter_chroma_12_c","_h264_h_loop_filter_chroma_12_c","_h264_h_loop_filter_chroma422_12_c","_h264_h_loop_filter_chroma_mbaff_12_c","_h264_h_loop_filter_chroma422_mbaff_12_c","_ff_h264_idct_add16_14_c","_ff_h264_idct8_add4_14_c","_ff_h264_idct_add8_14_c","_ff_h264_idct_add8_422_14_c","_ff_h264_idct_add16intra_14_c","_h264_v_loop_filter_luma_14_c","_h264_h_loop_filter_luma_14_c","_h264_h_loop_filter_luma_mbaff_14_c","_h264_v_loop_filter_chroma_14_c","_h264_h_loop_filter_chroma_14_c","_h264_h_loop_filter_chroma422_14_c","_h264_h_loop_filter_chroma_mbaff_14_c","_h264_h_loop_filter_chroma422_mbaff_14_c","_ff_h264_idct_add16_8_c","_ff_h264_idct8_add4_8_c","_ff_h264_idct_add8_8_c","_ff_h264_idct_add8_422_8_c","_ff_h264_idct_add16intra_8_c","_h264_v_loop_filter_luma_8_c","_h264_h_loop_filter_luma_8_c","_h264_h_loop_filter_luma_mbaff_8_c","_h264_v_loop_filter_chroma_8_c","_h264_h_loop_filter_chroma_8_c","_h264_h_loop_filter_chroma422_8_c","_h264_h_loop_filter_chroma_mbaff_8_c","_h264_h_loop_filter_chroma422_mbaff_8_c","_postrotate_c","_sbr_hf_g_filt_c","_ps_hybrid_analysis_c","_ps_stereo_interpolate_c","_ps_stereo_interpolate_ipdopd_c","_vector_fmul_window_c","_vector_fmul_add_c",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,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,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,0,0,0,0,0,0];var debug_table_viiiiidd=[0,"jsCall_viiiiidd_0","jsCall_viiiiidd_1","jsCall_viiiiidd_2","jsCall_viiiiidd_3","jsCall_viiiiidd_4","jsCall_viiiiidd_5","jsCall_viiiiidd_6","jsCall_viiiiidd_7","jsCall_viiiiidd_8","jsCall_viiiiidd_9","jsCall_viiiiidd_10","jsCall_viiiiidd_11","jsCall_viiiiidd_12","jsCall_viiiiidd_13","jsCall_viiiiidd_14","jsCall_viiiiidd_15","jsCall_viiiiidd_16","jsCall_viiiiidd_17","jsCall_viiiiidd_18","jsCall_viiiiidd_19","jsCall_viiiiidd_20","jsCall_viiiiidd_21","jsCall_viiiiidd_22","jsCall_viiiiidd_23","jsCall_viiiiidd_24","jsCall_viiiiidd_25","jsCall_viiiiidd_26","jsCall_viiiiidd_27","jsCall_viiiiidd_28","jsCall_viiiiidd_29","jsCall_viiiiidd_30","jsCall_viiiiidd_31","jsCall_viiiiidd_32","jsCall_viiiiidd_33","jsCall_viiiiidd_34",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,0];var debug_table_viiiiii=[0,"jsCall_viiiiii_0","jsCall_viiiiii_1","jsCall_viiiiii_2","jsCall_viiiiii_3","jsCall_viiiiii_4","jsCall_viiiiii_5","jsCall_viiiiii_6","jsCall_viiiiii_7","jsCall_viiiiii_8","jsCall_viiiiii_9","jsCall_viiiiii_10","jsCall_viiiiii_11","jsCall_viiiiii_12","jsCall_viiiiii_13","jsCall_viiiiii_14","jsCall_viiiiii_15","jsCall_viiiiii_16","jsCall_viiiiii_17","jsCall_viiiiii_18","jsCall_viiiiii_19","jsCall_viiiiii_20","jsCall_viiiiii_21","jsCall_viiiiii_22","jsCall_viiiiii_23","jsCall_viiiiii_24","jsCall_viiiiii_25","jsCall_viiiiii_26","jsCall_viiiiii_27","jsCall_viiiiii_28","jsCall_viiiiii_29","jsCall_viiiiii_30","jsCall_viiiiii_31","jsCall_viiiiii_32","jsCall_viiiiii_33","jsCall_viiiiii_34","_read_geobtag","_read_apic","_read_chapter","_read_priv","_ff_hyscale_fast_c","_bswap16Y_c","_read_ya16le_gray_c","_read_ya16be_gray_c","_read_ayuv64le_Y_c","_yuy2ToY_c","_uyvyToY_c","_bgr24ToY_c","_bgr16leToY_c","_bgr16beToY_c","_bgr15leToY_c","_bgr15beToY_c","_bgr12leToY_c","_bgr12beToY_c","_rgb24ToY_c","_rgb16leToY_c","_rgb16beToY_c","_rgb15leToY_c","_rgb15beToY_c","_rgb12leToY_c","_rgb12beToY_c","_palToY_c","_monoblack2Y_c","_monowhite2Y_c","_bgr32ToY_c","_bgr321ToY_c","_rgb32ToY_c","_rgb321ToY_c","_rgb48BEToY_c","_rgb48LEToY_c","_bgr48BEToY_c","_bgr48LEToY_c","_rgb64BEToY_c","_rgb64LEToY_c","_bgr64BEToY_c","_bgr64LEToY_c","_p010LEToY_c","_p010BEToY_c","_grayf32ToY16_c","_grayf32ToY16_bswap_c","_rgba64leToA_c","_rgba64beToA_c","_rgbaToA_c","_abgrToA_c","_read_ya16le_alpha_c","_read_ya16be_alpha_c","_read_ayuv64le_A_c","_palToA_c","_put_pcm_9","_hevc_h_loop_filter_luma_9","_hevc_v_loop_filter_luma_9","_put_pcm_10","_hevc_h_loop_filter_luma_10","_hevc_v_loop_filter_luma_10","_put_pcm_12","_hevc_h_loop_filter_luma_12","_hevc_v_loop_filter_luma_12","_put_pcm_8","_hevc_h_loop_filter_luma_8","_hevc_v_loop_filter_luma_8","_pred_dc_9","_pred_angular_0_9","_pred_angular_1_9","_pred_angular_2_9","_pred_angular_3_9","_pred_dc_10","_pred_angular_0_10","_pred_angular_1_10","_pred_angular_2_10","_pred_angular_3_10","_pred_dc_12","_pred_angular_0_12","_pred_angular_1_12","_pred_angular_2_12","_pred_angular_3_12","_pred_dc_8","_pred_angular_0_8","_pred_angular_1_8","_pred_angular_2_8","_pred_angular_3_8","_weight_h264_pixels16_9_c","_weight_h264_pixels8_9_c","_weight_h264_pixels4_9_c","_weight_h264_pixels2_9_c","_weight_h264_pixels16_10_c","_weight_h264_pixels8_10_c","_weight_h264_pixels4_10_c","_weight_h264_pixels2_10_c","_weight_h264_pixels16_12_c","_weight_h264_pixels8_12_c","_weight_h264_pixels4_12_c","_weight_h264_pixels2_12_c","_weight_h264_pixels16_14_c","_weight_h264_pixels8_14_c","_weight_h264_pixels4_14_c","_weight_h264_pixels2_14_c","_weight_h264_pixels16_8_c","_weight_h264_pixels8_8_c","_weight_h264_pixels4_8_c","_weight_h264_pixels2_8_c","_sbr_hf_apply_noise_0","_sbr_hf_apply_noise_1","_sbr_hf_apply_noise_2","_sbr_hf_apply_noise_3","_aes_decrypt","_aes_encrypt","_image_copy_plane",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,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,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,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,0];var debug_table_viiiiiifi=[0,"jsCall_viiiiiifi_0","jsCall_viiiiiifi_1","jsCall_viiiiiifi_2","jsCall_viiiiiifi_3","jsCall_viiiiiifi_4","jsCall_viiiiiifi_5","jsCall_viiiiiifi_6","jsCall_viiiiiifi_7","jsCall_viiiiiifi_8","jsCall_viiiiiifi_9","jsCall_viiiiiifi_10","jsCall_viiiiiifi_11","jsCall_viiiiiifi_12","jsCall_viiiiiifi_13","jsCall_viiiiiifi_14","jsCall_viiiiiifi_15","jsCall_viiiiiifi_16","jsCall_viiiiiifi_17","jsCall_viiiiiifi_18","jsCall_viiiiiifi_19","jsCall_viiiiiifi_20","jsCall_viiiiiifi_21","jsCall_viiiiiifi_22","jsCall_viiiiiifi_23","jsCall_viiiiiifi_24","jsCall_viiiiiifi_25","jsCall_viiiiiifi_26","jsCall_viiiiiifi_27","jsCall_viiiiiifi_28","jsCall_viiiiiifi_29","jsCall_viiiiiifi_30","jsCall_viiiiiifi_31","jsCall_viiiiiifi_32","jsCall_viiiiiifi_33","jsCall_viiiiiifi_34","_ps_decorrelate_c",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];var debug_table_viiiiiii=[0,"jsCall_viiiiiii_0","jsCall_viiiiiii_1","jsCall_viiiiiii_2","jsCall_viiiiiii_3","jsCall_viiiiiii_4","jsCall_viiiiiii_5","jsCall_viiiiiii_6","jsCall_viiiiiii_7","jsCall_viiiiiii_8","jsCall_viiiiiii_9","jsCall_viiiiiii_10","jsCall_viiiiiii_11","jsCall_viiiiiii_12","jsCall_viiiiiii_13","jsCall_viiiiiii_14","jsCall_viiiiiii_15","jsCall_viiiiiii_16","jsCall_viiiiiii_17","jsCall_viiiiiii_18","jsCall_viiiiiii_19","jsCall_viiiiiii_20","jsCall_viiiiiii_21","jsCall_viiiiiii_22","jsCall_viiiiiii_23","jsCall_viiiiiii_24","jsCall_viiiiiii_25","jsCall_viiiiiii_26","jsCall_viiiiiii_27","jsCall_viiiiiii_28","jsCall_viiiiiii_29","jsCall_viiiiiii_30","jsCall_viiiiiii_31","jsCall_viiiiiii_32","jsCall_viiiiiii_33","jsCall_viiiiiii_34","_hScale8To15_c","_hScale8To19_c","_hScale16To19_c","_hScale16To15_c","_yuy2ToUV_c","_yvy2ToUV_c","_uyvyToUV_c","_nv12ToUV_c","_nv21ToUV_c","_palToUV_c","_bswap16UV_c","_read_ayuv64le_UV_c","_p010LEToUV_c","_p010BEToUV_c","_p016LEToUV_c","_p016BEToUV_c","_gbr24pToUV_half_c","_rgb64BEToUV_half_c","_rgb64LEToUV_half_c","_bgr64BEToUV_half_c","_bgr64LEToUV_half_c","_rgb48BEToUV_half_c","_rgb48LEToUV_half_c","_bgr48BEToUV_half_c","_bgr48LEToUV_half_c","_bgr32ToUV_half_c","_bgr321ToUV_half_c","_bgr24ToUV_half_c","_bgr16leToUV_half_c","_bgr16beToUV_half_c","_bgr15leToUV_half_c","_bgr15beToUV_half_c","_bgr12leToUV_half_c","_bgr12beToUV_half_c","_rgb32ToUV_half_c","_rgb321ToUV_half_c","_rgb24ToUV_half_c","_rgb16leToUV_half_c","_rgb16beToUV_half_c","_rgb15leToUV_half_c","_rgb15beToUV_half_c","_rgb12leToUV_half_c","_rgb12beToUV_half_c","_rgb64BEToUV_c","_rgb64LEToUV_c","_bgr64BEToUV_c","_bgr64LEToUV_c","_rgb48BEToUV_c","_rgb48LEToUV_c","_bgr48BEToUV_c","_bgr48LEToUV_c","_bgr32ToUV_c","_bgr321ToUV_c","_bgr24ToUV_c","_bgr16leToUV_c","_bgr16beToUV_c","_bgr15leToUV_c","_bgr15beToUV_c","_bgr12leToUV_c","_bgr12beToUV_c","_rgb32ToUV_c","_rgb321ToUV_c","_rgb24ToUV_c","_rgb16leToUV_c","_rgb16beToUV_c","_rgb15leToUV_c","_rgb15beToUV_c","_rgb12leToUV_c","_rgb12beToUV_c","_yuv2p010lX_LE_c","_yuv2p010lX_BE_c","_yuv2p010cX_c","_yuv2planeX_16LE_c","_yuv2planeX_16BE_c","_yuv2p016cX_c","_yuv2planeX_9LE_c","_yuv2planeX_9BE_c","_yuv2planeX_10LE_c","_yuv2planeX_10BE_c","_yuv2planeX_12LE_c","_yuv2planeX_12BE_c","_yuv2planeX_14LE_c","_yuv2planeX_14BE_c","_yuv2planeX_floatBE_c","_yuv2planeX_floatLE_c","_yuv2planeX_8_c","_yuv2nv12cX_c","_sao_edge_filter_9","_put_hevc_pel_pixels_9","_put_hevc_qpel_h_9","_put_hevc_qpel_v_9","_put_hevc_qpel_hv_9","_put_hevc_epel_h_9","_put_hevc_epel_v_9","_put_hevc_epel_hv_9","_sao_edge_filter_10","_put_hevc_pel_pixels_10","_put_hevc_qpel_h_10","_put_hevc_qpel_v_10","_put_hevc_qpel_hv_10","_put_hevc_epel_h_10","_put_hevc_epel_v_10","_put_hevc_epel_hv_10","_sao_edge_filter_12","_put_hevc_pel_pixels_12","_put_hevc_qpel_h_12","_put_hevc_qpel_v_12","_put_hevc_qpel_hv_12","_put_hevc_epel_h_12","_put_hevc_epel_v_12","_put_hevc_epel_hv_12","_sao_edge_filter_8","_put_hevc_pel_pixels_8","_put_hevc_qpel_h_8","_put_hevc_qpel_v_8","_put_hevc_qpel_hv_8","_put_hevc_epel_h_8","_put_hevc_epel_v_8","_put_hevc_epel_hv_8",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,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,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];var debug_table_viiiiiiii=[0,"jsCall_viiiiiiii_0","jsCall_viiiiiiii_1","jsCall_viiiiiiii_2","jsCall_viiiiiiii_3","jsCall_viiiiiiii_4","jsCall_viiiiiiii_5","jsCall_viiiiiiii_6","jsCall_viiiiiiii_7","jsCall_viiiiiiii_8","jsCall_viiiiiiii_9","jsCall_viiiiiiii_10","jsCall_viiiiiiii_11","jsCall_viiiiiiii_12","jsCall_viiiiiiii_13","jsCall_viiiiiiii_14","jsCall_viiiiiiii_15","jsCall_viiiiiiii_16","jsCall_viiiiiiii_17","jsCall_viiiiiiii_18","jsCall_viiiiiiii_19","jsCall_viiiiiiii_20","jsCall_viiiiiiii_21","jsCall_viiiiiiii_22","jsCall_viiiiiiii_23","jsCall_viiiiiiii_24","jsCall_viiiiiiii_25","jsCall_viiiiiiii_26","jsCall_viiiiiiii_27","jsCall_viiiiiiii_28","jsCall_viiiiiiii_29","jsCall_viiiiiiii_30","jsCall_viiiiiiii_31","jsCall_viiiiiiii_32","jsCall_viiiiiiii_33","jsCall_viiiiiiii_34","_ff_hcscale_fast_c","_bayer_bggr8_to_yv12_copy","_bayer_bggr8_to_yv12_interpolate","_bayer_bggr16le_to_yv12_copy","_bayer_bggr16le_to_yv12_interpolate","_bayer_bggr16be_to_yv12_copy","_bayer_bggr16be_to_yv12_interpolate","_bayer_rggb8_to_yv12_copy","_bayer_rggb8_to_yv12_interpolate","_bayer_rggb16le_to_yv12_copy","_bayer_rggb16le_to_yv12_interpolate","_bayer_rggb16be_to_yv12_copy","_bayer_rggb16be_to_yv12_interpolate","_bayer_gbrg8_to_yv12_copy","_bayer_gbrg8_to_yv12_interpolate","_bayer_gbrg16le_to_yv12_copy","_bayer_gbrg16le_to_yv12_interpolate","_bayer_gbrg16be_to_yv12_copy","_bayer_gbrg16be_to_yv12_interpolate","_bayer_grbg8_to_yv12_copy","_bayer_grbg8_to_yv12_interpolate","_bayer_grbg16le_to_yv12_copy","_bayer_grbg16le_to_yv12_interpolate","_bayer_grbg16be_to_yv12_copy","_bayer_grbg16be_to_yv12_interpolate","_sao_band_filter_9","_put_hevc_pel_uni_pixels_9","_put_hevc_qpel_uni_h_9","_put_hevc_qpel_uni_v_9","_put_hevc_qpel_uni_hv_9","_put_hevc_epel_uni_h_9","_put_hevc_epel_uni_v_9","_put_hevc_epel_uni_hv_9","_sao_band_filter_10","_put_hevc_pel_uni_pixels_10","_put_hevc_qpel_uni_h_10","_put_hevc_qpel_uni_v_10","_put_hevc_qpel_uni_hv_10","_put_hevc_epel_uni_h_10","_put_hevc_epel_uni_v_10","_put_hevc_epel_uni_hv_10","_sao_band_filter_12","_put_hevc_pel_uni_pixels_12","_put_hevc_qpel_uni_h_12","_put_hevc_qpel_uni_v_12","_put_hevc_qpel_uni_hv_12","_put_hevc_epel_uni_h_12","_put_hevc_epel_uni_v_12","_put_hevc_epel_uni_hv_12","_sao_band_filter_8","_put_hevc_pel_uni_pixels_8","_put_hevc_qpel_uni_h_8","_put_hevc_qpel_uni_v_8","_put_hevc_qpel_uni_hv_8","_put_hevc_epel_uni_h_8","_put_hevc_epel_uni_v_8","_put_hevc_epel_uni_hv_8","_biweight_h264_pixels16_9_c","_biweight_h264_pixels8_9_c","_biweight_h264_pixels4_9_c","_biweight_h264_pixels2_9_c","_biweight_h264_pixels16_10_c","_biweight_h264_pixels8_10_c","_biweight_h264_pixels4_10_c","_biweight_h264_pixels2_10_c","_biweight_h264_pixels16_12_c","_biweight_h264_pixels8_12_c","_biweight_h264_pixels4_12_c","_biweight_h264_pixels2_12_c","_biweight_h264_pixels16_14_c","_biweight_h264_pixels8_14_c","_biweight_h264_pixels4_14_c","_biweight_h264_pixels2_14_c","_biweight_h264_pixels16_8_c","_biweight_h264_pixels8_8_c","_biweight_h264_pixels4_8_c","_biweight_h264_pixels2_8_c",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];var debug_table_viiiiiiiid=[0,"jsCall_viiiiiiiid_0","jsCall_viiiiiiiid_1","jsCall_viiiiiiiid_2","jsCall_viiiiiiiid_3","jsCall_viiiiiiiid_4","jsCall_viiiiiiiid_5","jsCall_viiiiiiiid_6","jsCall_viiiiiiiid_7","jsCall_viiiiiiiid_8","jsCall_viiiiiiiid_9","jsCall_viiiiiiiid_10","jsCall_viiiiiiiid_11","jsCall_viiiiiiiid_12","jsCall_viiiiiiiid_13","jsCall_viiiiiiiid_14","jsCall_viiiiiiiid_15","jsCall_viiiiiiiid_16","jsCall_viiiiiiiid_17","jsCall_viiiiiiiid_18","jsCall_viiiiiiiid_19","jsCall_viiiiiiiid_20","jsCall_viiiiiiiid_21","jsCall_viiiiiiiid_22","jsCall_viiiiiiiid_23","jsCall_viiiiiiiid_24","jsCall_viiiiiiiid_25","jsCall_viiiiiiiid_26","jsCall_viiiiiiiid_27","jsCall_viiiiiiiid_28","jsCall_viiiiiiiid_29","jsCall_viiiiiiiid_30","jsCall_viiiiiiiid_31","jsCall_viiiiiiiid_32","jsCall_viiiiiiiid_33","jsCall_viiiiiiiid_34",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,0];var debug_table_viiiiiiiidi=[0,"jsCall_viiiiiiiidi_0","jsCall_viiiiiiiidi_1","jsCall_viiiiiiiidi_2","jsCall_viiiiiiiidi_3","jsCall_viiiiiiiidi_4","jsCall_viiiiiiiidi_5","jsCall_viiiiiiiidi_6","jsCall_viiiiiiiidi_7","jsCall_viiiiiiiidi_8","jsCall_viiiiiiiidi_9","jsCall_viiiiiiiidi_10","jsCall_viiiiiiiidi_11","jsCall_viiiiiiiidi_12","jsCall_viiiiiiiidi_13","jsCall_viiiiiiiidi_14","jsCall_viiiiiiiidi_15","jsCall_viiiiiiiidi_16","jsCall_viiiiiiiidi_17","jsCall_viiiiiiiidi_18","jsCall_viiiiiiiidi_19","jsCall_viiiiiiiidi_20","jsCall_viiiiiiiidi_21","jsCall_viiiiiiiidi_22","jsCall_viiiiiiiidi_23","jsCall_viiiiiiiidi_24","jsCall_viiiiiiiidi_25","jsCall_viiiiiiiidi_26","jsCall_viiiiiiiidi_27","jsCall_viiiiiiiidi_28","jsCall_viiiiiiiidi_29","jsCall_viiiiiiiidi_30","jsCall_viiiiiiiidi_31","jsCall_viiiiiiiidi_32","jsCall_viiiiiiiidi_33","jsCall_viiiiiiiidi_34",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,0];var debug_table_viiiiiiiii=[0,"jsCall_viiiiiiiii_0","jsCall_viiiiiiiii_1","jsCall_viiiiiiiii_2","jsCall_viiiiiiiii_3","jsCall_viiiiiiiii_4","jsCall_viiiiiiiii_5","jsCall_viiiiiiiii_6","jsCall_viiiiiiiii_7","jsCall_viiiiiiiii_8","jsCall_viiiiiiiii_9","jsCall_viiiiiiiii_10","jsCall_viiiiiiiii_11","jsCall_viiiiiiiii_12","jsCall_viiiiiiiii_13","jsCall_viiiiiiiii_14","jsCall_viiiiiiiii_15","jsCall_viiiiiiiii_16","jsCall_viiiiiiiii_17","jsCall_viiiiiiiii_18","jsCall_viiiiiiiii_19","jsCall_viiiiiiiii_20","jsCall_viiiiiiiii_21","jsCall_viiiiiiiii_22","jsCall_viiiiiiiii_23","jsCall_viiiiiiiii_24","jsCall_viiiiiiiii_25","jsCall_viiiiiiiii_26","jsCall_viiiiiiiii_27","jsCall_viiiiiiiii_28","jsCall_viiiiiiiii_29","jsCall_viiiiiiiii_30","jsCall_viiiiiiiii_31","jsCall_viiiiiiiii_32","jsCall_viiiiiiiii_33","jsCall_viiiiiiiii_34","_yuv2rgba32_full_1_c","_yuv2rgbx32_full_1_c","_yuv2argb32_full_1_c","_yuv2xrgb32_full_1_c","_yuv2bgra32_full_1_c","_yuv2bgrx32_full_1_c","_yuv2abgr32_full_1_c","_yuv2xbgr32_full_1_c","_yuv2rgba64le_full_1_c","_yuv2rgbx64le_full_1_c","_yuv2rgba64be_full_1_c","_yuv2rgbx64be_full_1_c","_yuv2bgra64le_full_1_c","_yuv2bgrx64le_full_1_c","_yuv2bgra64be_full_1_c","_yuv2bgrx64be_full_1_c","_yuv2rgb24_full_1_c","_yuv2bgr24_full_1_c","_yuv2rgb48le_full_1_c","_yuv2bgr48le_full_1_c","_yuv2rgb48be_full_1_c","_yuv2bgr48be_full_1_c","_yuv2bgr4_byte_full_1_c","_yuv2rgb4_byte_full_1_c","_yuv2bgr8_full_1_c","_yuv2rgb8_full_1_c","_yuv2rgbx64le_1_c","_yuv2rgba64le_1_c","_yuv2rgbx64be_1_c","_yuv2rgba64be_1_c","_yuv2bgrx64le_1_c","_yuv2bgra64le_1_c","_yuv2bgrx64be_1_c","_yuv2bgra64be_1_c","_yuv2rgba32_1_c","_yuv2rgbx32_1_c","_yuv2rgba32_1_1_c","_yuv2rgbx32_1_1_c","_yuv2rgb16_1_c","_yuv2rgb15_1_c","_yuv2rgb12_1_c","_yuv2rgb8_1_c","_yuv2rgb4_1_c","_yuv2rgb4b_1_c","_yuv2rgb48le_1_c","_yuv2rgb48be_1_c","_yuv2bgr48le_1_c","_yuv2bgr48be_1_c","_yuv2rgb24_1_c","_yuv2bgr24_1_c","_yuv2monowhite_1_c","_yuv2monoblack_1_c","_yuv2yuyv422_1_c","_yuv2yvyu422_1_c","_yuv2uyvy422_1_c","_yuv2ya8_1_c","_yuv2ya16le_1_c","_yuv2ya16be_1_c","_yuy2toyv12_c","_put_hevc_pel_bi_pixels_9","_put_hevc_qpel_bi_h_9","_put_hevc_qpel_bi_v_9","_put_hevc_qpel_bi_hv_9","_put_hevc_epel_bi_h_9","_put_hevc_epel_bi_v_9","_put_hevc_epel_bi_hv_9","_put_hevc_pel_bi_pixels_10","_put_hevc_qpel_bi_h_10","_put_hevc_qpel_bi_v_10","_put_hevc_qpel_bi_hv_10","_put_hevc_epel_bi_h_10","_put_hevc_epel_bi_v_10","_put_hevc_epel_bi_hv_10","_put_hevc_pel_bi_pixels_12","_put_hevc_qpel_bi_h_12","_put_hevc_qpel_bi_v_12","_put_hevc_qpel_bi_hv_12","_put_hevc_epel_bi_h_12","_put_hevc_epel_bi_v_12","_put_hevc_epel_bi_hv_12","_put_hevc_pel_bi_pixels_8","_put_hevc_qpel_bi_h_8","_put_hevc_qpel_bi_v_8","_put_hevc_qpel_bi_hv_8","_put_hevc_epel_bi_h_8","_put_hevc_epel_bi_v_8","_put_hevc_epel_bi_hv_8",0,0,0,0,0];var debug_table_viiiiiiiiii=[0,"jsCall_viiiiiiiiii_0","jsCall_viiiiiiiiii_1","jsCall_viiiiiiiiii_2","jsCall_viiiiiiiiii_3","jsCall_viiiiiiiiii_4","jsCall_viiiiiiiiii_5","jsCall_viiiiiiiiii_6","jsCall_viiiiiiiiii_7","jsCall_viiiiiiiiii_8","jsCall_viiiiiiiiii_9","jsCall_viiiiiiiiii_10","jsCall_viiiiiiiiii_11","jsCall_viiiiiiiiii_12","jsCall_viiiiiiiiii_13","jsCall_viiiiiiiiii_14","jsCall_viiiiiiiiii_15","jsCall_viiiiiiiiii_16","jsCall_viiiiiiiiii_17","jsCall_viiiiiiiiii_18","jsCall_viiiiiiiiii_19","jsCall_viiiiiiiiii_20","jsCall_viiiiiiiiii_21","jsCall_viiiiiiiiii_22","jsCall_viiiiiiiiii_23","jsCall_viiiiiiiiii_24","jsCall_viiiiiiiiii_25","jsCall_viiiiiiiiii_26","jsCall_viiiiiiiiii_27","jsCall_viiiiiiiiii_28","jsCall_viiiiiiiiii_29","jsCall_viiiiiiiiii_30","jsCall_viiiiiiiiii_31","jsCall_viiiiiiiiii_32","jsCall_viiiiiiiiii_33","jsCall_viiiiiiiiii_34","_yuv2rgba32_full_2_c","_yuv2rgbx32_full_2_c","_yuv2argb32_full_2_c","_yuv2xrgb32_full_2_c","_yuv2bgra32_full_2_c","_yuv2bgrx32_full_2_c","_yuv2abgr32_full_2_c","_yuv2xbgr32_full_2_c","_yuv2rgba64le_full_2_c","_yuv2rgbx64le_full_2_c","_yuv2rgba64be_full_2_c","_yuv2rgbx64be_full_2_c","_yuv2bgra64le_full_2_c","_yuv2bgrx64le_full_2_c","_yuv2bgra64be_full_2_c","_yuv2bgrx64be_full_2_c","_yuv2rgb24_full_2_c","_yuv2bgr24_full_2_c","_yuv2rgb48le_full_2_c","_yuv2bgr48le_full_2_c","_yuv2rgb48be_full_2_c","_yuv2bgr48be_full_2_c","_yuv2bgr4_byte_full_2_c","_yuv2rgb4_byte_full_2_c","_yuv2bgr8_full_2_c","_yuv2rgb8_full_2_c","_yuv2rgbx64le_2_c","_yuv2rgba64le_2_c","_yuv2rgbx64be_2_c","_yuv2rgba64be_2_c","_yuv2bgrx64le_2_c","_yuv2bgra64le_2_c","_yuv2bgrx64be_2_c","_yuv2bgra64be_2_c","_yuv2rgba32_2_c","_yuv2rgbx32_2_c","_yuv2rgba32_1_2_c","_yuv2rgbx32_1_2_c","_yuv2rgb16_2_c","_yuv2rgb15_2_c","_yuv2rgb12_2_c","_yuv2rgb8_2_c","_yuv2rgb4_2_c","_yuv2rgb4b_2_c","_yuv2rgb48le_2_c","_yuv2rgb48be_2_c","_yuv2bgr48le_2_c","_yuv2bgr48be_2_c","_yuv2rgb24_2_c","_yuv2bgr24_2_c","_yuv2monowhite_2_c","_yuv2monoblack_2_c","_yuv2yuyv422_2_c","_yuv2yvyu422_2_c","_yuv2uyvy422_2_c","_yuv2ya8_2_c","_yuv2ya16le_2_c","_yuv2ya16be_2_c","_vu9_to_vu12_c","_yvu9_to_yuy2_c","_ff_emulated_edge_mc_8","_ff_emulated_edge_mc_16",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,0,0,0];var debug_table_viiiiiiiiiii=[0,"jsCall_viiiiiiiiiii_0","jsCall_viiiiiiiiiii_1","jsCall_viiiiiiiiiii_2","jsCall_viiiiiiiiiii_3","jsCall_viiiiiiiiiii_4","jsCall_viiiiiiiiiii_5","jsCall_viiiiiiiiiii_6","jsCall_viiiiiiiiiii_7","jsCall_viiiiiiiiiii_8","jsCall_viiiiiiiiiii_9","jsCall_viiiiiiiiiii_10","jsCall_viiiiiiiiiii_11","jsCall_viiiiiiiiiii_12","jsCall_viiiiiiiiiii_13","jsCall_viiiiiiiiiii_14","jsCall_viiiiiiiiiii_15","jsCall_viiiiiiiiiii_16","jsCall_viiiiiiiiiii_17","jsCall_viiiiiiiiiii_18","jsCall_viiiiiiiiiii_19","jsCall_viiiiiiiiiii_20","jsCall_viiiiiiiiiii_21","jsCall_viiiiiiiiiii_22","jsCall_viiiiiiiiiii_23","jsCall_viiiiiiiiiii_24","jsCall_viiiiiiiiiii_25","jsCall_viiiiiiiiiii_26","jsCall_viiiiiiiiiii_27","jsCall_viiiiiiiiiii_28","jsCall_viiiiiiiiiii_29","jsCall_viiiiiiiiiii_30","jsCall_viiiiiiiiiii_31","jsCall_viiiiiiiiiii_32","jsCall_viiiiiiiiiii_33","jsCall_viiiiiiiiiii_34","_put_hevc_pel_uni_w_pixels_9","_put_hevc_qpel_uni_w_h_9","_put_hevc_qpel_uni_w_v_9","_put_hevc_qpel_uni_w_hv_9","_put_hevc_epel_uni_w_h_9","_put_hevc_epel_uni_w_v_9","_put_hevc_epel_uni_w_hv_9","_put_hevc_pel_uni_w_pixels_10","_put_hevc_qpel_uni_w_h_10","_put_hevc_qpel_uni_w_v_10","_put_hevc_qpel_uni_w_hv_10","_put_hevc_epel_uni_w_h_10","_put_hevc_epel_uni_w_v_10","_put_hevc_epel_uni_w_hv_10","_put_hevc_pel_uni_w_pixels_12","_put_hevc_qpel_uni_w_h_12","_put_hevc_qpel_uni_w_v_12","_put_hevc_qpel_uni_w_hv_12","_put_hevc_epel_uni_w_h_12","_put_hevc_epel_uni_w_v_12","_put_hevc_epel_uni_w_hv_12","_put_hevc_pel_uni_w_pixels_8","_put_hevc_qpel_uni_w_h_8","_put_hevc_qpel_uni_w_v_8","_put_hevc_qpel_uni_w_hv_8","_put_hevc_epel_uni_w_h_8","_put_hevc_epel_uni_w_v_8","_put_hevc_epel_uni_w_hv_8"];var debug_table_viiiiiiiiiiii=[0,"jsCall_viiiiiiiiiiii_0","jsCall_viiiiiiiiiiii_1","jsCall_viiiiiiiiiiii_2","jsCall_viiiiiiiiiiii_3","jsCall_viiiiiiiiiiii_4","jsCall_viiiiiiiiiiii_5","jsCall_viiiiiiiiiiii_6","jsCall_viiiiiiiiiiii_7","jsCall_viiiiiiiiiiii_8","jsCall_viiiiiiiiiiii_9","jsCall_viiiiiiiiiiii_10","jsCall_viiiiiiiiiiii_11","jsCall_viiiiiiiiiiii_12","jsCall_viiiiiiiiiiii_13","jsCall_viiiiiiiiiiii_14","jsCall_viiiiiiiiiiii_15","jsCall_viiiiiiiiiiii_16","jsCall_viiiiiiiiiiii_17","jsCall_viiiiiiiiiiii_18","jsCall_viiiiiiiiiiii_19","jsCall_viiiiiiiiiiii_20","jsCall_viiiiiiiiiiii_21","jsCall_viiiiiiiiiiii_22","jsCall_viiiiiiiiiiii_23","jsCall_viiiiiiiiiiii_24","jsCall_viiiiiiiiiiii_25","jsCall_viiiiiiiiiiii_26","jsCall_viiiiiiiiiiii_27","jsCall_viiiiiiiiiiii_28","jsCall_viiiiiiiiiiii_29","jsCall_viiiiiiiiiiii_30","jsCall_viiiiiiiiiiii_31","jsCall_viiiiiiiiiiii_32","jsCall_viiiiiiiiiiii_33","jsCall_viiiiiiiiiiii_34","_yuv2rgba32_full_X_c","_yuv2rgbx32_full_X_c","_yuv2argb32_full_X_c","_yuv2xrgb32_full_X_c","_yuv2bgra32_full_X_c","_yuv2bgrx32_full_X_c","_yuv2abgr32_full_X_c","_yuv2xbgr32_full_X_c","_yuv2rgba64le_full_X_c","_yuv2rgbx64le_full_X_c","_yuv2rgba64be_full_X_c","_yuv2rgbx64be_full_X_c","_yuv2bgra64le_full_X_c","_yuv2bgrx64le_full_X_c","_yuv2bgra64be_full_X_c","_yuv2bgrx64be_full_X_c","_yuv2rgb24_full_X_c","_yuv2bgr24_full_X_c","_yuv2rgb48le_full_X_c","_yuv2bgr48le_full_X_c","_yuv2rgb48be_full_X_c","_yuv2bgr48be_full_X_c","_yuv2bgr4_byte_full_X_c","_yuv2rgb4_byte_full_X_c","_yuv2bgr8_full_X_c","_yuv2rgb8_full_X_c","_yuv2gbrp_full_X_c","_yuv2gbrp16_full_X_c","_yuv2rgbx64le_X_c","_yuv2rgba64le_X_c","_yuv2rgbx64be_X_c","_yuv2rgba64be_X_c","_yuv2bgrx64le_X_c","_yuv2bgra64le_X_c","_yuv2bgrx64be_X_c","_yuv2bgra64be_X_c","_yuv2rgba32_X_c","_yuv2rgbx32_X_c","_yuv2rgba32_1_X_c","_yuv2rgbx32_1_X_c","_yuv2rgb16_X_c","_yuv2rgb15_X_c","_yuv2rgb12_X_c","_yuv2rgb8_X_c","_yuv2rgb4_X_c","_yuv2rgb4b_X_c","_yuv2rgb48le_X_c","_yuv2rgb48be_X_c","_yuv2bgr48le_X_c","_yuv2bgr48be_X_c","_yuv2rgb24_X_c","_yuv2bgr24_X_c","_yuv2monowhite_X_c","_yuv2ayuv64le_X_c","_yuv2monoblack_X_c","_yuv2yuyv422_X_c","_yuv2yvyu422_X_c","_yuv2uyvy422_X_c","_yuv2ya8_X_c","_yuv2ya16le_X_c","_yuv2ya16be_X_c","_sao_edge_restore_0_9","_sao_edge_restore_1_9","_sao_edge_restore_0_10","_sao_edge_restore_1_10","_sao_edge_restore_0_12","_sao_edge_restore_1_12","_sao_edge_restore_0_8","_sao_edge_restore_1_8",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];var debug_table_viiiiiiiiiiiiii=[0,"jsCall_viiiiiiiiiiiiii_0","jsCall_viiiiiiiiiiiiii_1","jsCall_viiiiiiiiiiiiii_2","jsCall_viiiiiiiiiiiiii_3","jsCall_viiiiiiiiiiiiii_4","jsCall_viiiiiiiiiiiiii_5","jsCall_viiiiiiiiiiiiii_6","jsCall_viiiiiiiiiiiiii_7","jsCall_viiiiiiiiiiiiii_8","jsCall_viiiiiiiiiiiiii_9","jsCall_viiiiiiiiiiiiii_10","jsCall_viiiiiiiiiiiiii_11","jsCall_viiiiiiiiiiiiii_12","jsCall_viiiiiiiiiiiiii_13","jsCall_viiiiiiiiiiiiii_14","jsCall_viiiiiiiiiiiiii_15","jsCall_viiiiiiiiiiiiii_16","jsCall_viiiiiiiiiiiiii_17","jsCall_viiiiiiiiiiiiii_18","jsCall_viiiiiiiiiiiiii_19","jsCall_viiiiiiiiiiiiii_20","jsCall_viiiiiiiiiiiiii_21","jsCall_viiiiiiiiiiiiii_22","jsCall_viiiiiiiiiiiiii_23","jsCall_viiiiiiiiiiiiii_24","jsCall_viiiiiiiiiiiiii_25","jsCall_viiiiiiiiiiiiii_26","jsCall_viiiiiiiiiiiiii_27","jsCall_viiiiiiiiiiiiii_28","jsCall_viiiiiiiiiiiiii_29","jsCall_viiiiiiiiiiiiii_30","jsCall_viiiiiiiiiiiiii_31","jsCall_viiiiiiiiiiiiii_32","jsCall_viiiiiiiiiiiiii_33","jsCall_viiiiiiiiiiiiii_34","_put_hevc_pel_bi_w_pixels_9","_put_hevc_qpel_bi_w_h_9","_put_hevc_qpel_bi_w_v_9","_put_hevc_qpel_bi_w_hv_9","_put_hevc_epel_bi_w_h_9","_put_hevc_epel_bi_w_v_9","_put_hevc_epel_bi_w_hv_9","_put_hevc_pel_bi_w_pixels_10","_put_hevc_qpel_bi_w_h_10","_put_hevc_qpel_bi_w_v_10","_put_hevc_qpel_bi_w_hv_10","_put_hevc_epel_bi_w_h_10","_put_hevc_epel_bi_w_v_10","_put_hevc_epel_bi_w_hv_10","_put_hevc_pel_bi_w_pixels_12","_put_hevc_qpel_bi_w_h_12","_put_hevc_qpel_bi_w_v_12","_put_hevc_qpel_bi_w_hv_12","_put_hevc_epel_bi_w_h_12","_put_hevc_epel_bi_w_v_12","_put_hevc_epel_bi_w_hv_12","_put_hevc_pel_bi_w_pixels_8","_put_hevc_qpel_bi_w_h_8","_put_hevc_qpel_bi_w_v_8","_put_hevc_qpel_bi_w_hv_8","_put_hevc_epel_bi_w_h_8","_put_hevc_epel_bi_w_v_8","_put_hevc_epel_bi_w_hv_8"];var debug_tables={"dd":debug_table_dd,"did":debug_table_did,"didd":debug_table_didd,"fii":debug_table_fii,"fiii":debug_table_fiii,"ii":debug_table_ii,"iid":debug_table_iid,"iidiiii":debug_table_iidiiii,"iii":debug_table_iii,"iiii":debug_table_iiii,"iiiii":debug_table_iiiii,"iiiiii":debug_table_iiiiii,"iiiiiii":debug_table_iiiiiii,"iiiiiiii":debug_table_iiiiiiii,"iiiiij":debug_table_iiiiij,"iiiji":debug_table_iiiji,"iiijjji":debug_table_iiijjji,"jiiij":debug_table_jiiij,"jiiji":debug_table_jiiji,"jiji":debug_table_jiji,"v":debug_table_v,"vdiidiiiii":debug_table_vdiidiiiii,"vi":debug_table_vi,"vii":debug_table_vii,"viidi":debug_table_viidi,"viifi":debug_table_viifi,"viii":debug_table_viii,"viiii":debug_table_viiii,"viiiid":debug_table_viiiid,"viiiifii":debug_table_viiiifii,"viiiii":debug_table_viiiii,"viiiiidd":debug_table_viiiiidd,"viiiiii":debug_table_viiiiii,"viiiiiifi":debug_table_viiiiiifi,"viiiiiii":debug_table_viiiiiii,"viiiiiiii":debug_table_viiiiiiii,"viiiiiiiid":debug_table_viiiiiiiid,"viiiiiiiidi":debug_table_viiiiiiiidi,"viiiiiiiii":debug_table_viiiiiiiii,"viiiiiiiiii":debug_table_viiiiiiiiii,"viiiiiiiiiii":debug_table_viiiiiiiiiii,"viiiiiiiiiiii":debug_table_viiiiiiiiiiii,"viiiiiiiiiiiiii":debug_table_viiiiiiiiiiiiii};function nullFunc_dd(x){abortFnPtrError(x,"dd")}function nullFunc_did(x){abortFnPtrError(x,"did")}function nullFunc_didd(x){abortFnPtrError(x,"didd")}function nullFunc_fii(x){abortFnPtrError(x,"fii")}function nullFunc_fiii(x){abortFnPtrError(x,"fiii")}function nullFunc_ii(x){abortFnPtrError(x,"ii")}function nullFunc_iid(x){abortFnPtrError(x,"iid")}function nullFunc_iidiiii(x){abortFnPtrError(x,"iidiiii")}function nullFunc_iii(x){abortFnPtrError(x,"iii")}function nullFunc_iiii(x){abortFnPtrError(x,"iiii")}function nullFunc_iiiii(x){abortFnPtrError(x,"iiiii")}function nullFunc_iiiiii(x){abortFnPtrError(x,"iiiiii")}function nullFunc_iiiiiii(x){abortFnPtrError(x,"iiiiiii")}function nullFunc_iiiiiiii(x){abortFnPtrError(x,"iiiiiiii")}function nullFunc_iiiiij(x){abortFnPtrError(x,"iiiiij")}function nullFunc_iiiji(x){abortFnPtrError(x,"iiiji")}function nullFunc_iiijjji(x){abortFnPtrError(x,"iiijjji")}function nullFunc_jiiij(x){abortFnPtrError(x,"jiiij")}function nullFunc_jiiji(x){abortFnPtrError(x,"jiiji")}function nullFunc_jiji(x){abortFnPtrError(x,"jiji")}function nullFunc_v(x){abortFnPtrError(x,"v")}function nullFunc_vdiidiiiii(x){abortFnPtrError(x,"vdiidiiiii")}function nullFunc_vi(x){abortFnPtrError(x,"vi")}function nullFunc_vii(x){abortFnPtrError(x,"vii")}function nullFunc_viidi(x){abortFnPtrError(x,"viidi")}function nullFunc_viifi(x){abortFnPtrError(x,"viifi")}function nullFunc_viii(x){abortFnPtrError(x,"viii")}function nullFunc_viiii(x){abortFnPtrError(x,"viiii")}function nullFunc_viiiid(x){abortFnPtrError(x,"viiiid")}function nullFunc_viiiifii(x){abortFnPtrError(x,"viiiifii")}function nullFunc_viiiii(x){abortFnPtrError(x,"viiiii")}function nullFunc_viiiiidd(x){abortFnPtrError(x,"viiiiidd")}function nullFunc_viiiiii(x){abortFnPtrError(x,"viiiiii")}function nullFunc_viiiiiifi(x){abortFnPtrError(x,"viiiiiifi")}function nullFunc_viiiiiii(x){abortFnPtrError(x,"viiiiiii")}function nullFunc_viiiiiiii(x){abortFnPtrError(x,"viiiiiiii")}function nullFunc_viiiiiiiid(x){abortFnPtrError(x,"viiiiiiiid")}function nullFunc_viiiiiiiidi(x){abortFnPtrError(x,"viiiiiiiidi")}function nullFunc_viiiiiiiii(x){abortFnPtrError(x,"viiiiiiiii")}function nullFunc_viiiiiiiiii(x){abortFnPtrError(x,"viiiiiiiiii")}function nullFunc_viiiiiiiiiii(x){abortFnPtrError(x,"viiiiiiiiiii")}function nullFunc_viiiiiiiiiiii(x){abortFnPtrError(x,"viiiiiiiiiiii")}function nullFunc_viiiiiiiiiiiiii(x){abortFnPtrError(x,"viiiiiiiiiiiiii")}function jsCall_dd(index,a1){return functionPointers[index](a1)}function jsCall_did(index,a1,a2){return functionPointers[index](a1,a2)}function jsCall_didd(index,a1,a2,a3){return functionPointers[index](a1,a2,a3)}function jsCall_fii(index,a1,a2){return functionPointers[index](a1,a2)}function jsCall_fiii(index,a1,a2,a3){return functionPointers[index](a1,a2,a3)}function jsCall_ii(index,a1){return functionPointers[index](a1)}function jsCall_iid(index,a1,a2){return functionPointers[index](a1,a2)}function jsCall_iidiiii(index,a1,a2,a3,a4,a5,a6){return functionPointers[index](a1,a2,a3,a4,a5,a6)}function jsCall_iii(index,a1,a2){return functionPointers[index](a1,a2)}function jsCall_iiii(index,a1,a2,a3){return functionPointers[index](a1,a2,a3)}function jsCall_iiiii(index,a1,a2,a3,a4){return functionPointers[index](a1,a2,a3,a4)}function jsCall_iiiiii(index,a1,a2,a3,a4,a5){return functionPointers[index](a1,a2,a3,a4,a5)}function jsCall_iiiiiii(index,a1,a2,a3,a4,a5,a6){return functionPointers[index](a1,a2,a3,a4,a5,a6)}function jsCall_iiiiiiii(index,a1,a2,a3,a4,a5,a6,a7){return functionPointers[index](a1,a2,a3,a4,a5,a6,a7)}function jsCall_iiiiij(index,a1,a2,a3,a4,a5){return functionPointers[index](a1,a2,a3,a4,a5)}function jsCall_iiiji(index,a1,a2,a3,a4){return functionPointers[index](a1,a2,a3,a4)}function jsCall_iiijjji(index,a1,a2,a3,a4,a5,a6){return functionPointers[index](a1,a2,a3,a4,a5,a6)}function jsCall_jiiij(index,a1,a2,a3,a4){return functionPointers[index](a1,a2,a3,a4)}function jsCall_jiiji(index,a1,a2,a3,a4){return functionPointers[index](a1,a2,a3,a4)}function jsCall_jiji(index,a1,a2,a3){return functionPointers[index](a1,a2,a3)}function jsCall_v(index){functionPointers[index]()}function jsCall_vdiidiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9){functionPointers[index](a1,a2,a3,a4,a5,a6,a7,a8,a9)}function jsCall_vi(index,a1){functionPointers[index](a1)}function jsCall_vii(index,a1,a2){functionPointers[index](a1,a2)}function jsCall_viidi(index,a1,a2,a3,a4){functionPointers[index](a1,a2,a3,a4)}function jsCall_viifi(index,a1,a2,a3,a4){functionPointers[index](a1,a2,a3,a4)}function jsCall_viii(index,a1,a2,a3){functionPointers[index](a1,a2,a3)}function jsCall_viiii(index,a1,a2,a3,a4){functionPointers[index](a1,a2,a3,a4)}function jsCall_viiiid(index,a1,a2,a3,a4,a5){functionPointers[index](a1,a2,a3,a4,a5)}function jsCall_viiiifii(index,a1,a2,a3,a4,a5,a6,a7){functionPointers[index](a1,a2,a3,a4,a5,a6,a7)}function jsCall_viiiii(index,a1,a2,a3,a4,a5){functionPointers[index](a1,a2,a3,a4,a5)}function jsCall_viiiiidd(index,a1,a2,a3,a4,a5,a6,a7){functionPointers[index](a1,a2,a3,a4,a5,a6,a7)}function jsCall_viiiiii(index,a1,a2,a3,a4,a5,a6){functionPointers[index](a1,a2,a3,a4,a5,a6)}function jsCall_viiiiiifi(index,a1,a2,a3,a4,a5,a6,a7,a8){functionPointers[index](a1,a2,a3,a4,a5,a6,a7,a8)}function jsCall_viiiiiii(index,a1,a2,a3,a4,a5,a6,a7){functionPointers[index](a1,a2,a3,a4,a5,a6,a7)}function jsCall_viiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8){functionPointers[index](a1,a2,a3,a4,a5,a6,a7,a8)}function jsCall_viiiiiiiid(index,a1,a2,a3,a4,a5,a6,a7,a8,a9){functionPointers[index](a1,a2,a3,a4,a5,a6,a7,a8,a9)}function jsCall_viiiiiiiidi(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10){functionPointers[index](a1,a2,a3,a4,a5,a6,a7,a8,a9,a10)}function jsCall_viiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9){functionPointers[index](a1,a2,a3,a4,a5,a6,a7,a8,a9)}function jsCall_viiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10){functionPointers[index](a1,a2,a3,a4,a5,a6,a7,a8,a9,a10)}function jsCall_viiiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11){functionPointers[index](a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11)}function jsCall_viiiiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12){functionPointers[index](a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12)}function jsCall_viiiiiiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14){functionPointers[index](a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14)}var asmGlobalArg={};var asmLibraryArg={"___buildEnvironment":___buildEnvironment,"___lock":___lock,"___syscall221":___syscall221,"___syscall3":___syscall3,"___syscall5":___syscall5,"___unlock":___unlock,"___wasi_fd_close":___wasi_fd_close,"___wasi_fd_fdstat_get":___wasi_fd_fdstat_get,"___wasi_fd_seek":___wasi_fd_seek,"___wasi_fd_write":___wasi_fd_write,"__emscripten_fetch_free":__emscripten_fetch_free,"__memory_base":1024,"__table_base":0,"_abort":_abort,"_clock":_clock,"_clock_gettime":_clock_gettime,"_emscripten_asm_const_i":_emscripten_asm_const_i,"_emscripten_get_heap_size":_emscripten_get_heap_size,"_emscripten_is_main_browser_thread":_emscripten_is_main_browser_thread,"_emscripten_memcpy_big":_emscripten_memcpy_big,"_emscripten_resize_heap":_emscripten_resize_heap,"_emscripten_start_fetch":_emscripten_start_fetch,"_fabs":_fabs,"_getenv":_getenv,"_gettimeofday":_gettimeofday,"_gmtime_r":_gmtime_r,"_llvm_exp2_f64":_llvm_exp2_f64,"_llvm_log2_f32":_llvm_log2_f32,"_llvm_stackrestore":_llvm_stackrestore,"_llvm_stacksave":_llvm_stacksave,"_llvm_trunc_f64":_llvm_trunc_f64,"_localtime_r":_localtime_r,"_nanosleep":_nanosleep,"_pthread_cond_destroy":_pthread_cond_destroy,"_pthread_cond_init":_pthread_cond_init,"_pthread_create":_pthread_create,"_pthread_join":_pthread_join,"_strftime":_strftime,"_sysconf":_sysconf,"_time":_time,"abortStackOverflow":abortStackOverflow,"getTempRet0":getTempRet0,"jsCall_dd":jsCall_dd,"jsCall_did":jsCall_did,"jsCall_didd":jsCall_didd,"jsCall_fii":jsCall_fii,"jsCall_fiii":jsCall_fiii,"jsCall_ii":jsCall_ii,"jsCall_iid":jsCall_iid,"jsCall_iidiiii":jsCall_iidiiii,"jsCall_iii":jsCall_iii,"jsCall_iiii":jsCall_iiii,"jsCall_iiiii":jsCall_iiiii,"jsCall_iiiiii":jsCall_iiiiii,"jsCall_iiiiiii":jsCall_iiiiiii,"jsCall_iiiiiiii":jsCall_iiiiiiii,"jsCall_iiiiij":jsCall_iiiiij,"jsCall_iiiji":jsCall_iiiji,"jsCall_iiijjji":jsCall_iiijjji,"jsCall_jiiij":jsCall_jiiij,"jsCall_jiiji":jsCall_jiiji,"jsCall_jiji":jsCall_jiji,"jsCall_v":jsCall_v,"jsCall_vdiidiiiii":jsCall_vdiidiiiii,"jsCall_vi":jsCall_vi,"jsCall_vii":jsCall_vii,"jsCall_viidi":jsCall_viidi,"jsCall_viifi":jsCall_viifi,"jsCall_viii":jsCall_viii,"jsCall_viiii":jsCall_viiii,"jsCall_viiiid":jsCall_viiiid,"jsCall_viiiifii":jsCall_viiiifii,"jsCall_viiiii":jsCall_viiiii,"jsCall_viiiiidd":jsCall_viiiiidd,"jsCall_viiiiii":jsCall_viiiiii,"jsCall_viiiiiifi":jsCall_viiiiiifi,"jsCall_viiiiiii":jsCall_viiiiiii,"jsCall_viiiiiiii":jsCall_viiiiiiii,"jsCall_viiiiiiiid":jsCall_viiiiiiiid,"jsCall_viiiiiiiidi":jsCall_viiiiiiiidi,"jsCall_viiiiiiiii":jsCall_viiiiiiiii,"jsCall_viiiiiiiiii":jsCall_viiiiiiiiii,"jsCall_viiiiiiiiiii":jsCall_viiiiiiiiiii,"jsCall_viiiiiiiiiiii":jsCall_viiiiiiiiiiii,"jsCall_viiiiiiiiiiiiii":jsCall_viiiiiiiiiiiiii,"memory":wasmMemory,"nullFunc_dd":nullFunc_dd,"nullFunc_did":nullFunc_did,"nullFunc_didd":nullFunc_didd,"nullFunc_fii":nullFunc_fii,"nullFunc_fiii":nullFunc_fiii,"nullFunc_ii":nullFunc_ii,"nullFunc_iid":nullFunc_iid,"nullFunc_iidiiii":nullFunc_iidiiii,"nullFunc_iii":nullFunc_iii,"nullFunc_iiii":nullFunc_iiii,"nullFunc_iiiii":nullFunc_iiiii,"nullFunc_iiiiii":nullFunc_iiiiii,"nullFunc_iiiiiii":nullFunc_iiiiiii,"nullFunc_iiiiiiii":nullFunc_iiiiiiii,"nullFunc_iiiiij":nullFunc_iiiiij,"nullFunc_iiiji":nullFunc_iiiji,"nullFunc_iiijjji":nullFunc_iiijjji,"nullFunc_jiiij":nullFunc_jiiij,"nullFunc_jiiji":nullFunc_jiiji,"nullFunc_jiji":nullFunc_jiji,"nullFunc_v":nullFunc_v,"nullFunc_vdiidiiiii":nullFunc_vdiidiiiii,"nullFunc_vi":nullFunc_vi,"nullFunc_vii":nullFunc_vii,"nullFunc_viidi":nullFunc_viidi,"nullFunc_viifi":nullFunc_viifi,"nullFunc_viii":nullFunc_viii,"nullFunc_viiii":nullFunc_viiii,"nullFunc_viiiid":nullFunc_viiiid,"nullFunc_viiiifii":nullFunc_viiiifii,"nullFunc_viiiii":nullFunc_viiiii,"nullFunc_viiiiidd":nullFunc_viiiiidd,"nullFunc_viiiiii":nullFunc_viiiiii,"nullFunc_viiiiiifi":nullFunc_viiiiiifi,"nullFunc_viiiiiii":nullFunc_viiiiiii,"nullFunc_viiiiiiii":nullFunc_viiiiiiii,"nullFunc_viiiiiiiid":nullFunc_viiiiiiiid,"nullFunc_viiiiiiiidi":nullFunc_viiiiiiiidi,"nullFunc_viiiiiiiii":nullFunc_viiiiiiiii,"nullFunc_viiiiiiiiii":nullFunc_viiiiiiiiii,"nullFunc_viiiiiiiiiii":nullFunc_viiiiiiiiiii,"nullFunc_viiiiiiiiiiii":nullFunc_viiiiiiiiiiii,"nullFunc_viiiiiiiiiiiiii":nullFunc_viiiiiiiiiiiiii,"table":wasmTable};var asm=Module["asm"](asmGlobalArg,asmLibraryArg,buffer);Module["asm"]=asm;var _AVSniffHttpFlvInit=Module["_AVSniffHttpFlvInit"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["_AVSniffHttpFlvInit"].apply(null,arguments)};var _AVSniffStreamInit=Module["_AVSniffStreamInit"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["_AVSniffStreamInit"].apply(null,arguments)};var ___emscripten_environ_constructor=Module["___emscripten_environ_constructor"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["___emscripten_environ_constructor"].apply(null,arguments)};var ___errno_location=Module["___errno_location"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["___errno_location"].apply(null,arguments)};var __get_daylight=Module["__get_daylight"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["__get_daylight"].apply(null,arguments)};var __get_timezone=Module["__get_timezone"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["__get_timezone"].apply(null,arguments)};var __get_tzname=Module["__get_tzname"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["__get_tzname"].apply(null,arguments)};var _closeVideo=Module["_closeVideo"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["_closeVideo"].apply(null,arguments)};var _decodeCodecContext=Module["_decodeCodecContext"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["_decodeCodecContext"].apply(null,arguments)};var _decodeHttpFlvVideoFrame=Module["_decodeHttpFlvVideoFrame"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["_decodeHttpFlvVideoFrame"].apply(null,arguments)};var _decodeVideoFrame=Module["_decodeVideoFrame"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["_decodeVideoFrame"].apply(null,arguments)};var _demuxBox=Module["_demuxBox"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["_demuxBox"].apply(null,arguments)};var _exitMissile=Module["_exitMissile"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["_exitMissile"].apply(null,arguments)};var _exitTsMissile=Module["_exitTsMissile"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["_exitTsMissile"].apply(null,arguments)};var _fflush=Module["_fflush"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["_fflush"].apply(null,arguments)};var _free=Module["_free"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["_free"].apply(null,arguments)};var _getAudioCodecID=Module["_getAudioCodecID"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["_getAudioCodecID"].apply(null,arguments)};var _getBufferLengthApi=Module["_getBufferLengthApi"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["_getBufferLengthApi"].apply(null,arguments)};var _getExtensionInfo=Module["_getExtensionInfo"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["_getExtensionInfo"].apply(null,arguments)};var _getMediaInfo=Module["_getMediaInfo"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["_getMediaInfo"].apply(null,arguments)};var _getPPS=Module["_getPPS"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["_getPPS"].apply(null,arguments)};var _getPPSLen=Module["_getPPSLen"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["_getPPSLen"].apply(null,arguments)};var _getPacket=Module["_getPacket"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["_getPacket"].apply(null,arguments)};var _getSEI=Module["_getSEI"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["_getSEI"].apply(null,arguments)};var _getSEILen=Module["_getSEILen"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["_getSEILen"].apply(null,arguments)};var _getSPS=Module["_getSPS"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["_getSPS"].apply(null,arguments)};var _getSPSLen=Module["_getSPSLen"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["_getSPSLen"].apply(null,arguments)};var _getSniffHttpFlvPkg=Module["_getSniffHttpFlvPkg"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["_getSniffHttpFlvPkg"].apply(null,arguments)};var _getSniffHttpFlvPkgNoCheckProbe=Module["_getSniffHttpFlvPkgNoCheckProbe"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["_getSniffHttpFlvPkgNoCheckProbe"].apply(null,arguments)};var _getSniffStreamPkg=Module["_getSniffStreamPkg"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["_getSniffStreamPkg"].apply(null,arguments)};var _getSniffStreamPkgNoCheckProbe=Module["_getSniffStreamPkgNoCheckProbe"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["_getSniffStreamPkgNoCheckProbe"].apply(null,arguments)};var _getVLC=Module["_getVLC"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["_getVLC"].apply(null,arguments)};var _getVLCLen=Module["_getVLCLen"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["_getVLCLen"].apply(null,arguments)};var _getVPS=Module["_getVPS"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["_getVPS"].apply(null,arguments)};var _getVPSLen=Module["_getVPSLen"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["_getVPSLen"].apply(null,arguments)};var _getVideoCodecID=Module["_getVideoCodecID"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["_getVideoCodecID"].apply(null,arguments)};var _initMissile=Module["_initMissile"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["_initMissile"].apply(null,arguments)};var _initTsMissile=Module["_initTsMissile"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["_initTsMissile"].apply(null,arguments)};var _initializeDecoder=Module["_initializeDecoder"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["_initializeDecoder"].apply(null,arguments)};var _initializeDemuxer=Module["_initializeDemuxer"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["_initializeDemuxer"].apply(null,arguments)};var _initializeSniffHttpFlvModule=Module["_initializeSniffHttpFlvModule"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["_initializeSniffHttpFlvModule"].apply(null,arguments)};var _initializeSniffHttpFlvModuleWithAOpt=Module["_initializeSniffHttpFlvModuleWithAOpt"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["_initializeSniffHttpFlvModuleWithAOpt"].apply(null,arguments)};var _initializeSniffStreamModule=Module["_initializeSniffStreamModule"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["_initializeSniffStreamModule"].apply(null,arguments)};var _initializeSniffStreamModuleWithAOpt=Module["_initializeSniffStreamModuleWithAOpt"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["_initializeSniffStreamModuleWithAOpt"].apply(null,arguments)};var _main=Module["_main"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["_main"].apply(null,arguments)};var _malloc=Module["_malloc"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["_malloc"].apply(null,arguments)};var _pushSniffHttpFlvData=Module["_pushSniffHttpFlvData"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["_pushSniffHttpFlvData"].apply(null,arguments)};var _pushSniffStreamData=Module["_pushSniffStreamData"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["_pushSniffStreamData"].apply(null,arguments)};var _registerPlayer=Module["_registerPlayer"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["_registerPlayer"].apply(null,arguments)};var _release=Module["_release"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["_release"].apply(null,arguments)};var _releaseHttpFLV=Module["_releaseHttpFLV"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["_releaseHttpFLV"].apply(null,arguments)};var _releaseSniffHttpFlv=Module["_releaseSniffHttpFlv"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["_releaseSniffHttpFlv"].apply(null,arguments)};var _releaseSniffStream=Module["_releaseSniffStream"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["_releaseSniffStream"].apply(null,arguments)};var _setCodecType=Module["_setCodecType"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["_setCodecType"].apply(null,arguments)};var establishStackSpace=Module["establishStackSpace"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["establishStackSpace"].apply(null,arguments)};var stackAlloc=Module["stackAlloc"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["stackAlloc"].apply(null,arguments)};var stackRestore=Module["stackRestore"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["stackRestore"].apply(null,arguments)};var stackSave=Module["stackSave"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["stackSave"].apply(null,arguments)};var dynCall_v=Module["dynCall_v"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["dynCall_v"].apply(null,arguments)};var dynCall_vi=Module["dynCall_vi"]=function(){assert(runtimeInitialized,"you need to wait for the runtime to be ready (e.g. wait for main() to be called)");assert(!runtimeExited,"the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");return Module["asm"]["dynCall_vi"].apply(null,arguments)};Module["asm"]=asm;if(!Object.getOwnPropertyDescriptor(Module,"intArrayFromString"))Module["intArrayFromString"]=function(){abort("'intArrayFromString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"intArrayToString"))Module["intArrayToString"]=function(){abort("'intArrayToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};Module["ccall"]=ccall;Module["cwrap"]=cwrap;if(!Object.getOwnPropertyDescriptor(Module,"setValue"))Module["setValue"]=function(){abort("'setValue' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"getValue"))Module["getValue"]=function(){abort("'getValue' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"allocate"))Module["allocate"]=function(){abort("'allocate' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"getMemory"))Module["getMemory"]=function(){abort("'getMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"AsciiToString"))Module["AsciiToString"]=function(){abort("'AsciiToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stringToAscii"))Module["stringToAscii"]=function(){abort("'stringToAscii' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"UTF8ArrayToString"))Module["UTF8ArrayToString"]=function(){abort("'UTF8ArrayToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"UTF8ToString"))Module["UTF8ToString"]=function(){abort("'UTF8ToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stringToUTF8Array"))Module["stringToUTF8Array"]=function(){abort("'stringToUTF8Array' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stringToUTF8"))Module["stringToUTF8"]=function(){abort("'stringToUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"lengthBytesUTF8"))Module["lengthBytesUTF8"]=function(){abort("'lengthBytesUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"UTF16ToString"))Module["UTF16ToString"]=function(){abort("'UTF16ToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stringToUTF16"))Module["stringToUTF16"]=function(){abort("'stringToUTF16' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"lengthBytesUTF16"))Module["lengthBytesUTF16"]=function(){abort("'lengthBytesUTF16' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"UTF32ToString"))Module["UTF32ToString"]=function(){abort("'UTF32ToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stringToUTF32"))Module["stringToUTF32"]=function(){abort("'stringToUTF32' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"lengthBytesUTF32"))Module["lengthBytesUTF32"]=function(){abort("'lengthBytesUTF32' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"allocateUTF8"))Module["allocateUTF8"]=function(){abort("'allocateUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stackTrace"))Module["stackTrace"]=function(){abort("'stackTrace' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"addOnPreRun"))Module["addOnPreRun"]=function(){abort("'addOnPreRun' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"addOnInit"))Module["addOnInit"]=function(){abort("'addOnInit' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"addOnPreMain"))Module["addOnPreMain"]=function(){abort("'addOnPreMain' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"addOnExit"))Module["addOnExit"]=function(){abort("'addOnExit' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"addOnPostRun"))Module["addOnPostRun"]=function(){abort("'addOnPostRun' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"writeStringToMemory"))Module["writeStringToMemory"]=function(){abort("'writeStringToMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"writeArrayToMemory"))Module["writeArrayToMemory"]=function(){abort("'writeArrayToMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"writeAsciiToMemory"))Module["writeAsciiToMemory"]=function(){abort("'writeAsciiToMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"addRunDependency"))Module["addRunDependency"]=function(){abort("'addRunDependency' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"removeRunDependency"))Module["removeRunDependency"]=function(){abort("'removeRunDependency' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"ENV"))Module["ENV"]=function(){abort("'ENV' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"FS"))Module["FS"]=function(){abort("'FS' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"FS_createFolder"))Module["FS_createFolder"]=function(){abort("'FS_createFolder' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"FS_createPath"))Module["FS_createPath"]=function(){abort("'FS_createPath' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"FS_createDataFile"))Module["FS_createDataFile"]=function(){abort("'FS_createDataFile' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"FS_createPreloadedFile"))Module["FS_createPreloadedFile"]=function(){abort("'FS_createPreloadedFile' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"FS_createLazyFile"))Module["FS_createLazyFile"]=function(){abort("'FS_createLazyFile' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"FS_createLink"))Module["FS_createLink"]=function(){abort("'FS_createLink' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"FS_createDevice"))Module["FS_createDevice"]=function(){abort("'FS_createDevice' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"FS_unlink"))Module["FS_unlink"]=function(){abort("'FS_unlink' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")};if(!Object.getOwnPropertyDescriptor(Module,"GL"))Module["GL"]=function(){abort("'GL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"dynamicAlloc"))Module["dynamicAlloc"]=function(){abort("'dynamicAlloc' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"loadDynamicLibrary"))Module["loadDynamicLibrary"]=function(){abort("'loadDynamicLibrary' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"loadWebAssemblyModule"))Module["loadWebAssemblyModule"]=function(){abort("'loadWebAssemblyModule' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"getLEB"))Module["getLEB"]=function(){abort("'getLEB' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"getFunctionTables"))Module["getFunctionTables"]=function(){abort("'getFunctionTables' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"alignFunctionTables"))Module["alignFunctionTables"]=function(){abort("'alignFunctionTables' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"registerFunctions"))Module["registerFunctions"]=function(){abort("'registerFunctions' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};Module["addFunction"]=addFunction;Module["removeFunction"]=removeFunction;if(!Object.getOwnPropertyDescriptor(Module,"getFuncWrapper"))Module["getFuncWrapper"]=function(){abort("'getFuncWrapper' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"prettyPrint"))Module["prettyPrint"]=function(){abort("'prettyPrint' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"makeBigInt"))Module["makeBigInt"]=function(){abort("'makeBigInt' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"dynCall"))Module["dynCall"]=function(){abort("'dynCall' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"getCompilerSetting"))Module["getCompilerSetting"]=function(){abort("'getCompilerSetting' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stackSave"))Module["stackSave"]=function(){abort("'stackSave' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stackRestore"))Module["stackRestore"]=function(){abort("'stackRestore' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"stackAlloc"))Module["stackAlloc"]=function(){abort("'stackAlloc' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"establishStackSpace"))Module["establishStackSpace"]=function(){abort("'establishStackSpace' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"print"))Module["print"]=function(){abort("'print' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"printErr"))Module["printErr"]=function(){abort("'printErr' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"getTempRet0"))Module["getTempRet0"]=function(){abort("'getTempRet0' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"setTempRet0"))Module["setTempRet0"]=function(){abort("'setTempRet0' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"callMain"))Module["callMain"]=function(){abort("'callMain' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"abort"))Module["abort"]=function(){abort("'abort' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"Pointer_stringify"))Module["Pointer_stringify"]=function(){abort("'Pointer_stringify' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"warnOnce"))Module["warnOnce"]=function(){abort("'warnOnce' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")};if(!Object.getOwnPropertyDescriptor(Module,"ALLOC_NORMAL"))Object.defineProperty(Module,"ALLOC_NORMAL",{configurable:true,get:function(){abort("'ALLOC_NORMAL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}});if(!Object.getOwnPropertyDescriptor(Module,"ALLOC_STACK"))Object.defineProperty(Module,"ALLOC_STACK",{configurable:true,get:function(){abort("'ALLOC_STACK' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}});if(!Object.getOwnPropertyDescriptor(Module,"ALLOC_DYNAMIC"))Object.defineProperty(Module,"ALLOC_DYNAMIC",{configurable:true,get:function(){abort("'ALLOC_DYNAMIC' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}});if(!Object.getOwnPropertyDescriptor(Module,"ALLOC_NONE"))Object.defineProperty(Module,"ALLOC_NONE",{configurable:true,get:function(){abort("'ALLOC_NONE' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}});if(!Object.getOwnPropertyDescriptor(Module,"calledRun"))Object.defineProperty(Module,"calledRun",{configurable:true,get:function(){abort("'calledRun' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")}});var calledRun;function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}var calledMain=false;dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function callMain(args){assert(runDependencies==0,'cannot call main when async dependencies remain! (listen on Module["onRuntimeInitialized"])');assert(__ATPRERUN__.length==0,"cannot call main when preRun functions remain to be called");args=args||[];var argc=args.length+1;var argv=stackAlloc((argc+1)*4);HEAP32[argv>>2]=allocateUTF8OnStack(thisProgram);for(var i=1;i>2)+i]=allocateUTF8OnStack(args[i-1])}HEAP32[(argv>>2)+argc]=0;try{var ret=Module["_main"](argc,argv);exit(ret,true)}catch(e){if(e instanceof ExitStatus){return}else if(e=="SimulateInfiniteLoop"){noExitRuntime=true;return}else{var toLog=e;if(e&&typeof e==="object"&&e.stack){toLog=[e,e.stack]}err("exception thrown: "+toLog);quit_(1,e)}}finally{calledMain=true}}function run(args){args=args||arguments_;if(runDependencies>0){return}writeStackCookie();preRun();if(runDependencies>0)return;function doRun(){if(calledRun)return;calledRun=true;if(ABORT)return;initRuntime();preMain();if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();if(shouldRunNow)callMain(args);postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}checkStackCookie()}Module["run"]=run;function checkUnflushedContent(){var print=out;var printErr=err;var has=false;out=err=function(x){has=true};try{var flush=Module["_fflush"];if(flush)flush(0);["stdout","stderr"].forEach(function(name){var info=FS.analyzePath("/dev/"+name);if(!info)return;var stream=info.object;var rdev=stream.rdev;var tty=TTY.ttys[rdev];if(tty&&tty.output&&tty.output.length){has=true}})}catch(e){}out=print;err=printErr;if(has){warnOnce("stdio streams had content in them that was not flushed. you should set EXIT_RUNTIME to 1 (see the FAQ), or make sure to emit a newline when you printf etc.")}}function exit(status,implicit){checkUnflushedContent();if(implicit&&noExitRuntime&&status===0){return}if(noExitRuntime){if(!implicit){err("exit("+status+") called, but EXIT_RUNTIME is not set, so halting execution but not exiting the runtime or preventing further async execution (build with EXIT_RUNTIME=1, if you want a true shutdown)")}}else{ABORT=true;EXITSTATUS=status;exitRuntime();if(Module["onExit"])Module["onExit"](status)}quit_(status,new ExitStatus(status))}if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}var shouldRunNow=true;if(Module["noInitialRun"])shouldRunNow=false;noExitRuntime=true;run(); diff --git a/src/src/index.js b/src/src/index.js index beacbbd3..1edcc900 100644 --- a/src/src/index.js +++ b/src/src/index.js @@ -19,7 +19,7 @@ * Github: https://github.com/numberwolf/h265web.js * **********************************************************/ -require('./h265webjs-v20211123'); +require('./h265webjs-v20211125'); export default class h265webjs { static createPlayer(videoURL, config) { return window.new265webjs(videoURL, config); diff --git a/src/version.sh b/src/version.sh index 3ca9da49..b1d34580 100644 --- a/src/version.sh +++ b/src/version.sh @@ -19,4 +19,4 @@ # * Github: https://github.com/numberwolf/h265web.js # * # **********************************************************/ -VERSION='v20211123' # output version + index.js \ No newline at end of file +VERSION='v20211125' # output version + index.js \ No newline at end of file