|
@@ -88,8 +88,17 @@ public class BFRecordScreenController: BFBaseViewController {
|
|
// MARK: 行为参数
|
|
// MARK: 行为参数
|
|
|
|
|
|
var movieIsProcessing = false
|
|
var movieIsProcessing = false
|
|
- var events = [WithDrawModel]() // 行为记录,方便撤销
|
|
|
|
- var isDragingProgressSlder: Bool = false // 是否在拖动进度条
|
|
|
|
|
|
+
|
|
|
|
+ // 行为记录,方便撤销
|
|
|
|
+ var events = [WithDrawModel]() {
|
|
|
|
+ didSet {
|
|
|
|
+ withDrawBtn.isEnabled = (events.count != 0)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // 是否在拖动进度条
|
|
|
|
+ var isDragingProgressSlder: Bool = false
|
|
|
|
+
|
|
var isStopAtRecordRange = -1
|
|
var isStopAtRecordRange = -1
|
|
|
|
|
|
// 保存识别出来的字幕信息,用于回放,和合成使用
|
|
// 保存识别出来的字幕信息,用于回放,和合成使用
|
|
@@ -181,7 +190,8 @@ public class BFRecordScreenController: BFBaseViewController {
|
|
btn.setImage(imageInRecordScreenKit(by: "withdraw_h"), for: .highlighted)
|
|
btn.setImage(imageInRecordScreenKit(by: "withdraw_h"), for: .highlighted)
|
|
btn.setTitle("回退", for: .normal)
|
|
btn.setTitle("回退", for: .normal)
|
|
btn.setTitleColor(.white, for: .normal)
|
|
btn.setTitleColor(.white, for: .normal)
|
|
- btn.setTitleColor(.gray, for: .highlighted)
|
|
|
|
|
|
+ btn.setTitleColor(.lightGray, for: .disabled)
|
|
|
|
+ btn.isEnabled = false
|
|
btn.titleLabel?.font = UIFont.systemFont(ofSize: 12)
|
|
btn.titleLabel?.font = UIFont.systemFont(ofSize: 12)
|
|
btn.contentVerticalAlignment = UIControl.ContentVerticalAlignment.center
|
|
btn.contentVerticalAlignment = UIControl.ContentVerticalAlignment.center
|
|
btn.addTarget(self, action: #selector(withdrawAction), for: .touchUpInside)
|
|
btn.addTarget(self, action: #selector(withdrawAction), for: .touchUpInside)
|
|
@@ -904,7 +914,7 @@ public class BFRecordScreenController: BFBaseViewController {
|
|
collectionView.isScrollEnabled = true
|
|
collectionView.isScrollEnabled = true
|
|
|
|
|
|
recorderManager?.stopRecord(isCancel: false)
|
|
recorderManager?.stopRecord(isCancel: false)
|
|
-
|
|
|
|
|
|
+ changeWithDrawBtnLayout(true)
|
|
if !avatarView.isHidden {
|
|
if !avatarView.isHidden {
|
|
avatarView.endRecord()
|
|
avatarView.endRecord()
|
|
}
|
|
}
|
|
@@ -956,7 +966,7 @@ public class BFRecordScreenController: BFBaseViewController {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} else if action.type == 3 {
|
|
} else if action.type == 3 {
|
|
- // 删除录音
|
|
|
|
|
|
+ // 恢复删除录音
|
|
var tuples = action.deletedVoices
|
|
var tuples = action.deletedVoices
|
|
if tuples != nil, tuples!.count > 0 {
|
|
if tuples != nil, tuples!.count > 0 {
|
|
tuples!.sort { tuple1, tuple2 in
|
|
tuples!.sort { tuple1, tuple2 in
|
|
@@ -977,6 +987,7 @@ public class BFRecordScreenController: BFBaseViewController {
|
|
if itemModels[currItemModelIndex].mediaType == .IMAGE {
|
|
if itemModels[currItemModelIndex].mediaType == .IMAGE {
|
|
itemModels[currItemModelIndex].materialDuraion = itemModels[currItemModelIndex].voiceStickers.last?.endTime ?? 0
|
|
itemModels[currItemModelIndex].materialDuraion = itemModels[currItemModelIndex].voiceStickers.last?.endTime ?? 0
|
|
}
|
|
}
|
|
|
|
+
|
|
} else {}
|
|
} else {}
|
|
events.removeLast()
|
|
events.removeLast()
|
|
|
|
|
|
@@ -997,6 +1008,7 @@ public class BFRecordScreenController: BFBaseViewController {
|
|
changeWithDrawBtnLayout(false)
|
|
changeWithDrawBtnLayout(false)
|
|
}
|
|
}
|
|
searchStopAtRecordRange()
|
|
searchStopAtRecordRange()
|
|
|
|
+ indirectionView?.resetAllSubViews(items: itemModels[currItemModelIndex].voiceStickers, totalDuration: itemModels[currItemModelIndex].materialDuraion)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1378,16 +1390,16 @@ public class BFRecordScreenController: BFBaseViewController {
|
|
|
|
|
|
NotificationCenter.default.addObserver(forName: .AVPlayerItemDidPlayToEndTime, object: assetPlayer?.currentItem, queue: .main) { [weak self] notify in
|
|
NotificationCenter.default.addObserver(forName: .AVPlayerItemDidPlayToEndTime, object: assetPlayer?.currentItem, queue: .main) { [weak self] notify in
|
|
BFLog(1, message: "AVPlayerItemDidPlayToEndTime = \(notify)")
|
|
BFLog(1, message: "AVPlayerItemDidPlayToEndTime = \(notify)")
|
|
- if (self?.currItemModelIndex ?? 0) < ((self?.itemModels.count ?? 0) - 1) {
|
|
|
|
|
|
+// if (self?.currItemModelIndex ?? 0) < ((self?.itemModels.count ?? 0) - 1) {
|
|
// self?.collectionView.setContentOffset(CGPoint(x: CGFloat((self?.currItemModelIndex ?? 0) + 1) * (self?.collectionView.frame.width ?? 0), y: 0), animated: true)
|
|
// self?.collectionView.setContentOffset(CGPoint(x: CGFloat((self?.currItemModelIndex ?? 0) + 1) * (self?.collectionView.frame.width ?? 0), y: 0), animated: true)
|
|
- } else {
|
|
|
|
- self?.isNormalPlaying = false
|
|
|
|
- // self?.assetPlayer?.seek(to: CMTime.zero)
|
|
|
|
- // self?.progressThumV.progress = 0
|
|
|
|
- self?.isEndPlay = true
|
|
|
|
- // self?.currentPlayRecordIndex = -1
|
|
|
|
- self?.recordBtn.isHidden = true
|
|
|
|
- }
|
|
|
|
|
|
+// } else {
|
|
|
|
+// }
|
|
|
|
+ self?.isNormalPlaying = false
|
|
|
|
+ // self?.assetPlayer?.seek(to: CMTime.zero)
|
|
|
|
+ // self?.progressThumV.progress = 0
|
|
|
|
+ self?.isEndPlay = true
|
|
|
|
+ // self?.currentPlayRecordIndex = -1
|
|
|
|
+ self?.recordBtn.isHidden = true
|
|
if self?.isRecording ?? false {
|
|
if self?.isRecording ?? false {
|
|
self?.endRecord()
|
|
self?.endRecord()
|
|
cShowHUB(superView: nil, msg: "此视频已录制到头了哦")
|
|
cShowHUB(superView: nil, msg: "此视频已录制到头了哦")
|