I would like to know how to play a video while my app is loading, then navigate to next page in an ios app, using a MPMoviePlayerController
. I am loading the video in the viewDidLoad
. How can I to move to the next page after the video has finished?
Sample Code Here:
- (void)viewDidLoad
{
NSLog(@"Welcome to Home Page");
[super viewDidLoad];
self.parentViewController.view.backgroundColor=[UIColor colorWithPatternImage:[UIImage imageNamed:@"bg-image-new.png"]];
NSBundle * bundle =[NSBundle mainBundle];
NSString * moviepath = [bundle pathForResource:@"opening_ani" ofType:@"mp4"];
NSURL * movieurl = [[NSURL fileURLWithPath:moviepath]retain];
MPMoviePlayerController * themovie = [[MPMoviePlayerController alloc]initWithContentURL:movieurl];
themovie.view.frame=CGRectMake(0, 0, 1024, 768);
[self.view addSubview:themovie.view];
[themovie play];
[themovie setShouldAutoplay:NO];
}