开发者

MPMoviePlayerController not showing controls until video is loaded

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 开发者_如何学JAVApresent 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?


You have to use MPMoviePlayerViewController instead of MPMoviePlayerController.


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:

moviePlayerController.backgroundView.backgroundColor = [UIColor blackColor];

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜