-
Notifications
You must be signed in to change notification settings - Fork 321
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
[BUG] Pick a video at very first time. AssetEntity file getter return a file instance but the file size keep changing #452
Comments
The files may downloading from the iCloud |
After test file getter and getMediaUrl() in AssetEntity, they return different file path.
It seems getMediaUrl() return the file located in Gallery, but file getter return the file located in App temporary directory. |
Path is a simulated concept on all platforms, since they don't actually provide a real path that can be access directly. |
After some research, I found fetchFullSizeVideo in PMManager.m will call itself in the progress handler when progress is 1.0. Then it will trigger ExportSession multiple times. After ExportSession create the local file, fetchFullSizeVideo can found the file in local storage and return the file path. But in the in the meantime, ExportSession haven't done the process. Therefore the file size keep changing. The other problem. After requestAVAssetForVideo for iCloud file. It will trigger ExportSession immediately. But some times the processing fail. I found some guys are discussing about this in other GitHub repo (banchichen/TZImagePickerController#1073). Now I use requestExportSessionForVideo instead of requestAVAssetForVideo to solve this problem. I will create a PR, please help me to review it. |
AssetEntity file getter return a file but the size keep changing.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
AssetEntity file getter should return a file after any changes.
Flutter version
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 1.22.6, on macOS 11.2.3 20D91 darwin-x64, locale
zh-Hant-TW)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
[✓] Xcode - develop for iOS and macOS (Xcode 12.4)
[✓] Android Studio (version 4.1)
[✓] VS Code (version 1.54.2)
[✓] Connected device (1 available)
! Error: Chao-Ting’s iPhone is busy: Copying cache files from device. Xcode
will continue when Chao-Ting’s iPhone is finished. (code -10)
• No issues found!
Smartphone (please complete the following information):
The text was updated successfully, but these errors were encountered: