How to play Videos one after another on a Button Click using AVPlayer.
Asked
Active
Viewed 1,411 times
1 Answers
1
You can use AVQueuePlayer to play multiple videos or play list something like,
AVPlayerItem *itemOne = [AVPlayerItem playerItemWithURL: url1];
AVPlayerItem *itemTwo = [AVPlayerItem playerItemWithURL: url2];
AVQueuePlayer *queuePlayer = [AVQueuePlayer queuePlayerWithItems:[NSArray arrayWithObjects:itemOne, itemTwo, nil]];
[queuePlayer play];
You can add item like while playing,
[queuePlayer insertItem:itemThree afterItem:itemOne];
You can refer Apple documentation that i have mentioned in link for more methods and details.

Ketan Parmar
- 27,092
- 9
- 50
- 75