views:

727

answers:

4

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.

A: 

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.

Corey Floyd
+1  A: 

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];  
}
Donald Hughes
A: 

@ samuelreh

did you find out the solution for this? i have the same problem as well.

vicky
This is not a answer.
sugar
A: 

i have the same problem!

i want to put a view over the moviePlayer... but the

NSArray *windows = [[UIApplication sharedApplication] windows];  
if ([windows count] > 1) {
// Locate the movie player window
UIWindow *moviePlayerWindow = [[UIApplication sharedApplication] keyWindow];
[moviePlayerWindow addSubview:self.overlayView];  

}

doesnt works...

pepe
it works, widows count depends up to your application windows. it may be 1,2 or 3.
sugar