MPMoviePlayerController not showing controls until video is loaded

爷,独闯天下 提交于 2019-12-07 15:07:13

问题


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?


回答1:


You have to use MPMoviePlayerViewController instead of MPMoviePlayerController.




回答2:


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.



来源:https://stackoverflow.com/questions/6413296/mpmovieplayercontroller-not-showing-controls-until-video-is-loaded

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!