1. 程式人生 > >PHAsset獲得視訊URL時,用requestAVAssetForVideo有時會得到AVComposition這個物件

PHAsset獲得視訊URL時,用requestAVAssetForVideo有時會得到AVComposition這個物件

PHImageManager *manager = [PHImageManager defaultManager];

[manager requestAVAssetForVideo:phAsset options:options resultHandler:^(AVAsset * _Nullable asset, AVAudioMix * _Nullable audioMix, NSDictionary * _Nullable info) {

AVURLAsset *urlAsset = (AVURLAsset *)asset;

NSURL *url = urlAsset.URL;

NSData *data = [NSData dataWithContentsOfURL:url];

}]