|
@@ -443,6 +443,7 @@ public class BFRecordScreenController: BFBaseViewController {
|
|
|
|
|
|
self?.setSubtitleStyle(settingModel: subtitileModel.setting)
|
|
|
}
|
|
|
+ //编辑字幕完成
|
|
|
subtitleEditView.editSubtitleDone = { [weak self] newtext, index in
|
|
|
// 1,刷新 UI
|
|
|
self?.subtitleLabel.text = newtext
|
|
@@ -451,7 +452,16 @@ public class BFRecordScreenController: BFBaseViewController {
|
|
|
|
|
|
// 更新缓存数据
|
|
|
if index < (self?.itemModels[self?.currItemModelIndex ?? 0].titleStickers.count ?? 0) {
|
|
|
- self?.itemModels[self?.currItemModelIndex ?? 0].titleStickers[index].text = newtext
|
|
|
+
|
|
|
+ if(newtext.count == 0){
|
|
|
+ //删除数据
|
|
|
+ BFLog(message: "清空字幕操作要删除原字幕 sticker 数据")
|
|
|
+ self?.itemModels[self?.currItemModelIndex ?? 0].titleStickers.remove(at: index)
|
|
|
+ }else{
|
|
|
+ //更新数据
|
|
|
+ self?.itemModels[self?.currItemModelIndex ?? 0].titleStickers[index].text = newtext
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -461,10 +471,16 @@ public class BFRecordScreenController: BFBaseViewController {
|
|
|
}
|
|
|
|
|
|
@objc func editSubtitle() {
|
|
|
+
|
|
|
BFLog(message: "编辑字幕 index:\(showSubtitleIndex)")
|
|
|
- subtitleEditView.isHidden = false
|
|
|
- subtitleEditView.textView.becomeFirstResponder()
|
|
|
- subtitleEditView.setNewText(text: subtitleLabel.text ?? "", index: showSubtitleIndex)
|
|
|
+ if(!isNormalPlaying){
|
|
|
+ subtitleEditView.isHidden = false
|
|
|
+ subtitleEditView.textView.becomeFirstResponder()
|
|
|
+ subtitleEditView.setNewText(text: subtitleLabel.text ?? "", index: showSubtitleIndex)
|
|
|
+ }else{
|
|
|
+ BFLog(message: "播放状态不可以编辑字幕")
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
/// 更新字幕,在回放时使用
|