3
votes

I've spent several hours researching this and I'm still confused. It seems to be so common task that I started to think that I missed something simple.

The problem is:

I have a Portrait-only iPhone app. Basically an UINavigationController that presents a modal UIViewController at some point. There is an UIWebView in that modally presented controller which displays youtube video. When user taps on that webView the fullscreen movie player shows up, which is great, but it shows in portrait and there is no way to rotate it. I want it to be able to rotate or at least show full screen already rotated to landscape, with all my other controllers remaining portrait-only.

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 animations in willRotate 4. when orientation changes set the view transform to 90deg or -90deg rotation

This seem like a lot of work to achieve simple effect of youtube playing in landscape in portrait-only app! Are there simpler methods?

1
Did you get solution for this??Mohit

1 Answers

0
votes

You can implement shouldAutorotateToInterfaceOrientation: and return only YES when the video is playing fullscreen.