public class AdBreak
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static AdBreak |
create(long startPosition,
long endPosition,
java.util.Collection<Ad> ads)
Creates an AdBreak with startPosition, endPosition and ads.
|
static <T> AdBreak |
create(java.lang.Long adsOffset,
T input,
Function2<T,java.lang.Long,AdBreak> mapper)
Creates an AdBreak from a T type object.
|
static AdBreak |
create(java.lang.String id,
long startPosition,
long endPosition,
java.util.Collection<Ad> ads)
Creates an AdBreak with an Id, startPosition, endPosition and ads.
|
static AdBreak |
createSlate(long absoluteStartPositionMs,
long absoluteEndPositionMs)
Creates an Slate Ad Break.
|
long |
getAbsoluteEndPosition()
Returns the absolute end position of the AdBreak.
|
long |
getAbsoluteStartPosition()
Returns the absolute start position of the AdBreak.
|
Ad<?> |
getAdAt(long currentAbsolutePosition) |
java.util.Collection<Ad> |
getAds()
Returns the ads of the AdBreak.
|
long |
getDuration()
Returns the duration of the AdBreak.
|
java.lang.String |
getId() |
boolean |
isSlate() |
public static <T> AdBreak create(java.lang.Long adsOffset, @NonNull T input, @NonNull Function2<T,java.lang.Long,AdBreak> mapper) throws java.lang.Exception
T
- Type of the input.adsOffset
- Initial offset of the AdBreak.input
- object to map from.mapper
- Function implementation to map.java.lang.Exception
public static AdBreak create(long startPosition, long endPosition, @NonNull java.util.Collection<Ad> ads)
startPosition
- startPosition of the AdBreakendPosition
- endPosition of the AdBreak.ads
- Collection of Ad
.public static AdBreak create(@NonNull java.lang.String id, long startPosition, long endPosition, @NonNull java.util.Collection<Ad> ads)
id
- the AdBreak idstartPosition
- startPosition of the AdBreakendPosition
- endPosition of the AdBreak.ads
- Collection of Ad
.public static AdBreak createSlate(long absoluteStartPositionMs, long absoluteEndPositionMs)
absoluteStartPositionMs
- the absolute Ad start position in millisecondsabsoluteEndPositionMs
- the absolute Ad end position in millisecondspublic long getAbsoluteStartPosition()
public long getAbsoluteEndPosition()
public long getDuration()
public java.lang.String getId()
@NonNull public java.util.Collection<Ad> getAds()
@Nullable public Ad<?> getAdAt(long currentAbsolutePosition)
currentAbsolutePosition
- the playhead absolute position.public boolean isSlate()
createSlate(long, long)