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()
TimelineBlockgetDuration in interface TimelineBlockpublic long getAbsoluteOffset()
TimelineBlockgetAbsoluteOffset in interface TimelineBlockpublic long getRelativeOffset()
TimelineBlockgetRelativeOffset in interface TimelineBlockpublic boolean isAd()
TimelineBlockisAd in interface TimelineBlock@NonNull public AdPod getAdPod()
TimelineBlockTimelineBlock.isAd() returns true, use this method to get additional information about the
Ad Pod.getAdPod in interface TimelineBlockpublic boolean isDynamic()
TimelineBlockNote: The default implementation returns false.
isDynamic in interface TimelineBlockpublic void updateDuration(long duration)
TimelineBlockTimelineBlock.isDynamic() returns true.
Note: The default implementation does nothing. It can be overridden to provide the desired implementation.
updateDuration in interface TimelineBlockduration - the new durationpublic void updateAbsoluteOffset(long absoluteOffset)
TimelineBlockTimelineBlock.isDynamic() returns true.
Note: The default implementation does nothing. It can be overridden to provide the desired implementation.
updateAbsoluteOffset in interface TimelineBlockabsoluteOffset - the new absolute offsetpublic void updateRelativeOffset(long relativeOffset)
TimelineBlockTimelineBlock.isDynamic() returns true.
Note: The default implementation does nothing. It can be overridden to provide the desired implementation.
updateRelativeOffset in interface TimelineBlockrelativeOffset - the new relative offsetpublic void updateAdPod(@NonNull
AdPod adPod)
TimelineBlockAdPod 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 TimelineBlockadPod - the new AdPodpublic java.lang.String toString()
toString in class java.lang.Object