Commit 66ed2451 authored by CZ1004's avatar CZ1004

【修改】修改压缩方法

parent 4b92a5f0
......@@ -258,7 +258,7 @@ class CompressQualityController : BaseViewController{
}else{
// 压缩视频
var compressAllSize : Double = 0.0
CompressViewModel.compressVideos(models: self.model!, quality: Float(currentQulity)) { (identifier, progress) in
CompressViewModel.compressVideos(models: self.model!, quality: Float(currentQulity)) { progress in
compressingView.animationView.setProgress(CGFloat(progress), animated: false, duration: 0.1)
} completion: { (outputURLs, errors) in
for (index, outputURL) in outputURLs.enumerated() {
......@@ -268,17 +268,16 @@ class CompressQualityController : BaseViewController{
if let fileSize = attributes[.size] as? Int64 {
compressAllSize = compressAllSize + Double(fileSize)
}
Print("---------压缩后的大小:\(compressAllSize)")
} catch {
Print("获取视频文件大小失败")
}
print("Compressed video \(index) saved at: \(outputURL)")
} else if let error = errors[index] {
print("Error compressing video \(index): \(error.localizedDescription)")
}
// 不管成功失败都跳转下一页
self.updateNextView(compressAllSize,compressingView,[],outputURLs)
}
Print("---------压缩后的大小:\(compressAllSize)")
// 不管成功失败都跳转下一页
self.updateNextView(compressAllSize,compressingView,[],outputURLs)
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment