Kaynağa Gözat

字幕默认不显示第一项,按时间来显示

zhongbaojian 5 yıl önce
ebeveyn
işleme
6687c3e2c2

+ 9 - 5
SuperShow/UI/CoolVoice/WSSCoolVoiceSubtitleController.swift

@@ -1103,12 +1103,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,7 +1127,7 @@ fileprivate extension WSSCoolVoiceSubtitleController {
     }
 
     func createTextPasterInput() {
-        let rect = AVMakeRect(aspectRatio: videoSize, insideRect: pasterOverlayView.bounds)
+        let rect = AVMakeRect(aspectRatio: videoSize, insideRect: kOJSScreenBounds)
         let placeholer: UIView = UIView(frame: rect)
 
         /// 初始化文字Text