jonataslaw / jonataslaw/VideoCompress

cancelCompression doesn't work on iOS (v2.1.1)

Open
#81 2 comments 1 reaction 0 assignees View on GitHub
Dominant language
Swift
Stars
262
Forks
344
PR merge metrics
No merged PRs in 30d

Description

I made a small demo of the issue (see below). Issue is related to iOS platform

If you don't cancel the process everything seems to be working just fine.

![ezgif-5-b0d4fe3c1797](https://user-images.githubusercontent.com/1456389/102590843-ca5ccf80-4119-11eb-8168-92c9933a5d88.gif)

But if you stop the process (using `VideoCompress.cancelCompression` method) and immediately try to start compression again (same video or another, doesn't matter) you will get error:

```
flutter: Bad state: VideoCompress Error:
Method: compressVideo
Already have a compression process, you need to wait for the process to finish or stop it
```

![ezgif-5-228fe397d84c](https://user-images.githubusercontent.com/1456389/102590821-c3ce5800-4119-11eb-8e20-77da70cad729.gif)

At the same time if you stop the process (`VideoCompress.cancelCompression `) and wait enough for video compression to complete you will see that starting new compression works as expected.

Source code: [video_compress_bug.zip](https://github.com/jonataslaw/VideoCompress/files/5714540/video_compress_bug.zip)

Everything related to this bug happens in `viewer.dart` file

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.