MPMoviePlayerController fullscreen quirk in iPad

后端 未结 7 1787
無奈伤痛
無奈伤痛 2020-12-23 23:22

I want to show a MPMoviePlayerController in a view controller and let the user toggle full screen with the default controls, like the YouTube app. I\'m using the following c

7条回答
  •  鱼传尺愫
    2020-12-24 00:06

    Try this

     - (void)willEnterFullscreen:(NSNotification*)notification {
         NSLog(@"willEnterFullscreen");
    
        [[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationLandscapeRight animated:NO];
      }
    
     - (void)enteredFullscreen:(NSNotification*)notification {
         NSLog(@"enteredFullscreen");
     }
    
    - (void)willExitFullscreen:(NSNotification*)notification {
        NSLog(@"willExitFullscreen");
    
        [[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationPortrait animated:NO];
    
    
    }
    
    - (void)exitedFullscreen:(NSNotification*)notification {
        NSLog(@"exitedFullscreen");
    
        [[NSNotificationCenter defaultCenter] removeObserver:self];
    }
    

提交回复
热议问题