当前MoviePlayerViewControllerAnimated 的 MPMoviePlayerViewController 问题
问题是,如果电影结束,将自动调用dismissMoviePlayerViewController。 这意味着 MoviePlayerViewController 消失,但我希望如果电影结束,他应该出现在屏幕上,并且只有“完成”按钮应该执行关闭...
这是我的代码:
- (void) buttonTapped:(id)sender {
NSURL *url = [[NSURL alloc] initFileURLWithPath:[[NSBundle mainBundle] pathForResource:@"dishes" ofType:@"mov"]];
MPMoviePlayerViewController *movViewController = [[MPMoviePlayerViewController alloc] initWithContentURL:url];
[url release];
if(movViewController) {
[movViewController.moviePlayer setShouldAutoplay:NO];
[self presentMoviePlayerViewControllerAnimated:movViewController];
}
}
甚至 [movViewController.moviePlayer setShouldAutoplay:NO];什么也不做。
谢谢您的回答 西尼兹
the problem is that if the movie has finished, the dismissMoviePlayerViewController is called automatically.
This means that the MoviePlayerViewController disappear, but I want he should be on screen if the movie has finished and only the 'Done' Button should do the dismiss...
here is my code:
- (void) buttonTapped:(id)sender {
NSURL *url = [[NSURL alloc] initFileURLWithPath:[[NSBundle mainBundle] pathForResource:@"dishes" ofType:@"mov"]];
MPMoviePlayerViewController *movViewController = [[MPMoviePlayerViewController alloc] initWithContentURL:url];
[url release];
if(movViewController) {
[movViewController.moviePlayer setShouldAutoplay:NO];
[self presentMoviePlayerViewControllerAnimated:movViewController];
}
}
Even the [movViewController.moviePlayer setShouldAutoplay:NO]; does nothing.
Thank you for answering
xnz
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为你对你所看到的和实际发生的事情感到困惑。电影播放时,控件(包括“完成”按钮)会隐藏。电影结束后,他们就隐藏起来。要取消隐藏它们,用户必须触摸显示屏的某处,控件就会显示出来 - VCR 控件以及“完成”按钮和进度滑块。
I think you are confused with what you are seeing versus what is actually happening. While the movie plays, the controls, including the Done button, are hidden. When the movie ends, they stay hidden. To un-hide them, the user has to touch the display somewhere, and the controls will reveal themselves - the VCR controls as well as the Done button and progress slider.