jowie
jowie

Reputation: 8068

How do I turn off the back and next buttons on MPMoviePlayerController in full-screen mode?

I have an MPMoviePlayerController in my iPad app. When there's a video to view, the user taps on it, then can go full screen. However, if the user presses the NEXT button in full screen mode, the movie goes blank and the video can't be played again!

I don't need the back and next buttons anyway. How do I get rid of them, or sort this so it doesn't crash my app?

Thanks!

:-Joe

Upvotes: 1

Views: 2795

Answers (3)

Vitaliy Pitvalo
Vitaliy Pitvalo

Reputation: 1

This is bad way... Just foreach all subviews of player view and turn off needed button by index

[self listSubviewsOfView:playerVC.view andLevel: 0];



- (void)listSubviewsOfView:(UIView *)view andLevel: (NSInteger)level {

    NSArray *subviews = [view subviews];
    if ([subviews count] == 0) return;
    for (UIView *subview in subviews) {
       NSString *str = NSStringFromClass([subview class]);
       if(subview.hidden == NO){
          if([str isEqualToString:@"MPKnockoutButton"] && (level== 15 || level== 17) ){
               subview.hidden = YES;
          }
      }
     [self listSubviewsOfView:subview andLevel:level];
   }
}

Upvotes: 0

Chicowitz
Chicowitz

Reputation: 5939

Just ran into this in iOS 7. The seek buttons do fire the MPMoviePlayerPlaybackStateDidChangeNotification of type MPMoviePlaybackStateStopped. So you can listen for this case and handle it appropriately if you want to keep the standard UI controls without creating custom ones.

Upvotes: 0

Noah Witherspoon
Noah Witherspoon

Reputation: 57139

You could try setting its controlStyle to MPMovieControlStyleEmbedded—that'll give you the embedded-style controls, which're just a scrubber bar, a play/pause button, and a fullscreen toggle.

Upvotes: 0

Related Questions