wszhyWx/pages/videoLive/videoLive.vue

529 lines
13 KiB
Vue
Raw Normal View History

2023-09-28 10:07:02 +00:00
<template>
<view class="videoLive">
<u-navbar :background="background" :is-back='true' back-icon-color='#FFFFFF' :border-bottom="false" title="摄像机01"
title-color='#FFFFFF' :title-bold='true' title-size='32'></u-navbar>
<view class="center">
<view class="video_live">
2024-01-26 08:03:06 +00:00
<!-- <image src="../../static/videoLive.png" mode=""></image> -->
<video id="myVideo" style="width: 100%;height: 100%;" :src="src" controls></video>
2023-09-28 10:07:02 +00:00
</view>
<view class="skills">
<view class="left">
2023-10-05 04:08:22 +00:00
<image src="../../static/direction_keys.png" mode=""></image>
2024-02-22 06:20:13 +00:00
<view :class="directionFlag == 0 ? 'left_arrow_item_act' : 'left_arrow_item'" @touchstart.stop.prevent='touchstart(2)' @touchend.stop.prevent='touchend(2)'>
2024-02-21 10:37:29 +00:00
</view>
2024-02-22 06:20:13 +00:00
<view :class="directionFlag == 1 ? 'right_arrow_item_act' : 'right_arrow_item'" @touchstart.stop.prevent='touchstart(3)' @touchend.stop.prevent='touchend(3)'>
2024-02-21 10:37:29 +00:00
</view>
2024-02-22 06:20:13 +00:00
<view :class="directionFlag == 2 ? 'up_arrow_item_act' : 'up_arrow_item'" @touchstart.stop.prevent='touchstart(0)' @touchend.stop.prevent='touchend(0)'>
2024-02-21 10:37:29 +00:00
</view>
2024-02-22 06:20:13 +00:00
<view :class="directionFlag == 3 ? 'down_arrow_item_act' : 'down_arrow_item'" @touchstart.stop.prevent='touchstart(1)' @touchend.stop.prevent='touchend(1)'>
2024-02-21 10:37:29 +00:00
</view>
2023-09-28 10:07:02 +00:00
</view>
<view class="right">
<view class="right_item">
2024-02-22 06:20:13 +00:00
<view :class="flag1?'add_act':'add'" @touchstart.stop.prevent='touchstart(10)' @touchend.stop.prevent='touchend(10)'>
2023-09-28 10:07:02 +00:00
</view>
<view class="focus">
焦距
</view>
2024-02-22 06:20:13 +00:00
<view :class="flag1?'subtract':'subtract_act'" @touchstart.stop.prevent='touchstart(11)' @touchend.stop.prevent='touchend(11)'>
2023-09-28 10:07:02 +00:00
</view>
</view>
<view class="right_item">
2024-02-22 06:20:13 +00:00
<view :class="flag2?'add_act':'add'" @touchstart.stop.prevent='touchstart(8)' @touchend.stop.prevent='touchend(8)'>
2023-09-28 10:07:02 +00:00
</view>
<view class="focus">
缩放
</view>
2024-02-22 06:20:13 +00:00
<view :class="flag2?'subtract':'subtract_act'" @touchstart.stop.prevent='touchstart(9)' @touchend.stop.prevent='touchend(9)'>
2023-09-28 10:07:02 +00:00
</view>
</view>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
// 头部导航背景
background: {
backgroundColor: '#24B383',
},
2024-02-21 10:37:29 +00:00
directionFlag:5,
2023-09-28 10:07:02 +00:00
flag1:true,
flag2:true,
2024-01-26 02:25:01 +00:00
cameraSerialNumber:'',
cameraChannelNumber:'',
accesstoken:'',
2024-02-21 10:37:29 +00:00
src:'',
2023-09-28 10:07:02 +00:00
};
},
2024-01-26 02:25:01 +00:00
onLoad(options) {
2024-01-26 08:03:06 +00:00
// console.log(options,'00');
2024-01-26 02:25:01 +00:00
this.cameraSerialNumber = options.cameraSerialNumber;
this.cameraChannelNumber = options.cameraChannelNumber
2024-01-26 08:03:06 +00:00
this.getVideoData(this.cameraSerialNumber, this.cameraChannelNumber)
2024-01-26 02:25:01 +00:00
},
2023-09-28 10:07:02 +00:00
methods:{
2024-01-26 02:25:01 +00:00
// 获取摄像头得地址
getVideoData(cameraid, channelid) {
this.$http({
2024-01-26 08:03:06 +00:00
url: this.api.camera_getphonehls,
2024-01-26 02:25:01 +00:00
method: 'GET',
data: {
cameraid,
channelid,
}
}).then(res => {
if (res.code == 200) {
this.accesstoken = res.data.accesstoken;
this.src = res.data.ezopen;
}
})
},
2024-02-22 06:20:13 +00:00
touchstart(num){
if(num == 2){
this.directionFlag = 0;
}else if(num == 3){
this.directionFlag = 1;
}else if(num == 0){
this.directionFlag = 2;
}else if(num == 1){
this.directionFlag = 3;
}else if(num == 10){
this.flag1 = true;
}else if(num == 11){
this.flag1 = false;
}else if(num == 8){
this.flag2 = true;
}else if(num == 9){
this.flag2 = false;
}
2024-02-22 08:32:25 +00:00
// let that = this;
// uni.request({
// url: 'https://open.ys7.com/api/lapp/device/ptz/start',
// method: 'POST',
// data:{
// accessToken: that.accesstoken,
// deviceSerial: that.cameraSerialNumber,
// channelNo: that.cameraChannelNumber,
// direction:num,
// speed: 1,
// },
// header: {
// 'Content-Type': 'application/x-www-form-urlencoded',
// },
// success: (res) => {
// // console.log(res);
// }
// });
this.$http({
url: this.api.camera_start + '?cameraid=' + this.cameraSerialNumber + '&channelid=' + this.cameraChannelNumber + '&direction=' + num,
2024-02-22 06:20:13 +00:00
method: 'POST',
2024-02-22 08:32:25 +00:00
}).then(res=>{
})
2024-02-21 07:50:10 +00:00
},
2024-02-22 06:20:13 +00:00
touchend(num){
this.directionFlag = 5
2024-02-22 08:32:25 +00:00
// let that = this;
// uni.request({
// url:'https://open.ys7.com/api/lapp/device/ptz/stop',
// method: 'POST',
// data:{
// accessToken: that.accesstoken,
// deviceSerial: that.cameraSerialNumber,
// channelNo: that.cameraChannelNumber,
// direction:num,
// speed: 1,
// },
// header: {
// 'Content-Type': 'application/x-www-form-urlencoded',
// },
// success: (res) => {
// // console.log(res);
// }
// })
this.$http({
url: this.api.camera_stop + '?cameraid=' + this.cameraSerialNumber + '&channelid=' + this.cameraChannelNumber + '&direction=' + num,
2024-02-22 06:20:13 +00:00
method: 'POST',
2024-02-22 08:32:25 +00:00
}).then(res=>{
2024-02-22 06:20:13 +00:00
})
2023-09-28 10:07:02 +00:00
},
}
}
</script>
<style lang="scss" scoped>
.videoLive{
width: 100%;
min-height: 100vh;
background-color: #F5F6FA;
.center{
.video_live{
width: 750rpx;
height: 970rpx;
>image{
width: 100%;
height: 100%;
}
}
.skills{
width: 100%;
box-sizing: border-box;
padding: 61rpx 0 0 40rpx;
display: flex;
.left{
width: 340rpx;
height: 340rpx;
position: relative;
margin-right: 60rpx;
.left_arrow,.right_arrow{
width: 15rpx;
height: 28rpx;
}
2024-02-21 10:37:29 +00:00
2023-09-28 10:07:02 +00:00
.up_arrow,.down_arrow{
width: 27rpx;
height: 15rpx;
}
2024-02-21 10:37:29 +00:00
2024-02-22 06:20:13 +00:00
// 左箭头
.left_arrow_item{
2024-02-21 10:37:29 +00:00
width: 51rpx;
height: 51rpx;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
2024-02-22 06:20:13 +00:00
position: absolute;
top: 145rpx;
left: 29rpx;
2024-02-21 10:37:29 +00:00
}
2024-02-22 06:20:13 +00:00
.left_arrow_item_act{
2024-02-21 10:37:29 +00:00
width: 51rpx;
height: 51rpx;
background: #24B383;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
2023-09-28 10:07:02 +00:00
position: absolute;
2024-02-21 10:37:29 +00:00
top: 145rpx;
left: 29rpx;
2023-09-28 10:07:02 +00:00
}
2024-02-22 06:20:13 +00:00
.left_arrow_item::after{
content: '';
width: 15rpx;
height: 28rpx;
background: url('../../static/left_arrow.png') center no-repeat;
background-size: 15rpx 28rpx;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%,-50%);
}
.left_arrow_item_act::after{
content: '';
width: 15rpx;
height: 28rpx;
background: url('../../static/left_arrow_act.png') center no-repeat;
background-size: 15rpx 28rpx;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%,-50%);
}
2024-02-21 10:37:29 +00:00
2024-02-22 06:20:13 +00:00
// 右箭头
2024-02-21 10:37:29 +00:00
.right_arrow_item{
2024-02-22 06:20:13 +00:00
width: 51rpx;
height: 51rpx;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
position: absolute;
top: 145rpx;
right: 29rpx;
}
.right_arrow_item_act{
width: 51rpx;
height: 51rpx;
background: #24B383;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
2024-02-21 10:37:29 +00:00
position: absolute;
top: 145rpx;
right: 29rpx;
}
2024-02-22 06:20:13 +00:00
.right_arrow_item::after{
content: '';
width: 15rpx;
height: 28rpx;
background: url('../../static/right_arrow.png') center no-repeat;
background-size: 15rpx 28rpx;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%,-50%);
}
.right_arrow_item_act::after{
content: '';
width: 15rpx;
height: 28rpx;
background: url('../../static/right_arrow_act.png') center no-repeat;
background-size: 15rpx 28rpx;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%,-50%);
}
2024-02-21 10:37:29 +00:00
2024-02-22 06:20:13 +00:00
// 上箭头
2024-02-21 10:37:29 +00:00
.up_arrow_item{
2024-02-22 06:20:13 +00:00
width: 51rpx;
height: 51rpx;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
position: absolute;
top: 29rpx;
left: 146rpx;
}
.up_arrow_item_act{
width: 51rpx;
height: 51rpx;
background: #24B383;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
2024-02-21 10:37:29 +00:00
position: absolute;
top: 29rpx;
left: 146rpx;
}
2024-02-22 06:20:13 +00:00
.up_arrow_item::after{
content: '';
width: 27rpx;
height: 15rpx;
background: url('../../static/up_arrow.png') center no-repeat;
background-size: 27rpx 15rpx;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%,-50%);
}
.up_arrow_item_act::after{
content: '';
width: 27rpx;
height: 15rpx;
background: url('../../static/up_arrow_act.png') center no-repeat;
background-size: 27rpx 15rpx;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%,-50%);
}
2024-02-21 10:37:29 +00:00
2024-02-22 06:20:13 +00:00
// 下箭头
2024-02-21 10:37:29 +00:00
.down_arrow_item{
2024-02-22 06:20:13 +00:00
width: 51rpx;
height: 51rpx;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
position: absolute;
bottom: 28rpx;
left: 146rpx;
}
.down_arrow_item_act{
width: 51rpx;
height: 51rpx;
background: #24B383;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
2023-09-28 10:07:02 +00:00
position: absolute;
2024-02-21 10:37:29 +00:00
bottom: 28rpx;
2024-02-22 06:20:13 +00:00
left: 146rpx;
}
.down_arrow_item::after{
content: '';
width: 27rpx;
height: 15rpx;
background: url('../../static/down_arrow.png') center no-repeat;
background-size: 27rpx 15rpx;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%,-50%);
}
.down_arrow_item_act::after{
content: '';
width: 27rpx;
height: 15rpx;
background: url('../../static/down_arrow_act.png') center no-repeat;
background-size: 27rpx 15rpx;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%,-50%);
2024-02-21 10:37:29 +00:00
}
>image{
width: 100%;
height: 100%;
2023-09-28 10:07:02 +00:00
}
}
.right{
box-sizing: border-box;
padding-top: 10rpx;
2024-02-21 07:50:10 +00:00
display: flex;
flex-direction: column;
justify-content: center;
2023-09-28 10:07:02 +00:00
.right_item{
width: 240rpx;
height: 80rpx;
background: #EFFAF6;
border: 2px solid rgba(36,179,131,0.35);
border-radius: 40rpx;
display: flex;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
padding: 7rpx;
margin-bottom: 40rpx;
.add{
width: 66rpx;
height: 66rpx;
background: #EFFAF6;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
2024-02-22 06:20:13 +00:00
position: relative;
2023-09-28 10:07:02 +00:00
}
.add_act{
width: 66rpx;
height: 66rpx;
background: #24B383;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
2024-02-22 06:20:13 +00:00
position: relative;
}
.add::after{
content: '';
width: 38rpx;
height: 38rpx;
background: url('../../static/add.png') center no-repeat;
background-size: 38rpx 38rpx;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%,-50%);
}
.add_act::after{
content: '';
width: 38rpx;
height: 38rpx;
background: url('../../static/add_act.png') center no-repeat;
background-size: 38rpx 38rpx;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%,-50%);
2023-09-28 10:07:02 +00:00
}
.focus{
font-size: 30rpx;
font-family: PingFang SC;
font-weight: bold;
color: #24B383;
}
.subtract{
width: 66rpx;
height: 66rpx;
background: #EFFAF6;
border: 2px solid rgba(36,179,131,0.35);
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
2024-02-22 06:20:13 +00:00
position: relative;
2023-09-28 10:07:02 +00:00
}
.subtract_act{
width: 66rpx;
height: 66rpx;
background: #24B383;
border: 2px solid rgba(36,179,131,0.35);
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
2024-02-22 06:20:13 +00:00
position: relative;
}
.subtract::after{
content: '';
width: 38rpx;
height: 8rpx;
background: url('../../static/subtract.png') center no-repeat;
background-size: 38rpx 8rpx;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%,-50%);
}
.subtract_act::after{
content: '';
width: 38rpx;
height: 8rpx;
background: url('../../static/subtract_act.png') center no-repeat;
background-size: 38rpx 8rpx;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%,-50%);
2023-09-28 10:07:02 +00:00
}
}
}
}
}
}
</style>