Instance Method


Requests playback of a preroll video iAd.


func playPrerollAd(completionHandler: @escaping (Error?) -> Void)



Passing nil as the completion handler is an error and will throw an exception.


If the player view controller's AVPlayer instance begins playing during a pre-roll ad, the video ad will stop immediately.

The completion handler's error argument will be non-nil if the pre-roll ad could not be played. Errors can occur for a number of reasons, such as lack of ad inventory, exceeding the maximum pre-roll ad playback frequency, iAd account configuration issues, and media playback issues. See ADError for an exhaustive list of possible errors.

See Also

Playing a Preroll Video Ad

class func preparePrerollAds()

Informs iAd that the application intends to play a preroll ad.

func cancelPreroll()

Cancels the playback of a preroll video ad.