|
@@ -31,7 +31,7 @@ public class BFRecordScreenController: BFBaseViewController {
|
|
public var closeActionHandle: (() -> Void)?
|
|
public var closeActionHandle: (() -> Void)?
|
|
public var changeItemHandle: ((_ index: Int) -> Void)?
|
|
public var changeItemHandle: ((_ index: Int) -> Void)?
|
|
// 当前录制结束的上报
|
|
// 当前录制结束的上报
|
|
- public var recordRndHandle: ((_ currentRecord: PQVoiceModel?) -> Void)?
|
|
|
|
|
|
+ public var recordEndHandle: ((_ currentRecord: PQVoiceModel?) -> Void)?
|
|
// 字幕按钮点击上报
|
|
// 字幕按钮点击上报
|
|
public var subTitleBtnClickHandle: ((_ isOn: Bool) -> Void)?
|
|
public var subTitleBtnClickHandle: ((_ isOn: Bool) -> Void)?
|
|
|
|
|
|
@@ -583,6 +583,8 @@ public class BFRecordScreenController: BFBaseViewController {
|
|
|
|
|
|
BFLog(1, message: "添加录音文件:\(model.startCMTime.seconds) -- \(model.endCMTime.seconds)")
|
|
BFLog(1, message: "添加录音文件:\(model.startCMTime.seconds) -- \(model.endCMTime.seconds)")
|
|
sself.itemModels[sself.currItemModelIndex].voiceStickers.append(model)
|
|
sself.itemModels[sself.currItemModelIndex].voiceStickers.append(model)
|
|
|
|
+ // 录制结束回调
|
|
|
|
+ self?.recordEndHandle?(model)
|
|
// 如果是图片素材同时有需要删除的录音时需要调整录音文件开始结束时间
|
|
// 如果是图片素材同时有需要删除的录音时需要调整录音文件开始结束时间
|
|
// warning: 图片录制的时候应该只能在结尾处录制
|
|
// warning: 图片录制的时候应该只能在结尾处录制
|
|
if sself.itemModels[sself.currItemModelIndex].mediaType == .IMAGE {
|
|
if sself.itemModels[sself.currItemModelIndex].mediaType == .IMAGE {
|
|
@@ -1124,13 +1126,6 @@ public class BFRecordScreenController: BFBaseViewController {
|
|
if !avatarView.isHidden {
|
|
if !avatarView.isHidden {
|
|
avatarView.endRecord()
|
|
avatarView.endRecord()
|
|
}
|
|
}
|
|
- //add by ak 添加统计
|
|
|
|
- if let model = itemModels[currItemModelIndex].voiceStickers.last
|
|
|
|
- {
|
|
|
|
- recordRndHandle?(model)
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
-//
|
|
|
|
}
|
|
}
|
|
|
|
|
|
@objc func cancleRecord() {
|
|
@objc func cancleRecord() {
|
|
@@ -1145,6 +1140,8 @@ public class BFRecordScreenController: BFBaseViewController {
|
|
/// 不足一秒,主动取消录制
|
|
/// 不足一秒,主动取消录制
|
|
/// - Parameter voiceModel: <#voiceModel description#>
|
|
/// - Parameter voiceModel: <#voiceModel description#>
|
|
@objc func recordManagerCancelRecord(voiceModel: PQVoiceModel?) {
|
|
@objc func recordManagerCancelRecord(voiceModel: PQVoiceModel?) {
|
|
|
|
+ // 录制结束回调
|
|
|
|
+ recordEndHandle?(voiceModel)
|
|
BFLog(3, message: "开始录制-取消:currentAssetProgress=\(currentAssetProgress.seconds),cuInde=\(currItemModelIndex),currIndex=\(voiceModel?.currIndex ?? 0),\(String(describing: voiceModel)),\(String(describing: recorderManager?.voiceModel))")
|
|
BFLog(3, message: "开始录制-取消:currentAssetProgress=\(currentAssetProgress.seconds),cuInde=\(currItemModelIndex),currIndex=\(voiceModel?.currIndex ?? 0),\(String(describing: voiceModel)),\(String(describing: recorderManager?.voiceModel))")
|
|
if voiceModel != nil, currentAssetProgress.seconds - (recorderManager?.voiceModel?.startCMTime.seconds ?? 0) < 1.0 {
|
|
if voiceModel != nil, currentAssetProgress.seconds - (recorderManager?.voiceModel?.startCMTime.seconds ?? 0) < 1.0 {
|
|
cShowHUB(superView: nil, msg: "最短录制1秒")
|
|
cShowHUB(superView: nil, msg: "最短录制1秒")
|