Explorar o código

播放状态才刷新 UI 状态到暂停

jsonwang %!s(int64=3) %!d(string=hai) anos
pai
achega
9defa7eb04

+ 6 - 4
BFFramework/Classes/Stuckpoint/View/PQSelecteMusicView.swift

@@ -40,10 +40,12 @@ class PQSelecteMusicView: UIView {
         PQNotification.addObserver(forName: .AVPlayerItemDidPlayToEndTime, object: avPlayer.currentItem, queue: .main) { [weak self] notify in
             BFLog(message: "AVPlayerItemDidPlayToEndTime = \(notify)")
             avPlayer.seek(to: CMTime(value: CMTimeValue((self?.currentPlayData?.startTime ?? 0) * 1000), timescale: CMTimeScale(playerTimescale)))
- 
-            self?.currentPlayData?.voiceStatue = .isPause
-
-            self?.selectMusicCollection.reloadData()
+            
+            if(self?.currentPlayData?.voiceStatue == .isPlaying){
+                self?.currentPlayData?.voiceStatue = .isPause
+                self?.selectMusicCollection.reloadData()
+            }
+           
         }
 //        PQNotification.addObserver(forName: .AVPlayerItemNewErrorLogEntry, object: avPlayer.currentItem, queue: .main) { notify in
 //            BFLog(message: "AVPlayerItemNewErrorLogEntry = \(notify)")