This commit is contained in:
”Rain“ 2024-05-27 21:45:49 +08:00
parent 1c9371aa76
commit d9ada299de

View File

@ -10,10 +10,9 @@
<video class="videoBox" id="myVideo" :custom-cache="false" :src="playUrlFilter" controls autoplay></video> <video class="videoBox" id="myVideo" :custom-cache="false" :src="playUrlFilter" controls autoplay></video>
<view class="videoName"> <view class="videoName">
{{videoInfo.videoName}} {{videoInfo.videoName}}
<button v-if="videoInfo.videoType==3" type="primary" class="changeBtn btn" <button v-if="videoInfo.videoType==3" type="primary" class="changeBtn btn" @click="changeStreamFn">{{streamType==1?'切换到主码流':'切换到子码流'}}</button>
@click="changeStreamFn">{{streamType==1?'切换到主码流':'切换到子码流'}}</button>
</view> </view>
<view class="videoOperateBox" :class="{'videoOperateBox2':videoFlag}"> <view class="videoOperateBox">
<view class="box"> <view class="box">
<image src="../../static/videoControlIcon/bg.png" class="bg"></image> <image src="../../static/videoControlIcon/bg.png" class="bg"></image>
<view class="pic top" @click="controlVideoFn(0,0.2,0,'UP')"></view> <view class="pic top" @click="controlVideoFn(0,0.2,0,'UP')"></view>
@ -36,16 +35,11 @@
<script> <script>
import headers from '../../components/headers/headers.vue' import headers from '../../components/headers/headers.vue'
export default { export default {
components: { components:{headers},
headers
},
data() { data() {
return { return {
url:'',//rtsp://admin:jxj12345@192.168.0.64:554/h264/ch1/main/av_stream url:'',//rtsp://admin:jxj12345@192.168.0.64:554/h264/ch1/main/av_stream
videoInfo: { videoInfo:{videoName:'',videoType:null},
videoName: '',
videoType: null
},
streamType: 1, //1 2 streamType: 1, //1 2
videoResponseInfo: {}, videoResponseInfo: {},
videoFlag:false, videoFlag:false,
@ -70,10 +64,7 @@
// //
toBackList(){ toBackList(){
uni.navigateTo({ uni.navigateTo({
url: './playBackList?obj=' + JSON.stringify({ url: './playBackList?obj=' + JSON.stringify({...this.videoResponseInfo,...this.videoInfo})
...this.videoResponseInfo,
...this.videoInfo
})
}) })
}, },
changeStreamFn(){ changeStreamFn(){
@ -86,9 +77,7 @@
}, },
getPlayUrl(){ getPlayUrl(){
var that = this var that = this
var json = { var json ={itemId:this.videoInfo.itemId}
itemId: this.videoInfo.itemId
}
if(this.videoInfo.videoType==3){ if(this.videoInfo.videoType==3){
json.streamType=this.streamType json.streamType=this.streamType
json.type='rtsp' //rtsphls json.type='rtsp' //rtsphls
@ -106,10 +95,7 @@
that.url=res.result.videoInfo.url that.url=res.result.videoInfo.url
break; break;
} }
that.videoResponseInfo = { that.videoResponseInfo = {...res.result.projectVideoConfig,...res.result.videoInfo};
...res.result.projectVideoConfig,
...res.result.videoInfo
};
for(let i in that.videoResponseInfo){ for(let i in that.videoResponseInfo){
if(!that.videoResponseInfo[i]){ if(!that.videoResponseInfo[i]){
delete that.videoResponseInfo[i] delete that.videoResponseInfo[i]
@ -217,7 +203,6 @@
background-color: #F4F5FD; background-color: #F4F5FD;
height: 100vh; height: 100vh;
} }
/* #endif */ /* #endif */
/* #ifdef MP-WEIXIN */ /* #ifdef MP-WEIXIN */
@ -225,7 +210,6 @@
background-color: #F4F5FD; background-color: #F4F5FD;
height: 100vh; height: 100vh;
} }
/* #endif */ /* #endif */
/* #ifdef APP-PLUS */ /* #ifdef APP-PLUS */
@ -234,19 +218,16 @@
height: auto; height: auto;
padding-bottom: 60rpx; padding-bottom: 60rpx;
} }
/* #endif */ /* #endif */
.videoBox{ .videoBox{
width: 100%; width: 100%;
} }
.videoName{ .videoName{
font-size: 16px; font-size: 16px;
color: $uni-text-color; color: $uni-text-color;
font-weight: bold; font-weight: bold;
margin: 10px 15px; margin: 10px 15px;
position: relative; position: relative;
.changeBtn{ .changeBtn{
position: absolute; position: absolute;
right: 0; right: 0;
@ -254,7 +235,6 @@
font-size: 12px; font-size: 12px;
} }
} }
.video-playback{ .video-playback{
width: 454rpx; width: 454rpx;
height: 108rpx; height: 108rpx;
@ -272,11 +252,9 @@
// bottom: 80rpx; // bottom: 80rpx;
// left: 145rpx; // left: 145rpx;
} }
.videoOperateBox { .videoOperateBox {
text-align: center; text-align: center;
padding-top: 10px; padding-top: 10px;
.bg{ .bg{
width: 220px; width: 220px;
height: 220px; height: 220px;
@ -327,19 +305,19 @@
margin-top: -16px; margin-top: -16px;
} }
.videoOperateBox2 .left:hover { .videoOperateBox .left:hover {
background: url("../../static/videoControlIcon/left-active.png"); background: url("../../static/videoControlIcon/left-active.png");
} }
.videoOperateBox2 .right:hover { .videoOperateBox .right:hover {
background: url("../../static/videoControlIcon/right-active.png"); background: url("../../static/videoControlIcon/right-active.png");
} }
.videoOperateBox2 .top:hover { .videoOperateBox .top:hover {
background: url("../../static/videoControlIcon/top-active.png"); background: url("../../static/videoControlIcon/top-active.png");
} }
.videoOperateBox2 .bottom:hover { .videoOperateBox .bottom:hover {
background: url("../../static/videoControlIcon/bottom-active.png"); background: url("../../static/videoControlIcon/bottom-active.png");
} }