siyouyou 5 месяцев назад
Родитель
Сommit
141c6f5728

+ 8 - 0
src/components/videoPlayer/palyAndPlayback.vue

@@ -46,6 +46,7 @@
         :heigthIsFull="false"
         :camera-code="cameraCodeVideo"
         :video-url="cameraCodeUrl"
+        :video-id="this.id"
       />
     </el-main>
   </el-container>
@@ -77,6 +78,13 @@ export default {
         return "";
       },
     },
+    id: {
+      // 摄像机code
+      type: String,
+      default() {
+        return "";
+      },
+    },
     items: {
       type: String,
       default() {

+ 15 - 5
src/components/videoPlayer/videoPlayer.vue

@@ -37,6 +37,7 @@
 <script>
 import flvjs from "flv.js";
 import { records, lineDate } from "@/api/video";
+import { msgAlarmDetail } from "@/api/alarmList";
 
 // videoPlayer
 // 单个视频播放插件
@@ -94,6 +95,13 @@ export default {
       type: Boolean,
       default: true,
     },
+    videoId: {
+      // 摄像机code
+      type: String,
+      default() {
+        return "";
+      },
+    },
   },
   data() {
     return {
@@ -212,12 +220,14 @@ console.log(123,)
 
         if (this.$route.name === "/alarmDetail") {
           var set = setInterval(() => {
-            if (this.$store.state.lineDateProPost) {
-              records(
-                this.$store.state.lineDateProPost.cameraCode,
-                this.flay
+            // if (this.$store.state.lineDateProPost) {
+              if (this.videoId) {
+                msgAlarmDetail(
+                // this.$store.state.lineDateProPost.cameraCode,
+                // this.flay
+                this.videoId
               ).then((res) => {
-                this.videoInit(res.data);
+                this.videoInit(res.data.alarmUrl);
               });
               clearInterval(set);
             }

+ 1 - 1
src/views/alarmInformation/alarmDetail.vue

@@ -41,7 +41,7 @@
           </div>
         </div>
         <el-main style="padding: 0px; margin-top: 20px">
-          <palyAndPlayback :items="items" :videoType="videoType" :cameraCode="cameraCode"
+          <palyAndPlayback :items="items" :videoType="videoType" :cameraCode="cameraCode" :id="this.id"
             :alarmTime="cameraInfo.alarmTime" @tabChange="palyAndPlaybackTabChange"></palyAndPlayback>
         </el-main>
       </el-container>