|
|
|
@ -29,6 +29,16 @@
|
|
|
|
</a-modal>
|
|
|
|
</a-modal>
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
<template v-else-if="type=='test'">
|
|
|
|
<template v-else-if="type=='test'">
|
|
|
|
|
|
|
|
<a-modal
|
|
|
|
|
|
|
|
v-model="isShow"
|
|
|
|
|
|
|
|
@cancel="handleCancel"
|
|
|
|
|
|
|
|
:footer="null"
|
|
|
|
|
|
|
|
:maskClosable="false"
|
|
|
|
|
|
|
|
width="1600px"
|
|
|
|
|
|
|
|
:bodyStyle="{padding:0,display:'flex'}"
|
|
|
|
|
|
|
|
:centered="true"
|
|
|
|
|
|
|
|
class="config-model"
|
|
|
|
|
|
|
|
>
|
|
|
|
<div class="test-model">
|
|
|
|
<div class="test-model">
|
|
|
|
<video
|
|
|
|
<video
|
|
|
|
|
|
|
|
|
|
|
|
@ -73,6 +83,7 @@
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</a-modal>
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<template v-else-if="type=='config'">
|
|
|
|
<template v-else-if="type=='config'">
|
|
|
|
@ -229,6 +240,7 @@ export default {
|
|
|
|
data() {
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
return {
|
|
|
|
isShow:false,
|
|
|
|
isShow:false,
|
|
|
|
|
|
|
|
player:null,
|
|
|
|
type:'',
|
|
|
|
type:'',
|
|
|
|
title:'',
|
|
|
|
title:'',
|
|
|
|
closable:false,//取消model模态框右上角的X号
|
|
|
|
closable:false,//取消model模态框右上角的X号
|
|
|
|
@ -265,7 +277,6 @@ export default {
|
|
|
|
this.id = this.$route.query.modelData.id
|
|
|
|
this.id = this.$route.query.modelData.id
|
|
|
|
this.type = this.$route.query.modelType
|
|
|
|
this.type = this.$route.query.modelType
|
|
|
|
this.mdata = this.$route.query.modelData
|
|
|
|
this.mdata = this.$route.query.modelData
|
|
|
|
//this.getTestVideo(this.$route.query.modelData.rtsp)
|
|
|
|
|
|
|
|
this.$nextTick(() => {
|
|
|
|
this.$nextTick(() => {
|
|
|
|
this.autoPlay(this.id)
|
|
|
|
this.autoPlay(this.id)
|
|
|
|
})
|
|
|
|
})
|
|
|
|
@ -274,13 +285,15 @@ export default {
|
|
|
|
this.id = this.$route.query.modelData.id
|
|
|
|
this.id = this.$route.query.modelData.id
|
|
|
|
this.type = this.$route.query.modelType
|
|
|
|
this.type = this.$route.query.modelType
|
|
|
|
this.mdata = this.$route.query.modelData
|
|
|
|
this.mdata = this.$route.query.modelData
|
|
|
|
//this.getConfigVideo(this.$route.query.modelData.rtsp)
|
|
|
|
|
|
|
|
this.getConfigIoList()
|
|
|
|
|
|
|
|
this.$nextTick(() => {
|
|
|
|
this.$nextTick(() => {
|
|
|
|
this.autoPlay(this.id)
|
|
|
|
this.autoPlay(this.id)
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
this.getConfigIoList()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
destroy(){
|
|
|
|
|
|
|
|
//this.player.destroy()
|
|
|
|
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
methods: {
|
|
|
|
handleOk() {
|
|
|
|
handleOk() {
|
|
|
|
this.confirmLoading = true;
|
|
|
|
this.confirmLoading = true;
|
|
|
|
@ -320,24 +333,29 @@ export default {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
handleCancel() {
|
|
|
|
handleCancel() {
|
|
|
|
|
|
|
|
this.player.destroy()
|
|
|
|
console.log('Clicked cancel button');
|
|
|
|
console.log('Clicked cancel button');
|
|
|
|
this.$emit('close', false, {})
|
|
|
|
this.$emit('close', false, {})
|
|
|
|
if(this.type=='test') {
|
|
|
|
if(this.type=='test') {
|
|
|
|
this.$router.go(-1);
|
|
|
|
this.$router.go(-1);
|
|
|
|
this.player.destroy()
|
|
|
|
//this.player.destroy();
|
|
|
|
|
|
|
|
this.player = null;
|
|
|
|
}else if(this.type=='config') {
|
|
|
|
}else if(this.type=='config') {
|
|
|
|
this.$router.go(-1);
|
|
|
|
this.$router.go(-1);
|
|
|
|
this.player.destroy()
|
|
|
|
//this.player.destroy();
|
|
|
|
|
|
|
|
this.player = null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
//写两个会让渲染快一点,避开两个重连机制
|
|
|
|
autoPlay(id){
|
|
|
|
autoPlay(id){
|
|
|
|
let video = document.getElementById('camera'+id);
|
|
|
|
let video = document.getElementById('camera'+id);
|
|
|
|
console.log(video)
|
|
|
|
|
|
|
|
if(this.player == null){
|
|
|
|
|
|
|
|
this.player = new WebRtcPlayer(video,'camera'+id);
|
|
|
|
this.player = new WebRtcPlayer(video,'camera'+id);
|
|
|
|
}
|
|
|
|
|
|
|
|
this.player.load('camera'+id);
|
|
|
|
this.player.load('camera'+id);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
setVideoServer(){
|
|
|
|
setVideoServer(){
|
|
|
|
this.$api.httpApi.getVideoServer({
|
|
|
|
this.$api.httpApi.getVideoServer({
|
|
|
|
data: {}
|
|
|
|
data: {}
|
|
|
|
@ -375,7 +393,7 @@ export default {
|
|
|
|
type: type
|
|
|
|
type: type
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}).then(res => {
|
|
|
|
}).then(res => {
|
|
|
|
console.log(res)
|
|
|
|
|
|
|
|
this.getConfigIoList()
|
|
|
|
this.getConfigIoList()
|
|
|
|
}).catch(err => {
|
|
|
|
}).catch(err => {
|
|
|
|
|
|
|
|
|
|
|
|
|