gpt4 book ai didi

ios - 将iCloud视频下载到临时目录

转载 作者:行者123 更新时间:2023-12-01 18:47:56 26 4
gpt4 key购买 nike

我想将PHAsset视频从iCloud下载到应用程序的临时目录。如果可能的话,该怎么做?

最佳答案

这段代码可以帮助您入门:

 PHImageManager* manager = [PHImageManager defaultManager];
PHVideoRequestOptions* requestOptions = [PHVideoRequestOptions new];
requestOptions.networkAccessAllowed = YES;
requestOptions.progressHandler = ^(double progress, NSError* error, BOOL* stop, NSDictionary* info) {
NSLog(@"cacheAsset: %f", progress);
};
[manager requestExportSessionForVideo:inAsset
options:requestOptions
exportPreset:AVAssetExportPresetPassthrough resultHandler:^(AVAssetExportSession* exportSession, NSDictionary* info) {
exportSession.outputURL = url;
exportSession.outputFileType = AVFileTypeQuickTimeMovie;
[exportSession exportAsynchronouslyWithCompletionHandler:^{
// Do something here with the result. Make sure to check the info dictionary for additional status.
}];
}];

关于ios - 将iCloud视频下载到临时目录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33411868/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com