I have a video recording application. Everything is working fine. Except when receiving a phone call during recording.
When I receive a phone call, I try to end the recording, but any of my recording calls to AVAssetWriter are rejected. audioWriterInput appendSampleBufferreturns no, appendPixelBuffererror. I try to call avAssetWriter finishWritingbut returns AVAssetWriterStatusFailed.
Nothing works, my video is damaged, because it seems that my usual methods for ending a recording session are not allowed after receiving a call.
What can I listen to correctly end the recording session when I receive a phone call? The only thing I can do now is listen applicationWillResignActiveand stop everything, but this will prevent recording when the user receives a text message, etc., which will make my application work differently than the native camera application.
akaru source
share