|
@@ -256,26 +256,32 @@ class PQStuckPointPublicController: PQBaseViewController {
|
|
|
|
|
|
|
|
|
|
override func backBtnClick() {
|
|
override func backBtnClick() {
|
|
- view.endEditing(true)
|
|
|
|
- let remindData = PQBaseModel()
|
|
|
|
- remindData.title = "编辑的内容,将不会被保存"
|
|
|
|
- let remindView = PQRemindView(frame: CGRect(x: 0, y: 0, width: cScreenWidth, height: cScreenHeigth))
|
|
|
|
- remindView.isBanned = true
|
|
|
|
- remindView.confirmBtn.setTitle("确认", for: .normal)
|
|
|
|
- remindView.cancelBtn.setTitleColor(UIColor.hexColor(hexadecimal: "#333333"), for: .normal)
|
|
|
|
- remindView.confirmBtn.setTitleColor(UIColor.hexColor(hexadecimal: "#EE0051"), for: .normal)
|
|
|
|
- UIApplication.shared.keyWindow?.addSubview(remindView)
|
|
|
|
- remindView.remindData = remindData
|
|
|
|
- remindView.remindBlock = { [weak self] item, _ in
|
|
|
|
- if item.tag == 2 {
|
|
|
|
- // 取消导出
|
|
|
|
- if self?.exporter != nil {
|
|
|
|
- self?.exporter.cancel()
|
|
|
|
|
|
+
|
|
|
|
+ if(isExportSuccess){
|
|
|
|
+ navigationController?.popViewController(animated: true)
|
|
|
|
+ }else{
|
|
|
|
+ view.endEditing(true)
|
|
|
|
+ let remindData = PQBaseModel()
|
|
|
|
+ remindData.title = "编辑的内容,将不会被保存"
|
|
|
|
+ let remindView = PQRemindView(frame: CGRect(x: 0, y: 0, width: cScreenWidth, height: cScreenHeigth))
|
|
|
|
+ remindView.isBanned = true
|
|
|
|
+ remindView.confirmBtn.setTitle("确认", for: .normal)
|
|
|
|
+ remindView.cancelBtn.setTitleColor(UIColor.hexColor(hexadecimal: "#333333"), for: .normal)
|
|
|
|
+ remindView.confirmBtn.setTitleColor(UIColor.hexColor(hexadecimal: "#EE0051"), for: .normal)
|
|
|
|
+ UIApplication.shared.keyWindow?.addSubview(remindView)
|
|
|
|
+ remindView.remindData = remindData
|
|
|
|
+ remindView.remindBlock = { [weak self] item, _ in
|
|
|
|
+ if item.tag == 2 {
|
|
|
|
+ // 取消导出
|
|
|
|
+ if self?.exporter != nil {
|
|
|
|
+ self?.exporter.cancel()
|
|
|
|
+ }
|
|
|
|
+ self?.navigationController?.popViewController(animated: true)
|
|
|
|
+
|
|
}
|
|
}
|
|
- self?.navigationController?.popViewController(animated: true)
|
|
|
|
-
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
override func viewDidLoad() {
|
|
override func viewDidLoad() {
|
|
@@ -411,6 +417,7 @@ extension PQStuckPointPublicController {
|
|
let inputAsset = AVURLAsset(url: URL(fileURLWithPath: documensDirectory + (audioMixModel?.localPath ?? "")), options: avAssertOptions)
|
|
let inputAsset = AVURLAsset(url: URL(fileURLWithPath: documensDirectory + (audioMixModel?.localPath ?? "")), options: avAssertOptions)
|
|
// 每次初始化的时候设置初始值 为 nIl
|
|
// 每次初始化的时候设置初始值 为 nIl
|
|
exporter = PQCompositionExporter(asset: inputAsset, videoComposition: nil, audioMix: nil, filters: nil, stickers: mStickers, animationTool: nil, exportURL: outPutMP4URL)
|
|
exporter = PQCompositionExporter(asset: inputAsset, videoComposition: nil, audioMix: nil, filters: nil, stickers: mStickers, animationTool: nil, exportURL: outPutMP4URL)
|
|
|
|
+ exporter.showGaussianBlur = true
|
|
if exporter.prepare(videoSize: CGSize(width: editProjectModel?.sData?.videoMetaData?.videoWidth ?? 0, height: editProjectModel?.sData?.videoMetaData?.videoHeight ?? 0)) {
|
|
if exporter.prepare(videoSize: CGSize(width: editProjectModel?.sData?.videoMetaData?.videoWidth ?? 0, height: editProjectModel?.sData?.videoMetaData?.videoHeight ?? 0)) {
|
|
let playeTimeRange: CMTimeRange = CMTimeRange(start: CMTime(value: CMTimeValue(Int((audioMixModel?.startTime ?? 0) * 600)), timescale: 600), end: CMTime(value: CMTimeValue(Int((audioMixModel?.endTime ?? 0) * 600)), timescale: 600))
|
|
let playeTimeRange: CMTimeRange = CMTimeRange(start: CMTime(value: CMTimeValue(Int((audioMixModel?.startTime ?? 0) * 600)), timescale: 600), end: CMTime(value: CMTimeValue(Int((audioMixModel?.endTime ?? 0) * 600)), timescale: 600))
|
|
BFLog(message: "开始导出 \(String(describing: audioMixModel?.startTime)) 结束 \(String(describing: audioMixModel?.endTime))")
|
|
BFLog(message: "开始导出 \(String(describing: audioMixModel?.startTime)) 结束 \(String(describing: audioMixModel?.endTime))")
|