File tree Expand file tree Collapse file tree
android/src/main/java/com/michaelwolz/capacitorcameraview
ios/Sources/CameraViewPlugin Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -79,6 +79,8 @@ class CameraView(plugin: Plugin) {
7979 // Store references for later use
8080 this .lifecycleOwner = lifecycleOwner
8181
82+ isTorchEnabled = false
83+
8284 mainHandler.post {
8385 try {
8486 initializeCamera(context, lifecycleOwner, config)
@@ -106,6 +108,8 @@ class CameraView(plugin: Plugin) {
106108 }
107109 }
108110
111+ isTorchEnabled = false
112+
109113 webView.setLayerType(WebView .LAYER_TYPE_NONE , null )
110114 webView.setBackgroundColor(android.graphics.Color .WHITE )
111115
Original file line number Diff line number Diff line change @@ -73,6 +73,9 @@ internal let SUPPORTED_CAMERA_DEVICE_TYPES: [AVCaptureDevice.DeviceType] = [
7373 self . preferredCameraDeviceTypes = convertToNativeCameraTypes ( preferredCameraDeviceTypes)
7474 }
7575
76+ torchEnabled = false
77+ torchLevel = 1.0
78+
7679 DispatchQueue . global ( qos: . userInitiated) . async { [ weak self] in
7780 guard let self = self else { return }
7881
@@ -111,6 +114,9 @@ internal let SUPPORTED_CAMERA_DEVICE_TYPES: [AVCaptureDevice.DeviceType] = [
111114 public func stopSession( ) {
112115 guard captureSession. isRunning else { return }
113116
117+ torchEnabled = false
118+ torchLevel = 1.0
119+
114120 DispatchQueue . global ( qos: . userInitiated) . async { [ weak self] in
115121 self ? . captureSession. stopRunning ( )
116122 }
You can’t perform that action at this time.
0 commit comments