Library: How can i activate continues scan?

Created on 9 Nov 2018  路  6Comments  路  Source: zxing-js/library

Hello,

i'm trying to figure out how to scan continuously.

I saw issue #69 and i tried to do it myself before like calling it recursive, but as the other guy already said in his issue, the camera flashes and it doesn't seems continuous to the user.

Is there any chance?

question

All 6 comments

Yes, there is a big chance! The Angular component we have does scan continuously, I just can't prepare an example for you at this moment, but it is possible.

Solution is to recursively call codeReader.decodeOnceWithDelay(scanOk, scanFail); instead of doing the whole decodeFromInputVideo setup.

Disclaimer: writing just to give some feedback.

You're right. The code by the time I started to contribute was too far from my understanding and I failed in improving it. I'm rewriting it know on the Angular component, but I'm with lots of difficulties with deciding what should I change and what should I not. Recently I discovered that this whole setup is the main problem we gonna face. First of all I'm trying to create a new and as clean as possible code and I started with Promisefication of things.

Solution is to recursively call codeReader.decodeOnceWithDelay(scanOk, scanFail); instead of doing the whole decodeFromInputVideo setup.

there is no decodeOnceWithDelay but decodeWithRetryAndDelay. Although, your solutions totally worked for me, thanks!

@Alinaki let's just say you're a bit late here. xD

Just to make it clear, the method is kinda the same, but decodeWithRetryAndDelay is a newer version of it.

On version v0.15 you could do something like this (open the file for more):

https://github.com/zxing-js/library/blob/2f6503eab60838998836e534524b158c58761e7d/docs/examples/qr-camera/index.html#L83-L115

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lenny76 picture lenny76  路  10Comments

mattmahn picture mattmahn  路  7Comments

jsid72 picture jsid72  路  6Comments

michael-pearson picture michael-pearson  路  6Comments

vinayak-dataman picture vinayak-dataman  路  10Comments