How do I safely stop video recording on AVFramework, when home button is pressed?
I want my app to work like the native camera app: when you press the home button during recording it stops the recording process and then goes to the background mode.
On my app delegate, I call [[videoController captureManager] stopRecording]; but in recordingDidFinishToOutputFileURL I get an error which says:
Stop any other actions using the recording device and try again.
I would suggest putting the call to stop your video recording in your app delegate’s
applicationWillResignActive:method. This method is triggered when your app moves from being active to being inactive, which, according to the UIApplicationDelegate docs, occurs:The code would look something like this: