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()
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 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 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