Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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).

like image 568
Tony Mobile Avatar asked Sep 19 '12 15:09

Tony Mobile


1 Answers

OMG!!!

I wrote...

[player stop];

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

like image 59
Tony Mobile Avatar answered Oct 22 '22 00:10

Tony Mobile