|
@@ -438,7 +438,7 @@ public class BFRecordScreenController: BFBaseViewController {
|
|
|
// add by ak 取 nsl token
|
|
|
BFRecordScreenViewModel.getNlsAccessToken { [weak self] token, appkey in
|
|
|
BFLog(message: "nls appkey is \(appkey), token is \(token)")
|
|
|
- self?.speechTranscriberUtil = PQSpeechTranscriberUtil(token, appid: appkey)
|
|
|
+// self?.speechTranscriberUtil = PQSpeechTranscriberUtil(token, appid: appkey)
|
|
|
}
|
|
|
|
|
|
view.backgroundColor = .black
|
|
@@ -743,9 +743,7 @@ public class BFRecordScreenController: BFBaseViewController {
|
|
|
itemModels[currItemModelIndex].voiceStickers.remove(at: isStopAtRecordRange)
|
|
|
events.append(WithDrawModel(type: 3, timestamp: currentAssetProgress.seconds, deletedVoices: [(model, isStopAtRecordRange)]))
|
|
|
indirectionView?.deleteItem(index: isStopAtRecordRange)
|
|
|
-// drawOrUpdateRecordProgessLable()
|
|
|
searchStopAtRecordRange()
|
|
|
-
|
|
|
deleteTitles(voiceModel: model)
|
|
|
}
|
|
|
}
|
|
@@ -907,8 +905,6 @@ public class BFRecordScreenController: BFBaseViewController {
|
|
|
itemModels[currItemModelIndex].titleStickers.insert(titleTuple.0, at: titleTuple.1)
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
-// drawOrUpdateRecordProgessLable()
|
|
|
} else {}
|
|
|
events.removeLast()
|
|
|
let dur = itemModels[currItemModelIndex].materialDuraion
|
|
@@ -1312,10 +1308,10 @@ public class BFRecordScreenController: BFBaseViewController {
|
|
|
DispatchQueue.main.async { [weak self] in
|
|
|
self?.progreddL.text = String(format: "%@", CMTimeGetSeconds(time).formatDurationToHMS())
|
|
|
let su = !(self?.isDragingProgressSlder ?? false) || (self?.isRecording ?? false ) || (self?.isNormalPlaying ?? false)
|
|
|
-// BFLog(1, message: "进度监控:isDragingProgressSlder-\(self?.isDragingProgressSlder ?? false), isRecording - \(self?.isRecording ?? false), isNormalPlaying - \(self?.isNormalPlaying ?? false), su - \(su)")
|
|
|
if su {
|
|
|
self?.progressThumV.progress = time.seconds
|
|
|
}
|
|
|
+ // 更新字幕
|
|
|
self?.updateSubtitle(time: time)
|
|
|
}
|
|
|
}
|
|
@@ -1373,34 +1369,6 @@ public class BFRecordScreenController: BFBaseViewController {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- func drawOrUpdateRecordProgessLable() {
|
|
|
- DispatchQueue.main.async { [weak self] in
|
|
|
- guard let sself = self else {
|
|
|
- return
|
|
|
- }
|
|
|
-
|
|
|
- sself.progressThumV.progessIndicateBackV.subviews.forEach { vv in
|
|
|
- vv.removeFromSuperview()
|
|
|
- }
|
|
|
- let totalDur = sself.itemModels[sself.currItemModelIndex].materialDuraion
|
|
|
- let height = sself.progressThumV.progessIndicateBackV.height
|
|
|
- if sself.itemModels[sself.currItemModelIndex].mediaType == .VIDEO {
|
|
|
- if totalDur > 0, sself.itemModels[sself.currItemModelIndex].voiceStickers.count > 0 {
|
|
|
- let width = sself.progressThumV.progessIndicateBackV.width
|
|
|
- sself.itemModels[sself.currItemModelIndex].voiceStickers.forEach { model in
|
|
|
- let lineV = UIView(frame: CGRect(x: model.startTime * Double(width) / totalDur, y: 0, width: (model.endTime - model.startTime) * Double(width) / totalDur, height: Double(height)))
|
|
|
- lineV.backgroundColor = ThemeStyleColor
|
|
|
- sself.progressThumV.progessIndicateBackV.addSubview(lineV)
|
|
|
- }
|
|
|
- }
|
|
|
- } else {
|
|
|
- let lineV = UIView(frame: CGRect(x: 0, y: 0, width: totalDur * sself.progressThumV.thumbImageWidth / 2, height: Double(height)))
|
|
|
- lineV.backgroundColor = ThemeStyleColor
|
|
|
- sself.progressThumV.progessIndicateBackV.addSubview(lineV)
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
extension BFRecordScreenController: GPUImageMovieDelegate {
|
|
@@ -1550,10 +1518,8 @@ extension BFRecordScreenController: UICollectionViewDelegate, UICollectionViewDa
|
|
|
if let cell = collectionView.visibleCells.first as? BFImageCoverViewCell{
|
|
|
playBtn = cell.playBtn
|
|
|
}
|
|
|
-
|
|
|
// 更新当前page
|
|
|
currItemModelIndex = page
|
|
|
-// drawOrUpdateRecordProgessLable()
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -1580,6 +1546,8 @@ public extension BFRecordScreenController {
|
|
|
playRecord(at: currentAssetProgress, periodicTimeObserver: { [weak self] currentT, currentItem in
|
|
|
BFLog(message: "播放一段进度:\(currentT),\(currentItem)")
|
|
|
self?.imageRecordProgress(progress: CMTimeGetSeconds(currentT) / 2)
|
|
|
+ // 更新字幕
|
|
|
+ self?.updateSubtitle(time: currentT)
|
|
|
}, didPlayToEndTime: { [weak self] recordedAudio, currentItem in
|
|
|
BFLog(message: "播放一段结束:\(String(describing: recordedAudio)),\(String(describing: currentItem))")
|
|
|
if (recordedAudio?.endTime ?? 0) >= (self?.itemModels[self?.currItemModelIndex ?? 0].voiceStickers.last?.endTime ?? 0) {
|