2 lines
226 KiB
JavaScript
2 lines
226 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).jessibuca=t()}(this,(function(){"use strict";const e=0,t=1,i="flv",n="m7s",o={videoBuffer:1e3,isResize:!0,isFullResize:!1,isFlv:!1,debug:!1,loadingTimeout:10,heartTimeout:10,timeout:10,supportDblclickFullscreen:!1,showBandwidth:!1,keepScreenOn:!1,isNotMute:!1,hasAudio:!0,hasVideo:!0,operateBtns:{fullscreen:!1,screenshot:!1,play:!1,audio:!1,record:!1},hasControl:!1,loadingText:"",background:"",decoder:"decoder.js",url:"",rotate:0,forceNoOffscreen:!0,hiddenAutoPause:!1,protocol:t,demuxType:i,useWCS:!1,useMSE:!1,useOffscreen:!1},r="init",s="initVideo",a="render",A="playAudio",c="initAudio",d="audioCode",l="videoCode",u=1,h=2,f=8,p=9,g="init",m="decode",b="audioDecode",y="close",v={fullscreen:"fullscreen$2",webFullscreen:"webFullscreen",decoderWorkerInit:"decoderWorkerInit",play:"play",playing:"playing",pause:"pause",mute:"mute",load:"load",loading:"loading",videoInfo:"videoInfo",timeUpdate:"timeUpdate",audioInfo:"audioInfo",log:"log",error:"error",kBps:"kBps",timeout:"timeout",delayTimeout:"delayTimeout",loadingTimeout:"loadingTimeout",stats:"stats",performance:"performance",record:"record",recording:"recording",recordingTimestamp:"recordingTimestamp",recordStart:"recordStart",recordEnd:"recordEnd",recordCreateError:"recordCreateError",buffer:"buffer",videoFrame:"videoFrame",start:"start",metadata:"metadata",resize:"resize",streamEnd:"streamEnd",streamSuccess:"streamSuccess",streamMessage:"streamMessage",streamError:"streamError",volumechange:"volumechange",destroy:"destroy",mseSourceOpen:"mseSourceOpen",mseSourceClose:"mseSourceClose",mseSourceBufferError:"mseSourceBufferError",mseSourceBufferBusy:"mseSourceBufferBusy",videoWaiting:"videoWaiting",videoTimeUpdate:"videoTimeUpdate",videoSyncAudio:"videoSyncAudio"},w={load:v.load,timeUpdate:v.timeUpdate,videoInfo:v.videoInfo,audioInfo:v.audioInfo,error:v.error,kBps:v.kBps,log:v.log,start:v.start,timeout:v.timeout,loadingTimeout:v.loadingTimeout,delayTimeout:v.delayTimeout,fullscreen:"fullscreen",play:v.play,pause:v.pause,mute:v.mute,stats:v.stats,performance:v.performance,recordingTimestamp:v.recordingTimestamp,recordStart:v.recordStart,recordEnd:v.recordEnd},E={playError:"playIsNotPauseOrUrlIsNull",fetchError:"fetchError",websocketError:"websocketError",webcodecsH265NotSupport:"webcodecsH265NotSupport",mediaSourceH265NotSupport:"mediaSourceH265NotSupport",wasmDecodeError:"wasmDecodeError"},S="notConnect",R="open",C="close",B="error",k={download:"download",base64:"base64",blob:"blob"},I={7:"H264(AVC)",12:"H265(HEVC)"},T=7,x=12,L={10:"AAC",7:"ALAW",8:"MULAW"},D=32,O=33,j=34,U=0,F=1,P=2,M="mp4",V="webm",Q="webcodecs",N="webgl",W="offscreen",G="key",H="delta",J='video/mp4; codecs="avc1.64002A"',q="ended",z="open",X="closed";class Y{constructor(e){this.log=function(t){if(e._opt.debug){for(var i=arguments.length,n=new Array(i>1?i-1:0),o=1;o<i;o++)n[o-1]=arguments[o];console.log(`Jessibuca: [${t}]`,...n)}},this.warn=function(t){if(e._opt.debug){for(var i=arguments.length,n=new Array(i>1?i-1:0),o=1;o<i;o++)n[o-1]=arguments[o];console.warn(`Jessibuca: [${t}]`,...n)}},this.error=function(t){if(e._opt.debug){for(var i=arguments.length,n=new Array(i>1?i-1:0),o=1;o<i;o++)n[o-1]=arguments[o];console.error(`Jessibuca: [${t}]`,...n)}}}}class Z{constructor(e){this.destroys=[],this.proxy=this.proxy.bind(this),this.master=e}proxy(e,t,i){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(!e)return;if(Array.isArray(t))return t.map((t=>this.proxy(e,t,i,n)));e.addEventListener(t,i,n);const o=()=>e.removeEventListener(t,i,n);return this.destroys.push(o),o}destroy(){this.master.debug.log("Events","destroy"),this.destroys.forEach((e=>e()))}}var K="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function _(e,t){return e(t={exports:{}},t.exports),t.exports}var $=_((function(e){!function(){var t="undefined"!=
|