is there no "next video" button in AVPlayerViewController?

I'm writing an app that can play back HLS streams.


Some of our content is episodic television. So, if the user starts watching Episode 1 and finishes, they'll probably want to watch Episode 2.


I'm using AVPlayerViewController as the container to play back the videos. It works fine, and has just the right controls that I need. When the video got near the end, I'd handle the notification that got fired, and play the next video.


And then I discovered AVQueuePlayer. OK, this looks like what I want. I can add in multiple AVPlayerItems (each reprenenting one TV episode), and then set that to AVPlayerViewController. My expectation here was that since I'm sending in an AVQueuePlayer (with multiple items) that the AVPlayerViewController would provide a next button of some sort. So, if I'm mostly through Episode 1, I could hit a button and immediately start playing Episode 2. I don't see any way to configure this... I just figured that AVPlayerViewController would notice a queue, and adjust it's playback-controls accordingly.


So, the question is -- is there such a thing as a "next" button, and is there a way to show it?

Replies

Have you looked at AVPlayerViewController's "skippingBehavior" property and the associated AVPlayerViewControllerDelegate methods?

Ah, OK.


Well, that's good to know for tvOS, but not available in iOS. I guess I should've mentioned that in the ticket, sorry.


In iOS ... what I really want is a "next episode" button... but that shows up when all of the other controls show up, when the user taps on the screen. I thought that creating an AVQueuePlayer and wiring it to an AVPlayerViewController would've solved that for me.


The reason I was asking about this is because I want to add in one, single button to an AVPlayerViewController, and I can't. Yes, I know about the contentOverlayView, which kinda satisfies this... but I really wish that view would show/hide with all the other controls. Because that would be awesome, and exactly what I want. Oh well. 😟

Sorry, I thought I checked that the API was iOS too, but I must have been looking at something else.


Bringing this behavior to iOS sounds like a great enhancement to ask for, via the bug reporting system.