聊天室

This commit is contained in:
2023-12-10 23:59:03 +08:00
parent e1e98de4b2
commit 7dc111e89d

View File

@@ -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&params1=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&params1=closeCamara"
}else {
console.log("发送打开摄像头通知")
location.href = "uniwebview://action?function=callRoomFuns&params1=openCamara"
}
if(this.constraints.audio==false){
console.log("发送关闭麦克风通知")
location.href = "uniwebview://action?function=callRoomFuns&params1=closeVoice"
}else {
console.log("发送打开麦克风通知")
location.href = "uniwebview://action?function=callRoomFuns&params1=openVoice"
}
return false;
}
if (_this.publishSdk) {
_this.publishSdk.close();