MCPcopy Create free account
hub / github.com/Roy3838/Observer / startCapture

Method startCapture

app/src/utils/tauriStreamCapture.ts:1320–1345  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1318 }
1319
1320 async startCapture(): Promise<boolean> {
1321 if (!isTauri()) {
1322 throw new Error('Screen capture only available in Tauri');
1323 }
1324
1325 try {
1326 Logger.info("TAURI_STREAM", `Started Capturing tauri screen`);
1327
1328 // On desktop, show the selector first so user can pick what to capture
1329 if (isDesktop()) {
1330 Logger.info("TAURI_STREAM", `Popping up the screen capture window`);
1331 await this.showSelector();
1332 // The selector window will call startCaptureWithTarget when user picks
1333 // Return true to indicate the flow started (actual capture starts after selection)
1334 return true;
1335 }
1336
1337 // On mobile, start capture directly (uses system picker)
1338 const result = await invoke<boolean>('plugin:screen-capture|start_capture_cmd');
1339 this.capturing = result;
1340 Logger.info("TAURI_STREAM", `start_capture_cmd called`);
1341 return result;
1342 } catch (error) {
1343 throw error;
1344 }
1345 }
1346
1347 async stopCapture(): Promise<void> {
1348 if (!isTauri()) {

Callers

nothing calls this directly

Calls 4

showSelectorMethod · 0.95
isTauriFunction · 0.90
isDesktopFunction · 0.90
infoMethod · 0.80

Tested by

no test coverage detected