Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Ability to stop and start scanning while using Html5QrcodeScanner #285

Closed
ZhuanM opened this issue Sep 3, 2021 · 10 comments

Comments

@ZhuanM
Copy link

ZhuanM commented Sep 3, 2021

Is your feature request related to a problem? Please describe.
Not having the ability to stop the scanning process (without removing/cleaning the entire scanner itself - but simply not letting the scanner scan) and then being able to start scanning again while using Html5QrcodeScanner makes no sense since it is doable (according to the documentation) with Html5Qrcode by using the "start" and "stop" functions.

Describe the solution you'd like
I'd like to have the ability to stop and start scanning while using Html5QrcodeScanner by having the "start" and "stop" functions that are available with Html5Qrcode.

Describe alternatives you've considered
The alternative is to use Html5Qrcode but that means that the developer has to go through rebuilding the entire user interface just to have the "start" and "stop" functions available.

@mebjas
Copy link
Owner

mebjas commented Sep 4, 2021

I'd like to have the ability to stop and start scanning while using Html5QrcodeScanner by having the "start" and "stop" functions that are available with Html5Qrcode.

This makes sense, would you like the whole UI to reset to beginning in that case?

@ZhuanM
Copy link
Author

ZhuanM commented Sep 4, 2021

This makes sense, would you like the whole UI to reset to beginning in that case?

Well, if it were to reset the UI then it would be the same as using the "clean" function alongside with re-creating a new scanner. I think a new functionality that would be more useful for this library to have is the ability to not allow further scans but without clearing the entire scanner from the UI. Let's say that the developer wants the scanning to stop after, for example, the first or second or even third scan, but still without closing the scanner and by still showing the video camera feed with the scan box, and after a certain point in the code to be able to have it functionally scanning again.

@mebjas
Copy link
Owner

mebjas commented Sep 17, 2021

So it's expected to work like a stop() method should programatically trigger the stop button?

@ZhuanM
Copy link
Author

ZhuanM commented Sep 20, 2021

I want to apologize for misunderstanding the stop() and start() functionality of the Html5Qrcode class. As I worked even more with the Html5Qrcode class I became more familiar with them and it's not what I really intented to request as a feature. What I actually intented as a feature request is in my latest comment - the ability to be able to stop the scanning process with a NEW function (which doesn't exist on any class) without clearing the UI and while continuing to show the video camera feed with the QR shading scan box. Alongside with that new stopping function there should obviously also be a NEW function (which also doesn't exist on any class) which would be able to have the scanner be functionally scanning again and being able to read new Barcodes. Basically the whole idea is to have 2 new functions - stop reading and start reading.

@mebjas
Copy link
Owner

mebjas commented Oct 5, 2021

I think what you are looking for is pause() and resume() methods both at the Html5QrcodeScanner and Html5Qrcode level.

@mebjas mebjas self-assigned this Oct 5, 2021
@ZhuanM
Copy link
Author

ZhuanM commented Oct 6, 2021

Yes, this would be a more accurate naming of the functions I intented to request.

@SmitharyZach
Copy link

Yes I would love a pause feature.

I want to scan an item, show a pop up for the user to confirm the scan, then continue scanning. This is so a single item is not scanned twice and the end user can still keep the scanner open to quickly move through a line

@mebjas
Copy link
Owner

mebjas commented Oct 23, 2021

Support added with version 2.1.0

@mebjas mebjas closed this as completed Oct 23, 2021
@mebjas
Copy link
Owner

mebjas commented Oct 23, 2021

(reopen if there are some issues).

@S-Rajkumar
Copy link

So it's expected to work like a stop() method should programatically trigger the stop button?

is this done ?
i need to stop scanning by programatically.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants