ocation
        }))
      } else {
        window.requestAnimationFrame(processFrame(state))
      }
    }
  };

  processFrame({
    contentBefore: null,
    locationBefore: null,
    lastScanned: performance.now()
  })();
};

(async () => {
  const videoEl = document.querySelector('#video')

  const stream = await navigator.mediaDevices.getUserMedia({ video: true, audio: false })

  videoEl.srcObject = stream

  videoEl.addEventListener("loadeddata", () => {
      keepScanning(videoEl, { minDelay: 40, det