|
@@ -22,16 +22,12 @@
|
|
<div class="data-item">V.S {{ flightData.verticalSpeed }}m/s</div>
|
|
<div class="data-item">V.S {{ flightData.verticalSpeed }}m/s</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
+ <div class="map-box" v-show="currentPosition.latitude">
|
|
|
|
+ <Map />
|
|
|
|
+ </div>
|
|
<div class="video-box">
|
|
<div class="video-box">
|
|
- <video
|
|
|
|
- id="videoElement"
|
|
|
|
- controls
|
|
|
|
- :width="height + 'px'"
|
|
|
|
- :height="width + 'px'"
|
|
|
|
- ref="videoRef"
|
|
|
|
- x5-video-player-type="x5"
|
|
|
|
- muted
|
|
|
|
- ></video>
|
|
|
|
|
|
+ <video id="videoElement" controls :width="height + 'px'" :height="width + 'px'" ref="videoRef"
|
|
|
|
+ x5-video-player-type="x5" muted></video>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
@@ -40,9 +36,13 @@
|
|
import flvjs from "flv.js";
|
|
import flvjs from "flv.js";
|
|
import { getDroneFlightTask, flightTakeOff } from "@/api/home";
|
|
import { getDroneFlightTask, flightTakeOff } from "@/api/home";
|
|
import { Toast, Dialog } from "vant";
|
|
import { Toast, Dialog } from "vant";
|
|
|
|
+import Map from '@/components/Map.vue'
|
|
|
|
|
|
export default {
|
|
export default {
|
|
name: "DroneOperation",
|
|
name: "DroneOperation",
|
|
|
|
+ components: {
|
|
|
|
+ Map
|
|
|
|
+ },
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
liveUrl: "",
|
|
liveUrl: "",
|
|
@@ -50,10 +50,6 @@ export default {
|
|
height: 0,
|
|
height: 0,
|
|
currentTime: "",
|
|
currentTime: "",
|
|
timer: null,
|
|
timer: null,
|
|
- dronePosition: {
|
|
|
|
- lat: 39.9042,
|
|
|
|
- lng: 116.4074,
|
|
|
|
- },
|
|
|
|
flvPlayer: null,
|
|
flvPlayer: null,
|
|
flightTaskUuid: null,
|
|
flightTaskUuid: null,
|
|
reconnectNum: 0, // 直播重连次数
|
|
reconnectNum: 0, // 直播重连次数
|
|
@@ -74,6 +70,9 @@ export default {
|
|
flightData() {
|
|
flightData() {
|
|
return this.$store.state.flightData || {};
|
|
return this.$store.state.flightData || {};
|
|
},
|
|
},
|
|
|
|
+ currentPosition() {
|
|
|
|
+ return this.$store.state.currentPosition;
|
|
|
|
+ }
|
|
},
|
|
},
|
|
created() {
|
|
created() {
|
|
// console.log("this.$router==>", this.$route);
|
|
// console.log("this.$router==>", this.$route);
|
|
@@ -145,7 +144,7 @@ export default {
|
|
try {
|
|
try {
|
|
flvPlayer.attachMediaElement(videoElement);
|
|
flvPlayer.attachMediaElement(videoElement);
|
|
flvPlayer.load(); // 加载视频流
|
|
flvPlayer.load(); // 加载视频流
|
|
- } catch {}
|
|
|
|
|
|
+ } catch { }
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
// alert("当前浏览器不支持FLV.js");
|
|
// alert("当前浏览器不支持FLV.js");
|
|
@@ -183,13 +182,13 @@ export default {
|
|
) {
|
|
) {
|
|
this.liveUrl = res.data.startStreamConvert.videoUrl;
|
|
this.liveUrl = res.data.startStreamConvert.videoUrl;
|
|
try {
|
|
try {
|
|
- this.videoTimer = setTimeout(()=>{
|
|
|
|
|
|
+ this.videoTimer = setTimeout(() => {
|
|
loading.clear();
|
|
loading.clear();
|
|
this.videoTimer = null;
|
|
this.videoTimer = null;
|
|
this.initPlayer();
|
|
this.initPlayer();
|
|
}, 3000)
|
|
}, 3000)
|
|
- } catch {}
|
|
|
|
- }else{
|
|
|
|
|
|
+ } catch { }
|
|
|
|
+ } else {
|
|
loading.clear();
|
|
loading.clear();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -232,7 +231,7 @@ export default {
|
|
if (this.videoTimer) {
|
|
if (this.videoTimer) {
|
|
clearTimeout(this.videoTimer);
|
|
clearTimeout(this.videoTimer);
|
|
}
|
|
}
|
|
- if(this.reconnectTimer){
|
|
|
|
|
|
+ if (this.reconnectTimer) {
|
|
clearTimeout(this.reconnectTimer);
|
|
clearTimeout(this.reconnectTimer);
|
|
}
|
|
}
|
|
if (this.flvPlayer) {
|
|
if (this.flvPlayer) {
|
|
@@ -255,6 +254,7 @@ export default {
|
|
margin: 0 !important;
|
|
margin: 0 !important;
|
|
padding: 0;
|
|
padding: 0;
|
|
}
|
|
}
|
|
|
|
+
|
|
.container-title {
|
|
.container-title {
|
|
position: absolute;
|
|
position: absolute;
|
|
box-sizing: border-box;
|
|
box-sizing: border-box;
|
|
@@ -267,16 +267,21 @@ export default {
|
|
font-size: 14px;
|
|
font-size: 14px;
|
|
z-index: 20000;
|
|
z-index: 20000;
|
|
transform: rotate(90deg);
|
|
transform: rotate(90deg);
|
|
- right: 0; /* 初始设置为右对齐 */
|
|
|
|
- top: 100%; /* 垂直居中 */
|
|
|
|
- transform-origin: right top; /* 设置旋转基点在元素的右上角 */
|
|
|
|
|
|
+ right: 0;
|
|
|
|
+ /* 初始设置为右对齐 */
|
|
|
|
+ top: 100%;
|
|
|
|
+ /* 垂直居中 */
|
|
|
|
+ transform-origin: right top;
|
|
|
|
+ /* 设置旋转基点在元素的右上角 */
|
|
}
|
|
}
|
|
|
|
+
|
|
.container-title .title-right {
|
|
.container-title .title-right {
|
|
flex-shrink: 0;
|
|
flex-shrink: 0;
|
|
margin-left: 10px;
|
|
margin-left: 10px;
|
|
display: flex;
|
|
display: flex;
|
|
align-items: center;
|
|
align-items: center;
|
|
}
|
|
}
|
|
|
|
+
|
|
.container-title .title-left {
|
|
.container-title .title-left {
|
|
flex: 1;
|
|
flex: 1;
|
|
display: flex;
|
|
display: flex;
|
|
@@ -317,29 +322,33 @@ export default {
|
|
padding: 0;
|
|
padding: 0;
|
|
box-sizing: border-box;
|
|
box-sizing: border-box;
|
|
z-index: 20000;
|
|
z-index: 20000;
|
|
-
|
|
|
|
transform: rotate(90deg);
|
|
transform: rotate(90deg);
|
|
color: #ffffff;
|
|
color: #ffffff;
|
|
}
|
|
}
|
|
|
|
+
|
|
.flight-data .data-row {
|
|
.flight-data .data-row {
|
|
width: 100%;
|
|
width: 100%;
|
|
display: flex;
|
|
display: flex;
|
|
align-items: center;
|
|
align-items: center;
|
|
justify-content: center;
|
|
justify-content: center;
|
|
}
|
|
}
|
|
|
|
+
|
|
.flight-data .data-item {
|
|
.flight-data .data-item {
|
|
min-width: 35%;
|
|
min-width: 35%;
|
|
text-align: center;
|
|
text-align: center;
|
|
margin-bottom: 10px;
|
|
margin-bottom: 10px;
|
|
}
|
|
}
|
|
|
|
+
|
|
.video-box {
|
|
.video-box {
|
|
transform: rotate(90deg);
|
|
transform: rotate(90deg);
|
|
box-sizing: border-box;
|
|
box-sizing: border-box;
|
|
margin: 0;
|
|
margin: 0;
|
|
}
|
|
}
|
|
|
|
+
|
|
#videoElement {
|
|
#videoElement {
|
|
display: block;
|
|
display: block;
|
|
- object-fit: fill; /* 使用cover或fill */
|
|
|
|
|
|
+ object-fit: fill;
|
|
|
|
+ /* 使用cover或fill */
|
|
margin: 0 !important;
|
|
margin: 0 !important;
|
|
z-index: 900;
|
|
z-index: 900;
|
|
position: relative;
|
|
position: relative;
|
|
@@ -347,4 +356,16 @@ export default {
|
|
left: 0;
|
|
left: 0;
|
|
bottom: 0; */
|
|
bottom: 0; */
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+.map-box {
|
|
|
|
+ position: absolute;
|
|
|
|
+ z-index: 1000;
|
|
|
|
+ transform: rotate(90deg);
|
|
|
|
+ right: 80px;
|
|
|
|
+ /* 初始设置为右对齐 */
|
|
|
|
+ top: 220px;
|
|
|
|
+ /* 垂直居中 */
|
|
|
|
+ transform-origin: right top;
|
|
|
|
+ /* 设置旋转基点在元素的右上角 */
|
|
|
|
+}
|
|
</style>
|
|
</style>
|