我使用tensorflow-react在chrome上进行对象识别。我想用后置摄像头而不是前置摄像头。
这是代码:
const webcamPromise = navigator.mediaDevices
.getUserMedia({
video: true,
audio: false,
})
添加facingMode: 'environment'
似乎不起作用。
您在哪里添加了facingMode: 'environment'
?它应该与一起工作
navigator.mediaDevices
.getUserMedia({
video: {facingMode: 'environment'},
audio: false,
})