How to detect when AVPlayer video ends playing?
To get the AVPlayerItemDidPlayToEndTimeNotification your object needs to be an AVPlayerItem. To do so, just use the .currentItem property on your AVPlayer Now you will get a notification once the video ends! See my example: let videoPlayer = AVPlayer(URL: url) NSNotificationCenter.defaultCenter().addObserver(self, selector: “playerDidFinishPlaying:”, name: AVPlayerItemDidPlayToEndTimeNotification, object: videoPlayer.currentItem) func playerDidFinishPlaying(note: NSNotification) { print(“Video Finished”) } Swift … Read more