capacitor-camera-module 0.0.4 → 0.0.7

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.
package/README.md CHANGED
@@ -18,6 +18,8 @@ npx cap sync
18
18
  * [`requestPermission()`](#requestpermission)
19
19
  * [`checkAndRequestPermission()`](#checkandrequestpermission)
20
20
  * [`getCameraCapabilities()`](#getcameracapabilities)
21
+ * [`startPreview()`](#startpreview)
22
+ * [`stopPreview()`](#stoppreview)
21
23
  * [Interfaces](#interfaces)
22
24
 
23
25
  </docgen-index>
@@ -84,6 +86,24 @@ getCameraCapabilities() => Promise<CameraCapabilities>
84
86
  --------------------
85
87
 
86
88
 
89
+ ### startPreview()
90
+
91
+ ```typescript
92
+ startPreview() => Promise<void>
93
+ ```
94
+
95
+ --------------------
96
+
97
+
98
+ ### stopPreview()
99
+
100
+ ```typescript
101
+ stopPreview() => Promise<void>
102
+ ```
103
+
104
+ --------------------
105
+
106
+
87
107
  ### Interfaces
88
108
 
89
109
 
@@ -40,7 +40,7 @@ android {
40
40
  sourceCompatibility JavaVersion.VERSION_21
41
41
  targetCompatibility JavaVersion.VERSION_21
42
42
  }
43
- }
43
+
44
44
 
45
45
  repositories {
46
46
  google()
@@ -58,4 +58,8 @@ dependencies {
58
58
 
59
59
  implementation 'androidx.activity:activity:1.7.0'
60
60
  implementation 'androidx.fragment:fragment:1.5.7'
61
+
62
+ implementation "androidx.camera:camera-camera2:1.3.2"
63
+ implementation "androidx.camera:camera-lifecycle:1.3.2"
64
+ implementation "androidx.camera:camera-view:1.3.2"
61
65
  }
@@ -8,5 +8,6 @@
8
8
  <uses-feature android:name="android.hardware.camera" android:required="false" />
9
9
  <uses-feature android:name="android.hardware.camera.front" android:required="false" />
10
10
  <uses-feature android:name="android.hardware.camera.autofocus" android:required="false" />
11
+ <uses-feature android:name="android.hardware.camera.any" android:required="false" />
11
12
 
12
13
  </manifest>
@@ -26,6 +26,12 @@ import com.getcapacitor.annotation.PermissionCallback;
26
26
  )
27
27
  public class CameraModulePlugin extends Plugin {
28
28
 
29
+ @Override
30
+ public void load() {
31
+ super.load();
32
+ getBridge().getWebView().setBackgroundColor(0x00000000);
33
+ }
34
+
29
35
  @PluginMethod
30
36
  public void echo(PluginCall call) {
31
37
  String value = call.getString("value", "");
@@ -111,4 +117,70 @@ public class CameraModulePlugin extends Plugin {
111
117
 
112
118
  call.resolve(ret);
113
119
  }
120
+
121
+
122
+ //Camera
123
+ @PluginMethod
124
+ public void startPreview(PluginCall call) {
125
+ getActivity().runOnUiThread(() -> {
126
+ previewView = new PreviewView(getContext());
127
+ previewView.setLayoutParams(
128
+ new FrameLayout.LayoutParams(
129
+ FrameLayout.LayoutParams.MATCH_PARENT,
130
+ FrameLayout.LayoutParams.MATCH_PARENT
131
+ )
132
+ );
133
+
134
+ ViewGroup rootView = (ViewGroup) getActivity().getWindow().getDecorView();
135
+ rootView.addView(previewView, 0);
136
+
137
+ startCamera();
138
+
139
+ call.resolve();
140
+ });
141
+ }
142
+
143
+ private void startCamera() {
144
+ ListenableFuture<ProcessCameraProvider> cameraProviderFuture =
145
+ ProcessCameraProvider.getInstance(getContext());
146
+
147
+ cameraProviderFuture.addListener(() -> {
148
+ try {
149
+ cameraProvider = cameraProviderFuture.get();
150
+
151
+ Preview preview = new Preview.Builder().build();
152
+ preview.setSurfaceProvider(previewView.getSurfaceProvider());
153
+
154
+ cameraSelector = CameraSelector.DEFAULT_BACK_CAMERA;
155
+
156
+ cameraProvider.unbindAll();
157
+ cameraProvider.bindToLifecycle(
158
+ getActivity(),
159
+ cameraSelector,
160
+ preview
161
+ );
162
+ } catch (Exception e) {
163
+ e.printStackTrace();
164
+ }
165
+ }, ContextCompat.getMainExecutor(getContext()));
166
+ }
167
+
168
+ @PluginMethod
169
+ public void stopPreview(PluginCall call) {
170
+ getActivity().runOnUiThread(() -> {
171
+ if (cameraProvider != null) {
172
+ cameraProvider.unbindAll();
173
+ }
174
+
175
+ if (previewView != null) {
176
+ ViewGroup rootView = (ViewGroup) previewView.getParent();
177
+ rootView.removeView(previewView);
178
+ previewView = null;
179
+ }
180
+
181
+ call.resolve();
182
+ });
183
+ }
184
+
185
+
114
186
  }
package/dist/docs.json CHANGED
@@ -68,6 +68,26 @@
68
68
  "CameraCapabilities"
69
69
  ],
70
70
  "slug": "getcameracapabilities"
71
+ },
72
+ {
73
+ "name": "startPreview",
74
+ "signature": "() => Promise<void>",
75
+ "parameters": [],
76
+ "returns": "Promise<void>",
77
+ "tags": [],
78
+ "docs": "",
79
+ "complexTypes": [],
80
+ "slug": "startpreview"
81
+ },
82
+ {
83
+ "name": "stopPreview",
84
+ "signature": "() => Promise<void>",
85
+ "parameters": [],
86
+ "returns": "Promise<void>",
87
+ "tags": [],
88
+ "docs": "",
89
+ "complexTypes": [],
90
+ "slug": "stoppreview"
71
91
  }
72
92
  ],
73
93
  "properties": []
@@ -8,6 +8,8 @@ export interface CameraModulePlugin {
8
8
  requestPermission(): Promise<PermissionStatus>;
9
9
  checkAndRequestPermission(): Promise<PermissionStatus>;
10
10
  getCameraCapabilities(): Promise<CameraCapabilities>;
11
+ startPreview(): Promise<void>;
12
+ stopPreview(): Promise<void>;
11
13
  }
12
14
  export interface PermissionStatus {
13
15
  granted: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"","sourcesContent":["export interface CameraModulePlugin {\n\n echo(options: { value: string }): Promise<{ value: string }>;\n\n checkPermission(): Promise<PermissionStatus>;\n\n requestPermission(): Promise<PermissionStatus>;\n\n checkAndRequestPermission(): Promise<PermissionStatus>;\n\n getCameraCapabilities(): Promise<CameraCapabilities>;\n}\n\nexport interface PermissionStatus {\n granted: boolean;\n status: 'granted' | 'denied' | 'prompt' | 'prompt-with-rationale' | 'limited';\n details?: string;\n}\n\n\nexport interface CameraCapabilities {\n hasCamera: boolean;\n isSecureContext: boolean;\n userAgent: string;\n}"]}
1
+ {"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"","sourcesContent":["export interface CameraModulePlugin {\n echo(options: { value: string }): Promise<{ value: string }>;\n\n checkPermission(): Promise<PermissionStatus>;\n\n requestPermission(): Promise<PermissionStatus>;\n\n checkAndRequestPermission(): Promise<PermissionStatus>;\n\n getCameraCapabilities(): Promise<CameraCapabilities>;\n\n startPreview(): Promise<void>;\n\n stopPreview(): Promise<void>;\n\n}\n\nexport interface PermissionStatus {\n granted: boolean;\n status: 'granted' | 'denied' | 'prompt' | 'prompt-with-rationale' | 'limited';\n details?: string;\n}\n\n\nexport interface CameraCapabilities {\n hasCamera: boolean;\n isSecureContext: boolean;\n userAgent: string;\n}"]}
package/dist/esm/web.d.ts CHANGED
@@ -14,4 +14,6 @@ export declare class CameraModuleWeb extends WebPlugin implements CameraModulePl
14
14
  isSecureContext: boolean;
15
15
  userAgent: string;
16
16
  }>;
17
+ startPreview(): Promise<void>;
18
+ stopPreview(): Promise<void>;
17
19
  }
package/dist/esm/web.js CHANGED
@@ -152,5 +152,12 @@ export class CameraModuleWeb extends WebPlugin {
152
152
  userAgent: navigator.userAgent,
153
153
  };
154
154
  }
155
+ //Camera Preview
156
+ async startPreview() {
157
+ console.warn('[CameraModule] startPreview is not supported on web');
158
+ }
159
+ async stopPreview() {
160
+ console.warn('[CameraModule] stopPreview is not supported on web');
161
+ }
155
162
  }
156
163
  //# sourceMappingURL=web.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAI5C,MAAM,OAAO,eAAgB,SAAQ,SAAS;IAC5C,KAAK,CAAC,IAAI,CAAC,OAA0B;QACnC,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAC7B,OAAO,OAAO,CAAC;IACjB,CAAC;IAED,KAAK,CAAC,eAAe;;QACnB,+EA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C,qCAAqC,EAAE,KAAK,CAAC,CAAC;YAC5D,OAAO;gBACL,OAAO,EAAE,KAAK;gBACd,MAAM,EAAE,QAAQ;gBAChB,OAAO,EAAE,uCAAuC;aACjD,CAAC;QACJ,CAAC;IACH,CAAC;IAED,6DAA6D;IAC7D,KAAK,CAAC,qBAAqB;;QAKzB,MAAM,eAAe,GAAG,CAAC,CAAC,CAAA,MAAA,SAAS,CAAC,YAAY,0CAAE,gBAAgB,CAAA,CAAC;QACnE,MAAM,eAAe,GAAG,CAAC,CAAC,CAAA,MAAA,SAAS,CAAC,YAAY,0CAAE,YAAY,CAAA,CAAC;QAE/D,IAAI,SAAS,GAAG,KAAK,CAAC;QAEtB,IAAI,eAAe,IAAI,eAAe,EAAE,CAAC;YACvC,IAAI,CAAC;gBACH,MAAM,OAAO,GAAG,MAAM,SAAS,CAAC,YAAY,CAAC,gBAAgB,EAAE,CAAC;gBAChE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,KAAK,YAAY,CAAC,CAAC;YACrE,CAAC;YAAC,WAAM,CAAC;gBACP,SAAS,GAAG,KAAK,CAAC;YACpB,CAAC;QACH,CAAC;QAED,OAAO;YACL,SAAS;YACT,eAAe,EAAE,MAAM,CAAC,eAAe;YACvC,SAAS,EAAE,SAAS,CAAC,SAAS;SAC/B,CAAC;IACJ,CAAC;CACF","sourcesContent":["import { WebPlugin } from '@capacitor/core';\n\nimport type { CameraModulePlugin, PermissionStatus } from './definitions';\n\nexport class CameraModuleWeb extends WebPlugin implements CameraModulePlugin {\n async echo(options: { value: string }): Promise<{ value: string }> {\n console.log('ECHO', options);\n return options;\n }\n\n async checkPermission(): Promise<PermissionStatus> {\n // Verificar disponibilidad de APIs - usando prefijo _ para variables no usadas\n const hasMediaDevices = !!navigator.mediaDevices?.enumerateDevices;\n const _hasGetUserMedia = !!navigator.mediaDevices?.getUserMedia; // Prefijo _\n\n if (!hasMediaDevices || !_hasGetUserMedia) {\n throw this.unavailable('Camera API no disponible en este navegador');\n }\n\n try {\n const devices = await navigator.mediaDevices.enumerateDevices();\n const videoDevices = devices.filter((device) => device.kind === 'videoinput');\n\n // No hay dispositivos de cámara\n if (videoDevices.length === 0) {\n return {\n granted: false,\n status: 'denied',\n details: 'No camera devices found',\n };\n }\n\n // Verificar si algún dispositivo tiene label (indica permiso)\n const hasPermission = videoDevices.some((device) => device.label && device.label.trim() !== '');\n\n // Determinar estado más preciso\n let status: PermissionStatus['status'] = 'denied';\n if (hasPermission) {\n status = 'granted';\n } else {\n // En web, sin intentar getUserMedia, asumimos que es la primera vez\n status = 'prompt';\n }\n\n return {\n granted: hasPermission,\n status,\n details: `Found ${videoDevices.length} camera device(s)`,\n };\n } catch (error: any) {\n console.error('Error checking camera permission:', error);\n return {\n granted: false,\n status: 'denied',\n details: error.message || 'Unknown error',\n };\n }\n }\n\n async requestPermission(): Promise<PermissionStatus> {\n // Verificar getUserMedia específicamente para este método\n if (!navigator.mediaDevices?.getUserMedia) {\n throw this.unavailable('Camera API no disponible en este navegador');\n }\n\n try {\n // Intentar acceder a la cámara con configuración mínima\n const stream = await navigator.mediaDevices.getUserMedia({\n video: {\n width: { ideal: 1280 },\n height: { ideal: 720 },\n facingMode: { ideal: 'environment' },\n },\n audio: false,\n });\n\n // Limpiar recursos inmediatamente\n stream.getTracks().forEach((track) => {\n track.stop();\n });\n\n return {\n granted: true,\n status: 'granted',\n details: 'Permission granted successfully',\n };\n } catch (error: any) {\n console.error('Error requesting camera permission:', error);\n\n // Manejo específico de errores\n let status: PermissionStatus['status'] = 'denied';\n let details = error.message || 'Unknown error';\n\n if (error.name === 'NotAllowedError') {\n status = 'denied';\n details = 'User denied camera access';\n } else if (error.name === 'NotFoundError') {\n status = 'denied';\n details = 'No camera found';\n } else if (error.name === 'NotReadableError') {\n status = 'denied';\n details = 'Camera is already in use';\n } else if (error.name === 'OverconstrainedError') {\n status = 'denied';\n details = 'Camera constraints cannot be met';\n } else if (error.name === 'SecurityError') {\n status = 'denied';\n details = 'Camera access blocked by browser security settings';\n } else if (error.name === 'TypeError') {\n status = 'denied';\n details = 'Invalid constraints specified';\n }\n\n return {\n granted: false,\n status,\n details,\n };\n }\n }\n\n async checkAndRequestPermission(): Promise<PermissionStatus> {\n try {\n // Primero verificar el estado actual\n const currentStatus = await this.checkPermission();\n\n // Si ya tiene permiso, retornar inmediatamente\n if (currentStatus.granted) {\n return currentStatus;\n }\n\n // Si no tiene permiso, solicitar\n return await this.requestPermission();\n } catch (error) {\n console.error('Error in checkAndRequestPermission:', error);\n return {\n granted: false,\n status: 'denied',\n details: 'Failed to check or request permission',\n };\n }\n }\n\n // Método adicional para verificar soporte de características\n async getCameraCapabilities(): Promise<{\n hasCamera: boolean;\n isSecureContext: boolean;\n userAgent: string;\n }> {\n const hasMediaDevices = !!navigator.mediaDevices?.enumerateDevices;\n const hasGetUserMedia = !!navigator.mediaDevices?.getUserMedia;\n\n let hasCamera = false;\n\n if (hasMediaDevices || hasGetUserMedia) {\n try {\n const devices = await navigator.mediaDevices.enumerateDevices();\n hasCamera = devices.some((device) => device.kind === 'videoinput');\n } catch {\n hasCamera = false;\n }\n }\n\n return {\n hasCamera,\n isSecureContext: window.isSecureContext,\n userAgent: navigator.userAgent,\n };\n }\n}\n"]}
1
+ {"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAI5C,MAAM,OAAO,eAAgB,SAAQ,SAAS;IAC5C,KAAK,CAAC,IAAI,CAAC,OAA0B;QACnC,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAC7B,OAAO,OAAO,CAAC;IACjB,CAAC;IAED,KAAK,CAAC,eAAe;;QACnB,+EAA+E;QAC/E,MAAM,eAAe,GAAG,CAAC,CAAC,CAAA,MAAA,SAAS,CAAC,YAAY,0CAAE,gBAAgB,CAAA,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Q;gBAChB,OAAO,EAAE,uCAAuC;aACjD,CAAC;QACJ,CAAC;IACH,CAAC;IAED,6DAA6D;IAC7D,KAAK,CAAC,qBAAqB;;QAKzB,MAAM,eAAe,GAAG,CAAC,CAAC,CAAA,MAAA,SAAS,CAAC,YAAY,0CAAE,gBAAgB,CAAA,CAAC;QACnE,MAAM,eAAe,GAAG,CAAC,CAAC,CAAA,MAAA,SAAS,CAAC,YAAY,0CAAE,YAAY,CAAA,CAAC;QAE/D,IAAI,SAAS,GAAG,KAAK,CAAC;QAEtB,IAAI,eAAe,IAAI,eAAe,EAAE,CAAC;YACvC,IAAI,CAAC;gBACH,MAAM,OAAO,GAAG,MAAM,SAAS,CAAC,YAAY,CAAC,gBAAgB,EAAE,CAAC;gBAChE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,KAAK,YAAY,CAAC,CAAC;YACrE,CAAC;YAAC,WAAM,CAAC;gBACP,SAAS,GAAG,KAAK,CAAC;YACpB,CAAC;QACH,CAAC;QAED,OAAO;YACL,SAAS;YACT,eAAe,EAAE,MAAM,CAAC,eAAe;YACvC,SAAS,EAAE,SAAS,CAAC,SAAS;SAC/B,CAAC;IACJ,CAAC;IAED,gBAAgB;IAChB,KAAK,CAAC,YAAY;QAChB,OAAO,CAAC,IAAI,CAAC,qDAAqD,CAAC,CAAC;IACtE,CAAC;IAED,KAAK,CAAC,WAAW;QACf,OAAO,CAAC,IAAI,CAAC,oDAAoD,CAAC,CAAC;IACrE,CAAC;CACF","sourcesContent":["import { WebPlugin } from '@capacitor/core';\n\nimport type { CameraModulePlugin, PermissionStatus } from './definitions';\n\nexport class CameraModuleWeb extends WebPlugin implements CameraModulePlugin {\n async echo(options: { value: string }): Promise<{ value: string }> {\n console.log('ECHO', options);\n return options;\n }\n\n async checkPermission(): Promise<PermissionStatus> {\n // Verificar disponibilidad de APIs - usando prefijo _ para variables no usadas\n const hasMediaDevices = !!navigator.mediaDevices?.enumerateDevices;\n const _hasGetUserMedia = !!navigator.mediaDevices?.getUserMedia; // Prefijo _\n\n if (!hasMediaDevices || !_hasGetUserMedia) {\n throw this.unavailable('Camera API no disponible en este navegador');\n }\n\n try {\n const devices = await navigator.mediaDevices.enumerateDevices();\n const videoDevices = devices.filter((device) => device.kind === 'videoinput');\n\n // No hay dispositivos de cámara\n if (videoDevices.length === 0) {\n return {\n granted: false,\n status: 'denied',\n details: 'No camera devices found',\n };\n }\n\n // Verificar si algún dispositivo tiene label (indica permiso)\n const hasPermission = videoDevices.some((device) => device.label && device.label.trim() !== '');\n\n // Determinar estado más preciso\n let status: PermissionStatus['status'] = 'denied';\n if (hasPermission) {\n status = 'granted';\n } else {\n // En web, sin intentar getUserMedia, asumimos que es la primera vez\n status = 'prompt';\n }\n\n return {\n granted: hasPermission,\n status,\n details: `Found ${videoDevices.length} camera device(s)`,\n };\n } catch (error: any) {\n console.error('Error checking camera permission:', error);\n return {\n granted: false,\n status: 'denied',\n details: error.message || 'Unknown error',\n };\n }\n }\n\n async requestPermission(): Promise<PermissionStatus> {\n // Verificar getUserMedia específicamente para este método\n if (!navigator.mediaDevices?.getUserMedia) {\n throw this.unavailable('Camera API no disponible en este navegador');\n }\n\n try {\n // Intentar acceder a la cámara con configuración mínima\n const stream = await navigator.mediaDevices.getUserMedia({\n video: {\n width: { ideal: 1280 },\n height: { ideal: 720 },\n facingMode: { ideal: 'environment' },\n },\n audio: false,\n });\n\n // Limpiar recursos inmediatamente\n stream.getTracks().forEach((track) => {\n track.stop();\n });\n\n return {\n granted: true,\n status: 'granted',\n details: 'Permission granted successfully',\n };\n } catch (error: any) {\n console.error('Error requesting camera permission:', error);\n\n // Manejo específico de errores\n let status: PermissionStatus['status'] = 'denied';\n let details = error.message || 'Unknown error';\n\n if (error.name === 'NotAllowedError') {\n status = 'denied';\n details = 'User denied camera access';\n } else if (error.name === 'NotFoundError') {\n status = 'denied';\n details = 'No camera found';\n } else if (error.name === 'NotReadableError') {\n status = 'denied';\n details = 'Camera is already in use';\n } else if (error.name === 'OverconstrainedError') {\n status = 'denied';\n details = 'Camera constraints cannot be met';\n } else if (error.name === 'SecurityError') {\n status = 'denied';\n details = 'Camera access blocked by browser security settings';\n } else if (error.name === 'TypeError') {\n status = 'denied';\n details = 'Invalid constraints specified';\n }\n\n return {\n granted: false,\n status,\n details,\n };\n }\n }\n\n async checkAndRequestPermission(): Promise<PermissionStatus> {\n try {\n // Primero verificar el estado actual\n const currentStatus = await this.checkPermission();\n\n // Si ya tiene permiso, retornar inmediatamente\n if (currentStatus.granted) {\n return currentStatus;\n }\n\n // Si no tiene permiso, solicitar\n return await this.requestPermission();\n } catch (error) {\n console.error('Error in checkAndRequestPermission:', error);\n return {\n granted: false,\n status: 'denied',\n details: 'Failed to check or request permission',\n };\n }\n }\n\n // Método adicional para verificar soporte de características\n async getCameraCapabilities(): Promise<{\n hasCamera: boolean;\n isSecureContext: boolean;\n userAgent: string;\n }> {\n const hasMediaDevices = !!navigator.mediaDevices?.enumerateDevices;\n const hasGetUserMedia = !!navigator.mediaDevices?.getUserMedia;\n\n let hasCamera = false;\n\n if (hasMediaDevices || hasGetUserMedia) {\n try {\n const devices = await navigator.mediaDevices.enumerateDevices();\n hasCamera = devices.some((device) => device.kind === 'videoinput');\n } catch {\n hasCamera = false;\n }\n }\n\n return {\n hasCamera,\n isSecureContext: window.isSecureContext,\n userAgent: navigator.userAgent,\n };\n }\n\n //Camera Preview\n async startPreview(): Promise<void> {\n console.warn('[CameraModule] startPreview is not supported on web');\n }\n\n async stopPreview(): Promise<void> {\n console.warn('[CameraModule] stopPreview is not supported on web');\n }\n}\n"]}
@@ -159,6 +159,13 @@ class CameraModuleWeb extends core.WebPlugin {
159
159
  userAgent: navigator.userAgent,
160
160
  };
161
161
  }
162
+ //Camera Preview
163
+ async startPreview() {
164
+ console.warn('[CameraModule] startPreview is not supported on web');
165
+ }
166
+ async stopPreview() {
167
+ console.warn('[CameraModule] stopPreview is not supported on web');
168
+ }
162
169
  }
163
170
 
164
171
  var web = /*#__PURE__*/Object.freeze({
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.cjs.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst CameraModule = registerPlugin('CameraModule', {\n web: () => import('./web').then((m) => new m.CameraModuleWeb()),\n});\nexport * from './definitions';\nexport { CameraModule };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class CameraModuleWeb extends WebPlugin {\n async echo(options) {\n console.log('ECHO', options);\n return options;\n }\n async checkPermission() {\n var _a, _b;\n // Verificar disponibilidad de APIs - usando prefijo _ para variables no usadas\n const hasMediaDevices = !!((_a = navigator.mediaDevices) === null || _a === void 0 ? void 0 : _a.enumerateDevices);\n const _hasGetUserMedia = !!((_b = navigator.mediaDevices) === null || _b === void 0 ? void 0 : _b.getUserMedia); // Prefijo _\n if (!hasMediaDevices || !_hasGetUserMedia) {\n throw this.unavailable('Camera API no disponible en este navegador');\n }\n try {\n const devices = await navigator.mediaDevices.enumerateDevices();\n const videoDevices = devices.filter((device) => device.kind === 'videoinput');\n // No hay dispositivos de cámara\n if (videoDevices.length === 0) {\n return {\n granted: false,\n status: 'denied',\n details: 'No camera devices found',\n };\n }\n // Verificar si algún dispositivo tiene label (indica permiso)\n const hasPermission = videoDevices.some((device) => device.label && device.label.trim() !== '');\n // Determinar estado más preciso\n let status = 'denied';\n if (hasPermission) {\n status = 'granted';\n }\n else {\n // En web, sin intentar getUserMedia, asumimos que es la primera vez\n status = 'prompt';\n }\n return {\n granted: hasPermission,\n status,\n details: `Found ${videoDevices.length} camera device(s)`,\n };\n }\n catch (error) {\n console.error('Error checking camera permission:', error);\n return {\n granted: false,\n status: 'denied',\n details: error.message || 'Unknown error',\n };\n }\n }\n async requestPermission() {\n var _a;\n // Verificar getUserMedia específicamente para este método\n if (!((_a = navigator.mediaDevices) === null || _a === void 0 ? void 0 : _a.getUserMedia)) {\n throw this.unavailable('Camera API no disponible en este navegador');\n }\n try {\n // Intentar acceder a la cámara con configuración mínima\n const stream = await navigator.mediaDevices.getUserMedia({\n video: {\n width: { ideal: 1280 },\n height: { ideal: 720 },\n facingMode: { ideal: 'environment' },\n },\n audio: false,\n });\n // Limpiar recursos inmediatamente\n stream.getTracks().forEach((track) => {\n track.stop();\n });\n return {\n granted: true,\n status: 'granted',\n details: 'Permission granted successfully',\n };\n }\n catch (error) {\n console.error('Error requesting camera permission:', error);\n // Manejo específico de errores\n let status = 'denied';\n let details = error.message || 'Unknown error';\n if (error.name === 'NotAllowedError') {\n status = 'denied';\n details = 'User denied camera access';\n }\n else if (error.name === 'NotFoundError') {\n status = 'denied';\n details = 'No camera found';\n }\n else if (error.name === 'NotReadableError') {\n status = 'denied';\n details = 'Camera is already in use';\n }\n else if (error.name === 'OverconstrainedError') {\n status = 'denied';\n details = 'Camera constraints cannot be met';\n }\n else if (error.name === 'SecurityError') {\n status = 'denied';\n details = 'Camera access blocked by browser security settings';\n }\n else if (error.name === 'TypeError') {\n status = 'denied';\n details = 'Invalid constraints specified';\n }\n return {\n granted: false,\n status,\n details,\n };\n }\n }\n async checkAndRequestPermission() {\n try {\n // Primero verificar el estado actual\n const currentStatus = await this.checkPermission();\n // Si ya tiene permiso, retornar inmediatamente\n if (currentStatus.granted) {\n return currentStatus;\n }\n // Si no tiene permiso, solicitar\n return await this.requestPermission();\n }\n catch (error) {\n console.error('Error in checkAndRequestPermission:', error);\n return {\n granted: false,\n status: 'denied',\n details: 'Failed to check or request permission',\n };\n }\n }\n // Método adicional para verificar soporte de características\n async getCameraCapabilities() {\n var _a, _b;\n const hasMediaDevices = !!((_a = navigator.mediaDevices) === null || _a === void 0 ? void 0 : _a.enumerateDevices);\n const hasGetUserMedia = !!((_b = navigator.mediaDevices) === null || _b === void 0 ? void 0 : _b.getUserMedia);\n let hasCamera = false;\n if (hasMediaDevices || hasGetUserMedia) {\n try {\n const devices = await navigator.mediaDevices.enumerateDevices();\n hasCamera = devices.some((device) => device.kind === 'videoinput');\n }\n catch (_c) {\n hasCamera = false;\n }\n }\n return {\n hasCamera,\n isSecureContext: window.isSecureContext,\n userAgent: navigator.userAgent,\n };\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;;AACK,MAAC,YAAY,GAAGA,mBAAc,CAAC,cAAc,EAAE;AACpD,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,eAAe,EAAE,CAAC;AACnE,CAAC;;ACFM,MAAM,eAAe,SAASC,cAAS,CAAC;AAC/C,IAAI,MAAM,IAAI,CAAC,OAAO,EAAE;AACxB,QAAQ,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC;AACpC,QAAQ,OAAO,OAAO;AACtB,IAAI;AACJ,IAAI,MAAM,eAAe,GAAG;AAC5B,QAAQ,IAAI,EAAE,EAAE,EAAE;AAClB;AACA,QAAQ,MAAM,eAAe,GAAG,CAAC,EAAE,CAAC,EAAE,GAAG,SAAS,CAAC,YAAY,MAAM,IAAI,IAAI,EAAE,KAAK,MAAM,GAAG,MAAM,GAAG,EAAE,CAAC,gBAAgB,CAAC;AAC1H,QAAQ,MAAM,gBAAgB,GAAG,CAAC,EAAE,CAAC,EAAE,GAAG,SAAS,CAAC,YAAY,MAAM,IAAI,IAAI,EAAE,KAAK,MAAM,GAAG,MAAM,GAAG,EAAE,CAAC,YAAY,CAAC,CAAC;AACxH,QAAQ,IAAI,CAAC,eAAe,IAAI,CAAC,gBAAgB,EAAE;AACnD,YAAY,MAAM,IAAI,CAAC,WAAW,CAAC,4CAA4C,CAAC;AAChF,QAAQ;AACR,QAAQ,IAAI;AACZ,YAAY,MAAM,OAAO,GAAG,MAAM,SAAS,CAAC,YAAY,CAAC,gBAAgB,EAAE;AAC3E,YAAY,MAAM,YAAY,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,MAAM,KAAK,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EAAE;AAClB,QAAQ,MAAM,eAAe,GAAG,CAAC,EAAE,CAAC,EAAE,GAAG,SAAS,CAAC,YAAY,MAAM,IAAI,IAAI,EAAE,KAAK,MAAM,GAAG,MAAM,GAAG,EAAE,CAAC,gBAAgB,CAAC;AAC1H,QAAQ,MAAM,eAAe,GAAG,CAAC,EAAE,CAAC,EAAE,GAAG,SAAS,CAAC,YAAY,MAAM,IAAI,IAAI,EAAE,KAAK,MAAM,GAAG,MAAM,GAAG,EAAE,CAAC,YAAY,CAAC;AACtH,QAAQ,IAAI,SAAS,GAAG,KAAK;AAC7B,QAAQ,IAAI,eAAe,IAAI,eAAe,EAAE;AAChD,YAAY,IAAI;AAChB,gBAAgB,MAAM,OAAO,GAAG,MAAM,SAAS,CAAC,YAAY,CAAC,gBAAgB,EAAE;AAC/E,gBAAgB,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,MAAM,KAAK,MAAM,CAAC,IAAI,KAAK,YAAY,CAAC;AAClF,YAAY;AACZ,YAAY,OAAO,EAAE,EAAE;AACvB,gBAAgB,SAAS,GAAG,KAAK;AACjC,YAAY;AACZ,QAAQ;AACR,QAAQ,OAAO;AACf,YAAY,SAAS;AACrB,YAAY,eAAe,EAAE,MAAM,CAAC,eAAe;AACnD,YAAY,SAAS,EAAE,SAAS,CAAC,SAAS;AAC1C,SAAS;AACT,IAAI;AACJ;;;;;;;;;"}
1
+ {"version":3,"file":"plugin.cjs.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst CameraModule = registerPlugin('CameraModule', {\n web: () => import('./web').then((m) => new m.CameraModuleWeb()),\n});\nexport * from './definitions';\nexport { CameraModule };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class CameraModuleWeb extends WebPlugin {\n async echo(options) {\n console.log('ECHO', options);\n return options;\n }\n async checkPermission() {\n var _a, _b;\n // Verificar disponibilidad de APIs - usando prefijo _ para variables no usadas\n const hasMediaDevices = !!((_a = navigator.mediaDevices) === null || _a === void 0 ? void 0 : _a.enumerateDevices);\n const _hasGetUserMedia = !!((_b = navigator.mediaDevices) === null || _b === void 0 ? void 0 : _b.getUserMedia); // Prefijo _\n if (!hasMediaDevices || !_hasGetUserMedia) {\n throw this.unavailable('Camera API no disponible en este navegador');\n }\n try {\n const devices = await navigator.mediaDevices.enumerateDevices();\n const videoDevices = devices.filter((device) => device.kind === 'videoinput');\n // No hay dispositivos de cámara\n if (videoDevices.length === 0) {\n return {\n granted: false,\n status: 'denied',\n details: 'No camera devices found',\n };\n }\n // Verificar si algún dispositivo tiene label (indica permiso)\n const hasPermission = videoDevices.some((device) => device.label && device.label.trim() !== '');\n // Determinar estado más preciso\n let status = 'denied';\n if (hasPermission) {\n status = 'granted';\n }\n else {\n // En web, sin intentar getUserMedia, asumimos que es la primera vez\n status = 'prompt';\n }\n return {\n granted: hasPermission,\n status,\n details: `Found ${videoDevices.length} camera device(s)`,\n };\n }\n catch (error) {\n console.error('Error checking camera permission:', error);\n return {\n granted: false,\n status: 'denied',\n details: error.message || 'Unknown error',\n };\n }\n }\n async requestPermission() {\n var _a;\n // Verificar getUserMedia específicamente para este método\n if (!((_a = navigator.mediaDevices) === null || _a === void 0 ? void 0 : _a.getUserMedia)) {\n throw this.unavailable('Camera API no disponible en este navegador');\n }\n try {\n // Intentar acceder a la cámara con configuración mínima\n const stream = await navigator.mediaDevices.getUserMedia({\n video: {\n width: { ideal: 1280 },\n height: { ideal: 720 },\n facingMode: { ideal: 'environment' },\n },\n audio: false,\n });\n // Limpiar recursos inmediatamente\n stream.getTracks().forEach((track) => {\n track.stop();\n });\n return {\n granted: true,\n status: 'granted',\n details: 'Permission granted successfully',\n };\n }\n catch (error) {\n console.error('Error requesting camera permission:', error);\n // Manejo específico de errores\n let status = 'denied';\n let details = error.message || 'Unknown error';\n if (error.name === 'NotAllowedError') {\n status = 'denied';\n details = 'User denied camera access';\n }\n else if (error.name === 'NotFoundError') {\n status = 'denied';\n details = 'No camera found';\n }\n else if (error.name === 'NotReadableError') {\n status = 'denied';\n details = 'Camera is already in use';\n }\n else if (error.name === 'OverconstrainedError') {\n status = 'denied';\n details = 'Camera constraints cannot be met';\n }\n else if (error.name === 'SecurityError') {\n status = 'denied';\n details = 'Camera access blocked by browser security settings';\n }\n else if (error.name === 'TypeError') {\n status = 'denied';\n details = 'Invalid constraints specified';\n }\n return {\n granted: false,\n status,\n details,\n };\n }\n }\n async checkAndRequestPermission() {\n try {\n // Primero verificar el estado actual\n const currentStatus = await this.checkPermission();\n // Si ya tiene permiso, retornar inmediatamente\n if (currentStatus.granted) {\n return currentStatus;\n }\n // Si no tiene permiso, solicitar\n return await this.requestPermission();\n }\n catch (error) {\n console.error('Error in checkAndRequestPermission:', error);\n return {\n granted: false,\n status: 'denied',\n details: 'Failed to check or request permission',\n };\n }\n }\n // Método adicional para verificar soporte de características\n async getCameraCapabilities() {\n var _a, _b;\n const hasMediaDevices = !!((_a = navigator.mediaDevices) === null || _a === void 0 ? void 0 : _a.enumerateDevices);\n const hasGetUserMedia = !!((_b = navigator.mediaDevices) === null || _b === void 0 ? void 0 : _b.getUserMedia);\n let hasCamera = false;\n if (hasMediaDevices || hasGetUserMedia) {\n try {\n const devices = await navigator.mediaDevices.enumerateDevices();\n hasCamera = devices.some((device) => device.kind === 'videoinput');\n }\n catch (_c) {\n hasCamera = false;\n }\n }\n return {\n hasCamera,\n isSecureContext: window.isSecureContext,\n userAgent: navigator.userAgent,\n };\n }\n //Camera Preview\n async startPreview() {\n console.warn('[CameraModule] startPreview is not supported on web');\n }\n async stopPreview() {\n console.warn('[CameraModule] stopPreview is not supported on web');\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;;AACK,MAAC,YAAY,GAAGA,mBAAc,CAAC,cAAc,EAAE;AACpD,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,eAA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AAQ,IAAI,SAAS,GAAG,KAAK;AAC7B,QAAQ,IAAI,eAAe,IAAI,eAAe,EAAE;AAChD,YAAY,IAAI;AAChB,gBAAgB,MAAM,OAAO,GAAG,MAAM,SAAS,CAAC,YAAY,CAAC,gBAAgB,EAAE;AAC/E,gBAAgB,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,MAAM,KAAK,MAAM,CAAC,IAAI,KAAK,YAAY,CAAC;AAClF,YAAY;AACZ,YAAY,OAAO,EAAE,EAAE;AACvB,gBAAgB,SAAS,GAAG,KAAK;AACjC,YAAY;AACZ,QAAQ;AACR,QAAQ,OAAO;AACf,YAAY,SAAS;AACrB,YAAY,eAAe,EAAE,MAAM,CAAC,eAAe;AACnD,YAAY,SAAS,EAAE,SAAS,CAAC,SAAS;AAC1C,SAAS;AACT,IAAI;AACJ;AACA,IAAI,MAAM,YAAY,GAAG;AACzB,QAAQ,OAAO,CAAC,IAAI,CAAC,qDAAqD,CAAC;AAC3E,IAAI;AACJ,IAAI,MAAM,WAAW,GAAG;AACxB,QAAQ,OAAO,CAAC,IAAI,CAAC,oDAAoD,CAAC;AAC1E,IAAI;AACJ;;;;;;;;;"}
package/dist/plugin.js CHANGED
@@ -158,6 +158,13 @@ var capacitorCameraModule = (function (exports, core) {
158
158
  userAgent: navigator.userAgent,
159
159
  };
160
160
  }
161
+ //Camera Preview
162
+ async startPreview() {
163
+ console.warn('[CameraModule] startPreview is not supported on web');
164
+ }
165
+ async stopPreview() {
166
+ console.warn('[CameraModule] stopPreview is not supported on web');
167
+ }
161
168
  }
162
169
 
163
170
  var web = /*#__PURE__*/Object.freeze({
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst CameraModule = registerPlugin('CameraModule', {\n web: () => import('./web').then((m) => new m.CameraModuleWeb()),\n});\nexport * from './definitions';\nexport { CameraModule };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class CameraModuleWeb extends WebPlugin {\n async echo(options) {\n console.log('ECHO', options);\n return options;\n }\n async checkPermission() {\n var _a, _b;\n // Verificar disponibilidad de APIs - usando prefijo _ para variables no usadas\n const hasMediaDevices = !!((_a = navigator.mediaDevices) === null || _a === void 0 ? void 0 : _a.enumerateDevices);\n const _hasGetUserMedia = !!((_b = navigator.mediaDevices) === null || _b === void 0 ? void 0 : _b.getUserMedia); // Prefijo _\n if (!hasMediaDevices || !_hasGetUserMedia) {\n throw this.unavailable('Camera API no disponible en este navegador');\n }\n try {\n const devices = await navigator.mediaDevices.enumerateDevices();\n const videoDevices = devices.filter((device) => device.kind === 'videoinput');\n // No hay dispositivos de cámara\n if (videoDevices.length === 0) {\n return {\n granted: false,\n status: 'denied',\n details: 'No camera devices found',\n };\n }\n // Verificar si algún dispositivo tiene label (indica permiso)\n const hasPermission = videoDevices.some((device) => device.label && device.label.trim() !== '');\n // Determinar estado más preciso\n let status = 'denied';\n if (hasPermission) {\n status = 'granted';\n }\n else {\n // En web, sin intentar getUserMedia, asumimos que es la primera vez\n status = 'prompt';\n }\n return {\n granted: hasPermission,\n status,\n details: `Found ${videoDevices.length} camera device(s)`,\n };\n }\n catch (error) {\n console.error('Error checking camera permission:', error);\n return {\n granted: false,\n status: 'denied',\n details: error.message || 'Unknown error',\n };\n }\n }\n async requestPermission() {\n var _a;\n // Verificar getUserMedia específicamente para este método\n if (!((_a = navigator.mediaDevices) === null || _a === void 0 ? void 0 : _a.getUserMedia)) {\n throw this.unavailable('Camera API no disponible en este navegador');\n }\n try {\n // Intentar acceder a la cámara con configuración mínima\n const stream = await navigator.mediaDevices.getUserMedia({\n video: {\n width: { ideal: 1280 },\n height: { ideal: 720 },\n facingMode: { ideal: 'environment' },\n },\n audio: false,\n });\n // Limpiar recursos inmediatamente\n stream.getTracks().forEach((track) => {\n track.stop();\n });\n return {\n granted: true,\n status: 'granted',\n details: 'Permission granted successfully',\n };\n }\n catch (error) {\n console.error('Error requesting camera permission:', error);\n // Manejo específico de errores\n let status = 'denied';\n let details = error.message || 'Unknown error';\n if (error.name === 'NotAllowedError') {\n status = 'denied';\n details = 'User denied camera access';\n }\n else if (error.name === 'NotFoundError') {\n status = 'denied';\n details = 'No camera found';\n }\n else if (error.name === 'NotReadableError') {\n status = 'denied';\n details = 'Camera is already in use';\n }\n else if (error.name === 'OverconstrainedError') {\n status = 'denied';\n details = 'Camera constraints cannot be met';\n }\n else if (error.name === 'SecurityError') {\n status = 'denied';\n details = 'Camera access blocked by browser security settings';\n }\n else if (error.name === 'TypeError') {\n status = 'denied';\n details = 'Invalid constraints specified';\n }\n return {\n granted: false,\n status,\n details,\n };\n }\n }\n async checkAndRequestPermission() {\n try {\n // Primero verificar el estado actual\n const currentStatus = await this.checkPermission();\n // Si ya tiene permiso, retornar inmediatamente\n if (currentStatus.granted) {\n return currentStatus;\n }\n // Si no tiene permiso, solicitar\n return await this.requestPermission();\n }\n catch (error) {\n console.error('Error in checkAndRequestPermission:', error);\n return {\n granted: false,\n status: 'denied',\n details: 'Failed to check or request permission',\n };\n }\n }\n // Método adicional para verificar soporte de características\n async getCameraCapabilities() {\n var _a, _b;\n const hasMediaDevices = !!((_a = navigator.mediaDevices) === null || _a === void 0 ? void 0 : _a.enumerateDevices);\n const hasGetUserMedia = !!((_b = navigator.mediaDevices) === null || _b === void 0 ? void 0 : _b.getUserMedia);\n let hasCamera = false;\n if (hasMediaDevices || hasGetUserMedia) {\n try {\n const devices = await navigator.mediaDevices.enumerateDevices();\n hasCamera = devices.some((device) => device.kind === 'videoinput');\n }\n catch (_c) {\n hasCamera = false;\n }\n }\n return {\n hasCamera,\n isSecureContext: window.isSecureContext,\n userAgent: navigator.userAgent,\n };\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;AACK,UAAC,YAAY,GAAGA,mBAAc,CAAC,cAAc,EAAE;IACpD,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI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AG,MAAM,GAAG,EAAE,CAAC,YAAY,CAAC;IACtH,QAAQ,IAAI,SAAS,GAAG,KAAK;IAC7B,QAAQ,IAAI,eAAe,IAAI,eAAe,EAAE;IAChD,YAAY,IAAI;IAChB,gBAAgB,MAAM,OAAO,GAAG,MAAM,SAAS,CAAC,YAAY,CAAC,gBAAgB,EAAE;IAC/E,gBAAgB,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,MAAM,KAAK,MAAM,CAAC,IAAI,KAAK,YAAY,CAAC;IAClF,YAAY;IACZ,YAAY,OAAO,EAAE,EAAE;IACvB,gBAAgB,SAAS,GAAG,KAAK;IACjC,YAAY;IACZ,QAAQ;IACR,QAAQ,OAAO;IACf,YAAY,SAAS;IACrB,YAAY,eAAe,EAAE,MAAM,CAAC,eAAe;IACnD,YAAY,SAAS,EAAE,SAAS,CAAC,SAAS;IAC1C,SAAS;IACT,IAAI;IACJ;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"plugin.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst CameraModule = registerPlugin('CameraModule', {\n web: () => import('./web').then((m) => new m.CameraModuleWeb()),\n});\nexport * from './definitions';\nexport { CameraModule };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class CameraModuleWeb extends WebPlugin {\n async echo(options) {\n console.log('ECHO', options);\n return options;\n }\n async checkPermission() {\n var _a, _b;\n // Verificar disponibilidad de APIs - usando prefijo _ para variables no usadas\n const hasMediaDevices = !!((_a = navigator.mediaDevices) === null || _a === void 0 ? void 0 : _a.enumerateDevices);\n const _hasGetUserMedia = !!((_b = navigator.mediaDevices) === null || _b === void 0 ? void 0 : _b.getUserMedia); // Prefijo _\n if (!hasMediaDevices || !_hasGetUserMedia) {\n throw this.unavailable('Camera API no disponible en este navegador');\n }\n try {\n const devices = await navigator.mediaDevices.enumerateDevices();\n const videoDevices = devices.filter((device) => device.kind === 'videoinput');\n // No hay dispositivos de cámara\n if (videoDevices.length === 0) {\n return {\n granted: false,\n status: 'denied',\n details: 'No camera devices found',\n };\n }\n // Verificar si algún dispositivo tiene label (indica permiso)\n const hasPermission = videoDevices.some((device) => device.label && device.label.trim() !== '');\n // Determinar estado más preciso\n let status = 'denied';\n if (hasPermission) {\n status = 'granted';\n }\n else {\n // En web, sin intentar getUserMedia, asumimos que es la primera vez\n status = 'prompt';\n }\n return {\n granted: hasPermission,\n status,\n details: `Found ${videoDevices.length} camera device(s)`,\n };\n }\n catch (error) {\n console.error('Error checking camera permission:', error);\n return {\n granted: false,\n status: 'denied',\n details: error.message || 'Unknown error',\n };\n }\n }\n async requestPermission() {\n var _a;\n // Verificar getUserMedia específicamente para este método\n if (!((_a = navigator.mediaDevices) === null || _a === void 0 ? void 0 : _a.getUserMedia)) {\n throw this.unavailable('Camera API no disponible en este navegador');\n }\n try {\n // Intentar acceder a la cámara con configuración mínima\n const stream = await navigator.mediaDevices.getUserMedia({\n video: {\n width: { ideal: 1280 },\n height: { ideal: 720 },\n facingMode: { ideal: 'environment' },\n },\n audio: false,\n });\n // Limpiar recursos inmediatamente\n stream.getTracks().forEach((track) => {\n track.stop();\n });\n return {\n granted: true,\n status: 'granted',\n details: 'Permission granted successfully',\n };\n }\n catch (error) {\n console.error('Error requesting camera permission:', error);\n // Manejo específico de errores\n let status = 'denied';\n let details = error.message || 'Unknown error';\n if (error.name === 'NotAllowedError') {\n status = 'denied';\n details = 'User denied camera access';\n }\n else if (error.name === 'NotFoundError') {\n status = 'denied';\n details = 'No camera found';\n }\n else if (error.name === 'NotReadableError') {\n status = 'denied';\n details = 'Camera is already in use';\n }\n else if (error.name === 'OverconstrainedError') {\n status = 'denied';\n details = 'Camera constraints cannot be met';\n }\n else if (error.name === 'SecurityError') {\n status = 'denied';\n details = 'Camera access blocked by browser security settings';\n }\n else if (error.name === 'TypeError') {\n status = 'denied';\n details = 'Invalid constraints specified';\n }\n return {\n granted: false,\n status,\n details,\n };\n }\n }\n async checkAndRequestPermission() {\n try {\n // Primero verificar el estado actual\n const currentStatus = await this.checkPermission();\n // Si ya tiene permiso, retornar inmediatamente\n if (currentStatus.granted) {\n return currentStatus;\n }\n // Si no tiene permiso, solicitar\n return await this.requestPermission();\n }\n catch (error) {\n console.error('Error in checkAndRequestPermission:', error);\n return {\n granted: false,\n status: 'denied',\n details: 'Failed to check or request permission',\n };\n }\n }\n // Método adicional para verificar soporte de características\n async getCameraCapabilities() {\n var _a, _b;\n const hasMediaDevices = !!((_a = navigator.mediaDevices) === null || _a === void 0 ? void 0 : _a.enumerateDevices);\n const hasGetUserMedia = !!((_b = navigator.mediaDevices) === null || _b === void 0 ? void 0 : _b.getUserMedia);\n let hasCamera = false;\n if (hasMediaDevices || hasGetUserMedia) {\n try {\n const devices = await navigator.mediaDevices.enumerateDevices();\n hasCamera = devices.some((device) => device.kind === 'videoinput');\n }\n catch (_c) {\n hasCamera = false;\n }\n }\n return {\n hasCamera,\n isSecureContext: window.isSecureContext,\n userAgent: navigator.userAgent,\n };\n }\n //Camera Preview\n async startPreview() {\n console.warn('[CameraModule] startPreview is not supported on web');\n }\n async stopPreview() {\n console.warn('[CameraModule] stopPreview is not supported on web');\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;AACK,UAAC,YAAY,GAAGA,mBAAc,CAAC,cAAc,EAAE;IACpD,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,eAAe,EAAE,CAAC;IACnE,CAAC;;ICFM,MAAM,eAAe,SAASC,cAAS,CAAC;IAC/C,IAAI,MAAM,IAAI,CAAC,OAAO,EAAE;IACxB,QAAQ,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC;IACpC,QAAQ,OAAO,OAAO;IACtB,IAAI;IACJ,IAAI,MAAM,eAAe,GAAG;IAC5B,QAAQ,IAAI,EAAE,EAAE,EAAE;IAClB;IACA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AY;IACZ,YAAY,OAAO,EAAE,EAAE;IACvB,gBAAgB,SAAS,GAAG,KAAK;IACjC,YAAY;IACZ,QAAQ;IACR,QAAQ,OAAO;IACf,YAAY,SAAS;IACrB,YAAY,eAAe,EAAE,MAAM,CAAC,eAAe;IACnD,YAAY,SAAS,EAAE,SAAS,CAAC,SAAS;IAC1C,SAAS;IACT,IAAI;IACJ;IACA,IAAI,MAAM,YAAY,GAAG;IACzB,QAAQ,OAAO,CAAC,IAAI,CAAC,qDAAqD,CAAC;IAC3E,IAAI;IACJ,IAAI,MAAM,WAAW,GAAG;IACxB,QAAQ,OAAO,CAAC,IAAI,CAAC,oDAAoD,CAAC;IAC1E,IAAI;IACJ;;;;;;;;;;;;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "capacitor-camera-module",
3
- "version": "0.0.4",
3
+ "version": "0.0.7",
4
4
  "description": "Plugin to request permissiones view camera take phots",
5
5
  "main": "dist/plugin.cjs.js",
6
6
  "module": "dist/esm/index.js",