views:

339

answers:

1

Hello everyone,

I am trying to rotate my MPMoviePlayerController to landscape view, but it always stays in portrait mode. I am doing this in a UIViewController and I still can't rotate my MPMoviePlayerController when I am in full screen mode. Do I have to do something to the shouldAutorotatetoOrientation method? If anyone knows how to do this please leave a reply back!!

Thanks,

Kevin

+1  A: 

From the UIViewController class reference:

By default, the UIViewController class displays views in portrait mode only. To support additional orientations, you must override the shouldAutorotateToInterfaceOrientation: method and return YES for any orientations your subclass supports. If the autoresizing properties of your views are configured correctly, that may be all you have to do. However, the UIViewController class provides additional hooks for you to implement additional behaviors as needed.

For example, if your autoresizingMask is set to UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight, and the parent view of your movie player view has autoresizesSubviews = YES, then returning YES from the shouldAutorotateToInterfaceOrientation may be all you need to do.

GregInYEG
Thanks, but I've manually got it to work by shaping my view to lanscape dimensions and rotating my MPMoviePlayerController. But now I've led to the problem where my done button isn't working when I enable the [moviePlayer setControlStyle:MPMovieControlStyleFullScreen];
Kevin