From 6319e5cc494e9f25921fa140a6e8c389aaa806b1 Mon Sep 17 00:00:00 2001 From: Marc Rousavy Date: Fri, 10 Dec 2021 09:57:05 +0100 Subject: [PATCH] fix: Fix torch staying on after recording a video (#584) --- ios/CameraView+RecordVideo.swift | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ios/CameraView+RecordVideo.swift b/ios/CameraView+RecordVideo.swift index bd8ba1f..5e39bb4 100644 --- a/ios/CameraView+RecordVideo.swift +++ b/ios/CameraView+RecordVideo.swift @@ -72,6 +72,10 @@ extension CameraView: AVCaptureVideoDataOutputSampleBufferDelegate, AVCaptureAud self.deactivateAudioSession() } } + if options["flash"] != nil { + // Set torch mode back to what it was before if we used it for the video flash. + self.setTorchMode(self.torch) + } } self.isRecording = false