This is my code:
_mediaPlayer = [[MPMoviePlayerController alloc] init];
_mediaPlayer.controlStyle = MPMovieControlStyleNone;
_mediaPlayer.shouldAutoplay = NO;
[_mediaPlayer.view setFrame: CGRectMake(5, 5, 600,400)];
[playerHolder addSubview: _mediaPlayer.view];
//
[self prepareScreenContentToPlay];
//
UITapGestureRecognizer *singleFingerTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleRollTap:)];
singleFingerTap.numberOfTapsRequired = 1;
[_mediaPlayer.view addGestureRecognizer:singleFingerTap];
[singleFingerTap release];
And action method for gesture recognizer:
-(void)handleRollTap:(UITapGestureRecognizer*)sender{
NSLog(@"%@", @"touch");
}
MPMoviePlayerController works fine. In addition I want to handle touch on MPMoviePlayerController view but handleRollTap
never called. Why MPMoviePlayerController's view not works with UITapGestureRecognizer?
OK. If singleFingerTap.numberOfTapsRequired = 2;
then all works fine as well. But nothing for single tap..
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…