title: MPInlineVideoFullscreenViewController and AVFullScreenViewController first time comes in portrait mode
body: <p>There are too many questions related to landscape issue in MPMovieplayer. My application is in portrait mode.But i wanna video in landscape mode.I already have landscape/portrait functionality for video. I am using the following code:</p>
  
  <pre><code>static NSString * const VIDEO_CONTROLLER_CLASS_NAME_IOS7 = @"MPInlineVideoFullscreenViewController";
  static NSString * const VIDEO_CONTROLLER_CLASS_NAME_IOS8 = @"AVFullScreenViewController";
  
  - (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window
  {
    if ([[window.rootViewController presentedViewController] isKindOfClass:NSClassFromString(VIDEO_CONTROLLER_CLASS_NAME_IOS7)] ||
      [[window.rootViewController presentedViewController] isKindOfClass:NSClassFromString(VIDEO_CONTROLLER_CLASS_NAME_IOS8)]) 
  {
  
      return UIInterfaceOrientationMaskAllButUpsideDown;
  }
  else {
      return UIInterfaceOrientationMaskPortrait;
  }
  </code></pre>
  
  <p>}</p>
  
  <p>The Code is working fine in both iOS 7 and iOS8.
  But the problem is that video first open in portrait mode while device is in landscape mode.After a change in orientation than app works fine.</p>
  
  <p>Thanks in advance.</p>