319 lines
919 KiB
JavaScript
319 lines
919 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-pro"]=t()}(this,function(){"use strict";const _="fetch",M="websocket",U="worker",n="player",y="playbackTF",p="mp4",j="webm",N="flv",V="webTransport",H="nakedFlow",W={flv:"FLV",m7s:"m7s",hls:"HLS",webrtc:"Webrtc",webTransport:"WebTransport",nakedFlow:"裸流"},G="canvas",z="debug",K="warn",q="click",J={url:"",playbackConfig:{},fullscreenWatermarkConfig:{},playType:n,playbackForwardMaxRateDecodeIFrame:8,playOptions:{},isLive:!0,isMulti:!1,isCrypto:!1},Q={playType:n,container:"",videoBuffer:1e3,videoBufferDelay:1e3,networkDelay:1e4,isResize:!0,isFullResize:!1,isFlv:!1,isHls:!1,isWebrtc:!1,isWebrtcForZLM:!1,isNakedFlow:!1,debug:!1,debugLevel:K,debugUuid:"",isMulti:!1,hotKey:!1,loadingTimeout:10,heartTimeout:10,timeout:10,pageVisibilityHiddenTimeout:300,loadingTimeoutReplay:!0,heartTimeoutReplay:!0,loadingTimeoutReplayTimes:3,heartTimeoutReplayTimes:3,heartTimeoutReplayUseLastFrameShow:!1,supportDblclickFullscreen:!1,showBandwidth:!1,showPerformance:!1,keepScreenOn:!0,isNotMute:!1,hasAudio:!0,hasVideo:!0,operateBtns:{fullscreen:!1,screenshot:!1,play:!1,audio:!1,record:!1,ptz:!1,quality:!1,zoom:!1,close:!1,scale:!1,performance:!1,aiFace:!1,aiObject:!1,fullscreenFn:null,fullscreenExitFn:null,screenshotFn:null,playFn:null,pauseFn:null,recordFn:null,recordStopFn:null},extendOperateBtns:[],contextmenuBtns:[],watermarkConfig:{},controlAutoHide:!1,hasControl:!1,loadingIcon:!0,loadingText:"",background:"",loadingBackground:"",decoder:"decoder-pro.js",decoderWASM:"",url:"",rotate:0,mirrorRotate:"none",playbackConfig:{playList:[],fps:"",showControl:!0,showRateBtn:!1,rateConfig:[],isCacheBeforeDecodeForFpsRender:!1,uiUsePlaybackPause:!1,isPlaybackPauseClearCache:!0,isUseFpsRender:!1,isUseLocalCalculateTime:!1,localOneFrameTimestamp:40,supportWheel:!1},qualityConfig:[],defaultStreamQuality:"",scaleConfig:["拉伸","缩放","正常"],forceNoOffscreen:!0,hiddenAutoPause:!1,protocol:2,demuxType:N,useWasm:!1,useWCS:!1,useSIMD:!0,wcsUseVideoRender:!0,wasmUseVideoRender:!0,mseUseCanvasRender:!1,hlsUseCanvasRender:!1,useMSE:!1,useOffscreen:!1,autoWasm:!0,wasmDecodeErrorReplay:!0,openWebglAlignment:!1,syncAudioAndVideo:!1,playbackDelayTime:1e3,playbackFps:25,playbackForwardMaxRateDecodeIFrame:8,playbackCurrentTimeMove:!0,useVideoRender:!0,useCanvasRender:!1,networkDelayTimeoutReplay:!1,recordType:p,checkFirstIFrame:!0,nakedFlowFps:25,audioEngine:null,isShowRecordingUI:!0,isShowZoomingUI:!0,useFaceDetector:!1,useObjectDetector:!1,ptzClickType:q,weiXinInAndroidAudioBufferSize:4800,isCrypto:!1,cryptoKey:"",cryptoIV:"",cryptoKeyUrl:"",autoResize:!1,useWebFullScreen:!1,ptsMaxDiff:3600,aiFaceDetectWidth:192,aiObjectDetectWidth:192},X="init",Y="initVideo",Z="initAudio",$="audioCode",ee="videoCode",te="videoCodec",v={fullscreen:"fullscreen$2",webFullscreen:"webFullscreen",decoderWorkerInit:"decoderWorkerInit",play:"play",playing:"playing",pause:"pause",mute:"mute",load:"load",loading:"loading",zooming:"zooming",videoInfo:"videoInfo",timeUpdate:"timeUpdate",audioInfo:"audioInfo",log:"log",error:"error",kBps:"kBps",timeout:"timeout",delayTimeout:"delayTimeout",delayTimeoutRetryEnd:"delayTimeoutRetryEnd",loadingTimeout:"loadingTimeout",loadingTimeoutRetryEnd:"loadingTimeoutRetryEnd",stats:"stats",performance:"performance",faceDetectActive:"faceDetectActive",objectDetectActive:"objectDetectActive",record:"record",recording:"recording",recordingTimestamp:"recordingTimestamp",recordStart:"recordStart",recordEnd:"recordEnd",recordCreateError:"recordCreateError",recordBlob:"recordBlob",buffer:"buffer",videoFrame:"videoFrame",start:"start",metadata:"metadata",resize:"resize",volumechange:"volumechange",destroy:"destroy",beforeDestroy:"beforeDestroy",streamEnd:"streamEnd",streamRate:"streamRate",streamAbps:"streamAbps",streamVbps:"streamVbps",streamDts:"streamDts",streamSuccess:"streamSuccess",streamMessage:"streamMessage",streamError:"streamError",streamStats:"stre
|
||
|
<i class="jessibuca-icon jessibuca-icon-${t}"></i>
|
||
|
${Ir[t]?`<span class="icon-title-tips"><span class="icon-title">${Ir[t]}</span></span>`:""}
|
||
|
`,e),{});function Br(e,t){let i=!1;return e.forEach(e=>{i||e.startTimestamp<=t&&e.endTimestamp>t&&(i=!0)}),i}function xr(e,t,i){let r=0<arguments.length&&void 0!==e?e:[],s=1<arguments.length&&void 0!==t?t:[],a=2<arguments.length?i:void 0;const n=r.length,o=s.length,l=Math.max(n,o),c=2e3,u=Math.ceil(l/c);let d=0,h=0;!function e(){let t="",i="";for(let e=0;e<c;e++){const a=r[h],c=(a&&(t+=`
|
||
|
<div class="jessibuca-playback-time-minute-one${a.hasRecord?" active":""}${a.isStart?" start":""}" data-has-record="${a.hasRecord}"
|
||
|
data-time="${a.timestamp}" data-type="${a.dataType}">
|
||
|
<span class="jessibuca-playback-time-title-tips ${h>n-60?"jessibuca-playback-time-title-tips-left":""}"><span class="jessibuca-playback-time-title">${a.title}</span></span>
|
||
|
</div>
|
||
|
`),s[h]);c&&(i+=`
|
||
|
<div class="jessibuca-playback-time-hour" data-hour="${c.hour}" data-min="${c.min}" data-second="${c.second}"><span class="jessibuca-playback-time-hour-text">${c.title}</span></div>
|
||
|
`),h+=1}t&&a.$playbackTimeListOne.insertAdjacentHTML("beforeend",t),i&&a.$playbackTimeListSecond.insertAdjacentHTML("beforeend",i),(d+=1)<u&&(a.rafId=window.requestAnimationFrame(e))}()}function Pr(e,t){xr(function(e){var i,r,s,a=0<arguments.length&&void 0!==e?e:[],n=[],o=(a[0]||{}).startTimestamp;for(let t=0;t<1440;t++){var l=t%60==0;let e=!1;o&&(e=Br(a,(i=o,r=t,s=void 0,s=Math.floor(r/60)%60,r=Math.floor(r%60),new Date(i).setHours(s,r,0,0)))),n.push({title:function(e,t){let i="";var r;return-1<e&&(r=Math.floor(e/60)%60,e=e%60,e=Math.round(e),i=r<10?"0"+r+":":r+":",e<10&&(i+="0"),i+=e,it(t)||(t<10&&(t="0"+t),i+=":"+t)),i}(t),timestamp:t,dataType:"min",hasRecord:e,isStart:l})}return n}(e),function(){var i=[];for(let t=0;t<24;t++){let e=t+":00";t<10&&(e="0"+e),i.push({title:e,hour:t,min:0,second:0})}return i}(),t)}var Fr=(m,g)=>{const s=m["events"]["proxy"],a=document.createElement("object");a.setAttribute("aria-hidden","true"),a.setAttribute("tabindex",-1),a.type="text/html",a.data="about:blank",E(a,{display:"block",position:"absolute",top:"0",left:"0",height:"100%",width:"100%",overflow:"hidden",pointerEvents:"none",zIndex:"-1"});let n=m.width,e=m.height;const t=et(()=>{m.width===n&&m.height===e||(n=m.width,e=m.height,m.emit(v.resize),l())},500),i=(s(a,"load",()=>{s(a.contentDocument.defaultView,"resize",()=>{t()})}),m.$container.appendChild(a),m.on(v.destroy,()=>{m.$container.removeChild(a)}),m.on(v.volumechange,()=>{var e,t,i;0===(e=m.volume)?(E(g.$volumeOn,"display","none"),E(g.$volumeOff,"display","flex"),E(g.$volumeHandle,"top","48px")):g.$volumeHandle&&g.$volumePanel&&(t=Ke(g.$volumePanel,"height")||60,i=Ke(g.$volumeHandle,"height"),E(g.$volumeHandle,"top",t-(t-i)*e-i+"px"),E(g.$volumeOn,"display","flex"),E(g.$volumeOff,"display","none")),g.$volumePanelText&&(g.$volumePanelText.innerHTML=parseInt(100*e))}),m.on(v.loading,e=>{E(g.$loading,"display",e?"flex":"none"),E(g.$poster,"display","none"),e&&E(g.$playBig,"display","none"),S()||e||(g.$loadingBgImage.width=0,g.$loadingBgImage.height=0,g.$loadingBgImage.src="",E(g.$loadingBg,"display","none"))}),e=>{m.fullscreen&&w(e)!==m.$container||r()}),r=e=>{e=rt(e)?e:m.fullscreen;E(g.$fullscreenExit,"display",e?"flex":"none"),E(g.$fullscreen,"display",e?"none":"flex")},o=()=>m._opt.playType===y&&m._opt.playbackConfig.showControl,l=i=>{S()&&g.$controls&&m._opt.useWebFullScreen&&setTimeout(()=>{if(m.fullscreen){const i=o()?48:38;var e=m.height/2-m.width+i/2,t=m.height/2-i/2;g.$controls.style.transform=`translateX(${-e}px) translateY(-${t}px) rotate(-90deg)`}else g.$controls.style.transform="translateX(0) translateY(0) rotate(0)";i&&i()},10)};try{f.on("change",i),m.events.destroys.push(()=>{f.off("change",i)})}catch(m){}m.on(v.webFullscreen,e=>{S()&&(r(e),l(()=>{u()}))}),m.on(v.recording,()=>{m.playing&&(E(g.$record,"display",m.recording?"none":"flex"),E(g.$recordStop,"display",m.recording?"flex":"none"),m._opt.hasControl||m._opt.isShowRecordingUI)&&E(g.$recording,"display",m.recording?"flex":"none")}),m.on(v.recordingTimestamp,e=>{g.$recordingTime&&(g.$recordingTime.innerHTML=ot(e))}),m.on(v.zooming,()=>{m.playing&&(E(g.$zoom,"display",m.zooming?"none":"flex"),E(g.$zoomStop,"display",m.zooming?"flex":"none"),m._opt.hasControl||m._opt.isShowZoomingUI)&&E(g.$zoomControls,"display",m.zooming?"flex":"none")}),m.on(v.playing,e=>{c(e)});const c=t=>{E(g.$play,"display",t?"none":"flex"),E(g.$playBig,"display",t?"none":"block"),E(g.$pause,"display",t?"flex":"none"),E(g.$screenshot,"display",t?"flex":"none"),E(g.$record,"display",t?"flex":"none"),E(g.$qualityMenu,"display",t?"flex":"none"),E(g.$volume,"display",t?"flex":"none"),E(g.$ptz,"display",t?"flex":"none"),E(g.$zoom,"display",t?"flex":"none"),E(g.$scaleMenu,"display",t?"flex":"none"),E(g.$faceDetect,"display",t?"flex":"none"),m.isPlayback()&&E(g.$speedMenu,"display",t?"flex":"none"),r(),g.extendBtnList.forEach(e=>{e.$iconWrap&&E(e.$iconWrap,"display",t?"flex":"none"),e.$activeIconWrap&&E(e.$activeIconWrap,"display","none")}),m._opt.showPerformance?E(g.$performanceActive,"display",t?"flex":"none"):E(g.$performanc
|
||
|
<div class="jessibuca-quality-menu-item" data-quality="${e}">${e}</div>
|
||
|
`}),t&&(g.$qualityMenuList.insertAdjacentHTML("beforeend",t),Object.defineProperty(g,"$qualityMenuItems",{value:m.$container.querySelectorAll(".jessibuca-quality-menu-item")}),setTimeout(()=>{var e=h[0];m.streamQuality=e},0))}m.streamQuality&&s(m.streamQuality)}if(m._opt.operateBtns.scale&&0<m._opt.scaleConfig.length){m.on(v.viewResizeChange,e=>{s(e)});const s=i=>{var e=m._opt.scaleConfig[i];g.$scaleText.innerText=e,g.$scaleMenuItems.forEach(e=>{var t=e.dataset.scale;e.classList.remove("jessibuca-scale-menu-item-active"),T(t)===T(i)&&e.classList.add("jessibuca-scale-menu-item-active")})};{var d=m._opt.scaleConfig||[];let i="";d.forEach((e,t)=>{i+=`
|
||
|
<div class="jessibuca-scale-menu-item" data-scale="${t}">${e}</div>
|
||
|
`}),i&&(g.$scaleMenuList.insertAdjacentHTML("beforeend",i),Object.defineProperty(g,"$scaleMenuItems",{value:m.$container.querySelectorAll(".jessibuca-scale-menu-item")}))}s(m.scaleType)}if(m.isPlayback()&&m._opt.playbackConfig.showRateBtn&&0<m._opt.playbackConfig.rateConfig.length){m.on(v.playbackRateChange,e=>{s(e)});const s=i=>{var e=m._opt.playbackConfig.rateConfig.find(e=>T(e.value)===T(i));e&&(g.$speedText.innerText=e.label,g.$speedMenuItems.forEach(e=>{var t=e.dataset.speed;e.classList.remove("jessibuca-speed-menu-item-active"),T(t)===T(i)&&e.classList.add("jessibuca-speed-menu-item-active")}))};{d=m._opt.playbackConfig.rateConfig;let i="";d.forEach((e,t)=>{i+=`
|
||
|
<div class="jessibuca-speed-menu-item" data-speed="${e.value}">${e.label}</div>
|
||
|
`}),i&&(g.$speedMenuList.insertAdjacentHTML("beforeend",i),Object.defineProperty(g,"$speedMenuItems",{value:m.$container.querySelectorAll(".jessibuca-speed-menu-item")}))}const a=m.playback?m.playback.playbackRate:1;s(a)}m.on(v.stats,function(){var e,t,i,r,s,a,n,o,l,c,u,d,h,p,f,A=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};m._opt.showPerformance?(E(g.$performancePanel,"display","block"),g.$performancePanel.innerHTML="",e=m.video&&m.video.videoInfo||{},t=m.audio&&m.audio.audioInfo||{},i=m._times||{},r=m.getRenderType(),s=m.getDecodeType(),a=m.getDemuxType(),n=m.getStreamType(),o=m.getAudioEngineType(),u=m.getRecordingDuration(),d=m.getRecordingByteLength(),l=m.isAudioPlaybackRateSpeed(),c=m.videoIframeIntervalTs,u=ot(u),d=null==(h=d)||""==h?"0 Bytes":(p=new Array("Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"),f=0,h=parseFloat(h),f=Math.floor(Math.log(h)/Math.log(1024)),(h/Math.pow(1024,f)).toFixed(2)+p[f]),h=m.isPlayback()?"录播":"直播",p=A.isDropping,f=`
|
||
|
<div class="jessibuca-performance-item">
|
||
|
<span>版本 "2023-4-9"</span>
|
||
|
</div>
|
||
|
<div class="jessibuca-performance-item">
|
||
|
<span>播放模式 ${h}</span>
|
||
|
</div>
|
||
|
${m.isPlayback()?`
|
||
|
<div class="jessibuca-performance-item">
|
||
|
<span>播放倍率 ${m.playback.rate}倍</span>
|
||
|
</div>
|
||
|
<div class="jessibuca-performance-item">
|
||
|
<span>播放模式 ${m.playback.isUseFpsRender?"固定FPS":"动态FPS"}</span>
|
||
|
</div>
|
||
|
${m.playback.isUseFpsRender?`
|
||
|
<div class="jessibuca-performance-item">
|
||
|
<span>固定FPS ${m.video.getStreamFps()}</span>
|
||
|
</div>
|
||
|
`:""}
|
||
|
`:""}
|
||
|
<div class="jessibuca-performance-item">
|
||
|
<span>解封装模式 ${W[a]}</span>
|
||
|
</div>
|
||
|
<div class="jessibuca-performance-item">
|
||
|
<span>解码模式 ${s}</span>
|
||
|
</div>
|
||
|
<div class="jessibuca-performance-item">
|
||
|
<span>渲染组件 ${r}</span>
|
||
|
</div>
|
||
|
<div class="jessibuca-performance-item">
|
||
|
<span>网络请求组件 ${n}</span>
|
||
|
</div>
|
||
|
<div class="jessibuca-performance-item">
|
||
|
<span>视频格式 ${e.encType||"-"}</span>
|
||
|
</div>
|
||
|
<div class="jessibuca-performance-item">
|
||
|
<span>视频(宽x高) ${e.width||"-"}x${e.height||"-"}</span>
|
||
|
</div>
|
||
|
<div class="jessibuca-performance-item">
|
||
|
<span>视频GOP(ms) ${c||"-"}</span>
|
||
|
</div>
|
||
|
<div class="jessibuca-performance-item">
|
||
|
<span>音频格式 ${ue[t.encType]||"-"}</span>
|
||
|
</div>
|
||
|
<div class="jessibuca-performance-item">
|
||
|
<span>音频引擎 ${o||"-"}</span>
|
||
|
</div>
|
||
|
<div class="jessibuca-performance-item">
|
||
|
<span>音频通道 ${t.channels||"-"}</span>
|
||
|
</div>
|
||
|
<div class="jessibuca-performance-item">
|
||
|
<span>音频采样率 ${t.sampleRate||"-"}</span>
|
||
|
</div>
|
||
|
${m.isPlayer()?`
|
||
|
<div class="jessibuca-performance-item">
|
||
|
<span>播放器初始化(ms) ${i.playTimestamp}</span>
|
||
|
</div>
|
||
|
<div class="jessibuca-performance-item">
|
||
|
<span>开始请求地址(ms) ${i.streamTimestamp}</span>
|
||
|
</div>
|
||
|
<div class="jessibuca-performance-item">
|
||
|
<span>请求响应(ms) ${i.streamResponseTimestamp}</span>
|
||
|
</div>
|
||
|
<div class="jessibuca-performance-item">
|
||
|
<span>解封装(ms) ${i.demuxTimestamp}</span>
|
||
|
</div>
|
||
|
<div class="jessibuca-performance-item">
|
||
|
<span>解码(ms) ${i.decodeTimestamp}</span>
|
||
|
</div>
|
||
|
<div class="jessibuca-performance-item">
|
||
|
<span>页面开始渲染(ms) ${i.videoTimestamp}</span>
|
||
|
</div>
|
||
|
<div class="jessibuca-performance-item">
|
||
|
<span>初始化到页面渲染(ms) ${i.allTimestamp}</span>
|
||
|
</div>
|
||
|
${m.recording?`
|
||
|
<div class="jessibuca-performance-item">
|
||
|
<span>视频录制时间 ${u}</span>
|
||
|
</div>
|
||
|
<div class="jessibuca-performance-item">
|
||
|
<span>视频录制大小 ${d}</span>
|
||
|
</div>
|
||
|
`:""}
|
||
|
`:""}
|
||
|
<div class="jessibuca-performance-item">
|
||
|
<span>音频码率(bit) ${A.abps}</span>
|
||
|
</div>
|
||
|
<div class="jessibuca-performance-item">
|
||
|
<span>视频码率(bit) ${A.vbps}</span>
|
||
|
</div>
|
||
|
<div class="jessibuca-performance-item">
|
||
|
<span>视频帧率(fps) ${A.fps}</span>
|
||
|
</div>
|
||
|
<div class="jessibuca-performance-item">
|
||
|
<span>视频峰值帧率(fps) ${A.maxFps}</span>
|
||
|
</div>
|
||
|
<div class="jessibuca-performance-item">
|
||
|
<span>解码帧率(fps) ${A.dfps}</span>
|
||
|
</div>
|
||
|
<div class="jessibuca-performance-item">
|
||
|
<span>音频缓冲帧 ${A.audioBuffer}</span>
|
||
|
</div>
|
||
|
${m.isPlayer()?`
|
||
|
<div class="jessibuca-performance-item">
|
||
|
<span>视频待解码帧 ${A.demuxBuffer}</span>
|
||
|
</div>
|
||
|
`:`
|
||
|
<div class="jessibuca-performance-item">
|
||
|
<span>缓存时长(ms) ${A.playbackCacheDataDuration}</span>
|
||
|
</div>
|
||
|
<div class="jessibuca-performance-item">
|
||
|
<span>视频待渲染帧 ${A.playbackVideoBuffer}</span>
|
||
|
</div>
|
||
|
<div class="jessibuca-performance-item">
|
||
|
<span>视频待解码帧 ${A.demuxBuffer}</span>
|
||
|
</div>
|
||
|
<div class="jessibuca-performance-item">
|
||
|
<span>音频待解码帧 ${A.audioDemuxBuffer}</span>
|
||
|
</div>
|
||
|
`}
|
||
|
<div class="jessibuca-performance-item">
|
||
|
<span>待解封装数据(byte) ${A.flvBuffer}</span>
|
||
|
</div>
|
||
|
${m._opt.useMSE?`
|
||
|
<div class="jessibuca-performance-item">
|
||
|
<span>MSE缓冲时长(ms) ${A.mseDelay}</span>
|
||
|
</div>
|
||
|
<div class="jessibuca-performance-item">
|
||
|
<span>MSE解码间隔(ms) ${A.mseDecodeDiffTimes}</span>
|
||
|
</div>
|
||
|
<div class="jessibuca-performance-item">
|
||
|
<span>MSE解码时间(ms) ${A.mseTs}</span>
|
||
|
</div>
|
||
|
<div class="jessibuca-performance-item">
|
||
|
<span>MSE播放模式 ${1<A.mseDecodePlaybackRate?"加速":"正常"}</span>
|
||
|
</div>
|
||
|
`:""}
|
||
|
${m._opt.useWCS?`
|
||
|
<div class="jessibuca-performance-item">
|
||
|
<span>WCS解码间隔(ms) ${A.wcsDecodeDiffTimes}</span>
|
||
|
</div>
|
||
|
`:""}
|
||
|
${m._opt.isHls?`<div class="jessibuca-performance-item">
|
||
|
<span>HLS缓冲时长(ms) ${A.hlsDelay}</span>
|
||
|
</div>
|
||
|
<div class="jessibuca-performance-item">
|
||
|
<span>HLS播放模式 ${1<A.hlsDecodePlaybackRate?"加速":"正常"}</span>
|
||
|
</div>
|
||
|
`:""}
|
||
|
<div class="jessibuca-performance-item">
|
||
|
<span>网络延迟(ms) ${A.netBuf}</span>
|
||
|
</div>
|
||
|
<div class="jessibuca-performance-item">
|
||
|
<span>缓冲时长(ms) ${A.buf}</span>
|
||
|
</div>
|
||
|
<div class="jessibuca-performance-item">
|
||
|
<span>最新缓冲时长(ms) ${A.pushLatestDelay}</span>
|
||
|
</div>
|
||
|
<div class="jessibuca-performance-item">
|
||
|
<span>视频显示时间(ms) ${A.ts}</span>
|
||
|
</div>
|
||
|
${m._opt.hasAudio&&m.isAudioNotMute()?`
|
||
|
<div class="jessibuca-performance-item">
|
||
|
<span>音频显示时间(ms) ${A.audioTs}</span>
|
||
|
</div>
|
||
|
${m._opt.hasVideo?`
|
||
|
<div class="jessibuca-performance-item">
|
||
|
<span>音视频同步时间戳(ms) ${A.ts-A.audioTs}</span>
|
||
|
</div>
|
||
|
`:""}
|
||
|
<div class="jessibuca-performance-item">
|
||
|
<span>音频播放模式 ${l?"加速":"正常"}</span>
|
||
|
</div>
|
||
|
`:""}
|
||
|
<div class="jessibuca-performance-item">
|
||
|
<span>视频解码时间(ms) ${A.dts}</span>
|
||
|
</div>
|
||
|
|
||
|
<div class="jessibuca-performance-item">
|
||
|
<span>解码前-解码后延迟(ms) ${A.delayTs}</span>
|
||
|
</div>
|
||
|
<div class="jessibuca-performance-item">
|
||
|
<span>总延迟(网络+解码)(ms) ${A.totalDelayTs}</span>
|
||
|
</div>
|
||
|
${A.isStreamTsMoreThanLocal?'<div class="jessibuca-performance-item">\n <span>是否超过一倍率推流 是</span>\n </div>\n ':""}
|
||
|
<div class="jessibuca-performance-item">
|
||
|
<span>是否在丢帧 ${p}</span>
|
||
|
</div>
|
||
|
<div class="jessibuca-performance-item">
|
||
|
<span>播放时长(s) ${ot(A.pTs)}</span>
|
||
|
</div>
|
||
|
<div class="jessibuca-performance-item-block"></div>
|
||
|
`,g.$performancePanel.insertAdjacentHTML("beforeend",f)):(g.$performancePanel.innerHTML="",E(g.$performancePanel,"display","none"))}),m.on(v.togglePerformancePanel,e=>{E(g.$performance,"display",e?"none":"flex"),E(g.$performanceActive,"display",e?"flex":"none")}),m.on(v.faceDetectActive,e=>{E(g.$faceDetect,"display",e?"none":"flex"),E(g.$faceDetectActive,"display",e?"flex":"none")})};function Or(e,t){var i,r,t=(t=void 0===t?{}:t).insertAt;e&&"undefined"!=typeof document&&(i=document.head||document.getElementsByTagName("head")[0],(r=document.createElement("style")).type="text/css","top"===t&&i.firstChild?i.insertBefore(r,i.firstChild):i.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e)))}function _r(e,t){t instanceof Element?e.appendChild(t):e.insertAdjacentHTML("beforeend",String(t)),e.lastElementChild||e.lastChild}function x(e,t,i){e.style[t]=i}function Mr(e,t){return e.composedPath&&-1<e.composedPath().indexOf(t)}Or('@keyframes rotation{0%{-webkit-transform:rotate(0deg)}to{-webkit-transform:rotate(1turn)}}@keyframes magentaPulse{0%{background-color:#630030;-webkit-box-shadow:0 0 9px #333}50%{background-color:#a9014b;-webkit-box-shadow:0 0 18px #a9014b}to{background-color:#630030;-webkit-box-shadow:0 0 9px #333}}.jessibuca-container .jessibuca-icon{cursor:pointer;width:16px;height:16px;display:inline-block}.jessibuca-container .jessibuca-ptz-controls{position:absolute;width:140px;height:140px;visibility:hidden;opacity:0;border-radius:78px;background:url("data:image/png;base64,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
|
||
|
<div class="jessibuca-controls-center">
|
||
|
<div class="jessibuca-controls-playback-time">
|
||
|
<div class="jessibuca-controls-playback-time-inner">
|
||
|
<div class="jessibuca-controls-playback-time-scroll">
|
||
|
<div class="jessibuca-controls-playback-time-list">
|
||
|
<div class="jessibuca-playback-time-day">
|
||
|
<div class="jessibuca-playback-time-one-wrap"></div>
|
||
|
<div class="jessibuca-playback-time-second-wrap"></div>
|
||
|
</div>
|
||
|
</div>
|
||
|
<div class="jessibuca-controls-playback-current-time">
|
||
|
<div class="jessibuca-controls-playback-current-time-text">00:00:00</div>
|
||
|
</div>
|
||
|
</div>
|
||
|
</div>
|
||
|
</div>
|
||
|
<div class="jessibuca-controls-playback-btns">
|
||
|
<div class="jessibuca-controls-item jessibuca-playback-narrow">${B.narrow}</div>
|
||
|
<div class="jessibuca-controls-item jessibuca-playback-expand">${B.expand}</div>
|
||
|
</div>
|
||
|
</div>
|
||
|
`,l.$container.insertAdjacentHTML("beforeend",`
|
||
|
${u.background?`<div class="jessibuca-poster" style="background-image: url(${u.background})"></div>`:""}
|
||
|
<div class="jessibuca-loading-bg">
|
||
|
<img class="jessibuca-loading-bg-image" src="" alt="">
|
||
|
</div>
|
||
|
${u.loadingIcon?`
|
||
|
<div class="jessibuca-loading">
|
||
|
${B.loading}
|
||
|
${u.loadingText?`<div class="jessibuca-loading-text">${u.loadingText}</div>`:""}
|
||
|
</div>
|
||
|
`:""}
|
||
|
${u.hasControl&&d.play?'<div class="jessibuca-play-big"></div>':""}
|
||
|
${u.hasControl&&d.ptz?'\n <div class="jessibuca-ptz-controls">\n <div class="jessibuca-ptz-bg-active"></div>\n <div class="jessibuca-ptz-arrow jessibuca-ptz-arrow-up" data-arrow="up"></div>\n <div class="jessibuca-ptz-arrow jessibuca-ptz-arrow-right" data-arrow="right"></div>\n <div class="jessibuca-ptz-arrow jessibuca-ptz-arrow-down" data-arrow="down"></div>\n <div class="jessibuca-ptz-arrow jessibuca-ptz-arrow-left" data-arrow="left"></div>\n <div class="jessibuca-ptz-control"></div>\n </div>\n ':""}
|
||
|
${u.hasVideo?`
|
||
|
<div class="jessibuca-zoom-controls">
|
||
|
<div class="jessibuca-zoom-narrow">${B.narrow}</div>
|
||
|
<div class="jessibuca-zoom-tips">电子放大</div>
|
||
|
<div class="jessibuca-zoom-expand">${B.expand}</div>
|
||
|
<div class="jessibuca-zoom-stop2">${B.zoomStop}</div>
|
||
|
</div>
|
||
|
<div class="jessibuca-recording">
|
||
|
<div class="jessibuca-recording-red-point"></div>
|
||
|
<div class="jessibuca-recording-time">00:00:00</div>
|
||
|
<div class="jessibuca-icon-recordStop jessibuca-recording-stop">${B.recordStop}</div>
|
||
|
</div>
|
||
|
`:""}
|
||
|
|
||
|
${u.hasControl?`
|
||
|
<div class="jessibuca-controls">
|
||
|
<div class="jessibuca-controls-bottom">
|
||
|
<div class="jessibuca-controls-left">
|
||
|
${u.showBandwidth?'<div class="jessibuca-controls-item jessibuca-speed"></div>':""}
|
||
|
</div>
|
||
|
${u.playType===y&&u.playbackConfig.showControl?h:""}
|
||
|
|
||
|
<div class="jessibuca-controls-right">
|
||
|
${u.playType===y&&u.playbackConfig.showRateBtn?'\n <div class="jessibuca-controls-item-wrap">\n <div class="jessibuca-controls-item jessibuca-speed-menu">\n <div class="jessibuca-speed-icon-text"></div>\n <div class="jessibuca-speed-menu-list"></div>\n </div>\n </div>\n ':""}
|
||
|
${d.close?`<div class="jessibuca-controls-item-wrap"><div class="jessibuca-controls-item jessibuca-close">${B.close}</div></div>`:""}
|
||
|
${d.performance?`<div class="jessibuca-controls-item-wrap"><div class="jessibuca-controls-item jessibuca-performance">${B.performance}</div><div class="jessibuca-controls-item jessibuca-performance-active">${B.performanceActive}</div></div>`:""}
|
||
|
${d.aiFace?`<div class="jessibuca-controls-item-wrap"><div class="jessibuca-controls-item jessibuca-face">${B.face}</div><div class="jessibuca-controls-item jessibuca-face-active">${B.faceActive}</div></div>`:""}
|
||
|
${d.quality?'\n <div class="jessibuca-controls-item-wrap">\n <div class="jessibuca-controls-item jessibuca-quality-menu">\n <div class="jessibuca-quality-icon-text"></div>\n <div class="jessibuca-quality-menu-list"></div>\n </div>\n </div>\n ':""}
|
||
|
${d.scale?'\n <div class="jessibuca-controls-item-wrap">\n <div class="jessibuca-controls-item jessibuca-scale-menu">\n <div class="jessibuca-scale-icon-text"></div>\n <div class="jessibuca-scale-menu-list"></div>\n </div>\n </div>\n ':""}
|
||
|
${d.audio?`
|
||
|
<div class="jessibuca-controls-item-wrap">
|
||
|
<div class="jessibuca-controls-item jessibuca-volume">
|
||
|
${B.audio}
|
||
|
${B.mute}
|
||
|
<div class="jessibuca-volume-panel-wrap">
|
||
|
<div class="jessibuca-volume-panel">
|
||
|
<div class="jessibuca-volume-panel-handle"></div>
|
||
|
</div>
|
||
|
<div class="jessibuca-volume-panel-text"></div>
|
||
|
</div>
|
||
|
</div>
|
||
|
</div>
|
||
|
`:""}
|
||
|
${d.play?`<div class="jessibuca-controls-item-wrap"><div class="jessibuca-controls-item jessibuca-play">${B.play}</div><div class="jessibuca-controls-item jessibuca-pause">${B.pause}</div></div>`:""}
|
||
|
${d.screenshot?`<div class="jessibuca-controls-item-wrap"><div class="jessibuca-controls-item jessibuca-screenshot">${B.screenshot}</div></div>`:""}
|
||
|
${d.record?` <div class="jessibuca-controls-item-wrap"><div class="jessibuca-controls-item jessibuca-record">${B.record}</div><div class="jessibuca-controls-item jessibuca-record-stop">${B.recordStop}</div></div>`:""}
|
||
|
${d.ptz?` <div class="jessibuca-controls-item-wrap"><div class="jessibuca-controls-item jessibuca-ptz">${B.ptz}</div><div class="jessibuca-controls-item jessibuca-ptz-active">${B.ptzActive}</div></div>`:""}
|
||
|
${d.zoom?` <div class="jessibuca-controls-item-wrap"><div class="jessibuca-controls-item jessibuca-zoom">${B.zoom}</div><div class="jessibuca-controls-item jessibuca-zoom-stop">${B.zoomStop}</div></div>`:""}
|
||
|
${d.fullscreen?`<div class="jessibuca-controls-item-wrap"><div class="jessibuca-controls-item jessibuca-fullscreen">${B.fullscreen}</div><div class="jessibuca-controls-item jessibuca-fullscreen-exit">${B.fullscreenExit}</div></div>`:""}
|
||
|
</div>
|
||
|
</div>
|
||
|
</div>
|
||
|
`:""}
|
||
|
<div class="jessibuca-performance-panel"></div>
|
||
|
<div class="jessibuca-contextmenus"></div>
|
||
|
`),Object.defineProperty(c,"$poster",{value:l.$container.querySelector(".jessibuca-poster")}),Object.defineProperty(c,"$loadingBg",{value:l.$container.querySelector(".jessibuca-loading-bg")}),Object.defineProperty(c,"$loadingBgImage",{value:l.$container.querySelector(".jessibuca-loading-bg-image")}),Object.defineProperty(c,"$loading",{value:l.$container.querySelector(".jessibuca-loading")}),Object.defineProperty(c,"$play",{value:l.$container.querySelector(".jessibuca-play")}),Object.defineProperty(c,"$playBig",{value:l.$container.querySelector(".jessibuca-play-big")}),Object.defineProperty(c,"$recording",{value:l.$container.querySelector(".jessibuca-recording")}),Object.defineProperty(c,"$recordingTime",{value:l.$container.querySelector(".jessibuca-recording-time")}),Object.defineProperty(c,"$recordingStop",{value:l.$container.querySelector(".jessibuca-recording-stop")}),Object.defineProperty(c,"$pause",{value:l.$container.querySelector(".jessibuca-pause")}),Object.defineProperty(c,"$controls",{value:l.$container.querySelector(".jessibuca-controls")}),Object.defineProperty(c,"$controlsInner",{value:l.$container.querySelector(".jessibuca-controls-bottom")}),Object.defineProperty(c,"$controlsLeft",{value:l.$container.querySelector(".jessibuca-controls-left")}),Object.defineProperty(c,"$controlsRight",{value:l.$container.querySelector(".jessibuca-controls-right")}),Object.defineProperty(c,"$volume",{value:l.$container.querySelector(".jessibuca-volume")}),Object.defineProperty(c,"$volumePanelWrap",{value:l.$container.querySelector(".jessibuca-volume-panel-wrap")}),Object.defineProperty(c,"$volumePanelText",{value:l.$container.querySelector(".jessibuca-volume-panel-text")}),Object.defineProperty(c,"$volumePanel",{value:l.$container.querySelector(".jessibuca-volume-panel")}),Object.defineProperty(c,"$volumeHandle",{value:l.$container.querySelector(".jessibuca-volume-panel-handle")}),Object.defineProperty(c,"$volumeOn",{value:l.$container.querySelector(".jessibuca-icon-audio")}),Object.defineProperty(c,"$volumeOff",{value:l.$container.querySelector(".jessibuca-icon-mute")}),Object.defineProperty(c,"$fullscreen",{value:l.$container.querySelector(".jessibuca-fullscreen")}),Object.defineProperty(c,"$fullscreenExit",{value:l.$container.querySelector(".jessibuca-fullscreen-exit")}),Object.defineProperty(c,"$record",{value:l.$container.querySelector(".jessibuca-record")}),Object.defineProperty(c,"$recordStop",{value:l.$container.querySelector(".jessibuca-record-stop")}),Object.defineProperty(c,"$screenshot",{value:l.$container.querySelector(".jessibuca-screenshot")}),Object.defineProperty(c,"$speed",{value:l.$container.querySelector(".jessibuca-speed")}),Object.defineProperty(c,"$playbackTime",{value:l.$container.querySelector(".jessibuca-controls-playback-time")}),Object.defineProperty(c,"$playbackTimeInner",{value:l.$container.querySelector(".jessibuca-controls-playback-time-inner")}),Object.defineProperty(c,"$playbackTimeScroll",{value:l.$container.querySelector(".jessibuca-controls-playback-time-scroll")}),Object.defineProperty(c,"$playbackTimeList",{value:l.$container.querySelector(".jessibuca-controls-playback-time-list")}),Object.defineProperty(c,"$playbackTimeListOne",{value:l.$container.querySelector(".jessibuca-playback-time-one-wrap")}),Object.defineProperty(c,"$playbackTimeListSecond",{value:l.$container.querySelector(".jessibuca-playback-time-second-wrap")}),Object.defineProperty(c,"$playbackCurrentTime",{value:l.$container.querySelector(".jessibuca-controls-playback-current-time")}),Object.defineProperty(c,"$playbackCurrentTimeText",{value:l.$container.querySelector(".jessibuca-controls-playback-current-time-text")}),Object.defineProperty(c,"$controlsPlaybackBtns",{value:l.$container.querySelector(".jessibuca-controls-playback-btns")}),Object.defineProperty(c,"$playbackNarrow",{value:l.$container.querySelector(".jessibuca-playback-narrow")}),Object.defineProperty(c,"$playbackExpand",{value:l.$container.querySelector(".jessibuca-playback-expand")}),Object.defineProperty(c,"$ptz",{value:l.$container.querySelector
|
||
|
<div class="jessibuca-controls-item-wrap">
|
||
|
${t.icon?`<div class="jessibuca-controls-item jessibuca-control-extend-${i}">
|
||
|
<i class="jessibuca-icon jessibuca-icon-extend-${i}"></i>
|
||
|
${t.iconTitle?`
|
||
|
<span class="icon-title-tips"><span class="icon-title">${t.iconTitle}</span></span>
|
||
|
`:""}
|
||
|
</div>`:""}
|
||
|
${t.activeIcon?`<div class="jessibuca-controls-item jessibuca-control-extend-${i}-active">
|
||
|
<i class="jessibuca-icon jessibuca-icon-extend-${i}-active"></i>
|
||
|
${t.activeIconTitle?`
|
||
|
<span class="icon-title-tips"><span class="icon-title">${t.activeIconTitle}</span></span>
|
||
|
`:""}
|
||
|
</div>`:""}
|
||
|
</div>
|
||
|
`,n=Array.from(r.children)[t.index],o=(n?n.insertAdjacentHTML("beforebegin",a):_r(r,a),t.icon?r.querySelector(".jessibuca-icon-extend-"+i):null),l=t.icon?r.querySelector(".jessibuca-control-extend-"+i):null,c=t.activeIcon?r.querySelector(`.jessibuca-icon-extend-${i}-active`):null,u=t.activeIcon?r.querySelector(`.jessibuca-control-extend-${i}-active`):null,{proxy:d}=this.player["events"];t.icon&&(x(o,"background",`url(${t.icon}) no-repeat center`),x(o,"background-size","100% 100%"),x(l,"display","none"),t.iconHover)&&(d(o,"mouseover",()=>{x(o,"background",`url(${t.iconHover}) no-repeat center`),x(o,"background-size","100% 100%")}),d(o,"mouseout",()=>{x(o,"background",`url(${t.icon}) no-repeat center`),x(o,"background-size","100% 100%")})),t.activeIcon&&(x(c,"background",`url(${t.activeIcon}) no-repeat center`),x(c,"background-size","100% 100%"),x(u,"display","none"),t.activeIconHover)&&(d(c,"mouseover",()=>{x(c,"background",`url(${t.activeIconHover}) no-repeat center`),x(c,"background-size","100% 100%")}),d(c,"mouseout",()=>{x(c,"background",`url(${t.activeIcon}) no-repeat center`),x(c,"background-size","100% 100%")})),t.click&&o&&d(o,"click",e=>{e.preventDefault(),s&&(x(l,"display","none"),x(u,"display","flex")),t.click.call(this.player,this,e)}),t.activeClick&&c&&d(c,"click",e=>{e.preventDefault(),x(l,"display","flex"),x(u,"display","none"),t.activeClick.call(this.player,this,e)}),this.extendBtnList.push({name:i,$iconWrap:l,$activeIconWrap:u})}}}Or(".jessibuca-container{position:relative;width:100%;height:100%;overflow:hidden}.jessibuca-container.jessibuca-fullscreen-web{position:fixed;z-index:9999;left:0;top:0;right:0;bottom:0;width:100vw!important;height:100vh!important;background:#000}");class O{static init(){for(var e in O.types={avc1:[],avcC:[],hvc1:[],hvcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],mvex:[],mvhd:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[]},O.types)O.types.hasOwnProperty(e)&&(O.types[e]=[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]);var t=O.constants={};t.FTYP=new Uint8Array([105,115,111,109,0,0,0,1,105,115,111,109,97,118,99,49]),t.STSD_PREFIX=new Uint8Array([0,0,0,0,0,0,0,1]),t.STTS=new Uint8Array([0,0,0,0,0,0,0,0]),t.STSC=t.STCO=t.STTS,t.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),t.HDLR_VIDEO=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),t.HDLR_AUDIO=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]),t.DREF=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),t.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),t.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}static box(e){let t=8,i=null,r=Array.prototype.slice.call(arguments,1),s=r.length;for(let e=0;e<s;e++)t+=r[e].byteLength;(i=new Uint8Array(t))[0]=t>>>24&255,i[1]=t>>>16&255,i[2]=t>>>8&255,i[3]=255&t,i.set(e,4);let a=8;for(let e=0;e<s;e++)i.set(r[e],a),a+=r[e].byteLength;return i}static generateInitSegment(e){var t=O.box(O.types.ftyp,O.constants.FTYP),e=O.moov(e),i=new Uint8Array(t.byteLength+e.byteLength);return i.set(t,0),i.set(e,t.byteLength),i}static moov(e){var t=O.mvhd(e.timescale,e.duration),i=O.trak(e),e=O.mvex(e);return O.box(O.types.moov,t,i,e)}static mvhd(e,t){return O.box(O.types.mvhd,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,e>>>24&255,e>>>16&255,e>>>8&255,255&e,t>>>24&255,t>>>16&255,t>>>8&255,255&t,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]))}static trak(e){return O.box(O.types.trak,O.tkhd(e),O.mdia(e))}static tkhd(e){var t=e.id,i=e.duration,r=e.presentWidth,e=e.presentHeight;return O.box(O.types.tkhd,new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,t>>>24&255,t>>>16&255,t>>>8&255,255&t,0,0,0,0,i>>>24&255,i>>>16&255,i>>>8&255,255&i,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0
|
||
|
<div class="jessibuca-contextmenu jessibuca-contextmenu-${i=$e()}">
|
||
|
${t.content}
|
||
|
</div>
|
||
|
`,(s=Array.from(this.$contextmenus.children)[t.index])?s.insertAdjacentHTML("beforebegin",r):_r(this.$contextmenus,r),s=this.$contextmenus.querySelector(".jessibuca-contextmenu-"+i),t.click&&a(s,"click",e=>{e.preventDefault(),t.click.call(this.player,this,e),this.hide()}),this.menuList.push({uuid:i,$menuItem:s}))}}class Xr extends t{constructor(e,t){super(),this.$container=e;var i,e=St(),r=(this._opt=Object.assign({},e,t),this.debug=new Ne(this),this._opt.forceNoOffscreen=!0,S()&&(this._opt.controlAutoHide=!1),this._opt.forceNoOffscreen||("undefined"==typeof OffscreenCanvas?(this._opt.forceNoOffscreen=!0,this._opt.useOffscreen=!1):this._opt.useOffscreen=!0),(this._opt.isHls||this._opt.isWebrtc)&&(this._opt.useWCS=!1,this._opt.useMSE=!1,this._opt.isNakedFlow=!1),this._opt.isNakedFlow,this._opt.isHls||this._opt.isWebrtc||(this._opt.useWCS&&(this._opt.useWCS="VideoEncoder"in window,this._opt.useWCS||this.debug.warn("Player","useWCS is true, but not support so set useWCS false"),this._opt.useWCS)&&(this._opt.useOffscreen?this._opt.wcsUseVideoRender=!1:this._opt.wcsUseVideoRender&&(this._opt.wcsUseVideoRender=tt())),this._opt.useMSE&&(this._opt.useMSE=window.MediaSource&&window.MediaSource.isTypeSupported(ge),this._opt.useMSE||this.debug.warn("Player","useMSE is true, but not support so set useMSE false"))),this._opt.useMSE?(this._opt.useWCS&&this.debug.warn("Player","useMSE is true and useWCS is true then useWCS set true->false"),this._opt.forceNoOffscreen||this.debug.warn("Player","useMSE is true and forceNoOffscreen is false then forceNoOffscreen set false->true"),this._opt.useWCS=!1,this._opt.forceNoOffscreen=!0):this._opt.useWCS,!this._opt.useSIMD&&-1===this._opt.decoder.indexOf("-simd")||(this._opt.useSIMD=WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11])),this._opt.useSIMD)||this.debug.warn("Player","useSIMD is true, but not support so set useSIMD false"),this._opt.useSIMD?-1===this._opt.decoder.indexOf("-simd")&&(this._opt.decoder=this._opt.decoder.replace("decoder-pro","decoder-pro-simd")):-1!==this._opt.decoder.indexOf("-simd")&&(this._opt.decoder=this._opt.decoder.replace("decoder-pro-simd","decoder-pro")),this._opt.hasAudio||(this._opt.operateBtns.audio=!1),this._opt.hasVideo||(this._opt.operateBtns.fullscreen=!1,this._opt.operateBtns.screenshot=!1,this._opt.operateBtns.record=!1,this._opt.operateBtns.ptz=!1,this._opt.operateBtns.quality=!1,this._opt.operateBtns.zoom=!1),this._opt.qualityConfig&&0===this._opt.qualityConfig.length&&this._opt.operateBtns.quality&&(this._opt.operateBtns.quality=!1,this.debug.warn("Player","_opt.qualityConfig is empty, so set operateBtns.quality false")),this._opt.hasControl=this._hasControl(),this._loading=!1,this._playing=!1,this._playbackPause=!1,this._hasLoaded=!1,this._zooming=!1,this._destroyed=!1,this._checkHeartTimeout=null,this._checkLoadingTimeout=null,this._checkStatsInterval=null,this._checkVisibleHiddenTimeout=null,this._startBpsTime=null,this._isPlayingBeforePageHidden=!1,this._stats={buf:0,netBuf:0,fps:0,maxFps:0,dfps:0,abps:0,vbps:0,ts:0,mseTs:0,pTs:0,dts:0},this._allStatsData={},this._faceDetectActive=!1,this._objectDetectActive=!1,this._times={playInitStart:"",playStart:"",streamStart:"",streamResponse:"",demuxStart:"",decodeStart:"",videoStart:"",playTimestamp:"",streamTimestamp:"",streamResponseTimestamp:"",demuxTimestamp:"",decodeTimestamp:"",videoTimestamp:"",allTimestamp:""},this._videoTimestamp=0,this._audioTimestamp=0,this._videoIframeIntervalTs=0,this._streamQuality=this._opt.defaultStreamQuality||"",this._visibility=!0,this._lastestVisibilityChangeTimestamp=null,this._tempWorkerStats=null,this._isPlayback()&&(this._opt.useMSE=!1,this._opt.useWCS=!1),!1!==this._opt.useMSE||!1!==this._opt.useWCS||this._opt.isWebrtc||this._opt.isHls||(this._opt.useWasm=!0),(this._opt.isHls||this._opt.isWebrtc)&&(this._opt.hasVideo=!0,this._opt.hasAudio=!0),this._opt.hasVideo||(this._opt.useMSE=!1,this._opt.useWCS=!1),this._opt.useWasm&&(this._opt.useOffscreen?this._opt.wasmUseVideoRender=!1:this._opt.
|