|
|
|
@ -10,12 +10,50 @@
|
|
|
|
<!-- </div>-->
|
|
|
|
<!-- </div>-->
|
|
|
|
<!-- </div>-->
|
|
|
|
<!-- </div>-->
|
|
|
|
<!-- </div>-->
|
|
|
|
<!-- </div>-->
|
|
|
|
<div>实时画面:</div>
|
|
|
|
<a-tabs default-active-key="1" slot="headerContent" v-model="tabKey">
|
|
|
|
<canvas id="video-cav" width="400" height="400"></canvas>
|
|
|
|
<a-tab-pane key="0" tab="全部" >
|
|
|
|
|
|
|
|
</a-tab-pane>
|
|
|
|
|
|
|
|
<a-tab-pane :key="index+1" :tab="item.streetName" v-for="(item,index) in realTimeListData">
|
|
|
|
|
|
|
|
</a-tab-pane>
|
|
|
|
|
|
|
|
</a-tabs>
|
|
|
|
|
|
|
|
<div class="flex-layouts">
|
|
|
|
|
|
|
|
<div class="video-list" v-for="(item,index) in realTimeListData" :key="index+1">
|
|
|
|
|
|
|
|
<!-- 对应全部的-->
|
|
|
|
|
|
|
|
<div v-if="tabKey == 0" class="video-item">
|
|
|
|
|
|
|
|
<div class="video-box" width="400" height="300" v-for="i in item.cameras" :key="i.id" @click="showModel(i)">
|
|
|
|
|
|
|
|
<canvas :class="['video',i.id?'video'+i.id:'']">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</canvas>
|
|
|
|
|
|
|
|
<div class="video-name">
|
|
|
|
|
|
|
|
{{item.streetName}} {{i.name}}
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<!--对应各个巷道的-->
|
|
|
|
|
|
|
|
<div v-if="tabKey == index+1" class="video-item">
|
|
|
|
|
|
|
|
<div class="video-box" width="400" height="300" v-for="i in item.cameras" :key="i.id">
|
|
|
|
|
|
|
|
<canvas :class="['video',i.id?'video'+i.id:'']">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</canvas>
|
|
|
|
|
|
|
|
<div class="video-name">
|
|
|
|
|
|
|
|
{{item.streetName}} {{i.name}}
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<!-- <canvas class="video-cav" width="400" height="400"></canvas>-->
|
|
|
|
|
|
|
|
<Model
|
|
|
|
|
|
|
|
:visible.sync="visible"
|
|
|
|
|
|
|
|
:modelData.sync="modelData"
|
|
|
|
|
|
|
|
@sure="submit"
|
|
|
|
|
|
|
|
@close="closeModel"
|
|
|
|
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
<script>
|
|
|
|
|
|
|
|
import Model from "./model.vue"
|
|
|
|
export default {
|
|
|
|
export default {
|
|
|
|
name: "realTimeMonitoring",
|
|
|
|
name: "realTimeMonitoring",
|
|
|
|
data() {
|
|
|
|
data() {
|
|
|
|
@ -23,15 +61,22 @@ export default {
|
|
|
|
// 收起true 展开false
|
|
|
|
// 收起true 展开false
|
|
|
|
controlLabel: true,
|
|
|
|
controlLabel: true,
|
|
|
|
realTimeListData:[],
|
|
|
|
realTimeListData:[],
|
|
|
|
url:'722e6f04-bb3c-34b1-bcc7-ae9f6cd72e68',
|
|
|
|
url:"722e6f04-bb3c-34b1-bcc7-ae9f6cd72e68",
|
|
|
|
path:[]
|
|
|
|
tabKey: "0",
|
|
|
|
|
|
|
|
path:[],
|
|
|
|
|
|
|
|
player:'',
|
|
|
|
|
|
|
|
visible:false,
|
|
|
|
|
|
|
|
modelData:[]
|
|
|
|
};
|
|
|
|
};
|
|
|
|
},
|
|
|
|
},
|
|
|
|
mounted() {
|
|
|
|
mounted() {
|
|
|
|
this.getRealTimeList()
|
|
|
|
this.getRealTimeList()
|
|
|
|
// this.realTimeLychee()
|
|
|
|
|
|
|
|
this.getVideos()
|
|
|
|
this.getVideos()
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
destroyed(){
|
|
|
|
|
|
|
|
console.log('2222222')
|
|
|
|
|
|
|
|
this.player.destroy()
|
|
|
|
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
methods: {
|
|
|
|
// 展开收起
|
|
|
|
// 展开收起
|
|
|
|
handleUpDown() {
|
|
|
|
handleUpDown() {
|
|
|
|
@ -45,34 +90,68 @@ export default {
|
|
|
|
console.log(res.data)
|
|
|
|
console.log(res.data)
|
|
|
|
if(res.code == 200){
|
|
|
|
if(res.code == 200){
|
|
|
|
this.realTimeListData = res.data
|
|
|
|
this.realTimeListData = res.data
|
|
|
|
res.data.map(function(item){
|
|
|
|
res.data.forEach(function(item){
|
|
|
|
// console.log(item.cameras)
|
|
|
|
// console.log(item.cameras)
|
|
|
|
var $that = that
|
|
|
|
var $that = that
|
|
|
|
item.cameras.map(function(item){
|
|
|
|
item.cameras.forEach(function(item){
|
|
|
|
console.log(item.rtsp)
|
|
|
|
// console.log(item.rtsp)
|
|
|
|
$that.$axios.post('/lychee/stream/push', {
|
|
|
|
$that.$api.httpApi.getChannel({
|
|
|
|
|
|
|
|
data:{
|
|
|
|
"sourceUrl":item.rtsp,
|
|
|
|
"sourceUrl":item.rtsp,
|
|
|
|
"paramBefore": "-i",
|
|
|
|
"paramBefore": "-y -i",
|
|
|
|
"paramBehind": "-f mpegts -codec:v mpeg1video -s 1080*780 -b:v 1500k -r 30 -bf 0 -codec:a mp2 -ar 44100 -ac 1 -b:a 128k"
|
|
|
|
"paramBehind": "-f mpegts -codec:v mpeg1video -an -s 720*480 -b:v 500k -r 20 -bf 0 -codec:a mp2 -ar 44100 -ac 1 -b:a 128k"
|
|
|
|
|
|
|
|
}
|
|
|
|
}).then(res => {
|
|
|
|
}).then(res => {
|
|
|
|
console.log(res.data)
|
|
|
|
console.log(res.data)
|
|
|
|
console.log(this.path)
|
|
|
|
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'+item.id),
|
|
|
|
|
|
|
|
audio: false,
|
|
|
|
|
|
|
|
pauseWhenHidden: false,
|
|
|
|
|
|
|
|
videoBufferSize: 8 * 1024 * 1024,
|
|
|
|
|
|
|
|
loop:false,
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
player.play()
|
|
|
|
|
|
|
|
return $that.player=player
|
|
|
|
}).catch(err => {
|
|
|
|
}).catch(err => {
|
|
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
})
|
|
|
|
})
|
|
|
|
})
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
console.log(this.path)
|
|
|
|
console.log(this.realTimeListData)
|
|
|
|
}).catch(err => {
|
|
|
|
}).catch(err => {
|
|
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
getVideos(){
|
|
|
|
getVideos(){
|
|
|
|
var canvas = document.getElementById('video-cav')
|
|
|
|
// var canvas = document.querySelector('.video-cav')
|
|
|
|
var url = 'ws://192.168.66.56:9007/api/lychee/stream/live/'+this.url
|
|
|
|
// var url = 'ws://192.168.66.56:9007/api/lychee/stream/live/'+this.url
|
|
|
|
var player = new JSMpeg.Player(url, {canvas: canvas}) // eslint-disable-line no-unused-vars
|
|
|
|
// var player = new JSMpeg.Player(url, {
|
|
|
|
}
|
|
|
|
// canvas: canvas,
|
|
|
|
|
|
|
|
// audio: false,
|
|
|
|
|
|
|
|
// pauseWhenHidden: false,
|
|
|
|
|
|
|
|
// videoBufferSize: 8 * 1024 * 1024,
|
|
|
|
|
|
|
|
// loop:false
|
|
|
|
|
|
|
|
// })
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
showModel(item){
|
|
|
|
|
|
|
|
console.log(11111)
|
|
|
|
|
|
|
|
// this.player.destroy()
|
|
|
|
|
|
|
|
console.log(item)
|
|
|
|
|
|
|
|
this.visible = true
|
|
|
|
|
|
|
|
// this.$router.push({path: '/realTimeMonitoring/model', query: {id: "2"}});
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
submit(visible){
|
|
|
|
|
|
|
|
this.visible = visible
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
closeModel(visible,data){
|
|
|
|
|
|
|
|
this.visible = visible
|
|
|
|
|
|
|
|
this.modelData=data
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
components:{
|
|
|
|
|
|
|
|
Model
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
</script>
|
|
|
|
@ -115,5 +194,35 @@ export default {
|
|
|
|
width: 400px;
|
|
|
|
width: 400px;
|
|
|
|
height: 400px;
|
|
|
|
height: 400px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.flex-layouts{
|
|
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
|
|
width: 1650px;
|
|
|
|
|
|
|
|
flex-wrap: wrap;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
.video-list{
|
|
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
|
|
.video-item{
|
|
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
|
|
width: 100%;
|
|
|
|
|
|
|
|
.video-box{
|
|
|
|
|
|
|
|
position: relative;
|
|
|
|
|
|
|
|
margin: 3px;
|
|
|
|
|
|
|
|
.video-name{
|
|
|
|
|
|
|
|
position: absolute;
|
|
|
|
|
|
|
|
top: 10px;
|
|
|
|
|
|
|
|
left: 10px;
|
|
|
|
|
|
|
|
color: #ffda62;
|
|
|
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
|
|
|
font-size: 17px;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
.video{
|
|
|
|
|
|
|
|
border: solid 1px #000000;
|
|
|
|
|
|
|
|
background: #001529;
|
|
|
|
|
|
|
|
width: 400px;
|
|
|
|
|
|
|
|
height: 300px;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|
|
|
|
</style>
|
|
|
|
|