public class AdBlock extends java.lang.Object implements TimelineBlock
Constructor and Description |
---|
AdBlock(AdPod adPod)
Instantiates a new Ad block.
|
AdBlock(AdPod adPod,
boolean isDynamic)
Instantiates a new Ad block.
|
Modifier and Type | Method and Description |
---|---|
long |
getAbsoluteOffset()
Gets the absolute Block offset in milliseconds, that is,
the offset with respect to the total video length (content + ads).
|
AdPod |
getAdPod()
If
TimelineBlock.isAd() returns true, use this method to get additional information about the
Ad Pod. |
long |
getDuration()
Gets the duration of the block in milliseconds.
|
long |
getRelativeOffset()
Gets the relative Block offset in milliseconds, that is,
the offset with respect to the content length only (no Ads).
|
boolean |
isAd()
Specify if the block is an Ad.
|
boolean |
isDynamic()
Returns whether the Timeline block is dynamic or not.
|
java.lang.String |
toString() |
void |
updateAbsoluteOffset(long absoluteOffset)
Updates the absolute offset of this block.
|
void |
updateAdPod(AdPod adPod)
Updates the
AdPod of this block. |
void |
updateDuration(long duration)
Updates the duration of this block.
|
void |
updateRelativeOffset(long relativeOffset)
Updates the relative offset of this block.
|
public AdBlock(@NonNull AdPod adPod)
public AdBlock(@NonNull AdPod adPod, boolean isDynamic)
public long getDuration()
TimelineBlock
getDuration
in interface TimelineBlock
public long getAbsoluteOffset()
TimelineBlock
getAbsoluteOffset
in interface TimelineBlock
public long getRelativeOffset()
TimelineBlock
getRelativeOffset
in interface TimelineBlock
public boolean isAd()
TimelineBlock
isAd
in interface TimelineBlock
@NonNull public AdPod getAdPod()
TimelineBlock
TimelineBlock.isAd()
returns true, use this method to get additional information about the
Ad Pod.getAdPod
in interface TimelineBlock
public boolean isDynamic()
TimelineBlock
Note: The default implementation returns false.
isDynamic
in interface TimelineBlock
public void updateDuration(long duration)
TimelineBlock
TimelineBlock.isDynamic()
returns true.
Note: The default implementation does nothing. It can be overridden to provide the desired implementation.
updateDuration
in interface TimelineBlock
duration
- the new durationpublic void updateAbsoluteOffset(long absoluteOffset)
TimelineBlock
TimelineBlock.isDynamic()
returns true.
Note: The default implementation does nothing. It can be overridden to provide the desired implementation.
updateAbsoluteOffset
in interface TimelineBlock
absoluteOffset
- the new absolute offsetpublic void updateRelativeOffset(long relativeOffset)
TimelineBlock
TimelineBlock.isDynamic()
returns true.
Note: The default implementation does nothing. It can be overridden to provide the desired implementation.
updateRelativeOffset
in interface TimelineBlock
relativeOffset
- the new relative offsetpublic void updateAdPod(@NonNull AdPod adPod)
TimelineBlock
AdPod
of this block.
This block must only be updated when TimelineBlock.isDynamic()
returns true.
Note: The default implementation does nothing. It can be overridden to provide the desired implementation.
updateAdPod
in interface TimelineBlock
adPod
- the new AdPodpublic java.lang.String toString()
toString
in class java.lang.Object