Search code examples
iosobjective-cvideo-streamingavplayer

AVPlayer seekToTime never completes


I am using AVPlayer to stream video remotely. Whenever I scrub and use seekToTime it works, and the video plays from the location, however if I do this enough times sequentially then the completion handler of seekToTime never returns with "finished == YES" and is stuck.

Also, when profiling the connections it shows that the buffer never loads again even if seekToTime is called again after that. I can drag the scrubber to the beginning and playback will resume however it is not buffering anymore so it will get stuck in a "buffering" state once the buffer runs out but no buffer will be downloading.

Any ideas what might be wrong?


Solution

  • The problem was with the content distribution network. The streaming url was expiring and then would no longer stream to the player