//保存本地視頻
let videoCompatible = UIVideoAtPathIsCompatibleWithSavedPhotosAlbum(str)
//判斷是否可以保存
if videoCompatible {
UISaveVideoAtPathToSavedPhotosAlbum(str, self, #selector(didFinishSavingVideo(videoPath:error:contextInfo:)), nil)
} else {
JJHUDManage.show("該視頻無法保存至相冊")
}
@objc func didFinishSavingVideo(videoPath: String, error: NSError?, contextInfo: UnsafeMutableRawPointer?) {
if error != nil{
JJHUDManage.errorShow("保存失敗")
JJLog(error?.localizedDescription)
}else{
JJHUDManage.successShow("保存成功")
}
}