Skip to content

Commit

Permalink
[Fix] Ensure layers are not rotated unless autorate is enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
jonandersen committed Apr 1, 2019
1 parent 3f461e6 commit 40094df
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
8 changes: 6 additions & 2 deletions Source/SwiftyCamViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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

}
Expand Down

0 comments on commit 40094df

Please sign in to comment.