Open leobuckman opened 2 years ago
Same issue for me as well.
I think the problem is that toggleMovieRecording() in CameraView is called repetitively while events.didAskToRecordVideo is true, thus causing the video to toggle on and off near instantly. I think we need a solution to ensure it is only called and run once per call to toggleVideoRecording().
*Update - I added a simple boolean to CameraViewController (public var inProgress: Bool = false) and changed CameraView to this and it works:
**Update - The same issue occurs for the camera flipping. Add a boolean in CameraViewController (public var isCameraFlipping: Bool = false) and add this to CameraView: Also, set the boolean back to false at the last line of rotateCamera()
Crashes with error message:
Movie file finishing error: Optional(Error Domain=AVFoundationErrorDomain Code=-11859 "Movie recording cannot be started" UserInfo={NSUnderlyingError=0x281c02df0 {Error Domain=NSOSStatusErrorDomain Code=-16419 "(null)"}, NSLocalizedFailureReason=A movie recording is already in progress., NSLocalizedRecoverySuggestion=Stop the movie recording in progress and try again., AVErrorRecordingFailureDomainKey=1, NSLocalizedDescription=Movie recording cannot be started})
Crashes in this part of CameraViewController:
if error != nil { print("Movie file finishing error: \(String(describing: error))") success = (((error! as NSError).userInfo[AVErrorRecordingSuccessfullyFinishedKey] as AnyObject).boolValue)! }
Any idea as to why this is happening?