How can I detected when user touch to hide or show the MPMoviePlayerController controls ? Is there a notification or other way ?
The official answer would be; not possible.
Reasoning:
The MPMoviePlayerController
is to be regarded entirely opaque and should not be modified / accessed other than the documentation supports.
From its reference:
Consider a movie player view to be an opaque structure. You can add your own custom subviews to layer content on top of the movie but you must never modify any of its existing subviews.
However, you may get away by adding you own gesture recognizer to the view hierachy exposed by that controller. Make sure that your newly introduced gestures dont interfere with the existing (requireGestureRecognizerToFail
etc.).
But note, that is subject to break on every new iOS release as you will need to modify its existing gesture recognizers and that might be considered as a dealbreaker for submitting to iTunes. From my personal experience, that is not commonly detected by apple's review team and therefore could be an option.
The only "perfectly legal" option you have is disabling the control interface altogether (setting MPMovieControlStyle
, to MPMovieControlStyleNone
) and adding your own, resembling the original interface as far as you need it. Note that the complete functionality of that original interface is not entirely trivial - plan more than a day for that task. I have done loads of stuff like that and I can tell you that even after that experience, I would plan a week for fully implementing those things.