ios从相册获取视频路径(包含网络)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
获取空 PHVideoRequestOptions *options = [[PHVideoRequestOptions alloc] init]; options.version = PHImageRequestOptionsVersionCurrent; options.deliveryMode = PHVideoRequestOptionsDeliveryModeAutomatic; options.networkAccessAllowed = true ; // iCloud的相册需要网络许可 [[PHImageManager defaultManager] requestAVAssetForVideo:asset options:options resultHandler:^(AVAsset * avasset, AVAudioMix * audioMix, NSDictionary * info) { dispatch_async(dispatch_get_main_queue(), ^{ AVURLAsset *urlAsset = (AVURLAsset *)avasset; VideoEditViewController *editVideo = [[VideoEditViewController alloc] init]; [editVideo setVideoPath:[urlAsset.URL absoluteString]]; [kAppDelegate pushViewController:editVideo]; }); }]; |
jiuchi
学习了