瀏覽代碼

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

zhongbaojian 5 年之前
父節點
當前提交
6687c3e2c2
共有 1 個文件被更改,包括 9 次插入5 次删除
  1. 9 5
      SuperShow/UI/CoolVoice/WSSCoolVoiceSubtitleController.swift

+ 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