MPMoviePlayerController in Portrait mode?

北城余情 提交于 2019-12-02 14:09:59

问题


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

Thanks for your help.

T.


回答1:


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




回答2:


@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.

playing video in custom size screen - view in iphone




回答3:


You can. See Erica Sadun's article at
http://blogs.oreilly.com/iphone/2008/11/the-joys-of-vertical-audio.html.

But note that about method for doing this is undocumented by Apple and therefore not recommended.



来源:https://stackoverflow.com/questions/1374558/mpmovieplayercontroller-in-portrait-mode

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!