capacitor-camera-module 0.0.44 → 0.0.45
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.
|
@@ -5,7 +5,7 @@ import UIKit
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
@objc(CameraModule)
|
|
8
|
-
public class CameraModulePlugin: CAPPlugin,
|
|
8
|
+
public class CameraModulePlugin: CAPPlugin,CAPBridgedPlugin,
|
|
9
9
|
AVCaptureVideoDataOutputSampleBufferDelegate {
|
|
10
10
|
|
|
11
11
|
private var previewView: UIView?
|
|
@@ -26,26 +26,31 @@ public class CameraModulePlugin: CAPPlugin,
|
|
|
26
26
|
private var lastScanTime: Date?
|
|
27
27
|
private let scanDebounceInterval: TimeInterval = 0.5 // medio segundo
|
|
28
28
|
|
|
29
|
+
public let identifier = "CameraModule"
|
|
30
|
+
public let jsName = "CameraModule"
|
|
29
31
|
|
|
30
|
-
// MARK: - Lifecycle
|
|
31
32
|
|
|
32
|
-
public
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
public let pluginMethods: [CAPPluginMethod] = [
|
|
34
|
+
CAPPluginMethod(name: "checkPermission", returnType: CAPPluginReturnPromise),
|
|
35
|
+
CAPPluginMethod(name: "requestPermission", returnType: CAPPluginReturnPromise),
|
|
35
36
|
|
|
36
|
-
|
|
37
|
-
|
|
37
|
+
CAPPluginMethod(name: "startPreview", returnType: CAPPluginReturnPromise),
|
|
38
|
+
CAPPluginMethod(name: "stopPreview", returnType: CAPPluginReturnPromise),
|
|
38
39
|
|
|
39
|
-
|
|
40
|
-
|
|
40
|
+
CAPPluginMethod(name: "toggleFlash", returnType: CAPPluginReturnPromise),
|
|
41
|
+
CAPPluginMethod(name: "hasFlash", returnType: CAPPluginReturnPromise),
|
|
41
42
|
|
|
42
|
-
|
|
43
|
-
CAP_PLUGIN_METHOD(hasFlash, CAPPluginReturnPromise)
|
|
43
|
+
CAPPluginMethod(name: "takePhotoBase64", returnType: CAPPluginReturnPromise),
|
|
44
44
|
|
|
45
|
-
|
|
45
|
+
CAPPluginMethod(name: "startBarcodeScan", returnType: CAPPluginReturnPromise),
|
|
46
|
+
CAPPluginMethod(name: "stopBarcodeScan", returnType: CAPPluginReturnPromise)
|
|
47
|
+
]
|
|
46
48
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
+
// MARK: - Lifecycle
|
|
50
|
+
|
|
51
|
+
public override func load() {
|
|
52
|
+
bridge?.webView?.isOpaque = false
|
|
53
|
+
bridge?.webView?.backgroundColor = .clear
|
|
49
54
|
}
|
|
50
55
|
|
|
51
56
|
|