MPMoviePlayerViewController in UIModalPresentationFormSheet Problem

808 views Asked by At

My problem is that i have a MPMoviePlayerViewController embeded inside a modalviewcontroller that has the formsheet atribute and when the video goes to fullscreen using the pinch or the arrows the controls dont work.

I have figured out that they dont work because only touches inside the rectangle that makes the modalviewcontroller are registered. for example, double tapping to zoom inside the rectangle works while everywhere else it doesnt.

This is a problem since the movie controls can't be used due to this problem. Can anyone help?

1

There are 1 answers

0
Pete42 On BEST ANSWER

Here is how I solved it. I changed the size of the modal view controller when the video was going into fullscreen.

-(void)movieDidEnterFullscreen:(NSNotification *)notification{

NSLog(@"did enter");

self.navigationController.view.superview.frame = CGRectMake(0, 0, 1500,1500);

self.navigationController.view.superview.center = self.view.center;

[mpviewController moviePlayer].controlStyle = MPMovieControlStyleDefault;

}

-(void)movieDidExitFullscreen:(NSNotification *)notification{

NSLog(@"did exit");

UIDevice *device = [UIDevice currentDevice];
[device beginGeneratingDeviceOrientationNotifications];

if (([device orientation] == UIDeviceOrientationLandscapeLeft) || ([device orientation] == UIDeviceOrientationLandscapeRight)){
    self.navigationController.view.superview.frame = CGRectMake(0, 0, 620,540);
    self.navigationController.view.superview.center = CGPointMake(384, 512);
}

else {

    self.navigationController.view.superview.frame = CGRectMake(0, 0, 540,620);
    self.navigationController.view.superview.center = CGPointMake(384, 512);

}


[mpviewController moviePlayer].controlStyle = MPMovieControlStyleEmbedded;

}