iPad MPMoviePlayer 出现问题

发布于 2024-09-10 23:04:06 字数 240 浏览 2 评论 0原文

我正在开发一个 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 技术交流群。

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

发布评论

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

评论(2

囍孤女 2024-09-17 23:04:06

黑色闪光是由电影播放器​​在等待电影数据加载时进行绘制引起的。我最近也遇到了这个问题,并且没有太多选择,因为通知与闪烁并不真正匹配。我所做的最佳选择是将电影播放器​​的背景颜色与您的背景颜色相匹配。例如,如果您在白色上下文中显示:

MPMoviePlayerController * player;
player.backgroundView.backgroundColor = [UIColor whiteColor];

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:

MPMoviePlayerController * player;
player.backgroundView.backgroundColor = [UIColor whiteColor];
梦冥 2024-09-17 23:04:06

我的猜测是,您最好将所有 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

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