I'm changing over from ALAssetsLibrary to PHPhotoLibrary and want to know whether or not video file can save or not. In ALAssetsLibray, you know, we could know it before start saving video file with the API
- (BOOL)videoAtPathIsCompatibleWithSavedPhotosAlbum:(NSURL *)videoPathURL;
Does anyone knows the substitute API for videoAtPathIsCompatibleWIthSavedPhotoAlbum in PHPhotoLibrary ?
Or do you know the exact error code which means that a video file cannot save on the iOS device ?
My code for saving video file is like below,
- (void)saveVideoFile:(NSURL *)videoURL completion:(savePhotoFileCompletion)completion
{
[[PHPhotoLibrary sharedPhotoLibrary] performChanges:^{
PHAssetChangeRequest *assetChangeRequest;
assetChangeRequest = [PHAssetChangeRequest creationRequestForAssetFromVideoAtFileURL:videoURL];
PHAssetCollectionChangeRequest *assetCollectionChangeRequest =
[PHAssetCollectionChangeRequest changeRequestForAssetCollection:self.assetCollection];
[assetCollectionChangeRequest addAssets:@[ [assetChangeRequest placeholderForCreatedAsset] ]];
}
completionHandler:^(BOOL success, NSError *_Nullable error) {
DBGLog(@"success=%@, error=%@", (success ? @"YES" : @"NO"), error);
completion(success, error);
}];
}
I found the question talking about the same issue.
How to use PHPhotoLibrary like ALAssetsLibrary
But it doesn't refer to the exact answer.