CameraManager
CameraManager copied to clipboard
cameraManager.stopVideoRecording() doesn't seem to work on iOS 14.5
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() }