MPMoviePlayerController在启动前显示空白屏幕?
问题描述:
我有一个MPMoviePlayerController,我以模态方式呈现。视频加载正常,但是在视频启动之前,屏幕变为白色,直到加载完毕。如何防止这种情况发生?
I have an MPMoviePlayerController that I am presenting modally. The video loads fine, however just before the video is launched the screen turns white until it has loaded. How can I prevent this from happening?
moviePlayerViewController = [[MPMoviePlayerViewController alloc] initWithContentURL:[NSURL URLWithString:mySTVideo.video_url]];
[self presentModalViewController:moviePlayerViewController animated:YES];
答
首先,你应该用它来显示电影:
First, you should be using this for display the movies:
[self presentMoviePlayerViewControllerAnimated:moviePlayerViewController];
其次,要更改moviePlayerViewController背景,您可以使用:
Second, to change the moviePlayerViewController background you can use:
moviePlayerViewController.view.backgroundColor = [UIColor blackColor];
因此,当视频启动时,背景颜色将为黑色。
So when the video is launched the background color will be black.
希望它的帮助......
Hope its helps...