|
@@ -8,12 +8,12 @@
|
|
|
|
|
|
import BFCommonKit
|
|
|
import BFMediaKit
|
|
|
+import BFNetRequestKit
|
|
|
import BFUIKit
|
|
|
import Foundation
|
|
|
import GPUImage
|
|
|
import Photos
|
|
|
import UIKit
|
|
|
-import BFNetRequestKit
|
|
|
|
|
|
struct WithDrawModel {
|
|
|
var type: Int // 0:拖动; 1:预览播放暂停 2: 录音结束 3: 删除录音 4: 删除字幕
|
|
@@ -127,7 +127,7 @@ public class BFRecordScreenController: BFBaseViewController {
|
|
|
sself.itemModels[sself.currItemModelIndex].voiceStickers.forEach { _ in
|
|
|
duration = duration + (Double(model.duration ?? "0") ?? 0)
|
|
|
}
|
|
|
- sself.itemModels[sself.currItemModelIndex].materialDuraion = duration
|
|
|
+ sself.itemModels[sself.currItemModelIndex].materialDuraion = Double(String(format: "%.3f", duration)) ?? 0
|
|
|
sself.currentAssetProgress = CMTime(seconds: duration, preferredTimescale: 1000)
|
|
|
model.endTime = sself.currentAssetProgress.seconds
|
|
|
self?.isEndPlay = true
|
|
@@ -478,8 +478,8 @@ public class BFRecordScreenController: BFBaseViewController {
|
|
|
layoutsubview()
|
|
|
|
|
|
view.addSubview(subtitleEditView)
|
|
|
-
|
|
|
- if(!SWNetRequest.isNetReachabled()){
|
|
|
+
|
|
|
+ if !SWNetRequest.isNetReachabled() {
|
|
|
cShowHUB(superView: view, msg: "网络不佳,字幕可能无法生成")
|
|
|
}
|
|
|
}
|
|
@@ -1240,7 +1240,7 @@ public class BFRecordScreenController: BFBaseViewController {
|
|
|
DispatchQueue.main.async { [weak self] in
|
|
|
self?.progreddL.text = String(format: "%@", CMTimeGetSeconds(self!.currentAssetProgress).formatDurationToHMS())
|
|
|
}
|
|
|
- BFLog(message: "progress = \(progress),currentAssetProgress = \(currentAssetProgress)")
|
|
|
+ BFLog(message: "progress = \(progress),currentAssetProgress = \(currentAssetProgress.seconds),materialDuraion = \(itemModels[currItemModelIndex].materialDuraion)")
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -1403,6 +1403,10 @@ public extension BFRecordScreenController {
|
|
|
/// 处理图片音频的播放
|
|
|
func imageRecordPlay() {
|
|
|
if itemModels[currItemModelIndex].mediaType == .IMAGE {
|
|
|
+ if itemModels[currItemModelIndex].materialDuraion <= 0 || currentAssetProgress.seconds >= itemModels[currItemModelIndex].materialDuraion {
|
|
|
+ (collectionView.cellForItem(at: IndexPath(item: currItemModelIndex, section: 0)) as? BFImageCoverViewCell)?.playBtn.isSelected = false
|
|
|
+ return
|
|
|
+ }
|
|
|
isNormalPlaying = true
|
|
|
playRecord(at: currentAssetProgress, periodicTimeObserver: { [weak self] currentT, currentItem in
|
|
|
BFLog(message: "播放一段进度:\(currentT),\(currentItem)")
|