Re: [mediacapture-main] Add semantics choice to getUserMedia() for in-browser picker. (#667)

@getify Another alternative is to file an issue with the service to resolve

>  and their UI doesn't let me choose what mic or camera I want... I 

which should be possible utilizing the current iteration (using `label`s of `enumerateDevices()`) and selecting device by `deviceId`. To test hot-plugged a USB camera labeled `"Digital_Camera (<UUID>)"`

navigator.mediaDevices.getUserMedia({video: true})
.then(async stream => {
  const devices = await navigator.mediaDevices.enumerateDevices();
  const {deviceId} = devices.find(({label}) => label === 'Digital_Camera (093a:2700)')
  let [track] = stream.getVideoTracks();
  console.log(await track.getConstraints());
  track.stop();
  stream = await navigator.mediaDevices.getUserMedia({video: {deviceId: {exact: deviceId}}});
  [track] = stream.getVideoTracks();
  console.log(await track.getConstraints());
  const v = document.createElement('video');
  v.controls = v.autoplay = true;
  document.body.appendChild(v);
  v.srcObject = stream;           
});

-- 
GitHub Notification of comment by guest271314
Please view or discuss this issue at https://github.com/w3c/mediacapture-main/pull/667#issuecomment-647052797 using your GitHub account

Received on Saturday, 20 June 2020 22:35:29 UTC