0

I have problem while opening camera in my application from background mode. I used AVCaptureDevice controller and create custom camera in my application. It's work fine but when I close app from home button and again reopen app camera take longer time for reactivation. Can any body give some idea how can I reduce time for activation. Thanks in Advance.

kb920
  • 3,039
  • 2
  • 33
  • 44
  • hi, can you please tell where you have written the code for initializing the camera capture ? – hpp Aug 08 '13 at 08:00
  • @hpp -(void)viewWillAppear:(BOOL)animated – kb920 Aug 08 '13 at 09:12
  • hi, please put that code in separate method and call that method by applying delay.(performSelector withDelay).. – hpp Aug 08 '13 at 09:31
  • @hpp It's wrok fine now Thanks. But there us on another problem when I go to another view and come back to camera view again close app and open camera not active at that time – kb920 Aug 08 '13 at 10:40
  • to do that you need to add code in appDelegate.m file. in applicationDidBecomeActive method. put if(current view is cameraview) then put the code for initializing the camera in if condition. – hpp Aug 08 '13 at 11:06
  • I think it's not solution. I explain my prb again. 2 senario 1) Install app directly go to camera screen close app reopen again camera reactivation work fine. 2) Install app directly go to camera view than go to another view come back to camera view close app reopen camera not reactive. – kb920 Aug 08 '13 at 11:12
  • try to put the camera initialization code in ViewDidLoad method instead of ViewWillAppear method. – hpp Aug 08 '13 at 11:17
  • Bhalodiya saheb you are forget to close the session that why it delay so check this link http://stackoverflow.com/questions/7752931/reopening-avcapturesession – Rushabh Aug 13 '13 at 10:32

0 Answers0