On Macs with an M1/M2 processor and macOS Ventura (macOS version 13), the BarcodeDetector
is broken in Chromium based browsers, regardless of the version. For that constellation,
the BarcodeDetector does not error but does not detect QR codes. Macs without an M1/M2 or
before Ventura are fine. See https://bugs.chromium.org/p/chromium/issues/detail?id=1382442.
Fixes#209
This avoids that parallel scans on the same worker instance ALL interpret
the first incoming scan result as their result. Instead, now each scan
request to the worker waits for their individual response.
Fixes#149
Doed now not import the worker as a separate worker script via the Worker
constructor which required copying over the worker script and specifying
QrScanner.WORKER_PATH. Instead, the dynamic import will now be handled
automatically by bundlers like Rollup or Webpack.
- Avoid starting camera stream if scanner was paused in the meantime
- Be lenient on fails to .start() if the scanner was paused in the meantime
- Disallow starting the stream or flash if the scanner was destroyed
- Await video.play calls
Fixes#90Fixes#139
- Use .pause instead of copying the code
- Remove the unnecessary 300ms delay
- Avoid overwriting _offTimeout if another pause call happened shortly
before.
- Don't start the stream if is was paused.
- Merge deviceId and preferredFacingMode options into a single
option preferredCamera. Also previously, the deviceId took
precedence over the preferredFacingMode.
- .setCamera now also allows setting a preferred facingMode
instead of a deviceId.
Additinal fixes to PR#112:
- Correctly fallback to not applying any constraints in .start if
the preferredCamera (previously deviceId and preferredFacingMode)
is not available. Previously, if neither for the deviceId nor
the preferredFacingMode contraint a camera was found, no attempt
without a constraint was attempted.
- A add missing documentation for deviceId support in the constructor
to the Readme and generally adapt Readme for merged preferredCamera
option.
- Fix missing type for deviceId (now merged into preferredCamera) in
the constructor type definitions and generally adapt the types for
merged preferredCamera option.
- rename the method from getCameraList to listCameras
- make requesting labels (and the required camera permission) optional
- refactor hasCamera using listCameras
Additinal fixes to PR#112:
- add fallback labels for when no exact labels were requested
- remove unnecessary outer Promise
- make sure the created stream is always destroyed in a finally
- Add instructions to readme
- Update _flashOn after the flash was actually turned on or off
- Throw an error when trying to set the flash if not supported
- Make toggleFlash, turnFlashOn, turnFlashOff return a promise
- Throw an error when trying to detect flash support before the
video stream is available.
- Make change backwards compatible with previous consructor signature
- Fix demo to interpret errors as proper results
- Update types
- Do not report errors when the scanner is inactive
- Update readme