0
我想知道如何在加载应用程序时播放视频,然后使用MPMoviePlayerController
导航到ios应用程序中的下一页。我正在加载视频viewDidLoad
。视频完成后,如何才能移至下一页?如何在应用程序启动期间播放视频
示例代码这里:
- (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];
}