在视频结束后,我使用这段代码做了一些事情。
NotificationCenter.default.addObserver(self, selector: #selector(stopedPlaying), name: NSNotification.Name.AVPlayerItemDidPlayToEndTime, object: nil)这是与mp4视频一起工作的。但是因为它们超过10分钟,所以我开始使用m3u8格式。但是这部分代码不再工作了。任何想法都将不胜感激。
发布于 2016-12-02 14:14:15
您必须添加您应该观察其更改的对象。尝试添加如下代码中的playerItem对象。
NSNotificationCenter.defaultCenter().addObserver(self, selector: #selector(stopedPlaying),
name: AVPlayerItemDidPlayToEndTimeNotification,
object: destination.player!.currentItem)https://stackoverflow.com/questions/40914026
复制相似问题