|
|
|
@ -26,7 +26,7 @@
|
|
|
|
:url="i.rtsp"
|
|
|
|
:url="i.rtsp"
|
|
|
|
autostart
|
|
|
|
autostart
|
|
|
|
avsync
|
|
|
|
avsync
|
|
|
|
nmf-src="video_play_plugins/pnacl/Release/media_player.nmf"
|
|
|
|
nmf-src="/video_play_plugins/pnacl/Release/media_player.nmf"
|
|
|
|
nmf-path="media_player.nmf"
|
|
|
|
nmf-path="media_player.nmf"
|
|
|
|
width="390" height="219"
|
|
|
|
width="390" height="219"
|
|
|
|
latency="0"
|
|
|
|
latency="0"
|
|
|
|
@ -69,7 +69,6 @@ export default {
|
|
|
|
data() {
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
return {
|
|
|
|
// 收起true 展开false
|
|
|
|
// 收起true 展开false
|
|
|
|
videoWarpShow:true,
|
|
|
|
|
|
|
|
controlLabel: true,
|
|
|
|
controlLabel: true,
|
|
|
|
realTimeListData:[],
|
|
|
|
realTimeListData:[],
|
|
|
|
url:"722e6f04-bb3c-34b1-bcc7-ae9f6cd72e68",
|
|
|
|
url:"722e6f04-bb3c-34b1-bcc7-ae9f6cd72e68",
|
|
|
|
@ -82,60 +81,18 @@ export default {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
inject: ['reload'],
|
|
|
|
inject: ['reload'],
|
|
|
|
mounted() {
|
|
|
|
mounted() {
|
|
|
|
this.getRealTimeList()
|
|
|
|
|
|
|
|
console.log('index mounted执行了')
|
|
|
|
console.log('index mounted执行了')
|
|
|
|
|
|
|
|
this.getRealTimeList()
|
|
|
|
// this.getSdVideos()
|
|
|
|
// this.getSdVideos()
|
|
|
|
// this.playVideo()
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
destroyed(){
|
|
|
|
destroyed(){
|
|
|
|
console.log('2222222')
|
|
|
|
console.log('2222222')
|
|
|
|
// this.player.destroy()
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
methods: {
|
|
|
|
// 展开收起
|
|
|
|
// 展开收起
|
|
|
|
// handleUpDown() {
|
|
|
|
// handleUpDown() {
|
|
|
|
// this.controlLabel = !this.controlLabel;
|
|
|
|
// this.controlLabel = !this.controlLabel;
|
|
|
|
// },
|
|
|
|
// },
|
|
|
|
// getSdVideos(channel,id,that){
|
|
|
|
|
|
|
|
// console.log('首页getSdVideos方法执行了')
|
|
|
|
|
|
|
|
// var url = 'ws://192.168.66.56:9007/api/lychee/stream/live/'+channel
|
|
|
|
|
|
|
|
// // var url = 'ws://127.0.0.1:9007/api/lychee/stream/live/'+ channel
|
|
|
|
|
|
|
|
// var player = new JSMpeg.Player(url, {
|
|
|
|
|
|
|
|
// canvas: document.querySelector('.video'+id),
|
|
|
|
|
|
|
|
// audio: false,
|
|
|
|
|
|
|
|
// pauseWhenHidden: false,
|
|
|
|
|
|
|
|
// videoBufferSize: 16 * 1024 * 1024,
|
|
|
|
|
|
|
|
// loop:false,
|
|
|
|
|
|
|
|
// onPlay: function() {
|
|
|
|
|
|
|
|
// //开始播放事件回调
|
|
|
|
|
|
|
|
// console.log('play')
|
|
|
|
|
|
|
|
// },
|
|
|
|
|
|
|
|
// onEnded: function() {
|
|
|
|
|
|
|
|
// //播放完成事件回调
|
|
|
|
|
|
|
|
// console.log('end')
|
|
|
|
|
|
|
|
// },
|
|
|
|
|
|
|
|
// onPause:function(){
|
|
|
|
|
|
|
|
// //暂停时的回调
|
|
|
|
|
|
|
|
// console.log('pause')
|
|
|
|
|
|
|
|
// },
|
|
|
|
|
|
|
|
// onVideoDecode:function(){
|
|
|
|
|
|
|
|
// //–在每个解码和渲染的视频帧之后调用的回调
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// })
|
|
|
|
|
|
|
|
// player.play()
|
|
|
|
|
|
|
|
// return that.player=player
|
|
|
|
|
|
|
|
// },
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
playVideo(id,rtsp){
|
|
|
|
|
|
|
|
this.videoWarpShow = true;
|
|
|
|
|
|
|
|
// 设置url 播放 ---添加到事件队列在下一个tick执行,避免 TypeError: t.module.postMessage is not a function
|
|
|
|
|
|
|
|
this.$nextTick(() => {
|
|
|
|
|
|
|
|
// window.vxgplayer('vxg_media_player1').stop();
|
|
|
|
|
|
|
|
window.vxgplayer(id).src(rtsp);
|
|
|
|
|
|
|
|
window.vxgplayer(id).play();
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
getRealTimeList(){
|
|
|
|
getRealTimeList(){
|
|
|
|
var that=this
|
|
|
|
var that=this
|
|
|
|
this.$api.httpApi.getRealTimeList({
|
|
|
|
this.$api.httpApi.getRealTimeList({
|
|
|
|
@ -153,20 +110,6 @@ export default {
|
|
|
|
// console.log(item.rtsp)
|
|
|
|
// console.log(item.rtsp)
|
|
|
|
console.log('进来第二层循环了')
|
|
|
|
console.log('进来第二层循环了')
|
|
|
|
$that.playVideo('video'+item.id,item.rtsp)
|
|
|
|
$that.playVideo('video'+item.id,item.rtsp)
|
|
|
|
// $that.$api.httpApi.getChannel({
|
|
|
|
|
|
|
|
// data: {
|
|
|
|
|
|
|
|
// "clarity": "SD", //标清SD
|
|
|
|
|
|
|
|
// "sourceUrl": item.rtsp,
|
|
|
|
|
|
|
|
// "paramBefore": "-y -i",
|
|
|
|
|
|
|
|
// "paramBehind": "-f mpegts -codec:v mpeg1video -an -s 400*225 -b:v 500k -r 20 -bf 0 -codec:a mp2 -ar 44100 -ac 1 -b:a 128k"
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// }).then(res => {
|
|
|
|
|
|
|
|
// console.log(res.data)
|
|
|
|
|
|
|
|
// console.log('首页push调用channel执行了')
|
|
|
|
|
|
|
|
// $that.getSdVideos(res.data.channel, item.id, $that)
|
|
|
|
|
|
|
|
// }).catch(err => {
|
|
|
|
|
|
|
|
// console.log(err)
|
|
|
|
|
|
|
|
// })
|
|
|
|
|
|
|
|
})
|
|
|
|
})
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -174,6 +117,14 @@ export default {
|
|
|
|
console.log(err)
|
|
|
|
console.log(err)
|
|
|
|
})
|
|
|
|
})
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
playVideo(id,rtsp){
|
|
|
|
|
|
|
|
// 设置url 播放 ---添加到事件队列在下一个tick执行,避免 TypeError: t.module.postMessage is not a function
|
|
|
|
|
|
|
|
this.$nextTick(() => {
|
|
|
|
|
|
|
|
// window.vxgplayer('vxg_media_player1').stop();
|
|
|
|
|
|
|
|
window.vxgplayer(id).src(rtsp);
|
|
|
|
|
|
|
|
window.vxgplayer(id).play();
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
},
|
|
|
|
tabsChange(key){
|
|
|
|
tabsChange(key){
|
|
|
|
console.log(key)
|
|
|
|
console.log(key)
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|