mirror of
https://github.com/samsonjs/SwiftyCam.git
synced 2026-04-27 15:07:43 +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
|
# CHANGELOG
|
||||||
|
|
||||||
## Master
|
## Master
|
||||||
|
|
||||||
|
## Version 4.0.0
|
||||||
- Fixes an issue when Record button isn't getting correct callbacks
|
- Fixes an issue when Record button isn't getting correct callbacks
|
||||||
- Fixes an when didFinishRecordingVideo wouldn't get a callback
|
- Fixes an when didFinishRecordingVideo wouldn't get a callback
|
||||||
|
- Using allowAutoRotate=false prevents layer from rotating.
|
||||||
|
|
||||||
## Version 3.0.0
|
## Version 3.0.0
|
||||||
- Swift 4.2 support
|
- Swift 4.2 support
|
||||||
|
|
|
||||||
|
|
@ -346,7 +346,11 @@ open class SwiftyCamViewController: UIViewController {
|
||||||
/// ViewDidLayoutSubviews() Implementation
|
/// ViewDidLayoutSubviews() Implementation
|
||||||
private func updatePreviewLayer(layer: AVCaptureConnection, orientation: AVCaptureVideoOrientation) {
|
private func updatePreviewLayer(layer: AVCaptureConnection, orientation: AVCaptureVideoOrientation) {
|
||||||
|
|
||||||
layer.videoOrientation = orientation
|
if(shouldAutorotate){
|
||||||
|
layer.videoOrientation = orientation
|
||||||
|
} else {
|
||||||
|
layer.videoOrientation = .portrait
|
||||||
|
}
|
||||||
|
|
||||||
previewLayer.frame = self.view.bounds
|
previewLayer.frame = self.view.bounds
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue