LLSimpleCamera icon indicating copy to clipboard operation
LLSimpleCamera copied to clipboard

Orientation not working properly

Open pourhadi opened this issue 10 years ago • 6 comments

If I don't have useDeviceOrientation set to YES, orientation is always flipped the wrong way.

If I do set it to YES, the output video is always landscape.

pourhadi avatar Jun 01 '15 19:06 pourhadi

+1

russellbstephens avatar Aug 05 '15 23:08 russellbstephens

@pourhadi @russellbstephens guys can you please check with the latest version 4.0.0 and let me now if the problem is still there.

omergul avatar Dec 13 '15 10:12 omergul

when we record in landscape mode (where APP is in portrait) thumbnail image is in portrait Mode. its a big issue.Please give me solution.

yogeshingole avatar Jul 18 '17 06:07 yogeshingole

I have found a solution for this, at least for my case, but I think it can help @yogeshingole @pourhadi @russellbstephens MARK: I have only portrait mode enabled in my app and this method bellow is working like it should with that

[[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications];
    [[NSNotificationCenter defaultCenter] addObserverForName:UIDeviceOrientationDidChangeNotification object:nil queue:
  [NSOperationQueue mainQueue] usingBlock:^(NSNotification *note) {
        
        UIDeviceOrientation orientation = [[UIDevice currentDevice] orientation];
        if (orientation == UIDeviceOrientationPortrait){
            [UIView animateWithDuration:0.3 animations:^{
                self.preview.transform = CGAffineTransformMakeRotation(0);
            }];
        }else if ((orientation == UIDeviceOrientationLandscapeLeft)){
            [UIView animateWithDuration:0.3 animations:^{
                self.preview.transform = CGAffineTransformMakeRotation(M_PI_2);
            }];
            
        }else if ((orientation == UIDeviceOrientationLandscapeRight)){
            [UIView animateWithDuration:0.3 animations:^{
                self.preview.transform = CGAffineTransformMakeRotation(-M_PI_2);
            }];
            
        }
        
    }];

Video input is rotating, but preview is not, so I rotated it manually. @omergul Can we work on this to make smoother?

SrdjanSpasojevic avatar Aug 18 '17 13:08 SrdjanSpasojevic

Fixed problem by replacing below lines at line number 802 in file LLSimpleCamera.m

[[UIApplication sharedApplication] statusBarOrientation] to [[UIDevice currentDevice] orientation]

it's working Fine.

UdaySubbisetty avatar Jan 04 '18 10:01 UdaySubbisetty

device portrait orientation should be unlocked .

UdaySubbisetty avatar Jan 25 '18 10:01 UdaySubbisetty