A model of an VAST Ad spot, which can be played during video playback. More...

Inheritance diagram for com.ooyala.android.ads.vast.VASTAdSpot:
com.ooyala.android.item.OoyalaManagedAdSpot com.ooyala.android.item.AdSpot Comparable com.ooyala.android.ads.vast.VMAPAdSpot

Public Member Functions

 VASTAdSpot (int timeOffset, int duration, URL clickURL, List< URL > trackingURLs, URL vastURL)
 Initialize a VASTAdSpot using the specified data. More...
 
 VASTAdSpot (JSONObject data)
 Initialize a VASTAdSpot using the specified data (subclasses should override this) More...
 
 VASTAdSpot (int timeOffset, int duration, Element e)
 initialize a VASTAdSpot via XML document More...
 
ReturnState update (JSONObject data)
 Update the VASTAdSpot using the specified data (subclasses should override and call this) More...
 
boolean fetchPlaybackInfo (OoyalaAPIClient api, PlayerInfo info)
 Fetch the additional required info for the ad NOTE: As of right now, we only support VAST 2.0 Linear Ads. More...
 
List< Ad > getAds ()
 
URL getVASTURL ()
 
List< VASTAdSpotgetVMAPAdSpots ()
 
boolean isInfoFetched ()
 
Set< Integer > getErrors ()
 
List< String > getErrorUrls ()
 
List< Ad > getLinearAds ()
 
boolean needsPauseContent ()
 
AdOverlayInfo getAdOverlayInfo ()
 
int getTime ()
 Fetch the time at which this AdSpot should play. More...
 
URL getClickURL ()
 Fetch the URL to ping when this AdSpot is clicked. More...
 
List< URL > getTrackingURLs ()
 Fetch the list of tracking URLs to ping when this AdSpot is played. More...
 
int getPriority ()
 
void setPriority (int priority)
 set the priority of the ad spot. More...
 
int compareTo (AdSpot ad)
 compare two ad spots based on time, which is required to properly sort ad spots. More...
 

Static Public Member Functions

static OoyalaManagedAdSpot create (JSONObject data, int contentDuration)
 

Protected Member Functions

boolean parse (Element vast)
 

Protected Attributes

String _signature
 The signature for the vast request. More...
 
long _expires
 The expires for the vast request. More...
 
URL _vastURL
 The url for the vast request. More...
 
List< Ad > _poddedAds = new ArrayList<Ad>()
 The actual ads (List of VASTAd) More...
 
List< Ad > _standAloneAds = new ArrayList<Ad>()
 
List< VASTAdSpot_vmapAdSpots
 
int _contentDuration
 
boolean _infoFetched
 
Set< Integer > errors = new HashSet<Integer>()
 
List< String > errorUrls = new ArrayList<String>()
 
int _time = -1
 
int _priority = 0
 
URL _clickURL = null
 
List< URL > _trackingURLs = null
 

Static Protected Attributes

static final String KEY_TYPE = "type"
 
static final String KEY_TIME = "time"
 
static final String KEY_CLICK_URL = "click_url"
 
static final String KEY_TRACKING_URL = "tracking_url"
 
static final String AD_TYPE_OOYALA = "ooyala"
 
static final String AD_TYPE_VAST = "vast"
 

Detailed Description

A model of an VAST Ad spot, which can be played during video playback.

Constructor & Destructor Documentation

com.ooyala.android.ads.vast.VASTAdSpot.VASTAdSpot ( int  timeOffset,
int  duration,
URL  clickURL,
List< URL >  trackingURLs,
URL  vastURL 
)

Initialize a VASTAdSpot using the specified data.

Parameters
timeOffsetthe time offset at which the VASTAdSpot should play
clickURLthe clickthrough URL
trackingURLsthe tracking URLs that should be pinged when this ad plays
vastURLthe VAST URL containing the VAST compliant XML for this ad spot
com.ooyala.android.ads.vast.VASTAdSpot.VASTAdSpot ( JSONObject  data)

Initialize a VASTAdSpot using the specified data (subclasses should override this)

Parameters
datathe NSDictionary containing the data to use to initialize this VASTAdSpot
com.ooyala.android.ads.vast.VASTAdSpot.VASTAdSpot ( int  timeOffset,
int  duration,
Element  e 
)

initialize a VASTAdSpot via XML document

Parameters
timeOffsetthe time offset of the ad spot
durationthe content duration
ethe VAST document element

Member Function Documentation

int com.ooyala.android.item.AdSpot.compareTo ( AdSpot  ad)
inherited

compare two ad spots based on time, which is required to properly sort ad spots.

Parameters
adthe ad to be compared
static OoyalaManagedAdSpot com.ooyala.android.item.OoyalaManagedAdSpot.create ( JSONObject  data,
int  contentDuration 
)
staticinherited
boolean com.ooyala.android.ads.vast.VASTAdSpot.fetchPlaybackInfo ( OoyalaAPIClient  api,
PlayerInfo  info 
)

Fetch the additional required info for the ad NOTE: As of right now, we only support VAST 2.0 Linear Ads.

Information about Non-Linear and Companion Ads are stored in the dictionaries nonLinear and companion respectively.

Returns
false if errors occurred, true if successful
AdOverlayInfo com.ooyala.android.ads.vast.VASTAdSpot.getAdOverlayInfo ( )
List<Ad> com.ooyala.android.ads.vast.VASTAdSpot.getAds ( )
URL com.ooyala.android.item.OoyalaManagedAdSpot.getClickURL ( )
inherited

Fetch the URL to ping when this AdSpot is clicked.

Returns
the click URL
Set<Integer> com.ooyala.android.ads.vast.VASTAdSpot.getErrors ( )
Returns
error codes.
List<String> com.ooyala.android.ads.vast.VASTAdSpot.getErrorUrls ( )
Returns
error urls.
List<Ad> com.ooyala.android.ads.vast.VASTAdSpot.getLinearAds ( )
int com.ooyala.android.item.OoyalaManagedAdSpot.getPriority ( )
inherited
int com.ooyala.android.item.OoyalaManagedAdSpot.getTime ( )
inherited

Fetch the time at which this AdSpot should play.

Returns
The time at which this AdSpot should play in milliseconds.
List<URL> com.ooyala.android.item.OoyalaManagedAdSpot.getTrackingURLs ( )
inherited

Fetch the list of tracking URLs to ping when this AdSpot is played.

Returns
the priority
URL com.ooyala.android.ads.vast.VASTAdSpot.getVASTURL ( )
List<VASTAdSpot> com.ooyala.android.ads.vast.VASTAdSpot.getVMAPAdSpots ( )
boolean com.ooyala.android.ads.vast.VASTAdSpot.isInfoFetched ( )
boolean com.ooyala.android.ads.vast.VASTAdSpot.needsPauseContent ( )
boolean com.ooyala.android.ads.vast.VASTAdSpot.parse ( Element  vast)
protected
void com.ooyala.android.item.OoyalaManagedAdSpot.setPriority ( int  priority)
inherited

set the priority of the ad spot.

if two adspot have the same time, the one with higher priority(smaller value) will be played first.

ReturnState com.ooyala.android.ads.vast.VASTAdSpot.update ( JSONObject  data)

Update the VASTAdSpot using the specified data (subclasses should override and call this)

Parameters
datathe NSDictionary containing the data to use to update this VASTAdSpot
Returns
ReturnState.STATE_FAIL if the parsing failed, ReturnState.STATE_MATCHED if it was successful

Member Data Documentation

URL com.ooyala.android.item.OoyalaManagedAdSpot._clickURL = null
protectedinherited
int com.ooyala.android.ads.vast.VASTAdSpot._contentDuration
protected
long com.ooyala.android.ads.vast.VASTAdSpot._expires
protected

The expires for the vast request.

boolean com.ooyala.android.ads.vast.VASTAdSpot._infoFetched
protected
List<Ad> com.ooyala.android.ads.vast.VASTAdSpot._poddedAds = new ArrayList<Ad>()
protected

The actual ads (List of VASTAd)

int com.ooyala.android.item.OoyalaManagedAdSpot._priority = 0
protectedinherited
String com.ooyala.android.ads.vast.VASTAdSpot._signature
protected

The signature for the vast request.

List<Ad> com.ooyala.android.ads.vast.VASTAdSpot._standAloneAds = new ArrayList<Ad>()
protected
int com.ooyala.android.item.OoyalaManagedAdSpot._time = -1
protectedinherited
List<URL> com.ooyala.android.item.OoyalaManagedAdSpot._trackingURLs = null
protectedinherited
URL com.ooyala.android.ads.vast.VASTAdSpot._vastURL
protected

The url for the vast request.

List<VASTAdSpot> com.ooyala.android.ads.vast.VASTAdSpot._vmapAdSpots
protected
final String com.ooyala.android.item.OoyalaManagedAdSpot.AD_TYPE_OOYALA = "ooyala"
staticprotectedinherited
final String com.ooyala.android.item.OoyalaManagedAdSpot.AD_TYPE_VAST = "vast"
staticprotectedinherited
Set<Integer> com.ooyala.android.ads.vast.VASTAdSpot.errors = new HashSet<Integer>()
protected
List<String> com.ooyala.android.ads.vast.VASTAdSpot.errorUrls = new ArrayList<String>()
protected
final String com.ooyala.android.item.OoyalaManagedAdSpot.KEY_CLICK_URL = "click_url"
staticprotectedinherited
final String com.ooyala.android.item.OoyalaManagedAdSpot.KEY_TIME = "time"
staticprotectedinherited
final String com.ooyala.android.item.OoyalaManagedAdSpot.KEY_TRACKING_URL = "tracking_url"
staticprotectedinherited
final String com.ooyala.android.item.OoyalaManagedAdSpot.KEY_TYPE = "type"
staticprotectedinherited