ios - Camera Flash is not working -
i trying make extension marmalade, turns on , off camera flash in iphone. referring this answer on using camera flash. i've put exact code has mentioned , [device settorchmode:avcapturetorchmodeon];
gets called too. flash doesn't respond, if nothing has happened. there need do, make work static library, can use in extension?
update:-
using ios-sdk 6.1 compile extension , testing on iphone 4 (ios version 4.3.1). testing on iphone 5 (ios version 6.0.0), , flash turning on, not turning off. guess might help.
that code copied may have error in it. try following:
-(void)turnonflash { avcapturedevice *device = [avcapturedevice defaultdevicewithmediatype:avmediatypevideo]; if ([device hastorch]) { [device lockforconfiguration:nil]; [device settorchmode:avcapturetorchmodeoff]; [device unlockforconfiguration]; } }
Comments
Post a Comment