function gotDevices(deviceInfos) {
  var no_video_found = true;
  for (var i = 0; i !== deviceInfos.length; ++i) {
    var deviceInfo = deviceInfos[i];
    var option = document.createElement('option');
    option.value = deviceInfo.deviceId;
    if (deviceInfo.kind === 'videoinput') {
      no_video_found = false;
      option.text = deviceInfo.label || 'Camera ' + (videoSelect.length + 1);
      videoSelect.appendChild(option);
    }
  }
  if (no_video_found) {
    var option = document.createElement('option');
    option.value = -1;
    option.text = 'No camera found';
    videoSelect.appendChild(option);
  }
}
// then get a video stream from the default camera source.

then get a video stream from the default camera source.
then get a video stream from the default camera source .
function gotDevices(deviceInfos) {
  var no_video_found = true;
  for (var i = 0; i !== deviceInfos.length; ++i) {
    var deviceInfo = deviceInfos[i];
    var option = document.createElement('option');
    option.value = deviceInfo.deviceId;
    if (deviceInfo.kind === 'videoinput') {
      no_video_found = false;
      option.text = deviceInfo.label || 'Camera ' + (videoSelect.length + 1);
      videoSelect.appendChild(option);
    }
  }
  if (no_video_found) {
    var option = document.createElement('option');
    option.value = -1;
    option.text = 'No camera found';
    videoSelect.appendChild(option);
  }
}
function gotDevices ( deviceInfos ) { var no_video_found = true ; for ( var i = 0 ; i !== deviceInfos . length ; ++ i ) { var deviceInfo = deviceInfos [ i ] ; var option = document . createElement ( 'option' ) ; option . value = deviceInfo . deviceId ; if ( deviceInfo . kind === 'videoinput' ) { no_video_found = false ; option . text = deviceInfo . label || 'Camera ' + ( videoSelect . length + 1 ) ; videoSelect . appendChild ( option ) ; } } if ( no_video_found ) { var option = document . createElement ( 'option' ) ; option . value = - 1 ; option . text = 'No camera found' ; videoSelect . appendChild ( option ) ; } }
then get a video stream from the default camera source.
then get a video stream from the default camera source .