聊天室
This commit is contained in:
@@ -120,6 +120,11 @@ export default {
|
|||||||
this.client = getUrlParam("client");
|
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.voiceImg = getStatisFileUrl("/media/voice_open.png")
|
||||||
this.cameraImg = getStatisFileUrl("/media/camera_open.png")
|
this.cameraImg = getStatisFileUrl("/media/camera_open.png")
|
||||||
this.switchCameraImg = getStatisFileUrl("/media/switch.png")
|
this.switchCameraImg = getStatisFileUrl("/media/switch.png")
|
||||||
@@ -284,6 +289,13 @@ export default {
|
|||||||
this.beginPublish()
|
this.beginPublish()
|
||||||
},
|
},
|
||||||
switchCamera() {
|
switchCamera() {
|
||||||
|
if(this.client="app"){
|
||||||
|
location.href = "uniwebview://action?function=callRoomFuns¶ms1=switchCamara"
|
||||||
|
console.log("发送切换摄像头通知")
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
let self = this;
|
let self = this;
|
||||||
self.cameraIndex = self.cameraIndex + 1 == self.cameraDevices.length ? 0 : self.cameraIndex + 1
|
self.cameraIndex = self.cameraIndex + 1 == self.cameraDevices.length ? 0 : self.cameraIndex + 1
|
||||||
let deviceId = {
|
let deviceId = {
|
||||||
@@ -317,6 +329,8 @@ export default {
|
|||||||
console.log('navigator.getUserMedia error: ', error);
|
console.log('navigator.getUserMedia error: ', error);
|
||||||
},
|
},
|
||||||
beginPublish() {
|
beginPublish() {
|
||||||
|
|
||||||
|
|
||||||
let _this = this;
|
let _this = this;
|
||||||
//http://localhost:8080/hd-glasses-app/#/call_room?isPublish=1&isPlayer=1&uid=123&room=call_room
|
//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);
|
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) {
|
if (_this.publishSdk) {
|
||||||
_this.publishSdk.close();
|
_this.publishSdk.close();
|
||||||
|
|||||||
Reference in New Issue
Block a user