用手机测试无法打开后置摄像头,切换还是前置摄像头
来源:6-5 【音频参数调整】音频约束

点赞狂魔小奇奇
2020-05-24
function start()
{
if (!navigator.mediaDevices
|| !navigator.mediaDevices.getUserMedia) {
console.log(‘getUserMedia is not support’);
} else {
var deviceID = videoIP.value;
var constraints = {
video : {
width : 320,
height : 420,
frameRate : 30,
deviceID : deviceID ? deviceID : undefined
},
audio : {
noiseSuppresson : true,
echoCancellation : true,
volume : 0
}
}
navigator.mediaDevices.getUserMedia(constraints)
.then(gotMediaStream)
.then(gotDevices)
.catch(handleError);
}
}
写回答
1回答
-
点赞狂魔小奇奇
提问者
2020-05-24
以解决
00
相似问题