MPMoviePlayerController 在加载视频之前不显示控件
我有一个基于 iOS4 的应用程序,具有:
MPMoviePlayerController
和此设置:
moviePlayerController.movieSourceType = MPMovieSourceTypeStreaming;
moviePlayerController.controlStyle = MPMovieControlStyleDefault;
一切正常,除了当我呈现 MPMoviePlayerController 视图时,在视频预加载之前它不会显示控件。
我知道在以前版本的 iOS (3.x) 中,一旦出现 MPMoviePlayer 就会显示控件。有机会让它在 ios4 中工作吗?
I've an application based on iOS4, with a:
MPMoviePlayerController
and this settings:
moviePlayerController.movieSourceType = MPMovieSourceTypeStreaming;
moviePlayerController.controlStyle = MPMovieControlStyleDefault;
Everything is working good, except that, when I present the MPMoviePlayerController view, it doesn't display controls until the video is pre-loaded.
I know in previous version of iOS (3.x), controls are displayed as soon as MPMoviePlayer is presented. Any chance to have this working in ioS4?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您必须使用 MPMoviePlayerViewController 而不是 MPMoviePlayerController。
You have to use MPMoviePlayerViewController instead of MPMoviePlayerController.
我正在开发 iPad 视频播放器,并且遇到了同样的问题。但是,我认为这不是什么大问题,因为无论如何在视频加载之前您都无法控制视频。
您可以做的是通过设置背景视图来假装这些控件的存在。
这就是我所做的:
这只会使背景视图变黑,但您可以想象添加一个 UIImageView 作为显示禁用控件的背景视图,或者构建实际执行某些操作的真实控件。
I'm working on a video player for iPad and I'm experiencing the same behavior. However, I don't think it's much of a problem since you can't control the video until it's loaded anyway.
What you can do is fake the existence of those controls, by setting the background view.
Here's what I do:
That just makes the background view black, but you could imagine adding a UIImageView as background view that shows disabled controls, or build real controls that actually do something.