2 lines
26 KiB
JavaScript
2 lines
26 KiB
JavaScript
|
|
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self)["easyplayer-talk"]=t()}(this,(function(){"use strict";class e{on(e,t,i){const s=this.e||(this.e={});return(s[e]||(s[e]=[])).push({fn:t,ctx:i}),this}once(e,t,i){const s=this;function r(){s.off(e,r);for(var o=arguments.length,a=new Array(o),n=0;n<o;n++)a[n]=arguments[n];t.apply(i,a)}return r._=t,this.on(e,r,i)}emit(e){const t=((this.e||(this.e={}))[e]||[]).slice();for(var i=arguments.length,s=new Array(i>1?i-1:0),r=1;r<i;r++)s[r-1]=arguments[r];for(let e=0;e<t.length;e+=1)t[e].fn.apply(t[e].ctx,s);return this}off(e,t){const i=this.e||(this.e={});if(!e)return Object.keys(i).forEach((e=>{delete i[e]})),void delete this.e;const s=i[e],r=[];if(s&&t)for(let e=0,i=s.length;e<i;e+=1)s[e].fn!==t&&s[e].fn._!==t&&r.push(s[e]);return r.length?i[e]=r:delete i[e],this}}const t="debug",i="warn",s="talkGetUserMediaSuccess",r="talkGetUserMediaFail",o="talkGetUserMediaTimeout",a="talkStreamStart",n="talkStreamOpen",l="talkStreamClose",h="talkStreamError",u="talkStreamInactive",c="talkFailedAndStop",d={talkStreamClose:l,talkStreamError:h,talkStreamInactive:u,talkGetUserMediaTimeout:o,talkFailedAndStop:c},p={playError:"playIsNotPauseOrUrlIsNull",fetchError:"fetchError",websocketError:"websocketError",webcodecsH265NotSupport:"webcodecsH265NotSupport",webcodecsDecodeError:"webcodecsDecodeError",webcodecsUnsupportedConfigurationError:"webcodecsUnsupportedConfigurationError",webcodecsDecodeConfigureError:"webcodecsDecodeConfigureError",mediaSourceH265NotSupport:"mediaSourceH265NotSupport",mediaSourceAudioG711NotSupport:"mediaSourceAudioG711NotSupport",mediaSourceAudioInitTimeout:"mediaSourceAudioInitTimeout",mediaSourceAudioNoDataTimeout:"mediaSourceAudioNoDataTimeout",mediaSourceDecoderConfigurationError:"mediaSourceDecoderConfigurationError",mediaSourceFull:"mseSourceBufferFull",mseSourceBufferError:"mseSourceBufferError",mseAddSourceBufferError:"mseAddSourceBufferError",mediaSourceAppendBufferError:"mediaSourceAppendBufferError",mediaSourceTsIsMaxDiff:"mediaSourceTsIsMaxDiff",mediaSourceUseCanvasRenderPlayFailed:"mediaSourceUseCanvasRenderPlayFailed",mediaSourceBufferedIsZeroError:"mediaSourceBufferedIsZeroError",wasmDecodeError:"wasmDecodeError",wasmUseVideoRenderError:"wasmUseVideoRenderError",hlsError:"hlsError",webrtcError:"webrtcError",webrtcClosed:"webrtcClosed",webrtcIceCandidateError:"webrtcIceCandidateError",webglAlignmentError:"webglAlignmentError",wasmWidthOrHeightChange:"wasmWidthOrHeightChange",mseWidthOrHeightChange:"mseWidthOrHeightChange",wcsWidthOrHeightChange:"wcsWidthOrHeightChange",widthOrHeightChange:"widthOrHeightChange",tallWebsocketClosedByError:"tallWebsocketClosedByError",flvDemuxBufferSizeTooLarge:"flvDemuxBufferSizeTooLarge",wasmDecodeVideoNoResponseError:"wasmDecodeVideoNoResponseError",audioChannelError:"audioChannelError",simdH264DecodeVideoWidthIsTooLarge:"simdH264DecodeVideoWidthIsTooLarge",simdDecodeError:"simdDecodeError",webglContextLostError:"webglContextLostError",videoElementPlayingFailed:"videoElementPlayingFailed",videoElementPlayingFailedForWebrtc:"videoElementPlayingFailedForWebrtc",decoderWorkerInitError:"decoderWorkerInitError",videoInfoError:"videoInfoError",videoCodecIdError:"videoCodecIdError",streamEnd:"streamEnd",delayTimeout:"delayTimeout",loadingTimeout:"loadingTimeout",networkDelayTimeout:"networkDelayTimeout",aliyunRtcError:"aliyunRtcError",...{talkStreamError:h,talkStreamClose:l}},f="notConnect",m="open",g="close",k="error",w="g711a",b="g711u",S="pcm",T="opus",y=8,_=0,v=98,E="empty",U="rtp",M="tcp",B="open",C="close",R="error",G="message",A="worklet",L="script",F={encType:w,packetType:U,packetTcpSendType:M,rtpSsrc:"0000000000",numberChannels:1,sampleRate:8e3,sampleBitsWidth:16,sendInterval:20,debug:!1,debugLevel:i,testMicrophone:!1,saveToTempFile:!1,audioBufferLength:160,engine:A,checkGetUserMediaTimeout:!1,getUserMediaTimeout:1e4,audioConstraints:{latency:!0,noiseSuppression:!0,autoGainControl:!0,echo
|