{"remainingRequest":"D:\\jenkins\\workspace\\sfz-lh-fvue\\node_modules\\thread-loader\\dist\\cjs.js!D:\\jenkins\\workspace\\sfz-lh-fvue\\node_modules\\babel-loader\\lib\\index.js!D:\\jenkins\\workspace\\sfz-lh-fvue\\node_modules\\cache-loader\\dist\\cjs.js??ref--0-0!D:\\jenkins\\workspace\\sfz-lh-fvue\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\sfz-lh-fvue\\src\\views\\Normal\\components\\videoPlayerDH.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\sfz-lh-fvue\\src\\views\\Normal\\components\\videoPlayerDH.vue","mtime":1710961694264},{"path":"D:\\jenkins\\workspace\\sfz-lh-fvue\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\sfz-lh-fvue\\node_modules\\thread-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\sfz-lh-fvue\\node_modules\\babel-loader\\lib\\index.js","mtime":315532800000},{"path":"D:\\jenkins\\workspace\\sfz-lh-fvue\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\sfz-lh-fvue\\node_modules\\vue-loader\\lib\\index.js","mtime":499162500000}],"contextDependencies":[],"result":["import \"core-js/modules/es6.regexp.split\";\nimport \"core-js/modules/web.dom.iterable\";\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//\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/**\r\n * @description 自定义选择器\r\n * @param {string} str dom元素\r\n */\nfunction $(str) {\n if (str.charAt(0) == '#') {\n return document.getElementById(str.substring(1));\n } else if (str.charAt(0) == '.') {\n return document.getElementsByClassName(str.substring(1));\n } else {\n return document.getElementsByTagName(str);\n }\n}\n\nexport default {\n name: 'videoPlayerDH',\n props: {\n wrapperName: {\n type: String,\n default: 'h5-play-wrap'\n },\n showWdn: {\n type: Boolean,\n default: true\n },\n showFull: {\n type: Boolean,\n default: true\n }\n },\n data: function data() {\n return {\n curDeviceIndex: 0,\n deviceObject: {\n loginState: [],\n session: []\n },\n $loginState: '',\n $stream: '',\n $volume: '',\n $canvas: '',\n //canvas播放视频DOM\n $video: '',\n //video播放视频DOM\n $canvas_ivs: '',\n //canvas绘图DOM\n $video_wrap: '',\n //视频外层Wrap\n $videoLoading: '',\n //“加载中...”提示\n player: null,\n playerInstance: [],\n //播放|回放实例数组\n channel: 0,\n //当前通道\n curEnlargeWnd: 0,\n onlineChannel: [],\n //当前成功拉流的视频通道数组\n WndIndex: 0,\n //宫格窗口Id\n ivsInstance: [],\n //canvas绘图实例数组\n curWndType: 1 //窗口分割类型\n\n };\n },\n created: function created() {},\n mounted: function mounted() {\n this.init();\n },\n beforeDestroy: function beforeDestroy() {\n this.stopAll();\n },\n methods: {\n stopAll: function stopAll() {\n this.playerInstance.forEach(function (item) {\n if (item) {\n item.close();\n item = null;\n }\n });\n },\n play: function play(videoData) {\n var _this = this;\n\n var ip = videoData.ip,\n cameraCode = videoData.cameraCode,\n dyAccount = videoData.dyAccount,\n dyPassword = videoData.dyPassword;\n\n if (this.playerInstance[this.WndIndex]) {\n this.playerInstance[this.WndIndex].close();\n this.playerInstance[this.WndIndex] = null;\n console.log('停止');\n }\n\n var channel = cameraCode ? cameraCode : 1;\n\n if (!dyAccount || !dyPassword) {\n this.$message.warning('摄像机数据获取失败!');\n }\n\n var options = {\n wsURL: \"ws://\".concat(ip, \"/rtspoverwebsocket\"),\n rtspURL: \"rtsp://\".concat(ip, \"/cam/realmonitor?channel=\").concat(channel, \"&subtype=0&proto=Private3\"),\n username: dyAccount,\n password: dyPassword\n };\n this.$videoLoading.style.display = '';\n this.$videoLoading.innerText = '加载中...';\n var player = new PlayerControl(options);\n this.playerInstance[this.WndIndex] = player;\n player.on('WorkerReady', function () {\n player.connect();\n _this.$videoLoading.style.display = '';\n _this.$videoLoading.innerText = '连接中...';\n });\n player.on('PlayStart', function () {\n _this.$videoLoading.style.display = 'none';\n _this.$videoLoading.innerText = '';\n });\n player.on('Error', function (rs) {\n console.log(rs, rs.description, 'error');\n var message = '打开失败!';\n if (rs.description) message = rs.description;\n if (rs.errorCode == 101) message = '';\n _this.$videoLoading.style.display = '';\n _this.$videoLoading.innerText = message;\n });\n player.init(this.$canvas, this.$video);\n },\n stop: function stop() {\n this.playerInstance[this.WndIndex].close();\n },\n\n /**\r\n * @description 初始化\r\n */\n init: function init() {\n var _this2 = this;\n\n var initWidth = '50%';\n\n if (!this.showWdn) {\n initWidth = '100%';\n }\n\n var videoStr = '';\n\n for (var i = 0; i < 16; i++) {\n videoStr += '