husq
2023-09-18 1ef360a14efab8a1defa1dfdc13bb5af64a9d621
飞行指令打开
2 files modified
32 ■■■■ changed files
src/api/http/config.ts 2 ●●● patch | view | raw | blame | history
src/components/GMap.vue 30 ●●●● patch | view | raw | blame | history
src/api/http/config.ts
@@ -16,7 +16,7 @@
  // livestreaming
  // RTMP  Note: This IP is the address of the streaming server. If you want to see livestream on web page, you need to convert the RTMP stream to WebRTC stream.
  rtmpURL: 'rtmp://171.34.76.175:735/uav/', // Example: 'rtmp://192.168.1.1/live/'
  rtmpURL: 'rtmp://www.ainfo.top:735/uav/', // Example: 'rtmp://192.168.1.1/live/'
  // GB28181 Note:If you don't know what these parameters mean, you can go to Pilot2 and select the GB28181 page in the cloud platform. Where the parameters same as these parameters.
  // gbServerIp: '171.34.76.175',
  // gbServerPort: '15060',
src/components/GMap.vue
@@ -372,7 +372,7 @@
      </div>
      <a-row class="p5" v-if="showMonitor">
        <!-- <a-spin :spinning="spinning"> -->
          <Jessibuca v-if="airPortUrl" :videoUrl="airPortUrl" width="100%" height="200px" />
          <Jessibuca v-if="airPortUrl" :videoUrl="airPortUrl" width="100%" height="300px" />
        <!-- </a-spin> -->
      </a-row>
      <!--  飞机-->
@@ -613,9 +613,9 @@
            '' }}{{ deviceInfo.device.battery.remain_flight_time % 60 }}
        </div>
      </div>
      <!-- 飞行指令
      <!-- 飞行指令 -->
      <DroneControlPanel :sn="osdVisible.gateway_sn" :deviceInfo="deviceInfo" :payloads="osdVisible.payloads">
      </DroneControlPanel> -->
      </DroneControlPanel>
    </div>
  </div>
</template>
@@ -642,7 +642,7 @@
import { deviceTsaUpdate } from '/@/hooks/use-g-map-tsa'
import Jessibuca from '/@/components/Jessibuca/Jessibuca.vue'
import { CURRENT_CONFIG as config } from '/@/api/http/config'
import { getLiveCapacity, startLivestream } from '/@/api/manage'
import { getLiveCapacity, startLivestream, stopLivestream } from '/@/api/manage'
import {
  DeviceOsd, DeviceStatus, DockOsd, EGear, EModeCode, GatewayOsd, EDockModeCode, EDockModeText, EModeText,
  NetworkStateQualityEnum, NetworkStateTypeEnum, RainfallEnum, DroneInDockEnum
@@ -781,7 +781,11 @@
    // 打开监控权限
    const openMonitor = () => {
      showMonitor.value = !showMonitor.value
      loadVideo()
      if (showMonitor.value) {
        loadVideo()
      } else {
        onClose()
      }
    }
    // 加载该设备的视频信息
    const loadVideo = async () => {
@@ -827,11 +831,10 @@
          console.error(error)
        })
    }
    // 开始播放
    // 设备开始播放
    const onStart = async () => {
      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
      console.log(videoId, 'videoId')
      const liveURL = config.rtmpURL + streamId
      await startLivestream({
        url: liveURL,
@@ -846,6 +849,19 @@
          console.log(airPortUrl.value, 'airPortUrl')
        })
    }
    // 关闭设备直播
    const onClose = async () => {
      const videoId = droneList.value[droneIndex.value].value + '/' + cameraList.value[cameraIndex.value].value + '/' + videoList.value[videoIndex.value].value
      stopLivestream({
        video_id: videoId
      }).then(res => {
        if (res.code === 0) {
          console.log('stop play livestream')
          airPortUrl.value = ''
        }
      })
    }
    watch(() => store.state.deviceStatusEvent,
      data => {
        if (Object.keys(data.deviceOnline).length !== 0) {