Open gpapoyan95 opened 5 years ago
@gpapoyan95 Can you please attach a small project to repro this?
When I'm trying to swap camera to the front, the preview is rotated upside down. Any solution?
In my opinion , you can try to transform your renderView to solve this problem
I changed .portrait to .landscapeRight in imageOrientation for front camera and its working fine. @BradLarson please review it if its correct.
func imageOrientation() -> ImageOrientation {
switch self {
case .backFacing: return .landscapeRight
case .frontFacing: return .landscapeRight // this was .portrait
}
}
I add code in Camera.swift
if self.location == .frontFacing{ connection.videoOrientation = .landscapeRight }
@jagdev7dayz I don't know which solution is better
a soulution i have found to preserve the mirroring aspect (and fixing the upside-down bug) of the front camera is to set in ImageOrientation.swift L15:
case (.landscapeLeft, .portrait): return .rotateClockwiseAndFlipVertically // previously: return .rotateClockwise
When I'm trying to swap camera to the front, the preview is rotated upside down. Any solution?