The Problem
I am using an AVPlayerLooper
to replay an HTTP Live Streaming video indefinitely. The video replays perfectly for the first three loops. But on the fourth loop and all loops thereafter, the video "hiccups." In other words, when the video is near its end time, the video flashes, plays the last few frames for about a second, then flashes again and restarts. This also leads to the notification AVPlayerItemDidPlayToEndTime
being called twice and the playerLooper.loopCount
being incremented with each call.
How can I stop my videos from hiccuping?
Additional Information:
- Only some of my videos have this problem. Others work seamlessly.
- The AVPlayerLooper is designed to allow for seamless looping of HTTP Live Streaming videos. It works by making three copies of the provided template
AVPlayerItem
and plays them in succession using anAVQueuePlayer
(also provided) following what is referred to as the "treadmill pattern". It seems that after each item copy is played once we run into the problem above.