diff --git a/im-ui/src/api/camera.js b/im-ui/src/api/camera.js index be3a1ae..0cb5f0e 100644 --- a/im-ui/src/api/camera.js +++ b/im-ui/src/api/camera.js @@ -9,15 +9,15 @@ ImCamera.prototype.isEnable = function() { return !!navigator && !!navigator.mediaDevices && !!navigator.mediaDevices.getUserMedia; } -ImCamera.prototype.openVideo = function(isFacing) { +ImCamera.prototype.openVideo = function() { return new Promise((resolve, reject) => { if(this.stream){ this.close() } - let facingMode = isFacing ? "user" : "environment"; let constraints = { video: { - facingMode: facingMode + with: window.screen.width, + height: window.screen.height }, audio: { echoCancellation: true, //音频开启回音消除 diff --git a/im-ui/src/components/rtc/RtcGroupVideo.vue b/im-ui/src/components/rtc/RtcGroupVideo.vue index 83efc17..b7e7f27 100644 --- a/im-ui/src/components/rtc/RtcGroupVideo.vue +++ b/im-ui/src/components/rtc/RtcGroupVideo.vue @@ -498,7 +498,7 @@ return new Promise((resolve, reject) => { if (this.isCamera) { // 打开摄像头+麦克风 - this.camera.openVideo(this.isFacing).then((stream) => { + this.camera.openVideo().then((stream) => { console.log("摄像头打开成功") this.stream = stream; // 显示本地视频