3
votes

this is my first question, but I've readed StackOverflow for years. Well the thing is that I must concatenate a set of videos (MP4) in a particular order, and the last one must loop continuously. Okay, let's try AVFoundation.

I've defined all the elements such as AVComposition, AVURLAsset and AVPlayerItem. Then I build the AVPlayer and the AVPlayerLayer. Everything is okay and the videos are played in the correct order but... (and here comes the problem)

I can note a tiny flick when the AVPlayer passes from one video to the next one. I can ignore that one, but when AVPlayer reaches AVPlayerItem's end, and the selector is called for AVPlayerItemDidPlayToEndTimeNotification, I use seekToTime to move the reading head to the correct and then play it again. Works fine, but a GREAT flick is repeated when using seekToTime and playing again. I cannot allow that.

Does anybody know how to repeat the last asset on AVPlayerItem continuously and without flicks?

Thank you all.

1

1 Answers

4
votes

Absolutely stupid,

Friends, when making video manipulation apps be sure that the videos don't have annoying black frames. That was the root of all problems. [AVPlayer seekToTime:] works perfectly.

Thanks for your time and patience