It seems that I'm having a problem with repeatmodeone: it does not repeat the video.
This is the code for the video I have in the implementation:
- (void)viewDidLoad{
NSURL *url = [NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"Space Particle" ofType:@"mp4"]];
MPMoviePlayerViewController *playerController = [[MPMoviePlayerViewController alloc]initWithContentURL:url];
[self presentMoviePlayerViewControllerAnimated:playerController];
[playerController.moviePlayer prepareToPlay];
playerController.moviePlayer.movieSourceType = MPMovieSourceTypeFile;
playerController.moviePlayer.controlStyle = MPMovieControlStyleNone;
playerController.moviePlayer.scalingMode = MPMovieScalingModeAspectFill;
playerController.moviePlayer.repeatMode = MPMovieRepeatModeOne;
[MyView1 addSubview: playerController.view];
[playerController.moviePlayer play];
[playerController release];playerController=nil;
}
It works as an animated background with buttons above it. The video plays but when it finishes, it does not repeat.
I found out that, as an IbAction, it repeats, but as a viewDidLoad it doesn´t.
Note that the "MyView" outlet has been linked to a custom UIButton, and it´s in the button view where the movie plays.
The videos I'm using aren't large in size.
My objective is that the movie must repeat using the viewdidload method in order to auto play and repeat.
Please, is there anything I am doing wrong? Suggestions on how to solve it? Any help would be appreciated.