影片播放器廣告服務介面定義(VPAID) 2.0提供播放影片廣告的通用介面。 它為使用者提供豐富的媒體體驗,並允許發佈者更精確地鎖定廣告、追蹤廣告印象並從視訊內容獲利。
支援下列功能:
VPAID規格的2.0版
如需詳細資訊,請參閱 IAB VPAID 2.0.
線性VPAID隨選影片(VOD)內容廣告
JavaScript VPAID廣告
VPAID廣告必須以JavaScript為基礎,且廣告回應必須將VPAID廣告的媒體型別識別為 application/javascript
.
不支援下列功能:
已對API進行下列變更:
PTAuditudeMetadata
具有 customAdLoadTimeout
屬性以變更VPAID載入程式的預設逾時。
預設逾時值為10秒。
PTMediaPlayerCustomAdNotification
分派自 PTMediaPlayer
例項
當VPAID廣告播放時:
VPAID廣告會顯示在播放器檢視上方的檢視容器中,因此依賴播放器檢視上使用者點選的程式碼無法運作。
主要內容播放器已暫停,並呼叫 pause
和 play
播放器例項上的可暫停和繼續VPAID廣告。
VPAID廣告沒有預先定義的持續時間,因為廣告可以是互動式。
由廣告伺服器回應定義的廣告持續時間和廣告插播總持續時間可能不準確。
若要在iOS應用程式中新增VPAID 2.0支援:
(選用)新增自訂廣告事件的接聽程式。
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onMediaPlayerCustomAdNotification:) name:PTMediaPlayerCustomAdNotification object:self.player];
(選用)顯示通知。
-(void)onMediaPlayerCustomAdNotification:(NSNotification *)notification{ PTCustomAdNotificationObject *notificationObject = [notification.userInfo objectForKey:PTCustomAdNotificationObjectKey]; if (notificationObject)
{ NSLog(@"ViewController:: Custom Ad Notification Received: %ld", notificationObject.type); }
}