我正在使用getUserMedia()在iOS 11的Safari上捕获相机流。当我使用MediaDevices API获取摄像头列表时,标签为空白。有没有一种可靠的方法确定哪个相机指向哪个方向?
navigator.mediaDevices.enumerateDevices().then(function(devices) {
devices.forEach(function(device) {
if(device.kind === 'videoinput') {
console.log(device);
// Labels for both cameras are blank:
// MediaDeviceInfo { deviceId: "123ABC", groupId: "", kind: "videoinput", label: "" }
}
});
});