From: http://www.alexcurylo.com/blog/2009/08/24/snippet-playing-youtube-videos/
Unfortunately, there is no direct control or notification of downloading, progress, logout, etc. However, you can get some indirect notifications based on the state of the application window: add to your view controller
[[NSNotificationCenter defaultCenter]
addObserver:self
selector:@selector(windowNowVisible:)
name:UIWindowDidBecomeVisibleNotification
object:self.view.window
];
[[NSNotificationCenter defaultCenter]
addObserver:self
selector:@selector(windowNowHidden:)
name:UIWindowDidBecomeHiddenNotification
object:self.view.window
];
to call them when the YouTube window is displayed and leaves accordingly.
- (void)windowNowVisible:(NSNotification *)notification
{
NSLog(@"Youtube/ Media window appears");
}
- (void)windowNowHidden:(NSNotification *)notification
{
NSLog(@"Youtube/ Media window disappears.");
}
and hey, if that's all you need, as a notice, you're good to go!
source
share