2
在我的应用程序中,最终用户可以推送一个UIButton,它使用MPMoviePlayerController将一个视图控制器推入框架中播放视频。在电影播放结束时切换视图控制器?
我希望能够检测视频何时到达结束时间,以及何时发生这种情况,请推送新的视图控制器。虽然我似乎无法找到可以做到这一点的代码。
有谁知道如何做到这一点?
的视频播放代码看起来就像这样:
//video stuff
CGRect myVideoRect = CGRectMake(0.0f, 145.0f, 320.0f, 160.0f);
movieUrl = [[NSBundle mainBundle] URLForResource:@"myMovie" withExtension:@"m4v"];
moviePlayerController = [[MPMoviePlayerController alloc] initWithContentURL:movieUrl];
[[moviePlayerController view] setFrame:myVideoRect];
moviePlayerController.controlStyle = MPMovieControlStyleNone;
[self.view addSubview:moviePlayerController.view];
[moviePlayerController play];
谢谢!