|
@@ -6,6 +6,7 @@
|
|
|
// Copyright © 2019 duowan. All rights reserved.
|
|
|
//
|
|
|
|
|
|
+import DeviceKit
|
|
|
import OJASwiftKit
|
|
|
import UIKit
|
|
|
|
|
@@ -1047,7 +1048,10 @@ fileprivate extension WSSCoolVoiceSubtitleController {
|
|
|
self?.movieWriter?.finishRecording(completionHandler: { [weak self] in
|
|
|
let mixOutputPath: String = kOJSUserCacheDirectory + "/" + "tmp_export_mix_audio_subtitle_video" + ".mp4"
|
|
|
let combineVideo = AVURLAsset(url: outputUrl)
|
|
|
- let presentName = kOJSIsNotchiPhone ? AVAssetExportPresetHighestQuality : WSSMediaOperationTool.resolvePresentName(forVideoAsset: resultVideoAsset)
|
|
|
+ let presentName = WSSMediaOperationTool.resolvePresentName(forVideoAsset: resultVideoAsset)
|
|
|
+
|
|
|
+ WSSSimpleLog("🥞: \(presentName)")
|
|
|
+
|
|
|
self?.setupMixAudioExportDisplayLink()
|
|
|
self?.mixAudioExportSeesion = try? WSSMediaOperationTool.mixAudio(withAudioAsset: audioAsset,
|
|
|
forVideo: combineVideo,
|
|
@@ -1058,6 +1062,8 @@ fileprivate extension WSSCoolVoiceSubtitleController {
|
|
|
exportPath: mixOutputPath,
|
|
|
finish: { [weak self] mixResult in
|
|
|
|
|
|
+ WSSSimpleLog("#字幕合成#: \(mixOutputPath)")
|
|
|
+
|
|
|
// WSSHub.dismissHub()
|
|
|
DispatchQueue.main.async {
|
|
|
hideHud()
|
|
@@ -1103,12 +1109,16 @@ fileprivate extension WSSCoolVoiceSubtitleController {
|
|
|
func refreshSubtitlePaster(isFirst: Bool = false) {
|
|
|
refreshSubtitlePasterData()
|
|
|
|
|
|
- if let firstModel = currentShowingSubtitleInfos.safeObject(atIndex: 0) {
|
|
|
- /// 初始化displayModel
|
|
|
- if let vm = firstModel.fontViewModel {
|
|
|
- textPasterView.changeShowViewModel(vm)
|
|
|
+ if isFirst == false {
|
|
|
+ if let current = self.videoPlayer?.currentSeconds {
|
|
|
+ updatePlayTime(current)
|
|
|
}
|
|
|
+ } else {
|
|
|
+ // 初始化displayModel
|
|
|
+ updatePlayTime(0.0)
|
|
|
+ }
|
|
|
|
|
|
+ if let _ = currentShowingSubtitleInfos.safeObject(atIndex: 0) {
|
|
|
if isFirst {
|
|
|
pasterOverlayView.addSubview(textPasterView)
|
|
|
textPasterView.center = textPasterDefaultCenter
|
|
@@ -1123,8 +1133,8 @@ fileprivate extension WSSCoolVoiceSubtitleController {
|
|
|
}
|
|
|
|
|
|
func createTextPasterInput() {
|
|
|
- let rect = AVMakeRect(aspectRatio: videoSize, insideRect: pasterOverlayView.bounds)
|
|
|
- let placeholer: UIView = UIView(frame: rect)
|
|
|
+ let rect = AVMakeRect(aspectRatio: videoSize, insideRect: kOJSScreenBounds)
|
|
|
+ let placeholer: UIView = UIView(frame: CGRect(origin: CGPoint.zero, size: rect.size))
|
|
|
|
|
|
/// 初始化文字Text
|
|
|
textPasterInfoData.removeAll()
|