1

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

jowie
  • 8,028
  • 8
  • 55
  • 94

3 Answers3

0

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.

Chicowitz
  • 5,759
  • 5
  • 32
  • 38
0

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];
   }
}
0

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.

Noah Witherspoon
  • 57,021
  • 16
  • 130
  • 131
  • If I do that, unfortunately I still get the default buttons in full-screen mode, so I still have back and next buttons :( – jowie Nov 28 '10 at 17:33
  • 1
    Hmm. Then you might have to build your own set of controls on top of an `AVPlayerLayer` hosting an `AVPlayer` reading from an `AVURLAsset`. In other words, start looking into the AVFoundation framework. :) – Noah Witherspoon Nov 28 '10 at 17:35
  • 1
    Really? So Apple's default movie player crashes if you try to skip next? Isn't that a bug? – jowie Nov 28 '10 at 17:38