tvOS Interactive Overlay in AVPlayerViewController With Swift

Hi there,


According to the tvOS Human Interface Guidelines, it mentions "Some videos display interactive overlays, such as quizzes, surveys, and progress check-ins" under the Video section. From my understanding, it seems we can use AVPlayerViewController to present an interactive overlay?


However, the contentOverlayView property in AVPlayerViewController doesn't support user interaction. And I couldn't find anything from the documents/web/forums regarding to this topic. I knew that I could implement this by using AVPlayer with a custom view controller, but that would also mean I will lose the built-in playback controls, which I don't reall want to.


So wondering if adding an interactive overlay to AVPlayerViewController is actually possible (I'm using Swift)?


Regards,

Answered by svarrall in 101786022

I would think you would need to control the views and overlays yourself rather than relying on the contentOverlayView.


You can use an AVPlayerViewController within another view controller, and it has the inbuilt playback controls as long as it's size is the size of the screen. Anything less than fullscreen and it will hide the controls automatically.

Accepted Answer

I would think you would need to control the views and overlays yourself rather than relying on the contentOverlayView.


You can use an AVPlayerViewController within another view controller, and it has the inbuilt playback controls as long as it's size is the size of the screen. Anything less than fullscreen and it will hide the controls automatically.

tvOS Interactive Overlay in AVPlayerViewController With Swift
 
 
Q