Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Just realised the question was iPad-specific. My code was for the iPhone, but some of it may help you anyway.</p> <p>I had to do this a couple days ago, I think your issue is simply not calling hide on the status bar after the video starts playing. Either way I have the tried and tested code here which works from 3.0 to 4.2:</p> <pre><code>- (IBAction) playIntroVideo { NSString *videoString = [[NSBundle mainBundle] pathForResource:@"intro" ofType:@"mp4"]; NSURL *videoURL = [NSURL fileURLWithPath:videoString]; _player = [[MPMoviePlayerController alloc] initWithContentURL:videoURL]; if ( [_player respondsToSelector:@selector(view)] &amp;&amp; [_player respondsToSelector:@selector(setFullscreen:animated:)] &amp;&amp; [_player respondsToSelector:@selector(setControlStyle:)] ) { [[_player view] setFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT_FULL)]; [_player setFullscreen:YES animated:YES]; [_player setControlStyle:MPMovieControlStyleNone]; [self.view addSubview:[_player view]]; } [_player play]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(terminateVideo) name:MPMoviePlayerPlaybackDidFinishNotification object:nil]; [[UIApplication sharedApplication] setStatusBarHidden:YES]; self.navigationController.navigationBarHidden = YES; } - (void) terminateVideo { [[UIApplication sharedApplication] setStatusBarHidden:NO]; self.navigationController.navigationBarHidden = NO; if ([_player respondsToSelector:@selector(view)]) { [[_player view] removeFromSuperview]; } _player = nil; [_player release]; } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload