Red audio recording status bar “flashes” while app in *foreground*

和自甴很熟 提交于 2019-12-03 15:00:59

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/26055717/red-audio-recording-status-bar-flashes-while-app-in-foreground

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!