capacitor-camera-view 1.1.0 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -40,6 +40,15 @@ extension CameraViewManager: AVCaptureMetadataOutputObjectsDelegate {
|
|
|
40
40
|
]
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
+
/// Remove the metadata output if in case it is already configured, e.g. because
|
|
44
|
+
/// the camera is restarted with a diffrent setting where barcode detection was disabled
|
|
45
|
+
/// again
|
|
46
|
+
internal func removeMetadataOutput() {
|
|
47
|
+
if let metadataOutput = captureSession.outputs.first(where: { $0 is AVCaptureMetadataOutput }) {
|
|
48
|
+
captureSession.removeOutput(metadataOutput)
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
43
52
|
/// Delegate method called when metadata objects are detected in the camera feed
|
|
44
53
|
///
|
|
45
54
|
/// This method processes barcode data detected in the camera stream. When a barcode is detected,
|
|
@@ -318,6 +318,10 @@ internal let SUPPORTED_CAMERA_DEVICE_TYPES: [AVCaptureDevice.DeviceType] = [
|
|
|
318
318
|
// Setup metadata output for QR code scanning if enabled
|
|
319
319
|
if configuration.enableBarcodeDetection {
|
|
320
320
|
try setupMetadataOutput()
|
|
321
|
+
} else {
|
|
322
|
+
// Remove the metadata output in case it already existed for the
|
|
323
|
+
// capture session
|
|
324
|
+
removeMetadataOutput()
|
|
321
325
|
}
|
|
322
326
|
|
|
323
327
|
// Set the initial zoom factor if specified
|
package/package.json
CHANGED