Hi I need to add a custom overlay to a MPMoviePlayerViewController but for some reason I can't get it to work. This is my code I have. Right now the custom overlay is just a gray view that covers the whole screen.
NSString *url = [[NSBundle mainBundle] pathForResource:@"mymovie" ofType:@"mp4"];
mViewPlayer = [[MPMoviePlayerViewController alloc] initWithContentURL:[NSURL fileURLWithPath:url]];
mViewPlayer.moviePlayer.controlStyle = MPMovieControlStyleNone;
mViewPlayer.moviePlayer.scalingMode = MPMovieScalingModeAspectFill;
MyBx.frame = CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height);
MyBx.backgroundColor = [UIColor grayColor];
[mViewPlayer.view addSubview:MyBx];
[NSNotificationCenter defaultCenter]
addObserver:self selector:@selector(movieDidExitFullscreen:)
name:MPMoviePlayerPlaybackDidFinishNotification
object:[mViewPlayer moviePlayer]];
[[NSNotificationCenter defaultCenter]
addObserver:self selector:@selector(MymovieStateChange:)
name:MPMoviePlayerPlaybackStateDidChangeNotification
object:[mViewPlayer moviePlayer]];
[self presentMoviePlayerViewControllerAnimated:mViewPlayer]
Thank you for the help!