@elizaos/capacitor-screencapture 2.0.0-beta.1 → 2.0.3-beta.3
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/LICENSE +21 -0
- package/README.md +120 -0
- package/android/build.gradle +16 -2
- package/android/src/main/AndroidManifest.xml +9 -0
- package/android/src/main/java/ai/eliza/plugins/screencapture/ScreenCaptureFgService.kt +59 -0
- package/android/src/main/java/ai/eliza/plugins/screencapture/ScreenCapturePlugin.kt +149 -37
- package/dist/esm/web.d.ts.map +1 -1
- package/dist/esm/web.js +48 -9
- package/dist/esm/web.test.d.ts +2 -0
- package/dist/esm/web.test.d.ts.map +1 -0
- package/dist/esm/web.test.js +313 -0
- package/dist/plugin.cjs.js +48 -9
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +48 -9
- package/dist/plugin.js.map +1 -1
- package/package.json +13 -12
package/dist/plugin.js.map
CHANGED
|
@@ -1 +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.ScreenCaptureWeb());\nexport const ScreenCapture = registerPlugin(\"ScreenCapture\", {\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 hasDisplayMedia = () => !!navigator.mediaDevices.getDisplayMedia;\nconst getDisplayMedia = (opts) => navigator.mediaDevices.getDisplayMedia(opts);\nexport class ScreenCaptureWeb extends WebPlugin {\n constructor() {\n super(...arguments);\n this.mediaStream = null;\n this.mediaRecorder = null;\n this.recordedChunks = [];\n this.isRecording = false;\n this.isPaused = false;\n this.recordingStartTime = 0;\n this.pausedDuration = 0;\n this.pauseStartTime = 0;\n this.recordingStateInterval = null;\n this.pluginListeners = [];\n }\n async isSupported() {\n const supported = hasDisplayMedia();\n const features = [];\n if (supported)\n features.push(\"screenshot\", \"recording\");\n if (typeof MediaRecorder !== \"undefined\")\n features.push(\"video_encoding\");\n if (typeof AudioContext !== \"undefined\")\n features.push(\"system_audio\");\n return { supported, features };\n }\n async captureScreenshot(options) {\n const format = options?.format || \"png\";\n const quality = (options?.quality || 100) / 100;\n const scale = options?.scale || 1;\n // PERMISSIONS_MIGRATION: getDisplayMedia() triggers the OS screen\n // recording / picker dialog implicitly. New flow probes via\n // `screenRecordingProber` in\n // `packages/agent/src/services/permissions/probers/screen-recording.ts`\n // before opening the stream. Will be retired by the chat-surface\n // migration agent.\n const stream = await getDisplayMedia({\n video: { displaySurface: \"monitor\" },\n audio: false,\n });\n const track = stream.getVideoTracks()[0];\n const settings = track.getSettings();\n const width = (settings.width || 1920) * scale;\n const height = (settings.height || 1080) * scale;\n const imageCapture = new ImageCapture(track);\n const bitmap = await imageCapture.grabFrame();\n stream.getTracks().forEach((t) => {\n t.stop();\n });\n const canvas = document.createElement(\"canvas\");\n canvas.width = width;\n canvas.height = height;\n const ctx = canvas.getContext(\"2d\");\n if (!ctx) {\n throw new Error(\"Failed to get canvas context\");\n }\n ctx.drawImage(bitmap, 0, 0, width, height);\n bitmap.close();\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 return {\n base64,\n format,\n width,\n height,\n timestamp: Date.now(),\n };\n }\n async startRecording(options) {\n if (this.isRecording)\n throw new Error(\"Recording already in progress\");\n const videoConstraints = {\n displaySurface: \"monitor\",\n };\n if (options?.fps)\n videoConstraints.frameRate = { ideal: options.fps };\n this.mediaStream = await getDisplayMedia({\n video: videoConstraints,\n audio: options?.captureSystemAudio !== false,\n });\n if (options?.captureMicrophone) {\n const micStream = await navigator.mediaDevices.getUserMedia({\n audio: true,\n });\n micStream.getAudioTracks().forEach((t) => {\n this.mediaStream?.addTrack(t);\n });\n }\n const mimeType = getSupportedMimeType();\n if (!mimeType) {\n this.mediaStream.getTracks().forEach((t) => {\n t.stop();\n });\n throw new Error(\"No supported video mime type found\");\n }\n const recorderOptions = { mimeType };\n if (options?.bitrate)\n recorderOptions.videoBitsPerSecond = options.bitrate;\n this.recordedChunks = [];\n this.mediaRecorder = new MediaRecorder(this.mediaStream, 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.mediaStream.getVideoTracks()[0].addEventListener(\"ended\", () => {\n if (this.isRecording) {\n this.stopRecording().catch((err) => {\n console.error(\"[ScreenCapture] Auto-stop on track end failed:\", err);\n });\n }\n });\n this.recordingStartTime = Date.now();\n this.pausedDuration = 0;\n this.isRecording = true;\n this.isPaused = false;\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 || this.isPaused || autoStopping)\n return;\n const duration = (Date.now() - this.recordingStartTime - this.pausedDuration) / 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(\"[ScreenCapture] 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 - this.pausedDuration) / 1000;\n this.mediaRecorder.onstop = () => {\n if (this.recordingStateInterval) {\n clearInterval(this.recordingStateInterval);\n this.recordingStateInterval = null;\n }\n this.isRecording = false;\n this.isPaused = false;\n if (this.mediaStream) {\n this.mediaStream.getTracks().forEach((track) => {\n track.stop();\n });\n this.mediaStream = null;\n }\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 pauseRecording() {\n if (!this.isRecording || !this.mediaRecorder) {\n throw new Error(\"Not recording\");\n }\n if (this.isPaused) {\n return;\n }\n this.mediaRecorder.pause();\n this.isPaused = true;\n this.pauseStartTime = Date.now();\n const duration = (Date.now() - this.recordingStartTime - this.pausedDuration) / 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 }\n async resumeRecording() {\n if (!this.isRecording || !this.mediaRecorder) {\n throw new Error(\"Not recording\");\n }\n if (!this.isPaused) {\n return;\n }\n this.pausedDuration += Date.now() - this.pauseStartTime;\n this.mediaRecorder.resume();\n this.isPaused = false;\n }\n async getRecordingState() {\n const duration = this.isRecording\n ? (Date.now() - this.recordingStartTime - this.pausedDuration) / 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 /**\n * Check screen capture permissions.\n *\n * LIMITATION: The Screen Capture API (getDisplayMedia) does not support permission queries.\n * Unlike camera/microphone, there's no way to check if permission was previously granted.\n * Each call to getDisplayMedia always prompts the user.\n *\n * `screenCapture` will be:\n * - \"not_supported\": getDisplayMedia API not available\n * - \"prompt\": API available, but actual permission state is unknown (always requires prompt)\n */\n async checkPermissions() {\n let microphone = \"prompt\";\n try {\n const result = await navigator.permissions.query({\n name: \"microphone\",\n });\n microphone = result.state;\n }\n catch {\n // Permissions API may not support microphone query in this browser\n }\n // Screen capture permission cannot be queried - getDisplayMedia always prompts\n const screenCaptureStatus = hasDisplayMedia() ? \"prompt\" : \"not_supported\";\n return { screenCapture: screenCaptureStatus, microphone };\n }\n /**\n * Request screen capture permissions.\n *\n * LIMITATION: Screen capture (getDisplayMedia) cannot be pre-requested.\n * The user is prompted only when an actual capture is initiated.\n * This method only requests microphone permission for audio capture during recording.\n *\n * `screenCapture` will be:\n * - \"not_supported\": getDisplayMedia API not available\n * - \"prompt\": API available (permission prompt happens during actual capture)\n */\n async requestPermissions() {\n let microphone = \"denied\";\n try {\n const stream = await navigator.mediaDevices.getUserMedia({ audio: true });\n stream.getTracks().forEach((t) => {\n t.stop();\n });\n microphone = \"granted\";\n }\n catch {\n microphone = \"denied\";\n }\n // Cannot pre-request screen capture permission - it requires user gesture + actual capture\n const screenCaptureStatus = hasDisplayMedia() ? \"prompt\" : \"not_supported\";\n return { screenCapture: screenCaptureStatus, microphone };\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,CAAC,CAAC,gBAAgB,EAAE,CAAC;AAC/D,UAAC,aAAa,GAAGA,mBAAc,CAAC,eAAe,EAAE;IAC7D,IAAI,GAAG,EAAE,OAAO;IAChB,CAAC;;ICJD,MAAM,gBAAgB,GAAG;IACzB,IAAI,4BAA4B;IAChC,IAAI,4BAA4B;IAChC,IAAI,YAAY;IAChB,IAAI,WAAW;IACf,CAAC;IACD,MAAM,oBAAoB,GAAG,MAAM,gBAAgB,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,aAAa,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,IAAI,IAAI;IACzG,MAAM,eAAe,GAAG,MAAM,CAAC,CAAC,SAAS,CAAC,YAAY,CAAC,eAAe;IACtE,MAAM,eAAe,GAAG,CAAC,IAAI,KAAK,SAAS,CAAC,YAAY,CAAC,eAAe,CAAC,IAAI,CAAC;IACvE,MAAM,gBAAgB,SAASC,cAAS,CAAC;IAChD,IAAI,WAAW,GAAG;IAClB,QAAQ,KAAK,CAAC,GAAG,SAAS,CAAC;IAC3B,QAAQ,IAAI,CAAC,WAAW,GAAG,IAAI;IAC/B,QAAQ,IAAI,CAAC,aAAa,GAAG,IAAI;IACjC,QAAQ,IAAI,CAAC,cAAc,GAAG,EAAE;IAChC,QAAQ,IAAI,CAAC,WAAW,GAAG,KAAK;IAChC,QAAQ,IAAI,CAAC,QAAQ,GAAG,KAAK;IAC7B,QAAQ,IAAI,CAAC,kBAAkB,GAAG,CAAC;IACnC,QAAQ,IAAI,CAAC,cAAc,GAAG,CAAC;IAC/B,QAAQ,IAA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IAAI,CAAC;IAC5B,QAAQ,CAAC,CAAC;IACV,IAAI;IACJ;;;;;;;;;;;;;;;"}
|
|
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.ScreenCaptureWeb());\nexport const ScreenCapture = registerPlugin(\"ScreenCapture\", {\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 = () => typeof MediaRecorder === \"undefined\"\n ? null\n : (VIDEO_MIME_TYPES.find((m) => MediaRecorder.isTypeSupported(m)) ?? null);\nconst hasDisplayMedia = () => !!navigator.mediaDevices\n ?.getDisplayMedia;\nfunction assertPositiveFiniteNumber(value, label) {\n if (typeof value !== \"number\" || !Number.isFinite(value) || value <= 0) {\n throw new Error(`${label} must be a positive finite number`);\n }\n return value;\n}\nfunction assertQuality(value) {\n if (value === undefined)\n return 1;\n if (typeof value !== \"number\" || !Number.isFinite(value)) {\n throw new Error(\"quality must be a finite number between 0 and 100\");\n }\n if (value < 0 || value > 100) {\n throw new Error(\"quality must be between 0 and 100\");\n }\n return value / 100;\n}\nconst getDisplayMedia = (opts) => navigator.mediaDevices.getDisplayMedia(opts);\nexport class ScreenCaptureWeb extends WebPlugin {\n constructor() {\n super(...arguments);\n this.mediaStream = null;\n this.mediaRecorder = null;\n this.recordedChunks = [];\n this.isRecording = false;\n this.isPaused = false;\n this.recordingStartTime = 0;\n this.pausedDuration = 0;\n this.pauseStartTime = 0;\n this.recordingStateInterval = null;\n this.pluginListeners = [];\n }\n async isSupported() {\n const supported = hasDisplayMedia();\n const features = [];\n if (supported)\n features.push(\"screenshot\", \"recording\");\n if (typeof MediaRecorder !== \"undefined\")\n features.push(\"video_encoding\");\n if (typeof AudioContext !== \"undefined\")\n features.push(\"system_audio\");\n return { supported, features };\n }\n async captureScreenshot(options) {\n const format = options?.format || \"png\";\n const quality = assertQuality(options?.quality);\n const scale = options?.scale === undefined\n ? 1\n : assertPositiveFiniteNumber(options.scale, \"scale\");\n // PERMISSIONS_MIGRATION: getDisplayMedia() triggers the OS screen\n // recording / picker dialog implicitly. New flow probes via\n // `screenRecordingProber` in\n // `packages/agent/src/services/permissions/probers/screen-recording.ts`\n // before opening the stream. Will be retired by the chat-surface\n // migration agent.\n const stream = await getDisplayMedia({\n video: { displaySurface: \"monitor\" },\n audio: false,\n });\n const track = stream.getVideoTracks()[0];\n const settings = track.getSettings();\n const width = (settings.width || 1920) * scale;\n const height = (settings.height || 1080) * scale;\n let bitmap = null;\n try {\n const imageCapture = new ImageCapture(track);\n bitmap = await imageCapture.grabFrame();\n }\n finally {\n stream.getTracks().forEach((t) => {\n t.stop();\n });\n }\n const canvas = document.createElement(\"canvas\");\n canvas.width = width;\n canvas.height = height;\n const ctx = canvas.getContext(\"2d\");\n if (!ctx) {\n throw new Error(\"Failed to get canvas context\");\n }\n ctx.drawImage(bitmap, 0, 0, width, height);\n bitmap.close();\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 return {\n base64,\n format,\n width,\n height,\n timestamp: Date.now(),\n };\n }\n async startRecording(options) {\n if (this.isRecording)\n throw new Error(\"Recording already in progress\");\n if (options?.fps !== undefined) {\n assertPositiveFiniteNumber(options.fps, \"fps\");\n }\n if (options?.bitrate !== undefined) {\n assertPositiveFiniteNumber(options.bitrate, \"bitrate\");\n }\n if (options?.maxDuration !== undefined) {\n assertPositiveFiniteNumber(options.maxDuration, \"maxDuration\");\n }\n if (options?.maxFileSize !== undefined) {\n assertPositiveFiniteNumber(options.maxFileSize, \"maxFileSize\");\n }\n const videoConstraints = {\n displaySurface: \"monitor\",\n };\n if (options?.fps)\n videoConstraints.frameRate = { ideal: options.fps };\n this.mediaStream = await getDisplayMedia({\n video: videoConstraints,\n audio: options?.captureSystemAudio !== false,\n });\n if (options?.captureMicrophone) {\n const micStream = await navigator.mediaDevices.getUserMedia({\n audio: true,\n });\n micStream.getAudioTracks().forEach((t) => {\n this.mediaStream?.addTrack(t);\n });\n }\n const mimeType = getSupportedMimeType();\n if (!mimeType) {\n this.mediaStream.getTracks().forEach((t) => {\n t.stop();\n });\n throw new Error(\"No supported video mime type found\");\n }\n const recorderOptions = { mimeType };\n if (options?.bitrate)\n recorderOptions.videoBitsPerSecond = options.bitrate;\n this.recordedChunks = [];\n this.mediaRecorder = new MediaRecorder(this.mediaStream, 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.mediaStream.getVideoTracks()[0].addEventListener(\"ended\", () => {\n if (this.isRecording) {\n this.stopRecording().catch((err) => {\n console.error(\"[ScreenCapture] Auto-stop on track end failed:\", err);\n });\n }\n });\n this.recordingStartTime = Date.now();\n this.pausedDuration = 0;\n this.isRecording = true;\n this.isPaused = false;\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 || this.isPaused || autoStopping)\n return;\n const duration = (Date.now() - this.recordingStartTime - this.pausedDuration) / 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(\"[ScreenCapture] 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 - this.pausedDuration) / 1000;\n this.mediaRecorder.onstop = () => {\n if (this.recordingStateInterval) {\n clearInterval(this.recordingStateInterval);\n this.recordingStateInterval = null;\n }\n this.isRecording = false;\n this.isPaused = false;\n if (this.mediaStream) {\n this.mediaStream.getTracks().forEach((track) => {\n track.stop();\n });\n this.mediaStream = null;\n }\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 pauseRecording() {\n if (!this.isRecording || !this.mediaRecorder) {\n throw new Error(\"Not recording\");\n }\n if (this.isPaused) {\n return;\n }\n this.mediaRecorder.pause();\n this.isPaused = true;\n this.pauseStartTime = Date.now();\n const duration = (Date.now() - this.recordingStartTime - this.pausedDuration) / 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 }\n async resumeRecording() {\n if (!this.isRecording || !this.mediaRecorder) {\n throw new Error(\"Not recording\");\n }\n if (!this.isPaused) {\n return;\n }\n this.pausedDuration += Date.now() - this.pauseStartTime;\n this.mediaRecorder.resume();\n this.isPaused = false;\n }\n async getRecordingState() {\n const duration = this.isRecording\n ? (Date.now() - this.recordingStartTime - this.pausedDuration) / 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 /**\n * Check screen capture permissions.\n *\n * LIMITATION: The Screen Capture API (getDisplayMedia) does not support permission queries.\n * Unlike camera/microphone, there's no way to check if permission was previously granted.\n * Each call to getDisplayMedia always prompts the user.\n *\n * `screenCapture` will be:\n * - \"not_supported\": getDisplayMedia API not available\n * - \"prompt\": API available, but actual permission state is unknown (always requires prompt)\n */\n async checkPermissions() {\n let microphone = \"prompt\";\n try {\n const result = await navigator.permissions.query({\n name: \"microphone\",\n });\n microphone = result.state;\n }\n catch {\n // Permissions API may not support microphone query in this browser\n }\n // Screen capture permission cannot be queried - getDisplayMedia always prompts\n const screenCaptureStatus = hasDisplayMedia() ? \"prompt\" : \"not_supported\";\n return { screenCapture: screenCaptureStatus, microphone };\n }\n /**\n * Request screen capture permissions.\n *\n * LIMITATION: Screen capture (getDisplayMedia) cannot be pre-requested.\n * The user is prompted only when an actual capture is initiated.\n * This method only requests microphone permission for audio capture during recording.\n *\n * `screenCapture` will be:\n * - \"not_supported\": getDisplayMedia API not available\n * - \"prompt\": API available (permission prompt happens during actual capture)\n */\n async requestPermissions() {\n let microphone = \"denied\";\n try {\n const stream = await navigator.mediaDevices.getUserMedia({ audio: true });\n stream.getTracks().forEach((t) => {\n t.stop();\n });\n microphone = \"granted\";\n }\n catch {\n microphone = \"denied\";\n }\n // Cannot pre-request screen capture permission - it requires user gesture + actual capture\n const screenCaptureStatus = hasDisplayMedia() ? \"prompt\" : \"not_supported\";\n return { screenCapture: screenCaptureStatus, microphone };\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,CAAC,CAAC,gBAAgB,EAAE,CAAC;AAC/D,UAAC,aAAa,GAAGA,mBAAc,CAAC,eAAe,EAAE;IAC7D,IAAI,GAAG,EAAE,OAAO;IAChB,CAAC;;ICJD,MAAM,gBAAgB,GAAG;IACzB,IAAI,4BAA4B;IAChC,IAAI,4BAA4B;IAChC,IAAI,YAAY;IAChB,IAAI,WAAW;IACf,CAAC;IACD,MAAM,oBAAoB,GAAG,MAAM,OAAO,aAAa,KAAK;IAC5D,MAAM;IACN,OAAO,gBAAgB,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,aAAa,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC;IAC9E,MAAM,eAAe,GAAG,MAAM,CAAC,CAAC,SAAS,CAAC;IAC1C,MAAM,eAAe;IACrB,SAAS,0BAA0B,CAAC,KAAK,EAAE,KAAK,EAAE;IAClD,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,KAAK,IAAI,CAAC,EAAE;IAC5E,QAAQ,MAAM,IAAI,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,iCAAiC,CAAC,CAAC;IACpE,IAAI;IACJ,IAAI,OAAO,KAAK;IAChB;IACA,SAAS,aAAa,CAAC,KAAK,EAAE;IAC9B,IAAI,IAAI,KAAK,KAAK,SA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;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;;;;;;;;;;;;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elizaos/capacitor-screencapture",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.3-beta.3",
|
|
4
4
|
"description": "Captures screenshots and records the screen across web, mobile, and desktop.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"screen-capture",
|
|
@@ -14,6 +14,8 @@
|
|
|
14
14
|
"exports": {
|
|
15
15
|
".": {
|
|
16
16
|
"types": "./dist/esm/index.d.ts",
|
|
17
|
+
"bun": "./src/index.ts",
|
|
18
|
+
"development": "./src/index.ts",
|
|
17
19
|
"import": "./dist/esm/index.js",
|
|
18
20
|
"require": "./dist/plugin.cjs.js"
|
|
19
21
|
},
|
|
@@ -31,27 +33,25 @@
|
|
|
31
33
|
],
|
|
32
34
|
"author": "elizaOS",
|
|
33
35
|
"license": "MIT",
|
|
34
|
-
"dependencies": {
|
|
35
|
-
"@elizaos/app-core": "2.0.0-beta.1"
|
|
36
|
-
},
|
|
36
|
+
"dependencies": {},
|
|
37
37
|
"repository": {
|
|
38
38
|
"type": "git",
|
|
39
39
|
"url": "https://github.com/elizaOS/eliza"
|
|
40
40
|
},
|
|
41
41
|
"scripts": {
|
|
42
|
-
"build": "
|
|
43
|
-
"clean": "node
|
|
42
|
+
"build": "node ../../packages/scripts/with-package-build-lock.mjs plugins/plugin-native-screencapture -- bun run build:unlocked",
|
|
43
|
+
"clean": "node ../../packages/scripts/rm-path-recursive.mjs dist",
|
|
44
|
+
"test": "vitest run",
|
|
44
45
|
"prepublishOnly": "bun run build",
|
|
45
|
-
"watch": "tsc --watch"
|
|
46
|
+
"watch": "tsc --watch",
|
|
47
|
+
"build:unlocked": "bun run clean && tsc && bunx rollup -c rollup.config.mjs"
|
|
46
48
|
},
|
|
47
49
|
"devDependencies": {
|
|
48
|
-
"@capacitor/android": "^8.0.0",
|
|
49
50
|
"@capacitor/core": "^8.3.1",
|
|
50
|
-
"@capacitor/ios": "^8.0.0",
|
|
51
51
|
"@rollup/plugin-node-resolve": "^16.0.0",
|
|
52
|
-
"rimraf": "^6.0.0",
|
|
53
52
|
"rollup": "^4.60.2",
|
|
54
|
-
"typescript": "^6.0.3"
|
|
53
|
+
"typescript": "^6.0.3",
|
|
54
|
+
"vitest": "^4.0.0"
|
|
55
55
|
},
|
|
56
56
|
"peerDependencies": {
|
|
57
57
|
"@capacitor/core": "^8.3.1"
|
|
@@ -80,5 +80,6 @@
|
|
|
80
80
|
"ios": true,
|
|
81
81
|
"android": true
|
|
82
82
|
}
|
|
83
|
-
}
|
|
83
|
+
},
|
|
84
|
+
"gitHead": "f54b0f4eaed317d59fa7dbcdce20f4cdb0734420"
|
|
84
85
|
}
|