Video 如何将存储在资源中的视频保存到camera roll?

Video 如何将存储在资源中的视频保存到camera roll?,video,camera,media-player,avfoundation,Video,Camera,Media Player,Avfoundation,我正在使用下面的代码播放一部电影,但我想知道,当用户按下按钮时,是否有办法将我在应用程序中保存的该电影文件保存到设备的摄像头上 NSString *moviePath = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"video.m­p4"]; MPMoviePlayerController *moviePlayer = [[MPMoviePlayerController alloc] initW

我正在使用下面的代码播放一部电影,但我想知道,当用户按下按钮时,是否有办法将我在应用程序中保存的该电影文件保存到设备的摄像头上

NSString *moviePath = [[[NSBundle mainBundle] resourcePath]
  stringByAppendingPathComponent:@"video.m­p4"];
MPMoviePlayerController *moviePlayer = [[MPMoviePlayerController alloc]
initWithContentURL:[NSURL fileURLWithPath:moviePath]];

moviePlayer.movieControlMode = MPMovieControlModeDefault;

[[NSNotificationCenter defaultCenter] addObserver:self 
selector:@selector(movieFinishedCallback­:) 
name:MPMoviePlayerPlaybackDidFinishNotif­ication object:moviePlayer]; 

[moviePlayer play];

很简单,看看这个问题的答案

您可以使用:
UISaveVideoAtPathToSavedPhotosAlbum