In which situation is AVPlayerItemFailedToPlayToEndTime posted?

I am trying to play an open ended HLS playlist using AVPlayer. After some time (20-30 minutes), AVPlayerItemFailedToPlayToEndTimeNotification is posted with AVPlayerItemFailedToPlayToEndTimeErrorKey having the value as


Error Domain=AVFoundationErrorDomain Code=-11800 "The operation could not be completed"

UserInfo=\{NSLocalizedFailureReason=An unknown error occurred (-16011), NSLocalizedDescription=The operation could not be completed


When this gets posted, the playback stops. The documentation is very vague regarding AVPlayerItemFailedToPlayToEndTimeNotification and the error code is generic too.

I thought that maybe it is because of poor network connection, but I would have expected AVPlayerItemPlaybackStalled to be called prior to

AVPlayerItemFailedToPlayToEndTimeNotification and that's not the case.


Some AVPlayerItemErrorLogEvents are posted before:

VIDEOPLAYER: PLAYER ITEM NEW ERROR EVENT, errorCode: -12889\

description: <AVPlayerItemErrorLogEvent: 0x280bd4160>\

domain: CoreMediaErrorDomain\

uri :Optional("http://192.168.0.59:49152/session-streaming/3146389165/subtitles/0/2A0")\


Does anyone have more insight about situation when AVPlayerItemFailedToPlayToEndTimeNotification is posted?

Could it be that there are too many error logs events posted and eventually the player posts the AVPlayerItemFailedToPlayToEndTimeNotification?