我已经子类化了MPMoviePlayerViewController
,并且方法[parentViewController dismissMoviePlayerViewControllerAnimated]
不会动画化它。播放器就消失了。即使没有手动关闭它,只需按下“完成”按钮 - 播放器在没有动画的情况下消失。在子类播放器中,我将按钮添加到播放器视图中,就是这样。问题可能出在哪里?这是我的播放器的一些初始化代码。
MyMovieViewController *playerView = [[[MyMovieViewController alloc] initWithContentURL:url] autorelease];
[playerView setSelectedVideo:video];
[playerView.moviePlayer setAllowsAirPlay:YES];
[playerView.moviePlayer setShouldAutoplay:YES];
[[MenuController sharedInstance].menuView setHidden:YES];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(playBackChanged:) name:MPMoviePlayerPlaybackStateDidChangeNotification object:playerView.moviePlayer];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(loadStateChanged:) name:MPMoviePlayerLoadStateDidChangeNotification object:playerView.moviePlayer];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(playBackChanged:) name:MPMoviePlayerPlaybackDidFinishNotification object:playerView.moviePlayer];
[self presentMoviePlayerViewControllerAnimated:playerView];