views:

299

answers:

1

Everything works fine while I'm not playing anything (I'm calling beginnotifications, etc, and using the orientation to rotate my view). But after I start playing with MPMoviePlayerController everytime when I try

UIDeviceOrientation orientation = [[UIDevice currentDevice] orientation];

The orientation gets a UIDeviceOrientationUnknown.

Any clue? When the movie stops everything works alright again. I need this orientation to rotate the player's window, because Im using Iphone OS 3.1 so I can't directly use the view property inside MPMovie player controller.

A: 

I am sorry I cannot be of help, but I am getting the same problem. Only after the movie player. Did you ever find and answer for this?

Chris Lester
Sorry, I haven't found a way to do this at least in iPhone OS version lower than 3.2. I gave up.But hey, I had to code a version for my app in the Ipad and I discovered that for iPhone OS 3.2, there's a way to do it. The only thing you have to do is to use a custom class, that you have to make child of MPMoviePlayerViewController and override the method shouldAutorotateToInterfaceOrientation to return yes whenever you want the autorotation to be performed. It's all in the MPMoviePlayerViewController class reference
Zelldweller