<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <video id="video" autoplay muted playsinline></video>
</body>
<script type="module">
import BarcodeDetectorPolyfill from "https://cdn.skypack.dev/barcode-detector@1.0.3";

const adaptOldFormat = detectedCodes => {
  if (detectedCodes.length > 0) {
    const [ firstCode ] = detectedCodes;

    const [
      topLeftCorner,
      to