Replace deprecated `AVAsset.tracks(withMediaType:)`
This commit is contained in:
parent
4517a4fffb
commit
9ad5f7ba48
|
@ -15,7 +15,7 @@ extension AttachmentViewModel {
|
||||||
func compressVideo(url: URL) async throws -> URL? {
|
func compressVideo(url: URL) async throws -> URL? {
|
||||||
let urlAsset = AVURLAsset(url: 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
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue