From e6f63c537608c9c8bdc77e45a03125176bea280f Mon Sep 17 00:00:00 2001
From: xieb <vip_xiaobin810@163.com>
Date: Tue, 26 Sep 2023 11:31:33 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/demo' into demo

---
 src/components/GMap.vue |   26 ++++++++++++++++++++++----
 1 files changed, 22 insertions(+), 4 deletions(-)

diff --git a/src/components/GMap.vue b/src/components/GMap.vue
index 83938f5..7d7e941 100644
--- a/src/components/GMap.vue
+++ b/src/components/GMap.vue
@@ -373,7 +373,7 @@
       </div>
       <a-row class="p5" v-if="showMonitor" justify="center" align="middle">
         <!-- <a-spin :spinning="spinning"> -->
-          <Jessibuca v-if="airPortUrl" :videoUrl="airPortUrl" width="100%" height="300px" />
+          <Jessibuca v-if="airPortUrl" @timeout="airTimeout" :videoUrl="airPortUrl" width="100%" height="300px" />
         <!-- </a-spin> -->
       </a-row>
       <!--  飞机-->
@@ -406,7 +406,7 @@
               </a-button>
             </a-col>
             <a-col span="11">
-              <a-button :disabled="deviceInfo.device?.mode_code == 14 || !deviceInfo.device?true:false" :class="[openDroneControl?'active-color':'unactive-color']" class="width-100" type="primary"  size="small"
+              <a-button :class="[openDroneControl?'active-color':'unactive-color']" class="width-100" type="primary"  size="small"
                 @click="openDeviceSetting">
                 操作
               </a-button>
@@ -417,7 +417,7 @@
       <!-- 飞机直播 -->
       <a-row class="p5" v-if="showAircraft">
         <!-- <a-spin :spinning="spinning"> -->
-          <Jessibuca v-if="aircraftUrl" :videoUrl="aircraftUrl" width="100%" height="300px" />
+          <Jessibuca v-if="aircraftUrl" @timeout="flyTimeout" :videoUrl="aircraftUrl" width="100%" height="300px" />
         <!-- </a-spin> -->
       </a-row>
       <!-- 飞机图标信息 -->
@@ -905,8 +905,24 @@
           message.error(error)
         })
     }
+    // 机场视频超时说明可能直播被关闭需要重新开启直播
+    const airTimeout = () => {
+      try {
+        onStart()
+      } catch (e) {
+        onClose()
+      }
+    }
+    const flyTimeout = () => {
+      try {
+        flyOnStart()
+      } catch (e) {
+        closeFly()
+      }
+    }
     // 设备开始播放
     const onStart = async () => {
+      airPortUrl.value = ''
       const videoId = droneList.value[droneIndex.value].value + '/' + cameraList.value[cameraIndex.value].value + '/' + videoList.value[videoIndex.value].value
       const streamId = droneList.value[droneIndex.value].value + '-' + cameraList.value[cameraIndex.value].value + '-' + videoList.value[videoIndex.value].value
       const liveURL = config.rtmpURL + streamId
@@ -1315,7 +1331,9 @@
       closeOsdWindow,
       openDroneControl,
       openFlySetting,
-      openDeviceSetting
+      openDeviceSetting,
+      airTimeout,
+      flyTimeout
     }
   }
 })

--
Gitblit v1.9.3