【发布时间】:2022-11-14 11:26:10
【问题描述】:
我正在尝试使用 getUserMedia 在网页上显示 cam 实时流。它可以工作(如果我将流保存到文件中,就可以了),但视频标签仅显示静态绿色图像作为预览。有人面临同样的问题吗?
我的设置:
- 三星S8 (SM-G950F)
- 安卓 9
- 铬 107.0.5304.91
HTML
<video autoplay="true" width="100%" id="video-test"></video>
JS
var video = document.querySelector("#video-test");
navigator.mediaDevices.getUserMedia({
video: {
mandatory: { minFrameRate: 10, minWidth: 100, minHeigth: 100 },
}
})
.then(function (stream) {
video.srcObject = stream;
})
.catch(function (err0r) {
console.log("Something went wrong!", err0r);
});
谢谢
【问题讨论】:
标签: android google-chrome video getusermedia