我在应用程序加载而不是图像时开发启动视频。并且还使用 ios 中的推送视图控制器导航到下一页。但我不知道这是否是正确的代码。但我使用这个一些问题发生在第三页但它没有被使用我的应用程序加载正常。我的示例代码在这里。
- (void)viewDidLoad
{
[super viewDidLoad];
[self videopage];
// Do any additional setup after loading the view, typically from a nib.
}
-(void)videopage
{
NSURL * url=[NSURL URLWithString:@"http://xyz.opening_ani.mp4"];
MPMoviePlayerController * videos =[[MPMoviePlayerController alloc]initWithContentURL:url];
videos.view.frame=CGRectMake(0, 0, 1024, 768);
videos.controlStyle=MPMovieControlStyleNone;
[self.view addSubview:videos.view];
[videos play];
[[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(startParsing) name:MPMoviePlayerPlaybackDidFinishNotification object:nil];
//[self startParsing];
}
-(void)startParsing
{
ViewController * navigation=[[[ViewController alloc]initWithNibName:@"ViewController" bundle:nil]autorelease];
[self.navigationController pushViewController:navigation animated:NO];
}