Browse Source

视频相关

Lita-Tako 4 months ago
parent
commit
c487faefa2
2 changed files with 4 additions and 3 deletions
  1. 2 2
      src/components/video/Live.vue
  2. 2 1
      src/components/video/Replay.vue

+ 2 - 2
src/components/video/Live.vue

@@ -273,8 +273,8 @@
273
 		console.log('选择摄像头', camera)
273
 		console.log('选择摄像头', camera)
274
 		const { cameraIndexCode } = camera
274
 		const { cameraIndexCode } = camera
275
 		getPreview({ cameraIndexCode, protocol: 'WS' }).then((resp) => {
275
 		getPreview({ cameraIndexCode, protocol: 'WS' }).then((resp) => {
276
-			if (!resp || !resp.url) return message.error('无法获取视频地址')
277
-
276
+			if (!resp || !resp.data || !resp.data.url) return message.error('无法获取视频地址')
277
+			const url = resp.data.url
278
 			const exists = Object.values(videoMap).findIndex((u) => u.url === url)
278
 			const exists = Object.values(videoMap).findIndex((u) => u.url === url)
279
 			if (exists >= 0) {
279
 			if (exists >= 0) {
280
 				return message.warning(`该视频已经在 ${exists + 1} 窗口播放`)
280
 				return message.warning(`该视频已经在 ${exists + 1} 窗口播放`)

+ 2 - 1
src/components/video/Replay.vue

@@ -181,7 +181,8 @@
181
 		}
181
 		}
182
 		const { cameraIndexCode } = camera
182
 		const { cameraIndexCode } = camera
183
 		getPlaybackVideo({ cameraIndexCode }).then((resp) => {
183
 		getPlaybackVideo({ cameraIndexCode }).then((resp) => {
184
-			const { url } = resp
184
+			if (!resp || !resp.data || !resp.data.url) return message.error('无法获取视频地址')
185
+			const url = resp.data.url
185
 			if (url) {
186
 			if (url) {
186
 				const [realUrl, params] = url.split('?')
187
 				const [realUrl, params] = url.split('?')
187
 				const [startTime, endTime] = date.value
188
 				const [startTime, endTime] = date.value