Coder Social home page Coder Social logo

Comments (1)

ericblade avatar ericblade commented on July 20, 2024

Firstly, does navigator.mediaDevices.getSupportedCapabilities() return "torch: true"? if no, then browser doesn't support it on that device. If yes, then... it seems you might need to write some code more complex than a one liner to figure it out. Ultimately, you need to get access to a MediaStreamTrack, which you could do by building a dev version of Quagga and once you have that, you need to look at the results of MediaStreamTrack.getCapabilities(), and see if that returns "torch: true". If that is also a yes, then it's broken, report it to Samsung. If that is a no, then the device's camera does not support turning on the flash from the browser, which seems broken, report it to Samsung.

Alternatively, you might also check and see if there are multiple cameras reported -- Perhaps the torch is only supported with certain specific camera device ids.

To get a list of all camera devices, you can use Quagga.CameraAccess.enumerateVideoDevices(), and the results will be an array of all of the camera devices detected on the hardware, along with their identifiers. You can pass the deviceId to Quagga.init() to use a different camera (but be sure to not pass a "facing" parameter if you pass a deviceId)

As the interface to all camera devices is no different between the S9 and the S10 and any other device, that seems to highly indicate that the problem is either with the Samsung supplied software, or an intentional "you can't use torch from browser" or "you can't use torch with this specific camera id", neither of which make sense, but there's a lot of things that don't make sense to me out there. Therefore, I'm going to mark this as closed, unless or until you can provide some evidence of a deficiency in Quagga. If you find something, feel free to re-open.

I'd be happy to help where I can, but I think ultimately, you'll need to put together a development environment, and actually write some camera access code, to attempt to debug where the problem lay exactly.

from quagga2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.