react-native-camera-kit icon indicating copy to clipboard operation
react-native-camera-kit copied to clipboard

Fixed issue #518 modified Camera.kt file

Open MdAyan101 opened this issue 7 months ago • 6 comments

Summary

MdAyan101 avatar Jul 04 '25 06:07 MdAyan101

Flash light issue(#518) resolved with this fix, Thanks @MdAyan101

jineshfrancs avatar Jul 05 '25 17:07 jineshfrancs

https://github.com/teslamotors/react-native-camera-kit/issues/518 I was also facing the same issue, and was able to resolve using this. Thanks

ac5865 avatar Jul 07 '25 11:07 ac5865

Hi @MdAyan101,

Thanks for your first contribution!

If you want it to be merged quickly, please proactively provide details

  • why is the fix addressing the issue, the explanation behind it or a doc. Should this "trick" be done elsewhere?
  • steps on how you tested it, what version etc.

This helps now to get it merged, but also in the future to have enough context so it doesn't get mistakenly reverted

DavidBertet avatar Jul 21 '25 06:07 DavidBertet

Hi @DavidBertet ,

I was facing the issue of toggling the flashlight through a button while camera preview was on. I was not able to turn on the flash since the camera was already in use and I was getting this exception : android.hardware.camera2.CameraAccessException: CAMERA_IN_USE (4): setTorchMode:3108: Torch for camera "0" is not available due to an existing camera user

So I changed the setTorchMode method adding a pause for camera preview and then enabling the flash and then again resuming the camera preview. Just 2 line added.

I tested this in android 11, 12, 13, 14, 15 devices. Devices were from Samsung, pixel, Motorola, one-plus and it works for every device.

MdAyan101 avatar Jul 22 '25 09:07 MdAyan101

@MdAyan101 I am unable to reproduce the issue with a Pixel Fold 9. Can you provide an example project or a video recording of the issue? I don't want to add one-off hacks like this without a clear use cause.

scarlac avatar Aug 27 '25 01:08 scarlac

Can you have a test of v16? It fixes a bunch of issues with the new arch so it's possible it affected it.

scarlac avatar Sep 12 '25 03:09 scarlac

Stale. Closing.

scarlac avatar Dec 30 '25 19:12 scarlac