2015-12-14 72 views

回答

2

只需添加一个UIView作为subView与明确backgroundColor玩家的观点,并添加您需要的手势在该视图。如下所示。

[playerViewController.view addSubview:YourView]; 
+0

天才。谢谢。深夜不知道为什么我不能想到这一点。 –

+0

这是不工作的原因是因为我提出了avPlayerViewController而不是将其作为超级viewController的子视图添加它。再次感谢! –

3
playerViewController.view.userInteractionEnabled = false 
5

选项:

playerViewController.view.userInteractionEnabled = false 

某种原因而工作,这个答案不应该被downvoted!

行为在iOS的10:当你AVPlayerViewController用户dissable互动,然后添加手势识别:

 _moviePlayer = [[AVPlayerViewController alloc] init]; 
     _moviePlayer.view.frame = _backgroundContainer.frame; 
     _moviePlayer.view.autoresizingMask = UtilsViewFlexibleElement; 
     _moviePlayer.view.userInteractionEnabled = YES; 
     _moviePlayer.showsPlaybackControls = NO; 

     [_moviePlayer.view addGestureRecognizer:[[UITapGestureRecognizer alloc] 
initWithTarget:self action:@selector(viewTapped)]]; 

手势将被注册,并充分合作。