I am afraid that there are no documented notifications for those events.
You may be lucky and find something by sniffing all posted notifications as in the following answers:
Trapping and tracing all notifications
How to receive NSNotifications from UIWebView embedded YouTube video playback
There is however a way to simply link your controls with those of MPMoviePlayerControler
's. That way is definitely undocumented and it does carry a strong risk of getting rejected when trying to sell your app on iTunes.
First, you need to locate the interface view within MPMoviePlayerController
, which up until today is represented by a class called MPInlineVideoOverlay
when using the embedded interface. Once again, please note that his this carries a big chance or breaking as Apple may decide any day to use a different naming.
/**
* This quirky hack tried to locate the interface view within the supposingly opaque MPMoviePlayerController
* view hierachy.
* @note This has a fat chance of breaking and/or getting rejected by Apple
*
* @return interface view reference or nil if none was found
*/
- (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 the returns a proper view, you just add your own additions to the interface on to of it using UIView addSubview:
Once you did that, your controls will be part of the player's interface, shown and hidden right together with it (also adhering to all animations etc.).