开发者

iPhone SDK: is it possible to make standard movie player working in portrait orientation?

I tried to use

- (BOOL) shouldAutoRotateToInterfaceOrientation(UIInterfaceOrientation)interfaceOrientation {
    开发者_如何学Pythonif(interfaceOrientation == UIInterfaceOrientationPortrait) {
        return YES;
    }
}

but it doesn't change anything in a standard movie player. Screen rotates to landscape mode automatically and movie player does not respond to portrait rotation.

However, it works with usual view controllers. The SDK version is 3.1.2

I'm not going to use pre-set video orientation, I need only auto-rotation if it's possible.


You must have created the custom class which extends to UIViewController and you have added the frame work called #import <MediaPlayer/MediaPlayer.h>, then in delegate method - (void) moviePlayerLoadStateChanged:(NSNotification*)notification you need to add following line of code:

[[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationLandscapeRight animated:NO];
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜