I am afraid there are no registered notifications for these events.
You may be lucky and find something by sniffing all the published notifications, as in the following answers:
Track and track all notifications
How to get NSNotifications from native YouTube video playback in UIWebView
However, it is possible to simply link the controls to the MPMoviePlayerControler
parameters. Thus, it is definitely undocumented, and it is at great risk of being refused when trying to sell your application on iTunes.
First you need to find the interface view in MPMoviePlayerController
, which until today is represented by a class called MPInlineVideoOverlay
using the built-in interface. Please note again that this has a great chance or breaks, as Apple may decide to use a different name any day.
- (UIView *)interfaceViewWithPlayer:(MPMoviePlayerController *)player { for (UIView *views in [player.view subviews]) { for (UIView *subViews in [views subviews]) { for (UIView *controlView in [subViews subviews]) { if ([controlView isKindOfClass:NSClassFromString(@"MPInlineVideoOverlay")]) { return controlView; } } } } return nil; }
If it returns the correct view, you simply add your own add-ons to the interface to it using the UIView addSubview:
As soon as you do this, your controls will be part of the playerβs interface, displayed and hidden with it (also keeping to all animations, etc. )
source share