Awalz / SwiftyCam

A Snapchat Inspired iOS Camera Framework written in Swift
BSD 2-Clause "Simplified" License
2.08k stars 326 forks source link

didFinishRecordingVideo not getting called bug #169

Closed dadalar closed 5 years ago

dadalar commented 6 years ago

Fix a bug where didFinishRecordingVideo delegate method wasn't being called if stopVideoRecording gets called before the actual recording starts.

You can reproduce this issue by just stopping video recording as soon as it starts. Since the actual recording starts asynchronously, self.movieFileOutput?.isRecording doesn't get set to true yet and stopVideoRecording function doesn't do it's job. By making this change we try to stop even if the recording isn't started and it prints an error (which is something we want) but the delegate method gets called.

jonandersen commented 5 years ago

@dadalar There was some files that were removed and changed. Can you revert that?

dadalar commented 5 years ago

@jonandersen Thanks for the reply. I had to create a new pull request to change the branch. Please see https://github.com/Awalz/SwiftyCam/pull/192