Reputation: 864
I am trying to overlay a button on the MPMoviePlayer on my app. I can't get it to work properly on a streaming movie. The overlay shows up on top of the view that launched the movie object (in my case a table view). I'm pretty much following the MPMoviePlayer example exactly. I would also be interested in making the overlay show up if the movieplayer window is touched. I am not experienced with iphone development at all.
Thanks in advance.
Upvotes: 0
Views: 1251
Reputation: 6927
This is taken almost directly from the MoviePlayer sample project, where overlayView is the view you've defined.
NSArray *windows = [[UIApplication sharedApplication] windows];
if ([windows count] > 1) {
// Locate the movie player window
UIWindow *moviePlayerWindow = [[UIApplication sharedApplication] keyWindow];
[moviePlayerWindow addSubview:self.overlayView];
}
Upvotes: 2
Reputation: 25969
The MPMoviePlayer is probably added as a subview of the UIWindow instance in your app delegate (similar to the UIKeyboard).
You don't actually have any control over the MoviePlayer view, however. I could be wrong, but I don't think adding overlays on the MPMoviePlayer view is supported. You can try adding your "overlay" to the UIWindow instance and see what happens.
Upvotes: 0