我使用以下代码将视频保存到我的相册:
ALAssetsLibrary *assetLibrary = [[ALAssetsLibrary alloc] init];
[assetLibrary writeVideoAtPathToSavedPhotosAlbum:[NSURL URLWithString:videoPath] completionBlock:^(NSURL *assetURL, NSError *error)
{
NSError *removeError = nil;
[[NSFileManager defaultManager] removeItemAtURL:[NSURL URLWithString:videoPath] error:&removeError];
});
视频进入该文件夹的视频,但我想它去到一个特定的文件夹与应用程序的名称。我怎样才能做到这一点?
像这样
ALAssetsLibrary* assetLibrary = [[ALAssetsLibrary alloc] init];
[assetLibrary writeVideoAtPathToSavedPhotosAlbum:[NSURL URLWithString:@""] completionBlock:^(NSURL *assetURL, NSError *error) {
[assetLibrary addAssetURL:[NSURL URLWithString:@""] toAlbum:@"" completion:^(NSURL *assetURL, NSError *error) {
NSError* removeError = nil;
[[NSFileManager defaultManager] removeItemAtURL:[NSURL URLWithString:@""] error:&removeError];
} failure:^(NSError *error) {
NSLog(@"%@", error);
}];
}];
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句