title: How to properly rotate MPMoviePlayerController?
body: <p>I'm having some issues properly rotating an instance of MPMoviePlayerController. I want it to rotate based on iPad orientation. Normally, it works. Sometimes, however, something strange happens, and then it's screwed until I restart the program.</p>
  
  <p>Here's my initialization code:</p>
  
  <pre><code>NSString *path = [[NSBundle mainBundle] pathForResource:@"Drew 320x240" ofType:@"mp4" inDirectory:nil];
  myMPC = [[MPMoviePlayerController alloc] initWithContentURL:[NSURL fileURLWithPath:path]];
  
  [[myMPC view] setFrame: CGRectMake(0, 0, 597, 448)];
  myMPC.view.transform = CGAffineTransformMakeRotation(SP_D2R(-90));
  myMPC.view.center = CGPointMake(364, (850 / 2) + 168);
  </code></pre>
  
  <p>Here's my orientation code:</p>
  
  <pre><code>    -(void)orientationDetected:(UIEvent *)event{
      if ([UIDevice currentDevice].orientation == UIDeviceOrientationLandscapeLeft) {
          if (myMPC) {
              myMPC.view.transform = CGAffineTransformMakeRotation(SP_D2R(90));
              myMPC.view.center = CGPointMake(405, (850 / 2));
          }
      } else if ([UIDevice currentDevice].orientation == UIDeviceOrientationLandscapeRight) {
          if (myMPC) {
              myMPC.view.transform = CGAffineTransformMakeRotation(SP_D2R(-90));
              myMPC.view.center = CGPointMake(364, (850 / 2) + 174);
          }
      }
  }
  </code></pre>
  
  <p>And here are some screenshots. The first two are how they're supposed to be (one with the home button left, and the other with the home button right), the third one is the screw up. Here they are:</p>
  
  <p><img src="https://i.stack.imgur.com/t9Eho.png" alt="Landscape Home Button Left"></p>
  
  <p><img src="https://i.stack.imgur.com/skOAs.png" alt="Landscape Home Button Right"></p>
  
  <p><img src="https://i.stack.imgur.com/G2XX2.png" alt="Screw Up"></p>
  
  <p>As you can see, the video of the boy moves out of position and leaves blackness where it should have been (although the black rectangle isn't exactly where it should have been anyway -- it should be more to the left in that example). Once this happens, all subsequent device rotations result in this (until the program is restarted).</p>
  
  <p>This is not a simulator-specific issue, as this happens on the actual iPad. Again, sometimes it rotates fine. Is there something I'm missing/does anyone know why this is happening/does anyone know how to prevent this?</p>
  
  <p>I appreciate the help.</p>
  
  <p>Thank you,
  Ilya</p>
  
  <p>EDIT: Initialization code added and pictures are now embedded.</p>