【发布时间】:2019-03-08 13:18:44
【问题描述】:
我正在尝试制作一个 cam 捕获组件,我希望调整它的大小以适应包含它的 div 的 100%。 这就是我制作视频的方式。
navigator.mediaDevices.getUserMedia({
video: {
// Indicates the possible video quality.
width: { min: 640, ideal: 1024, max: 1920 },
height: { min: 480, ideal: 720, max: 1080 }
}})
.then(stream => {
// Code over here
}));
};
})
.catch(error => {
// Error over here
}));
});
}
在我的 CSS 中有这个。
#video {
margin-top: 0px;
margin-right: auto;
margin-bottom: 0px;
margin-left: auto;
width: 100%!important;
height: auto!important;
-webkit-transform: scaleX(-1); //avoid mirror effect
transform: scaleX(-1);
}
当我希望视频的质量是另一个大于 640x480 的质量时,会出现“错误”,然后视频>自动调整大小并且无法正常工作,因为我对图像进行了裁剪,然后我分析了它和其他现在没关系。
是否可以在不调整视频大小的情况下提高质量?
问候!
【问题讨论】:
标签: javascript css html5-video getusermedia