capacitor-camera-module 0.0.49 → 0.0.50
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.
|
@@ -7,6 +7,27 @@ import Photos
|
|
|
7
7
|
@objc(CameraModule)
|
|
8
8
|
public class CameraModulePlugin: CAPPlugin,CAPBridgedPlugin,AVCaptureVideoDataOutputSampleBufferDelegate {
|
|
9
9
|
|
|
10
|
+
|
|
11
|
+
public let identifier = "CameraModule"
|
|
12
|
+
public let jsName = "CameraModule"
|
|
13
|
+
public let pluginMethods: [CAPPluginMethod] = [
|
|
14
|
+
CAPPluginMethod(name: "checkPermission", returnType: CAPPluginReturnPromise),
|
|
15
|
+
CAPPluginMethod(name: "requestPermission", returnType: CAPPluginReturnPromise),
|
|
16
|
+
CAPPluginMethod(name: "checkGalleryPermission", returnType: CAPPluginReturnPromise),
|
|
17
|
+
CAPPluginMethod(name: "requestGalleryPermission", returnType: CAPPluginReturnPromise),
|
|
18
|
+
CAPPluginMethod(name: "checkAndRequestGalleryPermission", returnType: CAPPluginReturnPromise),
|
|
19
|
+
CAPPluginMethod(name: "pickImageBase64", returnType: CAPPluginReturnPromise),
|
|
20
|
+
CAPPluginMethod(name: "startPreview", returnType: CAPPluginReturnPromise),
|
|
21
|
+
CAPPluginMethod(name: "stopPreview", returnType: CAPPluginReturnPromise),
|
|
22
|
+
CAPPluginMethod(name: "toggleFlash", returnType: CAPPluginReturnPromise),
|
|
23
|
+
CAPPluginMethod(name: "hasFlash", returnType: CAPPluginReturnPromise),
|
|
24
|
+
CAPPluginMethod(name: "takePhotoBase64", returnType: CAPPluginReturnPromise),
|
|
25
|
+
CAPPluginMethod(name: "startBarcodeScan", returnType: CAPPluginReturnPromise),
|
|
26
|
+
CAPPluginMethod(name: "stopBarcodeScan", returnType: CAPPluginReturnPromise)
|
|
27
|
+
|
|
28
|
+
]
|
|
29
|
+
|
|
30
|
+
|
|
10
31
|
private var previewView: UIView?
|
|
11
32
|
private var captureSession: AVCaptureSession?
|
|
12
33
|
private var videoPreviewLayer: AVCaptureVideoPreviewLayer?
|
|
@@ -27,30 +48,6 @@ public class CameraModulePlugin: CAPPlugin,CAPBridgedPlugin,AVCaptureVideoDataOu
|
|
|
27
48
|
|
|
28
49
|
private var galleryCall: CAPPluginCall?
|
|
29
50
|
|
|
30
|
-
// MARK: - Capacitor Bridge
|
|
31
|
-
|
|
32
|
-
public static let identifier = "CameraModule"
|
|
33
|
-
public static let jsName = "CameraModule"
|
|
34
|
-
public let pluginMethods: [CAPPluginMethod] = [
|
|
35
|
-
CAPPluginMethod(name: "checkPermission", returnType: CAPPluginReturnPromise),
|
|
36
|
-
CAPPluginMethod(name: "requestPermission", returnType: CAPPluginReturnPromise),
|
|
37
|
-
CAPPluginMethod(name: "checkGalleryPermission", returnType: CAPPluginReturnPromise),
|
|
38
|
-
CAPPluginMethod(name: "requestGalleryPermission", returnType: CAPPluginReturnPromise),
|
|
39
|
-
CAPPluginMethod(name: "checkAndRequestGalleryPermission", returnType: CAPPluginReturnPromise),
|
|
40
|
-
CAPPluginMethod(name: "pickImageBase64", returnType: CAPPluginReturnPromise),
|
|
41
|
-
CAPPluginMethod(name: "startPreview", returnType: CAPPluginReturnPromise),
|
|
42
|
-
CAPPluginMethod(name: "stopPreview", returnType: CAPPluginReturnPromise),
|
|
43
|
-
CAPPluginMethod(name: "toggleFlash", returnType: CAPPluginReturnPromise),
|
|
44
|
-
CAPPluginMethod(name: "hasFlash", returnType: CAPPluginReturnPromise),
|
|
45
|
-
CAPPluginMethod(name: "takePhotoBase64", returnType: CAPPluginReturnPromise),
|
|
46
|
-
CAPPluginMethod(name: "startBarcodeScan", returnType: CAPPluginReturnPromise),
|
|
47
|
-
CAPPluginMethod(name: "stopBarcodeScan", returnType: CAPPluginReturnPromise)
|
|
48
|
-
|
|
49
|
-
]
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
51
|
// MARK: - Lifecycle
|
|
55
52
|
|
|
56
53
|
public override func load() {
|