Pārlūkot izejas kodu

修改云端录像详情页使用直接访问zlm的方式播放录像

648540858 1 gadu atpakaļ
vecāks
revīzija
b6e604f244
1 mainītis faili ar 23 papildinājumiem un 2 dzēšanām
  1. 23 2
      web_src/src/components/CloudRecordDetail.vue

+ 23 - 2
web_src/src/components/CloudRecordDetail.vue

@@ -314,13 +314,34 @@
         });
       },
       chooseFile(file){
+        console.log(file)
 			  if (file == null) {
           this.videoUrl = "";
           this.choosedFile = "";
         }else {
           this.choosedFile = file.fileName;
-          this.videoUrl = `${this.getFileBasePath(file)}/download/${this.app}/${this.stream}/${this.chooseDate}/${file.fileName}`
-          console.log(this.videoUrl)
+          this.$axios({
+            method: 'get',
+            url: `/api/cloud/record/play/path`,
+            params: {
+              recordId: file.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;
+              }
+            }
+          }).catch((error) => {
+            console.log(error);
+          });
+          //
+          //
+          // this.videoUrl = `${this.getFileBasePath(file)}/download/${this.app}/${this.stream}/${this.chooseDate}/${file.fileName}`
+          // console.log(this.videoUrl)
         }
 
       },