Next and previous default video controls with AVPlayerViewController - AVQueuePlayer not working

I have a list of songs to play in an AVPlayerViewController, so I am using AVQueuePlayer to play it. All songs are stored in the kit.


Now on the default screen I get the following functions:

  • Play / Pause
  • Automatically switch to the next video after completing the previous one
  • Fast forward the current video ('→ |')
  • Fast backward current video ('| <<')


What is not required should :

  • Previous functionality with provided '| <<to go to the previous video.
  • The following functionality with the provided "→ |" to go to the next video.


This I have done so far -

var arrAVPlayerItems = [AVPlayerItem]()
     for i in 1...4 {
         let fileURL = Bundle.main.url(forResource: "sample-\(i)", withExtension: "mp4")
         arrAVPlayerItems.append(AVPlayerItem(url: fileURL!))
     }
     let player = AVQueuePlayer(items: arrAVPlayerItems)
     playerViewController = AVPlayerViewController()
     playerViewController.player = player
     playerViewController.showsPlaybackControls = true

      


The situation here is that I will only have to use the default controls and not create my own.
Thanks in advance.

+3
ios avplayer avqueueplayer avplayerviewcontroller


source to share


No one has answered this question yet

Check out similar questions:

12
Move to previous AVPlayerItem on AVQueuePlayer / Play selected item from queue
7
How to get out of full screen mode in AVPlayerViewController in iOS9
6
AVPlayerViewController black screen when scrolling on iOS 11
five
AVQueuePlayer starting with next element too early
five
AVPlayerViewController Playback control Rewind / Fast forward does not work
4
Controlling pre-buffering of items in avqueueplayer
1
AVPlayer controls not working as expected
1
Set video size with AVPlayerViewController
1
AVPlayerViewController does not play video and does not show Quicktime logo
0
Reinitializing AVQueuePlayer without being tied to creating a new AVPlayerLayer



All Articles
Loading...
X
Show
Funny
Dev
Pics