Browse Source

合成完毕切换刷新时长

harry 3 years ago
parent
commit
15f50646a9
1 changed files with 6 additions and 4 deletions
  1. 6 4
      Introduce/Record/INVideoExportController.swift

+ 6 - 4
Introduce/Record/INVideoExportController.swift

@@ -452,9 +452,10 @@ class INVideoExportController: BFBaseViewController {
             avplayer.pause()
             let item = AVPlayerItem(url: saveAllUlr)
             avplayer.replaceCurrentItem(with: item)
-            if let btn = sliderView?.viewWithTag(1) as? UIButton {
-                btn.isSelected = false
+            if let sbtn = sliderView?.viewWithTag(1) as? UIButton {
+                sbtn.isSelected = false
                 avplayer.play()
+                sliderView?.duration = avplayer.currentItem?.asset.duration.seconds ?? 0
             }
         }
     }
@@ -472,9 +473,10 @@ class INVideoExportController: BFBaseViewController {
             avplayer.pause()
             let item = AVPlayerItem(url: saveOnlyUlr)
             avplayer.replaceCurrentItem(with: item)
-            if let btn = sliderView?.viewWithTag(1) as? UIButton {
-                btn.isSelected = false
+            if let sbtn = sliderView?.viewWithTag(1) as? UIButton {
+                sbtn.isSelected = false
                 avplayer.play()
+                sliderView?.duration = avplayer.currentItem?.asset.duration.seconds ?? 0
             }
         }
     }