From 7dc111e89d0a83e0236746a2526424a1f6789bee Mon Sep 17 00:00:00 2001 From: luojie Date: Sun, 10 Dec 2023 23:59:03 +0800 Subject: [PATCH] =?UTF-8?q?=E8=81=8A=E5=A4=A9=E5=AE=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hd-glasses-app/src/pages/call_room.vue | 32 ++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/hd-glasses-app/src/pages/call_room.vue b/hd-glasses-app/src/pages/call_room.vue index 64c9004..42dcd7a 100644 --- a/hd-glasses-app/src/pages/call_room.vue +++ b/hd-glasses-app/src/pages/call_room.vue @@ -120,6 +120,11 @@ export default { this.client = getUrlParam("client"); + let hd_gps_location = localStorage.getItem("hd_gps_location") + if (hd_gps_location) { + this.client="app" + } + this.voiceImg = getStatisFileUrl("/media/voice_open.png") this.cameraImg = getStatisFileUrl("/media/camera_open.png") this.switchCameraImg = getStatisFileUrl("/media/switch.png") @@ -284,6 +289,13 @@ export default { this.beginPublish() }, switchCamera() { + if(this.client="app"){ + location.href = "uniwebview://action?function=callRoomFuns¶ms1=switchCamara" + console.log("发送切换摄像头通知") + return false; + } + + let self = this; self.cameraIndex = self.cameraIndex + 1 == self.cameraDevices.length ? 0 : self.cameraIndex + 1 let deviceId = { @@ -317,6 +329,8 @@ export default { console.log('navigator.getUserMedia error: ', error); }, beginPublish() { + + let _this = this; //http://localhost:8080/hd-glasses-app/#/call_room?isPublish=1&isPlayer=1&uid=123&room=call_room @@ -328,6 +342,24 @@ export default { navigator.mediaDevices.enumerateDevices().then(this.gotDevices).catch(this.handleError); + if(this.client=="app"){ + if(this.constraints.video==false){ + console.log("发送关闭摄像头通知") + location.href = "uniwebview://action?function=callRoomFuns¶ms1=closeCamara" + }else { + console.log("发送打开摄像头通知") + location.href = "uniwebview://action?function=callRoomFuns¶ms1=openCamara" + } + if(this.constraints.audio==false){ + console.log("发送关闭麦克风通知") + location.href = "uniwebview://action?function=callRoomFuns¶ms1=closeVoice" + }else { + console.log("发送打开麦克风通知") + location.href = "uniwebview://action?function=callRoomFuns¶ms1=openVoice" + } + return false; + } + if (_this.publishSdk) { _this.publishSdk.close();