AVPlayer not finishing when streaming via AirPlay

▼魔方 西西 提交于 2019-12-21 20:00:18

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!