4

There are many questions (here, here) regarding the double height red audio recording status bar, but all of them reference flashes when the app resigns into the background. I'm getting a flash, I'm assuming from an AVCaptureSession setup, while the app is in foreground.

Has anyone experienced this before?

Community
  • 1
  • 1
Ryan Romanchuk
  • 10,819
  • 6
  • 37
  • 41

1 Answers1

12

You have to remove the audio input from the AVCaptureSession

    [self.captureSession removeInput:audioIn];

in which the audioIn is the AVCaptureDeviceInputobject, that is initialised in the init method.

Explanation: You get a flash because of the transition. When you go from view A to view B, and the object was allocated in view A. You get a flash because when the view B is presented, and view A still hasn’t deallocated the object. So it is still being used on “background” by view A. It’s the same thing when you are on a call and open an app while you are on a call.

bruno
  • 2,154
  • 5
  • 39
  • 64
  • do you know what's causing it to flash though? Is it because i'm transitioning to another view while the inputs are being removed? I'm definitely removing them, but maybe it's a new ios8 security feature? The app is always in the foreground when it happens. – Ryan Romanchuk Oct 14 '14 at 05:16
  • 1
    100+ For your answer :-) The irritating red colour is no more. Thanks @bruno – Blisskarthik Jan 07 '15 at 10:30
  • 1
    removing audio input in viewWillDisappear fixed issue! Thanks @bruno – Igor Palaguta Jun 03 '15 at 15:16