MPMoviePlayerController may exit full screen, but topbar is gone

I am broadcasting the movie on iPad using . MPMoviePlayerController

When the user rotates the device to landscape, I animate it to full screen .

If the user then issues “ exit full-screen mode ” or “done”, the film enlivens its small frame (its own behavior), BUT - there is no top panel (navigation panel) . In addition, visible views move up, behind, and outside the status bar.

Please note that I did not touch the top panel at all. I did not hide it manually.

I tried to restore the navigation bar by sending a setNavigationBarHidden:animatedviewcontroller to the current navigation controller, as well as a tabbarcontroller to the navigation controller. I put this in response to MPMoviePlayerDidExitFullscreenNotification(it works). There is no effect. However, if we return to the portrait, it will instantly return.

My questions:

  • Why doesn't the top bar come back when the user exits full screen?
  • How can we get the top bar back?

Regards, Timo

PS I will go on to experiment with the oddities described in this publication. May be related.

+3
source share
3 answers

( , ). :

// In the view did load for example :
[[NSNotificationCenter defaultCenter] addObserver:self
     selector:@selector(moviePlayerWillExitFullScreen:) 
    name:MPMoviePlayerWillExitFullscreenNotification 
    object:nil];

[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(moviePlayerDidEnterFullScreen:) name:MPMoviePlayerDidEnterFullscreenNotification object:nil];

// And in the ViewController put these methods :
- (void) moviePlayerWillExitFullScreen:(id)sender {
    [self.navigationController setNavigationBarHidden:NO animated:NO];
}

- (void)moviePlayerDidEnterFullScreen:(id)sender {
    [self.navigationController setNavigationBarHidden:YES animated:YES];
}

.

+2

​​Apple SDK (. post scriptum ), .

MPMoviePlayerDidExitFullscreenNotification, :

  • [setNavigationBarHidden:YES animated:NO] .
  • [setNavigationBarHidden:NO animated:YES] .

, , . , , , !

, animated:YES (re) ( ).

(animated:NO) 0 0,1 -performSelector:withObject:afterDelay:. , , .

Cheers,

P.S. SDK. , , TED iPad, . - : , , iPad , . , , .

+3

, [MPMoviePlayerControler setFullScreen], . , , Apple MPMoviePlayerController (Play, Pause, Done ..).         Apple . , , .         , .

, :

//set the mode of controls before playing movie or when view loads
-(void) playMovie:(UIButton *)btn {      
    mpmpController.controlStyle=MPMovieControlStyleEmbedded;
}


- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toIO
                                duration:(NSTimeInterval)duration {
     //this sets the controls to None
     mpmpController.controlStyle=MPMovieControlStyleNone;    
}

- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromIO {
    //reset the controlStyle
    mpmpController.controlStyle=MPMovieControlStyleEmbedded; 
}

. , .

+1

Source: https://habr.com/ru/post/1782355/


All Articles