Protocol

AVPlayerViewControllerDelegate

Methods you can implement to respond to media playback events associated with a player view controller.

Declaration

@protocol AVPlayerViewControllerDelegate

Overview

On iPad, you can implement methods to manage your app’s participation with Picture in Picture (PiP) playback. On Apple TV, you can implement methods related to playback navigation, interstitial content, and content proposals. Adopt this protocol in a custom object, and assign the object as the delegate of your AVPlayerViewController instance.

Topics

Managing Your App’s UI for Picture in Picture

- playerViewControllerShouldAutomaticallyDismissAtPictureInPictureStart:

Allows you to opt out from the player view controller automatically dismissing when Picture in Picture (PiP) starts.

- playerViewController:restoreUserInterfaceForPictureInPictureStopWithCompletionHandler:

Gives your app an opportunity to restore its movie playback user interface; called when Picture in Picture is about to stop.

Responding to Picture in Picture Playback Events

- playerViewControllerWillStartPictureInPicture:

Tells the delegate Picture in Picture is about to start.

- playerViewControllerDidStartPictureInPicture:

Tells the delegate Picture in Picture playback has started.

- playerViewControllerWillStopPictureInPicture:

Tells the delegate Picture in Picture is about to stop.

- playerViewControllerDidStopPictureInPicture:

Tells the delegate Picture in Picture playback has stopped and the stopping animation has finished.

- playerViewController:failedToStartPictureInPictureWithError:

Tells the delegate Picture in Picture failed to start.

Responding to Navigation Events

- playerViewController:timeToSeekAfterUserNavigatedFromTime:toTime:

Tells the delegate a user has skipped, scrubbed, or otherwise navigated to a new time and wants to resume playback at the targetTime.

- playerViewController:willResumePlaybackAfterUserNavigatedFromTime:toTime:

Tells the delegate the user has skipped, scrubbed, or otherwise navigated to a new time, and playback is about to start at the new time.

- skipToPreviousItemForPlayerViewController:

Tells the delegate the user skips backward in the timeline and the player view controller is configured to use non-default skipping behavior.

- skipToNextItemForPlayerViewController:

Tells the delegate the user skips forward in the timeline and the player view controller is configured to use non-default skipping behavior.

Responding to Interstitial Content Playback Events

- playerViewController:willPresentInterstitialTimeRange:

Tells the delegate the player view controller is about to begin playing a range of interstitial content.

- playerViewController:didPresentInterstitialTimeRange:

Tells the delegate the player view controller has completed playing a range of interstitial content.

Responding to Content Proposals

- playerViewController:didAcceptContentProposal:

Tells the delegate the user accepts the presented content proposal.

- playerViewController:didRejectContentProposal:

Tells the delegate the user rejects the presented content proposal.

- playerViewController:shouldPresentContentProposal:

Tells the delegate whether the content proposal should be presented.

Responding to Media Selection

- playerViewController:didSelectMediaSelectionOption:inMediaSelectionGroup:

Tells the delegate a user has selected a media option from a media selection group.

- playerViewController:didSelectExternalSubtitleOptionLanguage:

Tells the delegate the user has selected a specific subtitle option.

Responding to Transport Bar Changes

AVPlayerViewControllerAnimationCoordinator

Methods you implement to add animations to be performed alongside the playback controls' visibility animation.

Relationships

Inherits From

See Also

Accessing the Delegate Object

delegate

The delegate object for the player view controller.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software