尽管在iOS 8.2和iOS 8.3中设置了UIVideoEditorController
属性,但videoQuality
剪裁的视频会被压缩并失去质量。
let controller = segue.destinationViewController as! UIVideoEditorController
if let pathStr = mediaFile.pathStr {
if UIVideoEditorController.canEditVideoAtPath(pathStr as String) {
controller.delegate = self
controller.videoMaximumDuration = 30
controller.videoPath = pathStr as String
controller.videoQuality = .TypeHigh
} else {
showAlert("Can not edit video")
}
}
}