|
|
|
|
@ -25,6 +25,11 @@
|
|
|
|
|
v-decorator="['ip', { rules: [{ required: true, message: '请输入球机ip!' }] }]"
|
|
|
|
|
/>
|
|
|
|
|
</a-form-item>
|
|
|
|
|
<a-form-item label="视频流IP" :label-col="formItemVerticalLayout.labelCol">
|
|
|
|
|
<a-input
|
|
|
|
|
v-decorator="['rtcServer']"
|
|
|
|
|
/>
|
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-form>
|
|
|
|
|
</a-modal>
|
|
|
|
|
</template>
|
|
|
|
|
@ -220,15 +225,15 @@ export default {
|
|
|
|
|
this.form.setFieldsValue({ //setFieldsValue 表示对form表单重新设置值
|
|
|
|
|
name:newVal.name,
|
|
|
|
|
ip:newVal.ip,
|
|
|
|
|
rtsp:newVal.rtsp
|
|
|
|
|
rtsp:newVal.rtsp,
|
|
|
|
|
rtcServer:newVal.rtcServer,
|
|
|
|
|
rtcServerPort:newVal.rtcServerPort
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
}else if (newVal.id && this.type=='config'){
|
|
|
|
|
this.id = newVal.id
|
|
|
|
|
this.mdata = newVal
|
|
|
|
|
console.log(newVal)
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
@ -290,7 +295,10 @@ export default {
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
destroy(){
|
|
|
|
|
//this.player.destroy()
|
|
|
|
|
if(this.player != null){
|
|
|
|
|
this.player.destroy()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
handleOk() {
|
|
|
|
|
@ -346,7 +354,9 @@ export default {
|
|
|
|
|
autoPlay(id){
|
|
|
|
|
let video = document.getElementById('config-camera'+id);
|
|
|
|
|
if(video){
|
|
|
|
|
let player = new WebRtcPlayer(video,'camera'+id);
|
|
|
|
|
let server = this.mdata.rtcServer+":"+this.mdata.rtcServerPort
|
|
|
|
|
console.log("server:"+server)
|
|
|
|
|
let player = new WebRtcPlayer(server,video,'camera'+id);
|
|
|
|
|
console.log("okkkkkk")
|
|
|
|
|
//player.load('camera'+id);
|
|
|
|
|
this.player = player
|
|
|
|
|
@ -358,9 +368,7 @@ export default {
|
|
|
|
|
this.$api.httpApi.getVideoServer({
|
|
|
|
|
data: {}
|
|
|
|
|
}).then(res => {
|
|
|
|
|
if(res.code == 200) {
|
|
|
|
|
WebRtcPlayer.setServer(res.data.toString());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}).catch(err => {
|
|
|
|
|
console.log(err)
|
|
|
|
|
|