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) } } }