MPMoviePlayerController を使用していますが、2 回しか繰り返されないという問題が発生していますが、その方法を継続的に繰り返す必要があるため、より良い方法を提案してください。
-(void)viewDidLoad
{
player = [[MPMoviePlayerController alloc] initWithContentURL:outPutUrl];
player.view.frame = CGRectMake(0, 0, 320, 480);
player.repeatMode = MPMovieRepeatModeOne;
[player setShouldAutoplay:YES];
[player prepareToPlay];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(moviePlayerDidFinish:)
name:MPMoviePlayerPlaybackDidFinishNotification
object:player];
[player setControlStyle:MPMovieControlStyleNone];
[self.imgView addSubview:player.view];
[player play];
}
-(void)moviePlayerDidFinish:(NSNotification *)note
{
if (note.object == player)
{
NSLog(@"this is note%@",note.object);
NSInteger reason = [[note.userInfo objectForKey:MPMoviePlayerPlaybackDidFinishReasonUserInfoKey] integerValue];
if (reason == MPMovieFinishReasonPlaybackEnded)
{
[player play];
}
}
}