mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-07-22 07:03:53 +08:00
Merge pull request #3055 from xinnan-tech/fix-digital-human
fix: 修复数字人摄像头展示区域裁剪的问题
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user