|
|
|
@ -12,6 +12,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
<!-- </a-modal>-->
|
|
|
|
<!-- </a-modal>-->
|
|
|
|
<div class="video-mask">
|
|
|
|
<div class="video-mask">
|
|
|
|
|
|
|
|
<canvas class="video-canvas"></canvas>
|
|
|
|
<div class="video-close" @click="handleCancel">
|
|
|
|
<div class="video-close" @click="handleCancel">
|
|
|
|
x
|
|
|
|
x
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
@ -39,8 +40,8 @@
|
|
|
|
<img src="@/assets/right-top-icon.png" alt="">
|
|
|
|
<img src="@/assets/right-top-icon.png" alt="">
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="direction-item">
|
|
|
|
<div class="direction-item">
|
|
|
|
<img src="@/assets/left-icon.png" alt="">
|
|
|
|
<img src="@/assets/left-icon.png" alt="" @mousedown="leftStart" @mouseup="leftStop">
|
|
|
|
<img src="@/assets/right-icon.png" alt="">
|
|
|
|
<img src="@/assets/right-icon.png" alt="" @mousedown="rightStart" @mouseup="rightStop">
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="direction-item">
|
|
|
|
<div class="direction-item">
|
|
|
|
<img src="@/assets/left-bottom-icon.png" alt="">
|
|
|
|
<img src="@/assets/left-bottom-icon.png" alt="">
|
|
|
|
@ -71,13 +72,30 @@ export default {
|
|
|
|
modelData: function(newVal){
|
|
|
|
modelData: function(newVal){
|
|
|
|
// console.log(newVal)
|
|
|
|
// console.log(newVal)
|
|
|
|
if(newVal.id){
|
|
|
|
if(newVal.id){
|
|
|
|
this.mdata=newVal
|
|
|
|
|
|
|
|
this.id = newVal.id
|
|
|
|
this.id = newVal.id
|
|
|
|
|
|
|
|
console.log(newVal)
|
|
|
|
// console.log('触发了watch,重新赋值')
|
|
|
|
// console.log('触发了watch,重新赋值')
|
|
|
|
this.$nextTick(()=>{ //this.$nextTick解决不能在表单渲染之前赋值的报错问题
|
|
|
|
this.$nextTick(()=>{ //this.$nextTick解决不能在表单渲染之前赋值的报错问题
|
|
|
|
this.form.setFieldsValue({ //setFieldsValue 表示对form表单重新设置值
|
|
|
|
console.log(newVal.rtsp)
|
|
|
|
ip:newVal.ip,
|
|
|
|
this.$api.httpApi.getChannel({
|
|
|
|
rtsp:newVal.rtsp
|
|
|
|
data:{
|
|
|
|
|
|
|
|
"sourceUrl":newVal.rtsp,
|
|
|
|
|
|
|
|
"paramBefore": "-y -i",
|
|
|
|
|
|
|
|
"paramBehind": "-f mpegts -codec:v mpeg1video -an -s 1707*960 -b:v 1000k -r 20 -bf 0 -codec:a mp2 -ar 44100 -ac 1 -b:a 128k"
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}).then(res => {
|
|
|
|
|
|
|
|
console.log(res.data)
|
|
|
|
|
|
|
|
var url = 'ws://192.168.66.56:9007/api/lychee/stream/live/'+res.data.channel
|
|
|
|
|
|
|
|
var player = new JSMpeg.Player(url, {
|
|
|
|
|
|
|
|
canvas: document.querySelector('.video-canvas'),
|
|
|
|
|
|
|
|
audio: false,
|
|
|
|
|
|
|
|
pauseWhenHidden: false,
|
|
|
|
|
|
|
|
videoBufferSize: 8 * 1024 * 1024,
|
|
|
|
|
|
|
|
loop:false,
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
player.play()
|
|
|
|
|
|
|
|
}).catch(err => {
|
|
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
})
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -101,41 +119,46 @@ export default {
|
|
|
|
console.log('mounted执行了')
|
|
|
|
console.log('mounted执行了')
|
|
|
|
},
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
methods: {
|
|
|
|
handleOk() {
|
|
|
|
leftStart(){
|
|
|
|
this.confirmLoading = true;
|
|
|
|
// console.log(this.id)
|
|
|
|
setTimeout(() => {
|
|
|
|
console.log('左转鼠标按下')
|
|
|
|
this.form.validateFields((err, values) => {
|
|
|
|
this.$axios.post('/camera/control/left/'+this.id, {
|
|
|
|
console.log(values)
|
|
|
|
data: {}
|
|
|
|
if (!err) {
|
|
|
|
|
|
|
|
console.log(this.title)
|
|
|
|
|
|
|
|
if(this.title=='新增球机'){
|
|
|
|
|
|
|
|
this.$api.httpApi.addCamera({
|
|
|
|
|
|
|
|
data:values
|
|
|
|
|
|
|
|
}).then(res => {
|
|
|
|
}).then(res => {
|
|
|
|
if(res.code==200){
|
|
|
|
|
|
|
|
this.$emit('sure',false)
|
|
|
|
|
|
|
|
this.$message.success('新增球机成功');
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}).catch(err => {
|
|
|
|
}).catch(err => {
|
|
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
})
|
|
|
|
}else if(this.title=='编辑球机'){
|
|
|
|
},
|
|
|
|
values.id = this.id
|
|
|
|
leftStop(){
|
|
|
|
this.$api.httpApi.editCamera({
|
|
|
|
console.log('左转鼠标抬起')
|
|
|
|
data:values
|
|
|
|
this.$axios.post('/camera/control/left/stop/'+this.id, {
|
|
|
|
|
|
|
|
data: {}
|
|
|
|
}).then(res => {
|
|
|
|
}).then(res => {
|
|
|
|
if(res.code==200){
|
|
|
|
|
|
|
|
this.$emit('sure',false)
|
|
|
|
|
|
|
|
this.$message.success('编辑球机成功');
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}).catch(err => {
|
|
|
|
}).catch(err => {
|
|
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
})
|
|
|
|
}
|
|
|
|
},
|
|
|
|
}
|
|
|
|
rightStart(){
|
|
|
|
});
|
|
|
|
console.log('右转鼠标按下')
|
|
|
|
this.confirmLoading = false;
|
|
|
|
this.$axios.post('/camera/control/right/'+this.id, {
|
|
|
|
}, 500);
|
|
|
|
data: {}
|
|
|
|
|
|
|
|
}).then(res => {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}).catch(err => {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
rightStop(){
|
|
|
|
|
|
|
|
console.log('左转鼠标抬起')
|
|
|
|
|
|
|
|
this.$axios.post('/camera/control/right/stop/'+this.id, {
|
|
|
|
|
|
|
|
data: {}
|
|
|
|
|
|
|
|
}).then(res => {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}).catch(err => {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
},
|
|
|
|
},
|
|
|
|
handleCancel() {
|
|
|
|
handleCancel() {
|
|
|
|
console.log('Clicked cancel button');
|
|
|
|
console.log('Clicked cancel button');
|
|
|
|
@ -158,6 +181,10 @@ export default {
|
|
|
|
right: 0;
|
|
|
|
right: 0;
|
|
|
|
background-color: #001529;
|
|
|
|
background-color: #001529;
|
|
|
|
z-index: 9999;
|
|
|
|
z-index: 9999;
|
|
|
|
|
|
|
|
.video-canvas{
|
|
|
|
|
|
|
|
width: 100vw;
|
|
|
|
|
|
|
|
height: 100vh;
|
|
|
|
|
|
|
|
}
|
|
|
|
.video-close{
|
|
|
|
.video-close{
|
|
|
|
position: absolute;
|
|
|
|
position: absolute;
|
|
|
|
right: 20px;
|
|
|
|
right: 20px;
|
|
|
|
|