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

toggleTorch() not work on Android14 #1198

Open
nghehuavan opened this issue Oct 3, 2024 · 1 comment
Open

toggleTorch() not work on Android14 #1198

nghehuavan opened this issue Oct 3, 2024 · 1 comment

Comments

@nghehuavan
Copy link

controller.toggleTorch() run success. but not turn on flashlight on Android 14 (XiaoMi HyperOS)
i tried package torch_light can turn on flashlight. but "mobile_scanner" can't
image

@navaronbracke
Copy link
Collaborator

The torch_light plugin seems to interact with camera2 directly. We use CameraX instead, which is a backwards compatible wrapper around it.

Do you get any errors when trying to turn the torch on or off? We just check if the camera has a torch and turn it on or off.
See https://github.com/juliansteenbakker/mobile_scanner/blob/master/android/src/main/kotlin/dev/steenbakker/mobile_scanner/MobileScanner.kt#L448-L458

Perhaps the camera you wanted to use does not have a torch? That other plugin always seems to grab the first camera, which seems like a bug in that package.

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

No branches or pull requests

2 participants