Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iPad MPMoviePlayerController - Disable Fullscreen

Is there a way to disable the fullscreen button of the MPMoviePlayerController ?

like image 805
MathieuF Avatar asked Sep 06 '10 09:09

MathieuF


3 Answers

Just did it:

- (void)viewDidLoad {
    [super viewDidLoad];

    [[NSNotificationCenter defaultCenter] addObserver:self 
                                             selector:@selector(movieEventFullscreenHandler:) 
                                                 name:MPMoviePlayerWillEnterFullscreenNotification 
                                               object:nil];

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

    self.moviePlayer.controlStyle = MPMovieControlStyleEmbedded;
}

- (void)movieEventFullscreenHandler:(NSNotification*)notification {
    [self.moviePlayer setFullscreen:NO animated:NO];
    [self.moviePlayer setControlStyle:MPMovieControlStyleEmbedded];
}
like image 170
borisdiakur Avatar answered Nov 15 '22 20:11

borisdiakur


Depending on your needs, you can also simply disable all user interactions on the player view.

player.view.userInteractionEnabled = NO;
like image 37
Phil Avatar answered Nov 15 '22 20:11

Phil


You can set controlStyle to Fullscreen. these controls are somewhat different, but it doesn't feature a Fullscreen button!

[_moviePlayerController setControlStyle:MPMovieControlStyleFullscreen];
like image 40
dOM Avatar answered Nov 15 '22 20:11

dOM