Re: [mediacapture-main] Most browsers lie about how many devices they ask users to share (#648)

@youennf  Thanks for clarifying. I didn't mean to mischaracterize Safari's behavior. I based this on observation, not insight into internal heuristics. But when I run [this code]( in Safari on MacOS:
const gUM = constraints => navigator.mediaDevices.getUserMedia(constraints);

video1.srcObject = await gUM({video: true});
const [track1] = video1.srcObject.getVideoTracks();

const devices = await navigator.mediaDevices.enumerateDevices();
const [cam1, cam2] = devices.filter(({kind}) => kind == "videoinput");
const cam = (cam1.deviceId == track1.getSettings().deviceId)? cam2 : cam1;
video2.srcObject = await gUM({video: {deviceId: {exact: cam.deviceId}}});
...I get access to two cameras after a single prompt asking for one camera. From an end-user's point of view, who is not privy to these heuristics, this seemed surprising to me given the wording.

GitHub Notification of comment by jan-ivar
Please view or discuss this issue at using your GitHub account

Received on Thursday, 9 January 2020 20:49:16 UTC