         }
     }
     
-    fileprivate func _updateFlashMode(_ flashMode: CameraFlashMode) {
+    fileprivate func _updateIlluminationMode(_ mode: CameraFlashMode) {
+        if (cameraOutputMode != .stillImage) {
+            _updateTorch(mode)
+        } else {
+            _updateFlash(mode)
+        }
+    }
+    
+    fileprivate func _updateTorch(_ torchMode: CameraFlashMode) {
+        captureSession?.beginConfiguration()
+        defer { captureSession?.commitConfiguration() }
+        for captureDevice in AVCaptureDevice.videoDevices  {
+            guard let avTorchMode = AVCaptureDevice.TorchMode(rawValue: flashMode.rawValue) else { continue }
+            if captureDevice.isTorchModeSupported(avTorchMode) && cameraDevice == .back {
+                do {
+                    try captureDevice.lockForConfiguration()
+                } catch {
+                    return
+                }
+                
+                captureDevice.torchMode = avTorchMode
+                captureDevice.unlockForConfiguration()
+            }
+        }
+    }
+    
+    fileprivate func _updateFlash(_ flashMode: CameraFlashMode) {
         captureSession?.beginConfiguration()
         defer { captureSession?.commitConfiguration() }
         for captureDevice in AVCaptureDevice.videoDevices  {
             guard let avFlashMode = AVCaptureDevice.FlashMode(rawValue: flashMode.rawValue) else { continue }
-            if captureDevice.isFlashModeSupported(avFlashMode) {
+            if captureDevice.isFlashModeSupported(avFlashMode) && cameraDevice == .back  {
                 do {
                     try captureDevice.lockForConfiguration()
                 } catch {
                     return
                 }
+                
                 captureDevice.flashMode = avFlashMode
                 captureDevice.unlockForConfiguration()
             }
         }
-        
     }
     
     fileprivate func _performShutterAnimation(_ completion: (() -> Void)?) {

    public func fileOutput(captureOutput: AVCaptureFileOutput, didStartRecordingTo fileURL: URL, from connections: [AVCaptureConnection]) {
        captureSession?.beginConfiguration()
        if flashMode != .off {
            _updateFlashMode(flashMode)
        }
        
        captureSession?.commitConfiguration()
    }
    
    open func fileOutput(_ captureOutput: AVCaptureFileOutput, didFinishRecordingTo outputFileURL: URL, from connections: [AVCaptureConnection], error: Error?) {
        _updateFlashMode(.off)
        if let error = error {
            _show(NSLocalizedString("Unable to save video to the device", comment:""), message: error.localizedDescription)
        } else {

            let inputPort = newLocationMetadataInput.ports[0]
            captureSession.add(AVCaptureConnection(inputPorts: [inputPort], output: videoOutput))
            
            _updateIlluminationMode(flashMode)
            
            videoOutput.startRecording(to: _tempFilePath(), recordingDelegate: self)
        } else {
