1 line
13 KiB
Plaintext
1 line
13 KiB
Plaintext
|
|
"use strict";function _toConsumableArray(o){return _arrayWithoutHoles(o)||_iterableToArray(o)||_unsupportedIterableToArray(o)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(o,e){if(o){if("string"==typeof o)return _arrayLikeToArray(o,e);var r=Object.prototype.toString.call(o).slice(8,-1);return"Map"===(r="Object"===r&&o.constructor?o.constructor.name:r)||"Set"===r?Array.from(o):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(o,e):void 0}}function _iterableToArray(o){if("undefined"!=typeof Symbol&&null!=o[Symbol.iterator]||null!=o["@@iterator"])return Array.from(o)}function _arrayWithoutHoles(o){if(Array.isArray(o))return _arrayLikeToArray(o)}function _arrayLikeToArray(o,e){(null==e||e>o.length)&&(e=o.length);for(var r=0,a=new Array(e);r<e;r++)a[r]=o[r];return a}self.importScripts("common.js");var receiveVideoUrl="",firstRequestWs=1;function Downloader(){this.logger=new Logger("Downloader"),this.isChonglian=1,this.fetchFirst=!0,this.comein=!0,this.downloadNum={};for(var o=1;o<17;o++)this.downloadNum["malv"+o]=0,this.downloadNum["ismalvtimeInter"+o]=!0,this.downloadNum["controller"+o]="",this.downloadNum["recordVideoData"+o]=new Uint8Array(0),this.downloadNum["chushihua"+o]=!0}Uint8Array.prototype.concat=function(o,e){o=Array.from(o),e=Array.from(e),o=o.concat(e);return new Uint8Array(o)},Downloader.prototype.getFileInfo=function(o,e){this.logger.logInfo("Getting file size "+o+".");o={t:kGetFileInfoRsp,i:{sz:20<<20,st:200},num:e};self.postMessage(o)},Downloader.prototype.sendDataws=function(o,t,e,n,d,l,s,i,r,u){""!=o&&(this.reader=o);var m=this;this.reader.read().then(function(o){var e,r,a=o.done,o=o.value;a?(console.log("liu结束"),r={t:kliuover,num:d,rongqiId:i,devCode:u},self.postMessage(r)):o.byteLength&&(m.downloadNum["malv"+d]+=o.byteLength,m.downloadNum["ismalvtimeInter"+d]&&(m.downloadNum["ismalvtimeInter"+d]=!1,m.downloadNum["malv"+d]=0,e=setTimeout(function(){m.downloadNum["ismalvtimeInter"+d]=!0;var o={t:6,num:d,rongqiId:i,malv:m.downloadNum["malv"+d]};self.postMessage(o),clearTimeout(e)},2e3)),r={t:kFileData,s:t,e:t+o.byteLength,d:o.buffer,q:n,num:d,status:l,showName:s,downloadData:m.downloadNum["recordVideoData"+d],chushihua:m.downloadNum["chushihua"+d],rongqiId:i,malv:m.downloadNum["malv"+d],ismalv:m.downloadNum["ismalvtimeInter"+d],devCode:u},"1"===l&&(a=new Uint8Array(r.d),m.downloadNum["recordVideoData"+d]=m.downloadNum["recordVideoData"+d].concat(m.downloadNum["recordVideoData"+d],a)),self.postMessage(r,[r.d]),"2"===l&&0!==m.downloadNum["recordVideoData"+d].byteLength&&(m.downloadNum["recordVideoData"+d]=new Uint8Array(0)),m.downloadNum["chushihua"+d]=!1)})};var totalLength=0;function iserror(o,e,r,a,t){console.log("进入错误提示");var n,d,l={401:"登录失败,请重新登录",500:"服务内部错误(设备类)",503:"超过服务处理能力(设备类)",531:"消息格式错误(设备类)",532:"还有其他客户端在看此路视频(设备类)",533:"设备(含摄像机/dvr/nvr)未加载到程序中或设备不存在或设备未登陆(设备类)",534:"设备不支持此接口(设备类)",535:"设备登陆失败,请检查IP,端口号和登录名密码(设备类)",536:"设备连接失败,请检查网络情况和设备配置情况(设备类)",537:"RTP失败(设备类)",538:"SPS失败(设备类)",539:"RTCP超时(设备类)",540:"SDK执行失败,请检查PTS配置(设备类)",541:"不支持此方法(设备类)",542:"未定义的设备错误(设备类)",551:"SIP服务器内部错误(设备类)",552:"SIP协商有问题(设备类)",553:"SIP不支持的请求类型(设备类)",554:"SIP未找到请求项(设备类)",555:"SIP消息格式错误(设备类)",556:"SIP忙(设备类)",557:"SIP未知错误(设备类)",571:"RTSP错误的请求(设备类)",572:"RTSP不支持的请求类型<E7B1BB>
|