Based on your question and Ramis comment / code, I made an example code that you can try
As mentioned by JAL, a contentOverlayView should be the best option for displaying the contentOverlayView video control in the AVPlayerController , but according to my demo contentOverlayView has no user interaction for buttons or other controls, as if you AVTouchIgnoringView in the 3D view, the AVPlayerController has AVTouchIgnoringView / UIView before contentOverlayView which may be a problem when the user interacts with contentOverlayView .
So another solution is to add an overlay view to the AVPlayerViewController
func addContentOverlayView() { OverlayView.frame = CGRectMake(0,30,AVPlayerVC.view.bounds.width, 100) OverlayView.hidden = true OverlayView.backgroundColor = UIColor ( red: 0.5, green: 0.5, blue: 0.5, alpha: 0.379 ) let btnNext = UIButton(frame:CGRectMake(AVPlayerVC.view.bounds.width - 60,0,60,44)) btnNext.setTitle(">>", forState:.Normal) btnNext.addTarget(self, action:"playNext", forControlEvents:.TouchUpInside) // btnNext.layer.borderColor = UIColor ( red: 0.0, green: 0.0, blue: 1.0, alpha: 0.670476140202703 ).CGColor // btnNext.layer.borderWidth = 1.0 OverlayView.addSubview(btnNext) let btnReplay = UIButton(frame:CGRectMake((AVPlayerVC.view.bounds.width/2)-40,0,80,44)) btnReplay.setTitle("Replay", forState:.Normal) btnReplay.addTarget(self, action:"replayVideo", forControlEvents:.TouchUpInside) OverlayView.addSubview(btnReplay) let btnPrevious = UIButton(frame:CGRectMake(0,0,80,44)) btnPrevious.setTitle("<<", forState:.Normal) btnPrevious.addTarget(self, action:"previousVideo", forControlEvents:.TouchUpInside) OverlayView.addSubview(btnPrevious) let btnComment = UIButton(frame:CGRectMake((AVPlayerVC.view.bounds.width/2)-70,40,140,44)) btnComment.setTitle("Comments", forState:.Normal) btnComment.addTarget(self, action:"openComments", forControlEvents:.TouchUpInside) OverlayView.addSubview(btnComment) AVPlayerVC.view.addSubview(OverlayView); } func playNext() { prevItem = AVPlayerVC.player?.currentItem OverlayView.hidden = true commmentQueuePlayer.advanceToNextItem() } func replayVideo() { OverlayView.hidden = true AVPlayerVC.player?.currentItem?.seekToTime(kCMTimeZero) AVPlayerVC.player?.play() } func previousVideo() { OverlayView.hidden = true if prevItem != AVPlayerVC.player?.currentItem { if (commmentQueuePlayer.canInsertItem(prevItem!, afterItem:AVPlayerVC.player?.currentItem)) { //commmentQueuePlayer.insertItem(prevItem!, afterItem:AVPlayerVC.player?.currentItem) commmentQueuePlayer.replaceCurrentItemWithPlayerItem(prevItem) prevItem = AVPlayerVC.player?.currentItem replayVideo() } } else { replayVideo() //Else display alert no prev video found } } func stopedPlaying() { if prevItem == nil { prevItem = AVPlayerVC.player?.currentItem } OverlayView.hidden = false }
In the initial setup, we set AVPlayerController, AVQueuePlayer, etc ... at that time we can add an overlay to AVPlayerController
There is no direct availability for the previous item, and according to the documentation, the item will replaceCurrentItemWithPlayerItem insertItem(item: AVPlayerItem, afterItem: AVPlayerItem?) next item, so we have two parameters, for example replaceCurrentItemWithPlayerItem or insertItem(item: AVPlayerItem, afterItem: AVPlayerItem?)
If you need to check the complete code, you can check it at : https://gist.github.com/Pyrolr/debb4fca8f608b1300e099a5b3547031
Note. This is similar to the prototype, it does not work perfectly in all cases, but it can help you understand the basic functionalities that you need, and you can improve / optimize them according to your requirements.