iPad MPMoviePlayer 出现问题
我正在开发一个 iPad 应用程序,它在使用 MPMediaPlayer
框架的视图中包含一些视频。
视频运行良好,但在 viewLoad 上加载视频时,视频区域闪烁。它会显示一瞬间黑色,然后开始播放。
我正在考虑在 viewDidLoad
上使用 NSTimer
来取消隐藏隐藏的视频视图,这可能会给它一秒钟的加载时间。还有其他想法吗?
I'm working on an iPad app, it has a few videos within views using the MPMediaPlayer
framework.
Videos are working nice but on viewLoad there is a flashing of the video area when it loads the video. It shows black for a split second then starts playing.
I was thinking of using an NSTimer
on viewDidLoad
to unhide the hidden video view, which might give it a second to load up. Any other ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
黑色闪光是由电影播放器在等待电影数据加载时进行绘制引起的。我最近也遇到了这个问题,并且没有太多选择,因为通知与闪烁并不真正匹配。我所做的最佳选择是将电影播放器的背景颜色与您的背景颜色相匹配。例如,如果您在白色上下文中显示:
The black flash is caused by the movie player drawing while it's waiting for movie data to load. I've also run into this recently and there aren't many options since the notifications don't really match up to the flashing. Best option I've done is to match the background color of the movie player to your background color. For example if you are displaying on a white context:
我的猜测是,您最好将所有 MPMoviePlayer 相关代码放在 ViewDidLoad 中。
另外一点:尝试给 MPMoviePlayerViewController 一个机会,它在 3.2 及更高版本中是可访问的,使用起来非常方便。
我希望我能提供帮助。
*萨姆
My guess is, that you preferably put all MPMoviePlayer related code in ViewDidLoad.
On another note: try giving a chance to MPMoviePlayerViewController which is accessibly in 3.2 and later, it's very handy to use.
I hope I could help.
*sam