0
votes

I am faced with the same problem here. But my application does not work on iOS 7 the same way.

At the end of video or exiting fullscreen, the application rotation holded landscape mode.i rotate manually the device to portrait position then application become normal orientation position (portrait) and not change anymore. But in ios 6 at the end of the video, the device orientation back to normal position automatically.

does anyone have an advices ?

EDIT: i just realized now. my application statusbar is going portrait orientation at the end of the video. However, the view held landscape position. i try to rotate repeatedly, after that the view corrected.

2
yes you can try with modelpresentclasscodercat
was it deprecated in ios 7 ?Binus
By the way, i have tried the modelpresentclass. it was also useless. Please, attention to EDITBinus

2 Answers

2
votes

In AppDelegate.h:

@property(nonatomic)BOOL allowRotation;

in AppDelegate.m:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];

    RootViewController * root = [[RootViewController alloc] init];
    self.window.rootViewController = root;

//add two Notification

    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(MPVisionVideoNotification:) name:MPMoviePlayerWillEnterFullscreenNotification object:nil];
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(MPVisionVideoNotification:) name:MPMoviePlayerWillExitFullscreenNotification object:nil];

    self.window.backgroundColor = [UIColor whiteColor];
    [self.window makeKeyAndVisible];
    return YES;
}

- (void) moviePlayerWillEnterFullscreenNotification:(NSNotification*)notification {
    self.allowRotation = YES;
}

- (void) moviePlayerWillExitFullscreenNotification:(NSNotification*)notification {
    self.allowRotation = NO;
}

-(NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window
{
    if (self.allowRotation) {

        return UIInterfaceOrientationMaskLandscapeRight ;
    }
    return UIInterfaceOrientationMaskPortrait;
}

//this can rotate the windows when to fullscreen state
0
votes

Finally, i resolve the problem. i have not mentioned that i have been used 3rd party library which is "viewdeck II". And it brokes rotation cycle.

My advise who faced this kind problem, checking your 3rd party libraries...