アプリの読み込み中にビデオを再生し、.ios アプリで次のページに移動する方法を知りたいですMPMoviePlayerController
。に動画を読み込んでい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];
}