我无法一起指定视频质量和面向相机约束。 有没有办法结合以下约束?
{
audio: true,
video: { width: 1280, height: 720 }
}
{ audio: true, video: { facingMode: "user" } }
答案 0 :(得分:2)
navigator.mediaDevices.getUserMedia({audio:true,video:getConstraints(1280,720)})
function getConstraints(videowidth, videoheight) {
constraints = {
facingMode: { exact: "environment" },
width: { min: videowidth, ideal: videowidth, max: videowidth},
height: { min: videoheight, ideal: videoheight, max:
frameRate : {min: 5, max: 8 }
};
return constraints;
}