Noturno
Noturno

Reputation: 121

Seekbar visibility callback with AVPlayerViewController in tvOS

I'm working on a solution to display some elements on screen while the seekbar is visible.

I have a AVPlayerViewController with a AVPlayer playing a video. I want to display some components while the seekbar is visible and hide them when the seekbar is hidden.

Is there a way to be notified when the seekbar is visible/hidden?

Thanks in advance.

Upvotes: 3

Views: 840

Answers (1)

Jonathan
Jonathan

Reputation: 301

Take a look at the AVPlayerViewControllerDelegate specifically this method:

optional func playerViewController(_ playerViewController: AVPlayerViewController, willTransitionToVisibilityOfTransportBar visible: Bool, with coordinator: AVPlayerViewControllerAnimationCoordinator)

More information can be found here: https://developer.apple.com/documentation/avkit/avplayerviewcontrollerdelegate/2876484-playerviewcontroller

Upvotes: 5

Related Questions