MPMoviePlayerController
을 누르면 아무런 변화가 없습니다. 아무도 내가 UITapGestureRecognizer
을 설정하는데 잘못하고있는 것을 볼 수 있습니까?MPMoviePlayerController에 UITapGestureRecognizer 추가
- (void) playMovie : (NSString *) urlString{
self.movieURLString = urlString;
NSURL *movieURL = [NSURL URLWithString:self.movieURLString];
self.moviePlayer = [[MPMoviePlayerController alloc] init];
[self.moviePlayer setShouldAutoplay:YES];
[self.moviePlayer setContentURL:movieURL.absoluteURL];
[self.moviePlayer setMovieSourceType:MPMovieSourceTypeFile];
self.moviePlayer.controlStyle = MPMovieControlStyleNone;
self.moviePlayer.view.frame = self.movieView.frame;
/* add tap handler */
UITapGestureRecognizer *singleFingerTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(showControls:)];
singleFingerTap.delegate = self;
//EDIT: this line somehow didn't make into my OP
[self.moviePlayer.view addGestureRecognizer:singleFingerTap];
self.moviePlayer.view.backgroundColor = [UIColor clearColor];
[self.view addSubview:self.moviePlayer.view];
[self.moviePlayer prepareToPlay];
// respond to changes in movie player status
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(myMovieFinishedCallback:)
name:MPMoviePlayerPlaybackDidFinishNotification
object:self.moviePlayer];
}
- (void) showControls : (UITapGestureRecognizer *) recognizer {
NSLog(@"here");
self.moviePlayer.controlStyle = MPMovieControlStyleEmbedded;
}
나는 당신의 게시물에 대한 세부 사항을 확인하지는 않았지만,'MPMoviePlayerController'가 제스처 인식기 몇 개를 사용하고 충돌로 인해 결코 트리거되지 않는다는 사실을 놓치고있는 것 같아요. – Till