imaginary-cloud / CameraManager

Simple Swift class to provide all the configurations you need to create custom camera view in your app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Camera freeze when enter background then comeback

summonerriftofficial opened this issue · comments

Will, their new problem related to freezing camera, when I enter the background then back to the app the camera just freeze ad after multiple try it may come again,

I guess it's related to iOS 13 update, please can you investigate?

@summonerriftofficial

I've just tested the Example App from CameraManager v5.1.0 with iOS v13.4.1 and it works just fine. If you are not using the latest version v5.1.0, can you please try with that one?

please see this video,

RPReplay_Final1586804140.MP4.zip

also if I try to record in that case, I got that error

Error Domain=AVFoundationErrorDomain Code=-11803 "Cannot Record" UserInfo={NSLocalizedRecoverySuggestion=Try recording again., NSLocalizedDescription=Cannot Record, NSUnderlyingError=0x2802eb420 {Error Domain=NSOSStatusErrorDomain Code=-16409 "(null)"}}

also, I have to mention that this only happened when I push the view controller and not present it

using self.navigationController?.pushViewController(videoStudio, animated: true)

@ahmedsafadii

thanks for the feedback, I will look into it.

@ahmedsafadii

I've set up an example app which uses the using self.navigationController?.pushViewController(cameraManagerVC, animated: true) and didn't have any problems with it - using version v5.1.1.

Also, don't forget to make sure that the captureSession is running, especially when the videoStudio is pushed/popped or the app enters/leaves foreground, via cameraManager.resumeCaptureSession() and cameraManager.stopCaptureSession().

I try the example but something happened for the first layer it looks blue :/

and when I use the example it's work fine when I add it to my app it's freeze and I can confirm that it's the same example project.

@ahmedsafadii

just to make sure, did you update to CameraManager v5.1.1?

Same issue here with the 5.1.3. I had to use willEnterForegroundNotification and resumeCaptureSession to make it work.

not doing addLayerPreviewToView in the viewDidLoad make this happen for me.