开发者

Display MPMoviePlayerController during media loading

I use a MPMoviePlayerController to play audio (ex: http://www.stanford.edu/group/edcorner/uploads/podcast/ballmer090506.mp3) or video (ex: http://video.ted.com/talk/podcast/2011U/None/RicElias_2011U.mp4)

myMoviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:theURL];
myMoviePlayer.view.frame = CGRectMake(-80, 80, 480, 320);
myMoviePlayer.controlStyle = MPMovieControlStyleFullscreen;
myMoviePlayer.movieSourceType = MPMovieSourceTypeFile;
myMoviePlayer.scalingMode = MPMovi开发者_JAVA百科eScalingModeAspectFit;
myMoviePlayer.useApplicationAudioSession = TRUE;
[myMoviePlayer prepareToPlay];
[myMoviePlayer play];

It works well, my only one problem is during the loading time (between 5s and 20s if I have a bad 3G reception), I have a black screen.

I would like to have MPMoviePlayerController diplayed with the "Loading..." label and the UIActiviyIndicator in his top bar during this time, like YouTube videos.

How can I do that?

Thanks.


Just use MPMoviePlayerViewController instead of MPMoviePlayerController. It should do what you want.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜