I am delving this part more than one day. Please suggest any idea.
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.
Here is my 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()
}
What is happening here is once playing start second one. like a Queue.
Plese let me know is it good to go with AVQueuePlayerController or AVPlayerController.
Please help me anyone.I Google it, unfortunately, I could not get the solution.
I want to know I can trigger Next previous player icon
Please suggest.