Replace deprecated `AVAsset.tracks(withMediaType:)`

This commit is contained in:
woxtu 2024-03-04 10:27:57 +09:00
parent 4517a4fffb
commit 9ad5f7ba48
1 changed files with 1 additions and 1 deletions

View File

@ -15,7 +15,7 @@ extension AttachmentViewModel {
func compressVideo(url: URL) async throws -> URL? {
let urlAsset = AVURLAsset(url: url)
guard let track = urlAsset.tracks(withMediaType: .video).first else {
guard let track = try await urlAsset.loadTracks(withMediaType: .video).first else {
return nil
}