保存視頻:
1在工程中添加這個框架:
#import <AssetsLibrary/AssetsLibrary.h>
2
NSBundle *bundle=[NSBundle mainBundle]; NSString *videoPath=[bundle pathForResource:@"test" ofType:@"mp4"];//是本地的路徑就好 videoPath是你視頻文件的路徑,我這里是加載工程中的 ALAssetsLibrary *library = [[ALAssetsLibrary alloc] init]; [library writeVideoAtPathToSavedPhotosAlbum:[NSURL fileURLWithPath:videoPath] completionBlock:^(NSURL *assetURL, NSError *error) { if (error) { NSLog(@"Save video fail:%@",error); } else { NSLog(@"Save video succeed."); } }];
參考文獻:http://blog.csdn.net/kaven_lv/article/details/11483239