MPMoviePlayerViewController - 如何拦截或更改完成按钮的功能

发布于 2024-11-05 21:12:57 字数 395 浏览 3 评论 0原文

我正在使用 MPMoviePlayerViewController。我有一个 UINavigationController,但我没有推送它,而是调用了presentModalViewController。这是因为我希望 MPMoviePlayerViewController 具有交叉溶解过渡(并且我可以将 modalTransitionStyle 设置为该过渡)。它显示正确,并淡入到位。然而,当它完成时,它会导致前一个视图滑动到位。这不是我想要的。我尝试将 modalTransitionStyle 和 modalPresentationStyle 设置为无效。

我还对 MPMoviePlayerViewController 进行了子类化,但无法弄清楚如何拦截其在播放完毕或按下“完成”按钮时自行消失的默认功能。也许如果我能做到的话,我就能解决上述问题。

I'm using an MPMoviePlayerViewController. I have a UINavigationController, but instead of pushing it I call presentModalViewController. This is because I want the MPMoviePlayerViewController to have a cross dissolve transition (and I can set the modalTransitionStyle to that). It appears correctly, and fades into place. However, when it finishes, it causes the previous view to slide up into place. This is not what I want. I've tried setting the modalTransitionStyle and modalPresentationStyle to no effect.

I've also subclassed the MPMoviePlayerViewController but couldn't figure out how to intercept its default functionality of dismissing itself when finished playing or when the Done button is pressed. Perhaps if I could do that I could fix the above problem.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

ㄟ。诗瑗 2024-11-12 21:12:57

我建议您挂钩 MPMoviePlayerDidFinishNotification 和 MPMoviePlayerWillExitFullScreenNotification 的通知处理程序。一旦播放完成/完成/停止,就会调用前者。一旦用户点击 MPMoviePlayerController 的全屏界面中的“完成”按钮,就会发送后者。

I would suggest you to hook in notification handlers for MPMoviePlayerDidFinishNotification and MPMoviePlayerWillExitFullScreenNotification. The former is invoked once the playback is finished / done / stopped. The latter is sent once the user taps on the DONE button from the MPMoviePlayerController's fullscreen interface.

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