Skip to content

Commit

Permalink
BugFix #200
Browse files Browse the repository at this point in the history
  • Loading branch information
tilltue committed Aug 17, 2019
1 parent 6fa3878 commit b4d741c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion TLPhotoPicker.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

Pod::Spec.new do |s|
s.name = 'TLPhotoPicker'
s.version = '1.9.4'
s.version = '1.9.5'
s.summary = 'multiple phassets picker for iOS lib. like facebook'

# This description is used to generate tags and improve search results.
Expand Down
12 changes: 5 additions & 7 deletions TLPhotoPicker/Classes/TLAssetsCollection.swift
Original file line number Diff line number Diff line change
Expand Up @@ -219,10 +219,12 @@ public struct TLPHAsset {
}
}

//Apparently, this method is not be safety to export a video.
//Apparently, This is not the only way to export video.
//There is many way that export a video.
//This method was one of them.
public func exportVideoFile(options: PHVideoRequestOptions? = nil, progressBlock:((Float) -> Void)? = nil, completionBlock:@escaping ((URL,String) -> Void)) {
public func exportVideoFile(options: PHVideoRequestOptions? = nil,
progressBlock:((Float) -> Void)? = nil,
completionBlock:@escaping ((URL,String) -> Void)) {
guard let phAsset = self.phAsset, phAsset.mediaType == .video else { return }
var type = PHAssetResourceType.video
guard let resource = (PHAssetResource.assetResources(for: phAsset).filter{ $0.type == type }).first else { return }
Expand All @@ -240,11 +242,7 @@ public struct TLPHAsset {
}else {
requestOptions.isNetworkAccessAllowed = true
}
//iCloud download progress
//options.progressHandler = { (progress, error, stop, info) in

//}
PHImageManager.default().requestAVAsset(forVideo: phAsset, options: options) { (avasset, avaudioMix, infoDict) in
PHImageManager.default().requestAVAsset(forVideo: phAsset, options: requestOptions) { (avasset, avaudioMix, infoDict) in
guard let avasset = avasset else { return }
let exportSession = AVAssetExportSession.init(asset: avasset, presetName: AVAssetExportPresetHighestQuality)
exportSession?.outputURL = localURL
Expand Down

0 comments on commit b4d741c

Please sign in to comment.