 
         // Do any additional setup after loading the view.
         configTimeObserver()
+        configNotifications()
     }
 
     override open func didReceiveMemoryWarning() {

import AVFoundation

public typealias KeyframePickerVideoPlayerProgressHandler = (CMTime) -> Void

open class KeyframePickerVideoPlayerController: UIViewController {
    //MARK: - Public Properties
    public var asset: AVAsset?
    public var progressHandler: KeyframePickerVideoPlayerProgressHandler?
    
    //MARK: - Private Properties
    private lazy var _videoView: KeyframePickerVideoPlayerView = {

                                                            queue: DispatchQueue.main,
                                                            using: progressHandler)
        }
    }
    
    private func configNotifications() {
        //添加播放完成和播放失败通知
        NotificationCenter.default.addObserver(self, selector: #selector(didPlayToEndTime), name: Notification.Name.AVPlayerItemDidPlayToEndTime, object: nil)
        NotificationCenter.default.addObserver(self, selector: #selector(failedToPlayToEndTime), name: Notification.Name.AVPlayerItemFailedToPlayToEndTime, object: nil)
    }
    
    //MARK: - Notification Methods
    @objc private func didPlayToEndTime() {
        didPlayToEndTimeHandler?()
    }
    
    @objc private func failedToPlayToEndTime() {
        failedToPlayToEndTimeHandler?()
    }
}

