mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-11-24 04:19:48 +01:00
fix: 修复数字人摄像头展示区域裁剪的问题
This commit is contained in:
parent
fd93116d69
commit
3c31231781
1 changed files with 2 additions and 2 deletions
|
|
@ -192,7 +192,7 @@ class App {
|
|||
}
|
||||
log('正在请求摄像头权限...', 'info');
|
||||
this.cameraStream = await navigator.mediaDevices.getUserMedia({
|
||||
video: { width: 320, height: 240, facingMode: this.currentFacingMode },
|
||||
video: { width: 180, height: 240, facingMode: this.currentFacingMode },
|
||||
audio: false
|
||||
});
|
||||
cameraVideo.srcObject = this.cameraStream;
|
||||
|
|
@ -274,7 +274,7 @@ class App {
|
|||
return;
|
||||
}
|
||||
|
||||
canvas.width = video.videoWidth || 320;
|
||||
canvas.width = video.videoWidth || 180;
|
||||
canvas.height = video.videoHeight || 240;
|
||||
const ctx = canvas.getContext('2d');
|
||||
ctx.drawImage(video, 0, 0, canvas.width, canvas.height);
|
||||
|
|
|
|||
Loading…
Reference in a new issue