0

I have a requirement where I need to show a message "Low light" when there is a low light around the iphone front camera. I was searching for public API which does this but didn't find anything. Also did check ambient light sensor but nothing helped.

Can some tell me is there a way to identify the low light state while using the iphone front camera?

Thanks

Naveen
  • 636
  • 8
  • 28

1 Answers1

0

You need to use AVFoundation, and then you can monitor the Brightness Value that's in the video stream's metadata, as explained in my answer to another StackOverflow question. If you're not viewing the video feed, you may want to ramp it down to 6 fps, as that will give you a lower floor for the low light (and thus more control).

Community
  • 1
  • 1
Wildaker
  • 2,533
  • 1
  • 17
  • 19