Browse Source

视频相关

Lita-Tako 4 months ago
parent
commit
2e921770c2

+ 1 - 1
src/api/previewPlayback/index.js

@@ -11,5 +11,5 @@ export const controlling = (data) => {
11 11
 }
12 12
 
13 13
 export const getPlayback = (data) => {
14
-	return request('/getPlayback', data, 'get')
14
+	return request('/getPlayback', data, 'post')
15 15
 }

+ 4 - 1
src/components/video/Live.vue

@@ -193,8 +193,10 @@
193 193
 	}
194 194
 
195 195
 	const doControl = (command, action = 0, speed = 50, presetIndex = 10) => {
196
+		console.log('do control 2', command)
196 197
 		if (videoMap[currentWindowIndex]) {
197 198
 			const data = videoMap[currentWindowIndex]
199
+			const cameraId = data.cameraId
198 200
 			const c = findCameraByCameraId(cameraId)
199 201
 			if (c.cameraType !== '1') {
200 202
 				return message.warning('该操作必须是球形摄像机')
@@ -213,6 +215,7 @@
213 215
 	}
214 216
 
215 217
 	const doControl1 = (command) => {
218
+		console.log('do control 1', command)
216 219
 		doControl(command, 0)
217 220
 		setTimeout(() => {
218 221
 			doControl(command, 1)
@@ -282,7 +285,7 @@
282 285
 		getPreview({ cameraIndexCode, protocol: 'WS' }).then((resp) => {
283 286
 			if (!resp || !resp.url) return message.error('无法获取视频地址')
284 287
 			const url = resp.url
285
-			const exists = Object.values(videoMap).findIndex((u) => u.url === url)
288
+			const exists = Object.values(videoMap).findIndex((u) => u.cameraIndexCode === cameraIndexCode)
286 289
 			if (exists >= 0) {
287 290
 				return message.warning(`该视频已经在 ${exists + 1} 窗口播放`)
288 291
 			}

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

@@ -207,7 +207,7 @@
207 207
 			endTime,
208 208
 			cameraIndexCode,
209 209
 			recordLocation: 1,
210
-			protocol: 'WSS'
210
+			protocol: 'wss'
211 211
 		})
212 212
 	}
213 213