public class AdBreak
An ad break consisting of one or more ads and an indication of the point in time when it should start.
Ad breaks that are marked as Roll.PRE or Roll.POST can only contain one ad. In order to have multiple ads during an ad break, an offset
needs to be past.
This class provides two different constructors to enforce the above fact.
offset
Constructor and Description |
---|
AdBreak(java.lang.String adTag,
AdBreak.Roll roll)
Creates a pre-roll or a post-roll ad break that consists of a single ad.
|
AdBreak(java.util.ArrayList<java.lang.String> adTags,
long offset)
Creates an ad break that will start playing at the specified offset.
|
Modifier and Type | Method and Description |
---|---|
java.util.ArrayList<java.lang.String> |
getAdTags()
The list of ad tag URL(s) that we were passed as parameter to the constructor.
|
java.lang.Long |
getOffset()
If this ad break does not have a
enum AdBreak.Roll specified, then this offset indicates the position (in seconds) when the break should start. |
AdBreak.Roll |
getRoll()
Whether this ad break is a pre-roll or a post-roll.
|
public AdBreak(@NotNull java.lang.String adTag, @NotNull AdBreak.Roll roll)
Creates a pre-roll or a post-roll ad break that consists of a single ad.
adTag
- The ad tag url.roll
- Whether it's a pre-roll or a post-roll.public AdBreak(@NotNull java.util.ArrayList<java.lang.String> adTags, long offset)
Creates an ad break that will start playing at the specified offset.
adTags
- A list of ad tag urls.offset
- The offset (in seconds) when the ad break should start.@NotNull public java.util.ArrayList<java.lang.String> getAdTags()
The list of ad tag URL(s) that we were passed as parameter to the constructor.
@Nullable public AdBreak.Roll getRoll()
Whether this ad break is a pre-roll or a post-roll.
@Nullable public java.lang.Long getOffset()
If this ad break does not have a enum AdBreak.Roll
specified, then this offset indicates the position (in seconds) when the break should start.
enum AdBreak.Roll