1

I would like to remove or disable the seek forward button from the MPMediaPlayer. I have tried to enumerate all the views but apparently I could not find this button.

Does anyone have any idea?

Thanks.

Andrei Neacsu
  • 1,453
  • 3
  • 20
  • 33
  • provide some code or more information what you are actually doing... – DShah Sep 29 '11 at 16:07
  • I am presenting an MPMediaPlayerViewController in order to play a movie. It is imperative to prevent the user to fast forward to movie. But the backward and play/pause functions must work. – Andrei Neacsu Sep 29 '11 at 18:07

2 Answers2

0

You could always provide a custom control panel, you can hide the default controls with

playerController.controlStyle = MPMovieControlStyleNone;

Then add a subview containing your interface and just link buttons to play/pause start/stop rewinding, and there's an open source implementation of the variable speed slider (OBSlider). You will also need to register for some MP notifications:

MPMovieDurationAvailableNotification
MPMoviePlayerLoadStateDidChangeNotification
MPMoviePlayerPlaybackDidFinishNotification
MPMoviePlayerPlaybackStateDidChangeNotification
jbat100
  • 16,757
  • 4
  • 45
  • 70
-1

The only way I found is to add a transparent button over the seek forward button. Here is the code:

- (void)viewDidAppear:(BOOL)animated
{
[super viewDidAppear:animated];

    UIButton *button = [[UIButton alloc] init];

    if(UIInterfaceOrientationIsLandscape(self.interfaceOrientation))
        [button setFrame:CGRectMake(535, 599, 90, 60)];
    else
        [button setFrame:CGRectMake(407, 855, 90, 60)];

    [button setBackgroundColor:[UIColor clearColor]];
    [button setAlpha:0.7];
    [button setTag:1200];

    [self.moviePlayer.view addSubview:button];
    [button release];
}


- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration
{
    if(UIInterfaceOrientationIsLandscape(toInterfaceOrientation))
    {
        UIButton *button = (UIButton *)[self.moviePlayer.view viewWithTag:1200];
        [button setFrame:CGRectMake(535, 599, 90, 60)];
    }
    else
    {
        UIButton *button = (UIButton *)[self.moviePlayer.view viewWithTag:1200];
        [button setFrame:CGRectMake(407, 855, 90, 60)];
    }
}

This is for IPAD ONLY! If you would like to do the same on iPhone, please change the position of the transparent button.

Andrei Neacsu
  • 1,453
  • 3
  • 20
  • 33