diff --git a/package/ios/Core/CameraSession+Video.swift b/package/ios/Core/CameraSession+Video.swift index 5489997..53d72ab 100644 --- a/package/ios/Core/CameraSession+Video.swift +++ b/package/ios/Core/CameraSession+Video.swift @@ -18,7 +18,7 @@ extension CameraSession { filePath: String, onVideoRecorded: @escaping (_ video: Video) -> Void, onError: @escaping (_ error: CameraError) -> Void) { - + lockCurrentExposure(for: captureSession) // Run on Camera Queue CameraQueues.cameraQueue.async { @@ -36,7 +36,7 @@ extension CameraSession { } let enableAudio = self.configuration?.audio != .disabled - + // Callback for when new chunks are ready let onChunkReady: (ChunkedRecorder.Chunk) -> Void = { chunk in guard let delegate = self.delegate else { @@ -193,13 +193,18 @@ extension CameraSession { } } } - + func lockCurrentExposure(for session: AVCaptureSession) { guard let captureDevice = AVCaptureDevice.default(for: .video) else { print("No capture device available") return } + guard captureDevice.isExposureModeSupported(.custom) else { + ReactLogger.log(level: .info, message: "Custom exposure mode not supported") + return + } + do { // Lock the device for configuration try captureDevice.lockForConfiguration()