From 6dc6e3d7d42c5e2d71b91d48fbbc053eaff5ce6e Mon Sep 17 00:00:00 2001 From: yiming Date: Fri, 1 Apr 2022 11:10:56 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=86=E9=A2=91=E6=B5=81=E5=A4=9A=E6=9C=8D?= =?UTF-8?q?=E5=8A=A1=E5=99=A8=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/antd_color.less | 4 ++-- public/static/webrtcplayer.js | 9 +++------ src/views/cameraManage/index.vue | 4 ++++ src/views/cameraManage/model.vue | 24 ++++++++++++++++-------- src/views/realTimeMonitoring/index.vue | 3 ++- src/views/roadwayManage/index.vue | 1 - src/views/videoWall/index.vue | 3 ++- 7 files changed, 29 insertions(+), 19 deletions(-) diff --git a/public/antd_color.less b/public/antd_color.less index b746b9c..3f31489 100644 --- a/public/antd_color.less +++ b/public/antd_color.less @@ -30,7 +30,7 @@ button::-moz-focus-inner, [type='submit']::-moz-focus-inner {border-style: none;} fieldset {border: 0;} legend {color: inherit;} -mark {background-color: #feffe6;} +mark {background-color: color(~`colorPalette("@{heading-color}", 1)`);} ::selection {color: #fff;background: @primary-color;} .anticon {color: inherit;} html {--antd-wave-shadow-color: @primary-color;} @@ -1383,7 +1383,7 @@ tr.ant-table-expanded-row:hover {background: #fbfbfb;} .ant-tag-volcano-inverse {color: #fff;background: #fa541c;border-color: #fa541c;} .ant-tag-orange {color: #fa8c16;background: #fff7e6;border-color: #ffd591;} .ant-tag-orange-inverse {color: #fff;background: #fa8c16;border-color: #fa8c16;} -.ant-tag-yellow {color: #fadb14;background: #feffe6;border-color: #fffb8f;} +.ant-tag-yellow {color: #fadb14;background: color(~`colorPalette("@{heading-color}", 1)`);border-color: #fffb8f;} .ant-tag-yellow-inverse {color: #fff;background: #fadb14;border-color: #fadb14;} .ant-tag-gold {color: #faad14;background: #fffbe6;border-color: #ffe58f;} .ant-tag-gold-inverse {color: #fff;background: #faad14;border-color: #faad14;} diff --git a/public/static/webrtcplayer.js b/public/static/webrtcplayer.js index 1dacb19..adaf195 100644 --- a/public/static/webrtcplayer.js +++ b/public/static/webrtcplayer.js @@ -1,5 +1,5 @@ class WebRtcPlayer { - static server = '127.0.0.1:8083'; + webrtc = null; video = null; server = null; @@ -11,9 +11,9 @@ class WebRtcPlayer { onStatusChange:null }; - constructor(video1, uuid, options={}) { + constructor(server,video1, uuid, options={}) { console.log("new uuid:"+uuid) - this.server = WebRtcPlayer.server; + this.server = server; //this.video = document.getElementById(id); this.video = video1 this.uuid = uuid; @@ -116,8 +116,5 @@ class WebRtcPlayer { return dataURL; } - static setServer(serv) { - this.server = serv; - } } export default WebRtcPlayer; diff --git a/src/views/cameraManage/index.vue b/src/views/cameraManage/index.vue index 5607762..9133c3b 100644 --- a/src/views/cameraManage/index.vue +++ b/src/views/cameraManage/index.vue @@ -62,6 +62,10 @@ const columns = [ title: '球机IP', dataIndex: 'ip', }, + { + title: '视频流IP', + dataIndex: 'rtcServer', + }, { title: '修改时间', dataIndex: 'updateTime', diff --git a/src/views/cameraManage/model.vue b/src/views/cameraManage/model.vue index 2fa558c..3096e12 100644 --- a/src/views/cameraManage/model.vue +++ b/src/views/cameraManage/model.vue @@ -25,6 +25,11 @@ v-decorator="['ip', { rules: [{ required: true, message: '请输入球机ip!' }] }]" /> + + + @@ -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) diff --git a/src/views/realTimeMonitoring/index.vue b/src/views/realTimeMonitoring/index.vue index 6242f84..edbfc06 100644 --- a/src/views/realTimeMonitoring/index.vue +++ b/src/views/realTimeMonitoring/index.vue @@ -114,7 +114,8 @@ export default { let video = document.getElementById('camera'+b.id); if(video){ console.log("play:"+b.id) - let player = new WebRtcPlayer(video,'camera'+b.id); + let server = b.rtcServer+":"+b.rtcServerPort; + let player = new WebRtcPlayer(server,video,'camera'+b.id); //player.play('camera'+b.id); this.players.push(player) } diff --git a/src/views/roadwayManage/index.vue b/src/views/roadwayManage/index.vue index 6afb54e..71ed5d6 100644 --- a/src/views/roadwayManage/index.vue +++ b/src/views/roadwayManage/index.vue @@ -215,7 +215,6 @@ export default { cancelText: '取消', }); } - }, openLight(){ diff --git a/src/views/videoWall/index.vue b/src/views/videoWall/index.vue index 3b261ac..e3a83b5 100644 --- a/src/views/videoWall/index.vue +++ b/src/views/videoWall/index.vue @@ -113,8 +113,9 @@ export default { } let idName = rowIndex + "-" + columnIndex; console.log("idName:"+idName); + let server = cameras[i-1].rtcServer+":"+ cameras[i-1].rtcServerPort let video = document.getElementById(idName); - let player = new WebRtcPlayer(video,"camera"+cameras[i-1].id); + let player = new WebRtcPlayer(server,video,"camera"+cameras[i-1].id); this.players.push(player); } }