How does CameraX library can turn ON/OFF the torch?

androidx.camera:camera-core:1.0.0-alpha10

You can check is torch available or not with this:

val camera = cameraProvider.bindToLifecycle(lifecycleOwner, cameraSelector, preview, imageAnalyzer)

camera.cameraInfo.hasFlashUnit()

And you can enable torch with:

camera.cameraControl.enableTorch(true)

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)