Permalink
Browse files

Fixed adding of videos without audio track.

  • Loading branch information...
NikKovIos committed Jul 29, 2018
1 parent 78bfa46 commit a6e847cfb822706c49fecf3c831814446b4e0fa2
Showing with 3 additions and 5 deletions.
  1. +3 −5 Source/Pages/Gallery/LibraryMediaManager.swift
@@ -86,16 +86,14 @@ class LibraryMediaManager {
return
}
guard let audioTrack = asset.tracks(withMediaType: AVMediaType.audio).first,
if let audioTrack = asset.tracks(withMediaType: AVMediaType.audio).first,
let audioCompositionTrack = assetComposition
.addMutableTrack(withMediaType: AVMediaType.audio,
preferredTrackID: kCMPersistentTrackID_Invalid) else {
print("⚠️ PHCachingImageManager >>> Problems with audio track")
return
preferredTrackID: kCMPersistentTrackID_Invalid) {
try audioCompositionTrack.insertTimeRange(trackTimeRange, of: audioTrack, at: kCMTimeZero)
}
try videoCompositionTrack.insertTimeRange(trackTimeRange, of: videoTrack, at: kCMTimeZero)
try audioCompositionTrack.insertTimeRange(trackTimeRange, of: audioTrack, at: kCMTimeZero)
// 2. Create the instructions

0 comments on commit a6e847c

Please sign in to comment.