0

I have a ZXing scanner in my Angular project which is set to scan QR-codes. My problem is that I must make it so that the scanner automatically switches to the correct camera based off the distance between the phone and the screen while the scanner is active (no manual selection of cameras). I've looked online but I quite didn't get how to do so or if it is even possible, the only post I've found was from 2014 about a deprecated Firefox event (and I need to make it usable on every browser). Is it even possible to dynamically change the camera based off distance?

Example code:

 startDistanceTracking() {
    setInterval(() => {
      this.currentDistance = Math.random() * 100; 
      this.updateSelectedDevice();
    }, 500); //Every half second, refresh the distance and use it on updateSelectedDevice 
             //to switch the camera.
  }

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.