diff --git a/src/plugin/video/index.ts b/src/plugin/video/index.ts index c5db646..073fe85 100644 --- a/src/plugin/video/index.ts +++ b/src/plugin/video/index.ts @@ -138,7 +138,7 @@ class LiveStreamPlugin { * zpkzxx:照片扩展信息 */ console.log('LiveStreamPlugin takePicture', callback); - servicesTopic(sn, { + const querys = { bid: bid, method: 'camera_photo_take', tid: buildGUID(), @@ -146,7 +146,9 @@ class LiveStreamPlugin { data: { payload_index: uav.camera_index, }, - }); + }; + console.log(querys); + servicesTopic(sn, querys); const data = {}; callback(data); } @@ -212,25 +214,20 @@ class LiveStreamPlugin { client.subscribe('thing/product/' + serialNum + '/events', { qos: 2 }, () => {}); // 接收消息 let id = ''; - client.on('message', async (topic, message) => { - const rs = JSON.parse(message); - if ( - rs.method == 'flighttask_progress' && - rs.data.output.status == 'in_progress' && - id == '' - ) { - console.log(rs); - id = rs.data.output.ext.flight_id; - return new Promise((resolve, reject) => { + return new Promise((resolve, reject) => { + client.on('message', async (topic, message) => { + const rs = JSON.parse(message); + if ( + rs.method == 'flighttask_progress' && + rs.data.output.status == 'in_progress' && + id == '' + ) { + id = rs.data.output.ext.flight_id; getDroneDockflightInfos(id).then((res) => { - console.log(res); resolve(res); }); - }); - return await getDroneDockflightInfos(id).then((res) => { - return res; - }); - } + } + }); }); } } diff --git a/src/views/demo/workmanagement/ceshi/index.vue b/src/views/demo/workmanagement/ceshi/index.vue index 031bf64..813c961 100644 --- a/src/views/demo/workmanagement/ceshi/index.vue +++ b/src/views/demo/workmanagement/ceshi/index.vue @@ -7,6 +7,7 @@ 释放资源 获取航线任务 展示视频直播 + 拍照
@@ -38,6 +39,11 @@ console.log(document.getElementById('live-div')); liveStreamPlugin.setLiveStreamControl(document.getElementById('live-div'), '1'); }; + const takePhoto = () => { + liveStreamPlugin.takePicture((res) => { + console.log(res); + }); + }; onMounted(async () => { const token = 'API32_HENJOZMPBYKEXNVLFMY3Y5W5SQ.1751622229582.fmCjIucQYyq4YZe4CnSStN/rHcwjZTxUsDuXeXJfrYn0bwoaV1/IW8mcFwtLw8JHjowvMJrmPyy/QZAhssxQCQ=='; diff --git a/src/views/demo/workmanagement/flightoperation/src/AirportLive.vue b/src/views/demo/workmanagement/flightoperation/src/AirportLive.vue index 1f515c1..c4c1dcf 100644 --- a/src/views/demo/workmanagement/flightoperation/src/AirportLive.vue +++ b/src/views/demo/workmanagement/flightoperation/src/AirportLive.vue @@ -41,7 +41,12 @@ import { startLive, endLive } from '@/api/workmanagement/airportMaintenance'; import TCPlayer from 'tcplayer.js'; import 'tcplayer.js/dist/tcplayer.min.css'; //引入插件和样式文件 - import { servicesTopic, services_replyTopic, errorName } from '@/utils/debugging/remote'; + import { + servicesTopic, + services_replyTopic, + errorName, + setTopic, + } from '@/utils/debugging/remote'; import { useMessage } from '@/hooks/web/useMessage'; import { buildGUID } from '@/utils/uuid'; import { airPortStore } from '@/store/modules/airport'; @@ -110,6 +115,20 @@ player.play(); }; onMounted(() => { + // const querys = { + // bid: buildGUID(), + // tid: buildGUID(), + // timestamp: new Date().getTime(), + // data: { + // air_transfer_enable: 1, + // cameras: { + // zoom_factor: 2, + // ir_zoom_factor: 2, + // }, + // }, + // }; + // console.log(querys); + // setTopic(querys); setTimeout(() => { startLiveFun(); player = TCPlayer('player-container-id', { @@ -154,7 +173,7 @@ }; // 销毁视频控件 onBeforeUnmount(() => { - if(player){ + if (player) { player.dispose(); player = null; } diff --git a/src/views/demo/workmanagement/flightoperation/src/LoadControl.vue b/src/views/demo/workmanagement/flightoperation/src/LoadControl.vue index 82acd0d..2c1e027 100644 --- a/src/views/demo/workmanagement/flightoperation/src/LoadControl.vue +++ b/src/views/demo/workmanagement/flightoperation/src/LoadControl.vue @@ -31,14 +31,14 @@ />
@@ -57,14 +57,14 @@