简体   繁体   中英

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

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.

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

您可以尝试将其controlStyle设置为MPMovieControlStyleEmbedded将为您提供嵌入式样式的控件,该控件只是一个洗涤器栏,一个播放/暂停按钮和一个全屏切换。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM