0

以下のコードを使用してムービーを再生していますが、ユーザーがボタンを押したときに、アプリに保存したこのムービー ファイルをデバイスのカメラ ロールに保存する方法があるかどうか疑問に思っていました。

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];
4

1 に答える 1

0

非常に簡単です。答えについては、この他の質問をチェックしてください。

アプリ内動画をカメラロールに保存しますか?

以下を使用します。UISaveVideoAtPathToSavedPhotosAlbum

于 2013-03-03T17:11:30.577 に答える