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.
I had the same error when before I took down and set up the AVCaptureSession.
I only had spotted in iPhone 6.
Something it happen even when I do this in the main thread. I haven't use PBJVISION though. My error
I will update if I get more insight on this.