|
|
|
@ -70,7 +70,7 @@
|
|
|
|
|
} 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 } from '@/utils/debugging/remote';
|
|
|
|
|
import { useMessage } from '@/hooks/web/useMessage';
|
|
|
|
|
import { airPortStore } from '@/store/modules/airport';
|
|
|
|
|
import VueDragResize from 'vue-drag-resize/src';
|
|
|
|
@ -90,15 +90,19 @@
|
|
|
|
|
const width = ref(500);
|
|
|
|
|
const height = ref(348);
|
|
|
|
|
const left = ref(pageWidth - 800);
|
|
|
|
|
const top = ref(pageHeight - 500);
|
|
|
|
|
const top = ref(pageHeight - 440);
|
|
|
|
|
if (props.airportLiveVisible) {
|
|
|
|
|
top.value = pageHeight - 100;
|
|
|
|
|
top.value = pageHeight - 820;
|
|
|
|
|
}
|
|
|
|
|
let player;
|
|
|
|
|
const liveCode = ref('6');
|
|
|
|
|
watch(
|
|
|
|
|
() => props.msgData,
|
|
|
|
|
(val) => {},
|
|
|
|
|
() => props.airportLiveVisible,
|
|
|
|
|
(val) => {
|
|
|
|
|
if (val) {
|
|
|
|
|
top.value = pageHeight - 820;
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
const cameraType = ref('广角');
|
|
|
|
|
|
|
|
|
@ -144,11 +148,12 @@
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
});
|
|
|
|
|
const startTid = buildGUID();
|
|
|
|
|
const startLiveFun = () => {
|
|
|
|
|
const querys = {
|
|
|
|
|
bid: buildGUID(),
|
|
|
|
|
method: 'live_start_push',
|
|
|
|
|
tid: buildGUID(),
|
|
|
|
|
tid: startTid,
|
|
|
|
|
timestamp: new Date().getTime(),
|
|
|
|
|
data: {
|
|
|
|
|
url_type: 1, // 0 = 自适应;如需 RTMP 改为 1;GB28181 为 3;WebRTC 为 4
|
|
|
|
@ -160,11 +165,12 @@
|
|
|
|
|
servicesTopic(querys);
|
|
|
|
|
services_replyTopic();
|
|
|
|
|
};
|
|
|
|
|
const qualityTid = buildGUID();
|
|
|
|
|
const resolutionChange = (val: any) => {
|
|
|
|
|
const querys = {
|
|
|
|
|
bid: buildGUID(),
|
|
|
|
|
method: 'live_set_quality',
|
|
|
|
|
tid: buildGUID(),
|
|
|
|
|
tid: qualityTid,
|
|
|
|
|
timestamp: new Date().getTime(),
|
|
|
|
|
data: {
|
|
|
|
|
video_id: uav.video_id,
|
|
|
|
@ -173,6 +179,7 @@
|
|
|
|
|
};
|
|
|
|
|
servicesTopic(querys);
|
|
|
|
|
};
|
|
|
|
|
const lensTid = buildGUID();
|
|
|
|
|
const cameraChange = (val: any) => {
|
|
|
|
|
optionsArr.cameraOptions.forEach((item) => {
|
|
|
|
|
if (item.value === selectVal.camera) {
|
|
|
|
@ -183,7 +190,7 @@
|
|
|
|
|
const querys = {
|
|
|
|
|
bid: buildGUID(),
|
|
|
|
|
method: 'live_lens_change',
|
|
|
|
|
tid: buildGUID(),
|
|
|
|
|
tid: lensTid,
|
|
|
|
|
timestamp: new Date().getTime(),
|
|
|
|
|
data: {
|
|
|
|
|
video_id: uav.video_id,
|
|
|
|
@ -208,11 +215,12 @@
|
|
|
|
|
licenseUrl: live_info.url + liveCode.value + '.flv', // license 地址,必传。参考准备工作部分,在视立方控制台申请 license 后可获得 licenseUrl
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
const stopTid = buildGUID();
|
|
|
|
|
const closeLive = () => {
|
|
|
|
|
const querys = {
|
|
|
|
|
bid: buildGUID(),
|
|
|
|
|
method: 'live_stop_push',
|
|
|
|
|
tid: buildGUID(),
|
|
|
|
|
tid: stopTid,
|
|
|
|
|
timestamp: new Date().getTime(),
|
|
|
|
|
data: {
|
|
|
|
|
video_id: uav.video_id,
|
|
|
|
@ -231,7 +239,7 @@
|
|
|
|
|
playVideo();
|
|
|
|
|
getClient().on('message', (topic, message) => {
|
|
|
|
|
const rs = JSON.parse(message);
|
|
|
|
|
if (rs.method == 'live_start_push') {
|
|
|
|
|
if (rs.method == 'live_start_push' && rs.tid == startTid) {
|
|
|
|
|
if (rs.data.result == 0) {
|
|
|
|
|
createMessage.success('无人机开始直播成功');
|
|
|
|
|
player.src(live_info.url + liveCode.value + '.flv');
|
|
|
|
@ -243,7 +251,7 @@
|
|
|
|
|
} else {
|
|
|
|
|
createMessage.error('开始直播失败,' + errorName(rs.data.result));
|
|
|
|
|
}
|
|
|
|
|
} else if (rs.method == 'live_stop_push') {
|
|
|
|
|
} else if (rs.method == 'live_stop_push' && rs.tid == stopTid) {
|
|
|
|
|
if (rs.data.result == 0) {
|
|
|
|
|
createMessage.success('无人机停止直播成功');
|
|
|
|
|
if (player) {
|
|
|
|
@ -252,7 +260,7 @@
|
|
|
|
|
} else {
|
|
|
|
|
createMessage.error('无人机停止直播失败,' + errorName(rs.data.result));
|
|
|
|
|
}
|
|
|
|
|
} else if (rs.method == 'live_set_quality') {
|
|
|
|
|
} else if (rs.method == 'live_set_quality' && rs.tid == qualityTid) {
|
|
|
|
|
if (rs.data.result == 0) {
|
|
|
|
|
createMessage.success('无人机设置清晰度成功');
|
|
|
|
|
player.src(live_info.url + '4.flv');
|
|
|
|
@ -260,7 +268,7 @@
|
|
|
|
|
} else {
|
|
|
|
|
createMessage.error('无人机设置清晰度失败,' + errorName(rs.data.result));
|
|
|
|
|
}
|
|
|
|
|
} else if (rs.method == 'live_lens_change') {
|
|
|
|
|
} else if (rs.method == 'live_lens_change' && rs.tid == lensTid) {
|
|
|
|
|
if (rs.data.result == 0) {
|
|
|
|
|
createMessage.success('无人机设置直播镜头成功');
|
|
|
|
|
player.src(live_info.url + liveCode.value + '.flv');
|
|
|
|
@ -280,7 +288,6 @@
|
|
|
|
|
onBeforeUnmount(() => {
|
|
|
|
|
player.dispose();
|
|
|
|
|
player = null;
|
|
|
|
|
closeLive();
|
|
|
|
|
});
|
|
|
|
|
</script>
|
|
|
|
|
<style lang="less" scoped>
|
|
|
|
|