|
Hi! I currently need to handle cases in which the user cancels the media processing, but I couldn't find anything obvious in the API reference for that, so I wonder if anyone could help. Update: I just found out that video renders can be cancelled, so now I'm wondering is images can be cancelled too. |
Replies: 1 comment 1 reply
|
Hi! unlike video renders, the image processing doesn't have a cancel API. Once the export starts, there's no built-in way to abort it. The reason is that image export is designed to be fast rather than cancellable: the editor pre-captures screenshots in the background (isolates on native, web workers on web) on every change, so when you tap "Done" the final bytes are usually already ready or produced within milliseconds. Video rendering is a separate, longer-running native operation, which is why it exposes cancellation. If you need cancel-like behavior for images, handle it at the app level: the processing is bracketed by onImageEditingStarted and onImageEditingComplete / onCompleteWithParameters. If the user cancels while the loading dialog is up, just set a flag and discard the result when the completion callback fires. In practice, since generation is near-instant, most apps simply let it finish. If you have a use case where image export is slow enough to genuinely need interruption (e.g. very large images), feel free to open a feature request 🙂 |
Hi! unlike video renders, the image processing doesn't have a cancel API. Once the export starts, there's no built-in way to abort it.
The reason is that image export is designed to be fast rather than cancellable: the editor pre-captures screenshots in the background (isolates on native, web workers on web) on every change, so when you tap "Done" the final bytes are usually already ready or produced within milliseconds. Video rendering is a separate, longer-running native operation, which is why it exposes cancellation.
If you need cancel-like behavior for images, handle it at the app level: the processing is bracketed by onImageEditingStarted and onImageEditingComplete / onCompleteWithP…