Search code examples
iphoneforwardseekmpmediaplayercontroller

iPhone-MPMediaPlayer disable seek forward button


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.


Solution

  • 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.