From d5224e63a997240efa272d3522baf5d73ac843cb Mon Sep 17 00:00:00 2001 From: z_yu <1534695664@qq.com> Date: Fri, 12 Aug 2022 15:03:22 +0800 Subject: [PATCH] =?UTF-8?q?=E6=91=84=E5=83=8F=E5=A4=B4=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/storeManage/warehouse3D/index.vue | 4 +++- src/views/storeManage/warehouse3D/module/video.vue | 10 ++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/views/storeManage/warehouse3D/index.vue b/src/views/storeManage/warehouse3D/index.vue index 68ad711..d914898 100644 --- a/src/views/storeManage/warehouse3D/index.vue +++ b/src/views/storeManage/warehouse3D/index.vue @@ -72,7 +72,9 @@ export default { this.activeIndex = this.$route.params.roomId } displayConfigApi.list({ storeroomId: '' }).then((data) => { - this.camConfigData = data + if (data) { + this.camConfigData = data + } }) }, methods: { diff --git a/src/views/storeManage/warehouse3D/module/video.vue b/src/views/storeManage/warehouse3D/module/video.vue index 120e080..0c96fa6 100644 --- a/src/views/storeManage/warehouse3D/module/video.vue +++ b/src/views/storeManage/warehouse3D/module/video.vue @@ -17,7 +17,7 @@ export default { openVideoVisible: false, videoTitle: '', camConfig: null, - myVideo: null + player: null } }, methods: { @@ -25,19 +25,21 @@ export default { this.openVideoVisible = false // this.myVideo = document.getElementById('canvas') // this.myVideo.pause() + // $.post('http://127.0.0.1:3000/cameras/close/', { rtspUrl: $('#rtsp').val() }, function(result) { + this.player.destroy() + // }) done() }, play() { // const rtspUrl = 'rtsp://' + this.camConfig.deviceInfo.deviceAccount + ':' + this.camConfig.deviceInfo.devicePassword + '@' + this.camConfig.deviceInfo.deviceIp + ':' + this.camConfig.deviceInfo.devicePort + '/' + this.camConfig.deviceInfo.videoRoute + '/1' // const data = { rtspUrl: rtspUrl, size: '1024*768' } - const url = 'ws://127.0.0.1:3539' + const url = 'ws://127.0.0.1:3151' var canvas = document.getElementById('canvas') const opt = { canvas: canvas, poster: '0.jpg' } - const player = new JSMpeg.Player(url, opt) - console.log(player) + this.player = new JSMpeg.Player(url, opt) } } }