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

Quagga scanner continues to use the camera. #184

Closed
AbhinavReddy-Dev opened this issue Apr 21, 2023 · 4 comments
Closed

Quagga scanner continues to use the camera. #184

AbhinavReddy-Dev opened this issue Apr 21, 2023 · 4 comments
Assignees

Comments

@AbhinavReddy-Dev
Copy link
Contributor

This is a trivial issue but,

The scanner continues to use the camera even after the scan is stopped, and also when the user switches the page.
Expected behavior is to stop using the camera once the user stops it manually, and automatically when the user navigates to a different page.

@ysiddhapura
Copy link
Contributor

This is a trivial issue but,

The scanner continues to use the camera even after the scan is stopped, and also when the user switches the page. Expected behavior is to stop using the camera once the user stops it manually, and automatically when the user navigates to a different page.

We can work on this issue. Currently, there is an option to manually pause the camera in the address bar. But we can work on making it automated.

@ysiddhapura ysiddhapura self-assigned this Apr 21, 2023
@AbhinavReddy-Dev
Copy link
Contributor Author

Yes, I have closed it using address bar, but somehow the camera indicator on a MacOS device is still lit. This could be a MacOS only issue though.

This is a trivial issue but,
The scanner continues to use the camera even after the scan is stopped, and also when the user switches the page. Expected behavior is to stop using the camera once the user stops it manually, and automatically when the user navigates to a different page.

We can work on this issue. Currently, there is an option to manually pause the camera in the address bar. But we can work on making it automated.

@ysiddhapura
Copy link
Contributor

Yes, I have closed it using address bar, but somehow the camera indicator on a MacOS device is still lit. This could be a MacOS only issue though.

This is a trivial issue but,
The scanner continues to use the camera even after the scan is stopped, and also when the user switches the page. Expected behavior is to stop using the camera once the user stops it manually, and automatically when the user navigates to a different page.

We can work on this issue. Currently, there is an option to manually pause the camera in the address bar. But we can work on making it automated.

Okay sounds good, will look into this.

@Anoushka444 Anoushka444 self-assigned this Apr 22, 2023
@ysiddhapura
Copy link
Contributor

Fixed the issue: Added a state variable cameraOn to keep track of whether the camera is on or off. Also modified the useEffect hook to start or stop the camera based on the value of cameraOn. When the user clicks the "stop" button, it will update the cameraOn state to false which triggers the useEffect hook to stop the camera.

Please check #187 @AbhinavReddy-Dev @Anoushka444

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

6 participants