iphone - Detect LED Flash for Alerts setting status in code -
how can detect "led flash alerts" (from settings) status in code? have tried:
avcapturedevice *torched=[avcapturedevice defaultdevicewithmediatype:avmediatypevideo]; bool test = torched.torchmode; bool test1 = torched.flashmode;
but seams not need.
do this,
bool test=no; bool test1=no; class capturedeviceclass = nsclassfromstring(@"avcapturedevice"); if (capturedeviceclass != nil) { avcapturedevice *device = [avcapturedevice defaultdevicewithmediatype:avmediatypevideo]; if ([device hastorch] && [device hasflash]){ if(device.flashmode==avcaptureflashmodeon) nslog(@"on"); else nslog(@"off"); } }
hope helps you....
Comments
Post a Comment