I am using 'PBJVISION' in my app for Instagram like touch-to-record feature. It works fine but when I try to switch from PBJCameraMode.Video to PBJCameraMode.Photo, I am receiving an error;
reason: -[AVCaptureStillImageOutput captureStillImageAsynchronouslyFromConnection:completionHandler:] - inconsistent state.'
My code is pretty straightforward;
@IBAction func changeCameraModeAction(sender: AnyObject) {
if recordFlag == false {
PBJVision.sharedInstance().maximumCaptureDuration = CMTimeMakeWithSeconds(kTotalVideoLength, kVideoFramePerSec)
PBJVision.sharedInstance().cameraMode = PBJCameraMode.Video
recordFlag = true
} else {
progressBarView.hidden = true
PBJVision.sharedInstance().cameraMode = PBJCameraMode.Photo
recordFlag = false
}
}
Can you please help me?
Thanks, E.