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

cameraManager.stopVideoRecording() doesn't seem to work on iOS 14.5

Nerway opened this issue · comments

Stopped working on iOS 14.5 update.

The solution is to request for readWrite authorization after iOS 14's privacy policy updates.
Check info.plist for Privacy - Photo Library .... updates.

PHPhotoLibrary.requestAuthorization(for: .readWrite) { status in
switch status {
case .notDetermined:
case .restricted:
case .denied:
case .authorized:
case .limited:
@unknown default:
}
}

  • Also, Apple's official article about this states:
    "After the user sets the app’s authorization status, the system remembers their choice and won’t prompt them again. However, the user can change this choice at any time using the Settings app. Prepare your app to respond appropriately when a user changes your appʼs access."

Please follow the instructions:

cameraManager.addLayerPreviewToView(cameraView, newCameraOutputMode: .videoOnly) {
self.cameraManager.startRecordingVideo()
}