下载视频
[BFModule(TransitionModuleService) presentLoading];
dispatch_async(dispatch_get_global_queue(0, 0), ^{
NSURL *videoUrl = [NSURL URLWithString:video];
NSData *videoData = [NSData dataWithContentsOfURL:videoUrl options:NSDataReadingMapped error:nil];
NSString *documentPath = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES)[0];
NSString *tmpPath = [NSString stringWithFormat:@"%@/tempFile.mp4", documentPath];
dispatch_async_on_main_queue(^{
[videoData writeToFile:tmpPath atomically:YES];
[[PHPhotoLibrary sharedPhotoLibrary] performChanges:^{
[PHAssetChangeRequest creationRequestForAssetFromVideoAtFileURL:[NSURL URLWithString:tmpPath]];
} completionHandler:^(BOOL success, NSError * _Nullable error) {
dispatch_async_on_main_queue(^{
[BFModule(TransitionModuleService) dismissLoading];
if (success) {
[BFModule(LMAlertToastModuleService) showToastWithTitle:@"提示" message:@"保存成功"];
}
});
}];
});
});
本文地址
评论 · 1
frandon · 2023-03-31T19:15:55Z
Unrefined olive oils with more than 3 <a href=http://lasix.beauty>lasix diuretic side effects</a>
回复