0

is there a way to remove the fullscreen button from MPMoviePlayerController? Or at least deactivate it?

Yes I searched, but the older question isn't solved and I don't know if there is something like a "push" feature.

tshepang
  • 12,111
  • 21
  • 91
  • 136
Timm
  • 169
  • 1
  • 13
  • It wont be enough to disable the fullscreen button. A user can also enable fullscreen by pinching. So you would need to hide the fullscreen button AND disable the pinch gesture. All of that is doable but it would be against Apple's guidelines (hence has a chance of rejection) and it would be not very robust as you would have to traverse the view hierachy of the player interface and identify the control/gesture in question to disable them - as there is no documentation on those, you would have to identify them by class name, tag or index - very flaky! – Till May 29 '13 at 00:13
  • By iterating all MPMoviePlayerController subviews, then hide the full screen button http://stackoverflow.com/a/27482687/928599 – mohsinj Oct 15 '15 at 10:23

3 Answers3

3

Actually there is no way to achieve this.

You can use either:

[yourPlayer setMovieControlMode:MPMovieControlModeNone];

(But it'll hide all controls)

or

Disable the user interaction using:

yourPlayer.view.userInteractionEnabled = NO;

(But no controls can be used)

Midhun MP
  • 103,496
  • 31
  • 153
  • 200
2

Try this one it worked for me

- (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];
}
Agent Chocks.
  • 1,312
  • 8
  • 19
  • i also tried that, but after that i can't use the controls nor any other buttons anymore :( – Timm May 28 '13 at 08:09
  • so you need to disable only full screen right this will be possible only if you make your custom controls on player – Agent Chocks. May 28 '13 at 09:14
0

There is no way to do that. You can hide the entire control panel. Hopefully this link helps.

Community
  • 1
  • 1
Ratikanta Patra
  • 1,177
  • 7
  • 18