@elizaos/capacitor-camera 1.0.0 → 2.0.11-beta.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.
@@ -14,6 +14,37 @@ const VIDEO_MIME_TYPES = [
14
14
  "video/mp4",
15
15
  ];
16
16
  const getSupportedMimeType = () => VIDEO_MIME_TYPES.find((m) => MediaRecorder.isTypeSupported(m)) ?? null;
17
+ const getMediaDevices = () => {
18
+ if (!navigator.mediaDevices?.getUserMedia) {
19
+ throw new Error("Camera media devices API is not available");
20
+ }
21
+ return navigator.mediaDevices;
22
+ };
23
+ const assertPositiveFinite = (value, name) => {
24
+ if (!Number.isFinite(value) || value <= 0) {
25
+ throw new Error(`${name} must be a positive finite number`);
26
+ }
27
+ };
28
+ const assertRecordingOptions = (options) => {
29
+ if (!options)
30
+ return;
31
+ if (options.quality !== undefined &&
32
+ !["low", "medium", "high", "highest"].includes(options.quality)) {
33
+ throw new Error("quality must be one of low, medium, high, or highest");
34
+ }
35
+ if (options.maxDuration !== undefined) {
36
+ assertPositiveFinite(options.maxDuration, "maxDuration");
37
+ }
38
+ if (options.maxFileSize !== undefined) {
39
+ assertPositiveFinite(options.maxFileSize, "maxFileSize");
40
+ }
41
+ if (options.bitrate !== undefined) {
42
+ assertPositiveFinite(options.bitrate, "bitrate");
43
+ }
44
+ if (options.frameRate !== undefined) {
45
+ assertPositiveFinite(options.frameRate, "frameRate");
46
+ }
47
+ };
17
48
  class CameraWeb extends core.WebPlugin {
18
49
  constructor() {
19
50
  super(...arguments);
@@ -37,27 +68,29 @@ class CameraWeb extends core.WebPlugin {
37
68
  this.pluginListeners = [];
38
69
  }
39
70
  async getDevices() {
40
- // enumerateDevices() returns device stubs without labels unless the user
41
- // has already granted camera permission via a prior getUserMedia() call.
71
+ // enumerateDevices() returns unlabeled device records unless the user has
72
+ // already granted camera permission via a prior getUserMedia() call.
42
73
  // We intentionally do NOT call getUserMedia() here because it requires a
43
74
  // user gesture and would throw NotAllowedError if called programmatically.
44
- const allDevices = await navigator.mediaDevices.enumerateDevices();
75
+ const mediaDevices = getMediaDevices();
76
+ if (!mediaDevices.enumerateDevices) {
77
+ throw new Error("Camera device enumeration is not available");
78
+ }
79
+ const allDevices = await mediaDevices.enumerateDevices();
45
80
  const videoDevices = allDevices.filter((d) => d.kind === "videoinput");
46
- const devices = await Promise.all(videoDevices.map(async (device, index) => {
47
- const capabilities = await this.getDeviceCapabilities(device.deviceId);
48
- return {
49
- deviceId: device.deviceId,
50
- label: device.label || `Camera ${index + 1}`,
51
- direction: this.inferDirection(device.label),
52
- // Flash detection not available via MediaDevices API on web
53
- hasFlash: capabilities?.hasFlash ?? false,
54
- hasZoom: !!capabilities?.zoom,
55
- maxZoom: capabilities?.zoom?.max ?? 1,
56
- // Return actual capabilities or empty array to indicate unknown
57
- supportedResolutions: capabilities?.resolutions ?? [],
58
- supportedFrameRates: capabilities?.frameRates ?? [],
59
- };
60
- }));
81
+ const devices = await Promise.all(videoDevices.map(async (device, index) => ({
82
+ deviceId: device.deviceId,
83
+ label: device.label || `Camera ${index + 1}`,
84
+ direction: this.inferDirection(device.label),
85
+ // Capability probing requires getUserMedia(), which can prompt for
86
+ // camera permission. Enumeration stays prompt-free and reports
87
+ // unknown capabilities until preview/capture has explicit access.
88
+ hasFlash: false,
89
+ hasZoom: false,
90
+ maxZoom: 1,
91
+ supportedResolutions: [],
92
+ supportedFrameRates: [],
93
+ })));
61
94
  return { devices };
62
95
  }
63
96
  inferDirection(label) {
@@ -74,60 +107,17 @@ class CameraWeb extends core.WebPlugin {
74
107
  }
75
108
  return "external";
76
109
  }
77
- async getDeviceCapabilities(deviceId) {
78
- let stream;
79
- try {
80
- stream = await navigator.mediaDevices.getUserMedia({
81
- video: { deviceId: { exact: deviceId } },
82
- });
110
+ async startPreview(options) {
111
+ if (!options?.element?.appendChild) {
112
+ throw new Error("Preview element is required");
83
113
  }
84
- catch {
85
- return null; // Device not accessible
114
+ if (options.resolution) {
115
+ assertPositiveFinite(options.resolution.width, "resolution.width");
116
+ assertPositiveFinite(options.resolution.height, "resolution.height");
86
117
  }
87
- const track = stream.getVideoTracks()[0];
88
- if (!track) {
89
- stream.getTracks().forEach((t) => {
90
- t.stop();
91
- });
92
- return null;
118
+ if (options.frameRate !== undefined) {
119
+ assertPositiveFinite(options.frameRate, "frameRate");
93
120
  }
94
- const capabilities = track.getCapabilities ? track.getCapabilities() : {};
95
- stream.getTracks().forEach((t) => {
96
- t.stop();
97
- });
98
- const caps = capabilities;
99
- // Build resolutions from actual device capabilities only
100
- const resolutions = [];
101
- if (caps.width?.max && caps.height?.max) {
102
- resolutions.push({ width: caps.width.max, height: caps.height.max });
103
- // Add common lower resolutions only if device supports them
104
- if (caps.width.max >= 1280 && caps.height.max >= 720) {
105
- resolutions.push({ width: 1280, height: 720 });
106
- }
107
- if (caps.width.max >= 640 && caps.height.max >= 480) {
108
- resolutions.push({ width: 640, height: 480 });
109
- }
110
- }
111
- // Build frameRates from actual device capabilities only
112
- const frameRates = [];
113
- if (caps.frameRate?.max) {
114
- if (caps.frameRate.max >= 60)
115
- frameRates.push(60);
116
- if (caps.frameRate.max >= 30)
117
- frameRates.push(30);
118
- if (caps.frameRate.max >= 24)
119
- frameRates.push(24);
120
- if (caps.frameRate.max >= 15)
121
- frameRates.push(15);
122
- }
123
- return {
124
- zoom: caps.zoom,
125
- resolutions: resolutions.length > 0 ? resolutions : undefined,
126
- frameRates: frameRates.length > 0 ? frameRates : undefined,
127
- hasFlash: caps.torch === true, // Torch capability indicates flash support
128
- };
129
- }
130
- async startPreview(options) {
131
121
  await this.stopPreview();
132
122
  const constraints = {
133
123
  video: {
@@ -149,7 +139,9 @@ class CameraWeb extends core.WebPlugin {
149
139
  },
150
140
  audio: false,
151
141
  };
152
- this.mediaStream = await navigator.mediaDevices.getUserMedia(constraints);
142
+ // Browser camera permission is requested by opening the stream. Native
143
+ // permission probing is handled outside this Capacitor web fallback.
144
+ this.mediaStream = await getMediaDevices().getUserMedia(constraints);
153
145
  this.previewElement = options.element;
154
146
  this.videoElement = document.createElement("video");
155
147
  this.videoElement.srcObject = this.mediaStream;
@@ -183,8 +175,10 @@ class CameraWeb extends core.WebPlugin {
183
175
  });
184
176
  this.mediaStream = null;
185
177
  }
186
- if (this.videoElement && this.previewElement) {
187
- this.previewElement.removeChild(this.videoElement);
178
+ if (this.videoElement) {
179
+ if (this.previewElement?.contains(this.videoElement)) {
180
+ this.previewElement.removeChild(this.videoElement);
181
+ }
188
182
  this.videoElement = null;
189
183
  }
190
184
  this.previewElement = null;
@@ -210,8 +204,18 @@ class CameraWeb extends core.WebPlugin {
210
204
  const settings = track.getSettings();
211
205
  const videoWidth = settings.width || this.videoElement.videoWidth;
212
206
  const videoHeight = settings.height || this.videoElement.videoHeight;
207
+ assertPositiveFinite(videoWidth, "videoWidth");
208
+ assertPositiveFinite(videoHeight, "videoHeight");
213
209
  const targetWidth = options?.width || videoWidth;
214
210
  const targetHeight = options?.height || videoHeight;
211
+ assertPositiveFinite(targetWidth, "width");
212
+ assertPositiveFinite(targetHeight, "height");
213
+ if (options?.quality !== undefined &&
214
+ (!Number.isFinite(options.quality) ||
215
+ options.quality < 0 ||
216
+ options.quality > 100)) {
217
+ throw new Error("quality must be a finite number between 0 and 100");
218
+ }
215
219
  const canvas = document.createElement("canvas");
216
220
  canvas.width = targetWidth;
217
221
  canvas.height = targetHeight;
@@ -234,7 +238,11 @@ class CameraWeb extends core.WebPlugin {
234
238
  : format === "webp"
235
239
  ? "image/webp"
236
240
  : "image/jpeg";
237
- const base64 = canvas.toDataURL(mimeType, quality).split(",")[1];
241
+ const dataUrl = canvas.toDataURL(mimeType, quality);
242
+ const base64 = dataUrl.split(",")[1];
243
+ if (!base64) {
244
+ throw new Error("Failed to encode captured photo");
245
+ }
238
246
  return {
239
247
  base64,
240
248
  format,
@@ -249,9 +257,10 @@ class CameraWeb extends core.WebPlugin {
249
257
  if (this.isRecording) {
250
258
  throw new Error("Recording already in progress");
251
259
  }
260
+ assertRecordingOptions(options);
252
261
  let streamToRecord = this.mediaStream;
253
262
  if (options?.audio !== false) {
254
- const audioStream = await navigator.mediaDevices.getUserMedia({
263
+ const audioStream = await getMediaDevices().getUserMedia({
255
264
  audio: true,
256
265
  });
257
266
  streamToRecord = new MediaStream([
@@ -373,17 +382,28 @@ class CameraWeb extends core.WebPlugin {
373
382
  return { settings: { ...this.currentSettings } };
374
383
  }
375
384
  async setSettings(options) {
385
+ if (!options?.settings || typeof options.settings !== "object") {
386
+ throw new Error("settings object is required");
387
+ }
388
+ if (options.settings.zoom !== undefined) {
389
+ const zoom = options.settings.zoom;
390
+ this.assertValidZoom(zoom);
391
+ }
376
392
  this.currentSettings = { ...this.currentSettings, ...options.settings };
377
393
  if (this.mediaStream && options.settings.zoom !== undefined) {
378
394
  await this.applyZoom(options.settings.zoom);
379
395
  }
380
396
  }
381
397
  async setZoom(options) {
382
- if (!Number.isFinite(options.zoom) || options.zoom < 0) {
383
- throw new Error(`Invalid zoom value: ${options.zoom}. Must be a non-negative finite number.`);
398
+ const zoom = options?.zoom;
399
+ this.assertValidZoom(zoom);
400
+ await this.applyZoom(zoom);
401
+ this.currentSettings.zoom = zoom;
402
+ }
403
+ assertValidZoom(zoom) {
404
+ if (typeof zoom !== "number" || !Number.isFinite(zoom) || zoom < 0) {
405
+ throw new Error(`Invalid zoom value: ${zoom}. Must be a non-negative finite number.`);
384
406
  }
385
- await this.applyZoom(options.zoom);
386
- this.currentSettings.zoom = options.zoom;
387
407
  }
388
408
  async applyZoom(zoom) {
389
409
  if (!this.mediaStream)
@@ -403,6 +423,7 @@ class CameraWeb extends core.WebPlugin {
403
423
  async setFocusPoint(options) {
404
424
  if (!this.mediaStream)
405
425
  throw new Error("Preview not started");
426
+ this.assertNormalizedPoint(options, "focus point");
406
427
  const track = this.mediaStream.getVideoTracks()[0];
407
428
  if (!track)
408
429
  throw new Error("No video track available");
@@ -428,6 +449,7 @@ class CameraWeb extends core.WebPlugin {
428
449
  async setExposurePoint(options) {
429
450
  if (!this.mediaStream)
430
451
  throw new Error("Preview not started");
452
+ this.assertNormalizedPoint(options, "exposure point");
431
453
  const track = this.mediaStream.getVideoTracks()[0];
432
454
  if (!track)
433
455
  throw new Error("No video track available");
@@ -450,6 +472,16 @@ class CameraWeb extends core.WebPlugin {
450
472
  throw new Error(`Failed to set exposure point: ${e instanceof Error ? e.message : "unknown error"}`);
451
473
  }
452
474
  }
475
+ assertNormalizedPoint(options, name) {
476
+ if (!Number.isFinite(options?.x) ||
477
+ !Number.isFinite(options?.y) ||
478
+ options.x < 0 ||
479
+ options.x > 1 ||
480
+ options.y < 0 ||
481
+ options.y > 1) {
482
+ throw new Error(`${name} must use finite x/y values between 0 and 1`);
483
+ }
484
+ }
453
485
  async checkPermissions() {
454
486
  let cameraStatus = "prompt";
455
487
  let microphoneStatus = "prompt";
@@ -483,7 +515,7 @@ class CameraWeb extends core.WebPlugin {
483
515
  let cameraStatus = "denied";
484
516
  let microphoneStatus = "denied";
485
517
  try {
486
- const stream = await navigator.mediaDevices.getUserMedia({
518
+ const stream = await getMediaDevices().getUserMedia({
487
519
  video: true,
488
520
  audio: true,
489
521
  });
@@ -495,7 +527,7 @@ class CameraWeb extends core.WebPlugin {
495
527
  }
496
528
  catch {
497
529
  try {
498
- const videoStream = await navigator.mediaDevices.getUserMedia({
530
+ const videoStream = await getMediaDevices().getUserMedia({
499
531
  video: true,
500
532
  });
501
533
  videoStream.getTracks().forEach((track) => {
@@ -507,7 +539,7 @@ class CameraWeb extends core.WebPlugin {
507
539
  cameraStatus = "denied";
508
540
  }
509
541
  try {
510
- const audioStream = await navigator.mediaDevices.getUserMedia({
542
+ const audioStream = await getMediaDevices().getUserMedia({
511
543
  audio: true,
512
544
  });
513
545
  audioStream.getTracks().forEach((track) => {
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.cjs.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from \"@capacitor/core\";\nexport * from \"./definitions\";\nconst loadWeb = () => import(\"./web\").then((m) => new m.CameraWeb());\nexport const Camera = registerPlugin(\"ElizaCamera\", {\n web: loadWeb,\n});\n","import { WebPlugin } from \"@capacitor/core\";\nconst VIDEO_MIME_TYPES = [\n \"video/webm;codecs=vp9,opus\",\n \"video/webm;codecs=vp8,opus\",\n \"video/webm\",\n \"video/mp4\",\n];\nconst getSupportedMimeType = () => VIDEO_MIME_TYPES.find((m) => MediaRecorder.isTypeSupported(m)) ?? null;\nexport class CameraWeb extends WebPlugin {\n constructor() {\n super(...arguments);\n this.mediaStream = null;\n this.videoElement = null;\n this.previewElement = null;\n this.currentDeviceId = null;\n this.mediaRecorder = null;\n this.recordedChunks = [];\n this.recordingStartTime = 0;\n this.recordingStateInterval = null;\n this.isRecording = false;\n this.currentSettings = {\n flash: \"off\",\n zoom: 1,\n focusMode: \"continuous\",\n exposureMode: \"continuous\",\n exposureCompensation: 0,\n whiteBalance: \"auto\",\n };\n this.pluginListeners = [];\n }\n async getDevices() {\n // enumerateDevices() returns device stubs without labels unless the user\n // has already granted camera permission via a prior getUserMedia() call.\n // We intentionally do NOT call getUserMedia() here because it requires a\n // user gesture and would throw NotAllowedError if called programmatically.\n const allDevices = await navigator.mediaDevices.enumerateDevices();\n const videoDevices = allDevices.filter((d) => d.kind === \"videoinput\");\n const devices = await Promise.all(videoDevices.map(async (device, index) => {\n const capabilities = await this.getDeviceCapabilities(device.deviceId);\n return {\n deviceId: device.deviceId,\n label: device.label || `Camera ${index + 1}`,\n direction: this.inferDirection(device.label),\n // Flash detection not available via MediaDevices API on web\n hasFlash: capabilities?.hasFlash ?? false,\n hasZoom: !!capabilities?.zoom,\n maxZoom: capabilities?.zoom?.max ?? 1,\n // Return actual capabilities or empty array to indicate unknown\n supportedResolutions: capabilities?.resolutions ?? [],\n supportedFrameRates: capabilities?.frameRates ?? [],\n };\n }));\n return { devices };\n }\n inferDirection(label) {\n const lowerLabel = label.toLowerCase();\n if (lowerLabel.includes(\"front\") ||\n lowerLabel.includes(\"facetime\") ||\n lowerLabel.includes(\"user\")) {\n return \"front\";\n }\n if (lowerLabel.includes(\"back\") ||\n lowerLabel.includes(\"rear\") ||\n lowerLabel.includes(\"environment\")) {\n return \"back\";\n }\n return \"external\";\n }\n async getDeviceCapabilities(deviceId) {\n let stream;\n try {\n stream = await navigator.mediaDevices.getUserMedia({\n video: { deviceId: { exact: deviceId } },\n });\n }\n catch {\n return null; // Device not accessible\n }\n const track = stream.getVideoTracks()[0];\n if (!track) {\n stream.getTracks().forEach((t) => {\n t.stop();\n });\n return null;\n }\n const capabilities = track.getCapabilities ? track.getCapabilities() : {};\n stream.getTracks().forEach((t) => {\n t.stop();\n });\n const caps = capabilities;\n // Build resolutions from actual device capabilities only\n const resolutions = [];\n if (caps.width?.max && caps.height?.max) {\n resolutions.push({ width: caps.width.max, height: caps.height.max });\n // Add common lower resolutions only if device supports them\n if (caps.width.max >= 1280 && caps.height.max >= 720) {\n resolutions.push({ width: 1280, height: 720 });\n }\n if (caps.width.max >= 640 && caps.height.max >= 480) {\n resolutions.push({ width: 640, height: 480 });\n }\n }\n // Build frameRates from actual device capabilities only\n const frameRates = [];\n if (caps.frameRate?.max) {\n if (caps.frameRate.max >= 60)\n frameRates.push(60);\n if (caps.frameRate.max >= 30)\n frameRates.push(30);\n if (caps.frameRate.max >= 24)\n frameRates.push(24);\n if (caps.frameRate.max >= 15)\n frameRates.push(15);\n }\n return {\n zoom: caps.zoom,\n resolutions: resolutions.length > 0 ? resolutions : undefined,\n frameRates: frameRates.length > 0 ? frameRates : undefined,\n hasFlash: caps.torch === true, // Torch capability indicates flash support\n };\n }\n async startPreview(options) {\n await this.stopPreview();\n const constraints = {\n video: {\n deviceId: options.deviceId ? { exact: options.deviceId } : undefined,\n facingMode: options.direction === \"front\"\n ? \"user\"\n : options.direction === \"back\"\n ? \"environment\"\n : undefined,\n width: options.resolution?.width\n ? { ideal: options.resolution.width }\n : { ideal: 1920 },\n height: options.resolution?.height\n ? { ideal: options.resolution.height }\n : { ideal: 1080 },\n frameRate: options.frameRate\n ? { ideal: options.frameRate }\n : { ideal: 30 },\n },\n audio: false,\n };\n this.mediaStream = await navigator.mediaDevices.getUserMedia(constraints);\n this.previewElement = options.element;\n this.videoElement = document.createElement(\"video\");\n this.videoElement.srcObject = this.mediaStream;\n this.videoElement.autoplay = true;\n this.videoElement.playsInline = true;\n this.videoElement.muted = true;\n this.videoElement.style.width = \"100%\";\n this.videoElement.style.height = \"100%\";\n this.videoElement.style.objectFit = \"cover\";\n if (options.mirror) {\n this.videoElement.style.transform = \"scaleX(-1)\";\n }\n this.previewElement.appendChild(this.videoElement);\n await this.videoElement.play();\n const track = this.mediaStream.getVideoTracks()[0];\n const settings = track.getSettings();\n this.currentDeviceId = settings.deviceId || options.deviceId || \"\";\n return {\n width: settings.width || options.resolution?.width || 1920,\n height: settings.height || options.resolution?.height || 1080,\n deviceId: this.currentDeviceId,\n };\n }\n async stopPreview() {\n if (this.isRecording) {\n await this.stopRecording();\n }\n if (this.mediaStream) {\n this.mediaStream.getTracks().forEach((track) => {\n track.stop();\n });\n this.mediaStream = null;\n }\n if (this.videoElement && this.previewElement) {\n this.previewElement.removeChild(this.videoElement);\n this.videoElement = null;\n }\n this.previewElement = null;\n this.currentDeviceId = null;\n }\n async switchCamera(options) {\n if (!this.previewElement) {\n throw new Error(\"Preview not started\");\n }\n const mirror = options.direction === \"front\";\n return this.startPreview({\n element: this.previewElement,\n deviceId: options.deviceId,\n direction: options.direction,\n mirror,\n });\n }\n async capturePhoto(options) {\n if (!this.videoElement || !this.mediaStream) {\n throw new Error(\"Preview not started\");\n }\n const track = this.mediaStream.getVideoTracks()[0];\n const settings = track.getSettings();\n const videoWidth = settings.width || this.videoElement.videoWidth;\n const videoHeight = settings.height || this.videoElement.videoHeight;\n const targetWidth = options?.width || videoWidth;\n const targetHeight = options?.height || videoHeight;\n const canvas = document.createElement(\"canvas\");\n canvas.width = targetWidth;\n canvas.height = targetHeight;\n const ctx = canvas.getContext(\"2d\");\n if (!ctx) {\n throw new Error(\"Failed to get canvas context\");\n }\n const scaleX = targetWidth / videoWidth;\n const scaleY = targetHeight / videoHeight;\n const scale = Math.max(scaleX, scaleY);\n const drawWidth = videoWidth * scale;\n const drawHeight = videoHeight * scale;\n const drawX = (targetWidth - drawWidth) / 2;\n const drawY = (targetHeight - drawHeight) / 2;\n ctx.drawImage(this.videoElement, drawX, drawY, drawWidth, drawHeight);\n const quality = (options?.quality ?? 90) / 100;\n const format = options?.format || \"jpeg\";\n const mimeType = format === \"png\"\n ? \"image/png\"\n : format === \"webp\"\n ? \"image/webp\"\n : \"image/jpeg\";\n const base64 = canvas.toDataURL(mimeType, quality).split(\",\")[1];\n return {\n base64,\n format,\n width: targetWidth,\n height: targetHeight,\n };\n }\n async startRecording(options) {\n if (!this.mediaStream) {\n throw new Error(\"Preview not started\");\n }\n if (this.isRecording) {\n throw new Error(\"Recording already in progress\");\n }\n let streamToRecord = this.mediaStream;\n if (options?.audio !== false) {\n const audioStream = await navigator.mediaDevices.getUserMedia({\n audio: true,\n });\n streamToRecord = new MediaStream([\n ...this.mediaStream.getVideoTracks(),\n ...audioStream.getAudioTracks(),\n ]);\n }\n const mimeType = getSupportedMimeType();\n if (!mimeType)\n throw new Error(\"No supported video mime type found\");\n const recorderOptions = { mimeType };\n if (options?.bitrate)\n recorderOptions.videoBitsPerSecond = options.bitrate;\n this.recordedChunks = [];\n this.mediaRecorder = new MediaRecorder(streamToRecord, recorderOptions);\n this.mediaRecorder.ondataavailable = (event) => {\n if (event.data.size > 0) {\n this.recordedChunks.push(event.data);\n }\n };\n this.mediaRecorder.onerror = (event) => {\n this.notifyListeners(\"error\", {\n code: \"RECORDING_ERROR\",\n message: `Recording error: ${event.message || \"Unknown error\"}`,\n });\n };\n this.recordingStartTime = Date.now();\n this.isRecording = true;\n this.mediaRecorder.start(1000);\n this.notifyListeners(\"recordingState\", {\n isRecording: true,\n duration: 0,\n fileSize: 0,\n });\n let autoStopping = false;\n this.recordingStateInterval = setInterval(() => {\n if (!this.isRecording || autoStopping)\n return;\n const duration = (Date.now() - this.recordingStartTime) / 1000;\n const fileSize = this.recordedChunks.reduce((acc, chunk) => acc + chunk.size, 0);\n this.notifyListeners(\"recordingState\", {\n isRecording: true,\n duration,\n fileSize,\n });\n const overLimit = (options?.maxDuration && duration >= options.maxDuration) ||\n (options?.maxFileSize && fileSize >= options.maxFileSize);\n if (overLimit) {\n autoStopping = true;\n this.stopRecording().catch((err) => {\n console.error(\"[Camera] Auto-stop recording failed:\", err);\n });\n }\n }, 500);\n }\n async stopRecording() {\n if (!this.isRecording || !this.mediaRecorder) {\n throw new Error(\"Not recording\");\n }\n return new Promise((resolve, reject) => {\n if (!this.mediaRecorder) {\n reject(new Error(\"MediaRecorder not initialized\"));\n return;\n }\n const duration = (Date.now() - this.recordingStartTime) / 1000;\n this.mediaRecorder.onstop = () => {\n if (this.recordingStateInterval) {\n clearInterval(this.recordingStateInterval);\n this.recordingStateInterval = null;\n }\n this.isRecording = false;\n const blob = new Blob(this.recordedChunks, {\n type: this.mediaRecorder?.mimeType || \"video/webm\",\n });\n const url = URL.createObjectURL(blob);\n const video = document.createElement(\"video\");\n video.src = url;\n video.onloadedmetadata = () => {\n resolve({\n path: url,\n duration,\n width: video.videoWidth,\n height: video.videoHeight,\n fileSize: blob.size,\n mimeType: this.mediaRecorder?.mimeType || \"video/webm\",\n });\n };\n video.onerror = () => {\n resolve({\n path: url,\n duration,\n width: 0,\n height: 0,\n fileSize: blob.size,\n mimeType: this.mediaRecorder?.mimeType || \"video/webm\",\n });\n };\n this.notifyListeners(\"recordingState\", {\n isRecording: false,\n duration,\n fileSize: blob.size,\n });\n };\n this.mediaRecorder.stop();\n });\n }\n async getRecordingState() {\n const duration = this.isRecording\n ? (Date.now() - this.recordingStartTime) / 1000\n : 0;\n const fileSize = this.recordedChunks.reduce((acc, chunk) => acc + chunk.size, 0);\n return {\n isRecording: this.isRecording,\n duration,\n fileSize,\n };\n }\n async getSettings() {\n return { settings: { ...this.currentSettings } };\n }\n async setSettings(options) {\n this.currentSettings = { ...this.currentSettings, ...options.settings };\n if (this.mediaStream && options.settings.zoom !== undefined) {\n await this.applyZoom(options.settings.zoom);\n }\n }\n async setZoom(options) {\n if (!Number.isFinite(options.zoom) || options.zoom < 0) {\n throw new Error(`Invalid zoom value: ${options.zoom}. Must be a non-negative finite number.`);\n }\n await this.applyZoom(options.zoom);\n this.currentSettings.zoom = options.zoom;\n }\n async applyZoom(zoom) {\n if (!this.mediaStream)\n return;\n const track = this.mediaStream.getVideoTracks()[0];\n if (!track)\n return;\n const capabilities = track.getCapabilities ? track.getCapabilities() : {};\n const caps = capabilities;\n if (caps.zoom) {\n const clampedZoom = Math.max(caps.zoom.min, Math.min(caps.zoom.max, zoom));\n await track.applyConstraints({\n advanced: [{ zoom: clampedZoom }],\n });\n }\n }\n async setFocusPoint(options) {\n if (!this.mediaStream)\n throw new Error(\"Preview not started\");\n const track = this.mediaStream.getVideoTracks()[0];\n if (!track)\n throw new Error(\"No video track available\");\n // Check if focus control is supported\n const caps = track.getCapabilities ? track.getCapabilities() : {};\n if (!caps.focusMode?.includes(\"manual\")) {\n throw new Error(\"Manual focus not supported by this camera\");\n }\n try {\n await track.applyConstraints({\n advanced: [\n {\n focusMode: \"manual\",\n pointsOfInterest: [{ x: options.x, y: options.y }],\n },\n ],\n });\n }\n catch (e) {\n throw new Error(`Failed to set focus point: ${e instanceof Error ? e.message : \"unknown error\"}`);\n }\n }\n async setExposurePoint(options) {\n if (!this.mediaStream)\n throw new Error(\"Preview not started\");\n const track = this.mediaStream.getVideoTracks()[0];\n if (!track)\n throw new Error(\"No video track available\");\n // Check if exposure control is supported\n const caps = track.getCapabilities ? track.getCapabilities() : {};\n if (!caps.exposureMode?.includes(\"manual\")) {\n throw new Error(\"Manual exposure not supported by this camera\");\n }\n try {\n await track.applyConstraints({\n advanced: [\n {\n exposureMode: \"manual\",\n pointsOfInterest: [{ x: options.x, y: options.y }],\n },\n ],\n });\n }\n catch (e) {\n throw new Error(`Failed to set exposure point: ${e instanceof Error ? e.message : \"unknown error\"}`);\n }\n }\n async checkPermissions() {\n let cameraStatus = \"prompt\";\n let microphoneStatus = \"prompt\";\n try {\n const cameraResult = await navigator.permissions.query({\n name: \"camera\",\n });\n cameraStatus = cameraResult.state;\n }\n catch (err) {\n console.debug(\"[Camera] permissions.query('camera') not supported:\", err);\n }\n try {\n const micResult = await navigator.permissions.query({\n name: \"microphone\",\n });\n microphoneStatus = micResult.state;\n }\n catch (err) {\n console.debug(\"[Camera] permissions.query('microphone') not supported:\", err);\n }\n // Note: Web platform doesn't have a \"photos\" permission concept.\n // Photos are captured from camera stream, so camera permission covers this.\n return {\n camera: cameraStatus,\n microphone: microphoneStatus,\n photos: cameraStatus, // Photos access follows camera permission on web\n };\n }\n async requestPermissions() {\n let cameraStatus = \"denied\";\n let microphoneStatus = \"denied\";\n try {\n const stream = await navigator.mediaDevices.getUserMedia({\n video: true,\n audio: true,\n });\n stream.getTracks().forEach((track) => {\n track.stop();\n });\n cameraStatus = \"granted\";\n microphoneStatus = \"granted\";\n }\n catch {\n try {\n const videoStream = await navigator.mediaDevices.getUserMedia({\n video: true,\n });\n videoStream.getTracks().forEach((track) => {\n track.stop();\n });\n cameraStatus = \"granted\";\n }\n catch {\n cameraStatus = \"denied\";\n }\n try {\n const audioStream = await navigator.mediaDevices.getUserMedia({\n audio: true,\n });\n audioStream.getTracks().forEach((track) => {\n track.stop();\n });\n microphoneStatus = \"granted\";\n }\n catch {\n microphoneStatus = \"denied\";\n }\n }\n return {\n camera: cameraStatus,\n microphone: microphoneStatus,\n photos: cameraStatus, // Photos access follows camera permission on web\n };\n }\n async addListener(eventName, listenerFunc) {\n const entry = { eventName, callback: listenerFunc };\n this.pluginListeners.push(entry);\n return {\n remove: async () => {\n const i = this.pluginListeners.indexOf(entry);\n if (i >= 0)\n this.pluginListeners.splice(i, 1);\n },\n };\n }\n async removeAllListeners() {\n this.pluginListeners = [];\n }\n notifyListeners(eventName, data) {\n this.pluginListeners\n .filter((l) => l.eventName === eventName)\n .forEach((l) => {\n l.callback(data);\n });\n }\n}\n"],"names":["registerPlugin","WebPlugin"],"mappings":";;;;AAEA,MAAM,OAAO,GAAG,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,SAAS,EAAE,CAAC;AACxD,MAAC,MAAM,GAAGA,mBAAc,CAAC,aAAa,EAAE;AACpD,IAAI,GAAG,EAAE,OAAO;AAChB,CAAC;;ACJD,MAAM,gBAAgB,GAAG;AACzB,IAAI,4BAA4B;AAChC,IAAI,4BAA4B;AAChC,IAAI,YAAY;AAChB,IAAI,WAAW;AACf,CAAC;AACD,MAAM,oBAAoB,GAAG,MAAM,gBAAgB,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,aAAa,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,IAAI,IAAI;AAClG,MAAM,SAAS,SAASC,cAAS,CAAC;AACzC,IAAI,WAAW,GAAG;AAClB,QAAQ,KAAK,CAAC,GAAG,SAAS,CAAC;AAC3B,QAAQ,IAAI,CAAC,WAAW,GAAG,IAAI;AAC/B,QAAQ,IAAI,CAAC,YAAY,GAAG,IAAI;AAChC,QAAQ,IAAI,CAAC,cAAc,GAAG,IAAI;AAClC,QAAQ,IAAI,CAAC,eAAe,GAAG,IAAI;AACnC,QAAQ,IAAI,CAAC,aAAa,GAAG,IAAI;AACjC,QAAQ,IAAI,CAAC,cAAc,GAAG,EAAE;AAChC,QAAQ,IAAI,CAAC,kBAAkB,GAAG,CAAC;AACnC,QAAQ,IAAI,CAAC,sBAAsB,GAAG,IAAI;AAC1C,QAAQ,IAAI,CAAC,WAAW,GAAG,KAAK;AAChC,QAAQ,IAAI,CAAC,eAAe,GAAG;AAC/B,YAAY,KAAK,EAAE,KAAK;AACxB,YAAY,IAAI,EAAE,CAAC;AACnB,YAAY,SAAS,EAAE,YAAY;AACnC,YAAY,YAAY,EAAE,YAAY;AACtC,YAA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,YAAY,MAAM;AAClB,gBAAgB,gBAAgB,GAAG,QAAQ;AAC3C,YAAY;AACZ,QAAQ;AACR,QAAQ,OAAO;AACf,YAAY,MAAM,EAAE,YAAY;AAChC,YAAY,UAAU,EAAE,gBAAgB;AACxC,YAAY,MAAM,EAAE,YAAY;AAChC,SAAS;AACT,IAAI;AACJ,IAAI,MAAM,WAAW,CAAC,SAAS,EAAE,YAAY,EAAE;AAC/C,QAAQ,MAAM,KAAK,GAAG,EAAE,SAAS,EAAE,QAAQ,EAAE,YAAY,EAAE;AAC3D,QAAQ,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,KAAK,CAAC;AACxC,QAAQ,OAAO;AACf,YAAY,MAAM,EAAE,YAAY;AAChC,gBAAgB,MAAM,CAAC,GAAG,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,KAAK,CAAC;AAC7D,gBAAgB,IAAI,CAAC,IAAI,CAAC;AAC1B,oBAAoB,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC;AACrD,YAAY,CAAC;AACb,SAAS;AACT,IAAI;AACJ,IAAI,MAAM,kBAAkB,GAAG;AAC/B,QAAQ,IAAI,CAAC,eAAe,GAAG,EAAE;AACjC,IAAI;AACJ,IAAI,eAAe,CAAC,SAAS,EAAE,IAAI,EAAE;AACrC,QAAQ,IAAI,CAAC;AACb,aAAa,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,SAAS,KAAK,SAAS;AACpD,aAAa,OAAO,CAAC,CAAC,CAAC,KAAK;AAC5B,YAAY,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC;AAC5B,QAAQ,CAAC,CAAC;AACV,IAAI;AACJ;;;;;;;;;"}
1
+ {"version":3,"file":"plugin.cjs.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from \"@capacitor/core\";\nexport * from \"./definitions\";\nconst loadWeb = () => import(\"./web\").then((m) => new m.CameraWeb());\nexport const Camera = registerPlugin(\"ElizaCamera\", {\n web: loadWeb,\n});\n","import { WebPlugin } from \"@capacitor/core\";\nconst VIDEO_MIME_TYPES = [\n \"video/webm;codecs=vp9,opus\",\n \"video/webm;codecs=vp8,opus\",\n \"video/webm\",\n \"video/mp4\",\n];\nconst getSupportedMimeType = () => VIDEO_MIME_TYPES.find((m) => MediaRecorder.isTypeSupported(m)) ?? null;\nconst getMediaDevices = () => {\n if (!navigator.mediaDevices?.getUserMedia) {\n throw new Error(\"Camera media devices API is not available\");\n }\n return navigator.mediaDevices;\n};\nconst assertPositiveFinite = (value, name) => {\n if (!Number.isFinite(value) || value <= 0) {\n throw new Error(`${name} must be a positive finite number`);\n }\n};\nconst assertRecordingOptions = (options) => {\n if (!options)\n return;\n if (options.quality !== undefined &&\n ![\"low\", \"medium\", \"high\", \"highest\"].includes(options.quality)) {\n throw new Error(\"quality must be one of low, medium, high, or highest\");\n }\n if (options.maxDuration !== undefined) {\n assertPositiveFinite(options.maxDuration, \"maxDuration\");\n }\n if (options.maxFileSize !== undefined) {\n assertPositiveFinite(options.maxFileSize, \"maxFileSize\");\n }\n if (options.bitrate !== undefined) {\n assertPositiveFinite(options.bitrate, \"bitrate\");\n }\n if (options.frameRate !== undefined) {\n assertPositiveFinite(options.frameRate, \"frameRate\");\n }\n};\nexport class CameraWeb extends WebPlugin {\n constructor() {\n super(...arguments);\n this.mediaStream = null;\n this.videoElement = null;\n this.previewElement = null;\n this.currentDeviceId = null;\n this.mediaRecorder = null;\n this.recordedChunks = [];\n this.recordingStartTime = 0;\n this.recordingStateInterval = null;\n this.isRecording = false;\n this.currentSettings = {\n flash: \"off\",\n zoom: 1,\n focusMode: \"continuous\",\n exposureMode: \"continuous\",\n exposureCompensation: 0,\n whiteBalance: \"auto\",\n };\n this.pluginListeners = [];\n }\n async getDevices() {\n // enumerateDevices() returns unlabeled device records unless the user has\n // already granted camera permission via a prior getUserMedia() call.\n // We intentionally do NOT call getUserMedia() here because it requires a\n // user gesture and would throw NotAllowedError if called programmatically.\n const mediaDevices = getMediaDevices();\n if (!mediaDevices.enumerateDevices) {\n throw new Error(\"Camera device enumeration is not available\");\n }\n const allDevices = await mediaDevices.enumerateDevices();\n const videoDevices = allDevices.filter((d) => d.kind === \"videoinput\");\n const devices = await Promise.all(videoDevices.map(async (device, index) => ({\n deviceId: device.deviceId,\n label: device.label || `Camera ${index + 1}`,\n direction: this.inferDirection(device.label),\n // Capability probing requires getUserMedia(), which can prompt for\n // camera permission. Enumeration stays prompt-free and reports\n // unknown capabilities until preview/capture has explicit access.\n hasFlash: false,\n hasZoom: false,\n maxZoom: 1,\n supportedResolutions: [],\n supportedFrameRates: [],\n })));\n return { devices };\n }\n inferDirection(label) {\n const lowerLabel = label.toLowerCase();\n if (lowerLabel.includes(\"front\") ||\n lowerLabel.includes(\"facetime\") ||\n lowerLabel.includes(\"user\")) {\n return \"front\";\n }\n if (lowerLabel.includes(\"back\") ||\n lowerLabel.includes(\"rear\") ||\n lowerLabel.includes(\"environment\")) {\n return \"back\";\n }\n return \"external\";\n }\n async startPreview(options) {\n if (!options?.element?.appendChild) {\n throw new Error(\"Preview element is required\");\n }\n if (options.resolution) {\n assertPositiveFinite(options.resolution.width, \"resolution.width\");\n assertPositiveFinite(options.resolution.height, \"resolution.height\");\n }\n if (options.frameRate !== undefined) {\n assertPositiveFinite(options.frameRate, \"frameRate\");\n }\n await this.stopPreview();\n const constraints = {\n video: {\n deviceId: options.deviceId ? { exact: options.deviceId } : undefined,\n facingMode: options.direction === \"front\"\n ? \"user\"\n : options.direction === \"back\"\n ? \"environment\"\n : undefined,\n width: options.resolution?.width\n ? { ideal: options.resolution.width }\n : { ideal: 1920 },\n height: options.resolution?.height\n ? { ideal: options.resolution.height }\n : { ideal: 1080 },\n frameRate: options.frameRate\n ? { ideal: options.frameRate }\n : { ideal: 30 },\n },\n audio: false,\n };\n // Browser camera permission is requested by opening the stream. Native\n // permission probing is handled outside this Capacitor web fallback.\n this.mediaStream = await getMediaDevices().getUserMedia(constraints);\n this.previewElement = options.element;\n this.videoElement = document.createElement(\"video\");\n this.videoElement.srcObject = this.mediaStream;\n this.videoElement.autoplay = true;\n this.videoElement.playsInline = true;\n this.videoElement.muted = true;\n this.videoElement.style.width = \"100%\";\n this.videoElement.style.height = \"100%\";\n this.videoElement.style.objectFit = \"cover\";\n if (options.mirror) {\n this.videoElement.style.transform = \"scaleX(-1)\";\n }\n this.previewElement.appendChild(this.videoElement);\n await this.videoElement.play();\n const track = this.mediaStream.getVideoTracks()[0];\n const settings = track.getSettings();\n this.currentDeviceId = settings.deviceId || options.deviceId || \"\";\n return {\n width: settings.width || options.resolution?.width || 1920,\n height: settings.height || options.resolution?.height || 1080,\n deviceId: this.currentDeviceId,\n };\n }\n async stopPreview() {\n if (this.isRecording) {\n await this.stopRecording();\n }\n if (this.mediaStream) {\n this.mediaStream.getTracks().forEach((track) => {\n track.stop();\n });\n this.mediaStream = null;\n }\n if (this.videoElement) {\n if (this.previewElement?.contains(this.videoElement)) {\n this.previewElement.removeChild(this.videoElement);\n }\n this.videoElement = null;\n }\n this.previewElement = null;\n this.currentDeviceId = null;\n }\n async switchCamera(options) {\n if (!this.previewElement) {\n throw new Error(\"Preview not started\");\n }\n const mirror = options.direction === \"front\";\n return this.startPreview({\n element: this.previewElement,\n deviceId: options.deviceId,\n direction: options.direction,\n mirror,\n });\n }\n async capturePhoto(options) {\n if (!this.videoElement || !this.mediaStream) {\n throw new Error(\"Preview not started\");\n }\n const track = this.mediaStream.getVideoTracks()[0];\n const settings = track.getSettings();\n const videoWidth = settings.width || this.videoElement.videoWidth;\n const videoHeight = settings.height || this.videoElement.videoHeight;\n assertPositiveFinite(videoWidth, \"videoWidth\");\n assertPositiveFinite(videoHeight, \"videoHeight\");\n const targetWidth = options?.width || videoWidth;\n const targetHeight = options?.height || videoHeight;\n assertPositiveFinite(targetWidth, \"width\");\n assertPositiveFinite(targetHeight, \"height\");\n if (options?.quality !== undefined &&\n (!Number.isFinite(options.quality) ||\n options.quality < 0 ||\n options.quality > 100)) {\n throw new Error(\"quality must be a finite number between 0 and 100\");\n }\n const canvas = document.createElement(\"canvas\");\n canvas.width = targetWidth;\n canvas.height = targetHeight;\n const ctx = canvas.getContext(\"2d\");\n if (!ctx) {\n throw new Error(\"Failed to get canvas context\");\n }\n const scaleX = targetWidth / videoWidth;\n const scaleY = targetHeight / videoHeight;\n const scale = Math.max(scaleX, scaleY);\n const drawWidth = videoWidth * scale;\n const drawHeight = videoHeight * scale;\n const drawX = (targetWidth - drawWidth) / 2;\n const drawY = (targetHeight - drawHeight) / 2;\n ctx.drawImage(this.videoElement, drawX, drawY, drawWidth, drawHeight);\n const quality = (options?.quality ?? 90) / 100;\n const format = options?.format || \"jpeg\";\n const mimeType = format === \"png\"\n ? \"image/png\"\n : format === \"webp\"\n ? \"image/webp\"\n : \"image/jpeg\";\n const dataUrl = canvas.toDataURL(mimeType, quality);\n const base64 = dataUrl.split(\",\")[1];\n if (!base64) {\n throw new Error(\"Failed to encode captured photo\");\n }\n return {\n base64,\n format,\n width: targetWidth,\n height: targetHeight,\n };\n }\n async startRecording(options) {\n if (!this.mediaStream) {\n throw new Error(\"Preview not started\");\n }\n if (this.isRecording) {\n throw new Error(\"Recording already in progress\");\n }\n assertRecordingOptions(options);\n let streamToRecord = this.mediaStream;\n if (options?.audio !== false) {\n const audioStream = await getMediaDevices().getUserMedia({\n audio: true,\n });\n streamToRecord = new MediaStream([\n ...this.mediaStream.getVideoTracks(),\n ...audioStream.getAudioTracks(),\n ]);\n }\n const mimeType = getSupportedMimeType();\n if (!mimeType)\n throw new Error(\"No supported video mime type found\");\n const recorderOptions = { mimeType };\n if (options?.bitrate)\n recorderOptions.videoBitsPerSecond = options.bitrate;\n this.recordedChunks = [];\n this.mediaRecorder = new MediaRecorder(streamToRecord, recorderOptions);\n this.mediaRecorder.ondataavailable = (event) => {\n if (event.data.size > 0) {\n this.recordedChunks.push(event.data);\n }\n };\n this.mediaRecorder.onerror = (event) => {\n this.notifyListeners(\"error\", {\n code: \"RECORDING_ERROR\",\n message: `Recording error: ${event.message || \"Unknown error\"}`,\n });\n };\n this.recordingStartTime = Date.now();\n this.isRecording = true;\n this.mediaRecorder.start(1000);\n this.notifyListeners(\"recordingState\", {\n isRecording: true,\n duration: 0,\n fileSize: 0,\n });\n let autoStopping = false;\n this.recordingStateInterval = setInterval(() => {\n if (!this.isRecording || autoStopping)\n return;\n const duration = (Date.now() - this.recordingStartTime) / 1000;\n const fileSize = this.recordedChunks.reduce((acc, chunk) => acc + chunk.size, 0);\n this.notifyListeners(\"recordingState\", {\n isRecording: true,\n duration,\n fileSize,\n });\n const overLimit = (options?.maxDuration && duration >= options.maxDuration) ||\n (options?.maxFileSize && fileSize >= options.maxFileSize);\n if (overLimit) {\n autoStopping = true;\n this.stopRecording().catch((err) => {\n console.error(\"[Camera] Auto-stop recording failed:\", err);\n });\n }\n }, 500);\n }\n async stopRecording() {\n if (!this.isRecording || !this.mediaRecorder) {\n throw new Error(\"Not recording\");\n }\n return new Promise((resolve, reject) => {\n if (!this.mediaRecorder) {\n reject(new Error(\"MediaRecorder not initialized\"));\n return;\n }\n const duration = (Date.now() - this.recordingStartTime) / 1000;\n this.mediaRecorder.onstop = () => {\n if (this.recordingStateInterval) {\n clearInterval(this.recordingStateInterval);\n this.recordingStateInterval = null;\n }\n this.isRecording = false;\n const blob = new Blob(this.recordedChunks, {\n type: this.mediaRecorder?.mimeType || \"video/webm\",\n });\n const url = URL.createObjectURL(blob);\n const video = document.createElement(\"video\");\n video.src = url;\n video.onloadedmetadata = () => {\n resolve({\n path: url,\n duration,\n width: video.videoWidth,\n height: video.videoHeight,\n fileSize: blob.size,\n mimeType: this.mediaRecorder?.mimeType || \"video/webm\",\n });\n };\n video.onerror = () => {\n resolve({\n path: url,\n duration,\n width: 0,\n height: 0,\n fileSize: blob.size,\n mimeType: this.mediaRecorder?.mimeType || \"video/webm\",\n });\n };\n this.notifyListeners(\"recordingState\", {\n isRecording: false,\n duration,\n fileSize: blob.size,\n });\n };\n this.mediaRecorder.stop();\n });\n }\n async getRecordingState() {\n const duration = this.isRecording\n ? (Date.now() - this.recordingStartTime) / 1000\n : 0;\n const fileSize = this.recordedChunks.reduce((acc, chunk) => acc + chunk.size, 0);\n return {\n isRecording: this.isRecording,\n duration,\n fileSize,\n };\n }\n async getSettings() {\n return { settings: { ...this.currentSettings } };\n }\n async setSettings(options) {\n if (!options?.settings || typeof options.settings !== \"object\") {\n throw new Error(\"settings object is required\");\n }\n if (options.settings.zoom !== undefined) {\n const zoom = options.settings.zoom;\n this.assertValidZoom(zoom);\n }\n this.currentSettings = { ...this.currentSettings, ...options.settings };\n if (this.mediaStream && options.settings.zoom !== undefined) {\n await this.applyZoom(options.settings.zoom);\n }\n }\n async setZoom(options) {\n const zoom = options?.zoom;\n this.assertValidZoom(zoom);\n await this.applyZoom(zoom);\n this.currentSettings.zoom = zoom;\n }\n assertValidZoom(zoom) {\n if (typeof zoom !== \"number\" || !Number.isFinite(zoom) || zoom < 0) {\n throw new Error(`Invalid zoom value: ${zoom}. Must be a non-negative finite number.`);\n }\n }\n async applyZoom(zoom) {\n if (!this.mediaStream)\n return;\n const track = this.mediaStream.getVideoTracks()[0];\n if (!track)\n return;\n const capabilities = track.getCapabilities ? track.getCapabilities() : {};\n const caps = capabilities;\n if (caps.zoom) {\n const clampedZoom = Math.max(caps.zoom.min, Math.min(caps.zoom.max, zoom));\n await track.applyConstraints({\n advanced: [{ zoom: clampedZoom }],\n });\n }\n }\n async setFocusPoint(options) {\n if (!this.mediaStream)\n throw new Error(\"Preview not started\");\n this.assertNormalizedPoint(options, \"focus point\");\n const track = this.mediaStream.getVideoTracks()[0];\n if (!track)\n throw new Error(\"No video track available\");\n // Check if focus control is supported\n const caps = track.getCapabilities ? track.getCapabilities() : {};\n if (!caps.focusMode?.includes(\"manual\")) {\n throw new Error(\"Manual focus not supported by this camera\");\n }\n try {\n await track.applyConstraints({\n advanced: [\n {\n focusMode: \"manual\",\n pointsOfInterest: [{ x: options.x, y: options.y }],\n },\n ],\n });\n }\n catch (e) {\n throw new Error(`Failed to set focus point: ${e instanceof Error ? e.message : \"unknown error\"}`);\n }\n }\n async setExposurePoint(options) {\n if (!this.mediaStream)\n throw new Error(\"Preview not started\");\n this.assertNormalizedPoint(options, \"exposure point\");\n const track = this.mediaStream.getVideoTracks()[0];\n if (!track)\n throw new Error(\"No video track available\");\n // Check if exposure control is supported\n const caps = track.getCapabilities ? track.getCapabilities() : {};\n if (!caps.exposureMode?.includes(\"manual\")) {\n throw new Error(\"Manual exposure not supported by this camera\");\n }\n try {\n await track.applyConstraints({\n advanced: [\n {\n exposureMode: \"manual\",\n pointsOfInterest: [{ x: options.x, y: options.y }],\n },\n ],\n });\n }\n catch (e) {\n throw new Error(`Failed to set exposure point: ${e instanceof Error ? e.message : \"unknown error\"}`);\n }\n }\n assertNormalizedPoint(options, name) {\n if (!Number.isFinite(options?.x) ||\n !Number.isFinite(options?.y) ||\n options.x < 0 ||\n options.x > 1 ||\n options.y < 0 ||\n options.y > 1) {\n throw new Error(`${name} must use finite x/y values between 0 and 1`);\n }\n }\n async checkPermissions() {\n let cameraStatus = \"prompt\";\n let microphoneStatus = \"prompt\";\n try {\n const cameraResult = await navigator.permissions.query({\n name: \"camera\",\n });\n cameraStatus = cameraResult.state;\n }\n catch (err) {\n console.debug(\"[Camera] permissions.query('camera') not supported:\", err);\n }\n try {\n const micResult = await navigator.permissions.query({\n name: \"microphone\",\n });\n microphoneStatus = micResult.state;\n }\n catch (err) {\n console.debug(\"[Camera] permissions.query('microphone') not supported:\", err);\n }\n // Note: Web platform doesn't have a \"photos\" permission concept.\n // Photos are captured from camera stream, so camera permission covers this.\n return {\n camera: cameraStatus,\n microphone: microphoneStatus,\n photos: cameraStatus, // Photos access follows camera permission on web\n };\n }\n async requestPermissions() {\n let cameraStatus = \"denied\";\n let microphoneStatus = \"denied\";\n try {\n const stream = await getMediaDevices().getUserMedia({\n video: true,\n audio: true,\n });\n stream.getTracks().forEach((track) => {\n track.stop();\n });\n cameraStatus = \"granted\";\n microphoneStatus = \"granted\";\n }\n catch {\n try {\n const videoStream = await getMediaDevices().getUserMedia({\n video: true,\n });\n videoStream.getTracks().forEach((track) => {\n track.stop();\n });\n cameraStatus = \"granted\";\n }\n catch {\n cameraStatus = \"denied\";\n }\n try {\n const audioStream = await getMediaDevices().getUserMedia({\n audio: true,\n });\n audioStream.getTracks().forEach((track) => {\n track.stop();\n });\n microphoneStatus = \"granted\";\n }\n catch {\n microphoneStatus = \"denied\";\n }\n }\n return {\n camera: cameraStatus,\n microphone: microphoneStatus,\n photos: cameraStatus, // Photos access follows camera permission on web\n };\n }\n async addListener(eventName, listenerFunc) {\n const entry = { eventName, callback: listenerFunc };\n this.pluginListeners.push(entry);\n return {\n remove: async () => {\n const i = this.pluginListeners.indexOf(entry);\n if (i >= 0)\n this.pluginListeners.splice(i, 1);\n },\n };\n }\n async removeAllListeners() {\n this.pluginListeners = [];\n }\n notifyListeners(eventName, data) {\n this.pluginListeners\n .filter((l) => l.eventName === eventName)\n .forEach((l) => {\n l.callback(data);\n });\n }\n}\n"],"names":["registerPlugin","WebPlugin"],"mappings":";;;;AAEA,MAAM,OAAO,GAAG,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,SAAS,EAAE,CAAC;AACxD,MAAC,MAAM,GAAGA,mBAAc,CAAC,aAAa,EAAE;AACpD,IAAI,GAAG,EAAE,OAAO;AAChB,CAAC;;ACJD,MAAM,gBAAgB,GAAG;AACzB,IAAI,4BAA4B;AAChC,IAAI,4BAA4B;AAChC,IAAI,YAAY;AAChB,IAAI,WAAW;AACf,CAAC;AACD,MAAM,oBAAoB,GAAG,MAAM,gBAAgB,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,aAAa,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,IAAI,IAAI;AACzG,MAAM,eAAe,GAAG,MAAM;AAC9B,IAAI,IAAI,CAAC,SAAS,CAAC,YA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