当前MoviePlayerViewControllerAnimated 的 MPMoviePlayerViewController 问题

发布于 2024-10-11 18:36:49 字数 699 浏览 3 评论 0原文

问题是,如果电影结束,将自动调用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.movi​​ePlayer 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

夕色琉璃 2024-10-18 18:36:49

我认为你对你所看到的和实际发生的事情感到困惑。电影播放时,控件(包括“完成”按钮)会隐藏。电影结束后,他们就隐藏起来。要取消隐藏它们,用户必须触摸显示屏的某处,控件就会显示出来 - 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文