views:

486

answers:

0

Hi all

I'm having some trouble trying to apply rotation to the movie player while it's playing...

When you see the IPhone's video player (the default you have in the operative system), you realize that whenever you turn the device upside-down, the player rotates too.

I want to achieve exactly the same thing in my app, but I don't know how... By default the MPMoviePlayerController doesn't have autorotation enabled.

I don't want to use the view property on MPMoviePlayerController to not to spoil compatibility with the lower OS versions. I can set the INITIAL orientation by retrieving the player's window and applying a transform:

UIWindow * _moviePlayerWindow = [[UIApplication sharedApplication] keyWindow];



CameraLib::TViewPort vp;
VideoLib::getRenderStateCache()->getViewport(vp);
if (vp.getOrientation() == CameraLib::EOrientationLandscapeRight)
{


     CGAffineTransform transform = CGAffineTransformMakeRotation(PI);
     _moviePlayerWindow.transform = transform;

}

This works great but... if after it I try to change again "_moviePlayerWindow.transform transform" value to anything else ... it does nothing... The rotation transform I'm setting up doesn't commits... It doesn't do anything...

Any sugestions? Thanks