public class

SVSAdRuleData

extends Object
implements Parcelable Serializable
java.lang.Object
   ↳ com.smartadserver.android.instreamsdk.adrules.SVSAdRuleData

Class Overview

Represents the details of an ad rule related to a given ad break type.

Summary

[Expand]
Inherited Constants
From interface android.os.Parcelable
Public Methods
static SVSAdRuleData createMidrollAdRuleData(int instances, long maxAdPodDuration, double[] percents)
Creates a midroll SVSAdRuleData
static SVSAdRuleData createMidrollAdRuleData(int instances, long maxAdPodDuration, int offset, int interval)
Creates a midroll SVSAdRuleData
static SVSAdRuleData createMidrollAdRuleData(int instances, long maxAdPodDuration, String[] timecodes)
Creates a midroll SVSAdRuleData
static SVSAdRuleData createPostrollAdRuleData(int instances, long maxAdPodDuration)
Creates a postroll SVSAdRuleData
static SVSAdRuleData createPrerollAdRuleData(int instances, long maxAdPodDuration)
Creates a preroll SVSAdRuleData
long[] getAbsoluteTimes(long contentDuration)
Returns the absolutes times when the ad break represented by this rule is triggered
int getInstances()
Returns the number of ads in this ad break.
long getInterval()
The time interval between midrolls/overlays.
long getMaxAdPodDuration()
Returns the maximum duration for this ad break
long getOffset()
Initial time offset before the first ad in case where interval value is set
double[] getPercents()
Returns the percents of the content video duration when the ad break represented by this rule is triggered.
String[] getTimecodes()
Returns the string representations of the times (within content duration) when the ad break represented by this rule is triggered.
SVSAdBreakType getType()
Returns the type of this SVSAdRuleData
[Expand]
Inherited Methods
From class java.lang.Object
From interface android.os.Parcelable

Public Methods

public static SVSAdRuleData createMidrollAdRuleData (int instances, long maxAdPodDuration, double[] percents)

Creates a midroll SVSAdRuleData

Parameters
instances number of ads in the midroll
maxAdPodDuration maximum duration of midroll ad pod
percents the percents of the content video duration when the ad break represented by this rule is triggered.

public static SVSAdRuleData createMidrollAdRuleData (int instances, long maxAdPodDuration, int offset, int interval)

Creates a midroll SVSAdRuleData

Parameters
instances number of ads in the midroll
maxAdPodDuration maximum duration of midroll ad pod
offset initial time offset (in milliseconds) before the first midroll/overlay ad
interval the time interval (in milliseconds) between midrolls/overlays.

public static SVSAdRuleData createMidrollAdRuleData (int instances, long maxAdPodDuration, String[] timecodes)

Creates a midroll SVSAdRuleData

Parameters
instances number of ads in the midroll
maxAdPodDuration maximum duration of midroll ad pod
timecodes The string representations of the times (within content duration) when the ad break represented by this rule is triggered

public static SVSAdRuleData createPostrollAdRuleData (int instances, long maxAdPodDuration)

Creates a postroll SVSAdRuleData

Parameters
instances number of ads in the postroll
maxAdPodDuration maximum duration of postroll ad pod

public static SVSAdRuleData createPrerollAdRuleData (int instances, long maxAdPodDuration)

Creates a preroll SVSAdRuleData

Parameters
instances number of ads in the preroll
maxAdPodDuration maximum duration of preroll ad pod

public long[] getAbsoluteTimes (long contentDuration)

Returns the absolutes times when the ad break represented by this rule is triggered

Parameters
contentDuration the content video duration

public int getInstances ()

Returns the number of ads in this ad break. 0 if disabled. -1 if the number of ads is defined by the server. n > 0 means n ads

public long getInterval ()

The time interval between midrolls/overlays. Valid only if percents and timecodes are not set Concerns midrolls/overlays only

public long getMaxAdPodDuration ()

Returns the maximum duration for this ad break

public long getOffset ()

Initial time offset before the first ad in case where interval value is set

public double[] getPercents ()

Returns the percents of the content video duration when the ad break represented by this rule is triggered. Valid only if timecodes and interval are not set. Concerns midrolls/overlays only

public String[] getTimecodes ()

Returns the string representations of the times (within content duration) when the ad break represented by this rule is triggered. Valid only if percents and interval are not set Concerns midrolls/overlays only

public SVSAdBreakType getType ()

Returns the type of this SVSAdRuleData