如何在全屏模式下关闭 MPMoviePlayerController 上的后退和下一步按钮?
我的 iPad 应用程序中有一个 MPMoviePlayerController。当有视频要观看时,用户点击它,然后可以全屏显示。但是,如果用户在全屏模式下按“NEXT”按钮,电影就会变成空白,并且无法再次播放视频!
无论如何,我不需要后退和下一步按钮。我如何摆脱它们,或者对其进行排序,以免它使我的应用程序崩溃?
谢谢!
:-乔
I have an MPMoviePlayerController in my iPad app. When there's a video to view, the user taps on it, then can go full screen. However, if the user presses the NEXT button in full screen mode, the movie goes blank and the video can't be played again!
I don't need the back and next buttons anyway. How do I get rid of them, or sort this so it doesn't crash my app?
Thanks!
:-Joe
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您可以尝试将其
controlStyle
设置为MPMovieControlStyleEmbedded
- 这将为您提供嵌入式样式的控件,这些控件只是一个滑动条、一个播放/暂停按钮和一个全屏切换。You could try setting its
controlStyle
toMPMovieControlStyleEmbedded
—that'll give you the embedded-style controls, which're just a scrubber bar, a play/pause button, and a fullscreen toggle.刚刚在 iOS 7 中遇到了这个问题。搜索按钮确实会触发
MPMoviePlaybackStateStopped
类型的MPMoviePlayerPlaybackStateDidChangeNotification
。因此,如果您想保留标准 UI 控件而不创建自定义控件,则可以侦听这种情况并进行适当处理。Just ran into this in iOS 7. The seek buttons do fire the
MPMoviePlayerPlaybackStateDidChangeNotification
of typeMPMoviePlaybackStateStopped
. So you can listen for this case and handle it appropriately if you want to keep the standard UI controls without creating custom ones.这是不好的办法...
只需 foreach 播放器视图的所有子视图并按索引关闭所需的按钮
This is bad way...
Just foreach all subviews of player view and turn off needed button by index