You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
156 lines
3.0 KiB
156 lines
3.0 KiB
<template>
|
|
<div class="video-container">
|
|
<div class="header">
|
|
<div class="left">
|
|
<div class="radio">
|
|
<span @click="active = 'img'" :class="{ active: active === 'img' }">图像</span>
|
|
<span @click="active = 'video'" :class="{ active: active === 'video' }">视频</span>
|
|
</div>
|
|
</div>
|
|
<div class="right">
|
|
<!-- <div class="btn">2X</div>
|
|
<div class="btn">全屏</div> -->
|
|
</div>
|
|
</div>
|
|
<Transition name="fade" mode="out-in">
|
|
<Video :rangeIndex="rangeIndex" v-if="active === 'video'" class="video-stream" :pileNum="pileNum" :camId="camId"
|
|
:url="url" />
|
|
<img v-else src="./view.png" />
|
|
</Transition>
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
import Video from "./Video.vue"
|
|
|
|
export default {
|
|
name: 'VideoControls',
|
|
components: {
|
|
Video
|
|
},
|
|
props: {
|
|
// 设备ID
|
|
camId: {
|
|
type: String,
|
|
default: null
|
|
},
|
|
// 桩号
|
|
pileNum: {
|
|
type: String,
|
|
default: null
|
|
},
|
|
url: {
|
|
type: String,
|
|
default: null
|
|
},
|
|
rangeIndex: {
|
|
type: Number,
|
|
default: 0
|
|
}
|
|
},
|
|
data() {
|
|
return {
|
|
active: "video"
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style lang='scss' scoped>
|
|
.video-container {
|
|
position: relative;
|
|
background-color: #000;
|
|
height: 240px;
|
|
overflow: hidden;
|
|
display: flex;
|
|
justify-content: center;
|
|
|
|
.fade-enter-active,
|
|
.fade-leave-active {
|
|
transition: opacity 0.24s ease;
|
|
}
|
|
|
|
.fade-enter-from,
|
|
.fade-leave-to {
|
|
opacity: 0;
|
|
}
|
|
|
|
.header {
|
|
position: absolute;
|
|
top: 0;
|
|
left: 0;
|
|
width: 100%;
|
|
z-index: 999;
|
|
display: flex;
|
|
padding: 6px;
|
|
justify-content: space-between;
|
|
|
|
.left,
|
|
.right {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 9px;
|
|
}
|
|
|
|
.radio {
|
|
background: #265A70;
|
|
border-radius: 41px 41px 41px 41px;
|
|
overflow: hidden;
|
|
opacity: 1;
|
|
border: 1px solid #3DE8FF;
|
|
font-size: 12px;
|
|
// font-family: PingFang SC, PingFang SC;
|
|
font-weight: 400;
|
|
color: #FFFFFF;
|
|
line-height: 14px;
|
|
height: fit-content;
|
|
|
|
// -webkit-background-clip: text;
|
|
// -webkit-text-fill-color: transparent;
|
|
|
|
.active {
|
|
background-color: rgba(61, 232, 255, 1);
|
|
}
|
|
|
|
span {
|
|
background-color: rgba(38, 90, 112, 1);
|
|
padding: 4px 9px;
|
|
display: inline-block;
|
|
cursor: pointer;
|
|
|
|
&:hover {
|
|
background-color: rgba(61, 232, 255, 1);
|
|
}
|
|
}
|
|
}
|
|
|
|
.btn {
|
|
background: #265A70;
|
|
border-radius: 6px 6px 6px 6px;
|
|
opacity: 1;
|
|
border: 1px solid #3DE8FF;
|
|
font-size: 12px;
|
|
// font-family: PingFang SC, PingFang SC;
|
|
font-weight: 400;
|
|
color: #FFFFFF;
|
|
line-height: 14px;
|
|
padding: 3px 9px;
|
|
cursor: pointer;
|
|
// -webkit-background-clip: text;
|
|
// -webkit-text-fill-color: transparent;
|
|
}
|
|
}
|
|
|
|
|
|
.video-stream,
|
|
img {
|
|
height: 100%;
|
|
max-height: 100%;
|
|
max-width: 100%;
|
|
}
|
|
|
|
.video-stream {
|
|
width: 100%;
|
|
}
|
|
}
|
|
</style>
|
|
|