views:

2173

answers:

3

Hello,

I would like to know if it's possible to have a MoviePlayer in portrait mode.

Thanks for your help.

T.

+1  A: 

You can. See Erica Sadun's article at http://blogs.oreilly.com/iphone/2008/11/the-joys-of-vertical-audio.html. But note that the method for doing so is undocumented by Apple and therefore not recommended.

hkatz
+2  A: 
@interface MPMoviePlayerController (extend)
-(void)setOrientation:(int)orientation animated:(BOOL)value;
@end

moviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:movieUR];
[moviePlayer setOrientation:UIDeviceOrientationPortrait animated:NO];
if (moviePlayer)
{
        [self.moviePlayer play];
}

Implement above code. You will get what you want.

Hope that helps.

Sagar.

Check out following question. It has the same solutions.

http://stackoverflow.com/questions/1422930/playing-video-in-custom-size-screen-view-in-iphone

sugar
my app was rejected with this extension. =\
mOlind
I think you didn't gone through my answer. please check out my given link in answer I point out. It is mentioned there that it will be rejected.
sugar
+2  A: 

if you use "[moviePlayer setOrientation:UIDeviceOrientationPortrait animated:NO]; " API your application will be rejected from Apple Store

iPhoneMan