Skip to content

Conversation

@alperalb
Copy link

When capturing photos, preview layer shows in aspectFill ratio. But if we need to show it without filling arter the capture, a strange zooming effect occur.

if let validCaptureSession = captureSession {
previewLayer = AVCaptureVideoPreviewLayer(session: validCaptureSession)
previewLayer?.videoGravity = AVLayerVideoGravity.resizeAspectFill
previewLayer?.videoGravity = layerVideoGravity == .resizeAspect ? AVLayerVideoGravity.resizeAspect : AVLayerVideoGravity.resizeAspectFill

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not use enum by apple - AVLayerVideoGravity?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants