Commit Graph
106 Commits
Author SHA1 Message Date
Daniel 450de34ae3 Update our jsQR fork
Especially with the following changes:
- Attempt to fix Safari RangeError exceptions
- Support "structured append" qr codes
- Binarizer: adapt blackBias for slightly higher detection rate
2021-08-10 21:00:35 +02:00
Daniel d7a09be088 Avoid that Safari stops the video stream on hidden videos 2021-08-09 11:22:27 +02:00
Daniel e8d107a171 Performance improvements
- 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.
2021-07-29 19:37:15 +02:00
Daniel 5836ac719b Rename fixedCanvasSize to disallowCanvasResizing 2021-07-29 17:26:29 +02:00
TheAppleFreakandSören Schwert 83ed4002c5 Corrected typo in typings 2021-07-21 13:14:35 +02:00
Daniel e8a77dea3f Add option for providing a custom web cam scanning region 2020-07-12 18:57:29 +02:00
Daniel 89201b62e8 v1.2.0 2020-07-12 14:21:57 +02:00
Daniel 99111ae23a When the native BarcodeDetector crashed, create a new one
The BarcodeDetector sometimes crashes after some time. If that happens,
create a new one.
2020-07-12 13:01:05 +02:00
Daniel 423101663b Use native BarcodeDetector when supported 2020-07-12 12:30:38 +02:00
Daniel 87336c313b Update source rect when video ready
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.
2020-07-12 00:00:56 +02:00
Daniel ecc04840dd Increase the timeout
Sometimes when the scanner was processing a frame for a long time, the
timeout apparently could be triggered when it shouldn't.
2020-07-11 10:05:49 +02:00
Daniel f1ca69bb1e Readme: add documentation for some so far undocumented features
- 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
2020-07-11 10:04:57 +02:00
Daniel 509232f8d1 Support blobs as image source 2020-07-10 20:42:48 +02:00
Daniel 9ec0d32131 Add an umd build 2020-07-10 00:10:45 +02:00
Daniel c0f922bdda Update jsQR scanner 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.
2020-07-09 21:58:13 +02:00
Daniel efaec08208 Update all dependencies and rebuild 2020-07-09 17:20:10 +02:00
Daniel 4206f44c22 Make sure hasCamera() always returns a Promise 2020-07-09 16:36:44 +02:00
Daniel a3fcd4cf69 Fixes and improvements for flashlight support
- 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.
2020-07-09 14:31:41 +02:00
Filip ChalupaandDaniel 50adecec26 Flash detection and control
PR #34

Co-authored-by: Daniel <github.danimoh@neverbox.com>
2020-07-09 12:38:31 +02:00
Magnus HenochandDaniel 49ccc1dde9 Allow specifying a preferred facingMode for camera
PR #35

Co-authored-by: Daniel <github.danimoh@neverbox.com>
2020-07-09 11:33:38 +02:00
Daniel 947fb7ebcf Improvements and fixes for continous scanning error handling
- 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
2020-07-07 23:45:49 +02:00
diegoandDaniel 0961d4e102 add error for continous scanning 2020-07-07 15:52:08 +02:00
DanielandGustavo Honorato ee9e8f6fe6 Readme: improve webpack usage instructions
Improve the instructions for file-loader and add instructions for
raw-loader (see PR #60).

Co-authored-by: Gustavo Honorato <gustavohonorato@gmail.com>
2020-07-07 14:36:50 +02:00
Daniel 7776d8bca0 demo: add start and stop button 2020-07-06 23:31:20 +02:00
Daniel 1daf447a73 On pause stop all tracks if there are multiple
Should typically not be necessary, just to be safe.
2020-07-06 23:31:18 +02:00
DanielandAlessandro Gatti 177a252488 Set playsInline, muted and disablePictureInPicture by default
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>
2020-07-06 23:30:36 +02:00
shrpneandDaniel 0ce0db151f Set correct video mirror for safari user facing cameras
Co-authored-by: Daniel <github.danimoh@neverbox.com>
2020-07-06 10:58:54 +02:00
shrpneandDaniel 3cc846fa6d Skip scans until the video is ready
drawImage() only works correctly on a video with readyState > 1, see
https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/drawImage#Notes.
This also avoids false positives for videos paused after a successful
scan which remains visible on the canvas until the video is started
again and ready.

Co-authored-by: Daniel <github.danimoh@neverbox.com>
2020-07-05 15:55:45 +02:00
Danielandshrpne b3713f2b38 Remove canplay logic
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>
2020-07-05 13:45:29 +02:00
shrpneandDaniel 54e66c5a82 Fix for old Firefox versions
In older Firefox versions, the canplay event was not triggered
correctly, resulting in videos without autoplay not being played
manually via play().

Co-authored-by: Daniel <github.danimoh@neverbox.com>
2020-07-05 13:45:27 +02:00
078fcbfe66 Update README.md
Co-authored-by: Sören Schwert <hello@soerenschwert.de>
Co-authored-by: Daniel <github.danimoh@neverbox.com>
2020-07-05 12:31:27 +02:00
Christopher PfohlandDaniel 5ffcb9f507 Update qr-scanner.d.ts
More accurate callback type in the QrScanner constructor.
2020-07-05 12:29:46 +02:00
Sören SchwertandDaniel 85af2c3c8c Handle iOS non-Safari browsers not having navigator.mediaDevices
On iOS, only Safari gets access to media devices. Other browsers, such as Chrome and Firefox, do not.

This error was detected in the new Nimiq Wallet.
2020-07-03 18:52:38 +02:00
Daniel ecd8a3425f rebuild with much smaller file size 2019-02-17 11:25:13 -06:00
Daniel 18c3e4dff8 clean up temporarly created worker in single image scan 2019-02-16 22:40:10 -06:00
Daniel d5a8fe70e8 switch to jsQR library 2019-02-16 22:20:13 -06:00
Yury Kozyrevanddanimoh 540030c81f Update qr-scanner.d.ts 2019-02-13 17:00:35 -06:00
Daniel baeb1986f5 make ready for npm package publication 2019-02-05 14:18:36 -06:00
Daniel 56b8dafcd4 update Readme 2019-02-05 12:04:14 -06:00
Daniel 0cc9ee2841 change default QrScanner.WORKER_PATH; fix WORKER_PATH in demo 2019-02-05 09:45:48 -06:00
Daniel 2144b169d1 add method for checking whether device has a camera 2019-02-05 09:32:48 -06:00
Daniel b3371bd2f1 move public methods to the top of QrScanner class 2019-02-05 08:28:51 -06:00
Daniel 8a1aff3353 add typescript types 2019-02-04 22:16:42 -06:00
Curd BeckerandDaniel febb9987f6 let npm audit fix take care of any potential known security vulnerabilities 2019-01-19 17:21:57 +01:00
Curd BeckerandDaniel 71e6f13fe7 use gulp 4.0.0 + code compatibility changes 2019-01-19 17:21:51 +01:00
Daniel 2637e698fd fix entry point in package.json 2019-01-19 17:10:37 +01:00
Daniel 788a65bb24 add destroy method 2019-01-19 17:10:27 +01:00
Daniel 27e40bf1ce pause video if tab in background; start playback also on video that does not provide autoplay 2019-01-19 17:02:02 +01:00
Daniel f5771a8279 add support for color inverted inverted qr codes; improve readme; more specific error messages; warn on http connection 2018-12-15 09:32:49 -06:00
sisou ebac8e53cc Add static asset reference 2018-02-26 21:49:23 -06:00