This one is baffling me. If anyone has any answers, they are appreciated.
I have the following method which plays a video during a loading process in my app:
-(void)playLoadingMovie
{
NSString *moviePath = [[NSBundle mainBundle] pathForResource:@"movie" ofType:@"mp4"];
movieController = [[MPMoviePlayerViewController alloc] initWithContentURL:[NSURL fileURLWithPath:moviePath]];
movieController.moviePlayer.repeatMode = MPMovieRepeatModeOne;
[movieController.moviePlayer setControlStyle:MPMovieControlStyleNone];
[movieController.view setFrame:CGRectMake(0, 0, self.view.frame.size.height, self.view.frame.size.width)];
[self.view addSubview:movieController.view];
NSLog(@"repeatMode: %d",movieController.moviePlayer.repeatMode);
}
Everything is properly declared, synthesized, released, etc... in the appropriate places and situations elsewhere in the code. This particular method works just fine, except for the fact that it does not repeat as it should.
You can see that the repeatMode is set to MPMovieRepeatModeOne, and when I run the code, the log statement prints out "repeatMode: 1" just as it should.
I know that I can do something hackish and set an observer for when the movie finishes and have it call a method to play the movie again, but I would much rather have this code work properly.
Any ideas?