Skip to content

Instantly share code, notes, and snippets.

@fernandocyder
Created March 2, 2021 06:43
Show Gist options
  • Select an option

  • Save fernandocyder/7bcb3038c3a91c7809ca90b61a206d0a to your computer and use it in GitHub Desktop.

Select an option

Save fernandocyder/7bcb3038c3a91c7809ca90b61a206d0a to your computer and use it in GitHub Desktop.
const gotStream = (stream) => {
window.stream = stream; // make stream available to console
window.imageCapture = new ImageCapture(stream.getTracks()[0]);
console.log(window.imageCapture)
const videoElement = document.querySelector('video');
videoElement.srcObject = stream;
setInterval(checkQrCode, 5000);
// refresh button list in case labels have become available
return navigator.mediaDevices.enumerateDevices();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment