2011-09-29 4 views
1

MPMediaPlayer에서 앞으로 탐색 버튼을 제거하거나 비활성화하고 싶습니다. 모든 뷰를 열거하려고했지만 분명히이 버튼을 찾을 수 없습니다.iPhone-MPMediaPlayer 앞으로 탐색 버튼을 사용하지 않음

아무도 아이디어가 있습니까?

감사합니다.

+0

당신이 실제로하고있는 것을 몇 가지 코드 또는 더 많은 정보를 제공하십시오 ... – DShah

+0

나는 영화를 재생하기 위해 MPMediaPlayerViewController를 제시하고 있습니다. 사용자가 영화로 빨리 감기를하지 못하게하는 것이 중요합니다. 그러나 뒤로 및 재생/일시 정지 기능이 작동해야합니다. –

답변

-1

내가 찾은 유일한 방법은 앞으로 탐색 버튼 위에 투명 버튼을 추가하는 것입니다.

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

이는 아이 패드 전용입니다 : 여기 코드입니다! iPhone에서도 같은 작업을 수행하려면 투명 버튼의 위치를 ​​변경하십시오.

+0

그리고 애플이 업데이트에서 컨트롤러의 위치를 ​​바꿀 때, 뭐라구? –

+0

그런 다음이 대답이 마음에 들지 않으면 다른 방법을 찾아보십시오. : P ... 오, 그리고 애플에 의해 허용되는 방법. 감사 –

0

당신은 항상 당신의 인터페이스를 포함하는 하위 뷰를 추가하려면 다음

playerController.controlStyle = MPMovieControlStyleNone; 

와 기본 컨트롤을 숨길 수, 사용자 지정 컨트롤 패널을 제공하고 단지// 포즈 시작을 재생 되감기 정지 버튼을 링크, 그리고 거기에 있었다 가변 속도 슬라이더 (OBSlider)의 오픈 소스 구현. 또한 일부 MP 알림을 등록해야합니다.

MPMovieDurationAvailableNotification 
MPMoviePlayerLoadStateDidChangeNotification 
MPMoviePlayerPlaybackDidFinishNotification 
MPMoviePlayerPlaybackStateDidChangeNotification 
+0

앞으로 탐색 버튼 만 사용하면됩니다. –

관련 문제