Browse Source

播放完成后 回到推荐点

jsonwang 3 years ago
parent
commit
0d3a644b32
1 changed files with 8 additions and 8 deletions
  1. 8 8
      BFFramework/Classes/Stuckpoint/View/PQSelecteMusicView.swift

+ 8 - 8
BFFramework/Classes/Stuckpoint/View/PQSelecteMusicView.swift

@@ -34,14 +34,14 @@ class PQSelecteMusicView: UIView {
  
     lazy var avPlayer: AVPlayer = {
         let avPlayer = AVPlayer()
-//        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()
-//        }
+        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()
+        }
 //        PQNotification.addObserver(forName: .AVPlayerItemNewErrorLogEntry, object: avPlayer.currentItem, queue: .main) { notify in
 //            BFLog(message: "AVPlayerItemNewErrorLogEntry = \(notify)")
 //        }