()
| 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()) { |
nothing calls this directly
no test coverage detected