* Stop only video capture. * Works on both desktop and iOS.
()
| 1344 | * Works on both desktop and iOS. |
| 1345 | */ |
| 1346 | async stopVideo(): Promise<void> { |
| 1347 | if (!isTauri()) { |
| 1348 | throw new Error('Screen capture only available in Tauri'); |
| 1349 | } |
| 1350 | |
| 1351 | try { |
| 1352 | if (isDesktop()) { |
| 1353 | await invoke('sc_stop_video'); |
| 1354 | } else { |
| 1355 | // iOS: Stop capture stream and broadcast |
| 1356 | await invoke('stop_capture_stream_cmd'); |
| 1357 | await invoke('plugin:screen-capture|stop_capture_cmd'); |
| 1358 | } |
| 1359 | this.capturing = false; |
| 1360 | this.latestFrameBytes = null; |
| 1361 | this.latestBase64Frame = null; |
| 1362 | } catch (error) { |
| 1363 | throw error; |
| 1364 | } |
| 1365 | } |
| 1366 | |
| 1367 | /** |
| 1368 | * Stop only audio capture. |