diff --git a/public/sdk/decoder.worker b/public/sdk/decoder.worker new file mode 100644 index 0000000..e69de29 diff --git a/public/sdk/downloader.worker b/public/sdk/downloader.worker new file mode 100644 index 0000000..e69de29 diff --git a/public/sdk/enumConstant.js b/public/sdk/enumConstant.js new file mode 100644 index 0000000..008d3eb --- /dev/null +++ b/public/sdk/enumConstant.js @@ -0,0 +1 @@ +!function(e,t){"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("common requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,(function(e,t){const a={closeTalk:60,TalkHandshakeReq:59,kFileData:1,kInitDecoderReq:0,kUninitDecoderReq:1,kOpenDecoderReq:2,kCloseDecoderReq:3,kFeedDataReq:4,kStartDecodingReq:5,kPauseDecodingReq:6,kInitDecoderRsp:0,kUninitDecoderRsp:1,kOpenDecoderRsp:2,kCloseDecoderRsp:10,kVideoFrame:4,kAudioFrame:5,kDecodeFinishedEvt:8,cmdCallback:11,kGetParamRsp:12,sendDataCallback:13,socketLinkState:14,getHeartBeatRequest:15,DownloaderHeartBeat:16,closeWebsocket:17,fetchStream:18,resetDecoderFifo:19,getSetPlayBackSpeedReq:20,getSetPlayBackStartReq:21,deviceReady:22,getSetPlayBackStartTimeReq:23,responseCurDateTime:24,eventTypeFifoFull:25,eventTypeFifoEnough:26,playbakcRecordList:27,socketActiveClose:28,serverDataTimeout:29,heartPingResp:30,serverDecoderError:31,socketNoActive:32,getHandsharkReq:33,getHandsharkRes:34,recoderStart:35,recoderPause:36,onWasmLoaded:37,getHandshakeReq:38,DownloaderHandshakeReq:39,sendHandshakeReq:40,kVideoDownRep:100,kVideoDownChumksRep:101,getTalkStartReq:50,talkStartRep:51,pcmDataReq:52,kStartTalkEncoderRsq:53,kStartTalkEncoderRsp:54,kGetDeviceInfo:55,kGetAudioDataReq:56,kgetTalkStartRep:57,DestroyTalkReq:58,DestroyTalkRes:61,kStartTalkEncoderdeviceready:62,initTalkEncode:64,_getTalkStartReq:63,PlaybackOver:65,serverDecoderTalkError:66};return e.common=a,a})); \ No newline at end of file diff --git a/public/sdk/event.js b/public/sdk/event.js new file mode 100644 index 0000000..87910f0 --- /dev/null +++ b/public/sdk/event.js @@ -0,0 +1 @@ +import Logger from"./logger.js";new Logger("Event").logInfo("Event.js 已加载");export class Events{constructor(e){this.target={},this.eventsQueue={},this.disallowRepeat=!1}add(e=[],t,s){for(let n of e)this.on(n,t,s)}on(e,t,s){if(void 0===this.eventsQueue[e]&&(this.eventsQueue[e]={methods:[]}),"function"==typeof t){if(!this.disallowRepeat||!this.eventsQueue[e].methods.includes(t))return void 0!==s&&(t.once=s),this.eventsQueue[e].methods.push(t),this.target}else logger.error("on","the argument is not function.",t)}once(e,t){this.on(e,t,!0)}off(e,t){let s=this.eventsQueue[e];if(!s)return;let n=s.methods;if(t){let e=n.length;for(;e--;)n[e]===t&&n.splice(e,1)}else delete this.eventsQueue[e];return this.target}emit(e,...t){let s=this.eventsQueue[e];if(s)return s.methods.forEach((s=>{s.apply(this.target,t),s.once&&this.off(e,s)})),this.target}clear(e){delete this.eventsQueue[e]}clearAll(){this.eventsQueue={}}}export const events=e=>new Events(e);const getEvents=function(e){const t=new Events(e);return e=>(t.target=e,t)};export default getEvents; \ No newline at end of file diff --git a/public/sdk/libffmpeg.js b/public/sdk/libffmpeg.js new file mode 100644 index 0000000..fb9350b --- /dev/null +++ b/public/sdk/libffmpeg.js @@ -0,0 +1 @@ +var key,Module=void 0!==Module?Module:{},moduleOverrides={};for(key in Module)Module.hasOwnProperty(key)&&(moduleOverrides[key]=Module[key]);var arguments_=[],thisProgram="./this.program",quit_=function(e,t){throw t},ENVIRONMENT_IS_WEB=!1,ENVIRONMENT_IS_WORKER=!1,ENVIRONMENT_IS_NODE=!1,ENVIRONMENT_IS_SHELL=!1;if(ENVIRONMENT_IS_WEB="object"==typeof window,ENVIRONMENT_IS_WORKER="function"==typeof importScripts,ENVIRONMENT_IS_NODE="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER,Module.ENVIRONMENT)throw new Error("Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -s ENVIRONMENT=web or -s ENVIRONMENT=node)");var read_,readAsync,readBinary,setWindowTitle,nodeFS,nodePath,scriptDirectory="";function locateFile(e){return Module.locateFile?Module.locateFile(e,scriptDirectory):scriptDirectory+e}if(ENVIRONMENT_IS_NODE)scriptDirectory=ENVIRONMENT_IS_WORKER?require("path").dirname(scriptDirectory)+"/":__dirname+"/",read_=function(e,t){return nodeFS||(nodeFS=require("fs")),nodePath||(nodePath=require("path")),e=nodePath.normalize(e),nodeFS.readFileSync(e,t?null:"utf8")},readBinary=function(e){var t=read_(e,!0);return t.buffer||(t=new Uint8Array(t)),assert(t.buffer),t},process.argv.length>1&&(thisProgram=process.argv[1].replace(/\\/g,"/")),arguments_=process.argv.slice(2),"undefined"!=typeof module&&(module.exports=Module),process.on("uncaughtException",(function(e){if(!(e instanceof ExitStatus))throw e})),process.on("unhandledRejection",abort),quit_=function(e){process.exit(e)},Module.inspect=function(){return"[Emscripten Module object]"};else if(ENVIRONMENT_IS_SHELL)"undefined"!=typeof read&&(read_=function(e){return read(e)}),readBinary=function(e){var t;return"function"==typeof readbuffer?new Uint8Array(readbuffer(e)):(assert("object"==typeof(t=read(e,"binary"))),t)},"undefined"!=typeof scriptArgs?arguments_=scriptArgs:"undefined"!=typeof arguments&&(arguments_=arguments),"function"==typeof quit&&(quit_=function(e){quit(e)}),"undefined"!=typeof print&&("undefined"==typeof console&&(console={}),console.log=print,console.warn=console.error="undefined"!=typeof printErr?printErr:print);else{if(!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_WORKER)throw new Error("environment detection error");ENVIRONMENT_IS_WORKER?scriptDirectory=self.location.href:document.currentScript&&(scriptDirectory=document.currentScript.src),scriptDirectory=0!==scriptDirectory.indexOf("blob:")?scriptDirectory.substr(0,scriptDirectory.lastIndexOf("/")+1):"",read_=function(e){var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},ENVIRONMENT_IS_WORKER&&(readBinary=function(e){var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),readAsync=function(e,t,r){var o=new XMLHttpRequest;o.open("GET",e,!0),o.responseType="arraybuffer",o.onload=function(){200==o.status||0==o.status&&o.response?t(o.response):r()},o.onerror=r,o.send(null)},setWindowTitle=function(e){document.title=e}}var out=Module.print||console.log.bind(console),err=Module.printErr||console.warn.bind(console);for(key in moduleOverrides)moduleOverrides.hasOwnProperty(key)&&(Module[key]=moduleOverrides[key]);moduleOverrides=null,Module.arguments&&(arguments_=Module.arguments),Object.getOwnPropertyDescriptor(Module,"arguments")||Object.defineProperty(Module,"arguments",{configurable:!0,get:function(){abort("Module.arguments has been replaced with plain arguments_ (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)")}}),Module.thisProgram&&(thisProgram=Module.thisProgram),Object.getOwnPropertyDescriptor(Module,"thisProgram")||Object.defineProperty(Module,"thisProgram",{configurable:!0,get:function(){abort("Module.thisProgram has been replaced with plain thisProgram (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)")}}),Module.quit&&(quit_=Module.quit),Object.getOwnPropertyDescriptor(Module,"quit")||Object.defineProperty(Module,"quit",{configurable:!0,get:function(){abort("Module.quit has been replaced with plain quit_ (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)")}}),assert(void 0===Module.memoryInitializerPrefixURL,"Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead"),assert(void 0===Module.pthreadMainPrefixURL,"Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead"),assert(void 0===Module.cdInitializerPrefixURL,"Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead"),assert(void 0===Module.filePackagePrefixURL,"Module.filePackagePrefixURL option was removed, use Module.locateFile instead"),assert(void 0===Module.read,"Module.read option was removed (modify read_ in JS)"),assert(void 0===Module.readAsync,"Module.readAsync option was removed (modify readAsync in JS)"),assert(void 0===Module.readBinary,"Module.readBinary option was removed (modify readBinary in JS)"),assert(void 0===Module.setWindowTitle,"Module.setWindowTitle option was removed (modify setWindowTitle in JS)"),assert(void 0===Module.TOTAL_MEMORY,"Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY"),Object.getOwnPropertyDescriptor(Module,"read")||Object.defineProperty(Module,"read",{configurable:!0,get:function(){abort("Module.read has been replaced with plain read_ (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)")}}),Object.getOwnPropertyDescriptor(Module,"readAsync")||Object.defineProperty(Module,"readAsync",{configurable:!0,get:function(){abort("Module.readAsync has been replaced with plain readAsync (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)")}}),Object.getOwnPropertyDescriptor(Module,"readBinary")||Object.defineProperty(Module,"readBinary",{configurable:!0,get:function(){abort("Module.readBinary has been replaced with plain readBinary (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)")}}),Object.getOwnPropertyDescriptor(Module,"setWindowTitle")||Object.defineProperty(Module,"setWindowTitle",{configurable:!0,get:function(){abort("Module.setWindowTitle has been replaced with plain setWindowTitle (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)")}});var STACK_ALIGN=16;function alignMemory(e,t){return t||(t=STACK_ALIGN),Math.ceil(e/t)*t}function warnOnce(e){warnOnce.shown||(warnOnce.shown={}),warnOnce.shown[e]||(warnOnce.shown[e]=1,err(e))}function convertJsFunctionToWasm(e,t){if("function"==typeof WebAssembly.Function){for(var r={i:"i32",j:"i64",f:"f32",d:"f64"},o={parameters:[],results:"v"==t[0]?[]:[r[t[0]]]},n=1;n=o);)++n;if(n-t>16&&e.subarray&&UTF8Decoder)return UTF8Decoder.decode(e.subarray(t,n));for(var a="";t>10,56320|1023&c)}}else a+=String.fromCharCode((31&i)<<6|s)}else a+=String.fromCharCode(i)}return a}function UTF8ToString(e,t){return e?UTF8ArrayToString(HEAPU8,e,t):""}function stringToUTF8Array(e,t,r,o){if(!(o>0))return 0;for(var n=r,a=r+o-1,i=0;i=55296&&s<=57343)s=65536+((1023&s)<<10)|1023&e.charCodeAt(++i);if(s<=127){if(r>=a)break;t[r++]=s}else if(s<=2047){if(r+1>=a)break;t[r++]=192|s>>6,t[r++]=128|63&s}else if(s<=65535){if(r+2>=a)break;t[r++]=224|s>>12,t[r++]=128|s>>6&63,t[r++]=128|63&s}else{if(r+3>=a)break;s>=2097152&&warnOnce("Invalid Unicode code point 0x"+s.toString(16)+" encountered when serializing a JS string to an UTF-8 string on the asm.js/wasm heap! (Valid unicode code points should be in range 0-0x1FFFFF)."),t[r++]=240|s>>18,t[r++]=128|s>>12&63,t[r++]=128|s>>6&63,t[r++]=128|63&s}}return t[r]=0,r-n}function stringToUTF8(e,t,r){return assert("number"==typeof r,"stringToUTF8(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"),stringToUTF8Array(e,HEAPU8,t,r)}function lengthBytesUTF8(e){for(var t=0,r=0;r=55296&&o<=57343&&(o=65536+((1023&o)<<10)|1023&e.charCodeAt(++r)),o<=127?++t:t+=o<=2047?2:o<=65535?3:4}return t}var UTF16Decoder="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0;function allocateUTF8(e){var t=lengthBytesUTF8(e)+1,r=_malloc(t);return r&&stringToUTF8Array(e,HEAP8,r,t),r}function writeArrayToMemory(e,t){assert(e.length>=0,"writeArrayToMemory array must have a length (should be an array or typed array)"),HEAP8.set(e,t)}function writeAsciiToMemory(e,t,r){for(var o=0;o>0]=e.charCodeAt(o);r||(HEAP8[t>>0]=0)}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64,WASM_PAGE_SIZE=65536;function alignUp(e,t){return e%t>0&&(e+=t-e%t),e}function updateGlobalBufferAndViews(e){buffer=e,Module.HEAP8=HEAP8=new Int8Array(e),Module.HEAP16=HEAP16=new Int16Array(e),Module.HEAP32=HEAP32=new Int32Array(e),Module.HEAPU8=HEAPU8=new Uint8Array(e),Module.HEAPU16=HEAPU16=new Uint16Array(e),Module.HEAPU32=HEAPU32=new Uint32Array(e),Module.HEAPF32=HEAPF32=new Float32Array(e),Module.HEAPF64=HEAPF64=new Float64Array(e)}var STACK_BASE=8806896,STACK_MAX=3564016;assert(STACK_BASE%16==0,"stack must start aligned");var TOTAL_STACK=5242880;Module.TOTAL_STACK&&assert(TOTAL_STACK===Module.TOTAL_STACK,"the stack size can no longer be determined at runtime");var INITIAL_INITIAL_MEMORY=Module.INITIAL_MEMORY||33554432;function writeStackCookie(){assert(0==(3&STACK_MAX)),HEAPU32[1+(STACK_MAX>>2)]=34821223,HEAPU32[2+(STACK_MAX>>2)]=2310721022,HEAP32[0]=1668509029}function checkStackCookie(){if(!ABORT){var e=HEAPU32[1+(STACK_MAX>>2)],t=HEAPU32[2+(STACK_MAX>>2)];34821223==e&&2310721022==t||abort("Stack overflow! Stack cookie has been overwritten, expected hex dwords 0x89BACDFE and 0x2135467, but received 0x"+t.toString(16)+" "+e.toString(16)),1668509029!==HEAP32[0]&&abort("Runtime error: The application has corrupted its heap memory area (address zero)!")}}Object.getOwnPropertyDescriptor(Module,"INITIAL_MEMORY")||Object.defineProperty(Module,"INITIAL_MEMORY",{configurable:!0,get:function(){abort("Module.INITIAL_MEMORY has been replaced with plain INITIAL_INITIAL_MEMORY (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)")}}),assert(INITIAL_INITIAL_MEMORY>=TOTAL_STACK,"INITIAL_MEMORY should be larger than TOTAL_STACK, was "+INITIAL_INITIAL_MEMORY+"! (TOTAL_STACK="+TOTAL_STACK+")"),assert("undefined"!=typeof Int32Array&&"undefined"!=typeof Float64Array&&void 0!==Int32Array.prototype.subarray&&void 0!==Int32Array.prototype.set,"JS engine does not provide full typed array support"),(wasmMemory=Module.wasmMemory?Module.wasmMemory:new WebAssembly.Memory({initial:INITIAL_INITIAL_MEMORY/WASM_PAGE_SIZE,maximum:2147483648/WASM_PAGE_SIZE}))&&(buffer=wasmMemory.buffer),assert((INITIAL_INITIAL_MEMORY=buffer.byteLength)%WASM_PAGE_SIZE==0),assert(65536%WASM_PAGE_SIZE==0),updateGlobalBufferAndViews(buffer),function(){var e=new Int16Array(1),t=new Int8Array(e.buffer);if(e[0]=25459,115!==t[0]||99!==t[1])throw"Runtime error: expected the system to be little-endian!"}();var __ATPRERUN__=[],__ATINIT__=[],__ATMAIN__=[],__ATPOSTRUN__=[],runtimeInitialized=!1,runtimeExited=!1;function preRun(){if(Module.preRun)for("function"==typeof Module.preRun&&(Module.preRun=[Module.preRun]);Module.preRun.length;)addOnPreRun(Module.preRun.shift());callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){checkStackCookie(),assert(!runtimeInitialized),runtimeInitialized=!0,Module.noFSInit||FS.init.initialized||FS.init(),TTY.init(),callRuntimeCallbacks(__ATINIT__)}function preMain(){checkStackCookie(),FS.ignorePermissions=!1,callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){checkStackCookie(),runtimeExited=!0}function postRun(){if(checkStackCookie(),Module.postRun)for("function"==typeof Module.postRun&&(Module.postRun=[Module.postRun]);Module.postRun.length;)addOnPostRun(Module.postRun.shift());callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(e){__ATPRERUN__.unshift(e)}function addOnPostRun(e){__ATPOSTRUN__.unshift(e)}assert(Math.imul,"This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),assert(Math.fround,"This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),assert(Math.clz32,"This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"),assert(Math.trunc,"This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");var runDependencies=0,runDependencyWatcher=null,dependenciesFulfilled=null,runDependencyTracking={};function getUniqueRunDependency(e){for(var t=e;;){if(!runDependencyTracking[e])return e;e=t+Math.random()}}function addRunDependency(e){runDependencies++,Module.monitorRunDependencies&&Module.monitorRunDependencies(runDependencies),e?(assert(!runDependencyTracking[e]),runDependencyTracking[e]=1,null===runDependencyWatcher&&"undefined"!=typeof setInterval&&(runDependencyWatcher=setInterval((function(){if(ABORT)return clearInterval(runDependencyWatcher),void(runDependencyWatcher=null);var e=!1;for(var t in runDependencyTracking)e||(e=!0,err("still waiting on run dependencies:")),err("dependency: "+t);e&&err("(end of list)")}),1e4))):err("warning: run dependency added without ID")}function removeRunDependency(e){if(runDependencies--,Module.monitorRunDependencies&&Module.monitorRunDependencies(runDependencies),e?(assert(runDependencyTracking[e]),delete runDependencyTracking[e]):err("warning: run dependency removed without ID"),0==runDependencies&&(null!==runDependencyWatcher&&(clearInterval(runDependencyWatcher),runDependencyWatcher=null),dependenciesFulfilled)){var t=dependenciesFulfilled;dependenciesFulfilled=null,t()}}function abort(e){throw Module.onAbort&&Module.onAbort(e),err(e+=""),ABORT=!0,EXITSTATUS=1,e="abort("+e+") at "+stackTrace(),new WebAssembly.RuntimeError(e)}function hasPrefix(e,t){return String.prototype.startsWith?e.startsWith(t):0===e.indexOf(t)}Module.preloadedImages={},Module.preloadedAudios={};var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(e){return hasPrefix(e,dataURIPrefix)}var fileURIPrefix="file://";function isFileURI(e){return hasPrefix(e,fileURIPrefix)}function createExportWrapper(e,t){return function(){var r=e,o=t;return t||(o=Module.asm),assert(runtimeInitialized,"native function `"+r+"` called before runtime initialization"),assert(!runtimeExited,"native function `"+r+"` called after runtime exit (use NO_EXIT_RUNTIME to keep it alive after main() exits)"),o[e]||assert(o[e],"exported native function `"+r+"` not found"),o[e].apply(null,arguments)}}var tempDouble,tempI64,wasmBinaryFile="libffmpeg.wasm";function getBinary(){try{if(wasmBinary)return new Uint8Array(wasmBinary);if(readBinary)return readBinary(wasmBinaryFile);throw"both async and sync fetching of the wasm failed"}catch(e){abort(e)}}function getBinaryPromise(){return wasmBinary||!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_WORKER||"function"!=typeof fetch||isFileURI(wasmBinaryFile)?Promise.resolve().then(getBinary):fetch(wasmBinaryFile,{credentials:"same-origin"}).then((function(e){if(!e.ok)throw"failed to load wasm binary file at '"+wasmBinaryFile+"'";return e.arrayBuffer()})).catch((function(){return getBinary()}))}function createWasm(){var e={env:asmLibraryArg,wasi_snapshot_preview1:asmLibraryArg};function t(e,t){var r=e.exports;Module.asm=r,assert(wasmTable=Module.asm.__indirect_function_table,"table not found in wasm exports"),removeRunDependency("wasm-instantiate")}addRunDependency("wasm-instantiate");var r=Module;function o(e){assert(Module===r,"the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?"),r=null,t(e.instance)}function n(t){return getBinaryPromise().then((function(t){return WebAssembly.instantiate(t,e)})).then(t,(function(e){err("failed to asynchronously prepare wasm: "+e),abort(e)}))}if(Module.instantiateWasm)try{return Module.instantiateWasm(e,t)}catch(e){return err("Module.instantiateWasm callback failed with error: "+e),!1}return function(){if(wasmBinary||"function"!=typeof WebAssembly.instantiateStreaming||isDataURI(wasmBinaryFile)||isFileURI(wasmBinaryFile)||"function"!=typeof fetch)return n(o);fetch(wasmBinaryFile,{credentials:"same-origin"}).then((function(t){return WebAssembly.instantiateStreaming(t,e).then(o,(function(e){return err("wasm streaming compile failed: "+e),err("falling back to ArrayBuffer instantiation"),n(o)}))}))}(),{}}function callRuntimeCallbacks(e){for(;e.length>0;){var t=e.shift();if("function"!=typeof t){var r=t.func;"number"==typeof r?void 0===t.arg?wasmTable.get(r)():wasmTable.get(r)(t.arg):r(void 0===t.arg?null:t.arg)}else t(Module)}}function demangle(e){return warnOnce("warning: build with -s DEMANGLE_SUPPORT=1 to link in libcxxabi demangling"),e}function demangleAll(e){return e.replace(/\b_Z[\w\d_]+/g,(function(e){var t=demangle(e);return e===t?e:t+" ["+e+"]"}))}function dynCallLegacy(e,t,r){return assert("dynCall_"+e in Module,"bad function pointer type - no table for sig '"+e+"'"),r&&r.length?assert(r.length===e.substring(1).replace(/j/g,"--").length):assert(1==e.length),r&&r.length?Module["dynCall_"+e].apply(null,[t].concat(r)):Module["dynCall_"+e].call(null,t)}function jsStackTrace(){var e=new Error;if(!e.stack){try{throw new Error}catch(t){e=t}if(!e.stack)return"(no stack trace available)"}return e.stack.toString()}function stackTrace(){var e=jsStackTrace();return Module.extraStackTrace&&(e+="\n"+Module.extraStackTrace()),demangleAll(e)}function ___assert_fail(e,t,r,o){abort("Assertion failed: "+UTF8ToString(e)+", at: "+[t?UTF8ToString(t):"unknown filename",r,o?UTF8ToString(o):"unknown function"])}function _atexit(e,t){}function ___cxa_atexit(e,t){return _atexit(e,t)}function _tzset(){if(!_tzset.called){_tzset.called=!0;var e=(new Date).getFullYear(),t=new Date(e,0,1),r=new Date(e,6,1),o=t.getTimezoneOffset(),n=r.getTimezoneOffset(),a=Math.max(o,n);HEAP32[__get_timezone()>>2]=60*a,HEAP32[__get_daylight()>>2]=Number(o!=n);var i=u(t),s=u(r),d=allocateUTF8(i),c=allocateUTF8(s);n>2]=d,HEAP32[__get_tzname()+4>>2]=c):(HEAP32[__get_tzname()>>2]=c,HEAP32[__get_tzname()+4>>2]=d)}function u(e){var t=e.toTimeString().match(/\(([A-Za-z ]+)\)$/);return t?t[1]:"GMT"}}function _localtime_r(e,t){_tzset();var r=new Date(1e3*HEAP32[e>>2]);HEAP32[t>>2]=r.getSeconds(),HEAP32[t+4>>2]=r.getMinutes(),HEAP32[t+8>>2]=r.getHours(),HEAP32[t+12>>2]=r.getDate(),HEAP32[t+16>>2]=r.getMonth(),HEAP32[t+20>>2]=r.getFullYear()-1900,HEAP32[t+24>>2]=r.getDay();var o=new Date(r.getFullYear(),0,1),n=(r.getTime()-o.getTime())/864e5|0;HEAP32[t+28>>2]=n,HEAP32[t+36>>2]=-60*r.getTimezoneOffset();var a=new Date(r.getFullYear(),6,1).getTimezoneOffset(),i=o.getTimezoneOffset(),s=0|(a!=i&&r.getTimezoneOffset()==Math.min(i,a));HEAP32[t+32>>2]=s;var d=HEAP32[__get_tzname()+(s?4:0)>>2];return HEAP32[t+40>>2]=d,t}function ___localtime_r(e,t){return _localtime_r(e,t)}isDataURI(wasmBinaryFile)||(wasmBinaryFile=locateFile(wasmBinaryFile));var PATH={splitPath:function(e){return/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1)},normalizeArray:function(e,t){for(var r=0,o=e.length-1;o>=0;o--){var n=e[o];"."===n?e.splice(o,1):".."===n?(e.splice(o,1),r++):r&&(e.splice(o,1),r--)}if(t)for(;r;r--)e.unshift("..");return e},normalize:function(e){var t="/"===e.charAt(0),r="/"===e.substr(-1);return(e=PATH.normalizeArray(e.split("/").filter((function(e){return!!e})),!t).join("/"))||t||(e="."),e&&r&&(e+="/"),(t?"/":"")+e},dirname:function(e){var t=PATH.splitPath(e),r=t[0],o=t[1];return r||o?(o&&(o=o.substr(0,o.length-1)),r+o):"."},basename:function(e){if("/"===e)return"/";var t=(e=(e=PATH.normalize(e)).replace(/\/$/,"")).lastIndexOf("/");return-1===t?e:e.substr(t+1)},extname:function(e){return PATH.splitPath(e)[3]},join:function(){var e=Array.prototype.slice.call(arguments,0);return PATH.normalize(e.join("/"))},join2:function(e,t){return PATH.normalize(e+"/"+t)}};function setErrNo(e){return HEAP32[___errno_location()>>2]=e,e}function getRandomDevice(){if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues){var e=new Uint8Array(1);return function(){return crypto.getRandomValues(e),e[0]}}if(ENVIRONMENT_IS_NODE)try{var t=require("crypto");return function(){return t.randomBytes(1)[0]}}catch(e){}return function(){abort("no cryptographic support found for randomDevice. consider polyfilling it if you want to use something insecure like Math.random(), e.g. put this in a --pre-js: var crypto = { getRandomValues: function(array) { for (var i = 0; i < array.length; i++) array[i] = (Math.random()*256)|0 } };")}}var PATH_FS={resolve:function(){for(var e="",t=!1,r=arguments.length-1;r>=-1&&!t;r--){var o=r>=0?arguments[r]:FS.cwd();if("string"!=typeof o)throw new TypeError("Arguments to path.resolve must be strings");if(!o)return"";e=o+"/"+e,t="/"===o.charAt(0)}return(t?"/":"")+(e=PATH.normalizeArray(e.split("/").filter((function(e){return!!e})),!t).join("/"))||"."},relative:function(e,t){function r(e){for(var t=0;t=0&&""===e[r];r--);return t>r?[]:e.slice(t,r-t+1)}e=PATH_FS.resolve(e).substr(1),t=PATH_FS.resolve(t).substr(1);for(var o=r(e.split("/")),n=r(t.split("/")),a=Math.min(o.length,n.length),i=a,s=0;s0?r.slice(0,o).toString("utf-8"):null}else"undefined"!=typeof window&&"function"==typeof window.prompt?null!==(t=window.prompt("Input: "))&&(t+="\n"):"function"==typeof readline&&null!==(t=readline())&&(t+="\n");if(!t)return null;e.input=intArrayFromString(t,!0)}return e.input.shift()},put_char:function(e,t){null===t||10===t?(out(UTF8ArrayToString(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},flush:function(e){e.output&&e.output.length>0&&(out(UTF8ArrayToString(e.output,0)),e.output=[])}},default_tty1_ops:{put_char:function(e,t){null===t||10===t?(err(UTF8ArrayToString(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},flush:function(e){e.output&&e.output.length>0&&(err(UTF8ArrayToString(e.output,0)),e.output=[])}}};function mmapAlloc(e){for(var t=alignMemory(e,16384),r=_malloc(t);e=t)){t=Math.max(t,r*(r<1048576?2:1.125)>>>0),0!=r&&(t=Math.max(t,256));var o=e.contents;e.contents=new Uint8Array(t),e.usedBytes>0&&e.contents.set(o.subarray(0,e.usedBytes),0)}},resizeFileStorage:function(e,t){if(e.usedBytes!=t){if(0==t)return e.contents=null,void(e.usedBytes=0);if(!e.contents||e.contents.subarray){var r=e.contents;return e.contents=new Uint8Array(t),r&&e.contents.set(r.subarray(0,Math.min(t,e.usedBytes))),void(e.usedBytes=t)}if(e.contents||(e.contents=[]),e.contents.length>t)e.contents.length=t;else for(;e.contents.length=e.node.usedBytes)return 0;var i=Math.min(e.node.usedBytes-n,o);if(assert(i>=0),i>8&&a.subarray)t.set(a.subarray(n,n+i),r);else for(var s=0;s0||o+r8)throw new FS.ErrnoError(32);for(var n=PATH.normalizeArray(e.split("/").filter((function(e){return!!e})),!1),a=FS.root,i="/",s=0;s40)throw new FS.ErrnoError(32)}}return{path:i,node:a}},getPath:function(e){for(var t;;){if(FS.isRoot(e)){var r=e.mount.mountpoint;return t?"/"!==r[r.length-1]?r+"/"+t:r+t:r}t=t?e.name+"/"+t:e.name,e=e.parent}},hashName:function(e,t){for(var r=0,o=0;o>>0)%FS.nameTable.length},hashAddNode:function(e){var t=FS.hashName(e.parent.id,e.name);e.name_next=FS.nameTable[t],FS.nameTable[t]=e},hashRemoveNode:function(e){var t=FS.hashName(e.parent.id,e.name);if(FS.nameTable[t]===e)FS.nameTable[t]=e.name_next;else for(var r=FS.nameTable[t];r;){if(r.name_next===e){r.name_next=e.name_next;break}r=r.name_next}},lookupNode:function(e,t){var r=FS.mayLookup(e);if(r)throw new FS.ErrnoError(r,e);for(var o=FS.hashName(e.id,t),n=FS.nameTable[o];n;n=n.name_next){var a=n.name;if(n.parent.id===e.id&&a===t)return n}return FS.lookup(e,t)},createNode:function(e,t,r,o){var n=new FS.FSNode(e,t,r,o);return FS.hashAddNode(n),n},destroyNode:function(e){FS.hashRemoveNode(e)},isRoot:function(e){return e===e.parent},isMountpoint:function(e){return!!e.mounted},isFile:function(e){return 32768==(61440&e)},isDir:function(e){return 16384==(61440&e)},isLink:function(e){return 40960==(61440&e)},isChrdev:function(e){return 8192==(61440&e)},isBlkdev:function(e){return 24576==(61440&e)},isFIFO:function(e){return 4096==(61440&e)},isSocket:function(e){return 49152==(49152&e)},flagModes:{r:0,rs:1052672,"r+":2,w:577,wx:705,xw:705,"w+":578,"wx+":706,"xw+":706,a:1089,ax:1217,xa:1217,"a+":1090,"ax+":1218,"xa+":1218},modeStringToFlags:function(e){var t=FS.flagModes[e];if(void 0===t)throw new Error("Unknown file open mode: "+e);return t},flagsToPermissionString:function(e){var t=["r","w","rw"][3&e];return 512&e&&(t+="w"),t},nodePermissions:function(e,t){return FS.ignorePermissions||(-1===t.indexOf("r")||292&e.mode)&&(-1===t.indexOf("w")||146&e.mode)&&(-1===t.indexOf("x")||73&e.mode)?0:2},mayLookup:function(e){var t=FS.nodePermissions(e,"x");return t||(e.node_ops.lookup?0:2)},mayCreate:function(e,t){try{FS.lookupNode(e,t);return 20}catch(e){}return FS.nodePermissions(e,"wx")},mayDelete:function(e,t,r){var o;try{o=FS.lookupNode(e,t)}catch(e){return e.errno}var n=FS.nodePermissions(e,"wx");if(n)return n;if(r){if(!FS.isDir(o.mode))return 54;if(FS.isRoot(o)||FS.getPath(o)===FS.cwd())return 10}else if(FS.isDir(o.mode))return 31;return 0},mayOpen:function(e,t){return e?FS.isLink(e.mode)?32:FS.isDir(e.mode)&&("r"!==FS.flagsToPermissionString(t)||512&t)?31:FS.nodePermissions(e,FS.flagsToPermissionString(t)):44},MAX_OPEN_FDS:4096,nextfd:function(e,t){e=e||0,t=t||FS.MAX_OPEN_FDS;for(var r=e;r<=t;r++)if(!FS.streams[r])return r;throw new FS.ErrnoError(33)},getStream:function(e){return FS.streams[e]},createStream:function(e,t,r){FS.FSStream||(FS.FSStream=function(){},FS.FSStream.prototype={object:{get:function(){return this.node},set:function(e){this.node=e}},isRead:{get:function(){return 1!=(2097155&this.flags)}},isWrite:{get:function(){return 0!=(2097155&this.flags)}},isAppend:{get:function(){return 1024&this.flags}}});var o=new FS.FSStream;for(var n in e)o[n]=e[n];e=o;var a=FS.nextfd(t,r);return e.fd=a,FS.streams[a]=e,e},closeStream:function(e){FS.streams[e]=null},chrdev_stream_ops:{open:function(e){var t=FS.getDevice(e.node.rdev);e.stream_ops=t.stream_ops,e.stream_ops.open&&e.stream_ops.open(e)},llseek:function(){throw new FS.ErrnoError(70)}},major:function(e){return e>>8},minor:function(e){return 255&e},makedev:function(e,t){return e<<8|t},registerDevice:function(e,t){FS.devices[e]={stream_ops:t}},getDevice:function(e){return FS.devices[e]},getMounts:function(e){for(var t=[],r=[e];r.length;){var o=r.pop();t.push(o),r.push.apply(r,o.mounts)}return t},syncfs:function(e,t){"function"==typeof e&&(t=e,e=!1),FS.syncFSRequests++,FS.syncFSRequests>1&&err("warning: "+FS.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work");var r=FS.getMounts(FS.root.mount),o=0;function n(e){return assert(FS.syncFSRequests>0),FS.syncFSRequests--,t(e)}function a(e){if(e)return a.errored?void 0:(a.errored=!0,n(e));++o>=r.length&&n(null)}r.forEach((function(t){if(!t.type.syncfs)return a(null);t.type.syncfs(t,e,a)}))},mount:function(e,t,r){if("string"==typeof e)throw e;var o,n="/"===r,a=!r;if(n&&FS.root)throw new FS.ErrnoError(10);if(!n&&!a){var i=FS.lookupPath(r,{follow_mount:!1});if(r=i.path,o=i.node,FS.isMountpoint(o))throw new FS.ErrnoError(10);if(!FS.isDir(o.mode))throw new FS.ErrnoError(54)}var s={type:e,opts:t,mountpoint:r,mounts:[]},d=e.mount(s);return d.mount=s,s.root=d,n?FS.root=d:o&&(o.mounted=s,o.mount&&o.mount.mounts.push(s)),d},unmount:function(e){var t=FS.lookupPath(e,{follow_mount:!1});if(!FS.isMountpoint(t.node))throw new FS.ErrnoError(28);var r=t.node,o=r.mounted,n=FS.getMounts(o);Object.keys(FS.nameTable).forEach((function(e){for(var t=FS.nameTable[e];t;){var r=t.name_next;-1!==n.indexOf(t.mount)&&FS.destroyNode(t),t=r}})),r.mounted=null;var a=r.mount.mounts.indexOf(o);assert(-1!==a),r.mount.mounts.splice(a,1)},lookup:function(e,t){return e.node_ops.lookup(e,t)},mknod:function(e,t,r){var o=FS.lookupPath(e,{parent:!0}).node,n=PATH.basename(e);if(!n||"."===n||".."===n)throw new FS.ErrnoError(28);var a=FS.mayCreate(o,n);if(a)throw new FS.ErrnoError(a);if(!o.node_ops.mknod)throw new FS.ErrnoError(63);return o.node_ops.mknod(o,n,t,r)},create:function(e,t){return t=void 0!==t?t:438,t&=4095,t|=32768,FS.mknod(e,t,0)},mkdir:function(e,t){return t=void 0!==t?t:511,t&=1023,t|=16384,FS.mknod(e,t,0)},mkdirTree:function(e,t){for(var r=e.split("/"),o="",n=0;nthis.length-1||e<0)){var t=e%this.chunkSize,r=e/this.chunkSize|0;return this.getter(r)[t]}},a.prototype.setDataGetter=function(e){this.getter=e},a.prototype.cacheLength=function(){var e=new XMLHttpRequest;if(e.open("HEAD",r,!1),e.send(null),!(e.status>=200&&e.status<300||304===e.status))throw new Error("Couldn't load "+r+". Status: "+e.status);var t,o=Number(e.getResponseHeader("Content-length")),n=(t=e.getResponseHeader("Accept-Ranges"))&&"bytes"===t,a=(t=e.getResponseHeader("Content-Encoding"))&&"gzip"===t,i=1048576;n||(i=o);var s=this;s.setDataGetter((function(e){var t=e*i,n=(e+1)*i-1;if(n=Math.min(n,o-1),void 0===s.chunks[e]&&(s.chunks[e]=function(e,t){if(e>t)throw new Error("invalid range ("+e+", "+t+") or no bytes requested!");if(t>o-1)throw new Error("only "+o+" bytes available! programmer error!");var n=new XMLHttpRequest;if(n.open("GET",r,!1),o!==i&&n.setRequestHeader("Range","bytes="+e+"-"+t),"undefined"!=typeof Uint8Array&&(n.responseType="arraybuffer"),n.overrideMimeType&&n.overrideMimeType("text/plain; charset=x-user-defined"),n.send(null),!(n.status>=200&&n.status<300||304===n.status))throw new Error("Couldn't load "+r+". Status: "+n.status);return void 0!==n.response?new Uint8Array(n.response||[]):intArrayFromString(n.responseText||"",!0)}(t,n)),void 0===s.chunks[e])throw new Error("doXHR failed!");return s.chunks[e]})),!a&&o||(i=o=1,o=this.getter(0).length,i=o,out("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=o,this._chunkSize=i,this.lengthKnown=!0},"undefined"!=typeof XMLHttpRequest){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var i=new a;Object.defineProperties(i,{length:{get:function(){return this.lengthKnown||this.cacheLength(),this._length}},chunkSize:{get:function(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}});var s={isDevice:!1,contents:i}}else s={isDevice:!1,url:r};var d=FS.createFile(e,t,s,o,n);s.contents?d.contents=s.contents:s.url&&(d.contents=null,d.url=s.url),Object.defineProperties(d,{usedBytes:{get:function(){return this.contents.length}}});var c={};return Object.keys(d.stream_ops).forEach((function(e){var t=d.stream_ops[e];c[e]=function(){if(!FS.forceLoadFile(d))throw new FS.ErrnoError(29);return t.apply(null,arguments)}})),c.read=function(e,t,r,o,n){if(!FS.forceLoadFile(d))throw new FS.ErrnoError(29);var a=e.node.contents;if(n>=a.length)return 0;var i=Math.min(a.length-n,o);if(assert(i>=0),a.slice)for(var s=0;s>2]=o.dev,HEAP32[r+4>>2]=0,HEAP32[r+8>>2]=o.ino,HEAP32[r+12>>2]=o.mode,HEAP32[r+16>>2]=o.nlink,HEAP32[r+20>>2]=o.uid,HEAP32[r+24>>2]=o.gid,HEAP32[r+28>>2]=o.rdev,HEAP32[r+32>>2]=0,tempI64=[o.size>>>0,(tempDouble=o.size,+Math.abs(tempDouble)>=1?tempDouble>0?(0|Math.min(+Math.floor(tempDouble/4294967296),4294967295))>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[r+40>>2]=tempI64[0],HEAP32[r+44>>2]=tempI64[1],HEAP32[r+48>>2]=4096,HEAP32[r+52>>2]=o.blocks,HEAP32[r+56>>2]=o.atime.getTime()/1e3|0,HEAP32[r+60>>2]=0,HEAP32[r+64>>2]=o.mtime.getTime()/1e3|0,HEAP32[r+68>>2]=0,HEAP32[r+72>>2]=o.ctime.getTime()/1e3|0,HEAP32[r+76>>2]=0,tempI64=[o.ino>>>0,(tempDouble=o.ino,+Math.abs(tempDouble)>=1?tempDouble>0?(0|Math.min(+Math.floor(tempDouble/4294967296),4294967295))>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[r+80>>2]=tempI64[0],HEAP32[r+84>>2]=tempI64[1],0},doMsync:function(e,t,r,o,n){var a=HEAPU8.slice(e,e+r);FS.msync(t,a,n,r,o)},doMkdir:function(e,t){return"/"===(e=PATH.normalize(e))[e.length-1]&&(e=e.substr(0,e.length-1)),FS.mkdir(e,t,0),0},doMknod:function(e,t,r){switch(61440&t){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}return FS.mknod(e,t,r),0},doReadlink:function(e,t,r){if(r<=0)return-28;var o=FS.readlink(e),n=Math.min(r,lengthBytesUTF8(o)),a=HEAP8[t+n];return stringToUTF8(o,t,r+1),HEAP8[t+n]=a,n},doAccess:function(e,t){if(-8&t)return-28;var r;if(!(r=FS.lookupPath(e,{follow:!0}).node))return-44;var o="";return 4&t&&(o+="r"),2&t&&(o+="w"),1&t&&(o+="x"),o&&FS.nodePermissions(r,o)?-2:0},doDup:function(e,t,r){var o=FS.getStream(r);return o&&FS.close(o),FS.open(e,t,0,r,r).fd},doReadv:function(e,t,r,o){for(var n=0,a=0;a>2],s=HEAP32[t+(8*a+4)>>2],d=FS.read(e,HEAP8,i,s,o);if(d<0)return-1;if(n+=d,d>2],s=HEAP32[t+(8*a+4)>>2],d=FS.write(e,HEAP8,i,s,o);if(d<0)return-1;n+=d}return n},varargs:void 0,get:function(){return assert(null!=SYSCALLS.varargs),SYSCALLS.varargs+=4,HEAP32[SYSCALLS.varargs-4>>2]},getStr:function(e){return UTF8ToString(e)},getStreamFromFD:function(e){var t=FS.getStream(e);if(!t)throw new FS.ErrnoError(8);return t},get64:function(e,t){return assert(e>=0?0===t:-1===t),e}};function ___sys_access(e,t){try{return e=SYSCALLS.getStr(e),SYSCALLS.doAccess(e,t)}catch(e){return void 0!==FS&&e instanceof FS.ErrnoError||abort(e),-e.errno}}function ___sys_fcntl64(e,t,r){SYSCALLS.varargs=r;try{var o=SYSCALLS.getStreamFromFD(e);switch(t){case 0:return(n=SYSCALLS.get())<0?-28:FS.open(o.path,o.flags,0,n).fd;case 1:case 2:return 0;case 3:return o.flags;case 4:var n=SYSCALLS.get();return o.flags|=n,0;case 12:n=SYSCALLS.get();return HEAP16[n+0>>1]=2,0;case 13:case 14:return 0;case 16:case 8:return-28;case 9:return setErrNo(28),-1;default:return-28}}catch(e){return void 0!==FS&&e instanceof FS.ErrnoError||abort(e),-e.errno}}function ___sys_fstat64(e,t){try{var r=SYSCALLS.getStreamFromFD(e);return SYSCALLS.doStat(FS.stat,r.path,t)}catch(e){return void 0!==FS&&e instanceof FS.ErrnoError||abort(e),-e.errno}}function ___sys_getcwd(e,t){try{if(0===t)return-28;var r=FS.cwd();return t>>0,(tempDouble=d,+Math.abs(tempDouble)>=1?tempDouble>0?(0|Math.min(+Math.floor(tempDouble/4294967296),4294967295))>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[t+a>>2]=tempI64[0],HEAP32[t+a+4>>2]=tempI64[1],tempI64=[(s+1)*n>>>0,(tempDouble=(s+1)*n,+Math.abs(tempDouble)>=1?tempDouble>0?(0|Math.min(+Math.floor(tempDouble/4294967296),4294967295))>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[t+a+8>>2]=tempI64[0],HEAP32[t+a+12>>2]=tempI64[1],HEAP16[t+a+16>>1]=280,HEAP8[t+a+18>>0]=c,stringToUTF8(u,t+a+19,256),a+=n,s+=1}return FS.llseek(o,s*n,0),a}catch(e){return void 0!==FS&&e instanceof FS.ErrnoError||abort(e),-e.errno}}function ___sys_getegid32(){return 0}function ___sys_geteuid32(){return ___sys_getegid32()}function ___sys_getgid32(){return ___sys_getegid32()}function ___sys_getpid(){return 42}function ___sys_getuid32(){return ___sys_getegid32()}function ___sys_ioctl(e,t,r){SYSCALLS.varargs=r;try{var o=SYSCALLS.getStreamFromFD(e);switch(t){case 21509:case 21505:return o.tty?0:-59;case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:return o.tty?0:-59;case 21519:if(!o.tty)return-59;var n=SYSCALLS.get();return HEAP32[n>>2]=0,0;case 21520:return o.tty?-28:-59;case 21531:n=SYSCALLS.get();return FS.ioctl(o,t,n);case 21523:case 21524:return o.tty?0:-59;default:abort("bad ioctl syscall "+t)}}catch(e){return void 0!==FS&&e instanceof FS.ErrnoError||abort(e),-e.errno}}function ___sys_mkdir(e,t){try{return e=SYSCALLS.getStr(e),SYSCALLS.doMkdir(e,t)}catch(e){return void 0!==FS&&e instanceof FS.ErrnoError||abort(e),-e.errno}}function syscallMunmap(e,t){if(-1==(0|e)||0===t)return-28;var r=SYSCALLS.mappings[e];if(!r)return 0;if(t===r.len){var o=FS.getStream(r.fd);2&r.prot&&SYSCALLS.doMsync(e,o,t,r.flags,r.offset),FS.munmap(o),SYSCALLS.mappings[e]=null,r.allocated&&_free(r.malloc)}return 0}function ___sys_munmap(e,t){try{return syscallMunmap(e,t)}catch(e){return void 0!==FS&&e instanceof FS.ErrnoError||abort(e),-e.errno}}function ___sys_open(e,t,r){SYSCALLS.varargs=r;try{var o=SYSCALLS.getStr(e),n=SYSCALLS.get();return FS.open(o,t,n).fd}catch(e){return void 0!==FS&&e instanceof FS.ErrnoError||abort(e),-e.errno}}function ___sys_read(e,t,r){try{var o=SYSCALLS.getStreamFromFD(e);return FS.read(o,HEAP8,t,r)}catch(e){return void 0!==FS&&e instanceof FS.ErrnoError||abort(e),-e.errno}}function ___sys_stat64(e,t){try{return e=SYSCALLS.getStr(e),SYSCALLS.doStat(FS.stat,e,t)}catch(e){return void 0!==FS&&e instanceof FS.ErrnoError||abort(e),-e.errno}}function _abort(){abort()}function _clock(){return void 0===_clock.start&&(_clock.start=Date.now()),1e3*(Date.now()-_clock.start)|0}_emscripten_get_now=ENVIRONMENT_IS_NODE?function(){var e=process.hrtime();return 1e3*e[0]+e[1]/1e6}:"undefined"!=typeof dateNow?dateNow:function(){return performance.now()};var _emscripten_get_now_is_monotonic=!0;function _clock_gettime(e,t){var r;if(0===e)r=Date.now();else{if(1!==e&&4!==e||!_emscripten_get_now_is_monotonic)return setErrNo(28),-1;r=_emscripten_get_now()}return HEAP32[t>>2]=r/1e3|0,HEAP32[t+4>>2]=r%1e3*1e3*1e3|0,0}function _emscripten_memcpy_big(e,t,r){HEAPU8.copyWithin(e,t,t+r)}function _emscripten_get_heap_size(){return HEAPU8.length}function emscripten_realloc_buffer(e){try{return wasmMemory.grow(e-buffer.byteLength+65535>>>16),updateGlobalBufferAndViews(wasmMemory.buffer),1}catch(t){console.error("emscripten_realloc_buffer: Attempted to grow heap from "+buffer.byteLength+" bytes to "+e+" bytes, but got error: "+t)}}function _emscripten_resize_heap(e){e>>>=0;var t=_emscripten_get_heap_size();assert(e>t);var r=2147483648;if(e>r)return err("Cannot enlarge memory, asked to go up to "+e+" bytes, but the limit is "+"2147483648 bytes!"),!1;for(var o=1;o<=4;o*=2){var n=t*(1+.2/o);n=Math.min(n,e+100663296);var a=Math.min(r,alignUp(Math.max(16777216,e,n),65536));if(emscripten_realloc_buffer(a))return!0}return err("Failed to grow the heap from "+t+" bytes to "+a+" bytes, not enough memory!"),!1}var ENV={};function getExecutableName(){return thisProgram||"./this.program"}function getEnvStrings(){if(!getEnvStrings.strings){var e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:getExecutableName()};for(var t in ENV)e[t]=ENV[t];var r=[];for(var t in e)r.push(t+"="+e[t]);getEnvStrings.strings=r}return getEnvStrings.strings}function _environ_get(e,t){var r=0;return getEnvStrings().forEach((function(o,n){var a=t+r;HEAP32[e+4*n>>2]=a,writeAsciiToMemory(o,a),r+=o.length+1})),0}function _environ_sizes_get(e,t){var r=getEnvStrings();HEAP32[e>>2]=r.length;var o=0;return r.forEach((function(e){o+=e.length+1})),HEAP32[t>>2]=o,0}function _fd_close(e){try{var t=SYSCALLS.getStreamFromFD(e);return FS.close(t),0}catch(e){return void 0!==FS&&e instanceof FS.ErrnoError||abort(e),e.errno}}function _fd_fdstat_get(e,t){try{var r=SYSCALLS.getStreamFromFD(e),o=r.tty?2:FS.isDir(r.mode)?3:FS.isLink(r.mode)?7:4;return HEAP8[t>>0]=o,0}catch(e){return void 0!==FS&&e instanceof FS.ErrnoError||abort(e),e.errno}}function _fd_read(e,t,r,o){try{var n=SYSCALLS.getStreamFromFD(e),a=SYSCALLS.doReadv(n,t,r);return HEAP32[o>>2]=a,0}catch(e){return void 0!==FS&&e instanceof FS.ErrnoError||abort(e),e.errno}}function _fd_seek(e,t,r,o,n){try{var a=SYSCALLS.getStreamFromFD(e),i=4294967296*r+(t>>>0),s=9007199254740992;return i<=-s||i>=s?-61:(FS.llseek(a,i,o),tempI64=[a.position>>>0,(tempDouble=a.position,+Math.abs(tempDouble)>=1?tempDouble>0?(0|Math.min(+Math.floor(tempDouble/4294967296),4294967295))>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[n>>2]=tempI64[0],HEAP32[n+4>>2]=tempI64[1],a.getdents&&0===i&&0===o&&(a.getdents=null),0)}catch(e){return void 0!==FS&&e instanceof FS.ErrnoError||abort(e),e.errno}}function _fd_write(e,t,r,o){try{var n=SYSCALLS.getStreamFromFD(e),a=SYSCALLS.doWritev(n,t,r);return HEAP32[o>>2]=a,0}catch(e){return void 0!==FS&&e instanceof FS.ErrnoError||abort(e),e.errno}}function _gettimeofday(e){var t=Date.now();return HEAP32[e>>2]=t/1e3|0,HEAP32[e+4>>2]=t%1e3*1e3|0,0}function _gmtime_r(e,t){var r=new Date(1e3*HEAP32[e>>2]);HEAP32[t>>2]=r.getUTCSeconds(),HEAP32[t+4>>2]=r.getUTCMinutes(),HEAP32[t+8>>2]=r.getUTCHours(),HEAP32[t+12>>2]=r.getUTCDate(),HEAP32[t+16>>2]=r.getUTCMonth(),HEAP32[t+20>>2]=r.getUTCFullYear()-1900,HEAP32[t+24>>2]=r.getUTCDay(),HEAP32[t+36>>2]=0,HEAP32[t+32>>2]=0;var o=Date.UTC(r.getUTCFullYear(),0,1,0,0,0,0),n=(r.getTime()-o)/864e5|0;return HEAP32[t+28>>2]=n,_gmtime_r.GMTString||(_gmtime_r.GMTString=allocateUTF8("GMT")),HEAP32[t+40>>2]=_gmtime_r.GMTString,t}function _mktime(e){_tzset();var t=new Date(HEAP32[e+20>>2]+1900,HEAP32[e+16>>2],HEAP32[e+12>>2],HEAP32[e+8>>2],HEAP32[e+4>>2],HEAP32[e>>2],0),r=HEAP32[e+32>>2],o=t.getTimezoneOffset(),n=new Date(t.getFullYear(),0,1),a=new Date(t.getFullYear(),6,1).getTimezoneOffset(),i=n.getTimezoneOffset(),s=Math.min(i,a);if(r<0)HEAP32[e+32>>2]=Number(a!=i&&s==o);else if(r>0!=(s==o)){var d=Math.max(i,a),c=r>0?s:d;t.setTime(t.getTime()+6e4*(c-o))}HEAP32[e+24>>2]=t.getDay();var u=(t.getTime()-n.getTime())/864e5|0;return HEAP32[e+28>>2]=u,t.getTime()/1e3|0}function _pthread_create(){return 6}function _pthread_join(){}function _pthread_mutexattr_destroy(){}function _pthread_mutexattr_init(){}function _pthread_mutexattr_settype(){}function _pthread_rwlock_destroy(){return 0}function _pthread_rwlock_init(){return 0}function _pthread_rwlock_rdlock(){return 0}function _pthread_rwlock_unlock(){return 0}function _pthread_rwlock_wrlock(){return 0}function _setTempRet0(e){setTempRet0(0|e)}function __isLeapYear(e){return e%4==0&&(e%100!=0||e%400==0)}function __arraySum(e,t){for(var r=0,o=0;o<=t;r+=e[o++]);return r}var __MONTH_DAYS_LEAP=[31,29,31,30,31,30,31,31,30,31,30,31],__MONTH_DAYS_REGULAR=[31,28,31,30,31,30,31,31,30,31,30,31];function __addDays(e,t){for(var r=new Date(e.getTime());t>0;){var o=__isLeapYear(r.getFullYear()),n=r.getMonth(),a=(o?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR)[n];if(!(t>a-r.getDate()))return r.setDate(r.getDate()+t),r;t-=a-r.getDate()+1,r.setDate(1),n<11?r.setMonth(n+1):(r.setMonth(0),r.setFullYear(r.getFullYear()+1))}return r}function _strftime(e,t,r,o){var n=HEAP32[o+40>>2],a={tm_sec:HEAP32[o>>2],tm_min:HEAP32[o+4>>2],tm_hour:HEAP32[o+8>>2],tm_mday:HEAP32[o+12>>2],tm_mon:HEAP32[o+16>>2],tm_year:HEAP32[o+20>>2],tm_wday:HEAP32[o+24>>2],tm_yday:HEAP32[o+28>>2],tm_isdst:HEAP32[o+32>>2],tm_gmtoff:HEAP32[o+36>>2],tm_zone:n?UTF8ToString(n):""},i=UTF8ToString(r),s={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var d in s)i=i.replace(new RegExp(d,"g"),s[d]);var c=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],u=["January","February","March","April","May","June","July","August","September","October","November","December"];function l(e,t,r){for(var o="number"==typeof e?e.toString():e||"";o.length0?1:0}var o;return 0===(o=r(e.getFullYear()-t.getFullYear()))&&0===(o=r(e.getMonth()-t.getMonth()))&&(o=r(e.getDate()-t.getDate())),o}function _(e){switch(e.getDay()){case 0:return new Date(e.getFullYear()-1,11,29);case 1:return e;case 2:return new Date(e.getFullYear(),0,3);case 3:return new Date(e.getFullYear(),0,2);case 4:return new Date(e.getFullYear(),0,1);case 5:return new Date(e.getFullYear()-1,11,31);case 6:return new Date(e.getFullYear()-1,11,30)}}function f(e){var t=__addDays(new Date(e.tm_year+1900,0,1),e.tm_yday),r=new Date(t.getFullYear(),0,4),o=new Date(t.getFullYear()+1,0,4),n=_(r),a=_(o);return p(n,t)<=0?p(a,t)<=0?t.getFullYear()+1:t.getFullYear():t.getFullYear()-1}var S={"%a":function(e){return c[e.tm_wday].substring(0,3)},"%A":function(e){return c[e.tm_wday]},"%b":function(e){return u[e.tm_mon].substring(0,3)},"%B":function(e){return u[e.tm_mon]},"%C":function(e){return E((e.tm_year+1900)/100|0,2)},"%d":function(e){return E(e.tm_mday,2)},"%e":function(e){return l(e.tm_mday,2," ")},"%g":function(e){return f(e).toString().substring(2)},"%G":function(e){return f(e)},"%H":function(e){return E(e.tm_hour,2)},"%I":function(e){var t=e.tm_hour;return 0==t?t=12:t>12&&(t-=12),E(t,2)},"%j":function(e){return E(e.tm_mday+__arraySum(__isLeapYear(e.tm_year+1900)?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,e.tm_mon-1),3)},"%m":function(e){return E(e.tm_mon+1,2)},"%M":function(e){return E(e.tm_min,2)},"%n":function(){return"\n"},"%p":function(e){return e.tm_hour>=0&&e.tm_hour<12?"AM":"PM"},"%S":function(e){return E(e.tm_sec,2)},"%t":function(){return"\t"},"%u":function(e){return e.tm_wday||7},"%U":function(e){var t=new Date(e.tm_year+1900,0,1),r=0===t.getDay()?t:__addDays(t,7-t.getDay()),o=new Date(e.tm_year+1900,e.tm_mon,e.tm_mday);if(p(r,o)<0){var n=__arraySum(__isLeapYear(o.getFullYear())?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,o.getMonth()-1)-31,a=31-r.getDate()+n+o.getDate();return E(Math.ceil(a/7),2)}return 0===p(r,t)?"01":"00"},"%V":function(e){var t,r=new Date(e.tm_year+1900,0,4),o=new Date(e.tm_year+1901,0,4),n=_(r),a=_(o),i=__addDays(new Date(e.tm_year+1900,0,1),e.tm_yday);return p(i,n)<0?"53":p(a,i)<=0?"01":(t=n.getFullYear()=0;return t=(t=Math.abs(t)/60)/60*100+t%60,(r?"+":"-")+String("0000"+t).slice(-4)},"%Z":function(e){return e.tm_zone},"%%":function(){return"%"}};for(var d in S)i.indexOf(d)>=0&&(i=i.replace(new RegExp(d,"g"),S[d](a)));var T=intArrayFromString(i,!1);return T.length>t?0:(writeArrayToMemory(T,e),T.length-1)}function _sysconf(e){switch(e){case 30:return 16384;case 85:return 131072;case 132:case 133:case 12:case 137:case 138:case 15:case 235:case 16:case 17:case 18:case 19:case 20:case 149:case 13:case 10:case 236:case 153:case 9:case 21:case 22:case 159:case 154:case 14:case 77:case 78:case 139:case 80:case 81:case 82:case 68:case 67:case 164:case 11:case 29:case 47:case 48:case 95:case 52:case 51:case 46:case 79:return 200809;case 27:case 246:case 127:case 128:case 23:case 24:case 160:case 161:case 181:case 182:case 242:case 183:case 184:case 243:case 244:case 245:case 165:case 178:case 179:case 49:case 50:case 168:case 169:case 175:case 170:case 171:case 172:case 97:case 76:case 32:case 173:case 35:return-1;case 176:case 177:case 7:case 155:case 8:case 157:case 125:case 126:case 92:case 93:case 129:case 130:case 131:case 94:case 91:return 1;case 74:case 60:case 69:case 70:case 4:return 1024;case 31:case 42:case 72:return 32;case 87:case 26:case 33:return 2147483647;case 34:case 1:return 47839;case 38:case 36:return 99;case 43:case 37:return 2048;case 0:return 2097152;case 3:return 65536;case 28:return 32768;case 44:return 32767;case 75:return 16384;case 39:return 1e3;case 89:return 700;case 71:return 256;case 40:return 255;case 2:return 100;case 180:return 64;case 25:return 20;case 5:return 16;case 6:return 6;case 73:return 4;case 84:return"object"==typeof navigator&&navigator.hardwareConcurrency||1}return setErrNo(28),-1}function _time(e){var t=Date.now()/1e3|0;return e&&(HEAP32[e>>2]=t),t}var FSNode=function(e,t,r,o){e||(e=this),this.parent=e,this.mount=e.mount,this.mounted=null,this.id=FS.nextInode++,this.name=t,this.mode=r,this.node_ops={},this.stream_ops={},this.rdev=o},readMode=365,writeMode=146;Object.defineProperties(FSNode.prototype,{read:{get:function(){return(this.mode&readMode)===readMode},set:function(e){e?this.mode|=readMode:this.mode&=~readMode}},write:{get:function(){return(this.mode&writeMode)===writeMode},set:function(e){e?this.mode|=writeMode:this.mode&=~writeMode}},isFolder:{get:function(){return FS.isDir(this.mode)}},isDevice:{get:function(){return FS.isChrdev(this.mode)}}}),FS.FSNode=FSNode,FS.staticInit(),Module.FS_createPath=FS.createPath,Module.FS_createDataFile=FS.createDataFile,Module.FS_createPreloadedFile=FS.createPreloadedFile,Module.FS_createLazyFile=FS.createLazyFile,Module.FS_createDevice=FS.createDevice,Module.FS_unlink=FS.unlink;var ASSERTIONS=!0;function intArrayFromString(e,t,r){var o=r>0?r:lengthBytesUTF8(e)+1,n=new Array(o),a=stringToUTF8Array(e,n,0,n.length);return t&&(n.length=a),n}__ATINIT__.push({func:function(){___wasm_call_ctors()}});var calledRun,asmLibraryArg={__assert_fail:___assert_fail,__cxa_atexit:___cxa_atexit,__localtime_r:___localtime_r,__sys_access:___sys_access,__sys_fcntl64:___sys_fcntl64,__sys_fstat64:___sys_fstat64,__sys_getcwd:___sys_getcwd,__sys_getdents64:___sys_getdents64,__sys_getegid32:___sys_getegid32,__sys_geteuid32:___sys_geteuid32,__sys_getgid32:___sys_getgid32,__sys_getpid:___sys_getpid,__sys_getuid32:___sys_getuid32,__sys_ioctl:___sys_ioctl,__sys_mkdir:___sys_mkdir,__sys_munmap:___sys_munmap,__sys_open:___sys_open,__sys_read:___sys_read,__sys_stat64:___sys_stat64,abort:_abort,atexit:_atexit,clock:_clock,clock_gettime:_clock_gettime,emscripten_memcpy_big:_emscripten_memcpy_big,emscripten_resize_heap:_emscripten_resize_heap,environ_get:_environ_get,environ_sizes_get:_environ_sizes_get,fd_close:_fd_close,fd_fdstat_get:_fd_fdstat_get,fd_read:_fd_read,fd_seek:_fd_seek,fd_write:_fd_write,gettimeofday:_gettimeofday,gmtime_r:_gmtime_r,localtime_r:_localtime_r,memory:wasmMemory,mktime:_mktime,pthread_create:_pthread_create,pthread_join:_pthread_join,pthread_mutexattr_destroy:_pthread_mutexattr_destroy,pthread_mutexattr_init:_pthread_mutexattr_init,pthread_mutexattr_settype:_pthread_mutexattr_settype,pthread_rwlock_destroy:_pthread_rwlock_destroy,pthread_rwlock_init:_pthread_rwlock_init,pthread_rwlock_rdlock:_pthread_rwlock_rdlock,pthread_rwlock_unlock:_pthread_rwlock_unlock,pthread_rwlock_wrlock:_pthread_rwlock_wrlock,setTempRet0:_setTempRet0,strftime:_strftime,sysconf:_sysconf,time:_time},asm=createWasm(),___wasm_call_ctors=Module.___wasm_call_ctors=createExportWrapper("__wasm_call_ctors"),_free=Module._free=createExportWrapper("free"),_malloc=Module._malloc=createExportWrapper("malloc"),_memset=Module._memset=createExportWrapper("memset"),_memcpy=Module._memcpy=createExportWrapper("memcpy"),_initDecoder=Module._initDecoder=createExportWrapper("initDecoder"),_setLiveParam=Module._setLiveParam=createExportWrapper("setLiveParam"),_uninitDecoder=Module._uninitDecoder=createExportWrapper("uninitDecoder"),_closeDecoder=Module._closeDecoder=createExportWrapper("closeDecoder"),_ntohs=Module._ntohs=createExportWrapper("ntohs"),_getVideoParam=Module._getVideoParam=createExportWrapper("getVideoParam"),_getAudioParam=Module._getAudioParam=createExportWrapper("getAudioParam"),_openDecoder=Module._openDecoder=createExportWrapper("openDecoder"),_sendData=Module._sendData=createExportWrapper("sendData"),_decodeOnePacket=Module._decodeOnePacket=createExportWrapper("decodeOnePacket"),_getHeartbeatPing=Module._getHeartbeatPing=createExportWrapper("getHeartbeatPing"),_getHandshakeReq=Module._getHandshakeReq=createExportWrapper("getHandshakeReq"),_getSetPlaybackStartPosReq=Module._getSetPlaybackStartPosReq=createExportWrapper("getSetPlaybackStartPosReq"),_getSetPlayBackStartTimeReq=Module._getSetPlayBackStartTimeReq=createExportWrapper("getSetPlayBackStartTimeReq"),_getSetPlayBackSpeedReq=Module._getSetPlayBackSpeedReq=createExportWrapper("getSetPlayBackSpeedReq"),_getSetPlayBackStartReq=Module._getSetPlayBackStartReq=createExportWrapper("getSetPlayBackStartReq"),_getReqIFrame=Module._getReqIFrame=createExportWrapper("getReqIFrame"),_resetDecoderFifo=Module._resetDecoderFifo=createExportWrapper("resetDecoderFifo"),_setPlayMode=Module._setPlayMode=createExportWrapper("setPlayMode"),_setCipherInfo=Module._setCipherInfo=createExportWrapper("setCipherInfo"),_setRecordCallback=Module._setRecordCallback=createExportWrapper("setRecordCallback"),_recoderStart=Module._recoderStart=createExportWrapper("recoderStart"),_recoderPause=Module._recoderPause=createExportWrapper("recoderPause"),_initTalkEncoder=Module._initTalkEncoder=createExportWrapper("initTalkEncoder"),_closeTalkEncoder=Module._closeTalkEncoder=createExportWrapper("closeTalkEncoder"),_uninitTalkDecoder=Module._uninitTalkDecoder=createExportWrapper("uninitTalkDecoder"),_getTalkStartReq=Module._getTalkStartReq=createExportWrapper("getTalkStartReq"),_getTalkStopReq=Module._getTalkStopReq=createExportWrapper("getTalkStopReq"),_startTalkEncoder=Module._startTalkEncoder=createExportWrapper("startTalkEncoder"),_sendTalkData=Module._sendTalkData=createExportWrapper("sendTalkData"),_getAudioData=Module._getAudioData=createExportWrapper("getAudioData"),___errno_location=Module.___errno_location=createExportWrapper("__errno_location"),_fflush=Module._fflush=createExportWrapper("fflush"),_htons=Module._htons=createExportWrapper("htons"),_htonl=Module._htonl=createExportWrapper("htonl"),__get_tzname=Module.__get_tzname=createExportWrapper("_get_tzname"),__get_daylight=Module.__get_daylight=createExportWrapper("_get_daylight"),__get_timezone=Module.__get_timezone=createExportWrapper("_get_timezone"),stackSave=Module.stackSave=createExportWrapper("stackSave"),stackRestore=Module.stackRestore=createExportWrapper("stackRestore"),stackAlloc=Module.stackAlloc=createExportWrapper("stackAlloc"),_memalign=Module._memalign=createExportWrapper("memalign"),_emscripten_main_thread_process_queued_calls=Module._emscripten_main_thread_process_queued_calls=createExportWrapper("emscripten_main_thread_process_queued_calls"),dynCall_iiij=Module.dynCall_iiij=createExportWrapper("dynCall_iiij"),dynCall_iij=Module.dynCall_iij=createExportWrapper("dynCall_iij"),dynCall_ji=Module.dynCall_ji=createExportWrapper("dynCall_ji"),dynCall_iiijiijii=Module.dynCall_iiijiijii=createExportWrapper("dynCall_iiijiijii"),dynCall_iiiiijii=Module.dynCall_iiiiijii=createExportWrapper("dynCall_iiiiijii"),dynCall_viiijj=Module.dynCall_viiijj=createExportWrapper("dynCall_viiijj"),dynCall_jij=Module.dynCall_jij=createExportWrapper("dynCall_jij"),dynCall_jii=Module.dynCall_jii=createExportWrapper("dynCall_jii"),dynCall_jiji=Module.dynCall_jiji=createExportWrapper("dynCall_jiji"),_ff_h264_cabac_tables=Module._ff_h264_cabac_tables=252550;function ExitStatus(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}function run(e){function t(){calledRun||(calledRun=!0,Module.calledRun=!0,ABORT||(initRuntime(),preMain(),Module.onRuntimeInitialized&&Module.onRuntimeInitialized(),assert(!Module._main,'compiled without a main, but one is present. if you added it from JS, use Module["onRuntimeInitialized"]'),postRun()))}e=e||arguments_,runDependencies>0||(writeStackCookie(),preRun(),runDependencies>0||(Module.setStatus?(Module.setStatus("Running..."),setTimeout((function(){setTimeout((function(){Module.setStatus("")}),1),t()}),1)):t(),checkStackCookie()))}function checkUnflushedContent(){var e=out,t=err,r=!1;out=err=function(e){r=!0};try{var o=Module._fflush;o&&o(0),["stdout","stderr"].forEach((function(e){var t=FS.analyzePath("/dev/"+e);if(t){var o=t.object.rdev,n=TTY.ttys[o];n&&n.output&&n.output.length&&(r=!0)}}))}catch(e){}out=e,err=t,r&&warnOnce("stdio streams had content in them that was not flushed. you should set EXIT_RUNTIME to 1 (see the FAQ), or make sure to emit a newline when you printf etc.")}if(Object.getOwnPropertyDescriptor(Module,"intArrayFromString")||(Module.intArrayFromString=function(){abort("'intArrayFromString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"intArrayToString")||(Module.intArrayToString=function(){abort("'intArrayToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"ccall")||(Module.ccall=function(){abort("'ccall' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"cwrap")||(Module.cwrap=function(){abort("'cwrap' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"setValue")||(Module.setValue=function(){abort("'setValue' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"getValue")||(Module.getValue=function(){abort("'getValue' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"allocate")||(Module.allocate=function(){abort("'allocate' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"UTF8ArrayToString")||(Module.UTF8ArrayToString=function(){abort("'UTF8ArrayToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"UTF8ToString")||(Module.UTF8ToString=function(){abort("'UTF8ToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"stringToUTF8Array")||(Module.stringToUTF8Array=function(){abort("'stringToUTF8Array' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"stringToUTF8")||(Module.stringToUTF8=function(){abort("'stringToUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"lengthBytesUTF8")||(Module.lengthBytesUTF8=function(){abort("'lengthBytesUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"stackTrace")||(Module.stackTrace=function(){abort("'stackTrace' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"addOnPreRun")||(Module.addOnPreRun=function(){abort("'addOnPreRun' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"addOnInit")||(Module.addOnInit=function(){abort("'addOnInit' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"addOnPreMain")||(Module.addOnPreMain=function(){abort("'addOnPreMain' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"addOnExit")||(Module.addOnExit=function(){abort("'addOnExit' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"addOnPostRun")||(Module.addOnPostRun=function(){abort("'addOnPostRun' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"writeStringToMemory")||(Module.writeStringToMemory=function(){abort("'writeStringToMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"writeArrayToMemory")||(Module.writeArrayToMemory=function(){abort("'writeArrayToMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"writeAsciiToMemory")||(Module.writeAsciiToMemory=function(){abort("'writeAsciiToMemory' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Module.addRunDependency=addRunDependency,Module.removeRunDependency=removeRunDependency,Object.getOwnPropertyDescriptor(Module,"FS_createFolder")||(Module.FS_createFolder=function(){abort("'FS_createFolder' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Module.FS_createPath=FS.createPath,Module.FS_createDataFile=FS.createDataFile,Module.FS_createPreloadedFile=FS.createPreloadedFile,Module.FS_createLazyFile=FS.createLazyFile,Object.getOwnPropertyDescriptor(Module,"FS_createLink")||(Module.FS_createLink=function(){abort("'FS_createLink' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Module.FS_createDevice=FS.createDevice,Module.FS_unlink=FS.unlink,Object.getOwnPropertyDescriptor(Module,"getLEB")||(Module.getLEB=function(){abort("'getLEB' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"getFunctionTables")||(Module.getFunctionTables=function(){abort("'getFunctionTables' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"alignFunctionTables")||(Module.alignFunctionTables=function(){abort("'alignFunctionTables' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"registerFunctions")||(Module.registerFunctions=function(){abort("'registerFunctions' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Module.addFunction=addFunction,Object.getOwnPropertyDescriptor(Module,"removeFunction")||(Module.removeFunction=function(){abort("'removeFunction' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"getFuncWrapper")||(Module.getFuncWrapper=function(){abort("'getFuncWrapper' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"prettyPrint")||(Module.prettyPrint=function(){abort("'prettyPrint' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"makeBigInt")||(Module.makeBigInt=function(){abort("'makeBigInt' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"dynCall")||(Module.dynCall=function(){abort("'dynCall' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"getCompilerSetting")||(Module.getCompilerSetting=function(){abort("'getCompilerSetting' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"print")||(Module.print=function(){abort("'print' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"printErr")||(Module.printErr=function(){abort("'printErr' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"getTempRet0")||(Module.getTempRet0=function(){abort("'getTempRet0' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"setTempRet0")||(Module.setTempRet0=function(){abort("'setTempRet0' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"callMain")||(Module.callMain=function(){abort("'callMain' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"abort")||(Module.abort=function(){abort("'abort' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"stringToNewUTF8")||(Module.stringToNewUTF8=function(){abort("'stringToNewUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"emscripten_realloc_buffer")||(Module.emscripten_realloc_buffer=function(){abort("'emscripten_realloc_buffer' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"ENV")||(Module.ENV=function(){abort("'ENV' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"ERRNO_CODES")||(Module.ERRNO_CODES=function(){abort("'ERRNO_CODES' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"ERRNO_MESSAGES")||(Module.ERRNO_MESSAGES=function(){abort("'ERRNO_MESSAGES' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"setErrNo")||(Module.setErrNo=function(){abort("'setErrNo' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"DNS")||(Module.DNS=function(){abort("'DNS' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"getHostByName")||(Module.getHostByName=function(){abort("'getHostByName' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"GAI_ERRNO_MESSAGES")||(Module.GAI_ERRNO_MESSAGES=function(){abort("'GAI_ERRNO_MESSAGES' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"Protocols")||(Module.Protocols=function(){abort("'Protocols' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"Sockets")||(Module.Sockets=function(){abort("'Sockets' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"getRandomDevice")||(Module.getRandomDevice=function(){abort("'getRandomDevice' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"traverseStack")||(Module.traverseStack=function(){abort("'traverseStack' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"UNWIND_CACHE")||(Module.UNWIND_CACHE=function(){abort("'UNWIND_CACHE' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"withBuiltinMalloc")||(Module.withBuiltinMalloc=function(){abort("'withBuiltinMalloc' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"readAsmConstArgsArray")||(Module.readAsmConstArgsArray=function(){abort("'readAsmConstArgsArray' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"readAsmConstArgs")||(Module.readAsmConstArgs=function(){abort("'readAsmConstArgs' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"mainThreadEM_ASM")||(Module.mainThreadEM_ASM=function(){abort("'mainThreadEM_ASM' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"jstoi_q")||(Module.jstoi_q=function(){abort("'jstoi_q' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"jstoi_s")||(Module.jstoi_s=function(){abort("'jstoi_s' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"getExecutableName")||(Module.getExecutableName=function(){abort("'getExecutableName' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"listenOnce")||(Module.listenOnce=function(){abort("'listenOnce' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"autoResumeAudioContext")||(Module.autoResumeAudioContext=function(){abort("'autoResumeAudioContext' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"dynCallLegacy")||(Module.dynCallLegacy=function(){abort("'dynCallLegacy' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"getDynCaller")||(Module.getDynCaller=function(){abort("'getDynCaller' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"dynCall")||(Module.dynCall=function(){abort("'dynCall' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"callRuntimeCallbacks")||(Module.callRuntimeCallbacks=function(){abort("'callRuntimeCallbacks' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"abortStackOverflow")||(Module.abortStackOverflow=function(){abort("'abortStackOverflow' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"reallyNegative")||(Module.reallyNegative=function(){abort("'reallyNegative' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"unSign")||(Module.unSign=function(){abort("'unSign' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"reSign")||(Module.reSign=function(){abort("'reSign' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"formatString")||(Module.formatString=function(){abort("'formatString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"PATH")||(Module.PATH=function(){abort("'PATH' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"PATH_FS")||(Module.PATH_FS=function(){abort("'PATH_FS' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"SYSCALLS")||(Module.SYSCALLS=function(){abort("'SYSCALLS' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"syscallMmap2")||(Module.syscallMmap2=function(){abort("'syscallMmap2' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"syscallMunmap")||(Module.syscallMunmap=function(){abort("'syscallMunmap' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"JSEvents")||(Module.JSEvents=function(){abort("'JSEvents' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"specialHTMLTargets")||(Module.specialHTMLTargets=function(){abort("'specialHTMLTargets' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"maybeCStringToJsString")||(Module.maybeCStringToJsString=function(){abort("'maybeCStringToJsString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"findEventTarget")||(Module.findEventTarget=function(){abort("'findEventTarget' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"findCanvasEventTarget")||(Module.findCanvasEventTarget=function(){abort("'findCanvasEventTarget' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"polyfillSetImmediate")||(Module.polyfillSetImmediate=function(){abort("'polyfillSetImmediate' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"demangle")||(Module.demangle=function(){abort("'demangle' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"demangleAll")||(Module.demangleAll=function(){abort("'demangleAll' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"jsStackTrace")||(Module.jsStackTrace=function(){abort("'jsStackTrace' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"stackTrace")||(Module.stackTrace=function(){abort("'stackTrace' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"getEnvStrings")||(Module.getEnvStrings=function(){abort("'getEnvStrings' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"checkWasiClock")||(Module.checkWasiClock=function(){abort("'checkWasiClock' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"writeI53ToI64")||(Module.writeI53ToI64=function(){abort("'writeI53ToI64' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"writeI53ToI64Clamped")||(Module.writeI53ToI64Clamped=function(){abort("'writeI53ToI64Clamped' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"writeI53ToI64Signaling")||(Module.writeI53ToI64Signaling=function(){abort("'writeI53ToI64Signaling' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"writeI53ToU64Clamped")||(Module.writeI53ToU64Clamped=function(){abort("'writeI53ToU64Clamped' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"writeI53ToU64Signaling")||(Module.writeI53ToU64Signaling=function(){abort("'writeI53ToU64Signaling' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"readI53FromI64")||(Module.readI53FromI64=function(){abort("'readI53FromI64' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"readI53FromU64")||(Module.readI53FromU64=function(){abort("'readI53FromU64' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"convertI32PairToI53")||(Module.convertI32PairToI53=function(){abort("'convertI32PairToI53' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"convertU32PairToI53")||(Module.convertU32PairToI53=function(){abort("'convertU32PairToI53' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"exceptionLast")||(Module.exceptionLast=function(){abort("'exceptionLast' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"exceptionCaught")||(Module.exceptionCaught=function(){abort("'exceptionCaught' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"ExceptionInfoAttrs")||(Module.ExceptionInfoAttrs=function(){abort("'ExceptionInfoAttrs' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"ExceptionInfo")||(Module.ExceptionInfo=function(){abort("'ExceptionInfo' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"CatchInfo")||(Module.CatchInfo=function(){abort("'CatchInfo' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"exception_addRef")||(Module.exception_addRef=function(){abort("'exception_addRef' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"exception_decRef")||(Module.exception_decRef=function(){abort("'exception_decRef' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"Browser")||(Module.Browser=function(){abort("'Browser' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"funcWrappers")||(Module.funcWrappers=function(){abort("'funcWrappers' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"getFuncWrapper")||(Module.getFuncWrapper=function(){abort("'getFuncWrapper' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"setMainLoop")||(Module.setMainLoop=function(){abort("'setMainLoop' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"FS")||(Module.FS=function(){abort("'FS' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"mmapAlloc")||(Module.mmapAlloc=function(){abort("'mmapAlloc' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"MEMFS")||(Module.MEMFS=function(){abort("'MEMFS' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"TTY")||(Module.TTY=function(){abort("'TTY' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"PIPEFS")||(Module.PIPEFS=function(){abort("'PIPEFS' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"SOCKFS")||(Module.SOCKFS=function(){abort("'SOCKFS' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"tempFixedLengthArray")||(Module.tempFixedLengthArray=function(){abort("'tempFixedLengthArray' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"miniTempWebGLFloatBuffers")||(Module.miniTempWebGLFloatBuffers=function(){abort("'miniTempWebGLFloatBuffers' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"heapObjectForWebGLType")||(Module.heapObjectForWebGLType=function(){abort("'heapObjectForWebGLType' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"heapAccessShiftForWebGLHeap")||(Module.heapAccessShiftForWebGLHeap=function(){abort("'heapAccessShiftForWebGLHeap' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"GL")||(Module.GL=function(){abort("'GL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"emscriptenWebGLGet")||(Module.emscriptenWebGLGet=function(){abort("'emscriptenWebGLGet' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"computeUnpackAlignedImageSize")||(Module.computeUnpackAlignedImageSize=function(){abort("'computeUnpackAlignedImageSize' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"emscriptenWebGLGetTexPixelData")||(Module.emscriptenWebGLGetTexPixelData=function(){abort("'emscriptenWebGLGetTexPixelData' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"emscriptenWebGLGetUniform")||(Module.emscriptenWebGLGetUniform=function(){abort("'emscriptenWebGLGetUniform' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"emscriptenWebGLGetVertexAttrib")||(Module.emscriptenWebGLGetVertexAttrib=function(){abort("'emscriptenWebGLGetVertexAttrib' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"writeGLArray")||(Module.writeGLArray=function(){abort("'writeGLArray' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"AL")||(Module.AL=function(){abort("'AL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"SDL_unicode")||(Module.SDL_unicode=function(){abort("'SDL_unicode' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"SDL_ttfContext")||(Module.SDL_ttfContext=function(){abort("'SDL_ttfContext' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"SDL_audio")||(Module.SDL_audio=function(){abort("'SDL_audio' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"SDL")||(Module.SDL=function(){abort("'SDL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"SDL_gfx")||(Module.SDL_gfx=function(){abort("'SDL_gfx' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"GLUT")||(Module.GLUT=function(){abort("'GLUT' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"EGL")||(Module.EGL=function(){abort("'EGL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"GLFW_Window")||(Module.GLFW_Window=function(){abort("'GLFW_Window' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"GLFW")||(Module.GLFW=function(){abort("'GLFW' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"GLEW")||(Module.GLEW=function(){abort("'GLEW' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"IDBStore")||(Module.IDBStore=function(){abort("'IDBStore' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"runAndAbortIfError")||(Module.runAndAbortIfError=function(){abort("'runAndAbortIfError' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"warnOnce")||(Module.warnOnce=function(){abort("'warnOnce' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"stackSave")||(Module.stackSave=function(){abort("'stackSave' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"stackRestore")||(Module.stackRestore=function(){abort("'stackRestore' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"stackAlloc")||(Module.stackAlloc=function(){abort("'stackAlloc' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"AsciiToString")||(Module.AsciiToString=function(){abort("'AsciiToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"stringToAscii")||(Module.stringToAscii=function(){abort("'stringToAscii' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"UTF16ToString")||(Module.UTF16ToString=function(){abort("'UTF16ToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"stringToUTF16")||(Module.stringToUTF16=function(){abort("'stringToUTF16' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"lengthBytesUTF16")||(Module.lengthBytesUTF16=function(){abort("'lengthBytesUTF16' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"UTF32ToString")||(Module.UTF32ToString=function(){abort("'UTF32ToString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"stringToUTF32")||(Module.stringToUTF32=function(){abort("'stringToUTF32' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"lengthBytesUTF32")||(Module.lengthBytesUTF32=function(){abort("'lengthBytesUTF32' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"allocateUTF8")||(Module.allocateUTF8=function(){abort("'allocateUTF8' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Object.getOwnPropertyDescriptor(Module,"allocateUTF8OnStack")||(Module.allocateUTF8OnStack=function(){abort("'allocateUTF8OnStack' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}),Module.writeStackCookie=writeStackCookie,Module.checkStackCookie=checkStackCookie,Object.getOwnPropertyDescriptor(Module,"ALLOC_NORMAL")||Object.defineProperty(Module,"ALLOC_NORMAL",{configurable:!0,get:function(){abort("'ALLOC_NORMAL' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}}),Object.getOwnPropertyDescriptor(Module,"ALLOC_STACK")||Object.defineProperty(Module,"ALLOC_STACK",{configurable:!0,get:function(){abort("'ALLOC_STACK' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")}}),dependenciesFulfilled=function e(){calledRun||run(),calledRun||(dependenciesFulfilled=e)},Module.run=run,Module.preInit)for("function"==typeof Module.preInit&&(Module.preInit=[Module.preInit]);Module.preInit.length>0;)Module.preInit.pop()();noExitRuntime=!0,run(); \ No newline at end of file diff --git a/public/sdk/libffmpeg.wasm b/public/sdk/libffmpeg.wasm new file mode 100644 index 0000000..8caabcc Binary files /dev/null and b/public/sdk/libffmpeg.wasm differ diff --git a/public/sdk/logger.js b/public/sdk/logger.js new file mode 100644 index 0000000..9cb34be --- /dev/null +++ b/public/sdk/logger.js @@ -0,0 +1 @@ +!function(o,t){"object"==typeof module&&"object"==typeof module.exports?module.exports=o.document?t(o,!0):function(o){if(!o.document)throw new Error("Logger requires a window with a document");return t(o)}:t(o)}("undefined"!=typeof window?window:this,(function(o,t){function e(o){this.module=o}return e.prototype.log=function(o){},e.prototype.logError=function(o){},e.prototype.logInfo=function(o){},e.prototype.logDebug=function(o){},e.prototype.currentTimeStr=function(){var o=new Date(Date.now());return o.getFullYear()+"-"+(o.getMonth()+1)+"-"+o.getDate()+" "+o.getHours()+":"+o.getMinutes()+":"+o.getSeconds()+":"+o.getMilliseconds()},o.Logger=e,e})); \ No newline at end of file diff --git a/public/sdk/player.js b/public/sdk/player.js new file mode 100644 index 0000000..b405438 --- /dev/null +++ b/public/sdk/player.js @@ -0,0 +1 @@ +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.jPlayer=t():e.jPlayer=t()}(window,(function(){return function(e){var t={};function o(a){if(t[a])return t[a].exports;var r=t[a]={i:a,l:!1,exports:{}};return e[a].call(r.exports,r,r.exports,o),r.l=!0,r.exports}return o.m=e,o.c=t,o.d=function(e,t,a){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:a})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var a=Object.create(null);if(o.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)o.d(a,r,function(t){return e[t]}.bind(null,r));return a},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o(o.s=3)}([function(e,t,o){var a,r;a="undefined"!=typeof window?window:this,r=function(e,t){const o={closeTalk:60,TalkHandshakeReq:59,kFileData:1,kInitDecoderReq:0,kUninitDecoderReq:1,kOpenDecoderReq:2,kCloseDecoderReq:3,kFeedDataReq:4,kStartDecodingReq:5,kPauseDecodingReq:6,kInitDecoderRsp:0,kUninitDecoderRsp:1,kOpenDecoderRsp:2,kCloseDecoderRsp:10,kVideoFrame:4,kAudioFrame:5,kDecodeFinishedEvt:8,cmdCallback:11,kGetParamRsp:12,sendDataCallback:13,socketLinkState:14,getHeartBeatRequest:15,DownloaderHeartBeat:16,closeWebsocket:17,fetchStream:18,resetDecoderFifo:19,getSetPlayBackSpeedReq:20,getSetPlayBackStartReq:21,deviceReady:22,getSetPlayBackStartTimeReq:23,responseCurDateTime:24,eventTypeFifoFull:25,eventTypeFifoEnough:26,playbakcRecordList:27,socketActiveClose:28,serverDataTimeout:29,heartPingResp:30,serverDecoderError:31,socketNoActive:32,getHandsharkReq:33,getHandsharkRes:34,recoderStart:35,recoderPause:36,onWasmLoaded:37,getHandshakeReq:38,DownloaderHandshakeReq:39,sendHandshakeReq:40,kVideoDownRep:100,kVideoDownChumksRep:101,getTalkStartReq:50,talkStartRep:51,pcmDataReq:52,kStartTalkEncoderRsq:53,kStartTalkEncoderRsp:54,kGetDeviceInfo:55,kGetAudioDataReq:56,kgetTalkStartRep:57,DestroyTalkReq:58,DestroyTalkRes:61,kStartTalkEncoderdeviceready:62,initTalkEncode:64,_getTalkStartReq:63,PlaybackOver:65,serverDecoderTalkError:66};return e.common=o,o},"object"==typeof e.exports?e.exports=a.document?r(a):function(e){if(!e.document)throw new Error("common requires a window with a document");return r(e)}:r(a)},function(e,t,o){"use strict";e.exports=function(e,t,o,a){try{try{var r;try{r=new window.Blob([e])}catch(t){(r=new(window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder)).append(e),r=r.getBlob()}var s=window.URL||window.webkitURL,i=s.createObjectURL(r),n=new window[t](i,o);return s.revokeObjectURL(i),n}catch(a){return new window[t]("data:application/javascript,".concat(encodeURIComponent(e)),o)}}catch(e){if(!a)throw Error("Inline worker is not supported");return new window[t](a,o)}}},function(e,t,o){var a,r;a="undefined"!=typeof window?window:this,r=function(e,t){function o(e){this.module=e}return o.prototype.log=function(e){},o.prototype.logError=function(e){},o.prototype.logInfo=function(e){},o.prototype.logDebug=function(e){},o.prototype.currentTimeStr=function(){var e=new Date(Date.now());return e.getFullYear()+"-"+(e.getMonth()+1)+"-"+e.getDate()+" "+e.getHours()+":"+e.getMinutes()+":"+e.getSeconds()+":"+e.getMilliseconds()},e.Logger=o,o},"object"==typeof e.exports?e.exports=a.document?r(a):function(e){if(!e.document)throw new Error("Logger requires a window with a document");return r(e)}:r(a)},function(e,t,o){"use strict";function a(e){this.init(e)}o.r(t),o.d(t,"playerStateIdle",(function(){return T})),o.d(t,"playerStatePlaying",(function(){return E})),o.d(t,"playerStatePausing",(function(){return _})),a.prototype.init=function(e){this.option={encoding:"16bitInt",channels:1,sampleRate:8e3,flushingTime:5e3,...e},this.samples=new Float32Array,this.flush=this.flush.bind(this),this.interval=setInterval(this.flush,this.option.flushingTime),this.maxValue=this.getMaxValue(),this.TypedArray=this.getTypedArray(),this.createContext()},a.prototype.getMaxValue=function(){var e={"8bitInt":128,"16bitInt":32768,"32bitInt":2147483648,"32bitFloat":1};return e[this.option.encoding]?e[this.option.encoding]:e["16bitInt"]},a.prototype.getTypedArray=function(){var e={"8bitInt":Int8Array,"16bitInt":Int16Array,"32bitInt":Int32Array,"32bitFloat":Float32Array};return e[this.option.encoding]?e[this.option.encoding]:e["16bitInt"]},a.prototype.createContext=function(){this.audioCtx=new(window.AudioContext||window.webkitAudioContext),this.gainNode=this.audioCtx.createGain(),this.gainNode.gain.value=1,this.gainNode.connect(this.audioCtx.destination),this.startTime=this.audioCtx.currentTime},a.prototype.isTypedArray=function(e){return e.byteLength&&e.buffer&&e.buffer.constructor==ArrayBuffer},a.prototype.feed=function(e){if(this.isTypedArray(e)){e=this.getFormatedValue(e);var t=new Float32Array(this.samples.length+e.length);t.set(this.samples,0),t.set(e,this.samples.length),this.samples=t}},a.prototype.getFormatedValue=function(e){e=new this.TypedArray(e.buffer);var t,o=new Float32Array(e.length);for(t=0;t=n-51&&(t[r]=t[r]*s--/50),a+=this.option.channels;this.startTime>1,o>>1,e.subarray(a,a+r)),s.v.fill(t>>1,o>>1,e.subarray(a+r,e.length)),s.drawArrays(s.TRIANGLE_STRIP,0,4)}},i.prototype.fullscreen=function(){var e=this.canvas;e.RequestFullScreen?e.RequestFullScreen():e.webkitRequestFullScreen?e.webkitRequestFullScreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.msRequestFullscreen?e.msRequestFullscreen():alert("This browser doesn't supporter fullscreen")},s.prototype.bind=function(e,t,o){var a=this.gl;a.activeTexture([a.TEXTURE0,a.TEXTURE1,a.TEXTURE2][e]),a.bindTexture(a.TEXTURE_2D,this.texture),a.uniform1i(a.getUniformLocation(t,o),e)},i.prototype.exitfullscreen=function(){document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.msExitFullscreen?document.msExitFullscreen():alert("Exit fullscreen doesn't work")},i.prototype.webGLDestroy=function(){var e=this.gl,t=this.program;e.clear(e.COLOR_BUFFER_BIT),e.clear(e.DEPTH_BUFFER_BIT),e.clear(e.STENCIL_BUFFER_BIT),e.deleteProgram(t);var o=this.verticesBuffer,a=this.texCoordBuffer;e.deleteBuffer(o),e.deleteBuffer(a);var r=e.y.texture,s=e.u.texture,i=e.v.texture;e.deleteTexture(r),e.deleteTexture(s),e.deleteTexture(i),this.canvas=null,this.gl=null};var n=i,l=o(1),c=o.n(l);function d(){return c()('!function(e){var o={};function t(a){if(o[a])return o[a].exports;var r=o[a]={i:a,l:!1,exports:{}};return e[a].call(r.exports,r,r.exports,t),r.l=!0,r.exports}t.m=e,t.c=o,t.d=function(e,o,a){t.o(e,o)||Object.defineProperty(e,o,{enumerable:!0,get:a})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,o){if(1&o&&(e=t(e)),8&o)return e;if(4&o&&"object"==typeof e&&e&&e.__esModule)return e;var a=Object.create(null);if(t.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&o&&"string"!=typeof e)for(var r in e)t.d(a,r,function(o){return e[o]}.bind(null,r));return a},t.n=function(e){var o=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(o,"a",o),o},t.o=function(e,o){return Object.prototype.hasOwnProperty.call(e,o)},t.p="",t(t.s=0)}([function(e,o){function t(){this.logger=new Logger("Decoder"),this.coreLogLevel=0,this.wasmLoaded=!1,this.tmpReqQue=[],this.cacheBuffer=null,this.decodeTimer=null,this.videoCallback=null,this.audioCallback=null,this.requestCallback=null,this.responseCallback=null,this.eventCallback=null,this.decoderCmdCallback=null,this.recordWriteCallback=null,this.recordUpdateCallback=null,this.key="",this.iv="",this.allChunks=[],this.recoding=!1,this.handShakeData=null,this.deviceReadyStatus=!1}self.Module={onRuntimeInitialized:function(){self.decoder&&self.decoder.onWasmLoaded()},locateFile:function(e,o){return location.origin+"/"+e}},self.importScripts(location.origin+"/enumConstant.js"),self.importScripts(location.origin+"/logger.js"),self.importScripts(location.origin+"/libffmpeg.js"),t.prototype.initDecoder=function(e,o,t,a,r){var l=Module._initDecoder(this.coreLogLevel,this.eventCallback,this.decoderCmdCallback,this.responseCallback);if(this.logger.logInfo("initDecoder return "+l+"."),0==l){if(t&&""!=t&&a&&""!=a&&r&&""!=r){var s=allocateUTF8(t),n=allocateUTF8(a),c=allocateUTF8(r);Module._setCipherInfo(c,s,n)}null==this.cacheBuffer&&(this.cacheBuffer=Module._malloc(o)),Module._setPlayMode(e)}var i={t:common.kInitDecoderRsp,e:l};self.postMessage(i)},t.prototype.uninitDecoder=function(){this.closeDecoder();var e=Module._uninitDecoder(),o={t:common.kCloseDecoderRsp,e:0};self.postMessage(o),this.logger.logInfo("Uninit ffmpeg decoder return "+e+"."),null!==this.cacheBuffer&&(Module._free(this.cacheBuffer),this.cacheBuffer=null)},t.prototype.getParam=function(e){var o,t,a,r,l,s,n,c,i,d,u=2002==e?3:4,f=Module._malloc(4*u),g=2002==e?Module._getAudioParam(f,u):Module._getVideoParam(f,u);this.logger.logInfo("getParam return "+g),0==g?(t=f>>2,a=Module.HEAP32.subarray(t,t+u),r=2002==e?"":a[0],l=2002==e?"":a[1],s=2002==e?"":a[2],n=2002==e?"":a[3],c=2002==e?a[0]:"",i=2002==e?a[1]:"",d=2002==e?a[2]:"",o={t:common.kGetParamRsp,e:g,type:2002==e?"audio":"video",v:{d:r,p:l,w:s,h:n},a:{f:c,c:i,r:d}},self.postMessage(o)):(o={t:common.kGetParamRsp,e:g},self.postMessage(o)),Module._free(f)},t.prototype.openDecoder=function(){Module._setRecordCallback(this.recordWriteCallback,this.recordUpdateCallback);var e,o=Module._openDecoder(this.videoCallback,this.audioCallback,this.requestCallback);this.logger.logInfo("openDecoder return "+o),0==o&&(e={t:common.kOpenDecoderRsp,e:o},self.postMessage(e))},t.prototype.closeDecoder=function(){!1,a=!1,this.logger.logInfo("closeDecoder."),this.decodeTimer&&(clearInterval(this.decodeTimer),this.decodeTimer=null,this.logger.logInfo("Decode timer stopped."));var e=Module._closeDecoder();this.logger.logInfo("Close ffmpeg decoder return "+e+".")},t.prototype.startDecoding=function(e){this.logger.logInfo("Start decoding."),this.decodeTimer&&clearInterval(this.decodeTimer),this.decodeTimer=setInterval(this.decode,e)},t.prototype.pauseDecoding=function(){this.logger.logInfo("Pause decoding."),this.decodeTimer&&(clearInterval(this.decodeTimer),this.decodeTimer=null)};t.prototype.decode=function(){(new Date).getTime();var e=Module._decodeOnePacket();(new Date).getTime();for(7==e&&self.decoder.logger.logInfo("Decoder finished."),0==e&&!0;9==e&&this.decodeTimer;)e=Module._decodeOnePacket()},t.prototype.sendData=function(e){var o=new Uint8Array(e);Module.HEAPU8.set(o,this.cacheBuffer),Module._sendData(this.cacheBuffer,o.length)},t.prototype.getSetPlayBackSpeedReq=function(e){var o,t,a,r,l,s=Module._malloc(4),n=Module._malloc(1024),c=allocateUTF8(e),i=Module._getSetPlayBackSpeedReq(n,s,1024,c);this.logger.logInfo("_getSetPlayBackSpeedReq return "+i),0==i&&(t=s>>2,a=Module.HEAP32.subarray(t,t+1)[0],r=Module.HEAPU8.subarray(n,n+a),l=new Uint8Array(r),o={t:common.getSetPlayBackSpeedReq,b:l},self.postMessage(o),l=null),Module._free(s),Module._free(n)},t.prototype.getSetPlayBackStartReq=function(){var e,o,t,a,r,l=Module._malloc(4),s=Module._malloc(1024),n=Module._getSetPlayBackStartReq(s,l,1024);this.logger.logInfo("_getSetPlayBackStartReq return "+n),0==n&&(o=l>>2,t=Module.HEAP32.subarray(o,o+1)[0],a=Module.HEAPU8.subarray(s,s+t),r=new Uint8Array(a),e={t:common.getSetPlayBackStartReq,b:r},self.postMessage(e)),Module._free(l),Module._free(s)},t.prototype.getSetPlayBackStartTimeReq=function(e){var o,t,a,r,l,s=Module._malloc(4),n=Module._malloc(1024),c=allocateUTF8(String(e)),i=Module._getSetPlayBackStartTimeReq(n,s,1024,c);this.logger.logInfo("_getSetPlayBackStartTimeReq return "+i),0==i&&(t=s>>2,a=Module.HEAP32.subarray(t,t+1)[0],r=Module.HEAPU8.subarray(n,n+a),l=new Uint8Array(r),o={t:common.getSetPlayBackStartTimeReq,b:l},self.postMessage(o)),Module._free(s),Module._free(n)},t.prototype.getHeartbeatPing=function(){var e,o,t,a,r,l=Module._malloc(4),s=Module._malloc(1024),n=Module._getHeartbeatPing(s,l,1024);this.logger.logInfo("_getHeartbeatPing return "+n),0==n&&(o=l>>2,t=Module.HEAP32.subarray(o,o+1)[0],a=Module.HEAPU8.subarray(s,s+t),r=new Uint8Array(a),e={t:common.getHeartBeatRequest,b:r,l:t},self.postMessage(e)),Module._free(l),Module._free(s)},t.prototype.handshakeReq=function(){var e,o,t,a,r,l=Module._malloc(4),s=Module._malloc(1024),n=Module._getHandshakeReq(s,l,1024);this.logger.logInfo("_getHandshakeReq return "+n),0==n&&(o=l>>2,t=Module.HEAP32.subarray(o,o+1)[0],a=Module.HEAPU8.subarray(s,s+t),r=new Uint8Array(a),e={t:common.getHandshakeReq,b:r,l:t},self.postMessage(e)),Module._free(l),Module._free(s)},t.prototype.talkhandshakeReq=function(){var e,o,t,a,r,l=Module._malloc(4),s=Module._malloc(1024),n=Module._getHandshakeReq(s,l,1024);this.logger.logInfo("_getHandshakeReq return "+n),0==n&&(o=l>>2,t=Module.HEAP32.subarray(o,o+1)[0],a=Module.HEAPU8.subarray(s,s+t),r=new Uint8Array(a),e={t:common.getTalkHandshakeReq,b:r,l:t},self.postMessage(e)),Module._free(l),Module._free(s)},t.prototype.getHandsharkReq=function(){var e,o,t,a,r,l=Module._malloc(4),s=Module._malloc(1024),n=Module._getHandsharkReq(s,l,1024);this.logger.logInfo("_getHeartbeatPing return "+n),0==n&&(o=l>>2,t=Module.HEAP32.subarray(o,o+1)[0],a=Module.HEAPU8.subarray(s,s+t),r=new Uint8Array(a),e={t:common.getHandsharkRes,b:r,l:t},self.postMessage(e)),Module._free(l),Module._free(s)},t.prototype.processReq=function(e){switch(e.t){case common.kInitDecoderReq:this.initDecoder(e.s,e.c,e.k,e.i,e.ct);break;case common.kUninitDecoderReq:this.uninitDecoder();break;case common.kOpenDecoderReq:this.openDecoder();break;case common.kCloseDecoderReq:this.closeDecoder();break;case common.kStartDecodingReq:this.startDecoding(e.i);break;case common.kPauseDecodingReq:this.pauseDecoding();break;case common.kFeedDataReq:this.sendData(e.d);break;case common.getHeartBeatRequest:this.getHeartbeatPing();break;case common.getHandshakeReq:this.handshakeReq();break;case common.resetDecoderFifo:this.resetDecoderFifo();break;case common.getSetPlayBackSpeedReq:this.getSetPlayBackSpeedReq(e.l);break;case common.getSetPlayBackStartReq:this.getSetPlayBackStartReq();break;case common.getSetPlayBackStartTimeReq:this.getSetPlayBackStartTimeReq(e.s);break;case common.getHandsharkReq:this.getHandsharkReq();break;case common.recoderStart:this.recoderStart();break;case common.recoderPause:case common.recoderPause:this.recoderPause();break;case common.getTalkStartReq:case common.initTalkEncode:this.initEncoder();break;case common.kGetDeviceInfo:this.sendTalkData(e.d);break;case common._getTalkStartReq:this.getTalkStartReq();break;case common.kStartTalkEncoderRsp:if(e.b){let o=JSON.parse(e.b);this.startTalkEncoder(8e3,16,1,o.audio_codec,o.sample,o.bitwidth,o.channel)}else this.startTalkEncoder();break;case common.pcmDataReq:this.encodePcmDataReq(e);break;case common.DestroyTalkReq:this.closeTalkEncoder(),this.uninitTalkDecoder();break;default:this.logger.logError("Unsupport messsage "+e.t)}},t.prototype.cacheReq=function(e){e&&this.tmpReqQue.push(e)},t.prototype.resetDecoderFifo=function(e){Module._resetDecoderFifo()};var a=!1;t.prototype.recoderStart=function(){this.recoding=!0,this.allChunks=[];Module._recoderStart()},t.prototype.recoderPause=function(){this.recoding=!1;Module._recoderPause();let e=this.allChunks;var o={t:common.kVideoDownRep,s:(new Date).getTime(),d:e};self.postMessage(o)},t.prototype.onWasmLoaded=function(){let e=this;this.logger.logInfo("Wasm loaded."),this.wasmLoaded=!0,this.videoCallback=Module.addFunction((function(e,o,t){var a=Module.HEAPU8.subarray(e,e+o),r=new Uint8Array(a);(new Date).getTime();var l={t:common.kVideoFrame,s:t,d:r};self.postMessage(l,[l.d.buffer])}),"viid"),this.audioCallback=Module.addFunction((function(e,o,t){var a=Module.HEAPU8.subarray(e,e+o),r=new Uint8Array(a);(new Date).getTime();var l={t:common.kAudioFrame,s:t,d:r};self.postMessage(l,[l.d.buffer]),r=null}),"viid"),this.requestCallback=Module.addFunction((function(e,o){}),"vii"),this.TalkEventCallback=Module.addFunction((function(e,o){if(e>=4&&e<=18){const e={t:common.serverDecoderTalkError,s:o};self.postMessage(e)}}),"vii"),this.TalkCmdCallback=Module.addFunction((function(o,t,a,r,l,s,n){let c=Number(t);if(0===c)switch(o){case 1:let o={t:common.kStartTalkEncoderdeviceready,b:""};e.deviceReadyStatus||(e.deviceReadyStatus=!0,self.postMessage(o));break;case 10:let t=UTF8ToString(s,n),a={t:common.kStartTalkEncoderRsp,b:t};self.postMessage(a)}else{let e={t:common.closeTalk,b:"",errorCode:c};self.postMessage(e)}}),"vijiijii"),this.TalkUserDataCallback=Module.addFunction((function(e,o){}),"vii"),this.recordWriteCallback=Module.addFunction(((e,o,t)=>{var a=Module.HEAPU8.subarray(o,o+t);o=new Uint8Array(a);if(this.allChunks.push(o),this.recoding){let e=this.allChunks;var r={t:common.kVideoDownChumksRep,s:(new Date).getTime(),d:e};self.postMessage(r)}}),"viii"),this.recordUpdateCallback=Module.addFunction(((e,o,t,a)=>{var r=Module.HEAPU8.subarray(o,o+t)||[0];this.allChunks[0][a]=r[0]}),"viiii"),this.decoderCmdCallback=Module.addFunction((function(e,o,t,a,r,l,s){var n,c,i,d,u;switch(e){case 1:d={t:common.deviceReady},self.postMessage(d);break;case 2:break;case 3:i={t:common.responseCurDateTime,d:r},self.postMessage(i);break;case 4:i={t:common.PlaybackOver},self.postMessage(i);break;case 8:c=UTF8ToString(l,s),n={t:common.playbakcRecordList,d:c},self.postMessage(n);break;case 9:u={t:common.heartPingResp},self.postMessage(u)}}),"vijiijii"),this.responseCallback=Module.addFunction((function(e,o){}),"vii");const o=this;this.eventCallback=Module.addFunction((function(e,t){if(e>=4&&e<=18){const o={t:common.serverDecoderError,s:e};self.postMessage(o)}switch(e){case 0:if(!a){const e={t:common.sendDataCallback};self.postMessage(e),a=!0}break;case 1:case 2:case 3:const t={t:common.socketLinkState,s:e};self.postMessage(t);break;case 2e3:const r={t:common.eventTypeFifoFull};self.postMessage(r);break;case 2001:const l={t:common.eventTypeFifoEnough};self.postMessage(l);break;case 2002:o.getParam(2002);break;case 2003:o.getParam(2003);break;case 2004:o.recoderPause();break;case 17:const s={t:common.serverDataTimeout};self.postMessage(s)}}),"vii");let t={t:common.onWasmLoaded};var r;for(self.postMessage(t);this.tmpReqQue.length>0;)r=this.tmpReqQue.shift(),this.processReq(r)},t.prototype.initEncoder=function(){Module._initTalkEncoder(this.TalkEventCallback,this.TalkCmdCallback,this.TalkUserDataCallback)},t.prototype.getTalkStartReq=function(){var e,o,t,a,r,l=Module._malloc(4),s=Module._malloc(1024),n=Module._getTalkStartReq(s,l,1024);this.logger.logInfo("_getTalkStartReq return "+n),0==n&&(o=l>>2,t=Module.HEAP32.subarray(o,o+1)[0],a=Module.HEAPU8.subarray(s,s+t),r=new Uint8Array(a),e={t:common.getTalkStartReq,b:r,l:t},self.postMessage(e)),Module._free(l),Module._free(s)},t.prototype.sendTalkData=function(e){var o=new Uint8Array(e);Module.HEAPU8.set(o,this.cacheBuffer),Module._sendTalkData(this.cacheBuffer,o.length)},t.prototype.getTalkStopReq=function(){var e,o,t,a,r,l=Module._malloc(4),s=Module._malloc(1024),n=Module._getTalkStopReq(s,l,1024);this.logger.logInfo("_getTalkStartReq return "+n),0==n&&(o=l>>2,t=Module.HEAP32.subarray(o,o+1)[0],a=Module.HEAPU8.subarray(s,s+t),r=new Uint8Array(a),e={t:common.getTalkStopReq,b:r,l:t},self.postMessage(e)),Module._free(l),Module._free(s)},t.prototype.startTalkEncoder=function(e=8e3,o=16,t=1,a=1,r=8e3,l=16,s=1){var n=Module._startTalkEncoder(e,o,t,a,r,l,s);if(this.logger.logInfo("开启音频编码器 "+n),0==n){let e={t:common.kGetAudioDataReq,b:""};self.postMessage(e)}},t.prototype.closeTalkEncoder=function(){Module._closeTalkEncoder();this.deviceReadyStatus=!1},t.prototype.uninitTalkDecoder=function(){Module._uninitTalkDecoder()},t.prototype.encodePcmDataReq=function(e){let o=e.p.d,t=e.p.h;if(0==t)return;e.p.t;var a=Module._malloc(4),r=Module._malloc(51200),l=Module._malloc(51200),s=new Uint8Array(o);Module.HEAPU8.set(s,r);var n,c,i,d,u,f=t+10240,g=Module._getAudioData(r,t,0,l,a,f),m=a,h=l;this.logger.logInfo("_getAudioData return "+g),0==g&&(c=m>>2,i=Module.HEAP32.subarray(c,c+1)[0],d=Module.HEAPU8.subarray(h,h+i),u=new Uint8Array(d),n={t:common.kgetTalkStartRep,b:u,l:i},self.postMessage(n)),Module._free(m),Module._free(h),Module._free(a),Module._free(r),Module._free(l)},self.decoder=new t,self.onmessage=function(e){if(self.decoder){var o=e.data;if(!self.decoder.wasmLoaded)return self.decoder.cacheReq(o),void self.decoder.logger.logInfo("Temp cache req "+o.t+".");self.decoder.processReq(o)}}}]);',"Worker",void 0,o.p+"decoder.worker:9c62edef.js")}function h(){return c()('!function(e){var t={};function o(r){if(t[r])return t[r].exports;var s=t[r]={i:r,l:!1,exports:{}};return e[r].call(s.exports,s,s.exports,o),s.l=!0,s.exports}o.m=e,o.c=t,o.d=function(e,t,r){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(o.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var s in e)o.d(r,s,function(t){return e[t]}.bind(null,s));return r},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o(o.s=0)}([function(e,t){function o(){this.logger=new Logger("Downloader"),this.ws=null,this.heartbeatTimer=null,this.heartbeatTimes=0}self.importScripts(location.origin+"/enumConstant.js"),self.importScripts(location.origin+"/logger.js"),o.prototype.appendBuffer=function(e,t){var o=new Uint8Array(e.byteLength+t.byteLength);return o.set(new Uint8Array(e),0),o.set(new Uint8Array(t),e.byteLength),o.buffer},o.prototype.reportData=function(e){var t={t:common.kFileData,d:e};self.postMessage(t,[t.d])},o.prototype.requestWebsocket=function(e,t){var o,r,s=this;null===this.ws&&(this.ws=new WebSocket(e),this.ws.binaryType="arraybuffer",this.ws.onopen=function(e){s.logger.logInfo("Ws connected."),s.heartbeatTimes=0,r={t:common.sendHandshakeReq},self.postMessage(r)},this.ws.onerror=function(e){s.logger.logError("Ws connect error "+e.data),s.heartbeatTimes=0,s.ws=null},this.ws.onclose=function(e){clearInterval(s.heartbeatTimer),s.ws=null,o={t:common.socketActiveClose,d:e.code,w:e.wasClean},self.postMessage(o),s.heartbeatTimes=0},this.ws.onmessage=this.onmessage.bind(this))},o.prototype.onmessage=function(e){this.heartbeatTimes=0;var t=e.data;t.byteLength>10485760||self.downloader.reportData(t)},o.prototype.handshakeReq=function(e){this.ws&&this.ws.send(e)},o.prototype.startHeartbeatTimer=function(e){this.ws&&(clearInterval(this.heartbeatTimer),this.heartbeatTimer=setInterval((()=>{this.ws.send(e),this.heartbeatTimes=this.heartbeatTimes+1,this.heartbeatTimes>3&&(this.ws.close(),clearInterval(this.heartbeatTimer),this.ws=null,req={t:common.socketNoActive},self.postMessage(req),this.heartbeatTimes=0)}),13e3))},o.prototype.closeWebsocket=function(e){this.ws&&(this.ws.close(),clearInterval(this.heartbeatTimer))},o.prototype.setPlayBackSpeed=function(e){this.ws&&this.ws.send(e)},o.prototype.setPlayBackStart=function(e){this.ws&&this.ws.send(e)},o.prototype.SetPlayBackStartTime=function(e){this.ws&&this.ws.send(e)},o.prototype.heartPingResp=function(){this.heartbeatTimes=0},self.downloader=new o,self.onmessage=function(e){if(self.downloader){var t=e.data;switch(t.t){case common.fetchStream:self.downloader.requestWebsocket(t.url,t.msg);break;case common.DownloaderHeartBeat:self.downloader.startHeartbeatTimer(t.b);break;case common.DownloaderHandshakeReq:self.downloader.handshakeReq(t.b);break;case common.closeWebsocket:self.downloader.closeWebsocket();break;case common.getSetPlayBackSpeedReq:self.downloader.setPlayBackSpeed(t.b);break;case common.getSetPlayBackStartReq:self.downloader.setPlayBackStart(t.b);break;case common.getSetPlayBackStartTimeReq:self.downloader.SetPlayBackStartTime(t.b);break;case common.heartPingResp:self.downloader.heartPingResp();break;default:self.downloader.logger.logError("Unsupport messsage "+t.t)}}}}]);',"Worker",void 0,o.p+"downloader.worker:3ede097f.js")}function u(){return c()('!function(e){var t={};function a(s){if(t[s])return t[s].exports;var r=t[s]={i:s,l:!1,exports:{}};return e[s].call(r.exports,r,r.exports,a),r.l=!0,r.exports}a.m=e,a.c=t,a.d=function(e,t,s){a.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:s})},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,t){if(1&t&&(e=a(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var s=Object.create(null);if(a.r(s),Object.defineProperty(s,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)a.d(s,r,function(t){return e[t]}.bind(null,r));return s},a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,"a",t),t},a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.p="",a(a.s=0)}([function(e,t){function a(){this.logger=new Logger("Talkloader"),this.ws=null,this.heartbeatTimer=null,this.heartbeatTimes=0,this.handShakeData=null,this.heartbeatPingData=null,this.audioBufferArray=[]}self.importScripts(location.origin+"/enumConstant.js"),self.importScripts(location.origin+"/logger.js"),a.prototype.appendBuffer=function(e,t){var a=new Uint8Array(e.byteLength+t.byteLength);return a.set(new Uint8Array(e),0),a.set(new Uint8Array(t),e.byteLength),a.buffer},a.prototype.requestWebsocket=function(e,t){var a=this;null===this.ws?(this.ws=new WebSocket(e),this.ws.binaryType="arraybuffer",this.ws.onopen=function(e){a.logger.logInfo("talkWs connected."),a.heartbeatTimes=0,a.ws.send(a.handShakeData),a.startHeartbeatTimer(a.heartbeatPingData),a.initTalkEncode()},this.ws.onerror=function(e){a.logger.logError("talkWs connect error "+e.data),a.heartbeatTimes=0},this.ws.onclose=function(e){clearInterval(a.heartbeatTimer),a.ws=null,req={t:common.socketActiveClose,d:e.code,w:e.wasClean},self.postMessage(req),a.heartbeatTimes=0},this.ws.onmessage=this.onmessage.bind(this)):this.ws.onmessage=this.onmessage.bind(this)},a.prototype.onmessage=function(e){this.heartbeatTimes=0;var t=e.data;let a={t:common.kGetDeviceInfo,d:t};self.postMessage(a)},a.prototype.initTalkEncode=function(){var e={t:common.initTalkEncode,s:new Date};self.postMessage(e)},a.prototype.startHeartbeatTimer=function(e){this.ws&&(clearInterval(this.heartbeatTimer),this.heartbeatTimer=setInterval((()=>{this.ws.send(e),this.heartbeatTimes=this.heartbeatTimes+1,this.heartbeatTimes>3&&(this.ws.close(),clearInterval(this.heartbeatTimer),this.ws=null,req={t:common.socketNoActive},self.postMessage(req),this.heartbeatTimes=0)}),13e3))},a.prototype.getTalkStartReq=function(){var e={t:common.getTalkStartReq,s:new Date};self.postMessage(e)},a.prototype.setTalkStartRep=function(e){0===this.ws.bufferedAmount&&this.ws.send(e)},a.prototype.setTalkG711Data=function(e){this.ws&&this.ws.send(e)},a.prototype.closeWebsocket=function(e){if(this.ws){this.ws.close(),clearInterval(this.heartbeatTimer),this.ws=null;let e={t:common.DestroyTalkRes};self.postMessage(e)}},a.prototype.setHandShakeData=function(e){this.handShakeData=e},a.prototype.setHeartbeatPingData=function(e){this.heartbeatPingData=e},a.prototype.heartPingResp=function(){this.heartbeatTimes=0},self.talkloader=new a,self.onmessage=function(e){if(self.talkloader){var t=e.data;switch(t.t){case common.fetchStream:self.talkloader.requestWebsocket(t.url);break;case common.DownloaderHeartBeat:self.talkloader.setHeartbeatPingData(t.b);break;case common.TalkHandshakeReq:self.talkloader.setHandShakeData(t.b);break;case common.talkStartRep:self.talkloader.setTalkStartRep(t.b);break;case common.kgetTalkStartRep:self.talkloader.setTalkG711Data(t.b);break;case common.closeWebsocket:self.talkloader.closeWebsocket();break;case common.heartPingResp:self.talkloader.heartPingResp();break;case common.DestroyTalkReq:self.talkloader.closeWebsocket();break;default:self.talkloader.logger.logError("Unsupport messsage "+t.t)}}}}]);',"Worker",void 0,o.p+"talk.worker:e994faef.js")}var p=o(2),f=o.n(p);new f.a("Event").logInfo("Event.js 已加载");class m{constructor(e){this.target={},this.eventsQueue={},this.disallowRepeat=!1}add(e=[],t,o){for(let a of e)this.on(a,t,o)}on(e,t,o){if(void 0===this.eventsQueue[e]&&(this.eventsQueue[e]={methods:[]}),"function"==typeof t){if(!this.disallowRepeat||!this.eventsQueue[e].methods.includes(t))return void 0!==o&&(t.once=o),this.eventsQueue[e].methods.push(t),this.target}else logger.error("on","the argument is not function.",t)}once(e,t){this.on(e,t,!0)}off(e,t){let o=this.eventsQueue[e];if(!o)return;let a=o.methods;if(t){let e=a.length;for(;e--;)a[e]===t&&a.splice(e,1)}else delete this.eventsQueue[e];return this.target}emit(e,...t){let o=this.eventsQueue[e];if(o)return o.methods.forEach((o=>{o.apply(this.target,t),o.once&&this.off(e,o)})),this.target}clear(e){delete this.eventsQueue[e]}clearAll(){this.eventsQueue={}}}var g=function(e){const t=new m(e);return e=>(t.target=e,t)};var k=o(0),y=o.n(k);function R(e,t){let o=t||{};if(!e)return;this.canvasContainer=e,e.style.position="relative";const a=parseInt(getComputedStyle(e).width),r=parseInt(getComputedStyle(e).height);this.conW=a,this.conH=r;const s=document.createElement("canvas");s.width=a,s.height=r,s.style.cssText="transform: scale(1);transform-origin: 0 0;",s.setAttribute("class","videoCanvas"),this.msg="链接已断开";const i=document.createElement("div");i.style.cssText="position: absolute;z-index: 2;background-color: rgba(0, 0, 0, 0);margin: 0;top: 0;right: 0;bottom: 0;left: 0;",e.appendChild(s),e.appendChild(i),i.setAttribute("class","videoCanvasMsg");this.container_el=e,this.canvas=s,this.stateContainer_el=i,this.loading_el_str=o.loading_el_str?o.loading_el_str:'

视频连接中...

',this.pauseimg_el_str=o.pauseimg_el_str?o.pauseimg_el_str:'
\n \n 重播\n \n \n \n \n \n \n \n \n \n \n \n
',this.msg_el_str=o.msg_el_str?o.msg_el_str():function(e){return`

${e}

`},this.stateContainer_el.innerHTML=""}R.prototype._showOrHideShade=function(e){this.stateContainer_el.style.backgroundColor=e},R.prototype.showPauseIcon=function(){this._showOrHideShade("rgba(0,0,0,0)"),this.pauseimg_el_str.nodeType?(this.stateContainer_el.innerHTML="",this.stateContainer_el.appendChild(this.pauseimg_el_str)):this.stateContainer_el.innerHTML=this.pauseimg_el_str},R.prototype.showLoading=function(){this._showOrHideShade("rgba(0,0,0,1)"),this.stateContainer_el.innerHTML="",this.loading_el_str.nodeType?(this.stateContainer_el.innerHTML="",this.stateContainer_el.appendChild(this.loading_el_str)):this.stateContainer_el.innerHTML=this.loading_el_str},R.prototype.showMsg=function(e,t){this._showOrHideShade("rgba(0,0,0,1)"),this.stateContainer_el.innerHTML="";let o=null;o=e||t?"function"==typeof this.msg_el_str&&e?this.msg_el_str(e,t):this.msg_el_str(t):this.msg_el_str(""),o.nodeType?(this.stateContainer_el.innerHTML="",this.stateContainer_el.appendChild(o)):this.stateContainer_el.innerHTML=o},R.prototype.hideAll=function(){this._showOrHideShade("rgba(0,0,0,0)"),this.msg="",this.stateContainer_el.innerHTML=""};var v=R;var b={4:{code:4,code16:4,eventStr:"SERVER_UNKNOWN_ERROR",msg:"服务器未知错误"},5:{code:5,code16:5,eventStr:"SERVER_NOT_READY",msg:"服务器未准备好"},6:{code:6,code16:6,eventStr:"SERVER_USER_ABORT",msg:"服务器端用户主动断开"},7:{code:7,code16:7,eventStr:"SERVER_STOPPED",msg:"服务器服务已停止"},8:{code:8,code16:8,eventStr:"SERVER_ABORT",msg:"服务器服务已中断"},9:{code:9,code16:9,eventStr:"SERVER_STREAM_STOP",msg:"服务器流停止"},10:{code:10,code16:10,eventStr:"SERVER_CONNECT_DEV_FAILED",msg:"连接设备失败"},11:{code:11,code16:11,eventStr:"SERVER_SUBDEV_STREAM_ERR",msg:"订阅设备流失败"},12:{code:12,code16:12,eventStr:"SERVER_INVALID_CONTEXT",msg:"不合法的上下文"},13:{code:13,code16:13,eventStr:"SERVER_DEVICE_TIMEOUT",msg:"设备超时"},14:{code:14,code16:14,eventStr:"SERVER_CLIENT_TIMEOUT",msg:"客户端超时"},15:{code:15,code16:15,eventStr:"SERVER_OVER_DEV_LIMIT",msg:"超过设备最大连接数"},16:{code:16,code16:16,eventStr:"SERVER_PERM_DENIED",msg:"无权限"},17:{code:17,code16:17,eventStr:"SERVER_DATA_TIMEOUT",msg:"数据超时"},18:{code:18,code16:18,eventStr:"SERVER_DEVICE_ABORT",msg:"服务器端设备主动断开"}};let S=function(e,t=16,o=48e3){t=t,o=o;var a=new AudioContext,r=a.createMediaStreamSource(e),s=a.createScriptProcessor(4096,1,1),i={size:0,buffer:[],inputSampleRate:o,inputSampleBits:16,outputSampleRate:8e3,oututSampleBits:t,clear:function(){this.buffer=[],this.size=0},input:function(e){this.buffer.push(new Float32Array(e)),this.size+=e.length},compress:function(){for(var e=new Float32Array(this.size),t=0,o=0;o{o.emit("UNKNOWN_ERROR",e)})),o.on("SERVER_NOT_READY",(e=>{o.emit("NOT_READY",e)})),o.on("SERVER_USER_ABORT",(e=>{o.emit("USER_ABORT",e)})),o.on("SERVER_STOPPED",(e=>{o.emit("STOPPED",e)})),o.on("SERVER_ABORT",(e=>{o.emit("ABORT",e)})),o.on("SERVER_STREAM_STOP",(e=>{o.emit("STREAM_STOP",e)})),o.on("SERVER_CONNECT_DEV_FAILED",(e=>{o.emit("CONNECT_DEV_FAILED",e)})),o.on("SERVER_SUBDEV_STREAM_ERR",(e=>{o.emit("SUBDEV_STREAM_ERR",e)})),o.on("SERVER_INVALID_CONTEXT",(e=>{o.emit("INVALID_CONTEXT",e)})),o.on("SERVER_DEVICE_TIMEOUT",(e=>{o.emit("DEVICE_TIMEOUT",e)})),o.on("SERVER_CLIENT_TIMEOUT",(e=>{o.emit("CLIENT_TIMEOUT",e)})),o.on("SERVER_OVER_DEV_LIMIT",(e=>{o.emit("OVER_DEV_LIMIT",e)})),o.on("SERVER_PERM_DENIED",(e=>{o.emit("PERM_DENIED",e)})),o.on("SERVER_DATA_TIMEOUT",(e=>{o.emit("DATA_TIMEOUT",e)})),o.on("SERVER_DEVICE_ABORT",(e=>{o.emit("DEVICE_ABORT",e)})),o.on("MEDIA_ERROR",(e=>{o.emit("GET_MEDIA_ERROR",e)})),o.on("MEDIA_PROGRESS_INFO",(e=>{o.emit("GET_MEDIA_PROGRESS_INFO",e)})),o.on("DEVICE_RECORD_LIST",(e=>{o.emit("GET_DEVICE_RECORD_LIST",e)})),o.on("MEDIA_PLAY",(()=>{o.emit("GET_MEDIA_PLAY")})),o.on("MEDIA_PAUSE",(()=>{o.emit("GET_MEDIA_PAUSE")})),o.on("MEDIA_STOP",(()=>{o.emit("GET_MEDIA_STOP")})),o.on("VIDEO_MAX_END",(()=>{o.emit("GET_VIDEO_MAX_END")})),this.currentVolume=100,this.configInfo=null,this.pcmPlayer=null,this.canvas=null,this.webglPlayer=null,this.frameRate=0,this.pixFmt=0,this.videoWidth=0,this.videoHeight=0,this.yLength=0,this.uvLength=0,this.playerState=T,this.socketSending=!1,this.decoding=!1,this.currentTimestamp="",this.audioEncoding="",this.audioChannels=0,this.audioSampleRate=0,this.sampleFmt=0,this.speedNum=2,this.setFrameRate=1,this.seeking=!1,this.loadingDiv=null,this.loadingState=!0,this.buffering=!1,this.frameBuffer=[],this.isStream=!1,this.logger=new f.a("Player"),this.drawingState=!1,this.speeding=!1,this.playInitState=!0,this.playFirstGetParams=!0,this.requestAnimationFrame=null,this._onSnapshot=null,this._curSpeed=null,this.endtime=null;const a=new v(e,t);this.showPauseIcon=()=>{a.showPauseIcon()},this.showLoading=()=>{a.showLoading()},this.showMsg=(e,t)=>{a.showMsg(e,t)},this.hideAll=()=>{a.hideAll()},this._msgController=a,this.talkRecord=null,this.talkTimer=null,this.talkStream=null,this.getAudioDating=!1,this.getAudioDataStatus=!1;this.observer=new MutationObserver((e=>{if(this.videoHeight&&this.videoWidth&&this._msgController){let e=Math.ceil(1e5*parseInt(getComputedStyle(this.el).width)/this.videoWidth)/1e5,t=Math.ceil(1e5*parseInt(getComputedStyle(this.el).height)/this.videoHeight)/1e5;this.canvas.style.cssText=`transform: scale(${e},${t});transform-origin: 0 0;position:absolute;left: 0;top: 0;`}})),this.observer.observe(this._msgController.canvasContainer,{attributes:!0}),Object.defineProperty(this,"onSnapshot",{set:e=>{this._onSnapshot=e}})}M.prototype.initDownloadWorker=function(){var e,t=this;this.downloadWorker=new h,this.downloadWorker.onmessage=function(o){var a=o.data;switch(a.t){case y.a.sendHandshakeReq:e={t:y.a.getHandshakeReq},t.decodeWorker.postMessage(e);break;case y.a.kFileData:t.onFileData(a.d);break;case y.a.socketActiveClose:t.onsocketActiveClose(a.d,a.w);break;case y.a.socketNoActive:t.onsocketNoActive()}}},M.prototype.initDecodeWorker=function(){var e=this;this.decodeWorker=new d,this.decodeWorker.onmessage=function(t){var o=t.data;const a={[y.a.kInitDecoderRsp]:"onInitDecoder",[y.a.kOpenDecoderRsp]:"onOpenDecoder",[y.a.kVideoFrame]:"onVideoFrame",[y.a.kAudioFrame]:"onAudioFrame",[y.a.kDecodeFinishedEvt]:"onDecodeFinished",[y.a.sendDataCallback]:"onSendDataCallback",[y.a.kGetParamRsp]:"onGetParam",[y.a.socketLinkState]:"onSocketLinkState",[y.a.getHeartBeatRequest]:"onGetHeartBeatRequest",[y.a.getHandshakeReq]:"onGetHandshakeReq",[y.a.getSetPlayBackSpeedReq]:"onGetSetPlayBackSpeedReq",[y.a.getSetPlayBackStartReq]:"onGetSetPlayBackStartReq",[y.a.deviceReady]:"onDeviceReady",[y.a.getSetPlayBackStartTimeReq]:"onGetSetPlayBackStartTimeReq",[y.a.responseCurDateTime]:"onResponseCurDateTime",[y.a.eventTypeFifoFull]:"onEventTypeFifoFull",[y.a.eventTypeFifoEnough]:"onEventTypeFifoEnough",[y.a.playbakcRecordList]:"onPlaybakcRecordList",[y.a.serverDataTimeout]:"onServerDataTimeout",[y.a.serverDecoderError]:"onDecoderError",[y.a.serverDecoderTalkError]:"onDecoderTalkError",[y.a.heartPingResp]:"onHeartPingResp",[y.a.getHandsharkRes]:"onGetHandsharkRes",[y.a.kCloseDecoderRsp]:"onCloseDecoderRsp",[y.a.onWasmLoaded]:"onWasmLoaded",[y.a.kVideoDownRep]:"onVideoDownRep",[y.a.kVideoDownChumksRep]:"onVideoDownChumksRep",[y.a.getTalkStartReq]:"onTalkStartRep",[y.a.kStartTalkEncoderRsp]:"onStartTalkEncoder",[y.a.kGetAudioDataReq]:"onGetAudioDataReq",[y.a.kgetTalkStartRep]:"onGetAudioDataRep",[y.a.closeTalk]:"onCloseTalk",[y.a.kStartTalkEncoderdeviceready]:"onkTalkEncoderdeviceready",[y.a.PlaybackOver]:"onPlaybackOver"};a[o.t]&&e[a[o.t]](o)}},M.prototype.play=function(e){this.frameBuffer.length=0,this.frameBuffer=[];let{url:t,endtime:o,isStream:a,i:r,k:s,t:i}=e,l={e:0,m:"Success"},c=this;{if(this.playerState==_)return l=this.resume(),l;if(this.playerState==E)return l;if(!t)return l={e:-1,m:"Invalid url"},this.logger.logError("[ER] playVideo error, url empty."),l;if(!a&&!o)return l={e:-1,m:"Invalid endtime"},this.logger.logError("[ER] playVideo error, endtime empty."),l;if(!("AES-256-GCM"!=i||r&&s))return l={e:-1,m:"Invalid params"},this.logger.logError("[ER] playVideo error, params empty."),l;this.initDownloadWorker(),this.initDecodeWorker(),this.initTalkWorker(),this.canvas=this._msgController.canvas,this.configInfo=null,this.configInfo=new D(e),this.playerState=E,this.isStream=a,this.endtime=o,this.webglPlayer=new n(this.canvas,{preserveDrawingBuffer:!0,antialias:!0}),this.displayLoop();const d={t:y.a.kInitDecoderReq,s:this.isStream?0:1,c:4194304,k:this.configInfo.k,i:this.configInfo.i,ct:this.configInfo.ct};this.decodeWorker.postMessage(d);let h=!1;this.registerVisibilityEvent((function(e){e&&1==c.playerState?(c.getAudioDataStatus&&!c.getAudioDating&&c.startRecord(),c.isStream?1==h&&(c.pcmPlayer&&c.pcmPlayer.resume(),c.decodeWorker.postMessage({t:y.a.resetDecoderFifo}),c.startDecoding(),h=!1):1==h&&(c.resume(),h=!1)):(c.getAudioDataStatus&&c.getAudioDating&&c.talkPause(),c.isStream?(h=!0,c.pcmPlayer&&c.pcmPlayer.pause(),c.pauseDecoding()):c.playerState==E&&(c.pause(),h=!0))})),this.buffering=!0,this.loadingState=!0,this.hideAll(),this.event.emit("GET_MEDIA_PLAY")}return l},M.prototype.seekTo=function(e){let t={e:-1,m:"Parameter Null."};if(!e)return this.logger.logError("[ER] seekTo error, time empty."),t;if(this.playerState!=E)return t.m="Player Is NotPlaying",t;this.seeking=!0,this.speeding=!1,this.pauseDecoding(),this.decodeWorker.postMessage({t:y.a.resetDecoderFifo}),this.frameBuffer.length=0;const o={t:y.a.getSetPlayBackStartTimeReq,s:e};return this.decodeWorker.postMessage(o),t.e=0,t.m="SeekTo Success.",t},M.prototype.setSpeed=function(e){let t={e:-1,m:"Parameter Null."};if(!e)return this.logger.logError("[ER] seekTo error, time empty."),t;const o=["0","1/16","1/8","1/4","1/2","1","2","4","8","16"];let a=["0","0.0625","0.125","0.25","0.5","1","2","4","8","16"].findIndex((t=>t==e));if(a>-1){this.speed(o[a]),"0"!=o[a]&&(this._curSpeed=e),this.event.emit("speedNum",o[a]);const r=parseFloat(e);return r>1&&(this.speeding=!0,this.setFrameRate=this.setFrameRateFn(),this.speedNum=2*r,this.restartAudio()),r>0&&r<1&&(this.speeding=!0,this.speedNum=2,0!=this.frameRate&&(this.setFrameRate=Math.floor(this.setFrameRateFn()/r)),this.restartAudio()),1!=r&&0!=r||(this.speeding=!1,this.speedNum=2,this.setFrameRate=this.setFrameRateFn()),t.e=0,t.m="SetSpeed Success.",t}return t.m="Invalid Parameter.",t},M.prototype.pause=function(){let e={e:-1,m:"Not playing"};if(!this.isStream)return this.playerState!=E||(this.playerState=_,this.pcmPlayer&&this.pcmPlayer.pause(),this.setSpeed("0"),this.pauseDecoding(),this.showPauseIcon(),this.event.emit("GET_MEDIA_PAUSE"),e.e=0,e.m="Pause Success."),e},M.prototype.resume=function(){this.logger.logInfo("Resume.");let e={e:-1,m:"Not pausing"};return this.playerState!=_||(this.playerState=E,this.pcmPlayer&&this.pcmPlayer.resume(),this.startDecoding(),this.setSpeed("1"),this.hideAll(),this.event.emit("GET_MEDIA_PLAY"),e.e=0,e.m="Resume Success."),e},M.prototype.stop=function(e,t){let o={e:-1,m:"Not playing."};return this.playerState==T||(this.playerState=T,this.resetPlayer(e,t),this.getAudioDataStatus&&(this.getAudioDataStatus=!1,this.talkDestroy()),o.e=0,o.m="Stop Success."),o},M.prototype.resetPlayer=function(e,t){this.closeWebsocket(),(window.cancelAnimationFrame||window.mozCancelAnimationFrame)(this.requestAnimationFrame),this.webglPlayer.webGLDestroy(),this.loadingState=!1,this.canvas=null,this.webglPlayer=null,this.frameRate=0,this.pixFmt=0,this.videoWidth=0,this.videoHeight=0,this.yLength=0,this.uvLength=0,this.audioEncoding="",this.audioChannels=0,this.audioSampleRate=0,this.sampleFmt=0,this.speedNum=2,this.setFrameRate=1,this.playerState=T,this.socketSending=!1,this.decoding=!1,this.currentTimestamp="",this.frameBuffer.length=0,this.frameBuffer=[],this.buffering=!1,this.drawingState=!1,this.speeding=!1,this.playInitState=!0,this.playFirstGetParams=!0,w=0,this.requestAnimationFrame=null,this.endtime=null,this._curSpeed=null,this.pcmPlayer&&(this.pcmPlayer.destroy(),this.pcmPlayer=null,this.logger.logInfo("Pcm player released.")),this.logger.logInfo("Closing decoder."),this.decodeWorker.postMessage({t:y.a.kUninitDecoderReq}),this.showMsg(e,t),this.logger.logInfo("Uniniting decoder."),this.observer=null},M.prototype.reconnection=function(){const e={url:this.configInfo.url,endtime:this.configInfo.endtime,isStream:this.configInfo.isStream,k:this.configInfo.k,i:this.configInfo.i,ct:this.configInfo.ct,streamHighWaterFrame:this.configInfo.streamHighWaterFrame,playbackHighWaterFrame:this.configInfo.playbackHighWaterFrame,playbackLowWaterFrame:this.configInfo.playbackLowWaterFrame,language:this.configInfo.language?this.configInfo.language:"ch",deviceName:this.configInfo.deviceName?this.configInfo.deviceName:"设备"};this.play(e)},M.prototype.getCurTimestamp=function(){return this.currentTimestamp},M.prototype.fullscreen=function(){this.webglPlayer&&this.webglPlayer.fullscreen()},M.prototype.getState=function(){return this.playerState},M.prototype.volume=function(e){let t={e:-1,m:"Parameter Null"};return null===e||(null!==this.pcmPlayer&&this.pcmPlayer.volume(e),this.currentVolume=e,t.e=0,t.m="Set Volume Success."),t},M.prototype.recoderStart=function(){var e={t:y.a.recoderStart};this.decodeWorker.postMessage(e)},M.prototype.recoderPause=function(){var e={t:y.a.recoderPause};this.decodeWorker.postMessage(e)},M.prototype.setFrameRateFn=function(){return 1},M.prototype.displayLoop=function(){if(this.playerState!=T){let e=window.requestAnimationFrame||window.mozRequestAnimationFrame;this.requestAnimationFrame=e(this.displayLoop.bind(this))}if(this.playerState==E&&0!=this.frameBuffer.length&&!this.buffering)if(!this.isStream&&w5==e.t))}break;case y.a.kVideoFrame:if(this.displayVideoFrame(e)){this.frameBuffer.shift(),w=0;this.frameBuffer.filter((e=>4==e.t))}break;default:return}if(0==this.frameBuffer.length)break}!this.isStream&&this.frameBuffer.length>=this.configInfo.playbackHighWaterFrame&&this.socketSending&&(this.setSpeed("0"),this.event.emit("speedNum",0)),!this.isStream&&this.frameBuffer.length=this.configInfo.streamHighWaterFrame&&(this.frameBuffer=[])}},M.prototype.displayAudioFrame=function(e){if(this.playerState!=E)return!1;if(this.speeding)return!0;if(this.seeking&&(this.restartAudio(),this.loadingState=!1,this.seeking=!1),this.pcmPlayer){(new Date).getTime();this.pcmPlayer.feed(e.d)}return!0},M.prototype.displayVideoFrame=function(e){if(this.playerState!=E)return!1;if(this.seeking&&(this.restartAudio(),this.loadingState=!1,this.seeking=!1),this.drawingState){this.canvas.toBlob((e=>{this._onSnapshot(e)})),this.drawingState=!1;(function(){const e=document.createElement("a");document.body.appendChild(e),e.style.display="none"})()}(new Date).getTime();var t=new Uint8Array(e.d);return this.renderVideoFrame(t),!0},M.prototype.renderVideoFrame=function(e){this.webglPlayer.renderFrame(e,this.videoWidth,this.videoHeight,this.yLength,this.uvLength)},M.prototype.onFileData=function(e){var t;t={t:y.a.kFeedDataReq,d:e},this.decodeWorker.postMessage(t,[t.d])},M.prototype.onsocketActiveClose=function(e,t){let o="连接失败";this.serverDataTimeout&&(this.serverDataTimeout=!1),this.decoderErrorFlag?(this.event.emit("CLIENT_LINK_ERROR_ONE"),o=(this.configInfo.deviceName?this.configInfo.deviceName+":":"")+"数据接收超时!(0x"+this.serverDeviceUnLinkCode.toString(16)+")",this.decoderErrorFlag=!1):this.socketNoActive?(this.event.emit("CLIENT_LINK_ERROR_THREE"),o=(this.configInfo.deviceName?this.configInfo.deviceName+":":"")+"视频加载失败,请检查设备或网络配置!",this.socketNoActive=!1):1005==e||1e3==e||t?this.decoderErrorFlag&&(this.event.emit("CLIENT_LINK_ERROR_ONE"),o=(this.configInfo.deviceName?this.configInfo.deviceName+":":"")+"链接异常(0x"+this.serverDeviceUnLinkCode.toString(16)+")",this.decoderErrorFlag=!1):this.serverDeviceUnLinkCode?(o=(this.configInfo.deviceName?this.configInfo.deviceName+":":"")+"链接异常(0x"+this.serverDeviceUnLinkCode.toString(16)+")",this.event.emit("CLIENT_LINK_ERROR_ONE")):(o=(this.configInfo.deviceName?this.configInfo.deviceName+":":"")+"链接异常("+e+")",this.event.emit("CLIENT_LINK_ERROR_ONE")),this.stop("linkfail",o)},M.prototype.onsocketTalkActiveClose=function(e){1005===e&&1e3===e||this.talkDestroy()},M.prototype.onsocketNoActive=function(){this.stop(),this.socketNoActive=!0},M.prototype.onInitDecoder=function(e){if(this.playerState!=T)if(this.logger.logInfo("Init decoder response "+e.e+"."),0==e.e){const e={t:y.a.fetchStream,url:this.configInfo.url,msg:"start"};this.downloadWorker.postMessage(e),this.socketSending=!0,this.showLoading()}else this.reportPlayError(e.e)},M.prototype.onSendDataCallback=function(){const e={t:y.a.kOpenDecoderReq};this.decodeWorker.postMessage(e)},M.prototype.onOpenDecoder=function(e){this.startDecoding()},M.prototype.startDecoding=function(){var e={t:y.a.kStartDecodingReq,i:5};this.decodeWorker.postMessage(e),this.decoding=!0},M.prototype.onGetParam=function(e){if(this.playerState!=T&&this.playerState!=_)if(0==e.e){if(!this.playFirstGetParams&&("video"==e.type&&(this.frameRate!=e.v.d||this.pixFmt!=e.v.p||this.videoWidth!=e.v.w||this.videoHeight!=e.v.h)||"audio"==e.type&&(this.audioChannels!=e.a.c||this.audioSampleRate!=e.a.r||this.sampleFmt!=e.a.f)))return this.resetPlayer(),void setTimeout((()=>{this.reconnection()}),1e3);"audio"==e.type?this.onAudioParam(e.a):this.onVideoParam(e.v),this.decoding=!0,this.buffering=!1,this.loadingState=!1,this.hideAll(),this.event.emit("MEDIA_INFO",e)}else this.reportPlayError(e.e)},M.prototype.onVideoParam=function(e){if(this.playerState==T)return;this.logger.logInfo("Video param duation:"+e.d+" pixFmt:"+e.p+" width:"+e.w+" height:"+e.h+"."),this.frameRate=e.d,this.pixFmt=e.p,this.canvas.width=e.w,this.canvas.height=e.h;let t=Math.ceil(1e5*parseInt(getComputedStyle(this.el).width)/e.w)/1e5,o=Math.ceil(1e5*parseInt(getComputedStyle(this.el).height)/e.h)/1e5;this.canvas.style.cssText=`transform: scale(${t},${o});transform-origin: 0 0;position:absolute;left: 0;top: 0;`,this.videoWidth=e.w,this.videoHeight=e.h,this.yLength=this.videoWidth*this.videoHeight,this.uvLength=this.videoWidth/2*(this.videoHeight/2)},M.prototype.onAudioParam=function(e){if(this.playerState!=T&&(this.logger.logInfo("Audio param sampleFmt:"+e.f+" channels:"+e.c+" sampleRate:"+e.r+"."),0!=e.r&&0!=e.c)){var t=e.f;this.sampleFmt=e.f;var o=e.c,a=e.r,s="16bitInt";switch(t){case 0:s="8bitInt";break;case 1:s="16bitInt";break;case 2:s="32bitInt";break;case 3:s="32bitFloat";break;default:this.logger.logError("Unsupported audio sampleFmt "+t+"!")}this.logger.logInfo("Audio encoding "+s+"."),this.playInitState&&(this.pcmPlayer=new r({encoding:s,channels:o,sampleRate:a,flushingTime:100}),this.audioEncoding=s,this.audioChannels=o,this.audioSampleRate=a,this.playInitState=!1,this.volume(0))}},M.prototype.onAudioFrame=function(e){this.bufferFrame(e)},M.prototype.onVideoFrame=function(e){if(this.frameBuffer.filter((e=>4==e.t)).length>5){let e=this.frameBuffer.filter((e=>5==e.t));this.frameBuffer=e}this.bufferFrame(e)},M.prototype.bufferFrame=function(e){this.frameBuffer.push(e),this.getBufferTimerLength()>=500&&this.buffering&&(this.buffering=!1,this.loadingState=!1)},M.prototype.onSocketLinkState=function(e){var t;switch(this.logger.logInfo("Open socket response "+e.s+"."),e.s){case 1:t={t:y.a.getHeartBeatRequest},this.decodeWorker.postMessage(t);break;case 2:case 3:this.stop()}},M.prototype.onGetHeartBeatRequest=function(e){const t={t:y.a.DownloaderHeartBeat,b:e.b,l:e.l};this.downloadWorker.postMessage(t),this.talkWorker.postMessage(t)},M.prototype.onGetHandshakeReq=function(e){const t={t:y.a.DownloaderHandshakeReq,b:e.b,l:e.l},o={t:y.a.TalkHandshakeReq,b:e.b,l:e.l};this.downloadWorker.postMessage(t),this.talkWorker.postMessage(o),this.setSpeed("1")},M.prototype.onGetSetPlayBackSpeedReq=function(e){const t={t:y.a.getSetPlayBackSpeedReq,b:e.b};this.downloadWorker.postMessage(t)},M.prototype.onGetSetPlayBackStartReq=function(e){const t={t:y.a.getSetPlayBackStartReq,b:e.b};this.downloadWorker.postMessage(t)},M.prototype.onDeviceReady=function(){const e={t:y.a.getSetPlayBackStartReq};this.decodeWorker.postMessage(e)},M.prototype.onGetSetPlayBackStartTimeReq=function(e){this.startDecoding();const t={t:y.a.getSetPlayBackStartTimeReq,b:e.b};this.downloadWorker.postMessage(t)},M.prototype.onResponseCurDateTime=function(e){String(e.d).replace("n","");this.currentTimestamp=e.d;const t=new Date(this.endtime).getTime();parseInt(e.d)>=t&&this.event.emit("MEDIA_PROGRESS_INFO_STOP",parseInt(e.d)),this.event.emit("MEDIA_PROGRESS_INFO",parseInt(e.d))},M.prototype.onEventTypeFifoFull=function(e){this.playerState==E&&(this.setSpeed("0"),this.event.emit("speedNum",0))},M.prototype.onEventTypeFifoEnough=function(e){this.playerState==E&&(this._curSpeed?(this.setSpeed(this._curSpeed),this.event.emit("speedNum",this._curSpeed)):(this.setSpeed("1"),this.event.emit("speedNum",1)))},M.prototype.onServerDataTimeout=function(e){this.serverDataTimeout=!0,this.stop()},M.prototype.onGetHandsharkRes=function(e){const t=window.btoa(String.fromCharCode(...e.b)),o={t:y.a.fetchStream,url:this.configInfo.url+"&public_key="+t,msg:"start"};this.downloadWorker.postMessage(o),this.socketSending=!0,this.showLoading()},M.prototype.onCloseDecoderRsp=function(){this.event.emit("MEDIA_STOP"),this.decodeWorker.terminate(),this.downloadWorker.terminate(),this.talkWorker.terminate()},M.prototype.onWasmLoaded=function(){this.event.emit("WASMLOADED")},M.prototype.onPlaybakcRecordList=function(e){let t=JSON.parse(e.d);t.rec_file_infos?this.isStream||this.event.emit("DEVICE_RECORD_LIST",t):this.showMsg("linkfail",(this.configInfo.deviceName?this.configInfo.deviceName+":":"")+"数据列表为空!")},M.prototype.onHeartPingResp=function(){const e={t:y.a.heartPingResp};this.downloadWorker.postMessage(e)},M.prototype.onDecoderError=function(e){let t="连接失败(服务)";this.serverDeviceUnLinkCode=e.s,b[e.s]&&b[e.s].eventStr&&(this.event.emit(b[e.s].eventStr,b[e.s]),t=(this.configInfo.deviceName?this.configInfo.deviceName+":":"")+b[e.s].msg+"(0x"+this.serverDeviceUnLinkCode.toString(16)+")",this.stop("linkfail",t)),this.event.emit("decoderError",e),this.decoderErrorFlag=!0},M.prototype.speed=function(e){if(!e)return;this.socketSending="0"!=e;const t={t:y.a.getSetPlayBackSpeedReq,l:e};this.decodeWorker.postMessage(t)},M.prototype.restartAudio=function(){this.pcmPlayer&&(this.pcmPlayer.destroy(),this.pcmPlayer=null),0!=this.audioSampleRate&&0!=this.audioChannels&&(this.pcmPlayer=new r({encoding:this.audioEncoding,channels:this.audioChannels,sampleRate:this.audioSampleRate,flushingTime:1e3}),this.volume(this.currentVolume))},M.prototype.onDecodeFinished=function(e){this.pauseDecoding()},M.prototype.getBufferTimerLength=function(){if(!this.frameBuffer||0==this.frameBuffer.length)return 0;let e=this.frameBuffer[0],t=this.frameBuffer[this.frameBuffer.length-1];return Math.abs(t.s-e.s)},M.prototype.closeWebsocket=function(){const e={t:y.a.closeWebsocket};this.downloadWorker.postMessage(e)},M.prototype.pauseDecoding=function(){var e={t:y.a.kPauseDecodingReq};this.decodeWorker.postMessage(e),this.decoding=!1},M.prototype.formatTime=function(e){return(Math.floor(e/3600)<10?"0"+Math.floor(e/3600):Math.floor(e/3600))+":"+(Math.floor(e/60%60)<10?"0"+Math.floor(e/60%60):Math.floor(e/60%60))+":"+(e=Math.floor(e%60)<10?"0"+Math.floor(e%60):Math.floor(e%60))},M.prototype.reportPlayError=function(e,t,o){},M.prototype.registerVisibilityEvent=function(e){var t="hidden";function o(o){var a=!0,r=!1,s={focus:a,focusin:a,pageshow:a,blur:r,focusout:r,pagehide:r},i=a;i=(o=o||window.event).type in s?s[o.type]:document[t]?r:a,e(i)}t in document?document.addEventListener("visibilitychange",o):(t="mozHidden")in document?document.addEventListener("mozvisibilitychange",o):(t="webkitHidden")in document?document.addEventListener("webkitvisibilitychange",o):(t="msHidden")in document?document.addEventListener("msvisibilitychange",o):"onfocusin"in document?document.onfocusin=document.onfocusout=o:window.onpageshow=window.onpagehide=window.onfocus=window.onblur=o,void 0!==document[t]&&o({type:document[t]?"blur":"focus"})},M.prototype.snapshot=function(){this.drawingState=!0},M.prototype.onVideoDownRep=function(e){let t=e.d.map((e=>e.buffer));const o=document.createElement("a");o.style.display="none";const a=new Blob(t,{type:"video/mp4"}),r=window.URL.createObjectURL(a);o.href=r,o.download="录像"+(new Date).getTime()+".mp4",document.body.appendChild(o),o.click(),o.remove(),e.d=[]},M.prototype.onVideoDownChumksRep=function(e){e.d.length>=25&&(this.recoderPause(),this.event.emit("VIDEO_MAX_END"))},M.prototype.initTalkWorker=function(){var e=this;this.talkWorker=new u,this.talkWorker.onmessage=function(t){var o=t.data;switch(o.t){case y.a.kGetDeviceInfo:e.decodeWorker.postMessage(o);break;case y.a.socketActiveClose:e.onsocketTalkActiveClose(o.d);break;case y.a.getTalkStartReq:const t={t:y.a.getTalkStartReq,b:"",msg:""};e.decodeWorker.postMessage(t);break;case y.a.socketNoActive:e.onsocketNoActive();break;case y.a.DestroyTalkRes:break;case y.a.initTalkEncode:const a={t:y.a.initTalkEncode,b:"",msg:""};e.decodeWorker.postMessage(a)}}},M.prototype.onTalkStartRep=function(e){const t={t:y.a.talkStartRep,b:e.b,msg:"start"};this.talkWorker.postMessage(t)},M.prototype.onStartTalkEncoder=function(e){const t={t:y.a.kStartTalkEncoderRsp,b:e.b};this.decodeWorker.postMessage(t)},M.prototype.talk=function(e){const t={t:y.a.fetchStream,url:e};this.talkWorker.postMessage(t)},M.prototype.onGetAudioDataReq=function(){this.getAudioDataStatus=!0,this.startRecord()},M.prototype.onGetAudioDataRep=function(e){this.talkWorker.postMessage(e)},M.prototype.onkTalkEncoderdeviceready=function(){const e={t:y.a._getTalkStartReq,b:"",msg:""};this.decodeWorker.postMessage(e)},M.prototype.onPlaybackOver=function(){this.event.emit("PLAYBACKOVER")},M.prototype.onDecoderTalkError=function(e){b[e.s]&&b[e.s].eventStr&&this.event.emit(b[e.s].eventStr,b[e.s],"talk"),this.event.emit("CLIENT_TALK_ERROR_ONE",e),this.talkDestroy()};M.prototype.startRecord=function(){this.getAudioDating=!0,this.talkRecord||navigator.mediaDevices.getUserMedia({audio:{sampleRate:48e3,sampleSize:16,channelCount:1,volume:1,noiseSuppression:!0,echoCancellation:!0}}).then((e=>{this.talkStream=e,this.talkRecord=new S(this.talkStream),this.talkRecord.start(),this.talkTimer=setInterval((async()=>{if(this.getAudioDating&&this.talkRecord){let t=this.talkRecord.getBlob();this.talkRecord.clear();let o=await(e=t,new Promise(((t,o)=>{let a=new FileReader;a.readAsArrayBuffer(e),a.onload=function(e){a.result.slice(0,24e3),t({d:a.result,t:(new Date).getTime(),h:a.result.byteLength})}})));const a={t:y.a.pcmDataReq,p:o};this.decodeWorker.postMessage(a)}var e}),50)})).catch((e=>{this.event.emit("getUserMediaError")}))},M.prototype.talkPause=function(){this.talkRecord&&(clearInterval(this.talkTimer),this.talkRecord.stop(),this.talkRecord.clear(),this.talkRecord=null,this.talkStream.getTracks().forEach((e=>e.stop())),this.getAudioDating=!1)},M.prototype.onCloseTalk=function(e){this.event.emit("CLIENT_TALK_ERROR_ONE",e),this.talkDestroy()},M.prototype.talkDestroy=function(){this.talkRecord&&(clearInterval(this.talkTimer),this.talkRecord.stop(),this.talkRecord.clear(),this.talkRecord=null,this.talkStream.getTracks().forEach((e=>e.stop())),this.getAudioDating=!1);const e={t:y.a.DestroyTalkReq};this.talkWorker.postMessage(e),this.decodeWorker.postMessage(e)};t.default=M}])})); \ No newline at end of file diff --git a/public/sdk/talk.worker b/public/sdk/talk.worker new file mode 100644 index 0000000..e69de29 diff --git a/src/pages/ElecEvaluation/Monitor/RoomDetail/assessts/dian.png b/src/pages/ElecEvaluation/Monitor/RoomDetail/assessts/dian.png new file mode 100644 index 0000000..cbbfa76 Binary files /dev/null and b/src/pages/ElecEvaluation/Monitor/RoomDetail/assessts/dian.png differ diff --git a/src/pages/ElecEvaluation/Monitor/RoomDetail/assessts/gb.png b/src/pages/ElecEvaluation/Monitor/RoomDetail/assessts/gb.png new file mode 100644 index 0000000..f15f026 Binary files /dev/null and b/src/pages/ElecEvaluation/Monitor/RoomDetail/assessts/gb.png differ diff --git a/src/pages/ElecEvaluation/Monitor/RoomDetail/assessts/hf.png b/src/pages/ElecEvaluation/Monitor/RoomDetail/assessts/hf.png new file mode 100644 index 0000000..55442fb Binary files /dev/null and b/src/pages/ElecEvaluation/Monitor/RoomDetail/assessts/hf.png differ diff --git a/src/pages/ElecEvaluation/Monitor/RoomDetail/assessts/j.png b/src/pages/ElecEvaluation/Monitor/RoomDetail/assessts/j.png new file mode 100644 index 0000000..a63927a Binary files /dev/null and b/src/pages/ElecEvaluation/Monitor/RoomDetail/assessts/j.png differ diff --git a/src/pages/ElecEvaluation/Monitor/RoomDetail/assessts/ja.png b/src/pages/ElecEvaluation/Monitor/RoomDetail/assessts/ja.png new file mode 100644 index 0000000..034da75 Binary files /dev/null and b/src/pages/ElecEvaluation/Monitor/RoomDetail/assessts/ja.png differ diff --git a/src/pages/ElecEvaluation/Monitor/RoomDetail/assessts/jie.png b/src/pages/ElecEvaluation/Monitor/RoomDetail/assessts/jie.png new file mode 100644 index 0000000..83e6f46 Binary files /dev/null and b/src/pages/ElecEvaluation/Monitor/RoomDetail/assessts/jie.png differ diff --git a/src/pages/ElecEvaluation/Monitor/RoomDetail/assessts/jie_d.png b/src/pages/ElecEvaluation/Monitor/RoomDetail/assessts/jie_d.png new file mode 100644 index 0000000..43125c8 Binary files /dev/null and b/src/pages/ElecEvaluation/Monitor/RoomDetail/assessts/jie_d.png differ diff --git a/src/pages/ElecEvaluation/Monitor/RoomDetail/assessts/luxiang_a.png b/src/pages/ElecEvaluation/Monitor/RoomDetail/assessts/luxiang_a.png new file mode 100644 index 0000000..b38f7aa Binary files /dev/null and b/src/pages/ElecEvaluation/Monitor/RoomDetail/assessts/luxiang_a.png differ diff --git a/src/pages/ElecEvaluation/Monitor/RoomDetail/assessts/luxiang_a1.png b/src/pages/ElecEvaluation/Monitor/RoomDetail/assessts/luxiang_a1.png new file mode 100644 index 0000000..5eafc8f Binary files /dev/null and b/src/pages/ElecEvaluation/Monitor/RoomDetail/assessts/luxiang_a1.png differ diff --git a/src/pages/ElecEvaluation/Monitor/RoomDetail/assessts/lx.png b/src/pages/ElecEvaluation/Monitor/RoomDetail/assessts/lx.png new file mode 100644 index 0000000..bc80b5c Binary files /dev/null and b/src/pages/ElecEvaluation/Monitor/RoomDetail/assessts/lx.png differ diff --git a/src/pages/ElecEvaluation/Monitor/RoomDetail/assessts/lx_d.png b/src/pages/ElecEvaluation/Monitor/RoomDetail/assessts/lx_d.png new file mode 100644 index 0000000..4b76783 Binary files /dev/null and b/src/pages/ElecEvaluation/Monitor/RoomDetail/assessts/lx_d.png differ diff --git a/src/pages/ElecEvaluation/Monitor/RoomDetail/assessts/lx_t.png b/src/pages/ElecEvaluation/Monitor/RoomDetail/assessts/lx_t.png new file mode 100644 index 0000000..cbbfa76 Binary files /dev/null and b/src/pages/ElecEvaluation/Monitor/RoomDetail/assessts/lx_t.png differ diff --git a/src/pages/ElecEvaluation/Monitor/RoomDetail/assessts/play copy.png b/src/pages/ElecEvaluation/Monitor/RoomDetail/assessts/play copy.png new file mode 100644 index 0000000..20b1873 Binary files /dev/null and b/src/pages/ElecEvaluation/Monitor/RoomDetail/assessts/play copy.png differ diff --git a/src/pages/ElecEvaluation/Monitor/RoomDetail/assessts/play.png b/src/pages/ElecEvaluation/Monitor/RoomDetail/assessts/play.png new file mode 100644 index 0000000..d349340 Binary files /dev/null and b/src/pages/ElecEvaluation/Monitor/RoomDetail/assessts/play.png differ diff --git a/src/pages/ElecEvaluation/Monitor/RoomDetail/assessts/qp.png b/src/pages/ElecEvaluation/Monitor/RoomDetail/assessts/qp.png new file mode 100644 index 0000000..b2995f2 Binary files /dev/null and b/src/pages/ElecEvaluation/Monitor/RoomDetail/assessts/qp.png differ diff --git a/src/pages/ElecEvaluation/Monitor/RoomDetail/assessts/yl.png b/src/pages/ElecEvaluation/Monitor/RoomDetail/assessts/yl.png new file mode 100644 index 0000000..d5aeb19 Binary files /dev/null and b/src/pages/ElecEvaluation/Monitor/RoomDetail/assessts/yl.png differ diff --git a/src/pages/ElecEvaluation/Monitor/RoomDetail/assessts/yy.png b/src/pages/ElecEvaluation/Monitor/RoomDetail/assessts/yy.png new file mode 100644 index 0000000..44975b8 Binary files /dev/null and b/src/pages/ElecEvaluation/Monitor/RoomDetail/assessts/yy.png differ diff --git a/src/pages/ElecEvaluation/Monitor/RoomDetail/assessts/yy_a.png b/src/pages/ElecEvaluation/Monitor/RoomDetail/assessts/yy_a.png new file mode 100644 index 0000000..317e0ad Binary files /dev/null and b/src/pages/ElecEvaluation/Monitor/RoomDetail/assessts/yy_a.png differ diff --git a/src/pages/ElecEvaluation/Monitor/RoomDetail/assessts/yy_s.png b/src/pages/ElecEvaluation/Monitor/RoomDetail/assessts/yy_s.png new file mode 100644 index 0000000..bfc7bb9 Binary files /dev/null and b/src/pages/ElecEvaluation/Monitor/RoomDetail/assessts/yy_s.png differ diff --git a/src/pages/ElecEvaluation/Monitor/RoomDetail/assessts/zk.png b/src/pages/ElecEvaluation/Monitor/RoomDetail/assessts/zk.png new file mode 100644 index 0000000..d4bec8c Binary files /dev/null and b/src/pages/ElecEvaluation/Monitor/RoomDetail/assessts/zk.png differ diff --git a/src/pages/ElecEvaluation/Monitor/RoomDetail/assessts/zz.png b/src/pages/ElecEvaluation/Monitor/RoomDetail/assessts/zz.png new file mode 100644 index 0000000..a3be511 Binary files /dev/null and b/src/pages/ElecEvaluation/Monitor/RoomDetail/assessts/zz.png differ diff --git a/src/pages/ElecEvaluation/Monitor/RoomDetail/index.tsx b/src/pages/ElecEvaluation/Monitor/RoomDetail/index.tsx index 3aca17b..b08a0f4 100644 --- a/src/pages/ElecEvaluation/Monitor/RoomDetail/index.tsx +++ b/src/pages/ElecEvaluation/Monitor/RoomDetail/index.tsx @@ -12,9 +12,13 @@ import { getDicData, getSessionRoleData } from "@/utils/session"; import strangerIcon from '@/assets/monitor/stranger-icon.png'; import numberIcon from '@/assets/monitor/number-icon.png'; import { bidStatusMap } from '../Room'; -import ReactPlayer from 'react-player/file'; +//import ReactPlayer from 'react-player/file'; import moment from "moment"; import { ConsoleSqlOutlined } from '@ant-design/icons'; +import Player from './js/player'; +import JTimeLine from "./js/JtimeLine"; +import '../wasmStyle.less' +import dayjs from "dayjs"; const statusMap = ["未报道", "已报道"]; const peopleNumColumns: any[] = [ @@ -58,7 +62,7 @@ const backPeopleNumColumns: any[] = [ onCell, onHeaderCell, }, - { + { title: '阈值', dataIndex: 'thresholdOfPeople', key: 'thresholdOfPeople', @@ -135,6 +139,10 @@ const MonitorRoomDetail: React.FC<{}> = (props: any) => { //let basicInfoObj = useState({}); //异常预警数据 const [earlyWarnData, setEarlyWarnData] = useState(); + //陌生人告警数量 + const [strangerCount, setStrangerCount] = useState(); + //人数告警数量 + const [numberCount, setNumberCount] = useState(); //设备列表 const [caremaList, setCaremaList] = useState([]); @@ -164,10 +172,34 @@ const MonitorRoomDetail: React.FC<{}> = (props: any) => { const auth = useRef(authCheck(["ebtp-watcher", "ebtp-site-supervision", "ebtp-after-supervision"])); //协议 - const [protocol, setProtocol] = useState('hls'); + const [protocol, setProtocol] = useState('ws'); //码流 const [streamType, setStreamType] = useState('0'); + //播放器ref + const playerRefList = useRef([]); + + //回播组件 + const jTimeLineRef = useRef(); + //jTimeLineArr + const jTimeLineArr = useRef([]); + //基础数据ref + const basicInfoRef = useRef(null); + //回放定时器 + const timeLineTimerRef = useRef(null); + //定时时间 + const timerMsRef = useRef(1000); + //设备ref + const deviceInfoRef = useRef(null); + //回放进度条长度 + const [recordWidthRef, setRecordWidthRef] = useState(1000); + //进度条大小 + const currentScaleRef = useRef(0); + //倍速 + const [speed, setSpeed] = useState(1); + //倍速序号 + const speedindexRef = useRef(0); + const onCaremaPlay = (item: any) => { setCameraSelect(item.serialNumber); //setCameraParams(item.platform); @@ -176,29 +208,43 @@ const MonitorRoomDetail: React.FC<{}> = (props: any) => { // } else { // videoRef.current?.play(item.deviceCode); // } - onGetLiveStream(basicInfo,item); + //onGetLiveStream(basicInfo,item); + var i = 0; + playerRefList.current.forEach((element) => { + onGetLiveStream(basicInfoRef.current,item,element); + i++; + }); + } - const onGetLiveStream = (basicInfoObj:any,item: any) =>{ - - if (basicInfoObj?.status == "2") { - getRecordPlaybackTime({deviceSn:item.sn, - channelNum:item.serialNumber, - protocol:protocol, - startTime:moment(basicInfoObj?.startDate).format('yyyyMMDDHHmmss'), - endTime:moment(basicInfoObj?.endDate).format('yyyyMMDDHHmmss')}).then(res=>{ - if (res?.code == 200) { - const data = res?.data; - setVideoUrl(data.url); - } - }) - }else{ - getLiveStream({deviceSn:item.sn,channelNum:item.serialNumber,protocol:protocol,streamType:streamType}).then(res=>{ - if (res?.code == 200) { - const data = res?.data; - setVideoUrl(data.url); - } - }) + const onGetLiveStream = (basicInfoObj:any,item: any,player:any) =>{ + if(item!=null){ + if (basicInfoObj?.status == "2") { + getRecordPlaybackTime({deviceSn:item.sn, + channelNum:item.serialNumber, + protocol:protocol, + startTime:moment(basicInfoObj?.startDate).format('yyyyMMDDHHmmss'), + endTime:moment(basicInfoObj?.endDate).format('yyyyMMDDHHmmss')}).then(res=>{ + if (res?.code == 200) { + const data = res?.data; + if(data!=null){ + toplayer(data.url,moment(basicInfoObj?.endDate).format('yyyyMMDDHHmmss'),player); + } + + //setVideoUrl(data.url); + } + }) + }else{ + getLiveStream({deviceSn:item.sn,channelNum:item.serialNumber,protocol:protocol,streamType:streamType}).then(res=>{ + if (res?.code == 200) { + const data = res?.data; + //setVideoUrl(data.url); + if(data!=null){ + toplayer(data.url,null,player); + } + } + }) + } } } @@ -236,34 +282,18 @@ const MonitorRoomDetail: React.FC<{}> = (props: any) => { data["supplierLength"] = 0; } setBasicInfo(data); + basicInfoRef.current = data; getCaremaData(data);//获取监控点列表 if (data.status == "2") {//评标结束-回看 getBackList("2");//数量预警 ((roleCode != "ebtp-site-supervision") && (roleCode != "ebtp-after-supervision")) && getBackList("3");//陌生人预警 } + } }) } //获取异常预警数据 const getWarnInfo = () => { - //new - // console.log("----------basicInfo2"); - // console.log(basicInfo); - // console.log(deviceInfo); - // getAlarmMetadata1({ deviceSn: deviceInfo?.sn, - // startTime:moment(basicInfo?.startDate).format('yyyyMMDDHHmmss'), - // endTime:moment(basicInfo?.endDate).format('yyyyMMDDHHmmss'), - // pageNum:"1", - // pageSize:"200"}).then(res => { - // if (res?.code == 200) { - // const data = res?.data; - // console.log(data); - // if (data && data.length > 0) { - // setStrangerList(data.list); - // setBackStrangerList(data.list); - // } - // } - // }) getWarnData({ reserveId: monitorId }).then(res => { if (res?.code == 200) { @@ -283,16 +313,44 @@ const MonitorRoomDetail: React.FC<{}> = (props: any) => { setCaremaList(list); if (list.length > 0) { setDeviceInfo(list[0]); + deviceInfoRef.current = list[0]; setCameraSelect(list[0].serialNumber); - //setCameraParams(data[0].platform); - setTimeout(() => { - - }, 1000); - onGetLiveStream(baseData,list[0]); + onCaremaPlay(list[0]); + // var i = 0; + // playerRefList.current.forEach((element) => { + // onGetLiveStream(baseData,list[i]?list[i]:null,element); + // i++; + // }); + } } }) } + //播放 + const toplayer = (url:any,endtime:any,player:any) => { + console.log("playerRef.current.getState() :"+player.getState()) + if (player.getState() != 0) { + player.stop(); + player.talkDestroy(); + } + let options = { + url: url, + endtime: endtime, + isStream: true, + encrypted_key: "", + encrypted_iv: "", + encrypted_type: "" + }; + setTimeout(() => { + player.play(options); + if(basicInfoRef?.current.status == "2"){ + setTimeout(() => { + jTimeLinePlayer(); + }, 1000); + } + }, 1000); + + } //获取专家报道列表 const getExpertList = () => { getExpertReports({ reserveId: monitorId, pageNo: 1, pageSize: 20 }).then(res => { @@ -327,6 +385,7 @@ const MonitorRoomDetail: React.FC<{}> = (props: any) => { } }) } + //初始化字典 const initDict = () => { //采购方式字典 @@ -371,16 +430,97 @@ const MonitorRoomDetail: React.FC<{}> = (props: any) => { } } - useEffect(() => { + const handleTimeChange = (nowTime: any) => { + playerRefList.current[0].seekTo(nowTime); + } + + const jTimeLinePlayer = () =>{ - console.log("----------basicInfo"); - console.log(basicInfo); + var container = document.getElementById("container0"); + setRecordWidthRef(container?.clientWidth); + + //初始化回播组件 + jTimeLineRef.current = new JTimeLine(); + jTimeLineRef.current.init({ + id: "canvas", + onChange: handleTimeChange, + }); + + jTimeLineRef.current.run({ time: parseInt(playerRefList.current[0].getCurTimestamp()) }); + changeTimer(); + } + + const changeTimer = ()=> { + if(timeLineTimerRef.current){ + clearInterval(timeLineTimerRef.current); + } + + timeLineTimerRef.current = setInterval(() => { + jTimeLineRef.current.run({ time: parseInt(playerRefList.current[0].getCurTimestamp()) }); + }, timerMsRef.current); + } + + const fullscreen = () => { + playerRefList.current[0].fullscreen(); + } + const infoPlayer = () =>{ + for(var i = 0 ; i < 1 ; i ++){ + playerRefList.current[i] = new Player(document.getElementById("container"+i),null); + } + } + + const mathchDot = (currentScale:any) => { + var position = 0; + switch (currentScale) { + case 0: + (position = 0), jTimeLineRef.current.changeSize(0); + break; + case 1: + (position = 30), jTimeLineRef.current.changeSize(1); + break; + case 2: + (position = 60), jTimeLineRef.current.changeSize(2); + break; + case 3: + (position = 100), jTimeLineRef.current.changeSize(3); + } + document.getElementsByClassName("dot-container-dot")[0].style.left = position + "%"; + } + + const onReduce = () => { + currentScaleRef.current > 0 && (--currentScaleRef.current, mathchDot(currentScaleRef.current)); + } + const onAdd = () => { + currentScaleRef.current < 3 && (++currentScaleRef.current, mathchDot(currentScaleRef.current)); + } + + const setSpeedFun = () =>{ + if (playerRefList.current[0].getState() == 2) return; + const arr = ["1", "2", "4", "8", "4", "2", "1", "1/2", "1/4", "1/8", "1/4", "1/2"]; + const arr2 = [1, 2, 4, 8, 4, 2, 1, 0.5, 0.25, 0.125, 0.25, 0.5]; + speedindexRef.current++; + if (speedindexRef.current == 12) { + speedindexRef.current=0; + } + setSpeed(arr[speedindexRef.current]); + + playerRefList.current[0].setSpeed(arr2[speedindexRef.current] + ""); + timerMsRef.current = 1000/arr2[speedindexRef.current]; + changeTimer(); + } + + useEffect(() => { + if(timeLineTimerRef.current){ + clearInterval(timeLineTimerRef.current); + } + //初始化播放器 + infoPlayer(); if (auth) { initDict(); getRoomData(); getWarnInfo(); getExpertList(); - if (roleCode == "ebtp-site-supervision" || roleCode == "ebtp-after-supervision") { getAllStrangerList(); } + if (roleCode == "ebtp-site-supervision" || roleCode == "ebtp-after-supervision") { getAllStrangerList();} } }, []) //定时器 @@ -400,6 +540,7 @@ const MonitorRoomDetail: React.FC<{}> = (props: any) => { }; }, [basicInfo]) + return (
@@ -460,17 +601,50 @@ const MonitorRoomDetail: React.FC<{}> = (props: any) => {
- {/* {cameraParams && } */} - - + +
fullscreen()}>
+ {basicInfo?.status == "2"?
+
+ + 该浏览器不支持canvas + +
+
+
+
+ onReduce()}> +
+
+
+ onAdd()}> +
+
+
+
+ +    + fullscreen()}> +
+
+
+
: +
+
+
+
+
+
+ fullscreen()}> +
+
+
+
}
@@ -500,10 +674,11 @@ const MonitorRoomDetail: React.FC<{}> = (props: any) => {

时间:{item.eventTime}

- {/*

时间:{item.alarmTime}

*/} +

描述:{item.describeStranger}

drawerClick(item.filePath)} /> + {/* */}
)) : ( @@ -516,11 +691,10 @@ const MonitorRoomDetail: React.FC<{}> = (props: any) => {

时间:{item.eventTime}

描述:{item.describeStranger}

- {/*

时间:{item.alarmTime}

-

描述:{item.alarmDescribe}

*/}
drawerClick(item.filePath)} /> + {/* */}
)) : ( @@ -531,6 +705,7 @@ const MonitorRoomDetail: React.FC<{}> = (props: any) => { ) : btnSelect == "1" ? ( + ) : btnSelect == "2" ? ( ) : ( diff --git a/src/pages/ElecEvaluation/Monitor/RoomDetail/js/JtimeLine.js b/src/pages/ElecEvaluation/Monitor/RoomDetail/js/JtimeLine.js new file mode 100644 index 0000000..b94be06 --- /dev/null +++ b/src/pages/ElecEvaluation/Monitor/RoomDetail/js/JtimeLine.js @@ -0,0 +1,447 @@ +var JTimeLine = function() { + var status = { + isMouseDown: !1, + isOver: !1, + mousePosition: null, + oldTime: null, + nowTime: null, + moved: null, + hoverTime: "2018-12-07 12:00:00", + hoverLeft: 0, + timeTipShow: !1, + timeWidthTbls: [60, 1800, 3600, 86400, 259200], + timeUnits: [ + "范围: 1分钟; 单位: 秒", + "范围: 30分钟; 单位: 分钟", + "范围: 1小时; 单位: 分钟", + "范围: 1天; 单位: 小时", + "范围: 3天; 单位: 小时", + ], + drawPen: null, + timeSection: [], + canvasWidth: null, + canvasHeight: null, + timeTips: null, + }; + var _this = this; + Object.keys(status).forEach(function(element) { + _this[element] = status[element]; + }); + this.options = { + width: this.canvasWidth, + height: 48, + time: new Date().getTime(), + timeSection: [], + timeWidth: 0, + }; + JTimeLine.prototype.subTime = function(time) { + return time < 10 ? "0" + time : time; + }; + JTimeLine.prototype.tranTime = function(time) { + var stringTime = time; + var newDate; + if (time) { + newDate = new Date(time); + stringTime = + newDate.getFullYear() + + "/" + + (newDate.getMonth() + 1) + + "/" + + newDate.getDate() + + " " + + this.subTime(newDate.getHours()) + + ":" + + this.subTime(newDate.getMinutes()) + + ":" + + this.subTime(newDate.getSeconds()); + } + return stringTime; + }; + JTimeLine.prototype.init = function(params) { + var that = this; + var opts = this.options; + var callback; + that.timeWidthTblIndex = opts.timeWidth; + var canvas = document.querySelector(".time-line-body"); + that.drawPen = canvas.getContext("2d"); + that.nowTime = opts.time || Date.now(); + that.timeSection = opts.timeSection || []; + that.canvasWidth = canvas.offsetWidth; + that.canvasHeight = canvas.offsetHeight; + that.updata(); + document + .getElementById("canvas") + .addEventListener("mousemove", function(e) { + that.options.readOnly || that.mousemove(e); + }); + document + .getElementById("canvas") + .addEventListener("mouseover", function(e) { + that.options.readOnly || that.mouseover(e); + }); + document + .getElementById("canvas") + .addEventListener("mouseleave", function(e) { + that.options.readOnly || that.mouseleave(e); + }); + document + .getElementById("canvas") + .addEventListener("mousedown", function(e) { + that.options.readOnly || that.mousedown(e); + }); + document.getElementById("canvas").addEventListener("mouseup", function(e) { + if (!that.options.readOnly) { + callback = params.onChange; + that.mouseUpFn(e, callback); + } + }); + }; + JTimeLine.prototype.mousemove = function(e) { + var left; + var mouseOffset; + var timeOffsetUnit; + var currentTime; + if (this.isMouseDown && this.isOver) { + mouseOffset = this.mousePosition - e.pageX; + if (mouseOffset === 0) return; + timeOffsetUnit = 0; + switch (this.timeWidth) { + case 60: + timeOffsetUnit = 0.1; + break; + case 1800: + case 3600: + timeOffsetUnit = 3; + break; + case 86400: + timeOffsetUnit = 120; + } + currentTime = new Date(this.oldTime).getTime() + mouseOffset * timeOffsetUnit * 1e3; + this.updata({ time: currentTime }); + this.moved = !0; + } else { + left = parseInt( + document.getElementById("canvas-container").offsetLeft, + 10 + ); + this.mousePosition = e.pageX - left; + this.updata(); + } + }; + JTimeLine.prototype.mousedown = function(e) { + this.isMouseDown = !0; + this.mousePosition = e.pageX; + this.oldTime = this.nowTime; + }; + JTimeLine.prototype.mouseover = function(e) { + this.isOver = !0; + }; + JTimeLine.prototype.mouseleave = function(e) { + this.isOver = !1; + this.isMouseDown = !1; + this.updata(); + }; + JTimeLine.prototype.changeSize = function(timeWidth) { + this.options.timeWidth = timeWidth; + this.updata({ timeWidth: timeWidth }); + }; + JTimeLine.prototype.mouseUpFn = function(e, callback) { + if (this.isMouseDown) { + this.isMouseDown = !1; + if (this.moved) { + this.moved = !1; + this.updata({ time: this.nowTime }); + this.oldTime = this.nowTime; + callback(this.nowTime); + } + } + }; + JTimeLine.prototype.readOnly = function(data) { + this.options.readOnly = !0; + document.getElementById("canvas").style.cursor = "not-allowed"; + }; + JTimeLine.prototype.unReadOnly = function(data) { + this.options.readOnly = !1; + document.getElementById("canvas").style.cursor = "pointer"; + }; + JTimeLine.prototype.run = function(data) { + this.isMouseDown || this.updata(data); + }; + JTimeLine.prototype.getTime = function(data) { + }; + JTimeLine.prototype.updata = function(data) { + var that = this; + data = data || {}; + that.nowTime = data.time || that.nowTime; + that.timeSection = data.timeSection || that.timeSection; + that.timeWidthTblIndex = data.timeWidth || that.timeWidthTblIndex; + that.timeWidth = + that.timeWidthTbls[data.timeWidth || that.timeWidthTblIndex]; + that.timeUnit = that.timeUnits[data.timeWidth || that.timeWidthTblIndex]; + if (data.timeWidth === 0) { + that.timeWidthTblIndex = 0; + that.timeWidth = that.timeWidthTbls[0]; + that.timeUnit = that.timeUnits[0]; + } + that.drawPen.fillStyle = "#292B36"; + that.drawPen.fillRect(0, 0, that.canvasWidth, that.canvasHeight); + that.drawScale(); + that.drawRecord(); + that.drawOtherMsg(); + document.getElementById("canvas-container").style.width = + this.options.width + "px"; + document.getElementById("canvas").style.width = this.options.width + "px"; + document.getElementById("canvas-container").style.height = + this.options.height + "px"; + document.getElementById("canvas").style.height = this.options.height + "px"; + }; + // 画刻度调用 + JTimeLine.prototype.drawSolidLine = function(drawLineParams) { + let { startX, startY, endX, endY, lineWidth, color } = drawLineParams; + this.drawPen.save(); + this.drawPen.strokeStyle = color; + this.drawPen.lineWidth = lineWidth; + this.drawPen.beginPath(); + this.drawPen.moveTo(startX, startY); + this.drawPen.lineTo(endX, endY); + this.drawPen.stroke(); + this.drawPen.restore(); + }; + JTimeLine.prototype.drawString = function(text, x, y, aling, color) { + this.drawPen.font = "12px serif"; + this.drawPen.fillStyle = color || "#ffffff"; + this.drawPen.textAlign = aling || "left"; + this.drawPen.fillText(text, x, y); + }; + // 画刻度 + JTimeLine.prototype.drawScale = function() { + var that = this; + var lineColor = "rgba(255,255,255,0.3)"; + var startDate = new Date(that.nowTime); + var starSecond = startDate.getSeconds(); + var starMin = startDate.getMinutes(); + var startHours = startDate.getHours(); + var startDay = startDate.getDate(); + var startYears = startDate.getFullYear(); + var OffsetLeft = 60 * starMin + starSecond; + var curScale = 0; + var params; + var timeString; + var i; + var dotNum; + switch (that.timeWidth) { + case 60: + dotNum = parseInt(that.canvasWidth / 10); + startDate.setSeconds(startDate.getSeconds() - parseInt(dotNum / 2, 10)); + startDay = startDate.getDate(); + startHours = startDate.getHours(); + starMin = startDate.getMinutes(); + starSecond = startDate.getSeconds(); + for (i = 0; i < dotNum; i++) { + curScale = starSecond + i; + startDate.setSeconds(curScale); + if (curScale % 10 == 0) { + params = { startX:(i * that.canvasWidth) / dotNum, startY:0, endX:(i * that.canvasWidth) / dotNum, endY:(that.canvasHeight / 5) * 1.5, lineWidth:1, color:lineColor }; + that.drawSolidLine(params); + timeString = + this.subTime(startDate.getHours()) + + ":" + + this.subTime(startDate.getMinutes()) + + ":" + + this.subTime(startDate.getSeconds()); + that.drawString(timeString,(i * that.canvasWidth) / dotNum,(that.canvasHeight / 5) * 2.5,"center","rgba(255,255,255,0.3)"); + } else { + params = { startX:(i * that.canvasWidth) / dotNum, startY:0, endX:(i * that.canvasWidth) / dotNum, endY:(that.canvasHeight / 5) * 0.5, lineWidth:1, color:lineColor }; + that.drawSolidLine(params); + } + startDate.setDate(startDay); + startDate.setHours(startHours); + startDate.setMinutes(starMin); + } + break; + case 1800: + dotNum = parseInt(that.canvasWidth / 20); + startDate.setMinutes(startDate.getMinutes() - parseInt(dotNum / 2, 10)); + startHours = startDate.getHours(); + starMin = startDate.getMinutes(); + for (i = 0; i <= dotNum; i++) { + curScale = starMin + i; + startDate.setMinutes(curScale); + if (curScale % 5 == 0) { + params = { startX:(i * that.canvasWidth) / dotNum, startY:0, endX:(i * that.canvasWidth) / dotNum, endY:(that.canvasHeight / 5) * 1.5, lineWidth:1, color:lineColor }; + that.drawSolidLine(params); + timeString = + this.subTime(startDate.getHours()) + + ":" + + this.subTime(startDate.getMinutes()); + that.drawString(timeString,(i * that.canvasWidth) / dotNum,(that.canvasHeight / 5) * 2.5,"center","rgba(255,255,255,0.3)"); + } else { + params = { startX:(i * that.canvasWidth) / dotNum, startY:0, endX:(i * that.canvasWidth) / dotNum, endY:(that.canvasHeight / 5) * 0.5, lineWidth:1, color:lineColor }; + that.drawSolidLine(params); + } + startDate.setHours(startHours); + } + break; + case 3600: + dotNum = parseInt(that.canvasWidth / 20); + startDate.setMinutes(startDate.getMinutes() - parseInt(dotNum / 2, 10)); + startHours = startDate.getHours(); + starMin = startDate.getMinutes(); + for (i = 0; i <= dotNum; i++) { + curScale = starMin + i; + startDate.setMinutes(curScale); + if (curScale % 10 == 0) { + params = { startX:(i * that.canvasWidth) / dotNum, startY:0, endX:(i * that.canvasWidth) / dotNum, endY:(that.canvasHeight / 5) * 1.5, lineWidth:1, color:lineColor }; + that.drawSolidLine(params); + timeString = + this.subTime(startDate.getHours()) + + ":" + + this.subTime(startDate.getMinutes()); + that.drawString(timeString,(i * that.canvasWidth) / dotNum,(that.canvasHeight / 5) * 2.5,"center","rgba(255,255,255,0.3)"); + } else { + params = { startX:(i * that.canvasWidth) / dotNum, startY:0, endX:(i * that.canvasWidth) / dotNum, endY:(that.canvasHeight / 5) * 0.5, lineWidth:1, color:lineColor }; + that.drawSolidLine(params); + } + startDate.setHours(startHours); + } + break; + case 86400: + dotNum = parseInt(that.canvasWidth / 30); + startDate.setHours(startDate.getHours() - parseInt(dotNum / 2, 10)); + starSecond = startDate.getSeconds(); + starMin = startDate.getMinutes(); + startHours = startDate.getHours(); + startDay = startDate.getDate(); + startYears = startDate.getFullYear(); + for (i = 0; i <= dotNum; i++) { + curScale = startHours + i; + startDate.setHours(curScale); + if (curScale % 24 != 0) { + timeString = this.subTime(startDate.getHours()) + ":00"; + params = { startX:(i * that.canvasWidth) / dotNum, startY:0, endX:(i * that.canvasWidth) / dotNum, endY:(that.canvasHeight / 5) * 0.5, lineWidth:1, color:lineColor }; + that.drawSolidLine(params); + } else { + timeString = startDate.toLocaleDateString(); + params = { startX:(i * that.canvasWidth) / dotNum, startY:0, endX:(i * that.canvasWidth) / dotNum, endY:(that.canvasHeight / 5) * 1, lineWidth:1, color:lineColor }; + that.drawSolidLine(params); + } + if (curScale % 2 == 0) { + that.drawString(timeString,(i * that.canvasWidth) / dotNum,(that.canvasHeight / 5) * 2,"center","rgba(255,255,255,0.3)"); + } + startDate.setFullYear(startYears); + startDate.setDate(startDay); + startDate.setHours(startHours); + } + break; + case 259200: + startDate.setHours(startDate.getHours() - 36); + starSecond = startDate.getSeconds(); + starMin = startDate.getMinutes(); + startHours = startDate.getHours(); + OffsetLeft = 60 * starMin + starSecond; + for (i = 0; i <= 72; i++) { + curScale = startHours + i; + if (curScale >= 24) { + curScale %= 24; + } + curScale === 0? startDate.setHours(24):startDate.setHours(curScale); + timeString = this.subTime(startDate.getHours()); + if (curScale % 3 == 0) { + curScale || (timeString = startDate.toLocaleDateString()); + that.drawString(timeString,((3600 * i - OffsetLeft) * that.canvasWidth) / 259200,(that.canvasHeight / 5) * 2.5,"center","rgba(255,255,255,0.3)"); + params = { startX:((3600 * i - OffsetLeft) * that.canvasWidth) / 259200, startY:0, endX:((3600 * i - OffsetLeft) * that.canvasWidth) / 259200, endY:(that.canvasHeight / 5) * 1, lineWidth:1, color:lineColor }; + that.drawSolidLine(params); + } else { + params = { startX:((3600 * i - OffsetLeft) * that.canvasWidth) / 259200, startY:0, endX:((3600 * i - OffsetLeft) * that.canvasWidth) / 259200, endY:(that.canvasHeight / 5) * 0.5, lineWidth:1, color:lineColor }; + that.drawSolidLine(params); + } + } + } + }; + JTimeLine.prototype.getRecord = function(timeArr) { + this.timeSection = timeArr; + }; + // 画进度条 + JTimeLine.prototype.drawRecord = function() { + var startPosition; + var endPosition; + function findPosition(time) { + var scale = 10; + switch (that.timeWidth) { + case 60: + scale = 10; + break; + case 1800: + case 3600: + scale = 20 / 60; + break; + case 86400: + scale = 20 / 60 / 60; + } + var nowTimePostion = that.canvasWidth / 2; + var position = nowTimePostion + ((time - that.nowTime) / 1e3) * scale; + if (position > that.canvasWidth) { + position = that.canvasWidth; + } + if (position <= 0) { + position = 0; + } + return position; + } + var timeArr = this.timeSection || []; + var that = this; + var drawPen = that.drawPen; + var i; + for (i = 0; i < timeArr.length; i++) { + startPosition = findPosition(timeArr[i].startTime); + endPosition = findPosition(timeArr[i].endTime); + drawPen.fillStyle = "#FF502E"; + drawPen.fillRect( + startPosition, + (that.canvasHeight / 5) * 3, + endPosition - startPosition, + (that.canvasHeight / 5) * 1.5 + ); + } + }; + // 画中间的条 + JTimeLine.prototype.drawOtherMsg = function() { + this.drawPen.shadowColor = "#ffffff"; + this.drawPen.shadowOffsetX = 0; + this.drawPen.shadowOffsetY = 0; + this.drawPen.shadowBlur = 10; + this.drawPen.beginPath(); + this.drawPen.moveTo(this.canvasWidth / 2 - 4.5, 0); + this.drawPen.lineTo(this.canvasWidth / 2 + 4.5, 0); + this.drawPen.lineTo(this.canvasWidth / 2, 4.5); + this.drawPen.fillStyle = "#fff"; + this.drawPen.closePath(); + this.drawPen.fill(); + this.drawPen.beginPath(); + this.drawPen.moveTo(this.canvasWidth / 2 - 4.5, this.canvasHeight); + this.drawPen.lineTo(this.canvasWidth / 2 + 4.5, this.canvasHeight); + this.drawPen.lineTo(this.canvasWidth / 2, this.canvasHeight - 4.5); + this.drawPen.fillStyle = "#fff"; + this.drawPen.closePath(); + this.drawPen.fill(); + var params = { startX:this.canvasWidth / 2, startY:0, endX:this.canvasWidth / 2, endY:this.canvasHeight, lineWidth:2, color:"#ffffff" }; + this.drawSolidLine(params); + this.drawPen.shadowBlur = 0; + if (this.isOver) { + if (!this.isMouseDown) { + this.mouseTime = + (this.mousePosition / this.canvasWidth) * this.timeWidth * 1e3 + + this.nowTime - + (this.timeWidth / 2) * 1e3; + this.mouseString = this.tranTime(this.mouseTime); + this.hoverTime = this.mouseString; + this.hoverLeft = this.mousePosition - 60; + this.timeTipShow = !0; + } else { + this.timeTipShow = !1; + } + } + }; +}; + +export default JTimeLine; diff --git a/src/pages/ElecEvaluation/Monitor/RoomDetail/js/player.js b/src/pages/ElecEvaluation/Monitor/RoomDetail/js/player.js new file mode 100644 index 0000000..fc40a50 --- /dev/null +++ b/src/pages/ElecEvaluation/Monitor/RoomDetail/js/player.js @@ -0,0 +1 @@ +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.jPlayer=t():e.jPlayer=t()}(window,(function(){return function(e){var t={};function o(a){if(t[a])return t[a].exports;var r=t[a]={i:a,l:!1,exports:{}};return e[a].call(r.exports,r,r.exports,o),r.l=!0,r.exports}return o.m=e,o.c=t,o.d=function(e,t,a){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:a})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var a=Object.create(null);if(o.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)o.d(a,r,function(t){return e[t]}.bind(null,r));return a},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o(o.s=3)}([function(e,t,o){var a,r;a="undefined"!=typeof window?window:this,r=function(e,t){const o={closeTalk:60,TalkHandshakeReq:59,kFileData:1,kInitDecoderReq:0,kUninitDecoderReq:1,kOpenDecoderReq:2,kCloseDecoderReq:3,kFeedDataReq:4,kStartDecodingReq:5,kPauseDecodingReq:6,kInitDecoderRsp:0,kUninitDecoderRsp:1,kOpenDecoderRsp:2,kCloseDecoderRsp:10,kVideoFrame:4,kAudioFrame:5,kDecodeFinishedEvt:8,cmdCallback:11,kGetParamRsp:12,sendDataCallback:13,socketLinkState:14,getHeartBeatRequest:15,DownloaderHeartBeat:16,closeWebsocket:17,fetchStream:18,resetDecoderFifo:19,getSetPlayBackSpeedReq:20,getSetPlayBackStartReq:21,deviceReady:22,getSetPlayBackStartTimeReq:23,responseCurDateTime:24,eventTypeFifoFull:25,eventTypeFifoEnough:26,playbakcRecordList:27,socketActiveClose:28,serverDataTimeout:29,heartPingResp:30,serverDecoderError:31,socketNoActive:32,getHandsharkReq:33,getHandsharkRes:34,recoderStart:35,recoderPause:36,onWasmLoaded:37,getHandshakeReq:38,DownloaderHandshakeReq:39,sendHandshakeReq:40,kVideoDownRep:100,kVideoDownChumksRep:101,getTalkStartReq:50,talkStartRep:51,pcmDataReq:52,kStartTalkEncoderRsq:53,kStartTalkEncoderRsp:54,kGetDeviceInfo:55,kGetAudioDataReq:56,kgetTalkStartRep:57,DestroyTalkReq:58,DestroyTalkRes:61,kStartTalkEncoderdeviceready:62,initTalkEncode:64,_getTalkStartReq:63,PlaybackOver:65,serverDecoderTalkError:66};return e.common=o,o},"object"==typeof e.exports?e.exports=a.document?r(a):function(e){if(!e.document)throw new Error("common requires a window with a document");return r(e)}:r(a)},function(e,t,o){"use strict";e.exports=function(e,t,o,a){try{try{var r;try{r=new window.Blob([e])}catch(t){(r=new(window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder)).append(e),r=r.getBlob()}var s=window.URL||window.webkitURL,i=s.createObjectURL(r),n=new window[t](i,o);return s.revokeObjectURL(i),n}catch(a){return new window[t]("data:application/javascript,".concat(encodeURIComponent(e)),o)}}catch(e){if(!a)throw Error("Inline worker is not supported");return new window[t](a,o)}}},function(e,t,o){var a,r;a="undefined"!=typeof window?window:this,r=function(e,t){function o(e){this.module=e}return o.prototype.log=function(e){},o.prototype.logError=function(e){},o.prototype.logInfo=function(e){},o.prototype.logDebug=function(e){},o.prototype.currentTimeStr=function(){var e=new Date(Date.now());return e.getFullYear()+"-"+(e.getMonth()+1)+"-"+e.getDate()+" "+e.getHours()+":"+e.getMinutes()+":"+e.getSeconds()+":"+e.getMilliseconds()},e.Logger=o,o},"object"==typeof e.exports?e.exports=a.document?r(a):function(e){if(!e.document)throw new Error("Logger requires a window with a document");return r(e)}:r(a)},function(e,t,o){"use strict";function a(e){this.init(e)}o.r(t),o.d(t,"playerStateIdle",(function(){return T})),o.d(t,"playerStatePlaying",(function(){return E})),o.d(t,"playerStatePausing",(function(){return _})),a.prototype.init=function(e){this.option={encoding:"16bitInt",channels:1,sampleRate:8e3,flushingTime:5e3,...e},this.samples=new Float32Array,this.flush=this.flush.bind(this),this.interval=setInterval(this.flush,this.option.flushingTime),this.maxValue=this.getMaxValue(),this.TypedArray=this.getTypedArray(),this.createContext()},a.prototype.getMaxValue=function(){var e={"8bitInt":128,"16bitInt":32768,"32bitInt":2147483648,"32bitFloat":1};return e[this.option.encoding]?e[this.option.encoding]:e["16bitInt"]},a.prototype.getTypedArray=function(){var e={"8bitInt":Int8Array,"16bitInt":Int16Array,"32bitInt":Int32Array,"32bitFloat":Float32Array};return e[this.option.encoding]?e[this.option.encoding]:e["16bitInt"]},a.prototype.createContext=function(){this.audioCtx=new(window.AudioContext||window.webkitAudioContext),this.gainNode=this.audioCtx.createGain(),this.gainNode.gain.value=1,this.gainNode.connect(this.audioCtx.destination),this.startTime=this.audioCtx.currentTime},a.prototype.isTypedArray=function(e){return e.byteLength&&e.buffer&&e.buffer.constructor==ArrayBuffer},a.prototype.feed=function(e){if(this.isTypedArray(e)){e=this.getFormatedValue(e);var t=new Float32Array(this.samples.length+e.length);t.set(this.samples,0),t.set(e,this.samples.length),this.samples=t}},a.prototype.getFormatedValue=function(e){e=new this.TypedArray(e.buffer);var t,o=new Float32Array(e.length);for(t=0;t=n-51&&(t[r]=t[r]*s--/50),a+=this.option.channels;this.startTime>1,o>>1,e.subarray(a,a+r)),s.v.fill(t>>1,o>>1,e.subarray(a+r,e.length)),s.drawArrays(s.TRIANGLE_STRIP,0,4)}},i.prototype.fullscreen=function(){var e=this.canvas;e.RequestFullScreen?e.RequestFullScreen():e.webkitRequestFullScreen?e.webkitRequestFullScreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.msRequestFullscreen?e.msRequestFullscreen():alert("This browser doesn't supporter fullscreen")},s.prototype.bind=function(e,t,o){var a=this.gl;a.activeTexture([a.TEXTURE0,a.TEXTURE1,a.TEXTURE2][e]),a.bindTexture(a.TEXTURE_2D,this.texture),a.uniform1i(a.getUniformLocation(t,o),e)},i.prototype.exitfullscreen=function(){document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.msExitFullscreen?document.msExitFullscreen():alert("Exit fullscreen doesn't work")},i.prototype.webGLDestroy=function(){var e=this.gl,t=this.program;e.clear(e.COLOR_BUFFER_BIT),e.clear(e.DEPTH_BUFFER_BIT),e.clear(e.STENCIL_BUFFER_BIT),e.deleteProgram(t);var o=this.verticesBuffer,a=this.texCoordBuffer;e.deleteBuffer(o),e.deleteBuffer(a);var r=e.y.texture,s=e.u.texture,i=e.v.texture;e.deleteTexture(r),e.deleteTexture(s),e.deleteTexture(i),this.canvas=null,this.gl=null};var n=i,l=o(1),c=o.n(l);function d(){return c()('!function(e){var o={};function t(a){if(o[a])return o[a].exports;var r=o[a]={i:a,l:!1,exports:{}};return e[a].call(r.exports,r,r.exports,t),r.l=!0,r.exports}t.m=e,t.c=o,t.d=function(e,o,a){t.o(e,o)||Object.defineProperty(e,o,{enumerable:!0,get:a})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,o){if(1&o&&(e=t(e)),8&o)return e;if(4&o&&"object"==typeof e&&e&&e.__esModule)return e;var a=Object.create(null);if(t.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&o&&"string"!=typeof e)for(var r in e)t.d(a,r,function(o){return e[o]}.bind(null,r));return a},t.n=function(e){var o=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(o,"a",o),o},t.o=function(e,o){return Object.prototype.hasOwnProperty.call(e,o)},t.p="",t(t.s=0)}([function(e,o){function t(){this.logger=new Logger("Decoder"),this.coreLogLevel=0,this.wasmLoaded=!1,this.tmpReqQue=[],this.cacheBuffer=null,this.decodeTimer=null,this.videoCallback=null,this.audioCallback=null,this.requestCallback=null,this.responseCallback=null,this.eventCallback=null,this.decoderCmdCallback=null,this.recordWriteCallback=null,this.recordUpdateCallback=null,this.key="",this.iv="",this.allChunks=[],this.recoding=!1,this.handShakeData=null,this.deviceReadyStatus=!1}self.Module={onRuntimeInitialized:function(){self.decoder&&self.decoder.onWasmLoaded()},locateFile:function(e,o){return location.origin+"/sdk/"+e}},self.importScripts(location.origin+"/sdk/enumConstant.js"),self.importScripts(location.origin+"/sdk/logger.js"),self.importScripts(location.origin+"/sdk/libffmpeg.js"),t.prototype.initDecoder=function(e,o,t,a,r){var l=Module._initDecoder(this.coreLogLevel,this.eventCallback,this.decoderCmdCallback,this.responseCallback);if(this.logger.logInfo("initDecoder return "+l+"."),0==l){if(t&&""!=t&&a&&""!=a&&r&&""!=r){var s=allocateUTF8(t),n=allocateUTF8(a),c=allocateUTF8(r);Module._setCipherInfo(c,s,n)}null==this.cacheBuffer&&(this.cacheBuffer=Module._malloc(o)),Module._setPlayMode(e)}var i={t:common.kInitDecoderRsp,e:l};self.postMessage(i)},t.prototype.uninitDecoder=function(){this.closeDecoder();var e=Module._uninitDecoder(),o={t:common.kCloseDecoderRsp,e:0};self.postMessage(o),this.logger.logInfo("Uninit ffmpeg decoder return "+e+"."),null!==this.cacheBuffer&&(Module._free(this.cacheBuffer),this.cacheBuffer=null)},t.prototype.getParam=function(e){var o,t,a,r,l,s,n,c,i,d,u=2002==e?3:4,f=Module._malloc(4*u),g=2002==e?Module._getAudioParam(f,u):Module._getVideoParam(f,u);this.logger.logInfo("getParam return "+g),0==g?(t=f>>2,a=Module.HEAP32.subarray(t,t+u),r=2002==e?"":a[0],l=2002==e?"":a[1],s=2002==e?"":a[2],n=2002==e?"":a[3],c=2002==e?a[0]:"",i=2002==e?a[1]:"",d=2002==e?a[2]:"",o={t:common.kGetParamRsp,e:g,type:2002==e?"audio":"video",v:{d:r,p:l,w:s,h:n},a:{f:c,c:i,r:d}},self.postMessage(o)):(o={t:common.kGetParamRsp,e:g},self.postMessage(o)),Module._free(f)},t.prototype.openDecoder=function(){Module._setRecordCallback(this.recordWriteCallback,this.recordUpdateCallback);var e,o=Module._openDecoder(this.videoCallback,this.audioCallback,this.requestCallback);this.logger.logInfo("openDecoder return "+o),0==o&&(e={t:common.kOpenDecoderRsp,e:o},self.postMessage(e))},t.prototype.closeDecoder=function(){!1,a=!1,this.logger.logInfo("closeDecoder."),this.decodeTimer&&(clearInterval(this.decodeTimer),this.decodeTimer=null,this.logger.logInfo("Decode timer stopped."));var e=Module._closeDecoder();this.logger.logInfo("Close ffmpeg decoder return "+e+".")},t.prototype.startDecoding=function(e){this.logger.logInfo("Start decoding."),this.decodeTimer&&clearInterval(this.decodeTimer),this.decodeTimer=setInterval(this.decode,e)},t.prototype.pauseDecoding=function(){this.logger.logInfo("Pause decoding."),this.decodeTimer&&(clearInterval(this.decodeTimer),this.decodeTimer=null)};t.prototype.decode=function(){(new Date).getTime();var e=Module._decodeOnePacket();(new Date).getTime();for(7==e&&self.decoder.logger.logInfo("Decoder finished."),0==e&&!0;9==e&&this.decodeTimer;)e=Module._decodeOnePacket()},t.prototype.sendData=function(e){var o=new Uint8Array(e);Module.HEAPU8.set(o,this.cacheBuffer),Module._sendData(this.cacheBuffer,o.length)},t.prototype.getSetPlayBackSpeedReq=function(e){var o,t,a,r,l,s=Module._malloc(4),n=Module._malloc(1024),c=allocateUTF8(e),i=Module._getSetPlayBackSpeedReq(n,s,1024,c);this.logger.logInfo("_getSetPlayBackSpeedReq return "+i),0==i&&(t=s>>2,a=Module.HEAP32.subarray(t,t+1)[0],r=Module.HEAPU8.subarray(n,n+a),l=new Uint8Array(r),o={t:common.getSetPlayBackSpeedReq,b:l},self.postMessage(o),l=null),Module._free(s),Module._free(n)},t.prototype.getSetPlayBackStartReq=function(){var e,o,t,a,r,l=Module._malloc(4),s=Module._malloc(1024),n=Module._getSetPlayBackStartReq(s,l,1024);this.logger.logInfo("_getSetPlayBackStartReq return "+n),0==n&&(o=l>>2,t=Module.HEAP32.subarray(o,o+1)[0],a=Module.HEAPU8.subarray(s,s+t),r=new Uint8Array(a),e={t:common.getSetPlayBackStartReq,b:r},self.postMessage(e)),Module._free(l),Module._free(s)},t.prototype.getSetPlayBackStartTimeReq=function(e){var o,t,a,r,l,s=Module._malloc(4),n=Module._malloc(1024),c=allocateUTF8(String(e)),i=Module._getSetPlayBackStartTimeReq(n,s,1024,c);this.logger.logInfo("_getSetPlayBackStartTimeReq return "+i),0==i&&(t=s>>2,a=Module.HEAP32.subarray(t,t+1)[0],r=Module.HEAPU8.subarray(n,n+a),l=new Uint8Array(r),o={t:common.getSetPlayBackStartTimeReq,b:l},self.postMessage(o)),Module._free(s),Module._free(n)},t.prototype.getHeartbeatPing=function(){var e,o,t,a,r,l=Module._malloc(4),s=Module._malloc(1024),n=Module._getHeartbeatPing(s,l,1024);this.logger.logInfo("_getHeartbeatPing return "+n),0==n&&(o=l>>2,t=Module.HEAP32.subarray(o,o+1)[0],a=Module.HEAPU8.subarray(s,s+t),r=new Uint8Array(a),e={t:common.getHeartBeatRequest,b:r,l:t},self.postMessage(e)),Module._free(l),Module._free(s)},t.prototype.handshakeReq=function(){var e,o,t,a,r,l=Module._malloc(4),s=Module._malloc(1024),n=Module._getHandshakeReq(s,l,1024);this.logger.logInfo("_getHandshakeReq return "+n),0==n&&(o=l>>2,t=Module.HEAP32.subarray(o,o+1)[0],a=Module.HEAPU8.subarray(s,s+t),r=new Uint8Array(a),e={t:common.getHandshakeReq,b:r,l:t},self.postMessage(e)),Module._free(l),Module._free(s)},t.prototype.talkhandshakeReq=function(){var e,o,t,a,r,l=Module._malloc(4),s=Module._malloc(1024),n=Module._getHandshakeReq(s,l,1024);this.logger.logInfo("_getHandshakeReq return "+n),0==n&&(o=l>>2,t=Module.HEAP32.subarray(o,o+1)[0],a=Module.HEAPU8.subarray(s,s+t),r=new Uint8Array(a),e={t:common.getTalkHandshakeReq,b:r,l:t},self.postMessage(e)),Module._free(l),Module._free(s)},t.prototype.getHandsharkReq=function(){var e,o,t,a,r,l=Module._malloc(4),s=Module._malloc(1024),n=Module._getHandsharkReq(s,l,1024);this.logger.logInfo("_getHeartbeatPing return "+n),0==n&&(o=l>>2,t=Module.HEAP32.subarray(o,o+1)[0],a=Module.HEAPU8.subarray(s,s+t),r=new Uint8Array(a),e={t:common.getHandsharkRes,b:r,l:t},self.postMessage(e)),Module._free(l),Module._free(s)},t.prototype.processReq=function(e){switch(e.t){case common.kInitDecoderReq:this.initDecoder(e.s,e.c,e.k,e.i,e.ct);break;case common.kUninitDecoderReq:this.uninitDecoder();break;case common.kOpenDecoderReq:this.openDecoder();break;case common.kCloseDecoderReq:this.closeDecoder();break;case common.kStartDecodingReq:this.startDecoding(e.i);break;case common.kPauseDecodingReq:this.pauseDecoding();break;case common.kFeedDataReq:this.sendData(e.d);break;case common.getHeartBeatRequest:this.getHeartbeatPing();break;case common.getHandshakeReq:this.handshakeReq();break;case common.resetDecoderFifo:this.resetDecoderFifo();break;case common.getSetPlayBackSpeedReq:this.getSetPlayBackSpeedReq(e.l);break;case common.getSetPlayBackStartReq:this.getSetPlayBackStartReq();break;case common.getSetPlayBackStartTimeReq:this.getSetPlayBackStartTimeReq(e.s);break;case common.getHandsharkReq:this.getHandsharkReq();break;case common.recoderStart:this.recoderStart();break;case common.recoderPause:case common.recoderPause:this.recoderPause();break;case common.getTalkStartReq:case common.initTalkEncode:this.initEncoder();break;case common.kGetDeviceInfo:this.sendTalkData(e.d);break;case common._getTalkStartReq:this.getTalkStartReq();break;case common.kStartTalkEncoderRsp:if(e.b){let o=JSON.parse(e.b);this.startTalkEncoder(8e3,16,1,o.audio_codec,o.sample,o.bitwidth,o.channel)}else this.startTalkEncoder();break;case common.pcmDataReq:this.encodePcmDataReq(e);break;case common.DestroyTalkReq:this.closeTalkEncoder(),this.uninitTalkDecoder();break;default:this.logger.logError("Unsupport messsage "+e.t)}},t.prototype.cacheReq=function(e){e&&this.tmpReqQue.push(e)},t.prototype.resetDecoderFifo=function(e){Module._resetDecoderFifo()};var a=!1;t.prototype.recoderStart=function(){this.recoding=!0,this.allChunks=[];Module._recoderStart()},t.prototype.recoderPause=function(){this.recoding=!1;Module._recoderPause();let e=this.allChunks;var o={t:common.kVideoDownRep,s:(new Date).getTime(),d:e};self.postMessage(o)},t.prototype.onWasmLoaded=function(){let e=this;this.logger.logInfo("Wasm loaded."),this.wasmLoaded=!0,this.videoCallback=Module.addFunction((function(e,o,t){var a=Module.HEAPU8.subarray(e,e+o),r=new Uint8Array(a);(new Date).getTime();var l={t:common.kVideoFrame,s:t,d:r};self.postMessage(l,[l.d.buffer])}),"viid"),this.audioCallback=Module.addFunction((function(e,o,t){var a=Module.HEAPU8.subarray(e,e+o),r=new Uint8Array(a);(new Date).getTime();var l={t:common.kAudioFrame,s:t,d:r};self.postMessage(l,[l.d.buffer]),r=null}),"viid"),this.requestCallback=Module.addFunction((function(e,o){}),"vii"),this.TalkEventCallback=Module.addFunction((function(e,o){if(e>=4&&e<=18){const e={t:common.serverDecoderTalkError,s:o};self.postMessage(e)}}),"vii"),this.TalkCmdCallback=Module.addFunction((function(o,t,a,r,l,s,n){let c=Number(t);if(0===c)switch(o){case 1:let o={t:common.kStartTalkEncoderdeviceready,b:""};e.deviceReadyStatus||(e.deviceReadyStatus=!0,self.postMessage(o));break;case 10:let t=UTF8ToString(s,n),a={t:common.kStartTalkEncoderRsp,b:t};self.postMessage(a)}else{let e={t:common.closeTalk,b:"",errorCode:c};self.postMessage(e)}}),"vijiijii"),this.TalkUserDataCallback=Module.addFunction((function(e,o){}),"vii"),this.recordWriteCallback=Module.addFunction(((e,o,t)=>{var a=Module.HEAPU8.subarray(o,o+t);o=new Uint8Array(a);if(this.allChunks.push(o),this.recoding){let e=this.allChunks;var r={t:common.kVideoDownChumksRep,s:(new Date).getTime(),d:e};self.postMessage(r)}}),"viii"),this.recordUpdateCallback=Module.addFunction(((e,o,t,a)=>{var r=Module.HEAPU8.subarray(o,o+t)||[0];this.allChunks[0][a]=r[0]}),"viiii"),this.decoderCmdCallback=Module.addFunction((function(e,o,t,a,r,l,s){var n,c,i,d,u;switch(e){case 1:d={t:common.deviceReady},self.postMessage(d);break;case 2:break;case 3:i={t:common.responseCurDateTime,d:r},self.postMessage(i);break;case 4:i={t:common.PlaybackOver},self.postMessage(i);break;case 8:c=UTF8ToString(l,s),n={t:common.playbakcRecordList,d:c},self.postMessage(n);break;case 9:u={t:common.heartPingResp},self.postMessage(u)}}),"vijiijii"),this.responseCallback=Module.addFunction((function(e,o){}),"vii");const o=this;this.eventCallback=Module.addFunction((function(e,t){if(e>=4&&e<=18){const o={t:common.serverDecoderError,s:e};self.postMessage(o)}switch(e){case 0:if(!a){const e={t:common.sendDataCallback};self.postMessage(e),a=!0}break;case 1:case 2:case 3:const t={t:common.socketLinkState,s:e};self.postMessage(t);break;case 2e3:const r={t:common.eventTypeFifoFull};self.postMessage(r);break;case 2001:const l={t:common.eventTypeFifoEnough};self.postMessage(l);break;case 2002:o.getParam(2002);break;case 2003:o.getParam(2003);break;case 2004:o.recoderPause();break;case 17:const s={t:common.serverDataTimeout};self.postMessage(s)}}),"vii");let t={t:common.onWasmLoaded};var r;for(self.postMessage(t);this.tmpReqQue.length>0;)r=this.tmpReqQue.shift(),this.processReq(r)},t.prototype.initEncoder=function(){Module._initTalkEncoder(this.TalkEventCallback,this.TalkCmdCallback,this.TalkUserDataCallback)},t.prototype.getTalkStartReq=function(){var e,o,t,a,r,l=Module._malloc(4),s=Module._malloc(1024),n=Module._getTalkStartReq(s,l,1024);this.logger.logInfo("_getTalkStartReq return "+n),0==n&&(o=l>>2,t=Module.HEAP32.subarray(o,o+1)[0],a=Module.HEAPU8.subarray(s,s+t),r=new Uint8Array(a),e={t:common.getTalkStartReq,b:r,l:t},self.postMessage(e)),Module._free(l),Module._free(s)},t.prototype.sendTalkData=function(e){var o=new Uint8Array(e);Module.HEAPU8.set(o,this.cacheBuffer),Module._sendTalkData(this.cacheBuffer,o.length)},t.prototype.getTalkStopReq=function(){var e,o,t,a,r,l=Module._malloc(4),s=Module._malloc(1024),n=Module._getTalkStopReq(s,l,1024);this.logger.logInfo("_getTalkStartReq return "+n),0==n&&(o=l>>2,t=Module.HEAP32.subarray(o,o+1)[0],a=Module.HEAPU8.subarray(s,s+t),r=new Uint8Array(a),e={t:common.getTalkStopReq,b:r,l:t},self.postMessage(e)),Module._free(l),Module._free(s)},t.prototype.startTalkEncoder=function(e=8e3,o=16,t=1,a=1,r=8e3,l=16,s=1){var n=Module._startTalkEncoder(e,o,t,a,r,l,s);if(this.logger.logInfo("开启音频编码器 "+n),0==n){let e={t:common.kGetAudioDataReq,b:""};self.postMessage(e)}},t.prototype.closeTalkEncoder=function(){Module._closeTalkEncoder();this.deviceReadyStatus=!1},t.prototype.uninitTalkDecoder=function(){Module._uninitTalkDecoder()},t.prototype.encodePcmDataReq=function(e){let o=e.p.d,t=e.p.h;if(0==t)return;e.p.t;var a=Module._malloc(4),r=Module._malloc(51200),l=Module._malloc(51200),s=new Uint8Array(o);Module.HEAPU8.set(s,r);var n,c,i,d,u,f=t+10240,g=Module._getAudioData(r,t,0,l,a,f),m=a,h=l;this.logger.logInfo("_getAudioData return "+g),0==g&&(c=m>>2,i=Module.HEAP32.subarray(c,c+1)[0],d=Module.HEAPU8.subarray(h,h+i),u=new Uint8Array(d),n={t:common.kgetTalkStartRep,b:u,l:i},self.postMessage(n)),Module._free(m),Module._free(h),Module._free(a),Module._free(r),Module._free(l)},self.decoder=new t,self.onmessage=function(e){if(self.decoder){var o=e.data;if(!self.decoder.wasmLoaded)return self.decoder.cacheReq(o),void self.decoder.logger.logInfo("Temp cache req "+o.t+".");self.decoder.processReq(o)}}}]);',"Worker",void 0,o.p+"decoder.worker:9c62edef.js")}function h(){return c()('!function(e){var t={};function o(r){if(t[r])return t[r].exports;var s=t[r]={i:r,l:!1,exports:{}};return e[r].call(s.exports,s,s.exports,o),s.l=!0,s.exports}o.m=e,o.c=t,o.d=function(e,t,r){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(o.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var s in e)o.d(r,s,function(t){return e[t]}.bind(null,s));return r},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o(o.s=0)}([function(e,t){function o(){this.logger=new Logger("Downloader"),this.ws=null,this.heartbeatTimer=null,this.heartbeatTimes=0}self.importScripts(location.origin+"/sdk/enumConstant.js"),self.importScripts(location.origin+"/sdk/logger.js"),o.prototype.appendBuffer=function(e,t){var o=new Uint8Array(e.byteLength+t.byteLength);return o.set(new Uint8Array(e),0),o.set(new Uint8Array(t),e.byteLength),o.buffer},o.prototype.reportData=function(e){var t={t:common.kFileData,d:e};self.postMessage(t,[t.d])},o.prototype.requestWebsocket=function(e,t){var o,r,s=this;null===this.ws&&(this.ws=new WebSocket(e),this.ws.binaryType="arraybuffer",this.ws.onopen=function(e){s.logger.logInfo("Ws connected."),s.heartbeatTimes=0,r={t:common.sendHandshakeReq},self.postMessage(r)},this.ws.onerror=function(e){s.logger.logError("Ws connect error "+e.data),s.heartbeatTimes=0,s.ws=null},this.ws.onclose=function(e){clearInterval(s.heartbeatTimer),s.ws=null,o={t:common.socketActiveClose,d:e.code,w:e.wasClean},self.postMessage(o),s.heartbeatTimes=0},this.ws.onmessage=this.onmessage.bind(this))},o.prototype.onmessage=function(e){this.heartbeatTimes=0;var t=e.data;t.byteLength>10485760||self.downloader.reportData(t)},o.prototype.handshakeReq=function(e){this.ws&&this.ws.send(e)},o.prototype.startHeartbeatTimer=function(e){this.ws&&(clearInterval(this.heartbeatTimer),this.heartbeatTimer=setInterval((()=>{this.ws.send(e),this.heartbeatTimes=this.heartbeatTimes+1,this.heartbeatTimes>3&&(this.ws.close(),clearInterval(this.heartbeatTimer),this.ws=null,req={t:common.socketNoActive},self.postMessage(req),this.heartbeatTimes=0)}),13e3))},o.prototype.closeWebsocket=function(e){this.ws&&(this.ws.close(),clearInterval(this.heartbeatTimer))},o.prototype.setPlayBackSpeed=function(e){this.ws&&this.ws.send(e)},o.prototype.setPlayBackStart=function(e){this.ws&&this.ws.send(e)},o.prototype.SetPlayBackStartTime=function(e){this.ws&&this.ws.send(e)},o.prototype.heartPingResp=function(){this.heartbeatTimes=0},self.downloader=new o,self.onmessage=function(e){if(self.downloader){var t=e.data;switch(t.t){case common.fetchStream:self.downloader.requestWebsocket(t.url,t.msg);break;case common.DownloaderHeartBeat:self.downloader.startHeartbeatTimer(t.b);break;case common.DownloaderHandshakeReq:self.downloader.handshakeReq(t.b);break;case common.closeWebsocket:self.downloader.closeWebsocket();break;case common.getSetPlayBackSpeedReq:self.downloader.setPlayBackSpeed(t.b);break;case common.getSetPlayBackStartReq:self.downloader.setPlayBackStart(t.b);break;case common.getSetPlayBackStartTimeReq:self.downloader.SetPlayBackStartTime(t.b);break;case common.heartPingResp:self.downloader.heartPingResp();break;default:self.downloader.logger.logError("Unsupport messsage "+t.t)}}}}]);',"Worker",void 0,o.p+"downloader.worker:3ede097f.js")}function u(){return c()('!function(e){var t={};function a(s){if(t[s])return t[s].exports;var r=t[s]={i:s,l:!1,exports:{}};return e[s].call(r.exports,r,r.exports,a),r.l=!0,r.exports}a.m=e,a.c=t,a.d=function(e,t,s){a.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:s})},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,t){if(1&t&&(e=a(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var s=Object.create(null);if(a.r(s),Object.defineProperty(s,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)a.d(s,r,function(t){return e[t]}.bind(null,r));return s},a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,"a",t),t},a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.p="",a(a.s=0)}([function(e,t){function a(){this.logger=new Logger("Talkloader"),this.ws=null,this.heartbeatTimer=null,this.heartbeatTimes=0,this.handShakeData=null,this.heartbeatPingData=null,this.audioBufferArray=[]}self.importScripts(location.origin+"/sdk/enumConstant.js"),self.importScripts(location.origin+"/sdk/logger.js"),a.prototype.appendBuffer=function(e,t){var a=new Uint8Array(e.byteLength+t.byteLength);return a.set(new Uint8Array(e),0),a.set(new Uint8Array(t),e.byteLength),a.buffer},a.prototype.requestWebsocket=function(e,t){var a=this;null===this.ws?(this.ws=new WebSocket(e),this.ws.binaryType="arraybuffer",this.ws.onopen=function(e){a.logger.logInfo("talkWs connected."),a.heartbeatTimes=0,a.ws.send(a.handShakeData),a.startHeartbeatTimer(a.heartbeatPingData),a.initTalkEncode()},this.ws.onerror=function(e){a.logger.logError("talkWs connect error "+e.data),a.heartbeatTimes=0},this.ws.onclose=function(e){clearInterval(a.heartbeatTimer),a.ws=null,req={t:common.socketActiveClose,d:e.code,w:e.wasClean},self.postMessage(req),a.heartbeatTimes=0},this.ws.onmessage=this.onmessage.bind(this)):this.ws.onmessage=this.onmessage.bind(this)},a.prototype.onmessage=function(e){this.heartbeatTimes=0;var t=e.data;let a={t:common.kGetDeviceInfo,d:t};self.postMessage(a)},a.prototype.initTalkEncode=function(){var e={t:common.initTalkEncode,s:new Date};self.postMessage(e)},a.prototype.startHeartbeatTimer=function(e){this.ws&&(clearInterval(this.heartbeatTimer),this.heartbeatTimer=setInterval((()=>{this.ws.send(e),this.heartbeatTimes=this.heartbeatTimes+1,this.heartbeatTimes>3&&(this.ws.close(),clearInterval(this.heartbeatTimer),this.ws=null,req={t:common.socketNoActive},self.postMessage(req),this.heartbeatTimes=0)}),13e3))},a.prototype.getTalkStartReq=function(){var e={t:common.getTalkStartReq,s:new Date};self.postMessage(e)},a.prototype.setTalkStartRep=function(e){0===this.ws.bufferedAmount&&this.ws.send(e)},a.prototype.setTalkG711Data=function(e){this.ws&&this.ws.send(e)},a.prototype.closeWebsocket=function(e){if(this.ws){this.ws.close(),clearInterval(this.heartbeatTimer),this.ws=null;let e={t:common.DestroyTalkRes};self.postMessage(e)}},a.prototype.setHandShakeData=function(e){this.handShakeData=e},a.prototype.setHeartbeatPingData=function(e){this.heartbeatPingData=e},a.prototype.heartPingResp=function(){this.heartbeatTimes=0},self.talkloader=new a,self.onmessage=function(e){if(self.talkloader){var t=e.data;switch(t.t){case common.fetchStream:self.talkloader.requestWebsocket(t.url);break;case common.DownloaderHeartBeat:self.talkloader.setHeartbeatPingData(t.b);break;case common.TalkHandshakeReq:self.talkloader.setHandShakeData(t.b);break;case common.talkStartRep:self.talkloader.setTalkStartRep(t.b);break;case common.kgetTalkStartRep:self.talkloader.setTalkG711Data(t.b);break;case common.closeWebsocket:self.talkloader.closeWebsocket();break;case common.heartPingResp:self.talkloader.heartPingResp();break;case common.DestroyTalkReq:self.talkloader.closeWebsocket();break;default:self.talkloader.logger.logError("Unsupport messsage "+t.t)}}}}]);',"Worker",void 0,o.p+"talk.worker:e994faef.js")}var p=o(2),f=o.n(p);new f.a("Event").logInfo("Event.js 已加载");class m{constructor(e){this.target={},this.eventsQueue={},this.disallowRepeat=!1}add(e=[],t,o){for(let a of e)this.on(a,t,o)}on(e,t,o){if(void 0===this.eventsQueue[e]&&(this.eventsQueue[e]={methods:[]}),"function"==typeof t){if(!this.disallowRepeat||!this.eventsQueue[e].methods.includes(t))return void 0!==o&&(t.once=o),this.eventsQueue[e].methods.push(t),this.target}else logger.error("on","the argument is not function.",t)}once(e,t){this.on(e,t,!0)}off(e,t){let o=this.eventsQueue[e];if(!o)return;let a=o.methods;if(t){let e=a.length;for(;e--;)a[e]===t&&a.splice(e,1)}else delete this.eventsQueue[e];return this.target}emit(e,...t){let o=this.eventsQueue[e];if(o)return o.methods.forEach((o=>{o.apply(this.target,t),o.once&&this.off(e,o)})),this.target}clear(e){delete this.eventsQueue[e]}clearAll(){this.eventsQueue={}}}var g=function(e){const t=new m(e);return e=>(t.target=e,t)};var k=o(0),y=o.n(k);function R(e,t){let o=t||{};if(!e)return;this.canvasContainer=e,e.style.position="relative";const a=parseInt(getComputedStyle(e).width),r=parseInt(getComputedStyle(e).height);this.conW=a,this.conH=r;const s=document.createElement("canvas");s.width=a,s.height=r,s.style.cssText="transform: scale(1);transform-origin: 0 0;",s.setAttribute("class","videoCanvas"),this.msg="链接已断开";const i=document.createElement("div");i.style.cssText="position: absolute;z-index: 2;background-color: rgba(0, 0, 0, 0);margin: 0;top: 0;right: 0;bottom: 0;left: 0;",e.appendChild(s),e.appendChild(i),i.setAttribute("class","videoCanvasMsg");this.container_el=e,this.canvas=s,this.stateContainer_el=i,this.loading_el_str=o.loading_el_str?o.loading_el_str:'

视频连接中...

',this.pauseimg_el_str=o.pauseimg_el_str?o.pauseimg_el_str:'
\n \n 重播\n \n \n \n \n \n \n \n \n \n \n \n
',this.msg_el_str=o.msg_el_str?o.msg_el_str():function(e){return`

${e}

`},this.stateContainer_el.innerHTML=""}R.prototype._showOrHideShade=function(e){this.stateContainer_el.style.backgroundColor=e},R.prototype.showPauseIcon=function(){this._showOrHideShade("rgba(0,0,0,0)"),this.pauseimg_el_str.nodeType?(this.stateContainer_el.innerHTML="",this.stateContainer_el.appendChild(this.pauseimg_el_str)):this.stateContainer_el.innerHTML=this.pauseimg_el_str},R.prototype.showLoading=function(){this._showOrHideShade("rgba(0,0,0,1)"),this.stateContainer_el.innerHTML="",this.loading_el_str.nodeType?(this.stateContainer_el.innerHTML="",this.stateContainer_el.appendChild(this.loading_el_str)):this.stateContainer_el.innerHTML=this.loading_el_str},R.prototype.showMsg=function(e,t){this._showOrHideShade("rgba(0,0,0,1)"),this.stateContainer_el.innerHTML="";let o=null;o=e||t?"function"==typeof this.msg_el_str&&e?this.msg_el_str(e,t):this.msg_el_str(t):this.msg_el_str(""),o.nodeType?(this.stateContainer_el.innerHTML="",this.stateContainer_el.appendChild(o)):this.stateContainer_el.innerHTML=o},R.prototype.hideAll=function(){this._showOrHideShade("rgba(0,0,0,0)"),this.msg="",this.stateContainer_el.innerHTML=""};var v=R;var b={4:{code:4,code16:4,eventStr:"SERVER_UNKNOWN_ERROR",msg:"服务器未知错误"},5:{code:5,code16:5,eventStr:"SERVER_NOT_READY",msg:"服务器未准备好"},6:{code:6,code16:6,eventStr:"SERVER_USER_ABORT",msg:"服务器端用户主动断开"},7:{code:7,code16:7,eventStr:"SERVER_STOPPED",msg:"服务器服务已停止"},8:{code:8,code16:8,eventStr:"SERVER_ABORT",msg:"服务器服务已中断"},9:{code:9,code16:9,eventStr:"SERVER_STREAM_STOP",msg:"服务器流停止"},10:{code:10,code16:10,eventStr:"SERVER_CONNECT_DEV_FAILED",msg:"连接设备失败"},11:{code:11,code16:11,eventStr:"SERVER_SUBDEV_STREAM_ERR",msg:"订阅设备流失败"},12:{code:12,code16:12,eventStr:"SERVER_INVALID_CONTEXT",msg:"不合法的上下文"},13:{code:13,code16:13,eventStr:"SERVER_DEVICE_TIMEOUT",msg:"设备超时"},14:{code:14,code16:14,eventStr:"SERVER_CLIENT_TIMEOUT",msg:"客户端超时"},15:{code:15,code16:15,eventStr:"SERVER_OVER_DEV_LIMIT",msg:"超过设备最大连接数"},16:{code:16,code16:16,eventStr:"SERVER_PERM_DENIED",msg:"无权限"},17:{code:17,code16:17,eventStr:"SERVER_DATA_TIMEOUT",msg:"数据超时"},18:{code:18,code16:18,eventStr:"SERVER_DEVICE_ABORT",msg:"服务器端设备主动断开"}};let S=function(e,t=16,o=48e3){t=t,o=o;var a=new AudioContext,r=a.createMediaStreamSource(e),s=a.createScriptProcessor(4096,1,1),i={size:0,buffer:[],inputSampleRate:o,inputSampleBits:16,outputSampleRate:8e3,oututSampleBits:t,clear:function(){this.buffer=[],this.size=0},input:function(e){this.buffer.push(new Float32Array(e)),this.size+=e.length},compress:function(){for(var e=new Float32Array(this.size),t=0,o=0;o{o.emit("UNKNOWN_ERROR",e)})),o.on("SERVER_NOT_READY",(e=>{o.emit("NOT_READY",e)})),o.on("SERVER_USER_ABORT",(e=>{o.emit("USER_ABORT",e)})),o.on("SERVER_STOPPED",(e=>{o.emit("STOPPED",e)})),o.on("SERVER_ABORT",(e=>{o.emit("ABORT",e)})),o.on("SERVER_STREAM_STOP",(e=>{o.emit("STREAM_STOP",e)})),o.on("SERVER_CONNECT_DEV_FAILED",(e=>{o.emit("CONNECT_DEV_FAILED",e)})),o.on("SERVER_SUBDEV_STREAM_ERR",(e=>{o.emit("SUBDEV_STREAM_ERR",e)})),o.on("SERVER_INVALID_CONTEXT",(e=>{o.emit("INVALID_CONTEXT",e)})),o.on("SERVER_DEVICE_TIMEOUT",(e=>{o.emit("DEVICE_TIMEOUT",e)})),o.on("SERVER_CLIENT_TIMEOUT",(e=>{o.emit("CLIENT_TIMEOUT",e)})),o.on("SERVER_OVER_DEV_LIMIT",(e=>{o.emit("OVER_DEV_LIMIT",e)})),o.on("SERVER_PERM_DENIED",(e=>{o.emit("PERM_DENIED",e)})),o.on("SERVER_DATA_TIMEOUT",(e=>{o.emit("DATA_TIMEOUT",e)})),o.on("SERVER_DEVICE_ABORT",(e=>{o.emit("DEVICE_ABORT",e)})),o.on("MEDIA_ERROR",(e=>{o.emit("GET_MEDIA_ERROR",e)})),o.on("MEDIA_PROGRESS_INFO",(e=>{o.emit("GET_MEDIA_PROGRESS_INFO",e)})),o.on("DEVICE_RECORD_LIST",(e=>{o.emit("GET_DEVICE_RECORD_LIST",e)})),o.on("MEDIA_PLAY",(()=>{o.emit("GET_MEDIA_PLAY")})),o.on("MEDIA_PAUSE",(()=>{o.emit("GET_MEDIA_PAUSE")})),o.on("MEDIA_STOP",(()=>{o.emit("GET_MEDIA_STOP")})),o.on("VIDEO_MAX_END",(()=>{o.emit("GET_VIDEO_MAX_END")})),this.currentVolume=100,this.configInfo=null,this.pcmPlayer=null,this.canvas=null,this.webglPlayer=null,this.frameRate=0,this.pixFmt=0,this.videoWidth=0,this.videoHeight=0,this.yLength=0,this.uvLength=0,this.playerState=T,this.socketSending=!1,this.decoding=!1,this.currentTimestamp="",this.audioEncoding="",this.audioChannels=0,this.audioSampleRate=0,this.sampleFmt=0,this.speedNum=2,this.setFrameRate=1,this.seeking=!1,this.loadingDiv=null,this.loadingState=!0,this.buffering=!1,this.frameBuffer=[],this.isStream=!1,this.logger=new f.a("Player"),this.drawingState=!1,this.speeding=!1,this.playInitState=!0,this.playFirstGetParams=!0,this.requestAnimationFrame=null,this._onSnapshot=null,this._curSpeed=null,this.endtime=null;const a=new v(e,t);this.showPauseIcon=()=>{a.showPauseIcon()},this.showLoading=()=>{a.showLoading()},this.showMsg=(e,t)=>{a.showMsg(e,t)},this.hideAll=()=>{a.hideAll()},this._msgController=a,this.talkRecord=null,this.talkTimer=null,this.talkStream=null,this.getAudioDating=!1,this.getAudioDataStatus=!1;this.observer=new MutationObserver((e=>{if(this.videoHeight&&this.videoWidth&&this._msgController){let e=Math.ceil(1e5*parseInt(getComputedStyle(this.el).width)/this.videoWidth)/1e5,t=Math.ceil(1e5*parseInt(getComputedStyle(this.el).height)/this.videoHeight)/1e5;this.canvas.style.cssText=`transform: scale(${e},${t});transform-origin: 0 0;position:absolute;left: 0;top: 0;`}})),this.observer.observe(this._msgController.canvasContainer,{attributes:!0}),Object.defineProperty(this,"onSnapshot",{set:e=>{this._onSnapshot=e}})}M.prototype.initDownloadWorker=function(){var e,t=this;this.downloadWorker=new h,this.downloadWorker.onmessage=function(o){var a=o.data;switch(a.t){case y.a.sendHandshakeReq:e={t:y.a.getHandshakeReq},t.decodeWorker.postMessage(e);break;case y.a.kFileData:t.onFileData(a.d);break;case y.a.socketActiveClose:t.onsocketActiveClose(a.d,a.w);break;case y.a.socketNoActive:t.onsocketNoActive()}}},M.prototype.initDecodeWorker=function(){var e=this;this.decodeWorker=new d,this.decodeWorker.onmessage=function(t){var o=t.data;const a={[y.a.kInitDecoderRsp]:"onInitDecoder",[y.a.kOpenDecoderRsp]:"onOpenDecoder",[y.a.kVideoFrame]:"onVideoFrame",[y.a.kAudioFrame]:"onAudioFrame",[y.a.kDecodeFinishedEvt]:"onDecodeFinished",[y.a.sendDataCallback]:"onSendDataCallback",[y.a.kGetParamRsp]:"onGetParam",[y.a.socketLinkState]:"onSocketLinkState",[y.a.getHeartBeatRequest]:"onGetHeartBeatRequest",[y.a.getHandshakeReq]:"onGetHandshakeReq",[y.a.getSetPlayBackSpeedReq]:"onGetSetPlayBackSpeedReq",[y.a.getSetPlayBackStartReq]:"onGetSetPlayBackStartReq",[y.a.deviceReady]:"onDeviceReady",[y.a.getSetPlayBackStartTimeReq]:"onGetSetPlayBackStartTimeReq",[y.a.responseCurDateTime]:"onResponseCurDateTime",[y.a.eventTypeFifoFull]:"onEventTypeFifoFull",[y.a.eventTypeFifoEnough]:"onEventTypeFifoEnough",[y.a.playbakcRecordList]:"onPlaybakcRecordList",[y.a.serverDataTimeout]:"onServerDataTimeout",[y.a.serverDecoderError]:"onDecoderError",[y.a.serverDecoderTalkError]:"onDecoderTalkError",[y.a.heartPingResp]:"onHeartPingResp",[y.a.getHandsharkRes]:"onGetHandsharkRes",[y.a.kCloseDecoderRsp]:"onCloseDecoderRsp",[y.a.onWasmLoaded]:"onWasmLoaded",[y.a.kVideoDownRep]:"onVideoDownRep",[y.a.kVideoDownChumksRep]:"onVideoDownChumksRep",[y.a.getTalkStartReq]:"onTalkStartRep",[y.a.kStartTalkEncoderRsp]:"onStartTalkEncoder",[y.a.kGetAudioDataReq]:"onGetAudioDataReq",[y.a.kgetTalkStartRep]:"onGetAudioDataRep",[y.a.closeTalk]:"onCloseTalk",[y.a.kStartTalkEncoderdeviceready]:"onkTalkEncoderdeviceready",[y.a.PlaybackOver]:"onPlaybackOver"};a[o.t]&&e[a[o.t]](o)}},M.prototype.play=function(e){this.frameBuffer.length=0,this.frameBuffer=[];let{url:t,endtime:o,isStream:a,i:r,k:s,t:i}=e,l={e:0,m:"Success"},c=this;{if(this.playerState==_)return l=this.resume(),l;if(this.playerState==E)return l;if(!t)return l={e:-1,m:"Invalid url"},this.logger.logError("[ER] playVideo error, url empty."),l;if(!a&&!o)return l={e:-1,m:"Invalid endtime"},this.logger.logError("[ER] playVideo error, endtime empty."),l;if(!("AES-256-GCM"!=i||r&&s))return l={e:-1,m:"Invalid params"},this.logger.logError("[ER] playVideo error, params empty."),l;this.initDownloadWorker(),this.initDecodeWorker(),this.initTalkWorker(),this.canvas=this._msgController.canvas,this.configInfo=null,this.configInfo=new D(e),this.playerState=E,this.isStream=a,this.endtime=o,this.webglPlayer=new n(this.canvas,{preserveDrawingBuffer:!0,antialias:!0}),this.displayLoop();const d={t:y.a.kInitDecoderReq,s:this.isStream?0:1,c:4194304,k:this.configInfo.k,i:this.configInfo.i,ct:this.configInfo.ct};this.decodeWorker.postMessage(d);let h=!1;this.registerVisibilityEvent((function(e){e&&1==c.playerState?(c.getAudioDataStatus&&!c.getAudioDating&&c.startRecord(),c.isStream?1==h&&(c.pcmPlayer&&c.pcmPlayer.resume(),c.decodeWorker.postMessage({t:y.a.resetDecoderFifo}),c.startDecoding(),h=!1):1==h&&(c.resume(),h=!1)):(c.getAudioDataStatus&&c.getAudioDating&&c.talkPause(),c.isStream?(h=!0,c.pcmPlayer&&c.pcmPlayer.pause(),c.pauseDecoding()):c.playerState==E&&(c.pause(),h=!0))})),this.buffering=!0,this.loadingState=!0,this.hideAll(),this.event.emit("GET_MEDIA_PLAY")}return l},M.prototype.seekTo=function(e){let t={e:-1,m:"Parameter Null."};if(!e)return this.logger.logError("[ER] seekTo error, time empty."),t;if(this.playerState!=E)return t.m="Player Is NotPlaying",t;this.seeking=!0,this.speeding=!1,this.pauseDecoding(),this.decodeWorker.postMessage({t:y.a.resetDecoderFifo}),this.frameBuffer.length=0;const o={t:y.a.getSetPlayBackStartTimeReq,s:e};return this.decodeWorker.postMessage(o),t.e=0,t.m="SeekTo Success.",t},M.prototype.setSpeed=function(e){let t={e:-1,m:"Parameter Null."};if(!e)return this.logger.logError("[ER] seekTo error, time empty."),t;const o=["0","1/16","1/8","1/4","1/2","1","2","4","8","16"];let a=["0","0.0625","0.125","0.25","0.5","1","2","4","8","16"].findIndex((t=>t==e));if(a>-1){this.speed(o[a]),"0"!=o[a]&&(this._curSpeed=e),this.event.emit("speedNum",o[a]);const r=parseFloat(e);return r>1&&(this.speeding=!0,this.setFrameRate=this.setFrameRateFn(),this.speedNum=2*r,this.restartAudio()),r>0&&r<1&&(this.speeding=!0,this.speedNum=2,0!=this.frameRate&&(this.setFrameRate=Math.floor(this.setFrameRateFn()/r)),this.restartAudio()),1!=r&&0!=r||(this.speeding=!1,this.speedNum=2,this.setFrameRate=this.setFrameRateFn()),t.e=0,t.m="SetSpeed Success.",t}return t.m="Invalid Parameter.",t},M.prototype.pause=function(){let e={e:-1,m:"Not playing"};if(!this.isStream)return this.playerState!=E||(this.playerState=_,this.pcmPlayer&&this.pcmPlayer.pause(),this.setSpeed("0"),this.pauseDecoding(),this.showPauseIcon(),this.event.emit("GET_MEDIA_PAUSE"),e.e=0,e.m="Pause Success."),e},M.prototype.resume=function(){this.logger.logInfo("Resume.");let e={e:-1,m:"Not pausing"};return this.playerState!=_||(this.playerState=E,this.pcmPlayer&&this.pcmPlayer.resume(),this.startDecoding(),this.setSpeed("1"),this.hideAll(),this.event.emit("GET_MEDIA_PLAY"),e.e=0,e.m="Resume Success."),e},M.prototype.stop=function(e,t){let o={e:-1,m:"Not playing."};return this.playerState==T||(this.playerState=T,this.resetPlayer(e,t),this.getAudioDataStatus&&(this.getAudioDataStatus=!1,this.talkDestroy()),o.e=0,o.m="Stop Success."),o},M.prototype.resetPlayer=function(e,t){this.closeWebsocket(),(window.cancelAnimationFrame||window.mozCancelAnimationFrame)(this.requestAnimationFrame),this.webglPlayer.webGLDestroy(),this.loadingState=!1,this.canvas=null,this.webglPlayer=null,this.frameRate=0,this.pixFmt=0,this.videoWidth=0,this.videoHeight=0,this.yLength=0,this.uvLength=0,this.audioEncoding="",this.audioChannels=0,this.audioSampleRate=0,this.sampleFmt=0,this.speedNum=2,this.setFrameRate=1,this.playerState=T,this.socketSending=!1,this.decoding=!1,this.currentTimestamp="",this.frameBuffer.length=0,this.frameBuffer=[],this.buffering=!1,this.drawingState=!1,this.speeding=!1,this.playInitState=!0,this.playFirstGetParams=!0,w=0,this.requestAnimationFrame=null,this.endtime=null,this._curSpeed=null,this.pcmPlayer&&(this.pcmPlayer.destroy(),this.pcmPlayer=null,this.logger.logInfo("Pcm player released.")),this.logger.logInfo("Closing decoder."),this.decodeWorker.postMessage({t:y.a.kUninitDecoderReq}),this.showMsg(e,t),this.logger.logInfo("Uniniting decoder."),this.observer=null},M.prototype.reconnection=function(){const e={url:this.configInfo.url,endtime:this.configInfo.endtime,isStream:this.configInfo.isStream,k:this.configInfo.k,i:this.configInfo.i,ct:this.configInfo.ct,streamHighWaterFrame:this.configInfo.streamHighWaterFrame,playbackHighWaterFrame:this.configInfo.playbackHighWaterFrame,playbackLowWaterFrame:this.configInfo.playbackLowWaterFrame,language:this.configInfo.language?this.configInfo.language:"ch",deviceName:this.configInfo.deviceName?this.configInfo.deviceName:"设备"};this.play(e)},M.prototype.getCurTimestamp=function(){return this.currentTimestamp},M.prototype.fullscreen=function(){this.webglPlayer&&this.webglPlayer.fullscreen()},M.prototype.getState=function(){return this.playerState},M.prototype.volume=function(e){let t={e:-1,m:"Parameter Null"};return null===e||(null!==this.pcmPlayer&&this.pcmPlayer.volume(e),this.currentVolume=e,t.e=0,t.m="Set Volume Success."),t},M.prototype.recoderStart=function(){var e={t:y.a.recoderStart};this.decodeWorker.postMessage(e)},M.prototype.recoderPause=function(){var e={t:y.a.recoderPause};this.decodeWorker.postMessage(e)},M.prototype.setFrameRateFn=function(){return 1},M.prototype.displayLoop=function(){if(this.playerState!=T){let e=window.requestAnimationFrame||window.mozRequestAnimationFrame;this.requestAnimationFrame=e(this.displayLoop.bind(this))}if(this.playerState==E&&0!=this.frameBuffer.length&&!this.buffering)if(!this.isStream&&w5==e.t))}break;case y.a.kVideoFrame:if(this.displayVideoFrame(e)){this.frameBuffer.shift(),w=0;this.frameBuffer.filter((e=>4==e.t))}break;default:return}if(0==this.frameBuffer.length)break}!this.isStream&&this.frameBuffer.length>=this.configInfo.playbackHighWaterFrame&&this.socketSending&&(this.setSpeed("0"),this.event.emit("speedNum",0)),!this.isStream&&this.frameBuffer.length=this.configInfo.streamHighWaterFrame&&(this.frameBuffer=[])}},M.prototype.displayAudioFrame=function(e){if(this.playerState!=E)return!1;if(this.speeding)return!0;if(this.seeking&&(this.restartAudio(),this.loadingState=!1,this.seeking=!1),this.pcmPlayer){(new Date).getTime();this.pcmPlayer.feed(e.d)}return!0},M.prototype.displayVideoFrame=function(e){if(this.playerState!=E)return!1;if(this.seeking&&(this.restartAudio(),this.loadingState=!1,this.seeking=!1),this.drawingState){this.canvas.toBlob((e=>{this._onSnapshot(e)})),this.drawingState=!1;(function(){const e=document.createElement("a");document.body.appendChild(e),e.style.display="none"})()}(new Date).getTime();var t=new Uint8Array(e.d);return this.renderVideoFrame(t),!0},M.prototype.renderVideoFrame=function(e){this.webglPlayer.renderFrame(e,this.videoWidth,this.videoHeight,this.yLength,this.uvLength)},M.prototype.onFileData=function(e){var t;t={t:y.a.kFeedDataReq,d:e},this.decodeWorker.postMessage(t,[t.d])},M.prototype.onsocketActiveClose=function(e,t){let o="连接失败";this.serverDataTimeout&&(this.serverDataTimeout=!1),this.decoderErrorFlag?(this.event.emit("CLIENT_LINK_ERROR_ONE"),o=(this.configInfo.deviceName?this.configInfo.deviceName+":":"")+"数据接收超时!(0x"+this.serverDeviceUnLinkCode.toString(16)+")",this.decoderErrorFlag=!1):this.socketNoActive?(this.event.emit("CLIENT_LINK_ERROR_THREE"),o=(this.configInfo.deviceName?this.configInfo.deviceName+":":"")+"视频加载失败,请检查设备或网络配置!",this.socketNoActive=!1):1005==e||1e3==e||t?this.decoderErrorFlag&&(this.event.emit("CLIENT_LINK_ERROR_ONE"),o=(this.configInfo.deviceName?this.configInfo.deviceName+":":"")+"链接异常(0x"+this.serverDeviceUnLinkCode.toString(16)+")",this.decoderErrorFlag=!1):this.serverDeviceUnLinkCode?(o=(this.configInfo.deviceName?this.configInfo.deviceName+":":"")+"链接异常(0x"+this.serverDeviceUnLinkCode.toString(16)+")",this.event.emit("CLIENT_LINK_ERROR_ONE")):(o=(this.configInfo.deviceName?this.configInfo.deviceName+":":"")+"链接异常("+e+")",this.event.emit("CLIENT_LINK_ERROR_ONE")),this.stop("linkfail",o)},M.prototype.onsocketTalkActiveClose=function(e){1005===e&&1e3===e||this.talkDestroy()},M.prototype.onsocketNoActive=function(){this.stop(),this.socketNoActive=!0},M.prototype.onInitDecoder=function(e){if(this.playerState!=T)if(this.logger.logInfo("Init decoder response "+e.e+"."),0==e.e){const e={t:y.a.fetchStream,url:this.configInfo.url,msg:"start"};this.downloadWorker.postMessage(e),this.socketSending=!0,this.showLoading()}else this.reportPlayError(e.e)},M.prototype.onSendDataCallback=function(){const e={t:y.a.kOpenDecoderReq};this.decodeWorker.postMessage(e)},M.prototype.onOpenDecoder=function(e){this.startDecoding()},M.prototype.startDecoding=function(){var e={t:y.a.kStartDecodingReq,i:5};this.decodeWorker.postMessage(e),this.decoding=!0},M.prototype.onGetParam=function(e){if(this.playerState!=T&&this.playerState!=_)if(0==e.e){if(!this.playFirstGetParams&&("video"==e.type&&(this.frameRate!=e.v.d||this.pixFmt!=e.v.p||this.videoWidth!=e.v.w||this.videoHeight!=e.v.h)||"audio"==e.type&&(this.audioChannels!=e.a.c||this.audioSampleRate!=e.a.r||this.sampleFmt!=e.a.f)))return this.resetPlayer(),void setTimeout((()=>{this.reconnection()}),1e3);"audio"==e.type?this.onAudioParam(e.a):this.onVideoParam(e.v),this.decoding=!0,this.buffering=!1,this.loadingState=!1,this.hideAll(),this.event.emit("MEDIA_INFO",e)}else this.reportPlayError(e.e)},M.prototype.onVideoParam=function(e){if(this.playerState==T)return;this.logger.logInfo("Video param duation:"+e.d+" pixFmt:"+e.p+" width:"+e.w+" height:"+e.h+"."),this.frameRate=e.d,this.pixFmt=e.p,this.canvas.width=e.w,this.canvas.height=e.h;let t=Math.ceil(1e5*parseInt(getComputedStyle(this.el).width)/e.w)/1e5,o=Math.ceil(1e5*parseInt(getComputedStyle(this.el).height)/e.h)/1e5;this.canvas.style.cssText=`transform: scale(${t},${o});transform-origin: 0 0;position:absolute;left: 0;top: 0;`,this.videoWidth=e.w,this.videoHeight=e.h,this.yLength=this.videoWidth*this.videoHeight,this.uvLength=this.videoWidth/2*(this.videoHeight/2)},M.prototype.onAudioParam=function(e){if(this.playerState!=T&&(this.logger.logInfo("Audio param sampleFmt:"+e.f+" channels:"+e.c+" sampleRate:"+e.r+"."),0!=e.r&&0!=e.c)){var t=e.f;this.sampleFmt=e.f;var o=e.c,a=e.r,s="16bitInt";switch(t){case 0:s="8bitInt";break;case 1:s="16bitInt";break;case 2:s="32bitInt";break;case 3:s="32bitFloat";break;default:this.logger.logError("Unsupported audio sampleFmt "+t+"!")}this.logger.logInfo("Audio encoding "+s+"."),this.playInitState&&(this.pcmPlayer=new r({encoding:s,channels:o,sampleRate:a,flushingTime:100}),this.audioEncoding=s,this.audioChannels=o,this.audioSampleRate=a,this.playInitState=!1,this.volume(0))}},M.prototype.onAudioFrame=function(e){this.bufferFrame(e)},M.prototype.onVideoFrame=function(e){if(this.frameBuffer.filter((e=>4==e.t)).length>5){let e=this.frameBuffer.filter((e=>5==e.t));this.frameBuffer=e}this.bufferFrame(e)},M.prototype.bufferFrame=function(e){this.frameBuffer.push(e),this.getBufferTimerLength()>=500&&this.buffering&&(this.buffering=!1,this.loadingState=!1)},M.prototype.onSocketLinkState=function(e){var t;switch(this.logger.logInfo("Open socket response "+e.s+"."),e.s){case 1:t={t:y.a.getHeartBeatRequest},this.decodeWorker.postMessage(t);break;case 2:case 3:this.stop()}},M.prototype.onGetHeartBeatRequest=function(e){const t={t:y.a.DownloaderHeartBeat,b:e.b,l:e.l};this.downloadWorker.postMessage(t),this.talkWorker.postMessage(t)},M.prototype.onGetHandshakeReq=function(e){const t={t:y.a.DownloaderHandshakeReq,b:e.b,l:e.l},o={t:y.a.TalkHandshakeReq,b:e.b,l:e.l};this.downloadWorker.postMessage(t),this.talkWorker.postMessage(o),this.setSpeed("1")},M.prototype.onGetSetPlayBackSpeedReq=function(e){const t={t:y.a.getSetPlayBackSpeedReq,b:e.b};this.downloadWorker.postMessage(t)},M.prototype.onGetSetPlayBackStartReq=function(e){const t={t:y.a.getSetPlayBackStartReq,b:e.b};this.downloadWorker.postMessage(t)},M.prototype.onDeviceReady=function(){const e={t:y.a.getSetPlayBackStartReq};this.decodeWorker.postMessage(e)},M.prototype.onGetSetPlayBackStartTimeReq=function(e){this.startDecoding();const t={t:y.a.getSetPlayBackStartTimeReq,b:e.b};this.downloadWorker.postMessage(t)},M.prototype.onResponseCurDateTime=function(e){String(e.d).replace("n","");this.currentTimestamp=e.d;const t=new Date(this.endtime).getTime();parseInt(e.d)>=t&&this.event.emit("MEDIA_PROGRESS_INFO_STOP",parseInt(e.d)),this.event.emit("MEDIA_PROGRESS_INFO",parseInt(e.d))},M.prototype.onEventTypeFifoFull=function(e){this.playerState==E&&(this.setSpeed("0"),this.event.emit("speedNum",0))},M.prototype.onEventTypeFifoEnough=function(e){this.playerState==E&&(this._curSpeed?(this.setSpeed(this._curSpeed),this.event.emit("speedNum",this._curSpeed)):(this.setSpeed("1"),this.event.emit("speedNum",1)))},M.prototype.onServerDataTimeout=function(e){this.serverDataTimeout=!0,this.stop()},M.prototype.onGetHandsharkRes=function(e){const t=window.btoa(String.fromCharCode(...e.b)),o={t:y.a.fetchStream,url:this.configInfo.url+"&public_key="+t,msg:"start"};this.downloadWorker.postMessage(o),this.socketSending=!0,this.showLoading()},M.prototype.onCloseDecoderRsp=function(){this.event.emit("MEDIA_STOP"),this.decodeWorker.terminate(),this.downloadWorker.terminate(),this.talkWorker.terminate()},M.prototype.onWasmLoaded=function(){this.event.emit("WASMLOADED")},M.prototype.onPlaybakcRecordList=function(e){let t=JSON.parse(e.d);t.rec_file_infos?this.isStream||this.event.emit("DEVICE_RECORD_LIST",t):this.showMsg("linkfail",(this.configInfo.deviceName?this.configInfo.deviceName+":":"")+"数据列表为空!")},M.prototype.onHeartPingResp=function(){const e={t:y.a.heartPingResp};this.downloadWorker.postMessage(e)},M.prototype.onDecoderError=function(e){let t="连接失败(服务)";this.serverDeviceUnLinkCode=e.s,b[e.s]&&b[e.s].eventStr&&(this.event.emit(b[e.s].eventStr,b[e.s]),t=(this.configInfo.deviceName?this.configInfo.deviceName+":":"")+b[e.s].msg+"(0x"+this.serverDeviceUnLinkCode.toString(16)+")",this.stop("linkfail",t)),this.event.emit("decoderError",e),this.decoderErrorFlag=!0},M.prototype.speed=function(e){if(!e)return;this.socketSending="0"!=e;const t={t:y.a.getSetPlayBackSpeedReq,l:e};this.decodeWorker.postMessage(t)},M.prototype.restartAudio=function(){this.pcmPlayer&&(this.pcmPlayer.destroy(),this.pcmPlayer=null),0!=this.audioSampleRate&&0!=this.audioChannels&&(this.pcmPlayer=new r({encoding:this.audioEncoding,channels:this.audioChannels,sampleRate:this.audioSampleRate,flushingTime:1e3}),this.volume(this.currentVolume))},M.prototype.onDecodeFinished=function(e){this.pauseDecoding()},M.prototype.getBufferTimerLength=function(){if(!this.frameBuffer||0==this.frameBuffer.length)return 0;let e=this.frameBuffer[0],t=this.frameBuffer[this.frameBuffer.length-1];return Math.abs(t.s-e.s)},M.prototype.closeWebsocket=function(){const e={t:y.a.closeWebsocket};this.downloadWorker.postMessage(e)},M.prototype.pauseDecoding=function(){var e={t:y.a.kPauseDecodingReq};this.decodeWorker.postMessage(e),this.decoding=!1},M.prototype.formatTime=function(e){return(Math.floor(e/3600)<10?"0"+Math.floor(e/3600):Math.floor(e/3600))+":"+(Math.floor(e/60%60)<10?"0"+Math.floor(e/60%60):Math.floor(e/60%60))+":"+(e=Math.floor(e%60)<10?"0"+Math.floor(e%60):Math.floor(e%60))},M.prototype.reportPlayError=function(e,t,o){},M.prototype.registerVisibilityEvent=function(e){var t="hidden";function o(o){var a=!0,r=!1,s={focus:a,focusin:a,pageshow:a,blur:r,focusout:r,pagehide:r},i=a;i=(o=o||window.event).type in s?s[o.type]:document[t]?r:a,e(i)}t in document?document.addEventListener("visibilitychange",o):(t="mozHidden")in document?document.addEventListener("mozvisibilitychange",o):(t="webkitHidden")in document?document.addEventListener("webkitvisibilitychange",o):(t="msHidden")in document?document.addEventListener("msvisibilitychange",o):"onfocusin"in document?document.onfocusin=document.onfocusout=o:window.onpageshow=window.onpagehide=window.onfocus=window.onblur=o,void 0!==document[t]&&o({type:document[t]?"blur":"focus"})},M.prototype.snapshot=function(){this.drawingState=!0},M.prototype.onVideoDownRep=function(e){let t=e.d.map((e=>e.buffer));const o=document.createElement("a");o.style.display="none";const a=new Blob(t,{type:"video/mp4"}),r=window.URL.createObjectURL(a);o.href=r,o.download="录像"+(new Date).getTime()+".mp4",document.body.appendChild(o),o.click(),o.remove(),e.d=[]},M.prototype.onVideoDownChumksRep=function(e){e.d.length>=25&&(this.recoderPause(),this.event.emit("VIDEO_MAX_END"))},M.prototype.initTalkWorker=function(){var e=this;this.talkWorker=new u,this.talkWorker.onmessage=function(t){var o=t.data;switch(o.t){case y.a.kGetDeviceInfo:e.decodeWorker.postMessage(o);break;case y.a.socketActiveClose:e.onsocketTalkActiveClose(o.d);break;case y.a.getTalkStartReq:const t={t:y.a.getTalkStartReq,b:"",msg:""};e.decodeWorker.postMessage(t);break;case y.a.socketNoActive:e.onsocketNoActive();break;case y.a.DestroyTalkRes:break;case y.a.initTalkEncode:const a={t:y.a.initTalkEncode,b:"",msg:""};e.decodeWorker.postMessage(a)}}},M.prototype.onTalkStartRep=function(e){const t={t:y.a.talkStartRep,b:e.b,msg:"start"};this.talkWorker.postMessage(t)},M.prototype.onStartTalkEncoder=function(e){const t={t:y.a.kStartTalkEncoderRsp,b:e.b};this.decodeWorker.postMessage(t)},M.prototype.talk=function(e){const t={t:y.a.fetchStream,url:e};this.talkWorker.postMessage(t)},M.prototype.onGetAudioDataReq=function(){this.getAudioDataStatus=!0,this.startRecord()},M.prototype.onGetAudioDataRep=function(e){this.talkWorker.postMessage(e)},M.prototype.onkTalkEncoderdeviceready=function(){const e={t:y.a._getTalkStartReq,b:"",msg:""};this.decodeWorker.postMessage(e)},M.prototype.onPlaybackOver=function(){this.event.emit("PLAYBACKOVER")},M.prototype.onDecoderTalkError=function(e){b[e.s]&&b[e.s].eventStr&&this.event.emit(b[e.s].eventStr,b[e.s],"talk"),this.event.emit("CLIENT_TALK_ERROR_ONE",e),this.talkDestroy()};M.prototype.startRecord=function(){this.getAudioDating=!0,this.talkRecord||navigator.mediaDevices.getUserMedia({audio:{sampleRate:48e3,sampleSize:16,channelCount:1,volume:1,noiseSuppression:!0,echoCancellation:!0}}).then((e=>{this.talkStream=e,this.talkRecord=new S(this.talkStream),this.talkRecord.start(),this.talkTimer=setInterval((async()=>{if(this.getAudioDating&&this.talkRecord){let t=this.talkRecord.getBlob();this.talkRecord.clear();let o=await(e=t,new Promise(((t,o)=>{let a=new FileReader;a.readAsArrayBuffer(e),a.onload=function(e){a.result.slice(0,24e3),t({d:a.result,t:(new Date).getTime(),h:a.result.byteLength})}})));const a={t:y.a.pcmDataReq,p:o};this.decodeWorker.postMessage(a)}var e}),50)})).catch((e=>{this.event.emit("getUserMediaError")}))},M.prototype.talkPause=function(){this.talkRecord&&(clearInterval(this.talkTimer),this.talkRecord.stop(),this.talkRecord.clear(),this.talkRecord=null,this.talkStream.getTracks().forEach((e=>e.stop())),this.getAudioDating=!1)},M.prototype.onCloseTalk=function(e){this.event.emit("CLIENT_TALK_ERROR_ONE",e),this.talkDestroy()},M.prototype.talkDestroy=function(){this.talkRecord&&(clearInterval(this.talkTimer),this.talkRecord.stop(),this.talkRecord.clear(),this.talkRecord=null,this.talkStream.getTracks().forEach((e=>e.stop())),this.getAudioDating=!1);const e={t:y.a.DestroyTalkReq};this.talkWorker.postMessage(e),this.decodeWorker.postMessage(e)};t.default=M}])})); \ No newline at end of file diff --git a/src/pages/ElecEvaluation/Monitor/service.ts b/src/pages/ElecEvaluation/Monitor/service.ts index e1147e5..b143588 100644 --- a/src/pages/ElecEvaluation/Monitor/service.ts +++ b/src/pages/ElecEvaluation/Monitor/service.ts @@ -366,6 +366,8 @@ export async function getAlarmMetadata2(data: any) { */ export async function getAlarmMetadata(data: any) { console.log(data); + data["pageNum"]="1"; + data["pageSize"]="6"; return request('/api/biz-service-ebtp-evaluation/v1/eval/room/jovision/getAlarmMetadata', { method: 'POST', data: data, diff --git a/src/pages/ElecEvaluation/Monitor/wasmStyle.less b/src/pages/ElecEvaluation/Monitor/wasmStyle.less new file mode 100644 index 0000000..46d2b3a --- /dev/null +++ b/src/pages/ElecEvaluation/Monitor/wasmStyle.less @@ -0,0 +1,194 @@ +.p_top { + width: 100%; + height: 48px; + background: #292b36; + padding: 14px 21px 0 21px; + font-size: 14px; + color: #ffffff; + letter-spacing: 0; + box-sizing: border-box; + display: flex; + justify-content: space-between; + position: relative; + } + .p_container { + overflow: hidden; + position: relative; + height: 95%; + width: 100%; + background: #000; + // text-align: center; + } + .p_bottom_container { + position: relative; + width: 100%; + } + .p_bottom { + width: 100%; + top:-48px; + height: 48px; + background: #292b36; + padding: 14px 21px 0 21px; + font-size: 14px; + color: #ffffff; + letter-spacing: 0; + box-sizing: border-box; + display: flex; + justify-content: space-between; + + } + .scale .dot-container { + display: inline-block; + height: 16px; + width: 60px; + position: relative; + background: #fff; + height: 2px; + margin: 7px 10px; + line-height: 16px; + vertical-align: middle; + + } + .dot-container-dot { + display: inline-block; + position: absolute; + width: 10px; + height: 10px; + background: #fff; + border-radius: 100%; + top: -3.5px; + left: 0; + } + .current-time { + position: absolute; + left: 50%; + transform: translateX(-50%); + margin-top: 12px; + z-index: 99; + background: #06070b; + border-radius: 12px; + height: 24px; + line-height: 24px; + font-size: 14px; + color: #ffffff; + letter-spacing: 0; + text-align: center; + width: 176.5px; + } + .canvas-container { + position: absolute; + top: -48px; + opacity: 0.8; + background: #292b36; + width: 100%; + z-index: 100; + height: 48px; + } + + .ico { + min-width: 22px; + min-height: 22px; + margin-right: 4px; + display: inline-block; + cursor: pointer; + vertical-align: middle; + background-repeat: no-repeat; + background-position: center; + } + .ico2 { + min-width: 3px; + min-height: 3px; + margin-right: 3px; + display: inline-block; + vertical-align: middle; + background-repeat: no-repeat; + } + .ico-guanbi { + background-image: url("./RoomDetail/assessts/gb.png"); + } + .ico-huifang { + background-image: url("./RoomDetail/assessts/hf.png"); + } + .ico-jia { + background-image: url("./RoomDetail/assessts/j.png"); + } + .ico-jian { + background-image: url("./RoomDetail/assessts/ja.png"); + } + .ico-jietu { + background-image: url("./RoomDetail/assessts/jie.png"); + } + .ico-jietu-d { + background-image: url("./RoomDetail/assessts/jie_d.png"); + } + .ico-luxiang { + background-image: url("./RoomDetail/assessts/lx.png"); + } + .ico-luxiang-d { + background-image: url("./RoomDetail/assessts/lx_d.png"); + } + .ico-luxiang_a { + background-image: url("./RoomDetail/assessts/luxiang_a.png"); + background-repeat: no-repeat; + } + .ico-quanping { + background-image: url("./RoomDetail/assessts/qp.png"); + } + .ico-yulan { + background-image: url("./RoomDetail/assessts/yl.png"); + } + .ico-zhankai { + background-image: url("./RoomDetail/assessts/zk.png"); + } + .ico-dian { + background-image: url("./RoomDetail/assessts/dian.png"); + } + .ico-yy { + background-image: url("./RoomDetail/assessts/yy.png"); + } + .ico-yy_s { + background-image: url("./RoomDetail/assessts/yy_s.png"); + } + .ico-yy_a { + background-image: url("./RoomDetail/assessts/yy_a.png"); + } +.iconPlay { + width: 120px; + height: 120px; + cursor: pointer; + position: absolute; + left: 50%; + top: 50%; + transform: translate(-50%, -50%); +} +.speed { + background: rgba(255, 255, 255, 0.1); + display: inline-block; + font-size: 14px; + padding: 2px 8px; + border-radius: 10px; + color: #fff; + margin-right: 8px; + border: #ccc 1px solid; +} +.recordTime { + text-align: center; + position: absolute; + left: 50%; + transform: translate(-50%); + top: 63px; + z-index: 9999; + color: #fff; + opacity: 0.9; + background: #292b36; + border-radius: 4px; + border-radius: 100px; + width: 81px; + height: 25px; + line-height: 25px; + font-size: 12px; +} +.msgt { + font-size: 12px; + color: #606266; +} \ No newline at end of file diff --git a/src/pages/document.ejs b/src/pages/document.ejs index 1293096..77ef4b2 100644 --- a/src/pages/document.ejs +++ b/src/pages/document.ejs @@ -27,7 +27,7 @@ + charset="utf-8">