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
Create a new worker instance on each call to createQrEngine instead of
using a singleton worker instance. Sharing a singleton instance resulted
in problems when destroying the worker, for example in a call to
QrScanner.scanImage, while it was still needed in a scanner instance or
further calls to scanImage.
Building as es module doesn't make too much sense as browser support for
es modules is lower as for es6 generally, and anyone who would import the
legacy build via es import, could already pretty much use the regular build.
Also improves on documentation for legacy build.
Closes#143
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
Especially with the following changes:
- Attempt to fix Safari RangeError exceptions
- Support "structured append" qr codes
- Binarizer: adapt blackBias for slightly higher detection rate
- round scan region to whole pixel positions to avoid blurry
drawing at sub-pixel positions
- avoid clearing the canvas by resetting the canvas width or
height when they actually didn't change.
b3713f2 switched to starting to play immediately, without waiting for
a canplay event. The side effect of this is, that the play event (on
which the source rect is measured) is triggered before the video
is ready and the video dimensions known. To circumvent this, this
commit adds an additional source rect update on loadedmetadata.
- support for image urls and data urls
- support for stopping web cam scanning via stop()
- support for hasCamera() check
- documentation for optional scanImage() parameters
- update file sizes
- list web cam scanning out-of-the-box as a feature of this lib
New version of our jsQR-es6 fork has been updated to newest master
of cozmo/jsQR and merged in additional pull requests which are still
open in cozmo/jsQR. Also now makes the 'onlyInvert' inversion mode
usable.
- 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
Improve the instructions for file-loader and add instructions for
raw-loader (see PR #60).
Co-authored-by: Gustavo Honorato <gustavohonorato@gmail.com>
Set these properties by default to disable picture in picture mode and to
enable inline playback on iPhones.
Co-authored-by: Alessandro Gatti <ale.gatti96@gmail.com>
The manual call of play() just after setting the video stream introduced in
the previous commit seems to suffice without the need to wait for the
canplay event.
Co-authored-by: shrpne <shrpne@gmail.com>