[英]MPMoviePlayerViewController not appearing
我正在尝试为“标题/启动画面”加载小电影。 但是,当我调用presentMoviePlayerViewControllerAnimated
没有任何反应。 我已经确认正在执行该代码块,但是用户看不到任何东西。
我的目标是iPad,因此假定为3.2。
任何帮助,将不胜感激。
- (void)viewDidLoad {
[super viewDidLoad];
NSString *path = [[NSBundle mainBundle] pathForResource:@"Intro" ofType:@"m4v" inDirectory:nil];
NSURL *fileURL = [NSURL fileURLWithPath:path];
MPMoviePlayerViewController *playerView = [[MPMoviePlayerViewController alloc] initWithContentURL:fileURL];
[[NSNotificationCenter defaultCenter] addObserver:self selector: @selector(playbackDidFinish:) name:MPMoviePlayerPlaybackDidFinishNotification object:playerView.moviePlayer];
[self presentMoviePlayerViewControllerAnimated:playerView];
[playerView release];
}
- (void)playbackDidFinish:(NSNotification*)aNotification {
MPMoviePlayerController *player = [aNotification object];
[[NSNotificationCenter defaultCenter] removeObserver:self
name:MPMoviePlayerPlaybackDidFinishNotification
object:player];
[player stop];
[self dismissMoviePlayerViewControllerAnimated];
}
您应该放置一行[playerView版本]; 在此行之后[self dismissMoviePlayerViewControllerAnimated];
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.