|
@@ -898,7 +898,6 @@ public class BFRecordScreenController: BFBaseViewController {
|
|
|
duration = duration + temp.endCMTime - temp.startCMTime
|
|
|
}
|
|
|
wself.itemModels[wself.currItemModelIndex].materialDuraion = duration
|
|
|
-
|
|
|
}
|
|
|
|
|
|
wself.isEndPlay = true
|
|
@@ -1280,11 +1279,11 @@ public class BFRecordScreenController: BFBaseViewController {
|
|
|
UIApplication.shared.keyWindow?.isUserInteractionEnabled = true
|
|
|
|
|
|
if currentAssetProgress.seconds - (recorderManager?.voiceModel?.startCMTime.seconds ?? 0) > 1.0 {
|
|
|
- recorderManager?.stopRecord(isCancel: false)
|
|
|
} else {
|
|
|
- recorderManager?.stopRecord(isCancel: true)
|
|
|
+// recorderManager?.stopRecord(isCancel: true)
|
|
|
changeProgress(changCMTime: recorderManager?.voiceModel?.startCMTime ?? .zero)
|
|
|
}
|
|
|
+ recorderManager?.stopRecord(isCancel: false)
|
|
|
|
|
|
/*
|
|
|
if currentAssetProgress.seconds - (recorderManager?.voiceModel?.startCMTime.seconds ?? 0 ) >= 1.0 {
|
|
@@ -1396,6 +1395,10 @@ public class BFRecordScreenController: BFBaseViewController {
|
|
|
|
|
|
if itemModels[currItemModelIndex].mediaType == .Image {
|
|
|
itemModels[currItemModelIndex].materialDuraion = model.startCMTime
|
|
|
+ }else if itemModels[currItemModelIndex].mediaType == .Camera {
|
|
|
+ let video = rscmanager.recordItem?.videoStickers.last
|
|
|
+ rscmanager.revertLast()
|
|
|
+ itemModels[currItemModelIndex].materialDuraion = video?.timelineCMIn ?? .zero
|
|
|
}
|
|
|
}
|
|
|
} else if action.type == 3 {
|
|
@@ -1489,6 +1492,7 @@ public class BFRecordScreenController: BFBaseViewController {
|
|
|
vv.backgroundColor = UIColor.init(white: 1, alpha: 0.3)
|
|
|
btn.setImage(vv.graphicsGetImage(), for: .normal)
|
|
|
}
|
|
|
+
|
|
|
@objc func playbtnCancle(btn:UIButton){
|
|
|
btn.setImage(imageInRecordScreenKit(by: "preview_play"), for: .normal)
|
|
|
}
|
|
@@ -1496,11 +1500,12 @@ public class BFRecordScreenController: BFBaseViewController {
|
|
|
@objc public func playVideo(btn: UIButton) {
|
|
|
btn.setImage(imageInRecordScreenKit(by: "preview_play"), for: .normal)
|
|
|
|
|
|
- if itemModels[currItemModelIndex].mediaType == .Image && itemModels[currItemModelIndex].voiceStickers.count <= 0 {
|
|
|
- BFLog(message: "图片没有录音无法播放")
|
|
|
+ if itemModels[currItemModelIndex].mediaType != .Video && itemModels[currItemModelIndex].voiceStickers.count <= 0 {
|
|
|
+ BFLog(message: "图片或摄像头没有录音无法播放")
|
|
|
btn.isSelected = true
|
|
|
return
|
|
|
}
|
|
|
+
|
|
|
btn.isSelected = !btn.isSelected
|
|
|
if !btn.isSelected {
|
|
|
pause()
|
|
@@ -1559,6 +1564,11 @@ public class BFRecordScreenController: BFBaseViewController {
|
|
|
wself.isDragingProgressSlder = true
|
|
|
|
|
|
wself.changeProgress(progress: process)
|
|
|
+
|
|
|
+ if wself.rscurrentManager.recordItem?.mediaType != .Video{
|
|
|
+ wself.recordBtn.isHidden = true
|
|
|
+ wself.deleteRecordBtn.isHidden = false
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
vv.dragEndHandle = { [weak self] process in
|
|
@@ -1590,10 +1600,6 @@ public class BFRecordScreenController: BFBaseViewController {
|
|
|
changeProgress(changCMTime: elems[0].1.endCMTime)
|
|
|
progressThumV.progress = elems[0].1.endCMTime.seconds
|
|
|
|
|
|
-// deleteRecordBtn.isHidden = true
|
|
|
-// recordBtn.isHidden = false
|
|
|
-// isStopAtRecordRange = -1
|
|
|
-// BFLog(1, message: "停在了录音区间外 \(isStopAtRecordRange)")
|
|
|
searchStopAtRecordRange(needAdsorb: false)
|
|
|
return
|
|
|
} else {
|
|
@@ -1898,8 +1904,11 @@ public class BFRecordScreenController: BFBaseViewController {
|
|
|
subtitleBtn.isHidden = false
|
|
|
soundSettingBtn.isHidden = false
|
|
|
withDrawBtn.isHidden = false
|
|
|
- recordBtn.isHidden = (rscurrentManager.recordItem?.mediaType != .Video && isEndPlay) ? false : isEndPlay
|
|
|
- recordBtn.alpha = 1
|
|
|
+// recordBtn.isHidden = (rscurrentManager.recordItem?.mediaType != .Video && isEndPlay) ? false : isEndPlay
|
|
|
+// recordBtn.alpha = 1
|
|
|
+// if !recordBtn.isHidden {
|
|
|
+// deleteRecordBtn.isHidden = true
|
|
|
+// }
|
|
|
|
|
|
assetPlayer.pause()
|
|
|
recordPlayer.pause()
|
|
@@ -2094,20 +2103,32 @@ public class BFRecordScreenController: BFBaseViewController {
|
|
|
assetPlayer.seek(to: currentAssetProgress, toleranceBefore: CMTime(value: 1, timescale: 1_000_000), toleranceAfter: CMTime(value: 1, timescale: 1_000_000)) { _ in
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ if (rscurrentManager.recordItem?.voiceStickers.filter({ model in
|
|
|
+ CMTimeCompare(model.startCMTime, currentAssetProgress) <= 0 && CMTimeCompare(currentAssetProgress, model.endCMTime) < 0
|
|
|
+ })) != nil{
|
|
|
+ recordBtn.isHidden = true
|
|
|
+ }else{
|
|
|
+ recordBtn.isHidden = false
|
|
|
+ }
|
|
|
+
|
|
|
} else {
|
|
|
currentAssetProgress = isBack ? CMTime(seconds: Double(newProgress), preferredTimescale: 1000) : ((progress != -1) ? CMTime(seconds: (Double(newProgress) * itemModels[currItemModelIndex].materialDuraion.seconds), preferredTimescale: 1000) : changCMTime)
|
|
|
if currentAssetProgress.seconds > itemModels[currItemModelIndex].materialDuraion.seconds {
|
|
|
currentAssetProgress = itemModels[currItemModelIndex].materialDuraion
|
|
|
}
|
|
|
DispatchQueue.main.async { [weak self] in
|
|
|
+ guard let wself = self else { return }
|
|
|
+
|
|
|
BFLog(message: "更新录音进度\(#function)- \(self?.currentAssetProgress.seconds ?? 0)")
|
|
|
- self?.progreddL.text = String(format: "%@", CMTimeGetSeconds(self!.currentAssetProgress).formatDurationToHMS())
|
|
|
+ wself.progreddL.text = String(format: "%@", CMTimeGetSeconds(self!.currentAssetProgress).formatDurationToHMS())
|
|
|
}
|
|
|
BFLog(message: "progress = \(progress),currentAssetProgress = \(currentAssetProgress.seconds),materialDuraion = \(itemModels[currItemModelIndex].materialDuraion.seconds)")
|
|
|
|
|
|
// add by ak 图片素材拖动指针时同时更新字幕显现数据
|
|
|
updateSubtitle(time: currentAssetProgress)
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
|
|
|
// 画进度线
|