jsonwang 3 лет назад
Родитель
Сommit
a7006cccea
1 измененных файлов с 3 добавлено и 1 удалено
  1. 3 1
      Introduce/Record/INVideoExportController.swift

+ 3 - 1
Introduce/Record/INVideoExportController.swift

@@ -47,7 +47,9 @@ class INVideoExportController: BFBaseViewController {
         avplayerTimeObserver = avplayer.addPeriodicTimeObserver(forInterval: CMTime(value: 1, timescale: 100), queue: DispatchQueue.global()) {[weak self, weak avplayer] time in
          //    进度监控
             if let item = avplayer?.currentItem {
-                self?.progreddL.text = String(format: "%.2f / %.2f", CMTimeGetSeconds(time), CMTimeGetSeconds(item.duration))
+                DispatchQueue.main.async { [weak self] in
+                    self?.progreddL.text = String(format: "%.2f / %.2f", CMTimeGetSeconds(time), CMTimeGetSeconds(item.duration))
+                }
                 
             }
         } as? NSKeyValueObservation