{"remainingRequest":"D:\\jenkins\\workspace\\bzzgj-fvue\\node_modules\\thread-loader\\dist\\cjs.js!D:\\jenkins\\workspace\\bzzgj-fvue\\node_modules\\babel-loader\\lib\\index.js!D:\\jenkins\\workspace\\bzzgj-fvue\\node_modules\\cache-loader\\dist\\cjs.js??ref--0-0!D:\\jenkins\\workspace\\bzzgj-fvue\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\bzzgj-fvue\\src\\views\\Device\\deviceMonitor\\components\\videoPlayPlugin.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\bzzgj-fvue\\src\\views\\Device\\deviceMonitor\\components\\videoPlayPlugin.vue","mtime":1667545182489},{"path":"D:\\jenkins\\workspace\\bzzgj-fvue\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\bzzgj-fvue\\node_modules\\thread-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\bzzgj-fvue\\node_modules\\babel-loader\\lib\\index.js","mtime":315532800000},{"path":"D:\\jenkins\\workspace\\bzzgj-fvue\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\bzzgj-fvue\\node_modules\\vue-loader\\lib\\index.js","mtime":499162500000}],"contextDependencies":[],"result":["import \"core-js/modules/es6.regexp.constructor\";\nimport \"core-js/modules/es6.regexp.replace\";\nimport \"core-js/modules/es6.regexp.to-string\";\nimport \"core-js/modules/es6.regexp.split\";\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\nimport utils from '@/hotent-ui-util';\nimport videoPluginBrowserSetting from \"./model/VideoPluginBrowserSetting.vue\";\nexport default {\n components: {\n videoPluginBrowserSetting: videoPluginBrowserSetting\n },\n props: {\n options: {\n type: Object,\n default: function _default() {\n return {\n layout: '2x2',\n showToolbar: 1,\n simpleTips: false,\n mountedInit: true\n };\n }\n }\n },\n data: function data() {\n return {\n text: '',\n downloadUrl: './../static/plugin/VideoWebPlugin.exe',\n showSetting: false,\n simpleTips: this.options.simpleTips,\n width: 0,\n height: 0,\n // 插件对象实例,初始化为null,需要创建多个插件窗口时,需要定义多个插件对象实例变量,各个变量唯一标志对应的插件实例\n oWebControl: null,\n bIE: !!window.ActiveXObject || 'ActiveXObject' in window,\n // 是否为IE浏览器\n pubKey: '',\n // demo中未使用加密,可根据需求参照开发指南自行使用加密功能\n initCount: 0,\n playMode: 0,\n // 播放类型,0-预览,1-回放\n showDivInstruction: false,\n // 标志是否显示使用说明弹框\n endTime: '',\n startTime: '',\n playTime: '',\n param: {\n argument: {\n appkey: window.context.videoAppkey,\n ip: window.context.videoIp,\n port: window.context.videoPort,\n secret: window.context.videoSecret,\n enableHTTPS: 1,\n language: 'zh_CN',\n layout: this.options.layout,\n playMode: 0,\n reconnectDuration: 5,\n reconnectTimes: 5,\n showSmart: 0,\n showToolbar: this.options.showToolbar,\n toolBarButtonIDs: '2048,2049,2050,2304,2306,2305,2307,2308,2309,4096,4608,4097,4099,4098,4609,4100',\n snapDir: 'D:/snap',\n videoDir: 'D:/video'\n },\n funcName: 'init'\n },\n paramPlay: {\n argument: {\n authUuid: '',\n cameraIndexCode: '',\n ezvizDirect: 0,\n gpuMode: 0,\n streamMode: 0,\n transMode: 1,\n wndId: -1,\n cascade: 1\n },\n funcName: 'startPreview'\n }\n };\n },\n created: function created() {},\n mounted: function mounted() {\n var _this = this;\n\n this.$nextTick(function () {\n _this.getWindowSize();\n });\n\n if (this.options.mountedInit) {\n this.open();\n }\n\n this.$root.$on('resize', function () {\n _this.$nextTick(function () {\n _this.getWindowSize();\n\n if (_this.oWebControl) {\n _this.oWebControl.JS_Resize(_this.width, _this.height);\n }\n });\n });\n },\n beforeDestroy: function beforeDestroy() {\n this.disconnect();\n },\n methods: {\n resize: function resize(width, height) {\n if (!this.oWebControl) return;\n var iwidth = width ? width : this.width;\n var iheight = height ? height : this.height;\n this.oWebControl.JS_Resize(iwidth, iheight);\n },\n cutWindow: function cutWindow() {\n var left = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n var top = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n var width = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;\n var height = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;\n if (!this.oWebControl) return;\n this.oWebControl.JS_CuttingPartWindow(left, top, width, height);\n },\n repairWindow: function repairWindow() {\n if (!this.oWebControl) return;\n this.oWebControl.JS_RepairPartWindow(0, 0, this.width, this.height);\n },\n open: function open() {\n this.initTime();\n this.initPlugin();\n return;\n this.getWindowSize();\n },\n destroy: function destroy() {\n if (!this.oWebControl) return;\n this.oWebControl.JS_DestroyWnd();\n },\n HideWnd: function HideWnd() {\n if (!this.oWebControl) return;\n this.oWebControl.JS_HideWnd();\n },\n ShowWnd: function ShowWnd() {\n if (!this.oWebControl) return;\n this.oWebControl.JS_ShowWnd();\n },\n disconnect: function disconnect() {\n var _this2 = this;\n\n if (!this.oWebControl) return;\n this.oWebControl.JS_HideWnd();\n this.oWebControl.JS_Disconnect().then(function () {\n console.log('销毁成功');\n _this2.oWebControl = null;\n });\n },\n play: function play(code) {\n if (!code) return;\n this.paramPlay.argument.cameraIndexCode = code;\n var params = utils.deepClone(this.paramPlay);\n this.requestInterface(params);\n },\n requestInterface: function requestInterface(param) {\n var _this3 = this;\n\n var JsonParam = param;\n var JsonArgument = JsonParam.argument;\n JsonParam.argument = JSON.stringify(JsonArgument);\n this.oWebControl.JS_RequestInterface(JsonParam).then(function (oData) {\n console.log(oData);\n\n _this3.showCBInfo(JSON.stringify(oData ? oData.responseMsg : ''));\n });\n },\n autoInit: function autoInit() {\n var _this4 = this;\n\n var params = utils.deepClone(this.param);\n var JsonParam = params;\n\n if (JsonParam.argument.hasOwnProperty('playMode')) {\n this.playMode = JsonParam.argument.playMode;\n } //隐藏/显示轮巡功能模块\n // document.getElementById('TourPreview').style.display =\n // 0 == playMode && JsonParam.argument.hasOwnProperty('appkey')\n // ? ''\n // : 'none'\n //如果包含加密处理,处理加密字段\n\n\n if (JsonParam.argument.hasOwnProperty('encryptedFields')) {\n var enFields = JsonParam.argument.encryptedFields;\n var strArray = new Array();\n strArray = enFields.split(',');\n\n for (var i = 0, len = strArray.length; i < len; i++) {\n if ('appkey' == strArray[i]) {\n if (JsonParam.argument.hasOwnProperty('appkey')) {\n var appkey = JsonParam.argument.appkey;\n appkey = setEncrypt(appkey);\n JsonParam.argument.appkey = appkey;\n }\n }\n\n if ('secret' == strArray[i]) {\n if (JsonParam.argument.hasOwnProperty('secret')) {\n var secret = JsonParam.argument.secret;\n secret = setEncrypt(secret);\n JsonParam.argument.secret = secret;\n }\n }\n\n if ('ip' == strArray[i]) {\n if (JsonParam.argument.hasOwnProperty('ip')) {\n var ip = JsonParam.argument.ip;\n ip = setEncrypt(ip);\n JsonParam.argument.ip = ip;\n }\n }\n\n if ('snapDir' == strArray[i]) {\n if (JsonParam.argument.hasOwnProperty('snapDir')) {\n var snapDir = JsonParam.argument.snapDir;\n snapDir = setEncrypt(snapDir);\n JsonParam.argument.snapDir = snapDir;\n }\n }\n\n if ('layout' == strArray[i]) {\n if (JsonParam.argument.hasOwnProperty('layout')) {\n var layout = JsonParam.argument.layout;\n layout = setEncrypt(layout);\n JsonParam.argument.layout = layout;\n }\n }\n\n if ('videoDir' == strArray[i]) {\n if (JsonParam.argument.hasOwnProperty('videoDir')) {\n var videoDir = JsonParam.argument.videoDir;\n videoDir = setEncrypt(videoDir);\n JsonParam.argument.videoDir = videoDir;\n }\n }\n }\n } //1.4.1及以上版本支持argument字段为json,以下版本argument必须为string\n\n\n var JsonArgument = JsonParam.argument;\n JsonParam.argument = JSON.stringify(JsonArgument); //param = {\n // \"argument\": '{\"appkey\": \"21216099\",\"ip\": \"172.7.13.242\",\"port\": 443,\"secret\": \"dX5Gt0C0hmKbQ9ucHnWY\",\"enableHTTPS\": 1,\"language\": \"zh_CN\",\"layout\": \"2x2\",\"playMode\": 0,\"reconnectDuration\": 5,\"reconnectTimes\": 5,\"showSmart\": 0,\"showToolbar\": 1,\"snapDir\": \"D:/snap\",\"videoDir\": \"D:/video\"}',\n // \"funcName\": \"init\"\n //}\n\n this.oWebControl.JS_RequestInterface(JsonParam).then(function (oData) {\n console.log(oData);\n\n _this4.$emit('ready');\n\n _this4.showCBInfo(JSON.stringify(oData ? oData.responseMsg : '')); // UpdatePlayParamValue()\n\n\n _this4.oWebControl.JS_Resize(_this4.width, _this4.height);\n });\n },\n // 初始化插件\n initPlugin: function initPlugin() {\n var _this5 = this;\n\n if (this.oWebControl !== null) return;\n console.log(\"初始化插件\"); // 创建插件实例,并启动本地服务建立websocket连接,创建插件窗口\n\n this.oWebControl = new WebControl({\n szPluginContainer: 'playWnd',\n iServicePortStart: 15900,\n iServicePortEnd: 15909,\n szClassId: '23BF3B0A-2C56-4D97-9C03-0CB103AA8F11',\n // 用于IE10使用ActiveX的clsid\n cbConnectSuccess: function cbConnectSuccess() {\n _this5.initCount = 0;\n\n _this5.setCallbacks();\n\n _this5.oWebControl.JS_StartService('window', {\n dllPath: './VideoPluginConnect.dll'\n }).then(function () {\n _this5.oWebControl.JS_CreateWnd('playWnd', _this5.width, _this5.height).then(function () {\n console.log('JS_CreateWnd success');\n\n _this5.autoInit();\n\n _this5.oWebControl.JS_RequestInterface({\n funcName: 'getRSAPubKey',\n argument: JSON.stringify({\n keyLength: 1024\n })\n }).then(function (oData) {\n console.log(oData);\n\n if (oData.responseMsg.data) {\n _this5.pubKey = oData.responseMsg.data;\n }\n });\n });\n }, function () {});\n },\n cbConnectError: function cbConnectError() {\n console.log('cbConnectError');\n _this5.oWebControl = null;\n _this5.text = '插件未启动,正在尝试启动,请稍候...'; // $('#playWnd').html('插件未启动,正在尝试启动,请稍候...')\n\n WebControl.JS_WakeUp('VideoWebPlugin://');\n _this5.initCount++;\n\n if (_this5.initCount < 3) {\n setTimeout(function () {\n _this5.initPlugin();\n }, 3000);\n } else {\n _this5.showSetting = true;\n _this5.text = '';\n }\n },\n cbConnectClose: function cbConnectClose(bNormalClose) {\n // 异常断开:bNormalClose = false\n // JS_Disconnect正常断开:bNormalClose = true\n console.log('cbConnectClose');\n _this5.oWebControl = null;\n }\n });\n },\n // 获取窗口宽高\n getWindowSize: function getWindowSize() {\n this.width = this.$refs.playerContainer.clientWidth;\n this.height = this.$refs.playerContainer.clientHeight;\n },\n // 初始化时间变量\n initTime: function initTime() {\n this.endTime = Math.floor(new Date(this.dateFormat(new Date(), 'yyyy-MM-dd 23:59:59').replace('-', '/').replace('-', '/')).getTime() / 1000).toString();\n this.startTime = Math.floor(new Date(this.dateFormat(new Date(), 'yyyy-MM-dd 00:00:00').replace('-', '/').replace('-', '/')).getTime() / 1000).toString();\n this.playTime = Math.floor(new Date(this.dateFormat(new Date(), 'yyyy-MM-dd 00:00:00').replace('-', '/').replace('-', '/')).getTime() / 1000).toString();\n },\n // 设置窗口控制回调\n setCallbacks: function setCallbacks() {\n this.oWebControl.JS_SetWindowControlCallback({\n cbIntegrationCallBack: this.cbIntegrationCallBack\n });\n },\n // 推送消息\n cbIntegrationCallBack: function cbIntegrationCallBack(oData) {\n this.showCBInfo(JSON.stringify(oData.responseMsg));\n },\n // 显示接口返回的消息及插件回调信息\n showCBInfo: function showCBInfo(szInfo, type) {\n console.log('接口返回的消息及插件回调信息:' + type + szInfo);\n },\n // 格式化时间\n dateFormat: function dateFormat(oDate, fmt) {\n var o = {\n 'M+': oDate.getMonth() + 1,\n //月份\n 'd+': oDate.getDate(),\n //日\n 'h+': oDate.getHours(),\n //小时\n 'm+': oDate.getMinutes(),\n //分\n 's+': oDate.getSeconds(),\n //秒\n 'q+': Math.floor((oDate.getMonth() + 3) / 3),\n //季度\n S: oDate.getMilliseconds() //毫秒\n\n };\n\n if (/(y+)/.test(fmt)) {\n fmt = fmt.replace(RegExp.$1, (oDate.getFullYear() + '').substr(4 - RegExp.$1.length));\n }\n\n for (var k in o) {\n if (new RegExp('(' + k + ')').test(fmt)) {\n fmt = fmt.replace(RegExp.$1, RegExp.$1.length == 1 ? o[k] : ('00' + o[k]).substr(('' + o[k]).length));\n }\n }\n\n return fmt;\n },\n textbox: function textbox(obj, min, max) {\n obj.value = obj.value.replace(/[^\\d]/g, '');\n\n if (parseInt(obj.value) == obj.value && parseInt(obj.value) >= min && parseInt(obj.value) <= max) {} else {\n if (parseInt(obj.value) < min) {\n obj.value = min;\n }\n\n if (parseInt(obj.value) > max) {\n obj.value = max;\n }\n }\n },\n openModel: function openModel() {\n this.$refs.BrowserSetting.open();\n }\n }\n};",null]}