Bläddra i källkod

小屏视频播放地址

libushang 5 dagar sedan
förälder
incheckning
bb36c76b2b

+ 11 - 1
src/views/disasterRiskMonitor/hazardousChemicalEnterprisesView.vue

@@ -8,12 +8,15 @@
         <i class="icon-line" />
         <div class="text">视频</div>
       </div>
+      <!--
       <HKVideo
         v-if="!!video1"
         :dot_data="video1"
         autoplay
         style="height: 200px"
       />
+      -->
+      <HlsPlayer v-if="!!video1" :src="video1" style="height: 200px"/>
     </div>
     <div class="box">
       <div class="card-header">
@@ -49,6 +52,7 @@
 import { ref } from "vue";
 import { ElTable, ElTableColumn } from "element-plus";
 import {getChemicalcompanyVideo, getVideoInfo} from "@/api/disasterRiskMonitor/rainfall";
+import { getProxyVideoUrlById } from '@/api/videoMonitor';
 
 const route = useRoute();
 const latitude = ref(route.query.latitude);
@@ -67,7 +71,13 @@ queryParams.location = "POINT(" + longitude.value + " " + latitude.value + ")";
 const getVideo = () => {
   getChemicalcompanyVideo(videoCode.value).then(res => {
     videoList.value = res.data;
-    video1.value = res.data[0];
+    // video1.value = res.data[0];
+
+    // 转为互联网访问的地址
+    getProxyVideoUrlById(res.data[0].video_code).then((res)=>{
+      console.log('video_url:', res.data);
+      video1.value = res.data;
+    });
   });
   // getVideoInfo(queryParams).then(res => {
   //   res.data.list.forEach(item => {

+ 11 - 1
src/views/disasterRiskMonitor/rainfallInRainShelterView.vue

@@ -8,12 +8,15 @@
         <i class="icon-line" />
         <div class="text">视频</div>
       </div>
+      <!--
       <HKVideo
         v-if="!!video1"
         :dot_data="video1"
         autoplay
         style="height: 200px"
       />
+      -->
+      <HlsPlayer v-if="!!video1" :src="video1" style="height: 200px"/>
     </div>
     <div class="box">
       <div class="card-header">
@@ -51,6 +54,7 @@ import { ElTable, ElTableColumn } from "element-plus";
 import {
   getVideoInfo
 } from "@/api/disasterRiskMonitor/rainfall";
+import { getProxyVideoUrlById } from '@/api/videoMonitor';
 
 const route = useRoute();
 const latitude = ref(route.query.latitude);
@@ -72,7 +76,13 @@ const getVideo = () => {
       item.distance = (Math.ceil(item.distance * 100) / 100).toFixed(2);
     });
     videoList.value = res.data.list;
-    video1.value = res.data.list[0];
+    // video1.value = res.data.list[0];
+
+    // 转为互联网访问的地址
+    getProxyVideoUrlById(res.data.list[0].video_code).then((res)=>{
+      console.log('video_url:', res.data);
+      video1.value = res.data;
+    });
   });
 };
 getVideo();

+ 11 - 1
src/views/disasterRiskMonitor/rainfallMonitoringView.vue

@@ -30,12 +30,15 @@
         <i class="icon-line" />
         <div class="text">视频</div>
       </div>
+      <!--
       <HKVideo
         v-if="!!video1"
         :dot_data="video1"
         autoplay
         style="height: 200px"
       />
+      -->
+      <HlsPlayer v-if="!!video1" :src="video1" style="height: 200px"/>
     </div>
     <div class="box">
       <el-table
@@ -65,6 +68,7 @@ import {
   getMidmapDzzhDetails, getMidmapDzzhDetails2,
   getVideoInfo
 } from "@/api/disasterRiskMonitor/rainfall";
+import { getProxyVideoUrlById } from '@/api/videoMonitor';
 
 const route = useRoute();
 const informId = ref(route.query.id);
@@ -102,7 +106,13 @@ const getVideo = () => {
       item.distance = (Math.ceil(item.distance * 100) / 100).toFixed(2);
     });
     videoList.value = res.data.list;
-    video1.value = res.data.list[0];
+    //video1.value = res.data.list[0];
+    
+    // 转为互联网访问的地址
+    getProxyVideoUrlById(res.data.list[0].video_code).then((res)=>{
+      console.log('video_url:', res.data);
+      video1.value = res.data;
+    });
   });
 };
 const video1 = ref();

+ 11 - 1
src/views/disasterRiskMonitor/windAndFloodPreventionView.vue

@@ -8,12 +8,15 @@
         <i class="icon-line" />
         <div class="text">视频</div>
       </div>
+      <!--
       <HKVideo
         v-if="!!video1"
         :dot_data="video1"
         autoplay
         style="height: 200px"
       />
+      -->
+      <HlsPlayer v-if="!!video1" :src="video1" style="height: 200px"/>
     </div>
     <div class="box">
       <div class="card-header">
@@ -58,6 +61,7 @@ import {
   getVideoInfo,
   getVideoInfo2
 } from "@/api/disasterRiskMonitor/rainfall";
+import { getProxyVideoUrlById } from '@/api/videoMonitor';
 
 const route = useRoute();
 const latitude = ref(route.query.latitude);
@@ -86,7 +90,13 @@ const getVideo = () => {
       item.distance = (Math.ceil(item.distance * 100) / 100).toFixed(2);
     });
     videoList.value = res.data.list;
-    video1.value = res.data.list[0];
+    // video1.value = res.data.list[0];
+
+    // 转为互联网访问的地址
+    getProxyVideoUrlById(res.data.list[0].video_code).then((res)=>{
+      console.log('video_url:', res.data);
+      video1.value = res.data;
+    });
   });
 };
 getVideo();