IPhone, MPMoviePlayerController how to disable zooming when double tap on the screen?
-
22-07-2019 - |
Question
How can I dissable the strange double tap behaviour when playing movie using MPMoviePlayerController.
The double tap makes zoom/unzoom of the movie and makes some of my gestures in the overlay view to stop working on the double tap area.
Solution
I had the same problem. Just add:
self.moviePlayerViewController.view.userInteractionEnabled = NO;
OTHER TIPS
Actually you can do something like, it works fine for me :) :
[[[self.moviePlayer view] subviews] enumerateObjectsUsingBlock:^(id view, NSUInteger idx, BOOL *stop) {
[[view gestureRecognizers] enumerateObjectsUsingBlock:^(id tap, NSUInteger idx, BOOL *stop) {
if([tap isKindOfClass:[UITapGestureRecognizer class]]) {
if([tap numberOfTapsRequired]==2)
{
[view removeGestureRecognizer:tap];
}
}
}];
}];
The .userInteraction bool will solve the problem, unless you have your own gesture recognizers doing work in the MPMoviePlayerViewController.
If that's the case, then do this instead;
self.player.view.gestureRecognizers = nil;
Then afterwards, you can add & use your own gesture recognizers, since the interactivity of the player is still yes.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow