mirror of
https://github.com/samsonjs/SwiftyCam.git
synced 2026-03-26 09:15:55 +00:00
[Fix] Ensure layers are not rotated unless autorate is enabled
This commit is contained in:
parent
3f461e60d5
commit
40094dfec2
2 changed files with 9 additions and 2 deletions
|
|
@ -1,8 +1,11 @@
|
|||
# CHANGELOG
|
||||
|
||||
## Master
|
||||
|
||||
## Version 4.0.0
|
||||
- Fixes an issue when Record button isn't getting correct callbacks
|
||||
- Fixes an when didFinishRecordingVideo wouldn't get a callback
|
||||
- Using allowAutoRotate=false prevents layer from rotating.
|
||||
|
||||
## Version 3.0.0
|
||||
- Swift 4.2 support
|
||||
|
|
|
|||
|
|
@ -346,8 +346,12 @@ open class SwiftyCamViewController: UIViewController {
|
|||
/// ViewDidLayoutSubviews() Implementation
|
||||
private func updatePreviewLayer(layer: AVCaptureConnection, orientation: AVCaptureVideoOrientation) {
|
||||
|
||||
layer.videoOrientation = orientation
|
||||
|
||||
if(shouldAutorotate){
|
||||
layer.videoOrientation = orientation
|
||||
} else {
|
||||
layer.videoOrientation = .portrait
|
||||
}
|
||||
|
||||
previewLayer.frame = self.view.bounds
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue