!function(e){"function"==typeof define&&define.amd?define(e):e()}(function(){"use strict";class t{on(e,t,A){const s=this.e||(this.e={});return(s[e]||(s[e]=[])).push({fn:t,ctx:A}),this}once(s,i,r){const o=this;function a(){o.off(s,a);for(var e=arguments.length,t=new Array(e),A=0;A{delete t[e]}),void delete this.e;const s=t[e],i=[];if(s&&A)for(let e=0,t=s.length;e{var t;"[object Number]"===Object.prototype.toString.call(e)&&(s+=e,1e3<=(t=(e=F())-i)&&(A(s/t*1e3),i=e,s=0))}}(function(e){var o,t,a,A,s;o="undefined"!=typeof window&&void 0!==window.document?window.document:{},t=e.exports,a=function(){for(var e,t=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror"],["webkitRequestFullScreen","webkitCancelFullScreen","webkitCurrentFullScreenElement","webkitCancelFullScreen","webkitfullscreenchange","webkitfullscreenerror"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError"]],A=0,s=t.length,i={};A{var e=window.navigator.userAgent;return/MicroMessenger/i.test(e)};function z(e){return R(e.hasAudio)&&(e.useMSE||e.useWCS&&!e.useOffscreen)}function J(){return"https:"===window.location.protocol||"localhost"===window.location.hostname}function _(){{var A=j;let t="";if("object"==typeof A)try{t=JSON.stringify(A),t=JSON.parse(t)}catch(e){t=A}else t=A;return t}}function P(e){return!0===e||"true"===e}function R(e){return!0!==e&&"true"!==e}class V{constructor(e){this.destroys=[],this.proxy=this.proxy.bind(this),this.master=e}proxy(t,e,A){let s=3this.proxy(t,e,A,s));t.addEventListener(e,A,s);var i=()=>{"function"==typeof t.removeEventListener&&t.removeEventListener(e,A,s)};return this.destroys.push(i),i}}destroy(){this.master.debug&&this.master.debug.log("Events","destroy"),this.destroys.forEach(e=>e()),this.destroys=[]}}var q=A=>{A.on(d.decoderWorkerInit,()=>{A.debug.log("audioPlayer","listen decoderWorkerInit and set loaded true"),A.loaded=!0}),A.on(d.play,()=>{A.loading=!1}),A._opt.debug&&(Object.keys(d).forEach(t=>{A.on(d[t],e=>{A.debug.log("audioPlayer events",d[t],e)})}),Object.keys(p).forEach(t=>{A.on(p[t],e=>{A.debug.log("audioPlayer event error",p[t],e)})}))};class U extends t{constructor(t){super(),this.player=t,this.playing=!1,this.abortController=new AbortController,this.streamRate=I(e=>{t.emit(d.kBps,(e/1024).toFixed(2))}),this.streamRateInterval=null,t.debug.log("FetchStream","init")}destroy(){this.abort(),this.off(),this.streamRate=null,this.stopStreamRateInterval(),this.player.debug.log("FetchStream","destroy")}startStreamRateInterval(){this.stopStreamRateInterval(),this.streamRateInterval=setInterval(()=>{this.streamRate&&this.streamRate(0)},1e3)}stopStreamRateInterval(){this.streamRateInterval&&(clearInterval(this.streamRateInterval),this.streamRateInterval=null)}fetchStream(e){var t=1{if(!(e.ok&&200<=e.status&&e.status<=299))return this.player.debug.error("FetchStream",`fetch response status is ${e.status} and ok is ${e.ok} and emit error and next abort()`),this.abort(),void this.emit(p.fetchError,`fetch response status is ${e.status} and ok is `+e.ok);if(this.emit(d.streamSuccess),this.startStreamRateInterval(),"undefined"!=typeof WritableStream)e.body.pipeTo(new WritableStream({write:e=>(this.streamRate&&this.streamRate(e.byteLength),s.dispatch(e)),close:()=>{s.close()},abort:e=>{s.close();const t=e.toString();-1===t.indexOf(y)&&-1===t.indexOf(B)&&e.name!==L&&(this.abort(),this.emit(p.fetchError,e))}}));else{this.player.debug.log("FetchStream","not support WritableStream and use getReader() to read stream");const t=e.body.getReader(),A=()=>{t.read().then(e=>{var{done:e,value:t}=e;e?s.close():(this.streamRate&&this.streamRate(t.byteLength),s.dispatch(t),A())}).catch(e=>{s.close();const t=e.toString();-1===t.indexOf(y)&&-1===t.indexOf(B)&&e.name!==L&&(this.abort(),this.emit(p.fetchError,e))})};A()}}).catch(e=>{"AbortError"!==e.name&&(s.close(),this.abort(),this.emit(p.fetchError,e))})}abort(){this.abortController&&(this.abortController.abort(),this.abortController=null)}getStreamType(){return A}}class Z extends t{constructor(t){super(),this.player=t,this.socket=null,this.socketStatus=g,this.wsUrl=null,this.socketDestroyFnList=[],this.streamRate=I(e=>{t.emit(d.kBps,(e/1024).toFixed(2))}),this.streamRateInterval=null,t.debug.log("WebsocketStream","init")}destroy(){this._closeWebSocket(),this.stopStreamRateInterval(),this.wsUrl=null,this.off(),this.player.debug.log("WebsocketStream","destroy")}startStreamRateInterval(){this.stopStreamRateInterval(),this.streamRateInterval=setInterval(()=>{this.streamRate&&this.streamRate(0)},1e3)}stopStreamRateInterval(){this.streamRateInterval&&(clearInterval(this.streamRateInterval),this.streamRateInterval=null)}_createWebSocket(){const e=this.player,{debug:t,events:{proxy:A},demux:s}=e;this.socket=new WebSocket(this.wsUrl),this.socket.binaryType="arraybuffer";var i=A(this.socket,"open",()=>{t.log("WebsocketStream","socket open"),this.socketStatus=m,this.emit(d.streamSuccess),this.player.emit(d.websocketOpen),this.startStreamRateInterval()}),r=A(this.socket,"message",e=>{this.streamRate&&this.streamRate(e.data.byteLength),this._handleMessage(e.data)}),o=A(this.socket,"close",e=>{t.log("WebsocketStream","socket close and code is "+e.code),1006===e.code&&t.error("WebsocketStream","socket close abnormally and code is "+e.code),s.close(),this.socketStatus="close",this.player.emit(d.websocketClose),this.emit(d.streamEnd)}),a=A(this.socket,"error",e=>{t.error("WebsocketStream","socket error",e),this.socketStatus="error",this.emit(p.websocketError,e),s.close(),t.log("WebsocketStream","socket error:",e.isTrusted?"websocket user aborted":"websocket error")});this.socketDestroyFnList.push(i,r,o,a)}_closeWebSocket(){this.socketDestroyFnList.forEach(e=>e()),this.socket&&(this.socket.close(1e3,"Client disconnecting"),this.socket=null),this.socketStatus=g,this.streamRate=null}_handleMessage(e){const t=this.player["demux"];t?t.dispatch(e):this.player.debug.warn("WebsocketStream","websocket handle message demux is null")}fetchStream(e,t){this.player._times.streamStart=S(),this.wsUrl=e,this._createWebSocket()}sendMessage(e){this.socket?this.socketStatus===m?this.socket.send(e):this.player.debug.error("WebsocketStream","websocket send message error and socket status is "+this.socketStatus):this.player.debug.error("WebsocketStream","websocket send message socket is null")}resetFetchStream(){this._closeWebSocket(),this._createWebSocket()}getStreamType(){return s}}class X extends t{constructor(e){super(),(this.player=e).debug.log("HlsStream","init")}destroy(){this.off(),this.player.debug.log("HlsStream","destroy")}fetchStream(e){const t=this.player["hlsDecoder"];this.player._times.streamStart=S(),t.loadSource(e).then(()=>{this.player.debug.log("HlsStream","loadSource success"),this.emit(d.streamSuccess)}).catch(e=>{this.emit(p.hlsError,e)})}getStreamType(){return"hls"}}class $ extends t{constructor(e){super(),this.player=e,this.webrctUrl=null,e.debug.log("WebrtcStream","init")}destroy(){this.webrctUrl=null,this.off(),this.player.debug.log("WebrtcStream","destroy")}fetchStream(e){const t=this.player["webrtc"];this.player._times.streamStart=S(),this.webrctUrl=e.replace("webrtc:",window.location.protocol),t.loadSource(this.webrctUrl).then(()=>{this.player.debug.log("WebrtcStream","loadSource success"),this.emit(d.streamSuccess)}).catch(e=>{this.emit(p.webrtcError,e)})}getStreamType(){return"webrtc"}}class K extends t{constructor(t){super(),this.player=t,this.transport=null,this.wtUrl=null,this.streamRate=I(e=>{t.emit(d.kBps,(e/1024).toFixed(2))}),this.streamRateInterval=null,t.debug.log("WebTransportLoader","init")}destroy(){this.abort(),this.off(),this.player.debug.log("WebTransportLoader","destroy")}startStreamRateInterval(){this.stopStreamRateInterval(),this.streamRateInterval=setInterval(()=>{this.streamRate&&this.streamRate(0)},1e3)}stopStreamRateInterval(){this.streamRateInterval&&(clearInterval(this.streamRateInterval),this.streamRateInterval=null)}_createWebTransport(){const e=this.player,{events:{},demux:t}=e;try{this.transport=new WebTransport(this.wtUrl),this.transport.ready.then(()=>{this.emit(d.streamSuccess),this.startStreamRateInterval(),this.transport.createBidirectionalStream().then(e=>{e.readable.pipeTo(new WritableStream(t.input))})}).catch(e=>{this.player.debug.warn("WebTransportLoader","_createWebTransport-ready",e)})}catch(e){this.player.debug.warn("WebTransportLoader","_createWebTransport",e)}}fetchStream(e){this.player._times.streamStart=S(),this.wtUrl=e.replace(/^wt/,"https"),this._createWebTransport()}abort(){if(this.transport)try{this.transport.close(),this.transport=null}catch(e){this.transport=null}}getStreamType(){return"webTransport"}}class Q extends t{constructor(e){super(),this.player=e,this.workUrl=null,e.debug.log("WorkerStream","init")}destroy(){this.workUrl=null,this.off(),this.player.debug.log("WorkerStream","destroy")}sendMessage(e){this.player.decoderWorker.workerSendMessage(e)}fetchStream(e){this.workUrl=e,this.player._times.streamStart=S(),this.player.decoderWorker.workerFetchStream(e)}getStreamType(){return"worker "+(2===this.player._opt.protocol?A:s)}}class ee{constructor(e){return new(ee.getLoaderFactory(e._opt))(e)}static getLoaderFactory(e){var{protocol:t,useWasm:A,playType:s,playbackConfig:i}=e;return 2===t?s===o?Q:s===r?A&&!z(e)?Q:U:i.useWCS?U:Q:1===t?s===o?Q:s===r?A&&!z(e)?Q:Z:i.useWCS?Z:Q:3===t?X:4===t?$:5===t?K:void 0}}class te extends t{constructor(e){super(),this.bufferList=[],this.player=e,this.$audio=null,this.scriptNode=null,this.workletProcessorNode=null,this.hasInitScriptNode=!1,this.audioContext=new(window.AudioContext||window.webkitAudioContext)({sampleRate:48e3}),this.gainNode=this.audioContext.createGain();const t=this.audioContext.createBufferSource();t.buffer=this.audioContext.createBuffer(1,1,22050),t.connect(this.audioContext.destination),t.noteOn?t.noteOn(0):t.start(0),this.audioBufferSourceNode=t,this.mediaStreamAudioDestinationNode=this.audioContext.createMediaStreamDestination(),this.gainNode.gain.value=0,this.playing=!1,this.audioSyncVideoOption={diff:null},this.audioInfo={encType:"",channels:"",sampleRate:""},this.init=!1,this.hasAudio=!1,this.audioResumeStateTimeout=null,this.on(d.videoSyncAudio,e=>{this.audioSyncVideoOption=e})}destroy(){this.closeAudio(),this.resetInit(),this.audioContext.close(),this.audioContext=null,this.gainNode=null,this.hasAudio=!1,this.playing=!1,this.scriptNode&&(this.scriptNode.onaudioprocess=w,this.scriptNode=null),this.workletProcessorNode&&(this.workletProcessorNode.port.onmessage=w,this.workletProcessorNode=null),this.audioResumeStateTimeout&&(clearTimeout(this.audioResumeStateTimeout),this.audioResumeStateTimeout=null),this.audioBufferSourceNode=null,this.mediaStreamAudioDestinationNode=null,this.hasInitScriptNode=!1,this.audioSyncVideoOption={diff:null},this.off()}resetInit(){this.audioInfo={encType:"",channels:"",sampleRate:""},this.init=!1}getAudioInfo(){return this.audioInfo}updateAudioInfo(e){e.encTypeCode&&(this.audioInfo.encType=f[e.encTypeCode]),e.channels&&(this.audioInfo.channels=e.channels),e.sampleRate&&(this.audioInfo.sampleRate=e.sampleRate),this.audioInfo.sampleRate&&this.audioInfo.channels&&this.audioInfo.encType&&!this.init&&(this.player.emit(d.audioInfo,this.audioInfo),this.init=!0)}get isPlaying(){return this.playing}get isMute(){return 0===this.gainNode.gain.value}get volume(){return this.gainNode.gain.value}get bufferSize(){return this.bufferList.length}initScriptNode(){}initMobileScriptNode(){}initWorkletScriptNode(){}getEngineType(){return""}mute(e){e?(this.isMute||this.player.emit(d.mute,e),this.setVolume(0),this.clear()):(this.isMute&&this.player.emit(d.mute,e),this.setVolume(this.player.lastVolume||.5))}setVolume(e){e=parseFloat(e).toFixed(2),isNaN(e)||(this.audioEnabled(!0),e=W(e,0,1),this.gainNode.gain.value=e,this.player.emit(d.volumechange,this.player.volume))}closeAudio(){this.hasInitScriptNode&&(this.scriptNode&&this.scriptNode.disconnect(this.gainNode),this.workletProcessorNode&&this.workletProcessorNode.disconnect(this.gainNode),this.gainNode&&(this.gainNode.disconnect(this.mediaStreamAudioDestinationNode),this.$audio||this.gainNode.disconnect(this.audioContext.destination))),this.clear()}audioEnabled(e){e?this.isStateSuspended()&&(this.audioContext.resume().then(()=>{this.player.emit(d.audioResumeState,{state:this.audioContext.state,isRunning:this.isStateRunning()})}),this.audioResumeStateTimeout=setTimeout(()=>{clearTimeout(this.audioResumeStateTimeout),this.audioResumeStateTimeout=null,this.isStateSuspended()&&this.player.emit(d.audioResumeState,{state:this.audioContext.state,isRunning:this.isStateRunning()})},1e3)):this.isStateRunning()&&this.audioContext.suspend()}isStateRunning(){return"running"===this.audioContext.state}isStateSuspended(){return"suspended"===this.audioContext.state}clear(){this.bufferList=[]}play(e,t){}pause(){this.audioSyncVideoOption={diff:null},this.playing=!1}resume(){this.playing=!0}setRate(e){}getAudioBufferSize(){return 0}}class Ae{constructor(e,t,A,s){this.player=e,this.audio=t,this.channel=A,this.bufferSize=s}extract(t,e){var A=this.provide(e);for(let e=0;eo){try{for(let e=0;ethis._frameCount)||(e=this.frameCount),this._frameCount-=e,this._position+=e}receiveSamples(e){var t=1=e-1)break e;var a=A+2*r;s[i+2*o]=(1-this.slopeCount)*t[a]+this.slopeCount*t[a+2],s[i+2*o+1]=(1-this.slopeCount)*t[a+1]+this.slopeCount*t[a+3],o+=1,this.slopeCount+=this._rate}return this.prevSampleL=t[A+2*e-2],this.prevSampleR=t[A+2*e-1],o}}function re(){}class oe extends class{constructor(e){this._pipe=e}get pipe(){return this._pipe}get inputBuffer(){return this._pipe.inputBuffer}get outputBuffer(){return this._pipe.outputBuffer}fillInputBuffer(){throw new Error("fillInputBuffer() not overridden")}fillOutputBuffer(){let e=0this._position)throw new RangeError("New position may not be greater than current position");var t=this.outputBufferPosition-(this._position-e);if(t<0)throw new RangeError("New position falls outside of history buffer");this.outputBufferPosition=t,this._position=e}get sourcePosition(){return this._sourcePosition}set sourcePosition(e){this.clear(),this._sourcePosition=e}onEnd(){this.callback()}fillInputBuffer(){var e=0t&&(t=A,e=s);return e}seekBestOverlapPositionStereoQuick(){let t,A,s,i,r,o=0;for(this.preCalculateCorrelationReferenceStereo(),A=Number.MIN_VALUE,t=0,i=0,r=0;o<4;o+=1){let e=0;for(;ae[o][e]&&!((r=i+ae[o][e])>=this.seekLength);)(s=this.calculateCrossCorrelationStereo(2*r,this.refMidBuffer))>A&&(A=s,t=r),e+=1;i=t}return t}preCalculateCorrelationReferenceStereo(){let e,t,A=0;for(;A=this.sampleReq;){e=this.seekBestOverlapPosition(),this._outputBuffer.ensureAdditionalCapacity(this.overlapLength),this.overlap(Math.floor(e)),this._outputBuffer.put(this.overlapLength),0<(t=this.seekWindowLength-2*this.overlapLength)&&this._outputBuffer.putBuffer(this._inputBuffer,e+this.overlapLength,t);var t=this._inputBuffer.startIndex+2*(e+this.seekWindowLength-this.overlapLength);this.midBuffer.set(this._inputBuffer.vector.subarray(t,t+2*this.overlapLength)),this.skipFract+=this.nominalSkip,e=Math.floor(this.skipFract),this.skipFract-=e,this._inputBuffer.receive(e)}}}function he(e,t){return 1e-10<(t{e()}),this.eventListenList=[]),this.$audio&&(this.$audio.pause(),this.$audio.srcObject=null,this.$audio.parentNode&&this.$audio.parentNode.removeChild(this.$audio),this.$audio=null),this.processor&&(this.processor.destroy(),this.processor=null),this.rateProcessor&&(this.rateProcessor.destroy(),this.rateProcessor=null),this.scriptNodeInterval&&(clearInterval(this.scriptNodeInterval),this.scriptNodeInterval=null),this.defaultPlaybackRate=1,this.playbackRate=1,this.scriptStartTime=0,this.audioBufferSize=0,this.engineType=E,this.player.debug.log("AudioContext","destroy")}isAudioPlaying(){return this.$audio&&R(this.$audio.paused)&&R(this.$audio.ended)&&0!==this.$audio.playbackRate&&0!==this.$audio.readyState}_bindAudioProxy(){const e=this.player.events["proxy"],t=e(this.$audio,"canplay",()=>{this.player.debug.log("AudioContext","canplay"),this._delayPlay&&this._audioElementPlay()});this.eventListenList.push(t)}_getAudioElementReadyState(){let e=0;return e=this.$audio?this.$audio.readyState:e}audioElementPlay(){if(this.$audio){var e=this._getAudioElementReadyState();if(this.player.debug.log("AudioContext","play and readyState: "+e),!(0!==e||Y()&&k()))return this.player.debug.warn("AudioContext","readyState is 0 and set _delayPlay to true"),void(this._delayPlay=!0);this._audioElementPlay()}}_audioElementPlay(){this.$audio&&this.$audio.play().then(()=>{this._delayPlay=!1,this.player.debug.log("AudioContext","_audioElementPlay success"),setTimeout(()=>{this.isAudioPlaying()||(this.player.debug.warn("AudioContext","play failed and retry play"),this._audioElementPlay())},100),this.isAudioPlaying()&&(this.player.debug.log("AudioContext","play success and remove document click event listener"),document.removeEventListener("click",this._audioElementPlay.bind(this)))}).catch(e=>{this.player.debug.error("AudioContext","_audioElementPlay error",e),document.addEventListener("click",this._audioElementPlay.bind(this))})}getAudioBufferSize(){return this.audioBufferSize}get oneBufferDuration(){return this.audioBufferSize/this.audioContext.sampleRate*1e3}get isActiveEngineType(){return this.engineType===C}initProcessor(){this.processor=new Ae(this.player,this,this.audioInfo.channels,this.audioBufferSize),this.rateProcessor=new ue(this.player,this,this.processor)}getAutoAudioEngineType(){let e=this.player._opt.audioEngine||E;var t=()=>{e=Y()&&function(){var e=window.navigator.userAgent.toLowerCase();return/android/i.test(e)}()?C:(!k()||!this.player._opt.supportLockScreenPlayAudio)&&J()?b:E};return this.player._opt.audioEngine?this.player._opt.audioEngine===b&&J()?e=b:this.player._opt.audioEngine===C?e=C:this.player._opt.audioEngine===E?e=E:t():t(),e}getAudioBufferSizeByType(){var e=this.engineType,t=(this.player._opt.hasVideo,this.player._opt.weiXinInAndroidAudioBufferSize);return e!==b&&e===C?t||4800:1024}initScriptNode(){this.playing=!0,this.hasInitScriptNode||(this.initProcessor(),this.engineType===b?this.initWorkletScriptNode():this.engineType===C?this.initIntervalScriptNode():this.engineType===E&&this.initProcessScriptNode(),this.audioElementPlay())}getEngineType(){return this.engineType}isPlaybackRateSpeed(){return this.playbackRate>this.defaultPlaybackRate}initProcessScriptNode(){const e=this.audioContext.createScriptProcessor(this.audioBufferSize,0,this.audioInfo.channels);e.onaudioprocess=e=>{e=e.outputBuffer;this.handleScriptNodeCallback(e)},e.connect(this.gainNode),this.scriptNode=e,this.gainNode.connect(this.mediaStreamAudioDestinationNode),this.$audio?this.$audio.srcObject=this.mediaStreamAudioDestinationNode.stream:this.gainNode.connect(this.audioContext.destination),this.hasInitScriptNode=!0}initIntervalScriptNode(){this.scriptStartTime=0;var e=1e3*this.audioBufferSize/this.audioContext.sampleRate;this.scriptNodeInterval=setInterval(()=>{const e=this.audioContext.createBufferSource(),t=this.audioContext.createBuffer(this.audioInfo.channels,this.audioBufferSize,this.audioContext.sampleRate);this.handleScriptNodeCallback(t,()=>{this.scriptStartTime{"init"===e.data.message?(this.audioBufferSize=e.data.audioBufferSize,this.start=e.data.start,this.channels=e.data.channels,this.state=0,this.offset=0,this.samplesArray=[]):"stop"===e.data.message?(this.state=0,this.start=!1,this.offset=0,this.samplesArray=[]):"data"===e.data.message?this.samplesArray.push(e.data.buffer):"zero"===e.data.message&&this.samplesArray.push({left:new Float32Array(this.audioBufferSize).fill(0),right:new Float32Array(this.audioBufferSize).fill(0)})}}process(t,e,A){const s=e[0][0],i=e[0][1];if(0===this.offset&&this.port.postMessage({message:"beep"}),0===this.state)this.state=1;else if(1===this.state&&this.samplesArray.length>=4)this.state=2;else if(2===this.state){const t=this.samplesArray[0];for(let e=0;e{if(this.audioContext){let e=[1];2===this.audioInfo.channels&&(e=[1,1]),this.workletProcessorNode=new AudioWorkletNode(this.audioContext,"worklet-processor",{numberOfOutputs:this.audioInfo.channels,outputChannelCount:e}),this.workletProcessorNode.connect(this.gainNode),this.gainNode.connect(this.mediaStreamAudioDestinationNode),this.$audio?this.$audio.srcObject=this.mediaStreamAudioDestinationNode.stream:this.gainNode.connect(this.audioContext.destination),this.hasInitScriptNode=!0,this.workletProcessorNode.port.postMessage({message:"init",audioBufferSize:this.audioBufferSize,start:!0,channels:this.audioInfo.channels}),this.workletProcessorNode.port.onmessage=e=>{this.workletProcessorNode?this.audioContext?this.handleScriptNodeCallback(this.workletProcessorNode,null,!0):this.workletProcessorNode.port.postMessage({message:"zero"}):this.player.debug.error("AudioContext","workletProcessorNode is null")}}else this.player.debug.error("AudioContext","initWorkletScriptNode audioContext is null")})}handleScriptNodeCallback(e,t){let A,s=2A)return this.player.debug.warn("AudioContext",`bufferList length ${this.bufferList.length} more than ${A}, and drop`),void this.clear();this.bufferList.length>t?(e=this.defaultPlaybackRate+.1,this.player.debug.warn("AudioContext",`bufferList length ${this.bufferList.length} more than ${t}, speed up, playbackRate is `+e)):this.bufferList.length{this.listenPlaybackPause(e)}),this.player.debug.log("AudioPlaybackContext","init")}destroy(){this.delayTimeout&&(clearTimeout(this.delayTimeout),this.delayTimeout=null),super.destroy(),this.player.debug.log("AudioPlaybackLoader","destroy")}listenPlaybackPause(e){e?(this.pause(),this.player.playback.isPlaybackPauseClearCache&&this.clear()):this.resume()}initScriptNodeDelay(){var e=this.player._opt.playbackDelayTime;0{this.initScriptNode()},e):this.initScriptNode()}setRate(e){e!==this.defaultPlaybackRate&&this.rateProcessor&&(this.player.debug.log("AudioPlaybackContext","setRate",e),this.defaultPlaybackRate=e,this.updatePlaybackRate(e))}}class pe extends M{constructor(e){super(e),this.TAG_NAME="AudioPlayerLoader",this.player.debug.log(this.TAG_NAME,"init")}destroy(){super.destroy(),this.player.debug.log(this.TAG_NAME,"destroy")}play(e,t){R(this.playing)||super.play(e,t)}pause(){this.player.debug.log(this.TAG_NAME,"pause"),this.playing=!1,this.clear()}resume(){this.player.debug.log(this.TAG_NAME,"resume"),this.playing=!0}}class H{constructor(e){return new(H.getLoaderFactory(e._opt))(e)}static getLoaderFactory(e){return"playbackTF"===e.playType?ce:e.playType===o?pe:e.isHls&&R(e.supportHls265)||e.isWebrtc&&R(e.isWebrtcH265)?de:M}}const N=()=>"wakeLock"in navigator&&-1===window.navigator.userAgent.indexOf("Samsung")&&R(k());class ge{constructor(e){this.player=e,this.enabled=!1,N()?(this.player.debug.log("NoSleep","Native Wake Lock API supported."),this._wakeLock=null,this.handleVisibilityChange=()=>{null!==this._wakeLock&&"visible"===document.visibilityState&&this.enable()},document.addEventListener("visibilitychange",this.handleVisibilityChange),document.addEventListener("fullscreenchange",this.handleVisibilityChange)):(this.player.debug.log("NoSleep","Native Wake Lock API not supported. so use video element."),this.noSleepVideo=document.createElement("video"),this.noSleepVideo.setAttribute("title","No Sleep"),this.noSleepVideo.setAttribute("playsinline",""),this._addSourceToVideo(this.noSleepVideo,"webm","data:video/webm;base64,GkXfo59ChoEBQveBAULygQRC84EIQoKEd2VibUKHgQRChYECGFOAZwEAAAAAABLfEU2bdLpNu4tTq4QVSalmU6yBoU27i1OrhBZUrmtTrIHYTbuMU6uEElTDZ1OsggGXTbuMU6uEHFO7a1OsghLJ7AEAAAAAAABZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmsirXsYMPQkBNgI1MYXZmNTguNDUuMTAwV0GNTGF2ZjU4LjQ1LjEwMESJiECzmgAAAAAAFlSua0C5rgEAAAAAAABO14EBc8WI9UhIq9EDJPCcgQAitZyDdW5khoVWX1ZQOIOBASPjg4QF9eEA4AEAAAAAAAAbsIIBQLqB8FSwggElVLqB8FWwiFW3gQFVuIECrgEAAAAAAABZ14ECc8WIUEWPA9J/iJ6cgQAitZyDdW5khoZBX09QVVNWqoNjLqBWu4QExLQAg4EC4ZGfgQG1iEDncAAAAAAAYmSBIGOik09wdXNIZWFkAQE4AYC7AAAAAAASVMNnQcJzcwEAAAAAAACXY8CAZ8gBAAAAAAAAFUWji01BSk9SX0JSQU5ERIeEaXNvbWfIAQAAAAAAABZFo41NSU5PUl9WRVJTSU9ORIeDNTEyZ8gBAAAAAAAAJ0WjkUNPTVBBVElCTEVfQlJBTkRTRIeQaXNvbWlzbzJhdmMxbXA0MWfIAQAAAAAAABpFo4dFTkNPREVSRIeNTGF2ZjU4LjQ1LjEwMHNzAQAAAAAAAIZjwItjxYj1SEir0QMk8GfIAQAAAAAAAB5Fo4xIQU5ETEVSX05BTUVEh4xWaWRlb0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Fgv9AAIgAQzX61yT5xzAACjh4ICCYD4//6jh4ICHYD4//6jh4ICMYD4//6jh4ICRYD4//6jh4ICWYD4//6jnoECXwDRAgAFEKwAGAAYWC/0AAiABDNfrXJPnHMAAKOHggJtgPj//qOHggKBgPj//qOHggKVgPj//qOHggKpgPj//qOHggK9gPj//qOegQLDANECAAUQEBRgAGFgv9AAIgAQzX61yT5xzAAAo4eCAtGA+P/+o4eCAuWA+P/+o4eCAvmA+P/+o4eCAw2A+P/+o4eCAyGA+P/+o56BAycA0QIABRCsABgAGFgv9AAIgAQzX61yT5xzAACjh4IDNYD4//6jh4IDSYD4//6jh4IDXYD4//6jh4IDcYD4//6jh4IDhYD4//6jnoEDiwDRAgAFEKwAGAAYWC/0AAiABDNfrXJPnHMAAKOHggOZgPj//qOHggOtgPj//qOHggPBgPj//qOHggPVgPj//qOHggPpgPj//qOegQPvANECAAUQrAAYABhYL/QACIAEM1+tck+ccwAAo4eCA/2A+P/+o4eCBBGA+P/+o4eCBCWA+P/+o4eCBDmA+P/+o4eCBE2A+P/+o56BBFMA0QIABRCsABgAGFgv9AAIgAQzX61yT5xzAACjh4IEiID4//6jh4IEnID4//6jh4IEsID4//6jnoEEtwDRAgAFEKwAGAAYWC/0AAiABDNfrXJPnHMAAKOHggTEgPj//qOHggTYgPj//qOHggTsgPj//qOHggUAgPj//qOHggUUgPj//qOegQUbANECAAUQrAAYABhYL/QACIAEM1+tck+ccwAAo4eCBSiA+P/+o4eCBTyA+P/+o4eCBVCA+P/+o4eCBWSA+P/+o4eCBXiA+P/+o56BBX8A0QIABRCsABgAGFgv9AAIgAQzX61yT5xzAACjh4IFjID4//6jh4IFoID4//6jh4IFtID4//6jh4IFyID4//6jh4IF3ID4//6jnoEF4wDRAgAFEKwAGAAYWC/0AAiABDNfrXJPnHMAAKOHggXwgPj//qOHggYEgPj//qOHggYYgPj//qOHggYsgPj//qOHggZAgPj//qOegQZHANECAAUQrAAYABhYL/QACIAEM1+tck+ccwAAo4eCBlSA+P/+o4eCBmiA+P/+o4eCBnyA+P/+o4eCBpCA+P/+o4eCBqSA+P/+o56BBqsA0QIABRCsABgAGFgv9AAIgAQzX61yT5xzAACjh4IGuID4//6jh4IGzID4//6jh4IG4ID4//6jh4IG9ID4//6jh4IHCID4//6jnoEHDwDRAgAFEBAUYABhYL/QACIAEM1+tck+ccwAAKOHggccgPj//qOHggcwgPj//qOHggdEgPj//qOHggdYgPj//qOHggdsgPj//qOegQdzANECAAUQrAAYABhYL/QACIAEM1+tck+ccwAAo4eCB4CA+P/+o4eCB5SA+P/+o4eCB6iA+P/+o4eCB7yA+P/+o4eCB9CA+P/+o56BB9cA0QIABRCsABgAGFgv9AAIgAQzX61yT5xzAACjh4IH5ID4//6jh4IH+ID4//6jh4IIDID4//6jh4IIIID4//6jh4IINID4//6jnoEIOwDRAgAFEKwAGAAYWC/0AAiABDNfrXJPnHMAAKOHgghIgPj//qOHgghcgPj//qOHgghwgPj//qOHggiEgPj//qOegQifANECAAUQrAAYABhYL/QACIAEM1+tck+ccwAAo4eCCMCA+P/+o4eCCNSA+P/+o4eCCOiA+P/+o4eCCPyA+P/+o56BCQMA0QIABRCsABgAGFgv9AAIgAQzX61yT5xzAACjh4IJEID4//6jh4IJJID4//6jh4IJOID4//6jh4IJTID4//6jh4IJYID4//6jnoEJZwDRAgAFEKwAGAAYWC/0AAiABDNfrXJPnHMAAKOHggl0gPj//qOHggmIgPj//qOHggmcgPj//qOHggmwgPj//qOHggnEgPj//qOegQnLANECAAUQrAAYABhYL/QACIAEM1+tck+ccwAAo4eCCdiA+P/+o4eCCeyA+P/+o4eCCgCA+P/+o4eCChSA+P/+o4eCCiiA+P/+o56BCi8A0QIABRCsABgAGFgv9AAIgAQzX61yT5xzAACjh4IKPID4//6jh4IKUID4//6jh4IKZID4//6jh4IKeID4//6jh4IKjID4//6jnoEKkwDRAgAFEKwAGAAYWC/0AAiABDNfrXJPnHMAAKOHggqggPj//qOHggq0gPj//qOHggrIgPj//qOHggrcgPj//qOHggrwgPj//qOegQr3ANECAAUQrAAYABhYL/QACIAEM1+tck+ccwAAo4eCCwSA+P/+o4eCCxiA+P/+o4eCCyyA+P/+o4eCC0CA+P/+o4eCC1SA+P/+o56BC1sA0QIABRAQFGAAYWC/0AAiABDNfrXJPnHMAACjh4ILaID4//6jh4ILfID4//6jh4ILkID4//6jh4ILpID4//6jh4ILuID4//6jnoELvwDRAgAFEKwAGAAYWC/0AAiABDNfrXJPnHMAAKOHggvMgPj//qOHggvggPj//qOHggv0gPj//qOHggwIgPj//qOHggwcgPj//qOegQwjANECAAUQrAAYABhYL/QACIAEM1+tck+ccwAAo4eCDDCA+P/+o4eCDESA+P/+o4eCDFiA+P/+o4eCDGyA+P/+o4eCDICA+P/+o56BDIcA0QIABRCsABgAGFgv9AAIgAQzX61yT5xzAACjh4IMlID4//6jh4IMqID4//6jh4IMvID4//6jh4IM0ID4//6jnoEM6wDRAgAFEKwAGAAYWC/0AAiABDNfrXJPnHMAAKOHgg0MgPj//qOHgg0ggPj//qOHgg00gPj//qOHgg1IgPj//qOegQ1PANECAAUQrAAYABhYL/QACIAEM1+tck+ccwAAo4eCDVyA+P/+o4eCDXCA+P/+o4eCDYSA+P/+o4eCDZiA+P/+o4eCDayA+P/+o56BDbMA0QIABRCsABgAGFgv9AAIgAQzX61yT5xzAACjh4INwID4//6jh4IN1ID4//6jh4IN6ID4//6jh4IN/ID4//6jh4IOEID4//6jnoEOFwDRAgAFEKwAGAAYWC/0AAiABDNfrXJPnHMAAKOHgg4kgPj//qOHgg44gPj//qOHgg5MgPj//qOHgg5ggPj//qOHgg50gPj//qOegQ57ANECAAUQrAAYABhYL/QACIAEM1+tck+ccwAAo4eCDoiA+P/+o4eCDpyA+P/+o4eCDrCA+P/+o4eCDsSA+P/+o4eCDtiA+P/+o56BDt8A0QIABRCsABgAGFgv9AAIgAQzX61yT5xzAACjh4IO7ID4//6jh4IPAID4//6jh4IPFID4//6jh4IPKID4//6jh4IPPID4//6jnoEPQwDRAgAFEKwAGAAYWC/0AAiABDNfrXJPnHMAAKOHgg9QgPj//qOHgg9kgPj//qOHgg94gPj//qOHgg+MgPj//qOHgg+ggPj//qOegQ+nANECAAUQEBRgAGFgv9AAIgAQzX61yT5xzAAAo4eCD7SA+P/+o4eCD8iA+P/+o4eCD9yA+P/+o4eCD/CA+P/+o4eCEASA+P/+o56BEAsA0QIABRCsABgAGFgv9AAIgAQzX61yT5xzAACjh4IQGID4//6jh4IQLID4//6jh4IQQID4//6jh4IQVID4//6jh4IQaID4//6jnoEQbwDRAgAFEKwAGAAYWC/0AAiABDNfrXJPnHMAAKOHghB8gPj//qOHghCQgPj//qOHghCkgPj//qOHghC4gPj//qOHghDMgPj//qOegRDTANECAAUQrAAYABhYL/QACIAEM1+tck+ccwAAo4eCEOCA+P/+o4eCEPSA+P/+o4eCEQiA+P/+o56BETcA0QIABRCsABgAGFgv9AAIgAQzX61yT5xzAACjh4IRQ4D4//6jh4IRV4D4//6jh4IRa4D4//6jh4IRf4D4//6jh4IRk4D4//6jnoERmwDRAgAFEKwAGAAYWC/0AAiABDNfrXJPnHMAAKOHghGngPj//qOHghG7gPj//qOHghHPgPj//qOHghHjgPj//qOHghH3gPj//qOegRH/ANECAAUQrAAYABhYL/QACIAEM1+tck+ccwAAo4eCEguA+P/+o4eCEh+A+P/+o4eCEjOA+P/+o4eCEkeA+P/+o4eCEluA+P/+o56BEmMA0QIABRCsABgAGFgv9AAIgAQzX61yT5xzAACjh4ISb4D4//6jh4ISg4D4//6jh4ISl4D4//6jh4ISq4D4//6jh4ISv4D4//6jnoESxwDRAgAFEKwAGAAYWC/0AAiABDNfrXJPnHMAAKOHghLTgPj//qOHghLngPj//qOHghL7gPj//qOHghMPgPj//qOHghMjgPj//qOegRMrANECAAUQrAAYABhYL/QACIAEM1+tck+ccwAAo4eCEzeA+P/+o4eCE0uA+P/+o4eCE1+A+P/+o4eCE3OA+P/+oAEAAAAAAAAPoYeCE4cA+P/+daKDB/KBHFO7a5G7j7OBB7eK94EB8YIDX/CBDA=="),this._addSourceToVideo(this.noSleepVideo,"mp4","data:video/mp4;base64,AAAAIGZ0eXBpc29tAAACAGlzb21pc28yYXZjMW1wNDEAAAAIZnJlZQAACORtZGF03gIATGF2YzU4LjM1LjEwMAACMEAOAAACcQYF//9t3EXpvebZSLeWLNgg2SPu73gyNjQgLSBjb3JlIDE2MSByMzAyNyA0MTIxMjc3IC0gSC4yNjQvTVBFRy00IEFWQyBjb2RlYyAtIENvcHlsZWZ0IDIwMDMtMjAyMCAtIGh0dHA6Ly93d3cudmlkZW9sYW4ub3JnL3gyNjQuaHRtbCAtIG9wdGlvbnM6IGNhYmFjPTAgcmVmPTMgZGVibG9jaz0xOjA6MCBhbmFseXNlPTB4MToweDExMSBtZT1oZXggc3VibWU9NyBwc3k9MSBwc3lfcmQ9MS4wMDowLjAwIG1peGVkX3JlZj0xIG1lX3JhbmdlPTE2IGNocm9tYV9tZT0xIHRyZWxsaXM9MSA4eDhkY3Q9MCBjcW09MCBkZWFkem9uZT0yMSwxMSBmYXN0X3Bza2lwPTEgY2hyb21hX3FwX29mZnNldD0tMiB0aHJlYWRzPTcgbG9va2FoZWFkX3RocmVhZHM9MSBzbGljZWRfdGhyZWFkcz0wIG5yPTAgZGVjaW1hdGU9MSBpbnRlcmxhY2VkPTAgYmx1cmF5X2NvbXBhdD0wIGNvbnN0cmFpbmVkX2ludHJhPTAgYmZyYW1lcz0wIHdlaWdodHA9MCBrZXlpbnQ9MjUwIGtleWludF9taW49MTAgc2NlbmVjdXQ9NDAgaW50cmFfcmVmcmVzaD0wIHJjX2xvb2thaGVhZD00MCByYz1jcmYgbWJ0cmVlPTEgY3JmPTIzLjAgcWNvbXA9MC42MCBxcG1pbj0wIHFwbWF4PTY5IHFwc3RlcD00IGlwX3JhdGlvPTEuNDAgYXE9MToxLjAwAIAAAADvZYiED/JigADD7JycnJycnJycnJycnJycnJycnJ11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111114BGCAHARggBwEYIAcBGCAHARggBwAAAAdBmjgf4BLYARggBwEYIAcBGCAHARggBwAAAAdBmlQH+AS2ARggBwEYIAcBGCAHARggBwAAAAdBmmA/wCWwARggBwEYIAcBGCAHARggBwEYIAcAAAAHQZqAP8AlsAEYIAcBGCAHARggBwEYIAcAAAAHQZqgP8AlsAEYIAcBGCAHARggBwEYIAcAAAAHQZrAP8AlsAEYIAcBGCAHARggBwEYIAcBGCAHAAAAB0Ga4D/AJbABGCAHARggBwEYIAcBGCAHAAAAB0GbAD/AJbABGCAHARggBwEYIAcBGCAHAAAAB0GbID/AJbABGCAHARggBwEYIAcBGCAHARggBwAAAAdBm0A/wCWwARggBwEYIAcBGCAHAAAAB0GbYD/AJbABGCAHARggBwEYIAcAAAAHQZuAP8AlsAEYIAcBGCAHARggBwEYIAcBGCAHAAAAB0GboD/AJbABGCAHARggBwEYIAcBGCAHAAAAB0GbwD/AJbABGCAHARggBwEYIAcBGCAHAAAAB0Gb4D/AJbABGCAHARggBwEYIAcBGCAHARggBwAAAAdBmgA/wCWwARggBwEYIAcBGCAHARggBwAAAAdBmiA/wCWwARggBwEYIAcBGCAHARggBwAAAAdBmkA/wCWwARggBwEYIAcBGCAHARggBwEYIAcAAAAHQZpgP8AlsAEYIAcBGCAHARggBwEYIAcAAAAHQZqAP8AlsAEYIAcBGCAHARggBwEYIAcAAAAHQZqgP8AlsAEYIAcBGCAHARggBwAAAAdBmsA/wCWwARggBwEYIAcBGCAHARggBwAAAAdBmuA/wCWwARggBwEYIAcBGCAHARggBwAAAAdBmwA/wCWwARggBwEYIAcBGCAHARggBwEYIAcAAAAHQZsgP8AlsAEYIAcBGCAHARggBwEYIAcAAAAHQZtAP8AlsAEYIAcBGCAHARggBwEYIAcAAAAHQZtgP8AlsAEYIAcBGCAHARggBwEYIAcBGCAHAAAAB0GbgD/AJbABGCAHARggBwEYIAcBGCAHAAA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QAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAA3HN0Y28AAAAAAAAAMwAAADAAAAOtAAADzAAAA+cAAAQCAAAEIQAABDwAAARXAAAEdgAABJEAAASsAAAEywAABOIAAAT5AAAFGAAABTMAAAVOAAAFbQAABYgAAAWjAAAFwgAABd0AAAX4AAAGDwAABioAAAZFAAAGZAAABn8AAAaaAAAGuQAABtQAAAbvAAAHDgAABykAAAc8AAAHWwAAB3YAAAeRAAAHsAAAB8sAAAfmAAAIBQAACCAAAAg7AAAIWgAACG0AAAiIAAAIpwAACMIAAAjdAAAI/AAAABpzZ3BkAQAAAHJvbGwAAAACAAAAAf//AAAAHHNiZ3AAAAAAcm9sbAAAAAEAAADSAAAAAQAAAGJ1ZHRhAAAAWm1ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAG1kaXJhcHBsAAAAAAAAAAAAAAAALWlsc3QAAAAlqXRvbwAAAB1kYXRhAAAAAQAAAABMYXZmNTguMjAuMTAw"),Object.assign(this.noSleepVideo.style,{position:"absolute",left:"-100%",top:"-100%"}),document.querySelector("body").append(this.noSleepVideo),this.handleNoSleepVideoTimeUpdate=()=>{this.noSleepVideo&&4{this._wakeLock=e,this.enabled=!0,t.log("wakeLock","Wake Lock active."),this._wakeLock.addEventListener("release",()=>{t.log("wakeLock","Wake Lock released.")})}).catch(e=>{throw this.enabled=!1,t.warn("wakeLock",e.name+", "+e.message),e}):this.noSleepVideo.play().then(e=>(t.log("wakeLock","noSleepVideo Wake Lock active."),this.enabled=!0,e)).catch(e=>{throw t.warn("wakeLock",`noSleepVideo ${e.name}, `+e.message),this.enabled=!1,e})}disable(){N()?(this._wakeLock&&this._wakeLock.release(),this._wakeLock=null):this.noSleepVideo&&this.noSleepVideo.pause(),this.enabled=!1,this.player.debug.log("wakeLock","Disabling wake lock.")}}class me{TAG_NAME="decoderAudioWorker";constructor(e){this.player=e,this.destroyResolve=null;let t=this.player._opt.decoder;if(0===t.indexOf("http")&&this.player._opt.isDecoderUseCDN){const e=new Blob([`importScripts("${t}")`],{type:"application/javascript"});t=window.URL.createObjectURL(e)}this.decoderWorker=new Worker(t),this._initDecoderWorker(),e.debug.log(this.TAG_NAME,"init")}destroy(){return new Promise((e,t)=>{this.player.loaded?(this.player.debug.log(this.TAG_NAME,"has loaded and post message to destroy"),this.decoderWorker?(this.decoderWorker.postMessage({cmd:"close"}),this.destroyResolve=e):(this.player.debug.warn(this.TAG_NAME,"has loaded but decoderWorker is null and destroy directly"),this._destroy(),e())):(this.player.debug.log(this.TAG_NAME,"has not loaded and destroy directly"),this._destroy(),e())})}_destroy(){this.decoderWorker&&(this.decoderWorker.terminate(),this.decoderWorker=null),this.player.debug.log("decoderWorker","destroy"),this.destroyResolve&&(this.destroyResolve(),this.destroyResolve=null)}_initDecoderWorker(){const{debug:A,events:{}}=this.player;this.decoderWorker.onmessage=e=>{var t=e.data;switch(t.cmd){case i:A.log("decoderWorker","onmessage:",i),this.decoderWorker&&this._initWork(),this.player.loaded||this.player.emit(d.load),this.player.emit(d.decoderWorkerInit);break;case l:A.log("decoderWorker","onmessage:",l,t.code),this.player.audio&&this.player.audio.updateAudioInfo({encTypeCode:t.code});break;case h:if(A.log("decoderWorker","onmessage:",h,`channels:${t.channels},sampleRate:`+t.sampleRate),2{this._destroyed=!0,this.emit("destroy"),this.off(),this.events&&(this.events.destroy(),this.events=null),this.clearCheckHeartTimeout(),this.clearCheckLoadingTimeout(),this.clearStatsInterval(),this.decoderWorker?this.decoderWorker.destroy().then(()=>{this.decoderWorker=null,this._destroy(),e()}):(this._destroy(),e())})}_destroy(){this._loading=!1,this._playing=!1,this._hasLoaded=!1,this._destroyed=!1,this._checkHeartTimeout=null,this._checkLoadingTimeout=null,this._checkStatsInterval=null,this._resetStats(),this._audioTimestamp=0,this._times={playInitStart:"",playStart:"",streamStart:"",streamResponse:"",demuxStart:"",decodeStart:"",videoStart:"",playTimestamp:"",streamTimestamp:"",streamResponseTimestamp:"",demuxTimestamp:"",decodeTimestamp:"",videoTimestamp:"",allTimestamp:""},this._tempWorkerStats=null,this.audio&&(this.audio.destroy(),this.audio=null),this.stream&&(this.stream.destroy(),this.stream=null),this.debug.log(this.TAG_NAME,"destroy end"),this._opt=_()}_resetStats(){this._startBpsTime=null,this._playingStartTimestamp=null,this._historyAbpsList=[],this._stats={abps:0,ts:0,buf:0,audioBufferTs:0}}set loaded(e){this._hasLoaded=e}get loaded(){return this._hasLoaded}set playing(e){e&&(this.loading=!1),this.playing!==e&&(this._playing=e,this.emit(d.playing,e),this.emit(d.volumechange,this.volume),e?this.emit(d.play):this.emit(d.pause))}get playing(){return this._playing}get volume(){return this.audio&&this.audio.volume||0}set volume(e){e!==this.volume&&(this.audio?(this.audio.setVolume(e),this._lastVolume=this.volume):this.debug.warn(this.TAG_NAME,"set volume error, audio is null"))}get lastVolume(){return this._lastVolume}set loading(e){this.loading!==e&&(this._loading=e,this.emit(d.loading,this._loading))}get loading(){return this._loading}set audioTimestamp(e){null!==e&&(this._audioTimestamp=e)}get audioTimestamp(){return this._audioTimestamp}get isDebug(){return P(this._opt.debug)}isDestroyed(){return this._destroyed}updateOption(e){this._opt=Object.assign({},this._opt,e)}init(){return new Promise((e,t)=>{this.audio||(this.audio=new H(this)),this.stream||(this.stream=new ee(this)),this.decoderWorker?this.loaded?e():this.once(d.decoderWorkerInit,()=>{this.loaded=!0,e()}):(this.decoderWorker=new me(this),this.once(d.decoderWorkerInit,()=>{this.loaded=!0,e()}))})}play(){let A=0{if(!A&&!this._opt.url)return t("url is empty");this.loading=!0,this.playing=!1,this._times.playInitStart=S(),A=A||this._opt.url,this._opt.url=A,this.clearCheckHeartTimeout(),this.init().then(()=>{this._times.playStart=S(),this._opt.isNotMute&&this.mute(!1),this.enableWakeLock(),this.checkLoadingTimeout(),this.stream&&(this.stream.once(p.fetchError,e=>{this.emitError(p.fetchError,e)}),this.stream.once(p.websocketError,e=>{this.emitError(p.websocketError,e)}),this.stream.once(d.streamEnd,()=>{this.emit(d.streamEnd)}),this.stream.once(d.streamSuccess,()=>{e(),this._times.streamResponse=S(),this.checkStatsInterval(),this.debug.log(this.TAG_NAME,"stream success and start play")}),this.stream.fetchStream(A))}).catch(()=>{t()})})}checkLoadingTimeout(){this._checkLoadingTimeout=setTimeout(()=>{this.playing?this.debug.warn(this.TAG_NAME,`checkLoadingTimeout but loading is ${this.loading} and playing is `+this.playing):this.isDestroyed()?this.debug&&this.debug.warn(this.TAG_NAME,"checkLoadingTimeout but player is destroyed"):(this.debug.warn(this.TAG_NAME,"checkLoadingTimeout and pause and emit loadingTimeout event"),this.emit(d.timeout,d.loadingTimeout),this.emit(d.loadingTimeout))},1e3*this._opt.loadingTimeout)}clearCheckLoadingTimeout(){this._checkLoadingTimeout&&(this.debug.log(this.TAG_NAME,"clearCheckLoadingTimeout"),clearTimeout(this._checkLoadingTimeout),this._checkLoadingTimeout=null)}checkStatsInterval(){this.debug.log(this.TAG_NAME,"checkStatsInterval"),this._checkStatsInterval=setInterval(()=>{this.updateStats()},1e3)}clearCheckHeartTimeout(){this.debug.log(this.TAG_NAME,"clearCheckHeartTimeout"),this._checkHeartTimeout&&(clearTimeout(this._checkHeartTimeout),this._checkHeartTimeout=null)}clearStatsInterval(){this.debug.log(this.TAG_NAME,"clearStatsInterval"),this._checkStatsInterval&&(clearInterval(this._checkStatsInterval),this._checkStatsInterval=null)}updateStats(){var e=0{const A=()=>{this.stream&&(this.stream.destroy(),this.stream=null),this.off(),this.clearCheckHeartTimeout(),this.clearCheckLoadingTimeout(),this.clearStatsInterval(),this.releaseWakeLock(),this._resetStats(),this.loading=!1,this.playing=!1,this.audio&&this.audio.pause(),this._audioTimestamp=0,this._hasLoaded=!1,this._times={playInitStart:"",playStart:"",streamStart:"",streamResponse:"",demuxStart:"",decodeStart:"",videoStart:"",playTimestamp:"",streamTimestamp:"",streamResponseTimestamp:"",demuxTimestamp:"",decodeTimestamp:"",videoTimestamp:"",allTimestamp:""},q(this)};this.decoderWorker?this.decoderWorker.destroy().then(()=>{this.decoderWorker=null,A(),e()}).catch(e=>{this.debug.error(this.TAG_NAME,"pause() decoderWorker destroy error",e),t(e)}):(A(),setTimeout(()=>{e()},0))})}handleRender(){this.isDestroyed()?this.debug&&this.debug.warn("player","handleRender but player is destroyed"):(this.loading&&(this.clearCheckLoadingTimeout(),this.emit(d.start),this.loading=!1),this.playing||(this.playing=!0))}updateHistoryAbpsList(e){this._historyAbpsList.length>this._opt.heartTimeout&&this._historyAbpsList.shift(),this._historyAbpsList.push(e),this.isHistoryAbpsListAllZero()&&this.checkHeartTimeout$2()}isHistoryAbpsListAllZero(){let t=!0;if(t=this._historyAbpsList.length{if(void 0===t[e])throw new Error(`JbPro option "${e}" can not be undefined`)});var e=_();let A=Object.assign({},e,t);T(A.videoBuffer)&&(A.videoBuffer=1e3*Number(A.videoBuffer)),T(A.timeout)&&(v(A.loadingTimeout)&&(A.loadingTimeout=A.timeout),v(A.heartTimeout)&&(A.heartTimeout=A.timeout)),this._opt=A,this._destroyed=!1,this._loadingTimeoutReplayTimes=0,this._heartTimeoutReplayTimes=0,this.debug=new G(this),this.events=new V(this),this._initAudioPlayer(),this.debug.log(this.TAG_NAME,'init success and version is "7-3-2023"'),console.log('JbProAudio version is "7-3-2023"')}destroy(){return new Promise((e,t)=>{this.debug.log(this.TAG_NAME,"destroy()"),this._destroyed=!0,this.off(),this.player?this.player.destroy().then(()=>{this.player=null,this._destroy(),e()}).catch(()=>{t()}):(this._destroy(),e())})}_destroy(){this.events&&(this.events.destroy(),this.events=null),this.debug&&this.debug.log("JbPro","destroy end"),this._resetOpt(),this._loadingTimeoutReplayTimes=0,this._heartTimeoutReplayTimes=0}_initAudioPlayer(){this.player=new fe(this._opt),this.debug.log(this.TAG_NAME,"_initPlayer",this.player.getOption()),this._bindEvents()}_resetOpt(){this._opt=_()}_bindEvents(){Object.keys(c).forEach(t=>{this.player.on(c[t],e=>{this.emit(t,e)})})}_play(){let r=0{var s,i=0===r.indexOf("http")?2:1;if(-1!==r.indexOf(".flv")&&!this._opt.isFlv&&(this._opt.isFlv=!0),s=this._opt.isFlv?"flv":"m7s",!i||!s)return A(`play protocol is ${i}, demuxType is `+s);this.player.updateOption({protocol:i,demuxType:s,isFlv:this._opt.isFlv}),this.player.once(p.fetchError,e=>{this.emit(d.crashLog,this._getCrashLog(p.fetchError,e)),this.debug.log(this.TAG_NAME,"fetch error and reset player"),this.pause().then(()=>{this.emit(d.playFailedAndPaused,p.fetchError)}).catch(e=>{this.debug.error(this.TAG_NAME,"fetch error and pause",e)})}),this.player.once(d.streamEnd,e=>{this.emit(d.crashLog,this._getCrashLog(d.streamEnd,e)),this.debug.log(this.TAG_NAME,"streamEnd and reset player"),this.pause().then(()=>{this.emit(d.playFailedAndPaused,d.streamEnd)}).catch(e=>{this.debug.error(this.TAG_NAME,"streamEnd and pause",e)})}),this.player.once(p.websocketError,e=>{this.emit(d.crashLog,this._getCrashLog(p.websocketError,e)),this.debug.log(this.TAG_NAME,"websocketError and reset player"),this.pause().then(()=>{this.emit(d.playFailedAndPaused,p.websocketError)}).catch(e=>{this.debug.error(this.TAG_NAME,"websocketError and pause",e)})}),this.player.on(d.delayTimeout,e=>{this.emit(d.crashLog,this._getCrashLog(d.delayTimeout,e)),this.isDestroyed()?this.debug.log(this.TAG_NAME,"delay timeout but player is destroyed"):this.pause().then(()=>{var e;this.player&&this.player._opt.heartTimeoutReplay&&(this._heartTimeoutReplayTimes{}).catch(e=>{this.debug.error(this.TAG_NAME,"delay timeout replay error",e)}))):(this.emit(d.playFailedAndPaused,d.delayTimeout),this.emit(d.delayTimeoutRetryEnd),this.debug.warn(this.TAG_NAME,`delayTimeoutRetryEnd and opt.heartTimeout is ${this.player&&this.player._opt.heartTimeout} and opt.heartTimeoutReplay is ${this.player&&this.player._opt.heartTimeoutReplay} and opt.heartTimeoutReplayTimes is ${this.player&&this.player._opt.heartTimeoutReplayTimes},and local._heartTimeoutReplayTimes is `+this._heartTimeoutReplayTimes))}).catch(e=>{this.debug.error(this.TAG_NAME,"delay timeout and pause error",e)})}),this.player.on(d.loadingTimeout,t=>{this.emit(d.crashLog,this._getCrashLog(d.loadingTimeout,t)),this.isDestroyed()?this.debug.log(this.TAG_NAME,"loading timeout but player is destroyed"):this.pause().then(()=>{var t;this.player&&this.player._opt.loadingTimeoutReplay&&(this._loadingTimeoutReplayTimes{}).catch(()=>{this.debug.error("Jessibuca","loading timeout replay error",e)}))):(this.emit(d.playFailedAndPaused,d.loadingTimeout),this.emit(d.loadingTimeoutRetryEnd))}).catch(e=>{this.debug.error(this.TAG_NAME,"loading timeout and pause error",e)})}),this.player.play(r).then(()=>{t()}).catch(e=>{this.debug.error(this.TAG_NAME,"hasLoaded and play error",e),this.emit(d.crashLog,this._getCrashLog("hasLoaded and play error",e)),this.player.pause().then(()=>{A(e)}).catch(e=>{this.debug.error(this.TAG_NAME,"hasLoaded and play error and next pause error",e)})})})}isDestroyed(){return this._destroyed}play(){let A=0(this.debug.log(this.TAG_NAME,"play() "+A),A||this._opt.url?(A&&(A=(""+A).trim(),this._opt.url=A),this.player?void(this.player.playing||this.player.loading?(this.debug.warn(this.TAG_NAME,`play() and player is playing ${this.player.playing} or loading ${this.player.loading} and pause to play`),this.player.pause().then(()=>{this._play(this._opt.url).then(()=>{e()}).catch(e=>{t(e)})})):this._play(this._opt.url).then(()=>{e()}).catch(e=>{t(e)})):t("player is null")):(this.emit(d.error,p.playError),void t("url is null and this._opt.url is null"))))}mute(){this.debug.log(this.TAG_NAME,"mute()"),this.player&&this.player.mute(!0)}cancelMute(){this.debug.log(this.TAG_NAME,"cancelMute()"),this.player&&this.player.mute(!1)}pause(){return new Promise((t,A)=>{this.debug.log(this.TAG_NAME,"pause()"),this.player?this.player.pause().then(e=>{this._bindEvents(),t(e)}).catch(e=>{A(e)}):A("player is null")})}setVolume(e){this.debug.log(this.TAG_NAME,"setVolume() "+e),this.player&&(this.player.volume=e)}getVolume(){let e=null;return this.player&&(e=this.player.volume,e=parseFloat(e).toFixed(2)),e}setTimeout(e){this.debug.log(this.TAG_NAME,"setTimeout() "+e),e=Number(e),this.player&&this.player.updateOption({timeout:e,loadingTimeout:e,heartTimeout:e})}audioResume(){this.debug.log(this.TAG_NAME,"audioResume()"),this.player&&this.player.audio?this.player.audio.audioEnabled(!0):this.debug.warn(this.TAG_NAME,"audioResume() player is not init")}setDebug(e){this.debug.log(this.TAG_NAME,"setDebug() "+e),this.player?this.player.updateOption({debug:!!e}):this.debug.warn(this.TAG_NAME,"setDebug() player is not init")}_getCrashLog(t){var A=1