public class ContentBlock extends java.lang.Object implements TimelineBlock
| Modifier and Type | Method and Description |
|---|---|
static ContentBlock |
create(long durationMs,
long absoluteOffsetMs,
long relativeOffsetMs)
Instantiates a new Content block.
|
static ContentBlock |
create(long durationMs,
long absoluteOffsetMs,
long relativeOffsetMs,
AdPod adPod)
Instantiates a new Content block.
|
static ContentBlock |
createDynamicBlock() |
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 static ContentBlock create(long durationMs, long absoluteOffsetMs, long relativeOffsetMs)
durationMs - duration of the ContentBlock in milliseconds.absoluteOffsetMs - absoluteOffset of the ContentBlock in milliseconds.relativeOffsetMs - relativeOffset of the ContentBlock in milliseconds.AdPod.public static ContentBlock create(long durationMs, long absoluteOffsetMs, long relativeOffsetMs, @NonNull AdPod adPod)
durationMs - duration of the ContentBlock in milliseconds.absoluteOffsetMs - absoluteOffset of the ContentBlock in milliseconds.relativeOffsetMs - relativeOffset of the ContentBlock in milliseconds.adPod - a non-null AdPod.public static ContentBlock createDynamicBlock()
public 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 long getDuration()
TimelineBlockgetDuration in interface TimelineBlockpublic long getAbsoluteOffset()
TimelineBlockgetAbsoluteOffset in interface TimelineBlockpublic long getRelativeOffset()
TimelineBlockgetRelativeOffset 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