0
votes

my project support portrait and landscape orientations on the device orientation on the general information. also, most of the viewcontrollers has a superclass named paren view controller in which i implemented methods to show the view only in portrait this method is -shouldautorotate returning NO. This specific controller containing the webview as a one of many views should be in portrait to, so i implemented that method too but i need the video to be in landscape also at the moment it is playing when the done button on the player is tapped and the video disappear the main view has to be on portrait, in other words i need the video to be in landscape and in portrait orientation. when i return YES from the shouldautorotate method the view containing the webview and the video can rotate which is what i don't want to happen.

Any help to solve this?

1

1 Answers

0
votes

You can handle the rotation manually by adding observer.

- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];

    [[NSNotificationCenter defaultCenter] addObserver:self
                                             selector:@selector(orientationDidChange:)
                                                 name:UIDeviceOrientationDidChangeNotification object:nil];
}

- (void)orientationDidChange:(NSNotification*)notification
{
   /// handle rotation for your views
}