Search code examples
mpmovieplayercontrollerfullscreenios6

MPMoviePlayerController doesn't play movie in full screen


I have a MPMoviePlayerController on my iPad app that works good when its frame is regular (not fullscreen).

When I tap the fullscreen button, the player goes fullscreen, but the movie stops. I perpetually see the title "Loading...", a black background, and the standard controls (back, play and next) disabled.

I declare an instance variable for the player:

MPMoviePlayerController *player;

In my implementation:

MPMoviePlayerController *player = [[MPMoviePlayerController alloc] initWithContentURL:videoUrl];

player.shouldAutoplay = NO;
player.movieSourceType = MPMovieSourceTypeFile;
player.controlStyle = MPMovieControlStyleEmbedded;
player.allowsAirPlay = YES;

player.view.frame = CGRectMake(xPos, yPos, width, height);

[self.view addSubview:player.view];

[player prepareToPlay];

Do you have any idea? I'm using iOS 6 SDK, and I'm testing the app on iPad 6.0 simulator and a real iPad2 with iOS 6 beta (latest).


Solution

  • OMG!!!

    I wrote...

    [player stop];
    

    in viewWillDisappear!!! How could I be so stupid?! No cake tonight...