Fix video rotation

This commit is contained in:
Ali 2021-01-26 20:50:58 +05:00
parent 0fbb849637
commit 145c034ad8

View File

@ -103,7 +103,7 @@ public final class MediaPlayerNode: ASDisplayNode {
self.currentRotationAngle = rotationAngle self.currentRotationAngle = rotationAngle
self.currentAspect = aspect self.currentAspect = aspect
var transform = CGAffineTransform(rotationAngle: CGFloat(rotationAngle)) var transform = CGAffineTransform(rotationAngle: CGFloat(rotationAngle))
if abs(rotationAngle).remainder(dividingBy: Double.pi / 2.0) > 0.1 { if abs(rotationAngle).remainder(dividingBy: Double.pi) > 0.1 {
transform = transform.scaledBy(x: CGFloat(aspect), y: CGFloat(1.0 / aspect)) transform = transform.scaledBy(x: CGFloat(aspect), y: CGFloat(1.0 / aspect))
} }
videoLayer.setAffineTransform(transform) videoLayer.setAffineTransform(transform)