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

Method startCapture

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

Source from the content-addressed store, hash-verified

1296 }
1297
1298 async startCapture(): Promise<boolean> {
1299 if (!isTauri()) {
1300 throw new Error('Screen capture only available in Tauri');
1301 }
1302
1303 try {
1304 Logger.info("TAURI_STREAM", `Started Capturing tauri screen`);
1305
1306 // On desktop, show the selector first so user can pick what to capture
1307 if (isDesktop()) {
1308 Logger.info("TAURI_STREAM", `Popping up the screen capture window`);
1309 await this.showSelector();
1310 // The selector window will call startCaptureWithTarget when user picks
1311 // Return true to indicate the flow started (actual capture starts after selection)
1312 return true;
1313 }
1314
1315 // On mobile, start capture directly (uses system picker)
1316 const result = await invoke<boolean>('plugin:screen-capture|start_capture_cmd');
1317 this.capturing = result;
1318 Logger.info("TAURI_STREAM", `start_capture_cmd called`);
1319 return result;
1320 } catch (error) {
1321 throw error;
1322 }
1323 }
1324
1325 async stopCapture(): Promise<void> {
1326 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