-1
我有一個大問題,我的情況PHImageManager.default()。requestAVAsset視頻
我的主要問題是,我需要一個獲取視頻一個做視頻名稱一些操作,並將其保存到文件系統和再次獲取另一個視頻對視頻名稱進行一些操作並通過資產循環將其保存到文件系統問題是完成處理程序阻止我這樣做,因爲它將所有視頻保存在一起,而不進行任何編輯並更改名稱this save all視頻,我認爲它正在後臺線程請任何幫助解決這個問題,我需要處理獲取視頻一個接一個
這是我的代碼
for asset in arrayOfAssets {
if asset.mediaType == .video {
PHImageManager.default().requestAVAsset(forVideo: asset, options: nil, resultHandler: { (AVAsset, AVAudio, info) in
// i need access to this place so i can fetch the video one by one and working with the AVAsset
})
}else{
let imageOp = PHImageRequestOptions()
PHImageManager.default().requestImage(for: asset, targetSize: CGSize(width:125,height:125), contentMode: .aspectFit, options: imageOp, resultHandler: { (img, info) in
print(img!)
})
}
}
這個問題被標記爲 「雨燕」,而不是「 objective-c「... – Moritz
是的埃裏克,但我們可以從這個想法。 和代碼可以轉換爲swift。 https://objectivec2swift.com/ – Rivendell
但我不需要獲取所有視頻我需要訪問結果處理程序 – Mustafa