A model of a VMAP Ad spot, which extends VAST Ad spot with additional VMAP attributes. More...

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

Public Member Functions

 VMAPAdSpot (final TimeOffset timeOffset, int duration, double repeatAfter, String breakType, String breakId, String sourceId, Boolean allowMultipleAds, Boolean followRedirects, Element e)
 Create a VMAP Ad Spot with an XML document. More...
 
 VMAPAdSpot (final TimeOffset timeOffset, int duration, double repeatAfter, String breakType, String breakId, String sourceId, Boolean allowMultipleAds, Boolean followRedirects, URL vastUrl)
 create a VMAP Ad Spot with an url to the VAST XML More...
 
int getTime ()
 
double getOriginalTimeInMilliseconds ()
 
final TimeOffset getTimeOffset ()
 
double getRepeatAfter ()
 
final String getBreakType ()
 
final String getBreakId ()
 
final String getAdSourceId ()
 
boolean getAllowMultipleAds ()
 
boolean getFollowRedirects ()
 
boolean isRepeatable ()
 
void markAsPlayed ()
 mark the ad spot as played More...
 
void markAsUnplayed ()
 mark the ad spot as unplayed 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 ()
 
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

final TimeOffset timeOffset
 
final String breakType
 
final String breakId
 
final String adSourceId
 
final Boolean allowMultipleAds
 
final Boolean followRedirects
 
final double repeatAfter
 
int repeatCounter
 
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 a VMAP Ad spot, which extends VAST Ad spot with additional VMAP attributes.

Constructor & Destructor Documentation

com.ooyala.android.ads.vast.VMAPAdSpot.VMAPAdSpot ( final TimeOffset  timeOffset,
int  duration,
double  repeatAfter,
String  breakType,
String  breakId,
String  sourceId,
Boolean  allowMultipleAds,
Boolean  followRedirects,
Element  e 
)

Create a VMAP Ad Spot with an XML document.

Parameters
timeOffsetthe time offset of the ad spot
durationthe duration of the content
repeatAfterafter what time the spot should be repeated. ignored for now
breakTypethe break type. ignored for now
breakIdthe break ID. ignored for now
sourceIdthe source ID.
allowMultipleAdsif multiple ads are allowed
followRedirectsif redirects are followed. ignored for now
ethe root element of the VAST XML
com.ooyala.android.ads.vast.VMAPAdSpot.VMAPAdSpot ( final TimeOffset  timeOffset,
int  duration,
double  repeatAfter,
String  breakType,
String  breakId,
String  sourceId,
Boolean  allowMultipleAds,
Boolean  followRedirects,
URL  vastUrl 
)

create a VMAP Ad Spot with an url to the VAST XML

Parameters
timeOffsetthe time offset of the ad spot
durationthe duration of the content
repeatAfterafter what time the spot should be repeated. ignored for now
breakTypethe break type. ignored for now
breakIdthe break ID. ignored for now
sourceIdthe ad source ID.
allowMultipleAdsif multiple ads are allowed
followRedirectsif redirects are followed. ignored for now
vastUrlthe url to the VAST XML

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 
)
inherited

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 ( )
inherited
List<Ad> com.ooyala.android.ads.vast.VASTAdSpot.getAds ( )
inherited
final String com.ooyala.android.ads.vast.VMAPAdSpot.getAdSourceId ( )
Returns
ad source id
boolean com.ooyala.android.ads.vast.VMAPAdSpot.getAllowMultipleAds ( )
Returns
allow multiple ads
final String com.ooyala.android.ads.vast.VMAPAdSpot.getBreakId ( )
Returns
break id
final String com.ooyala.android.ads.vast.VMAPAdSpot.getBreakType ( )
Returns
break type
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 ( )
inherited
Returns
error codes.
List<String> com.ooyala.android.ads.vast.VASTAdSpot.getErrorUrls ( )
inherited
Returns
error urls.
boolean com.ooyala.android.ads.vast.VMAPAdSpot.getFollowRedirects ( )
Returns
follow redirects
List<Ad> com.ooyala.android.ads.vast.VASTAdSpot.getLinearAds ( )
inherited
double com.ooyala.android.ads.vast.VMAPAdSpot.getOriginalTimeInMilliseconds ( )
Returns
the original time offset, in seconds
int com.ooyala.android.item.OoyalaManagedAdSpot.getPriority ( )
inherited
double com.ooyala.android.ads.vast.VMAPAdSpot.getRepeatAfter ( )
Returns
repeat after
int com.ooyala.android.ads.vast.VMAPAdSpot.getTime ( )
Returns
the time offset in seconds of when the ad spot should be played
final TimeOffset com.ooyala.android.ads.vast.VMAPAdSpot.getTimeOffset ( )
Returns
the time offset
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 ( )
inherited
List<VASTAdSpot> com.ooyala.android.ads.vast.VASTAdSpot.getVMAPAdSpots ( )
inherited
boolean com.ooyala.android.ads.vast.VASTAdSpot.isInfoFetched ( )
inherited
boolean com.ooyala.android.ads.vast.VMAPAdSpot.isRepeatable ( )
Returns
true if repeatalbe, false otherwise
void com.ooyala.android.ads.vast.VMAPAdSpot.markAsPlayed ( )

mark the ad spot as played

void com.ooyala.android.ads.vast.VMAPAdSpot.markAsUnplayed ( )

mark the ad spot as unplayed

boolean com.ooyala.android.ads.vast.VASTAdSpot.needsPauseContent ( )
inherited
boolean com.ooyala.android.ads.vast.VASTAdSpot.parse ( Element  vast)
protectedinherited
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)
inherited

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
protectedinherited
long com.ooyala.android.ads.vast.VASTAdSpot._expires
protectedinherited

The expires for the vast request.

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

The actual ads (List of VASTAd)

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

The signature for the vast request.

List<Ad> com.ooyala.android.ads.vast.VASTAdSpot._standAloneAds = new ArrayList<Ad>()
protectedinherited
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
protectedinherited

The url for the vast request.

List<VASTAdSpot> com.ooyala.android.ads.vast.VASTAdSpot._vmapAdSpots
protectedinherited
final String com.ooyala.android.item.OoyalaManagedAdSpot.AD_TYPE_OOYALA = "ooyala"
staticprotectedinherited
final String com.ooyala.android.item.OoyalaManagedAdSpot.AD_TYPE_VAST = "vast"
staticprotectedinherited
final String com.ooyala.android.ads.vast.VMAPAdSpot.adSourceId
protected
final Boolean com.ooyala.android.ads.vast.VMAPAdSpot.allowMultipleAds
protected
final String com.ooyala.android.ads.vast.VMAPAdSpot.breakId
protected
final String com.ooyala.android.ads.vast.VMAPAdSpot.breakType
protected
Set<Integer> com.ooyala.android.ads.vast.VASTAdSpot.errors = new HashSet<Integer>()
protectedinherited
List<String> com.ooyala.android.ads.vast.VASTAdSpot.errorUrls = new ArrayList<String>()
protectedinherited
final Boolean com.ooyala.android.ads.vast.VMAPAdSpot.followRedirects
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
final double com.ooyala.android.ads.vast.VMAPAdSpot.repeatAfter
protected
int com.ooyala.android.ads.vast.VMAPAdSpot.repeatCounter
protected
final TimeOffset com.ooyala.android.ads.vast.VMAPAdSpot.timeOffset
protected