From 3d15759fb9d044578ba4793b279808b2983e48d9 Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Wed, 29 May 2024 21:56:18 -0700 Subject: [PATCH 1/2] Don't constantly commit CA transactions when scrubbing video Closes #488 --- Tusker/Screens/Gallery/VideoControlsViewController.swift | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Tusker/Screens/Gallery/VideoControlsViewController.swift b/Tusker/Screens/Gallery/VideoControlsViewController.swift index 08d18faa1e..a7eac5bf3a 100644 --- a/Tusker/Screens/Gallery/VideoControlsViewController.swift +++ b/Tusker/Screens/Gallery/VideoControlsViewController.swift @@ -256,10 +256,8 @@ private class VideoScrubbingControl: UIControl { private func updateFillLayerMask() { // I don't know where this animation is coming from - CATransaction.begin() - CATransaction.setDisableActions(true) fillMaskLayer.frame = CGRect(x: 0, y: 0, width: fractionComplete * bounds.width, height: 8) - CATransaction.commit() + fillMaskLayer.removeAllAnimations() } override func beginTracking(_ touch: UITouch, with event: UIEvent?) -> Bool { From cb3fd43dbdc4eef2bb347ea58c01a01578c46154 Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Wed, 29 May 2024 22:03:21 -0700 Subject: [PATCH 2/2] Fix video thubmnail being flipped in Compose Closes #487 --- .../ComposeUI/Controllers/AttachmentThumbnailController.swift | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Packages/ComposeUI/Sources/ComposeUI/Controllers/AttachmentThumbnailController.swift b/Packages/ComposeUI/Sources/ComposeUI/Controllers/AttachmentThumbnailController.swift index 8bc31e2c9c..015309c6ce 100644 --- a/Packages/ComposeUI/Sources/ComposeUI/Controllers/AttachmentThumbnailController.swift +++ b/Packages/ComposeUI/Sources/ComposeUI/Controllers/AttachmentThumbnailController.swift @@ -40,6 +40,7 @@ class AttachmentThumbnailController: ViewController { case .video, .gifv: let asset = AVURLAsset(url: url) let imageGenerator = AVAssetImageGenerator(asset: asset) + imageGenerator.appliesPreferredTrackTransform = true #if os(visionOS) #warning("Use async AVAssetImageGenerator.image(at:)") #else @@ -91,6 +92,7 @@ class AttachmentThumbnailController: ViewController { if type.conforms(to: .movie) { let asset = AVURLAsset(url: url) let imageGenerator = AVAssetImageGenerator(asset: asset) + imageGenerator.appliesPreferredTrackTransform = true #if os(visionOS) #warning("Use async AVAssetImageGenerator.image(at:)") #else