-
Notifications
You must be signed in to change notification settings - Fork 979
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
Zoom value? #307
Comments
haven't actually tested this, but in your init callback, you should be able to do something like:
You could probably also supply that as a constraint in the call to Quagga.init. Please let us know how that works for you :) |
I've tried exactly that code and attempted:
Still no luck - always opens without a zoom that must be manually adjusted. |
But your manual adjustment uses exactly the same code? |
Yes - but ideally, I'd like to not have to have the manual adjustment. I'd like to start with max zoom from launch. Here's what i've got so far (w/o manual adjustment):
// edited Oct-9-2020 to set max aspectRatio request to 2, not 100, to prevent people from using that value in the future, as it blows up iOS 14 - Eric Blade |
I'd like to see if doing it as I had said makes it work with my app and my nexus 5, but I've been incredibly busy with dealing with employment contracts the last couple of days :) My first thought, is that I wonder if maybe for some reason, there's some kind of time delay that needs to pass between the init callback, and before the device can accept a zoom command.. my second thought, is i wonder if there's something in the rules that says the camera can only perform commands if they are accompanied by user interaction, which is now a rule for playing sound in Chrome, so i could see it being a rule in other areas, too.. hmm. |
Got it! Added after Quagga.start(); This code pen: https://codepen.io/serratus/pen/zzxaOL and blog post: https://www.oberhofer.co/mediastreamtrack-and-its-capabilities/ were extremely helpful! |
so, a slight delay after start, before the camera is able to accept the zoom. I hate having to do workarounds that involve delays like that, but... yeah. i've had to ship things like that before, too. :-S |
.... seems that I need to get some better understanding of how this code all works, but it looks like you should be able to init() .. sleep() .. applyConstraints() .. then start() .. the sleep() part is what bothers me, as the init callback looks like it should be called after everything is up and ready. At least, the callback is called once CameraAccess responds to a request() call.. so.. i'm confused. Might just be one of those things . . . on the other hand, i wonder if there's a specific location that a callback could be added to notify when the camera is ready to zoom. |
Is there a way to set a default zoom value? I've not been able to adjust this - except manually.
The text was updated successfully, but these errors were encountered: