[Fix] Ensure layers are not rotated unless autorate is enabled

This commit is contained in:
Jon Andersen 2019-04-01 00:45:10 -04:00
parent 3f461e60d5
commit 40094dfec2
2 changed files with 9 additions and 2 deletions

View file

@ -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

View file

@ -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
}