问题
I am observing the following Notification to know when my HLS stream in AVPlayer has been played until the end:[[NSNotificationCenter defaultCenter]
addObserver:self
selector:@selector(didPlayToEnd:)
name:AVPlayerItemDidPlayToEndTimeNotification
object:_player.currentItem];
This works fine when playing inside the app but when I stream via AirPlay, the notification is not sent. On my Apple TV it looks like the video has played up until shortly before the end of the video and then paused.
So my questions are:
Does the external stream really pause before the actual end of the video?
If so, how can I get notified when the external stream reaches that point?
If not, do I have to change sth in the Notification code to make it work with AirPlay?
来源:https://stackoverflow.com/questions/26365372/avplayer-not-finishing-when-streaming-via-airplay