MPMoviePlayerController fullscreen quirk in iPad -


I want to show an MPMoviePlayerController in a view controller and allow the user to toggle full screen with the default controls like YouTube app . I am using the following code in bare-bones example:

  - (zero) viewDidoadload {[Super Viewedload]; Self.player = [[MP3 MPV Player Controller] Init]; Self.player.contentURL = theURL; Self.player.view.frame = self.viewForMovie.bounds; Self.player.view.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; [Self.viewForMovie addSubview: player.view]; [Self. Play Player]; }  

It works fine until the user rotates the device and tap on the screen, without the full screen of the video. The status bar is shown in the wrong position, as shown in the screenshot below.

screenshot

I used the iPad tab for the Template tab bar application I am working with

What I'm doing wrong

Yes, I also experience this problem I am doing This certainly appears to be a bug in MPMoviePlayerController.

When I exit the fullscreen mode, to settle in my application, just fix the status bar:

  - (zero) playerDidxflashcreen: (NSNitification * ) Notification {MPVPlayer Controller * Movie Player = (MPMVPlayer Controller *) Notification.Object; If (movie player == self player) {UIApplication * app = [UIApplication shared application]; If (AppStatsbarOreation! = Self.interfaceOrientation) {[App Setstatsbar Orientation: Self Interface Oriented Animated: NO]; }}}  

This does not fix the problem in fullscreen mode, but it fixes later.

Note that the function must be added for notification:

  [[NSNetification Center default center] addObserver: Self selector: @selector (playerDidExitFullscreen :) name: MPMoviePlayerDidExitFullscreenNotification Object: zero];  

Comments