Instance Method

playerViewController(_:shouldPresent:)

Tells the delegate whether the content proposal should be presented.

Declaration

optional func playerViewController(_ playerViewController: AVPlayerViewController, shouldPresent proposal: AVContentProposal) -> Bool

Parameters

playerViewController

The player view controller to which this delegate is assigned.

proposal

The content proposal to be presented.

Return Value

Return true to allow the presentation of the content proposal.

Discussion

If you implement this method, you should return true to allow presentation of the content proposal. The delegate may wish to create a custom view controller when this is called and assign it as the contentProposalViewController property of AVPlayerViewController.

See Also

Responding to Content Proposals

func playerViewController(AVPlayerViewController, didAccept: AVContentProposal)

Tells the delegate the user accepts the presented content proposal.

func playerViewController(AVPlayerViewController, didReject: AVContentProposal)

Tells the delegate the user rejects the presented content proposal.