MPMoviePlayerController in Portrait mode?

前端 未结 3 1160
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-23 12:49

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

Thanks for your help.

T.

相关标签:
3条回答
  • 2021-01-23 13:09

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

    0 讨论(0)
  • 2021-01-23 13:14

    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.

    0 讨论(0)
  • 2021-01-23 13:31
    @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

    0 讨论(0)
提交回复
热议问题