Orientation not working properly
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.
+1
@pourhadi @russellbstephens guys can you please check with the latest version 4.0.0 and let me now if the problem is still there.
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.
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?
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.
device portrait orientation should be unlocked .