Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

final thumbnailFile = await VideoCompress.getFileThumbnail(widget.filePath); on iOS, some file can't callback result. #272

Open
pursue942 opened this issue Sep 12, 2024 · 0 comments

Comments

@pursue942
Copy link

private func getFileThumbnail(_ path: String,_ quality: NSNumber,_ position: NSNumber,_ result: FlutterResult) {
let fileName = Utility.getFileName(path)
let url = Utility.getPathUrl("(Utility.basePath())/(fileName).jpg")
Utility.deleteFile(path)
if let bitmap = getBitMap(path,quality,position,result) {
guard (try? bitmap.write(to: url)) != nil else {
return result(FlutterError(code: channelName,message: "getFileThumbnail error",details: "getFileThumbnail error"))
}
result(Utility.excludeFileProtocol(url.absoluteString))
}
// I need to add code to fix it when bitmap is nil:
else{
result(FlutterError(code: channelName,message: "getFileThumbnail error",details: "getFileThumbnail error"))
}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant