Instance Method

playPrerollAdWithCompletionHandler:

Requests playback of a preroll video iAd.

Declaration

- (void)playPrerollAdWithCompletionHandler:(void (^)(NSError *error))completionHandler;

Parameters

completionHandler

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

Discussion

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

+ preparePrerollAds

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

- cancelPreroll

Cancels the playback of a preroll video ad.