iOS - 视频不能仅在iOS7上通过iPhone旋转? [英] iOS - Video not rotating only in iOS7 over iPhone?

查看:94
本文介绍了iOS - 视频不能仅在iOS7上通过iPhone旋转?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我做了什么?

我正在 MPMoviePlayerViewController 并实现了如下定位功能

I am playing videos in an extended class of MPMoviePlayerViewController and have implemented orientation functions as follows

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation {

    if (toInterfaceOrientation == UIInterfaceOrientationPortraitUpsideDown){
        return FALSE;
    }
    else{
        return TRUE;
    }
}

- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration {
    [self setControlsPositions:toInterfaceOrientation];
}
-(BOOL)shouldAutorotate
{
    return YES;
}

我面临的问题是什么?

iPhone和iPad上的应用程序可以正常运行至iOS6(使用iOS7)但是在安装了iOS7的情况下,视频无法在iPhone上旋转。

The application works fine up till iOS6 on Both iPhone and iPad Almong with iPad (with iOS7) but the video does not rotate over iPhone with iOS7 installed.

此问题的原因是什么以及如何解决?

What is the reason for such issue and how it can be resolved?

更新


如果 setMovieSourceType 我发现视频会旋转是
设置为 MPMovieSourceTypeUnknown 但设置为
时不旋转`MPMovieSourceTypeStreaming

I have found that the video does rotates if setMovieSourceType is set to MPMovieSourceTypeUnknown but does not rotate when set to `MPMovieSourceTypeStreaming


推荐答案

在苹果要我给他们一个样本以便我在iOS-7中报告的bug之后我发现我没有推动视图控制器而不是我正在将视图添加到窗口。
在这种情况下,其他视图控制器确实获得了方向事件,但是 MPMoviePlayerViewController 子类没有这样我只是呈现视图控制器而不是添加它的视图而它工作。

After apple wanted me to give them a sample for the bug reported by me in iOS-7 i found that i wasn't pushing the view Controller rather i was adding the view to window. In such cases other view Controllers do get the orientation events but the MPMoviePlayerViewController subclass didn't so i just presentated the view controller instead of adding the its view and it worked.

这篇关于iOS - 视频不能仅在iOS7上通过iPhone旋转?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆