@elizaos/capacitor-camera 1.0.0

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/dist/plugin.js ADDED
@@ -0,0 +1,560 @@
1
+ var capacitorElizaCamera = (function (exports, core) {
2
+ 'use strict';
3
+
4
+ const loadWeb = () => Promise.resolve().then(function () { return web; }).then((m) => new m.CameraWeb());
5
+ const Camera = core.registerPlugin("ElizaCamera", {
6
+ web: loadWeb,
7
+ });
8
+
9
+ const VIDEO_MIME_TYPES = [
10
+ "video/webm;codecs=vp9,opus",
11
+ "video/webm;codecs=vp8,opus",
12
+ "video/webm",
13
+ "video/mp4",
14
+ ];
15
+ const getSupportedMimeType = () => VIDEO_MIME_TYPES.find((m) => MediaRecorder.isTypeSupported(m)) ?? null;
16
+ class CameraWeb extends core.WebPlugin {
17
+ constructor() {
18
+ super(...arguments);
19
+ this.mediaStream = null;
20
+ this.videoElement = null;
21
+ this.previewElement = null;
22
+ this.currentDeviceId = null;
23
+ this.mediaRecorder = null;
24
+ this.recordedChunks = [];
25
+ this.recordingStartTime = 0;
26
+ this.recordingStateInterval = null;
27
+ this.isRecording = false;
28
+ this.currentSettings = {
29
+ flash: "off",
30
+ zoom: 1,
31
+ focusMode: "continuous",
32
+ exposureMode: "continuous",
33
+ exposureCompensation: 0,
34
+ whiteBalance: "auto",
35
+ };
36
+ this.pluginListeners = [];
37
+ }
38
+ async getDevices() {
39
+ // enumerateDevices() returns device stubs without labels unless the user
40
+ // has already granted camera permission via a prior getUserMedia() call.
41
+ // We intentionally do NOT call getUserMedia() here because it requires a
42
+ // user gesture and would throw NotAllowedError if called programmatically.
43
+ const allDevices = await navigator.mediaDevices.enumerateDevices();
44
+ const videoDevices = allDevices.filter((d) => d.kind === "videoinput");
45
+ const devices = await Promise.all(videoDevices.map(async (device, index) => {
46
+ const capabilities = await this.getDeviceCapabilities(device.deviceId);
47
+ return {
48
+ deviceId: device.deviceId,
49
+ label: device.label || `Camera ${index + 1}`,
50
+ direction: this.inferDirection(device.label),
51
+ // Flash detection not available via MediaDevices API on web
52
+ hasFlash: capabilities?.hasFlash ?? false,
53
+ hasZoom: !!capabilities?.zoom,
54
+ maxZoom: capabilities?.zoom?.max ?? 1,
55
+ // Return actual capabilities or empty array to indicate unknown
56
+ supportedResolutions: capabilities?.resolutions ?? [],
57
+ supportedFrameRates: capabilities?.frameRates ?? [],
58
+ };
59
+ }));
60
+ return { devices };
61
+ }
62
+ inferDirection(label) {
63
+ const lowerLabel = label.toLowerCase();
64
+ if (lowerLabel.includes("front") ||
65
+ lowerLabel.includes("facetime") ||
66
+ lowerLabel.includes("user")) {
67
+ return "front";
68
+ }
69
+ if (lowerLabel.includes("back") ||
70
+ lowerLabel.includes("rear") ||
71
+ lowerLabel.includes("environment")) {
72
+ return "back";
73
+ }
74
+ return "external";
75
+ }
76
+ async getDeviceCapabilities(deviceId) {
77
+ let stream;
78
+ try {
79
+ stream = await navigator.mediaDevices.getUserMedia({
80
+ video: { deviceId: { exact: deviceId } },
81
+ });
82
+ }
83
+ catch {
84
+ return null; // Device not accessible
85
+ }
86
+ const track = stream.getVideoTracks()[0];
87
+ if (!track) {
88
+ stream.getTracks().forEach((t) => {
89
+ t.stop();
90
+ });
91
+ return null;
92
+ }
93
+ const capabilities = track.getCapabilities ? track.getCapabilities() : {};
94
+ stream.getTracks().forEach((t) => {
95
+ t.stop();
96
+ });
97
+ const caps = capabilities;
98
+ // Build resolutions from actual device capabilities only
99
+ const resolutions = [];
100
+ if (caps.width?.max && caps.height?.max) {
101
+ resolutions.push({ width: caps.width.max, height: caps.height.max });
102
+ // Add common lower resolutions only if device supports them
103
+ if (caps.width.max >= 1280 && caps.height.max >= 720) {
104
+ resolutions.push({ width: 1280, height: 720 });
105
+ }
106
+ if (caps.width.max >= 640 && caps.height.max >= 480) {
107
+ resolutions.push({ width: 640, height: 480 });
108
+ }
109
+ }
110
+ // Build frameRates from actual device capabilities only
111
+ const frameRates = [];
112
+ if (caps.frameRate?.max) {
113
+ if (caps.frameRate.max >= 60)
114
+ frameRates.push(60);
115
+ if (caps.frameRate.max >= 30)
116
+ frameRates.push(30);
117
+ if (caps.frameRate.max >= 24)
118
+ frameRates.push(24);
119
+ if (caps.frameRate.max >= 15)
120
+ frameRates.push(15);
121
+ }
122
+ return {
123
+ zoom: caps.zoom,
124
+ resolutions: resolutions.length > 0 ? resolutions : undefined,
125
+ frameRates: frameRates.length > 0 ? frameRates : undefined,
126
+ hasFlash: caps.torch === true, // Torch capability indicates flash support
127
+ };
128
+ }
129
+ async startPreview(options) {
130
+ await this.stopPreview();
131
+ const constraints = {
132
+ video: {
133
+ deviceId: options.deviceId ? { exact: options.deviceId } : undefined,
134
+ facingMode: options.direction === "front"
135
+ ? "user"
136
+ : options.direction === "back"
137
+ ? "environment"
138
+ : undefined,
139
+ width: options.resolution?.width
140
+ ? { ideal: options.resolution.width }
141
+ : { ideal: 1920 },
142
+ height: options.resolution?.height
143
+ ? { ideal: options.resolution.height }
144
+ : { ideal: 1080 },
145
+ frameRate: options.frameRate
146
+ ? { ideal: options.frameRate }
147
+ : { ideal: 30 },
148
+ },
149
+ audio: false,
150
+ };
151
+ this.mediaStream = await navigator.mediaDevices.getUserMedia(constraints);
152
+ this.previewElement = options.element;
153
+ this.videoElement = document.createElement("video");
154
+ this.videoElement.srcObject = this.mediaStream;
155
+ this.videoElement.autoplay = true;
156
+ this.videoElement.playsInline = true;
157
+ this.videoElement.muted = true;
158
+ this.videoElement.style.width = "100%";
159
+ this.videoElement.style.height = "100%";
160
+ this.videoElement.style.objectFit = "cover";
161
+ if (options.mirror) {
162
+ this.videoElement.style.transform = "scaleX(-1)";
163
+ }
164
+ this.previewElement.appendChild(this.videoElement);
165
+ await this.videoElement.play();
166
+ const track = this.mediaStream.getVideoTracks()[0];
167
+ const settings = track.getSettings();
168
+ this.currentDeviceId = settings.deviceId || options.deviceId || "";
169
+ return {
170
+ width: settings.width || options.resolution?.width || 1920,
171
+ height: settings.height || options.resolution?.height || 1080,
172
+ deviceId: this.currentDeviceId,
173
+ };
174
+ }
175
+ async stopPreview() {
176
+ if (this.isRecording) {
177
+ await this.stopRecording();
178
+ }
179
+ if (this.mediaStream) {
180
+ this.mediaStream.getTracks().forEach((track) => {
181
+ track.stop();
182
+ });
183
+ this.mediaStream = null;
184
+ }
185
+ if (this.videoElement && this.previewElement) {
186
+ this.previewElement.removeChild(this.videoElement);
187
+ this.videoElement = null;
188
+ }
189
+ this.previewElement = null;
190
+ this.currentDeviceId = null;
191
+ }
192
+ async switchCamera(options) {
193
+ if (!this.previewElement) {
194
+ throw new Error("Preview not started");
195
+ }
196
+ const mirror = options.direction === "front";
197
+ return this.startPreview({
198
+ element: this.previewElement,
199
+ deviceId: options.deviceId,
200
+ direction: options.direction,
201
+ mirror,
202
+ });
203
+ }
204
+ async capturePhoto(options) {
205
+ if (!this.videoElement || !this.mediaStream) {
206
+ throw new Error("Preview not started");
207
+ }
208
+ const track = this.mediaStream.getVideoTracks()[0];
209
+ const settings = track.getSettings();
210
+ const videoWidth = settings.width || this.videoElement.videoWidth;
211
+ const videoHeight = settings.height || this.videoElement.videoHeight;
212
+ const targetWidth = options?.width || videoWidth;
213
+ const targetHeight = options?.height || videoHeight;
214
+ const canvas = document.createElement("canvas");
215
+ canvas.width = targetWidth;
216
+ canvas.height = targetHeight;
217
+ const ctx = canvas.getContext("2d");
218
+ if (!ctx) {
219
+ throw new Error("Failed to get canvas context");
220
+ }
221
+ const scaleX = targetWidth / videoWidth;
222
+ const scaleY = targetHeight / videoHeight;
223
+ const scale = Math.max(scaleX, scaleY);
224
+ const drawWidth = videoWidth * scale;
225
+ const drawHeight = videoHeight * scale;
226
+ const drawX = (targetWidth - drawWidth) / 2;
227
+ const drawY = (targetHeight - drawHeight) / 2;
228
+ ctx.drawImage(this.videoElement, drawX, drawY, drawWidth, drawHeight);
229
+ const quality = (options?.quality ?? 90) / 100;
230
+ const format = options?.format || "jpeg";
231
+ const mimeType = format === "png"
232
+ ? "image/png"
233
+ : format === "webp"
234
+ ? "image/webp"
235
+ : "image/jpeg";
236
+ const base64 = canvas.toDataURL(mimeType, quality).split(",")[1];
237
+ return {
238
+ base64,
239
+ format,
240
+ width: targetWidth,
241
+ height: targetHeight,
242
+ };
243
+ }
244
+ async startRecording(options) {
245
+ if (!this.mediaStream) {
246
+ throw new Error("Preview not started");
247
+ }
248
+ if (this.isRecording) {
249
+ throw new Error("Recording already in progress");
250
+ }
251
+ let streamToRecord = this.mediaStream;
252
+ if (options?.audio !== false) {
253
+ const audioStream = await navigator.mediaDevices.getUserMedia({
254
+ audio: true,
255
+ });
256
+ streamToRecord = new MediaStream([
257
+ ...this.mediaStream.getVideoTracks(),
258
+ ...audioStream.getAudioTracks(),
259
+ ]);
260
+ }
261
+ const mimeType = getSupportedMimeType();
262
+ if (!mimeType)
263
+ throw new Error("No supported video mime type found");
264
+ const recorderOptions = { mimeType };
265
+ if (options?.bitrate)
266
+ recorderOptions.videoBitsPerSecond = options.bitrate;
267
+ this.recordedChunks = [];
268
+ this.mediaRecorder = new MediaRecorder(streamToRecord, recorderOptions);
269
+ this.mediaRecorder.ondataavailable = (event) => {
270
+ if (event.data.size > 0) {
271
+ this.recordedChunks.push(event.data);
272
+ }
273
+ };
274
+ this.mediaRecorder.onerror = (event) => {
275
+ this.notifyListeners("error", {
276
+ code: "RECORDING_ERROR",
277
+ message: `Recording error: ${event.message || "Unknown error"}`,
278
+ });
279
+ };
280
+ this.recordingStartTime = Date.now();
281
+ this.isRecording = true;
282
+ this.mediaRecorder.start(1000);
283
+ this.notifyListeners("recordingState", {
284
+ isRecording: true,
285
+ duration: 0,
286
+ fileSize: 0,
287
+ });
288
+ let autoStopping = false;
289
+ this.recordingStateInterval = setInterval(() => {
290
+ if (!this.isRecording || autoStopping)
291
+ return;
292
+ const duration = (Date.now() - this.recordingStartTime) / 1000;
293
+ const fileSize = this.recordedChunks.reduce((acc, chunk) => acc + chunk.size, 0);
294
+ this.notifyListeners("recordingState", {
295
+ isRecording: true,
296
+ duration,
297
+ fileSize,
298
+ });
299
+ const overLimit = (options?.maxDuration && duration >= options.maxDuration) ||
300
+ (options?.maxFileSize && fileSize >= options.maxFileSize);
301
+ if (overLimit) {
302
+ autoStopping = true;
303
+ this.stopRecording().catch((err) => {
304
+ console.error("[Camera] Auto-stop recording failed:", err);
305
+ });
306
+ }
307
+ }, 500);
308
+ }
309
+ async stopRecording() {
310
+ if (!this.isRecording || !this.mediaRecorder) {
311
+ throw new Error("Not recording");
312
+ }
313
+ return new Promise((resolve, reject) => {
314
+ if (!this.mediaRecorder) {
315
+ reject(new Error("MediaRecorder not initialized"));
316
+ return;
317
+ }
318
+ const duration = (Date.now() - this.recordingStartTime) / 1000;
319
+ this.mediaRecorder.onstop = () => {
320
+ if (this.recordingStateInterval) {
321
+ clearInterval(this.recordingStateInterval);
322
+ this.recordingStateInterval = null;
323
+ }
324
+ this.isRecording = false;
325
+ const blob = new Blob(this.recordedChunks, {
326
+ type: this.mediaRecorder?.mimeType || "video/webm",
327
+ });
328
+ const url = URL.createObjectURL(blob);
329
+ const video = document.createElement("video");
330
+ video.src = url;
331
+ video.onloadedmetadata = () => {
332
+ resolve({
333
+ path: url,
334
+ duration,
335
+ width: video.videoWidth,
336
+ height: video.videoHeight,
337
+ fileSize: blob.size,
338
+ mimeType: this.mediaRecorder?.mimeType || "video/webm",
339
+ });
340
+ };
341
+ video.onerror = () => {
342
+ resolve({
343
+ path: url,
344
+ duration,
345
+ width: 0,
346
+ height: 0,
347
+ fileSize: blob.size,
348
+ mimeType: this.mediaRecorder?.mimeType || "video/webm",
349
+ });
350
+ };
351
+ this.notifyListeners("recordingState", {
352
+ isRecording: false,
353
+ duration,
354
+ fileSize: blob.size,
355
+ });
356
+ };
357
+ this.mediaRecorder.stop();
358
+ });
359
+ }
360
+ async getRecordingState() {
361
+ const duration = this.isRecording
362
+ ? (Date.now() - this.recordingStartTime) / 1000
363
+ : 0;
364
+ const fileSize = this.recordedChunks.reduce((acc, chunk) => acc + chunk.size, 0);
365
+ return {
366
+ isRecording: this.isRecording,
367
+ duration,
368
+ fileSize,
369
+ };
370
+ }
371
+ async getSettings() {
372
+ return { settings: { ...this.currentSettings } };
373
+ }
374
+ async setSettings(options) {
375
+ this.currentSettings = { ...this.currentSettings, ...options.settings };
376
+ if (this.mediaStream && options.settings.zoom !== undefined) {
377
+ await this.applyZoom(options.settings.zoom);
378
+ }
379
+ }
380
+ async setZoom(options) {
381
+ if (!Number.isFinite(options.zoom) || options.zoom < 0) {
382
+ throw new Error(`Invalid zoom value: ${options.zoom}. Must be a non-negative finite number.`);
383
+ }
384
+ await this.applyZoom(options.zoom);
385
+ this.currentSettings.zoom = options.zoom;
386
+ }
387
+ async applyZoom(zoom) {
388
+ if (!this.mediaStream)
389
+ return;
390
+ const track = this.mediaStream.getVideoTracks()[0];
391
+ if (!track)
392
+ return;
393
+ const capabilities = track.getCapabilities ? track.getCapabilities() : {};
394
+ const caps = capabilities;
395
+ if (caps.zoom) {
396
+ const clampedZoom = Math.max(caps.zoom.min, Math.min(caps.zoom.max, zoom));
397
+ await track.applyConstraints({
398
+ advanced: [{ zoom: clampedZoom }],
399
+ });
400
+ }
401
+ }
402
+ async setFocusPoint(options) {
403
+ if (!this.mediaStream)
404
+ throw new Error("Preview not started");
405
+ const track = this.mediaStream.getVideoTracks()[0];
406
+ if (!track)
407
+ throw new Error("No video track available");
408
+ // Check if focus control is supported
409
+ const caps = track.getCapabilities ? track.getCapabilities() : {};
410
+ if (!caps.focusMode?.includes("manual")) {
411
+ throw new Error("Manual focus not supported by this camera");
412
+ }
413
+ try {
414
+ await track.applyConstraints({
415
+ advanced: [
416
+ {
417
+ focusMode: "manual",
418
+ pointsOfInterest: [{ x: options.x, y: options.y }],
419
+ },
420
+ ],
421
+ });
422
+ }
423
+ catch (e) {
424
+ throw new Error(`Failed to set focus point: ${e instanceof Error ? e.message : "unknown error"}`);
425
+ }
426
+ }
427
+ async setExposurePoint(options) {
428
+ if (!this.mediaStream)
429
+ throw new Error("Preview not started");
430
+ const track = this.mediaStream.getVideoTracks()[0];
431
+ if (!track)
432
+ throw new Error("No video track available");
433
+ // Check if exposure control is supported
434
+ const caps = track.getCapabilities ? track.getCapabilities() : {};
435
+ if (!caps.exposureMode?.includes("manual")) {
436
+ throw new Error("Manual exposure not supported by this camera");
437
+ }
438
+ try {
439
+ await track.applyConstraints({
440
+ advanced: [
441
+ {
442
+ exposureMode: "manual",
443
+ pointsOfInterest: [{ x: options.x, y: options.y }],
444
+ },
445
+ ],
446
+ });
447
+ }
448
+ catch (e) {
449
+ throw new Error(`Failed to set exposure point: ${e instanceof Error ? e.message : "unknown error"}`);
450
+ }
451
+ }
452
+ async checkPermissions() {
453
+ let cameraStatus = "prompt";
454
+ let microphoneStatus = "prompt";
455
+ try {
456
+ const cameraResult = await navigator.permissions.query({
457
+ name: "camera",
458
+ });
459
+ cameraStatus = cameraResult.state;
460
+ }
461
+ catch (err) {
462
+ console.debug("[Camera] permissions.query('camera') not supported:", err);
463
+ }
464
+ try {
465
+ const micResult = await navigator.permissions.query({
466
+ name: "microphone",
467
+ });
468
+ microphoneStatus = micResult.state;
469
+ }
470
+ catch (err) {
471
+ console.debug("[Camera] permissions.query('microphone') not supported:", err);
472
+ }
473
+ // Note: Web platform doesn't have a "photos" permission concept.
474
+ // Photos are captured from camera stream, so camera permission covers this.
475
+ return {
476
+ camera: cameraStatus,
477
+ microphone: microphoneStatus,
478
+ photos: cameraStatus, // Photos access follows camera permission on web
479
+ };
480
+ }
481
+ async requestPermissions() {
482
+ let cameraStatus = "denied";
483
+ let microphoneStatus = "denied";
484
+ try {
485
+ const stream = await navigator.mediaDevices.getUserMedia({
486
+ video: true,
487
+ audio: true,
488
+ });
489
+ stream.getTracks().forEach((track) => {
490
+ track.stop();
491
+ });
492
+ cameraStatus = "granted";
493
+ microphoneStatus = "granted";
494
+ }
495
+ catch {
496
+ try {
497
+ const videoStream = await navigator.mediaDevices.getUserMedia({
498
+ video: true,
499
+ });
500
+ videoStream.getTracks().forEach((track) => {
501
+ track.stop();
502
+ });
503
+ cameraStatus = "granted";
504
+ }
505
+ catch {
506
+ cameraStatus = "denied";
507
+ }
508
+ try {
509
+ const audioStream = await navigator.mediaDevices.getUserMedia({
510
+ audio: true,
511
+ });
512
+ audioStream.getTracks().forEach((track) => {
513
+ track.stop();
514
+ });
515
+ microphoneStatus = "granted";
516
+ }
517
+ catch {
518
+ microphoneStatus = "denied";
519
+ }
520
+ }
521
+ return {
522
+ camera: cameraStatus,
523
+ microphone: microphoneStatus,
524
+ photos: cameraStatus, // Photos access follows camera permission on web
525
+ };
526
+ }
527
+ async addListener(eventName, listenerFunc) {
528
+ const entry = { eventName, callback: listenerFunc };
529
+ this.pluginListeners.push(entry);
530
+ return {
531
+ remove: async () => {
532
+ const i = this.pluginListeners.indexOf(entry);
533
+ if (i >= 0)
534
+ this.pluginListeners.splice(i, 1);
535
+ },
536
+ };
537
+ }
538
+ async removeAllListeners() {
539
+ this.pluginListeners = [];
540
+ }
541
+ notifyListeners(eventName, data) {
542
+ this.pluginListeners
543
+ .filter((l) => l.eventName === eventName)
544
+ .forEach((l) => {
545
+ l.callback(data);
546
+ });
547
+ }
548
+ }
549
+
550
+ var web = /*#__PURE__*/Object.freeze({
551
+ __proto__: null,
552
+ CameraWeb: CameraWeb
553
+ });
554
+
555
+ exports.Camera = Camera;
556
+
557
+ return exports;
558
+
559
+ })({}, capacitorExports);
560
+ //# sourceMappingURL=plugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.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":";;;IAEA,MAAM,OAAO,GAAG,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,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AAS;IACT,IAAI;IACJ,IAAI,MAAM,WAAW,CAAC,SAAS,EAAE,YAAY,EAAE;IAC/C,QAAQ,MAAM,KAAK,GAAG,EAAE,SAAS,EAAE,QAAQ,EAAE,YAAY,EAAE;IAC3D,QAAQ,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,KAAK,CAAC;IACxC,QAAQ,OAAO;IACf,YAAY,MAAM,EAAE,YAAY;IAChC,gBAAgB,MAAM,CAAC,GAAG,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,KAAK,CAAC;IAC7D,gBAAgB,IAAI,CAAC,IAAI,CAAC;IAC1B,oBAAoB,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC;IACrD,YAAY,CAAC;IACb,SAAS;IACT,IAAI;IACJ,IAAI,MAAM,kBAAkB,GAAG;IAC/B,QAAQ,IAAI,CAAC,eAAe,GAAG,EAAE;IACjC,IAAI;IACJ,IAAI,eAAe,CAAC,SAAS,EAAE,IAAI,EAAE;IACrC,QAAQ,IAAI,CAAC;IACb,aAAa,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,SAAS,KAAK,SAAS;IACpD,aAAa,OAAO,CAAC,CAAC,CAAC,KAAK;IAC5B,YAAY,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC;IAC5B,QAAQ,CAAC,CAAC;IACV,IAAI;IACJ;;;;;;;;;;;;;;;"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Camera Plugin for Electrobun
3
+ *
4
+ * Uses the web implementation (MediaDevices API) for parity on desktop.
5
+ */
6
+
7
+ import type { CameraPlugin } from "../../src/definitions";
8
+ import { CameraWeb } from "../../src/web";
9
+
10
+ export class CameraElectrobun extends CameraWeb implements CameraPlugin {}
11
+
12
+ // Export the plugin instance
13
+ export const Camera = new CameraElectrobun();