You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 10, 2023. It is now read-only.
I think JPSVolumeButtonHandler might not be cleaning up after itself properly. If I initialize it once, then I can record videos fine. But if I set it to nil and it deallocates (when my view disappears), and then I initialize it again, I can't record videos anymore (Using AVCaptureMovieFileOutput#startRecordingToOutputFileURL).
The text was updated successfully, but these errors were encountered:
Aha, the problem was that JPSVolumeButtonHandler is calling setCategory and setActive on an AVAudioSession, which screwed up my video recording, maybe because I was also recording the audio from the microphone. Also, I think you should use self.session = [AVAudioSession sharedInstance]; instead of instantiating a new one, since it's a singleton object.
Do you know if calling setCategory and setActive is really necessary? My app is already calling them, but I commented out all the calls in my app, as well as in JPSVolumeButtonHandler, and I could still capture the volume buttons without any issues.
Oh, the sharedInstance thing was already fixed in this commit. Sorry, I was looking at the latest code I found on Cocoapods, which doesn't seem to be updated yet.
@ndbroadbent did commenting out setCategory and setActive work for you? I am running into the exact same problem on the most recent version (Jan 2015), when I modify those calls I can no longer use the volume buttons.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Please see my StackOverflow post for details: http://stackoverflow.com/questions/29312178/cant-call-startrecordingtooutputfileurl-more-than-once-on-instance-of-avcapture
I think
JPSVolumeButtonHandler
might not be cleaning up after itself properly. If I initialize it once, then I can record videos fine. But if I set it to nil and it deallocates (when my view disappears), and then I initialize it again, I can't record videos anymore (UsingAVCaptureMovieFileOutput#startRecordingToOutputFileURL
).The text was updated successfully, but these errors were encountered: