AVPlayerViewController were are the default controls?

So here’s the problem. I was working with tvOS on a project. The layout was a collection view of cells at the bottom layout and a player view with the current video. This current video’s view was part of a AVPlayerViewController’s view. When the view’s frame transitioned to Fullscreen 1080 x 1920 the default AV controls were absent.

After digging around on the tvOS forum and Stackoverflow I figured the reason was the view was not in focus.

Solution. Make sure if you’re having a similar problem that preferrrdFocusedView should be the Fullscreen view (AVPlayerViewController’s view) in order to get the default controls. Do so by calling setNeedsFocusUpdate and updateFocusIfNeeded.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s