neekeetab / CachingPlayerItem

Play and cache media content simultaneously on your iOS device
MIT License
520 stars 89 forks source link

Determine when end is reached, play complete? #26

Closed smhk closed 4 years ago

smhk commented 4 years ago

Regarding playback complete,

the amazing CachingPlayerItemDelegate does not have a "playback has reached end" concept

CachingPlayerItem is incredible - is there an easy way to add a "playback complete" concept?

With "old" style code, we use something like

        NotificationCenter.default.addObserver(
            self,
            selector: #selector(fileComplete),
            name: NSNotification.Name.AVPlayerItemDidPlayToEndTime,
            object: nil)

Is there a better way when using the amazing CachingPlayerItem ? Thanks

neekeetab commented 4 years ago

CachingPlayerItem is essentially AVPlayerItem but with a custom loader, so determining the end of the playback is the same as for AVPlayerItem

smhk commented 4 years ago

OK! Done, thanks! Fantastic lib.