Video Player Ad-Serving Interface Definition (VPAID) 2.0 provides a common interface to play video ads. It provides a rich media experience for users and allows publishers to better target ads, track ad impressions, and monetize video content.
The following features are supported:
Version 2.0 of the VPAID specification
For more information, refer to IAB VPAID 2.0.
Linear VPAID ads on video-on-demand (VOD) content
JavaScript VPAID ads
VPAID ads must be JavaScript-based, and the ad response must identify the media type of the VPAID ad as application/javascript
.
The following features are not supported:
The following changes were made to the API:
PTAuditudeMetadata
has a customAdLoadTimeout
property to change the default timeout on the VPAID loading process.
The default timeout value is 10 seconds.
PTMediaPlayerCustomAdNotification
is dispatched from the PTMediaPlayer
instance
While the VPAID ad is playing:
The VPAID ad is displayed in a view container above the player view, so the code that relies on taps by users on the player view does not work.
The main content player is paused, and calls to pause
and play
on the player instance are used to pause and resume the VPAID ad.
VPAID ads do not have a predefined duration, because the ad can be interactive.
The ad duration and total ad break duration that are defined by the ad server response might not be accurate.
To add VPAID 2.0 support in your iOS application:
(Optional) Add a listener for custom ad events.
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onMediaPlayerCustomAdNotification:) name:PTMediaPlayerCustomAdNotification object:self.player];
(Optional) Display the notification.
-(void)onMediaPlayerCustomAdNotification:(NSNotification *)notification{ PTCustomAdNotificationObject *notificationObject = [notification.userInfo objectForKey:PTCustomAdNotificationObjectKey]; if (notificationObject)
{ NSLog(@"ViewController:: Custom Ad Notification Received: %ld", notificationObject.type); }
}