PHImageManager requestAVAssetForVideo returns nil assetUrl (iCloud)

171 Views Asked by At

After presenting the Library Picker, Trying to fetch selected video url some of the assets seems to be stored on iCloud and not locally. requestAVAssetForVideo not contains AVAsset. how to handle it?

  __block BOOL isPhotoInICloud = NO;

PHVideoRequestOptions * options = [[PHVideoRequestOptions alloc]init];
[options setNetworkAccessAllowed:YES];
[options setVersion:PHVideoRequestOptionsVersionCurrent];
[options setDeliveryMode:PHVideoRequestOptionsDeliveryModeHighQualityFormat];
options.progressHandler = ^(double progress, NSError *error, BOOL *stop, NSDictionary *info){
    NSLog(@"progress %f info %@",progress,info);
    isPhotoInICloud = YES;
};




[[PHImageManager defaultManager]requestAVAssetForVideo:phasset options:options resultHandler:^(AVAsset *avAsset, AVAudioMix *audioMix, NSDictionary *info) {


AVURLAsset * assetUrl = (AVURLAsset*)avAsset;
    if(!assetUrl){
        [self showNoVideoUrlFound:info phasset:phasset];
    }
    else{
        [self continueWithPhasset:phasset avAsset:avAsset info:info];
    }
}];
0

There are 0 best solutions below