title: Swift 2 AVPlayer - Play Next video Previous Video
body: <p>I am delving this part more than one day. Please suggest any idea.</p>
  
  <p>I have to accomplish to play video.I have a list of videos. If the user makes it full-screen video, then previous and next player button enable , and play when they click.</p>
  
  <p>Here is my code;</p>
  
  <pre><code>         var commmentQueuePlayer = AVQueuePlayer()
           var items = [AVPlayerItem]()
           if let player = comPlayerControl {
  
              let videoURL: String = "http://cdnapi.kaltura.com/p/11/sp/11/playManifest/entryId/0_6swapj1k/format/applehttp/protocol/http/a.m3u8"
              let firstItemURL: String = "http://cdnapi.kaltura.com/p/11/sp/11/playManifest/entryId/0_2p3957qy/format/applehttp/protocol/http/a.m3u8"
              let secondItemURL: String = "http://cdnapi.kaltura.com/p/11/sp/11/playManifest/entryId/0_buy5xjol/format/applehttp/protocol/http/a.m3u8"
  
  
              let firstItem = AVPlayerItem(URL: NSURL(string: firstItemURL)! )
              let secondItem = AVPlayerItem(URL: NSURL(string: secondItemURL)! )
              let playerItem = AVPlayerItem(URL: NSURL(string: videoURL)! )
  
              items = [firstItem,secondItem,playerItem]
              commmentQueuePlayer = AVQueuePlayer(items: items)
  
              player.player = commmentQueuePlayer
              player.view.frame = videoCell.frame
              player.view.sizeToFit()
              player.showsPlaybackControls = true
              videoCell.addSubview(player.view)
             // comPlayerControl.player?.play()
          }
  </code></pre>
  
  <p>What is happening here is once playing start second one. like a Queue.</p>
  
  <p>Plese let me know is it good to go with AVQueuePlayerController or AVPlayerController.</p>
  
  <p>Please help me anyone.I Google it, unfortunately, I could not get the solution.</p>
  
  <p>I want to know I can trigger Next previous player icon</p>
  
  <p><a href="https://i.stack.imgur.com/06ESJ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/06ESJ.png" alt="enter image description here"></a></p>
  
  <p>Please suggest.</p>