|
|
|
@ -73,30 +73,12 @@ export default {
|
|
|
|
// console.log(newVal)
|
|
|
|
// console.log(newVal)
|
|
|
|
if(newVal.id){
|
|
|
|
if(newVal.id){
|
|
|
|
this.id = newVal.id
|
|
|
|
this.id = newVal.id
|
|
|
|
|
|
|
|
this.mdata = newVal
|
|
|
|
console.log(newVal)
|
|
|
|
console.log(newVal)
|
|
|
|
// console.log('触发了watch,重新赋值')
|
|
|
|
console.log('触发了watch,重新赋值')
|
|
|
|
this.$nextTick(()=>{ //this.$nextTick解决不能在表单渲染之前赋值的报错问题
|
|
|
|
this.$nextTick(()=>{ //this.$nextTick解决不能在表单渲染之前赋值的报错问题
|
|
|
|
console.log(newVal.rtsp)
|
|
|
|
console.log(newVal.rtsp)
|
|
|
|
this.$api.httpApi.getChannel({
|
|
|
|
this.request(newVal)
|
|
|
|
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 => {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -127,18 +109,59 @@ export default {
|
|
|
|
leftDownUrl:require('@/assets/left-down-icon.png'),
|
|
|
|
leftDownUrl:require('@/assets/left-down-icon.png'),
|
|
|
|
downUrl:require('@/assets/down-icon.png'),
|
|
|
|
downUrl:require('@/assets/down-icon.png'),
|
|
|
|
rightDownUrl:require('@/assets/right-down-icon.png'),
|
|
|
|
rightDownUrl:require('@/assets/right-down-icon.png'),
|
|
|
|
|
|
|
|
player:'',
|
|
|
|
};
|
|
|
|
};
|
|
|
|
},
|
|
|
|
},
|
|
|
|
mounted() {
|
|
|
|
// provide(){ //提供
|
|
|
|
console.log('mounted执行了')
|
|
|
|
// return {
|
|
|
|
},
|
|
|
|
// reload: this.reloadModel
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// },
|
|
|
|
|
|
|
|
// inject: ['reload'],
|
|
|
|
|
|
|
|
// mounted() {
|
|
|
|
|
|
|
|
// console.log('mounted执行了')
|
|
|
|
|
|
|
|
// },
|
|
|
|
methods: {
|
|
|
|
methods: {
|
|
|
|
pauseEvent(e){
|
|
|
|
// reloadModel(){
|
|
|
|
if(e.stopPropagation) e.stopPropagation();
|
|
|
|
// this.isRouter = false
|
|
|
|
if(e.preventDefault) e.preventDefault();
|
|
|
|
// this.$nextTick( function () {
|
|
|
|
e.cancelBubble=true;
|
|
|
|
// this.isRouter = true
|
|
|
|
e.returnValue=false;
|
|
|
|
// console.log(this.mdata)
|
|
|
|
return false;
|
|
|
|
// this.player= this.player.destroy()
|
|
|
|
|
|
|
|
// this.request(this.mdata)
|
|
|
|
|
|
|
|
// })
|
|
|
|
|
|
|
|
// },
|
|
|
|
|
|
|
|
handleCancel() {
|
|
|
|
|
|
|
|
console.log('Clicked cancel button');
|
|
|
|
|
|
|
|
console.log(this.title);
|
|
|
|
|
|
|
|
location.reload();
|
|
|
|
|
|
|
|
const that=this
|
|
|
|
|
|
|
|
setTimeout(function () {
|
|
|
|
|
|
|
|
that.$emit('close',false,{})
|
|
|
|
|
|
|
|
},500)
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
request(data){
|
|
|
|
|
|
|
|
const that=this
|
|
|
|
|
|
|
|
this.$api.httpApi.getChannel({
|
|
|
|
|
|
|
|
data:{
|
|
|
|
|
|
|
|
"sourceUrl":data.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,
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
return that.player=player
|
|
|
|
|
|
|
|
}).catch(err => {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
},
|
|
|
|
},
|
|
|
|
zoomDecStart(){
|
|
|
|
zoomDecStart(){
|
|
|
|
console.log('变倍-按下')
|
|
|
|
console.log('变倍-按下')
|
|
|
|
@ -451,15 +474,6 @@ export default {
|
|
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
})
|
|
|
|
},
|
|
|
|
},
|
|
|
|
handleCancel() {
|
|
|
|
|
|
|
|
console.log('Clicked cancel button');
|
|
|
|
|
|
|
|
console.log(this.title);
|
|
|
|
|
|
|
|
location.reload();
|
|
|
|
|
|
|
|
setTimeout(function () {
|
|
|
|
|
|
|
|
this.$emit('close',false,{})
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
</script>
|
|
|
|
|