diff --git a/public/antd_color.less b/public/antd_color.less index bdf6854..37c86c8 100644 --- a/public/antd_color.less +++ b/public/antd_color.less @@ -1389,13 +1389,13 @@ tr.ant-table-expanded-row:hover {background: #fbfbfb;} .ant-tag-gold-inverse {color: #fff;background: #faad14;border-color: #faad14;} .ant-tag-cyan {color: #13c2c2;background: #e6fffb;border-color: #87e8de;} .ant-tag-cyan-inverse {color: #fff;background: #13c2c2;border-color: #13c2c2;} -.ant-tag-lime {color: #a0d911;background: color(~`colorPalette("@{text-color}", 1)`);border-color: #eaff8f;} +.ant-tag-lime {color: #a0d911;background: #fcffe6;border-color: #eaff8f;} .ant-tag-lime-inverse {color: #fff;background: #a0d911;border-color: #a0d911;} .ant-tag-green {color: #52c41a;background: #f6ffed;border-color: #b7eb8f;} .ant-tag-green-inverse {color: #fff;background: #52c41a;border-color: #52c41a;} .ant-tag-blue {color: #1890ff;background: #e6f7ff;border-color: #91d5ff;} .ant-tag-blue-inverse {color: #fff;background: #1890ff;border-color: #1890ff;} -.ant-tag-geekblue {color: #2f54eb;background: #f0f5ff;border-color: #adc6ff;} +.ant-tag-geekblue {color: #2f54eb;background: color(~`colorPalette("@{text-color-secondary}", 3)`);border-color: #adc6ff;} .ant-tag-geekblue-inverse {color: #fff;background: #2f54eb;border-color: #2f54eb;} .ant-tag-purple {color: #722ed1;background: #f9f0ff;border-color: #d3adf7;} .ant-tag-purple-inverse {color: #fff;background: #722ed1;border-color: #722ed1;} diff --git a/public/index.html b/public/index.html index b0c00e3..fea4a11 100644 --- a/public/index.html +++ b/public/index.html @@ -11,7 +11,6 @@ - 垛机视觉系统 @@ -20,6 +19,7 @@ We're sorry but 垛机视觉系统 doesn't work properly without JavaScript enabled. Please enable it to continue. +
diff --git a/public/video_play_plugins/webrtcplayer.js b/public/video_play_plugins/webrtcplayer.js deleted file mode 100644 index f5282c8..0000000 --- a/public/video_play_plugins/webrtcplayer.js +++ /dev/null @@ -1,121 +0,0 @@ -class WebRtcPlayer { - static server = '127.0.0.1:8083'; - webrtc = null; - video = null; - server = null; - codecLink = null; - rsdpLink = null; - stream = new MediaStream(); - uuid = null; - options={ - onStatusChange:null - }; - - constructor(id, uuid, options={}) { - this.server = WebRtcPlayer.server; - this.video = document.getElementById(id); - this.uuid = uuid; - Object.assign(this.options, options); - this.createLinks(); - this.play(); - } - - createLinks() { - this.codecLink = "//" + this.server + "/stream/codec/" + this.uuid - this.rsdpLink = "//" + this.server + "/stream/receiver/" + this.uuid - } - - play() { - this.webrtc = new RTCPeerConnection({ - iceServers: [{ - urls: ["stun:stun.l.google.com:19302"] - }] - }); - if(this.webrtc){ - - }else{ - console.log("no") - } - this.webrtc.onnegotiationneeded = this.handleNegotiationNeeded.bind(this); - this.webrtc.ontrack = this.onTrack.bind(this); - fetch(this.codecLink) - .then((response) => { - response.json().then((data) => { - data.forEach((item, i) => { - this.webrtc.addTransceiver(item.Type, { - 'direction': 'sendrecv' - }); - }); - }); - }) - .catch((error) => { - console.log(error); - }); - - this.webrtc.onconnectionstatechange = () => { - if(this.webrtc.connectionState == 'connected' || this.webrtc.connectionState == 'connecting'){ - - }else{ - console.log(this.webrtc.connectionState) - this.load(this.uuid); - } - - } - } - - async handleNegotiationNeeded() { - let offer = await this.webrtc.createOffer(); - await this.webrtc.setLocalDescription(offer); - let formData = new FormData(); - formData.append('suuid', this.uuid); - formData.append('data', btoa(this.webrtc.localDescription.sdp)); - fetch(this.rsdpLink, { - method: 'POST', - body: formData - }) - .then((response) => { - response.text().then((data) => { - this.webrtc.setRemoteDescription(new RTCSessionDescription({ - type: 'answer', - sdp: atob(data) - })) - }); - }) - .catch((err) => {}) - } - - onTrack(event) { - this.stream.addTrack(event.track); - this.video.srcObject = this.stream; - this.video.play(); - } - - load(uuid) { - this.destroy(); - this.uuid = uuid; - this.createLinks(); - this.play(); - } - - destroy() { - - this.webrtc.close(); - this.webrtc = null; - this.video.srcObject = null; - this.stream = new MediaStream(); - } - - getImageUrl() { - let canvas = document.createElement("canvas"); - canvas.width = this.video.videoWidth; - canvas.height = this.video.videoHeight; - canvas.getContext('2d').drawImage(video, 0, 0, canvas.width, canvas.height); - let dataURL = canvas.toDataURL(); - canvas.remove(); - return dataURL; - } - - static setServer(serv) { - this.server = serv; - } -} diff --git a/src/api/http/http-api.js b/src/api/http/http-api.js index 261f7b7..90fc9e3 100644 --- a/src/api/http/http-api.js +++ b/src/api/http/http-api.js @@ -45,6 +45,11 @@ export default { url: "/camera/page", name: "获取球机列表" }, + getVideoServer:{ + method: "GET", + url: "/realTime/videoServer", + name: "获取视频服务器" + }, addCamera: { method: "POST", url: "/camera", diff --git a/src/views/realTimeMonitoring/index.vue b/src/views/realTimeMonitoring/index.vue index 3cbb0e4..4420b16 100644 --- a/src/views/realTimeMonitoring/index.vue +++ b/src/views/realTimeMonitoring/index.vue @@ -1,6 +1,6 @@