Compare commits

...

1 Commits

Author SHA1 Message Date
9e05ea15c1 Ensure custom exposure mode is supported 2024-10-09 17:59:22 -06:00

View File

@ -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()