Landscape full screen youtube movie from portrait UIWebView in portrait app only in iOS 4.3, 5.0 and 6.0

I spent several hours researching this and I am still confused. This seems to be such a common task that I started to think I was missing something simple.

The problem is this:

I have a portrait-only iPhone app. Basically a UINavigationController, which at some point represents a modal UIViewController. This modally exposed controller has a UIWebView that displays YouTube videos. When the user clicks on this webView, a full screen player appears, which is great, but it shows up in portrait and there is no way to rotate it. I want it to be able to rotate, or at least show that the full screen has already been rotated to landscape, with all my other controllers remaining just portraits.

The only solution I can think of is to do the following: 1. allow the app and all controllers to support portrait and landscape 2. Observe orientation changes in all controllers 3. disable UIView animation in willRotate 4. When orientation changes set view transform to 90deg or -90deg rotation

It looks like a lot of work to achieve a simple youtube playback effect in landscape in a portrait-only app! Are there easier methods?

+3


source to share


1 answer


You can only implement shouldAutorotateToInterfaceOrientation:

and return YES when the video is playing full screen.



0


source







All Articles