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 g开发者_开发技巧et rid of them, or sort this so it doesn't crash my app?
Thanks!
:-Joe
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.
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];
}
}
精彩评论