Skip to content

Commit

Permalink
fix: add exception on cancel video compression
Browse files Browse the repository at this point in the history
  • Loading branch information
numandev1 committed Dec 23, 2021
1 parent b4ed805 commit 36e3607
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
Expand Up @@ -44,7 +44,7 @@ public void onFinish(boolean result) {

@Override
public void onError(String errorMessage) {
promise.resolve(srcPath);
promise.reject("Compression has canncelled");
}

@Override
Expand Down
13 changes: 5 additions & 8 deletions ios/Video/VideoCompressor.swift
Expand Up @@ -382,20 +382,17 @@ func makeValidUri(filePath: String) -> String {

}, completionHandler: { result in
self.videoCompressionCounter=0;
switch result {
case .success(let status):
switch status {
switch exporter.status {
case .completed:
onCompletion(exporter.outputURL!)
break
case .cancelled:
let error = CompressionError(message: "Compression has canncelled")
onFailure(error)
break
default:
onCompletion(url)
break
}
break
case .failure(let error):
onCompletion(url)
break
}
})
}
Expand Down

0 comments on commit 36e3607

Please sign in to comment.