-
public class AdBreak
Representation of an AdBreak.
-
-
Method Summary
Modifier and Type Method Description static <T> AdBreak
create(Long adsOffset, @NonNull() T input, @NonNull() Function2<T, Long, AdBreak> mapper)
Creates an AdBreak from a T type object. static AdBreak
create(long startPosition, long endPosition, @NonNull() Collection<Ad> ads)
Creates an AdBreak with startPosition, endPosition and ads. static AdBreak
create(@NonNull() String id, long startPosition, long endPosition, @NonNull() 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.An Slate Ad Break is an AdBreak containing one linear ad that will only return a validabsolute start position, absolute end position, and duration. long
getAbsoluteStartPosition()
Returns the absolute start position of the AdBreak. long
getAbsoluteEndPosition()
Returns the absolute end position of the AdBreak. long
getDuration()
Returns the duration of the AdBreak. String
getId()
Collection<Ad>
getAds()
Returns the ads of the AdBreak. Ad<out Object>
getAdAt(long currentAbsolutePosition)
boolean
isSlate()
-
-
Method Detail
-
create
static <T> AdBreak create(Long adsOffset, @NonNull() T input, @NonNull() Function2<T, Long, AdBreak> mapper)
Creates an AdBreak from a T type object.
- Parameters:
adsOffset
- Initial offset of the AdBreak.input
- object to map from.mapper
- Function implementation to map.
-
create
static AdBreak create(long startPosition, long endPosition, @NonNull() Collection<Ad> ads)
Creates an AdBreak with startPosition, endPosition and ads.
- Parameters:
startPosition
- startPosition of the AdBreakendPosition
- endPosition of the AdBreak.ads
- Collection of Ad.
-
create
static AdBreak create(@NonNull() String id, long startPosition, long endPosition, @NonNull() Collection<Ad> ads)
Creates an AdBreak with an Id, startPosition, endPosition and ads.
- Parameters:
id
- the AdBreak idstartPosition
- startPosition of the AdBreakendPosition
- endPosition of the AdBreak.ads
- Collection of Ad.
-
createSlate
static AdBreak createSlate(long absoluteStartPositionMs, long absoluteEndPositionMs)
Creates an Slate Ad Break.An Slate Ad Break is an AdBreak containing one linear ad that will only return a validabsolute start position, absolute end position, and duration. All values are in milliseconds.The remaining values will return empty for non nullable values, or null otherwise.
- Parameters:
absoluteStartPositionMs
- the absolute Ad start position in millisecondsabsoluteEndPositionMs
- the absolute Ad end position in milliseconds
-
getAbsoluteStartPosition
long getAbsoluteStartPosition()
Returns the absolute start position of the AdBreak.
-
getAbsoluteEndPosition
long getAbsoluteEndPosition()
Returns the absolute end position of the AdBreak.
-
getDuration
long getDuration()
Returns the duration of the AdBreak.
-
getAds
@NonNull() Collection<Ad> getAds()
Returns the ads of the AdBreak.
-
getAdAt
@Nullable() Ad<out Object> getAdAt(long currentAbsolutePosition)
- Parameters:
currentAbsolutePosition
- the playhead absolute position.
-
isSlate
boolean isSlate()
-
-
-
-