0

Is there any other way to check whether an AVPlayerItem has ended except with NotificationCenter.default.addObserver(self, selector: #selector(hasEnded), name: .AVPlayerItemDidPlayToEndTime, object: player.currentItem)? I am asking because when an item finishes it triggers the function and I seek the item to 0. Afterwards when it finishes for a second time it doesn't want to enter the hasEnded method for a second time on this item. If there is a way to fix this method I would be happy to learn it. I tried with NotificationCenter.default.publisher() as well.

0 Answers0