Youtube-video nicht spielen im landscape-Modus in iOS 8

Meine app besteht in der Funktionalität der Wiedergabe von videos, sowohl in Landschaft und portrait-Modus.videos kann youtube auch alles gut funktioniert bis iOS 7 aber jetzt youtube-videos funktionieren nicht im landscape-Modus auf iOS 8.

mein code:

- (NSUInteger)application:(UIApplication *)applicationsupportedInterfaceOrientationsForWindow:(UIWindow *)window {


  if ([[window.rootViewController presentedViewController]
     isKindOfClass:[MPMoviePlayerViewController class]] || [[window.rootViewController presentedViewController] isKindOfClass:NSClassFromString(@"MPInlineVideoFullscreenViewController")])        {

      return UIInterfaceOrientationMaskAllButUpsideDown;
  } else {

      if ([[window.rootViewController presentedViewController]
         isKindOfClass:[UINavigationController class]]) {

          //look for it inside UINavigationController
          UINavigationController *nc = (UINavigationController *)[window.rootViewController presentedViewController];

          //is at the top?
          if ([nc.topViewController isKindOfClass:[MPMoviePlayerViewController class]]) {
            return UIInterfaceOrientationMaskAllButUpsideDown;

            //or it's presented from the top?
          } else if ([[nc.topViewController presentedViewController]
                    isKindOfClass:[MPMoviePlayerViewController class]]) {
              return UIInterfaceOrientationMaskAllButUpsideDown;
          }
      }
  } 

  return UIInterfaceOrientationMaskPortrait;
}

Alles gut funktioniert bis iOS 7 aber aufhören zu arbeiten auf iOS 8.
Jede Hilfe zu schätzen

InformationsquelleAutor pankaj | 2014-09-22
Schreibe einen Kommentar