我试图通过捏它来关闭视频播放器,但没有任何成功。
func playVideo(video: MyVideoClass) {
let playerVC = AVPlayerViewController()
playerVC.player = AVPlayer(URL: NSURL(string: video.videourl)!)
let pinchy = UIPinchGestureRecognizer(target: self, action: "handlePinchGesture:")
playerVC.view.addGestureRecognizer(pinchy)
self.presentViewController(playerVC, animated: true, completion: {
playerVC.player!.play()
});
}
func handlePinchGesture(sender: AnyObject) {
print("Received gesture from \(sender)");
}
此时捏住视频播放器 UI 没有任何作用。