Skip to content

Commit

Permalink
fix(imagepicker): await picked videos
Browse files Browse the repository at this point in the history
  • Loading branch information
triniwiz committed Aug 15, 2024
1 parent cacb75b commit 379e3f8
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/imagepicker/index.ios.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,11 @@ class ImagePickerControllerDelegate extends NSObject implements QBImagePickerCon
const manager = new PHImageManager();
const options = new PHVideoRequestOptions();
options.networkAccessAllowed = true;
manager.requestAVAssetForVideoOptionsResultHandler(phAssetImage, options, (urlAsset: AVURLAsset, audioMix, info) => {
fileMap[existingFileName].path = urlAsset.URL.toString().replace('file://', '');
await new Promise<void>((resolve) => {
manager.requestAVAssetForVideoOptionsResultHandler(phAssetImage, options, (urlAsset: AVURLAsset, audioMix, info) => {
fileMap[existingFileName].path = urlAsset.URL.toString().replace('file://', '');
resolve();
});
});
} else {
const imageOptions = new PHContentEditingInputRequestOptions();
Expand Down

0 comments on commit 379e3f8

Please sign in to comment.