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];
}