From 92e5ed2e30126afc320ddf458c2653c4d41ef61d Mon Sep 17 00:00:00 2001
From: 648540858 <648540858@qq.com>
Date: 星期三, 06 十二月 2023 16:10:32 +0800
Subject: [PATCH] 优化前端云端录像的播放

---
 web_src/src/components/CloudRecord.vue |   24 ++++++++++++++++++++----
 1 files changed, 20 insertions(+), 4 deletions(-)

diff --git a/web_src/src/components/CloudRecord.vue b/web_src/src/components/CloudRecord.vue
index ca963e6..4a4a74b 100755
--- a/web_src/src/components/CloudRecord.vue
+++ b/web_src/src/components/CloudRecord.vue
@@ -213,10 +213,26 @@
       console.log(row)
       this.chooseRecord = row;
       this.showPlayer = true;
-      let videoPath = row.filePath.substring(row.filePath.length - 25);
-      console.log(videoPath)
-      this.videoUrl = `${this.getFileBasePath(row)}/download/${row.app}/${row.stream}/${videoPath}`
-      console.log(this.videoUrl)
+      this.$axios({
+        method: 'get',
+        url: `/api/cloud/record/play/path`,
+        params: {
+          recordId: row.id,
+        }
+      }).then((res) => {
+        console.log(res)
+        if (res.data.code === 0) {
+          if (location.protocol === "https:") {
+            this.videoUrl = res.data.data.httpsPath;
+          }else {
+            this.videoUrl = res.data.data.httpPath;
+          }
+          console.log(222 )
+          console.log(this.videoUrl )
+        }
+      }).catch((error) => {
+        console.log(error);
+      });
     },
       getFileBasePath(item) {
           let basePath = ""

--
Gitblit v1.8.0