Class ContentBlock
java.lang.Object
com.brightcove.ssai.timeline.block.ContentBlock
- All Implemented Interfaces:
TimelineBlock
A timeline block representing video content.
-
Method Summary
Modifier and TypeMethodDescriptionstatic ContentBlockcreate(long durationMs, long absoluteOffsetMs, long relativeOffsetMs) Instantiates a new Content block.static ContentBlockInstantiates a new Content block.static ContentBlocklongGets the absolute Block offset in milliseconds, that is, the offset with respect to the total video length (content + ads).getAdPod()IfTimelineBlock.isAd()returns true, use this method to get additional information about the Ad Pod.longGets the duration of the block in milliseconds.longGets the relative Block offset in milliseconds, that is, the offset with respect to the content length only (no Ads).booleanisAd()Specify if the block is an Ad.booleanReturns whether the Timeline block is dynamic or not.toString()voidupdateAbsoluteOffset(long absoluteOffset) Updates the absolute offset of this block.voidupdateAdPod(AdPod adPod) Updates theAdPodof this block.voidupdateDuration(long duration) Updates the duration of this block.voidupdateRelativeOffset(long relativeOffset) Updates the relative offset of this block.
-
Method Details
-
create
Instantiates a new Content block.- Parameters:
durationMs- duration of the ContentBlock in milliseconds.absoluteOffsetMs- absoluteOffset of the ContentBlock in milliseconds.relativeOffsetMs- relativeOffset of the ContentBlock in milliseconds.- Returns:
- the created ContentBlock instance with an invalid
AdPod.
-
create
public static ContentBlock create(long durationMs, long absoluteOffsetMs, long relativeOffsetMs, @NonNull AdPod adPod) Instantiates a new Content block.- Parameters:
durationMs- duration of the ContentBlock in milliseconds.absoluteOffsetMs- absoluteOffset of the ContentBlock in milliseconds.relativeOffsetMs- relativeOffset of the ContentBlock in milliseconds.adPod- a non-nullAdPod.- Returns:
- the created ContentBlock instance.
-
createDynamicBlock
-
isAd
public boolean isAd()Description copied from interface:TimelineBlockSpecify if the block is an Ad.- Specified by:
isAdin interfaceTimelineBlock- Returns:
- true if an Ad.
-
getAdPod
Description copied from interface:TimelineBlockIfTimelineBlock.isAd()returns true, use this method to get additional information about the Ad Pod.- Specified by:
getAdPodin interfaceTimelineBlock- Returns:
- the Ad Pod info
-
getDuration
public long getDuration()Description copied from interface:TimelineBlockGets the duration of the block in milliseconds.- Specified by:
getDurationin interfaceTimelineBlock- Returns:
- the duration.
-
getAbsoluteOffset
public long getAbsoluteOffset()Description copied from interface:TimelineBlockGets the absolute Block offset in milliseconds, that is, the offset with respect to the total video length (content + ads).- Specified by:
getAbsoluteOffsetin interfaceTimelineBlock- Returns:
- the offset in milliseconds.
-
getRelativeOffset
public long getRelativeOffset()Description copied from interface:TimelineBlockGets the relative Block offset in milliseconds, that is, the offset with respect to the content length only (no Ads).- Specified by:
getRelativeOffsetin interfaceTimelineBlock- Returns:
- the offset in milliseconds.
-
isDynamic
public boolean isDynamic()Description copied from interface:TimelineBlockReturns whether the Timeline block is dynamic or not.Note: The default implementation returns false.
- Specified by:
isDynamicin interfaceTimelineBlock- Returns:
- true if it is dynamic
-
updateDuration
public void updateDuration(long duration) Description copied from interface:TimelineBlockUpdates the duration of this block. This block must only be updated whenTimelineBlock.isDynamic()returns true.Note: The default implementation does nothing. It can be overridden to provide the desired implementation.
- Specified by:
updateDurationin interfaceTimelineBlock- Parameters:
duration- the new duration
-
updateAbsoluteOffset
public void updateAbsoluteOffset(long absoluteOffset) Description copied from interface:TimelineBlockUpdates the absolute offset of this block. This block must only be updated whenTimelineBlock.isDynamic()returns true.Note: The default implementation does nothing. It can be overridden to provide the desired implementation.
- Specified by:
updateAbsoluteOffsetin interfaceTimelineBlock- Parameters:
absoluteOffset- the new absolute offset
-
updateRelativeOffset
public void updateRelativeOffset(long relativeOffset) Description copied from interface:TimelineBlockUpdates the relative offset of this block. This block must only be updated whenTimelineBlock.isDynamic()returns true.Note: The default implementation does nothing. It can be overridden to provide the desired implementation.
- Specified by:
updateRelativeOffsetin interfaceTimelineBlock- Parameters:
relativeOffset- the new relative offset
-
updateAdPod
Description copied from interface:TimelineBlockUpdates theAdPodof this block. This block must only be updated whenTimelineBlock.isDynamic()returns true.Note: The default implementation does nothing. It can be overridden to provide the desired implementation.
- Specified by:
updateAdPodin interfaceTimelineBlock- Parameters:
adPod- the new AdPod
-
toString
-