From 096996c24215aa32b9faf2f2ab52e97f74e18e5b Mon Sep 17 00:00:00 2001 From: Thomas Ricouard Date: Wed, 24 Jan 2024 16:56:35 +0100 Subject: [PATCH] Video: Increase compression when in extension --- .../Sources/StatusKit/Editor/Components/Compressor.swift | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Packages/StatusKit/Sources/StatusKit/Editor/Components/Compressor.swift b/Packages/StatusKit/Sources/StatusKit/Editor/Components/Compressor.swift index 3934fb78..278d69ff 100644 --- a/Packages/StatusKit/Sources/StatusKit/Editor/Components/Compressor.swift +++ b/Packages/StatusKit/Sources/StatusKit/Editor/Components/Compressor.swift @@ -87,7 +87,12 @@ extension StatusEditor { func compressVideo(_ url: URL) async -> URL? { await withCheckedContinuation { continuation in let urlAsset = AVURLAsset(url: url, options: nil) - guard let exportSession = AVAssetExportSession(asset: urlAsset, presetName: AVAssetExportPreset1920x1080) else { + let presetName: String = if Bundle.main.bundlePath.hasSuffix(".appex") { + AVAssetExportPreset1280x720 + } else { + AVAssetExportPreset1920x1080 + } + guard let exportSession = AVAssetExportSession(asset: urlAsset, presetName: presetName) else { continuation.resume(returning: nil) return }