iOS status bar orientation after play video fullsc

2019-02-25 19:21发布

问题:

I have an issue when play youtube video on iOS 6.1.2. That is, after play vieo at full screen mode at landscape (my app just supports portrait mode), or if user press Done during playing video, the status bar will not rotate. like this:

Now I register the UIMoviePlayerControllerDidExitFullscreenNotification observer to change the rotation of statusbar and it work fine on iOS 6.1 and below, but not in iOS 6.0.1

Please tell me if I make any mistake. Or any other solution to fix the statusbar orientation is welcome.

 [[NSNotificationCenter defaultCenter] addObserver:self
                                             selector:@selector(youTubeVideoExit:)
                                                 name:@"UIMoviePlayerControllerDidExitFullscreenNotification"
                                               object:nil];


- (void)youTubeVideoExit:(id)sender {
    [[UIApplication sharedApplication] setStatusBarOrientation:UIDeviceOrientationPortrait animated:NO];

}