MPMoviePlayerView fade in/out of overlay

Posted by therobot on Stack Overflow See other posts from Stack Overflow or by therobot
Published on 2011-03-02T07:21:58Z Indexed on 2011/03/02 7:24 UTC
Read the original article Hit count: 325

I've got a MPMoviePlayerViewController, and I've added an overlay as a subview to the MPMoviePlayerController.view that it controls. Does anyone know if there's an easy way to make my added overlay fade in and out with the rest of the controls?

My code to initialize and present the player is:

LandscapeMPVC * theMovieViewController = [[LandscapeMPVC alloc] initWithContentURL:sourceURL];
MPMoviePlayerController * theMoviePlayer = [theMovieViewController moviePlayer];

[theMoviePlayer setRepeatMode:MPMovieRepeatModeOne]; 
[theMoviePlayer setScalingMode:MPMovieScalingModeAspectFit];
[theMoviePlayer setFullscreen:YES];

// Attemps at overlays
MPViewOverlayController * overlayCont = [[MPViewOverlayController alloc] init];

[[theMovieViewController view] addSubview:overlayCont.view];

[[NSNotificationCenter defaultCenter] addObserver:self 
                                         selector:@selector(resetToolbar:) 
                                             name:MPMoviePlayerPlaybackDidFinishNotification
                                           object:theMoviePlayer];

[self presentMoviePlayerViewControllerAnimated:theMovieViewController];

LandscapeMPVC is just a subclass of MoviePlayerViewController where I overwrite the orientation code.

When the rest of the controls fade in the movie player, my custom overlay does not. Is there some code in the controller that I need to add, or some notification that is sent?

Any input would be greatly appreciated.

© Stack Overflow or respective owner

Related posts about iphone

Related posts about ipad