I want to play video in my iPad app, using MPMoviePlayerController. My problem is, that player is only displaying "Loading" and do not play the video. Here is the code I use:
- (void)playMovieFile:(NSString *)fileName
{
NSString *filePath=[[NSBundle mainBundle] pathForResource:fileName ofType:@"mov"];
NSURL *fileUrl=[NSURL fileURLWithPath:filePath];
self.moviePlayer=[[MPMoviePlayerController alloc] initWithContentURL:fileUrl];
[self.moviePlayer.view setFrame:self.view.frame];
[self.view addSubview:self.moviePlayer.view];
[self.moviePlayer prepareToPlay];
[self.moviePlayer play];
}
I also try to use MPMoviePlayerViewController, but with sane success.Also, what movie types do MPMoviePlayerController plays? Can it be because of size of movie? It is 263 MB.