Rectangle 27 3

IMP:If you're using ARC I believe you need to retain the outer moviePlayer. I just assigned it to a new property myself.

If your using self view as entire screen.

And without using self view you can work with entire fullscreen(it does not invoke the fullscreen-property)

NSURL *url = [[NSBundle mainBundle] URLForResource:@"Robot" withExtension:@"m4v"];
moviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:url];
moviePlayer.controlStyle = MPMovieControlStyleFullscreen;
moviePlayer.view.transform = CGAffineTransformConcat(moviePlayer.view.transform,   CGAffineTransformMakeRotation(M_PI_2));
UIWindow *backgroundWindow = [[UIApplication sharedApplication] keyWindow];
[moviePlayer.view setFrame:backgroundWindow.frame];
[backgroundWindow addSubview:moviePlayer.view];
[moviePlayer play];

thanks. the bug has disappeared in iOS 7.0.4

objective c - MPMoviePlayerController stops working in full screen mod...

ios objective-c mpmovieplayercontroller
Rectangle 27 0

I don't think we can control orientation of camera.Its orientation property is inbuilt,which changes with orientation of device.

Orientation of picker is read only property.

actually i just got an idea, maybe we can put the camera in another viewController and fix the orientation. would that work?

objective c - iPad camera orientation portrait mode? - Stack Overflow

objective-c ios ipad
Rectangle 27 0

- (NSUInteger) application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window {
     return UIInterfaceOrientationMaskLandscape;
}

in videoView to make it landscape

thanks for the suggestion...but still not working..same problem

objective c - Change Orientation on only one View Controller , lock ot...

objective-c xcode ios8 orientation
Rectangle 27 0

- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation
{
  return UIInterfaceOrientationMaskPortrait;
}
category
UINavigationController
appDelegate
- (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window
{
  UINavigationController *navigationController = (UINavigationController *)self.window.rootViewController;
  //check for which controller u need these methods
  if([navigationController.visibleViewController isKindOfClass:[yourViewController class]]) //provide specific view controller where u want protrait
  {
    [navigationController shouldAutorotate];
    [navigationController supportedInterfaceOrientations];
    [navigationController preferredInterfaceOrientationForPresentation];
  }
  return UIInterfaceOrientationMaskAll;
}

Note : remove from all viewController if u have added category for UINavigationController. It should be only in appDelegate.

hi prince.. Yesterday problem was with iPad mini's button, once I switch it works fine... :). Today's question: where should I add this, I have tried in corresponding views before.. It didn't worked.

In controller function is not getting called.

I have added it in category, there also preferredInterfaceOrientationForPresentation in not got hit while loading initially.

App hanged when I add the above code :(

- (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window this function is getting called multiple times for me whenever it is called category method also called, again coming back to same function...leads to finally hanging and crash, category is in app delegate.mm only

objective c - How to load UIView in Portrait mode irrespective of devi...

objective-c ios xcode cocoa-touch uiview
Rectangle 27 0

#pragma mark iOS 5 Orientation Support

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {

     return UIInterfaceOrientationIsPortrait(interfaceOrientation);
}

#pragma mark iOS 6 Orientation Support

-(NSUInteger)supportedInterfaceOrientations
{
    return UIInterfaceOrientationMaskPortrait;
}
#pragma mark - iOS 5.0 and up Rotation Methods

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {

    return UIInterfaceOrientationMaskLandscape;

}

#pragma mark - iOS 6.0 and up Rotation Methods

- (NSUInteger)supportedInterfaceOrientations;
{
    return UIInterfaceOrientationMaskLandscape;
}

If you are using navigationController,

Create a category like this,

@interface UINavigationController (Rotation_IOS6)

    @end

    @implementation UINavigationController (Rotation_IOS6)

    -(BOOL)shouldAutorotate
    {
        if([self.visibleViewController isMemberOfClass:NSClassFromString(@"YourLandscapeViewController")])
        {
            return UIInterfaceOrientationMaskLandscape
        }
        return NO;
    }

    - (NSUInteger)supportedInterfaceOrientations
    {
        return [[self topViewController] supportedInterfaceOrientations];
    }

    - (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation
    {
        if([self.visibleViewController isMemberOfClass:NSClassFromString(@"YourLandscapeViewController")])
        {
            return UIInterfaceOrientationMaskLandscape
        }
        return [[self.viewControllers lastObject] preferredInterfaceOrientationForPresentation];
    }

@end

objective c - Force orientation to Portrait Mode - Stack Overflow

objective-c orientation portrait
Rectangle 27 0

IMP:If you're using ARC I believe you need to retain the outer moviePlayer. I just assigned it to a new property myself.

If your using self view as entire screen.

And without using self view you can work with entire fullscreen(it does not invoke the fullscreen-property)

NSURL *url = [[NSBundle mainBundle] URLForResource:@"Robot" withExtension:@"m4v"];
moviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:url];
moviePlayer.controlStyle = MPMovieControlStyleFullscreen;
moviePlayer.view.transform = CGAffineTransformConcat(moviePlayer.view.transform,   CGAffineTransformMakeRotation(M_PI_2));
UIWindow *backgroundWindow = [[UIApplication sharedApplication] keyWindow];
[moviePlayer.view setFrame:backgroundWindow.frame];
[backgroundWindow addSubview:moviePlayer.view];
[moviePlayer play];

thanks. the bug has disappeared in iOS 7.0.4

objective c - MPMoviePlayerController stops working in full screen mod...

ios objective-c mpmovieplayercontroller
Rectangle 27 0

I don't think we can control orientation of camera.Its orientation property is inbuilt,which changes with orientation of device.

Orientation of picker is read only property.

actually i just got an idea, maybe we can put the camera in another viewController and fix the orientation. would that work?

objective c - iPad camera orientation portrait mode? - Stack Overflow

objective-c ios ipad
Rectangle 27 0

- (NSUInteger) application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window {
     return UIInterfaceOrientationMaskLandscape;
}

in videoView to make it landscape

thanks for the suggestion...but still not working..same problem

objective c - Change Orientation on only one View Controller , lock ot...

objective-c xcode ios8 orientation