views:

357

answers:

1

Hi,

I got a problem that it hasn't change to portrait mode when using the following code:

NSString *url = @"http://abc.com/movie.3gp";

MPMoviePlayerController *moviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:[NSURL URLWithString:url]];

moviePlayer.scalingMode = MPMovieScalingModeAspectFill; // seen nothing change when comment this line

if([moviePlayer respondsToSelector:@selector(setOrientation:animated:)])
    [moviePlayer setOrientation:UIDeviceOrientationPortrait animated:NO];

[moviePlayer play];

Is my code problem? anyone can solve my problem or any alternative?

Thanks.

+2  A: 

is there any particular reason you expect this code to work? MPMoviePlayerController isn't documented as having a setOrientation method...

I don't think there's a way to make this happen.

David Maymudes
It's because I am finding solution for portrait mode and some of answer in this site said this method seen work, so I'm asking help for this, or I may misunderstanding the answer from other post.
calendarw