Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

Commit e8cf3ac

Browse files
committed
Improve format
1 parent dd75553 commit e8cf3ac

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

packages/video_player/video_player_avfoundation/ios/Classes/FLTVideoPlayerPlugin.m

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -190,16 +190,17 @@ - (instancetype)initWithURL:(NSURL *)url
190190
- (CGAffineTransform)fixTransform:(AVAssetTrack *)videoTrack {
191191
CGAffineTransform transform = videoTrack.preferredTransform;
192192
NSInteger rotationDegrees = (NSInteger)round(radiansToDegrees(atan2(transform.b, transform.a)));
193-
NSLog(@"TX and TY: %f, %f. Rotation: %ld. Natural width and height: %f, %f", transform.tx, transform.ty,
194-
(long)rotationDegrees, videoTrack.naturalSize.width, videoTrack.naturalSize.height);
193+
CGSize size = videoTrack.naturalSize;
194+
NSLog(@"TX and TY: %f, %f. Rotation: %ld. Natural width and height: %f, %f", transform.tx,
195+
transform.ty, (long)rotationDegrees, size.width, size.height);
195196
if (rotationDegrees == 90) {
196197
NSLog(@"Setting transform tx");
197-
transform.tx = videoTrack.naturalSize.height;
198+
transform.tx = size.height;
198199
transform.ty = 0;
199200
} else if (rotationDegrees == 270) {
200201
NSLog(@"Setting transform ty");
201202
transform.tx = 0;
202-
transform.ty = videoTrack.naturalSize.width;
203+
transform.ty = size.width;
203204
}
204205
return transform;
205206
}

0 commit comments

Comments
 (0)