4

I am using AVQueuePlayer to play my list of videos. I want to play one video continuously unless I call for second video to play. Now, Video1 plays and when it ends, calls for video2 to play which I don't like.

Secondly, there is a delay in between two videos. Is there any way of smooth transition from 1 video to second one?

1 Answers1

4

Regarding your first question: Set the AVQueuePlayer's actionAtItemEnd property to AVPlayerActionAtItemEndNone. Then register for AVPlayerItemDidPlayToEndTimeNotification and inside the function that treats this notification call [player seekToTime:kCMTimeZero], which plays your current video from the beginning.
Second question: You could take care of this case inside the above function also.

pablasso
  • 2,479
  • 2
  • 26
  • 32
tephe
  • 182
  • 11
  • this is the good solution and solve my one problem . but when I play the video in this manner and load view by push and pop then after loading 4 time at 5th time the video can not load, I have check that the AVQueuePlayer object is also getting release and the memory also get free but still have problem and you please provide me the solution for this problem. Thanks – Crazy Developer Apr 25 '11 at 06:51
  • This works for repeating an audio file however its not smooth. – malhal Aug 03 '15 at 15:28