Take the 2-minute tour ×

I added pinch recognizer to the view(in which I have added MPMoviePlayerController) and created a function to handle pinch (i have set IBAction for that function) but it did not enter that function. What could be the problem ?

share|improve this question

3 Answers 3

up vote 2 down vote accepted

MPMoviePlayerController has its own implemented gestures recognizers that work on MPSwipableView. These gestures are already modified to perform specific default operations that MPMoviePlayer uses.

  • To define a custom gesture over MPMoviePlayerController. you have to use a separate empty view, add it over your MPMoviePlayerController.

  • Add Gesture Recognizers on it. Now you can receive gestures on your empty view. According to that you can adjust your MPMoviePlayer's View frame.

share|improve this answer

add delegate to pinch recognizer,MPMoviePlayerController and enable user interaction for MPMoviePlayerController,

share|improve this answer

An alternative to umirza47 answer is to deactivate the pinchgesture recogniser attached to the MPMoviePlayerController view. It depends though if you need to have the zoom in/zoom out functionality on the movie player for your own purpose: i believe that what the pinchgesture recognizer is for on the movie player:

for (UIGestureRecognizer *gesture in ((UIView *)videoVC.moviePlayer.view.subviews[0]).gestureRecognizers) {

     if ([gesture isKindOfClass:[UIPinchGestureRecognizer class]]) {

                gesture.enabled = NO;
share|improve this answer

Your Answer


