球机配置页面视频

merge-requests/1/head
qiushui 4 years ago
parent a365a4f9a4
commit 8cfddc29c9

Binary file not shown.

@ -30,7 +30,13 @@
</template> </template>
<template v-else-if="type=='test'"> <template v-else-if="type=='test'">
<div class="test-model"> <div class="test-model">
<object id="video-test" type='application/x-vlc-plugin' events='True' width="100%" <video
width="80%"
height="80%"
:id="`camera${id}`"
autoplay controls muted ></video>
<!-- <object id="video-test" type='application/x-vlc-plugin' events='True' width="100%"
height="100%" pluginspage="http://www.videolan.org" height="100%" pluginspage="http://www.videolan.org"
codebase="http://downloads.videolan.org/pub/videolan/vlc-webplugins/2.0.6/npapi-vlc-2.0.6.tar.xz"> codebase="http://downloads.videolan.org/pub/videolan/vlc-webplugins/2.0.6/npapi-vlc-2.0.6.tar.xz">
<param name='controls' value='false'/> <param name='controls' value='false'/>
@ -41,7 +47,7 @@
</object> </object>
<div class="video-close" @click="handleCancel"> <div class="video-close" @click="handleCancel">
</div> </div> -->
<div class="operation-list"> <div class="operation-list">
<div class="operation-item"> <div class="operation-item">
<img :src="zoomSubUrl" alt="" @mousedown="zoomDecStart" <img :src="zoomSubUrl" alt="" @mousedown="zoomDecStart"
@ -91,16 +97,11 @@
:centered="true" :centered="true"
class="config-model" class="config-model"
> >
<object id="video-config" type='application/x-vlc-plugin' events='True' width="800"
height="450" pluginspage="http://www.videolan.org" <video width="900"
codebase="http://downloads.videolan.org/pub/videolan/vlc-webplugins/2.0.6/npapi-vlc-2.0.6.tar.xz"> height="600"
<param name='controls' value='false'/> :id="`camera${id}`"
<param name='text' value='正在加载视频中...'/> autoplay controls muted ></video>
<param name='branding' value='false'/>
<param name="windowless" value="true">
<param name='fullscreen' value='false'/>
<embed type="application/x-google-vlc-plugin"/>
</object>
<div class="operation-list"> <div class="operation-list">
<div class="operation-item"> <div class="operation-item">
<img :src="zoomSubUrl" alt="" @mousedown="zoomDecStart" <img :src="zoomSubUrl" alt="" @mousedown="zoomDecStart"
@ -230,6 +231,7 @@ const columns = [
scopedSlots: { customRender: 'position' } scopedSlots: { customRender: 'position' }
} }
]; ];
import WebRtcPlayer from ".././realTimeMonitoring/webrtcplayer"
export default { export default {
props:[ 'visible', 'modelType', 'modelData'], props:[ 'visible', 'modelType', 'modelData'],
watch: { watch: {
@ -254,6 +256,7 @@ export default {
ip:newVal.ip, ip:newVal.ip,
rtsp:newVal.rtsp rtsp:newVal.rtsp
}) })
}) })
}else if (newVal.id && this.type=='config'){ }else if (newVal.id && this.type=='config'){
this.id = newVal.id this.id = newVal.id
@ -261,7 +264,7 @@ export default {
console.log(newVal) console.log(newVal)
this.$nextTick(()=>{ //this.$nextTick this.$nextTick(()=>{ //this.$nextTick
console.log(newVal.rtsp) console.log(newVal.rtsp)
this.getConfigVideo(newVal.rtsp) //this.getConfigVideo(newVal.rtsp)
this.getConfigIoList() this.getConfigIoList()
}) })
} }
@ -301,19 +304,26 @@ export default {
}, },
mounted() { mounted() {
console.log('mounted执行了') console.log('mounted执行了')
this.setVideoServer()
if (this.$route.query.modelType == 'test') { if (this.$route.query.modelType == 'test') {
this.isShow = true this.isShow = true
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.getTestVideo(this.$route.query.modelData.rtsp)
this.$nextTick(() => {
this.autoPlay(this.id)
})
} else if (this.$route.query.modelType == 'config') { } else if (this.$route.query.modelType == 'config') {
this.isShow = true this.isShow = true
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.getConfigVideo(this.$route.query.modelData.rtsp)
this.getConfigIoList() this.getConfigIoList()
this.$nextTick(() => {
this.autoPlay(this.id)
})
} }
}, },
methods: { methods: {
@ -367,20 +377,21 @@ export default {
vlc.playlist.items.clear() vlc.playlist.items.clear()
} }
}, },
getTestVideo(rtsp){ autoPlay(id){
this.$nextTick(() => { let video = document.getElementById('camera'+id);
var vlc = document.getElementById('video-test'); let player = new WebRtcPlayer(video,'camera'+id);
var options = new Array(":network-caching=100");// player.load('camera'+id);
var vlcItem = vlc.playlist.add(`${rtsp}`, "vedio", options);
vlc.playlist.playItem(vlcItem);
})
}, },
getConfigVideo(rtsp){ setVideoServer(){
this.$nextTick(() => { this.$api.httpApi.getVideoServer({
var vlc = document.getElementById('video-config'); data: {}
var options = new Array(":network-caching=100");// }).then(res => {
var vlcItem = vlc.playlist.add(`${rtsp}`, "vedio", options); if(res.code == 200) {
vlc.playlist.playItem(vlcItem); WebRtcPlayer.setServer(res.data.toString());
}
}).catch(err => {
console.log(err)
}) })
}, },
getConfigIoList(){ getConfigIoList(){

Loading…
Cancel
Save