iPhone 如何阻止 MPMoviePlayerController 最后关闭?

发布于 2024-10-07 08:13:38 字数 256 浏览 3 评论 0原文

在我的 iPhone 应用程序中,我使用 MPMoviePlayerController 来播放电影。我隐藏了电影播放器​​上默认可见的所有控件。但我在播放器控件上放置了一个“重播”按钮。

电影结束时,玩家被移除。但我想停在最后一帧,这样当我单击“重播”按钮时,它将从头开始。我编写了重放功能并且运行良好。当电影正在播放并单击“重播”时,它会从头开始重新启动视频。

我面临的问题是,在电影结束时,它变成白屏,按“重播”按钮不会重新启动电影。遇到这种情况该如何处理呢?

In my iPhone app, I'm using MPMoviePlayerController to play a movie. I'm hiding all the controls that are by default visible on the movie player. But I placed a "Replay" button over the player control.

At the end of movie, the player is being removed. But I want to stop at the last frame, so that when I click "Replay" button, it will start from beginning. I wrote the functionality for replay and its working good. When ever the movie is playing and on click of "Replay", its restarting the video from starting.

The problem I'm facing is that, at the end of movie its becoming white screen and pressing "Replay" button is not restarting the movie. How to handle this situation?

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

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

发布评论

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

评论(2

过期情话 2024-10-14 08:13:38

不需要创建新实例。我找到了解决办法。不要只是释放玩家的实例。单击重播按钮时(无论是在视频中间还是在完成后),只需暂停它,将位置移动到开头并播放即可。就是这样......没有保留,没有释放任何东西......这取决于程序员/开发人员何时释放播放器并将其从视图中删除。

Its not necessary to create new instance. I found out the solution. Don't just release the instance of player. When replay button is clicked (either in middle of video or after completion), just pause it, move the location to beginning and play it. That's it.. no retain, no release nothing.... Its upto the programmer/developer when to release the player and remove it from the view.

十级心震 2024-10-14 08:13:38

我从未使用过 MPMoviePlayerController 但也许它的实例在电影结束时被释放。在这种情况下,增加保留计数器并手动释放它可以解决问题。

I never used MPMoviePlayerController but pherhaps it's instance is released when the movie has ended. In this case incrementing the retaincounter and manually releasing it would solve the problem.

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