Search code examples
iosobjective-ccocoa-touchmpmovieplayercontrollermpmovieplayer

MPMoviePlayerController shows blank white screen before launch?


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];

Solution

  • First, you should be using this for display the movies:

    [self presentMoviePlayerViewControllerAnimated: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...