2011-08-03 10 views
1

소개 비디오가있는 iOS 게임을하고 있습니다. 어떻게없이 동영상을 전체 화면으로 재생 할 : 놀이처럼사용자 컨트롤이나 상호 작용없이 iPhone에서 전체 화면 비디오를 재생할 수 있습니까?

1) 사용자 제어/일시 정지 볼 수있는

2) 더블 탭 같은 접촉 또는 비디오의 규모/줌을 변경 곤란?

동영상의 탭을 사용하지 않으려면 동영상 플레이어보기의 빈 UIView 화면을 추가하면됩니까? 내가 어떻게 그럴 수 있니?

+0

>>> 비디오에서 탭을 비활성화하려면 동영상 플레이어보기의 빈 UIView 초과 부분을 추가해도됩니까? 내가 어떻게 그럴 수 있니? 그럴 수도 있습니다. 알림 또는 원시 대리자 메서드를 통해 이벤트 처리기를 다시 연결하고 멀티 터치 제스처를 처리하기위한 메서드를 바로 적용하십시오. – Eugene

답변

1

내가 MPMoviePlayerController 솟다는 "빈"보기를 추가로 갔다. 이것은 내가 그것을 설정하는 방법입니다. 이벤트 핸들러를 망칠 필요가 없었습니다.

mBlankView = [[UIView alloc] initWithFrame:viewFrame]; 
mBlankView.userInteractionEnabled = YES; 
[mBlankView setMultipleTouchEnabled:YES]; 
[mBlankView setBackgroundColor:[UIColor clearColor]]; 
[window addSubview:mBlankView];  

viewFrame에는 MPMoviePlayerController의 크기가 포함됩니다.

5

어떤 종류의 영화 플레이어를 사용하고 있습니까? MPMoviePlayerViewController/MPMoviePlayerController를 사용하는 경우 controlStyle 속성을 MPMovieControlStyleNone으로 설정할 수 있습니다.

예 (당신은 당신이 controlStyle 속성을 가지고있는 MPMoviePlayerController를 얻을 수 있도록 먼저 moviePlayer 속성을 호출 MPMoviePlayerViewController를 사용하는 경우) :

MPMoviePlayerViewController* moviePlayerViewController = [MPMoviePlayerViewController alloc] initWithContentURL:url]; 
moviePlayerViewController.moviePlayer.controlStyle = MPMovieControlStyleNone; 
+0

Ok. 그게 효과가있는 것 같습니다. # 2에 대한 아이디어는? – djcouchycouch

0
MPMoviePlayerViewController *playerViewController=[[MPMoviePlayerViewController alloc]initWithContentURL:[NSURL fileURLWithPath:[[NSBundle mainBundle]pathForResource:@"XYZ" ofType:@"mp4"]]]; 
[self presentViewController:playerViewController animated:NO completion:nil]; 

MPMoviePlayerController *player = [playerViewController moviePlayer]; 
player.controlStyle=MPMovieControlStyleNone; //hide the controls 
[player play]; 
관련 문제