-
- All Implemented Interfaces:
-
com.brightcove.ssai.timeline.block.TimelineBlock
public class ContentBlock implements TimelineBlock
A timeline block representing video content.
-
-
Method Summary
Modifier and Type Method Description static ContentBlock
create(long durationMs, long absoluteOffsetMs, long relativeOffsetMs)
Instantiates a new Content block. static ContentBlock
create(long durationMs, long absoluteOffsetMs, long relativeOffsetMs, @NonNull() AdPod adPod)
Instantiates a new Content block. static ContentBlock
createDynamicBlock()
boolean
isAd()
Specify if the block is an Ad. AdPod
getAdPod()
If isAd returns true, use this method to get additional information about theAd Pod. long
getDuration()
Gets the duration of the block in milliseconds. long
getAbsoluteOffset()
Gets the absolute Block offset in milliseconds, that is,the offset with respect to the total video length (content + ads). long
getRelativeOffset()
Gets the relative Block offset in milliseconds, that is,the offset with respect to the content length only (no Ads). boolean
isDynamic()
Returns whether the Timeline block is dynamic or not. void
updateDuration(long duration)
Updates the duration of this block. void
updateAbsoluteOffset(long absoluteOffset)
Updates the absolute offset of this block. void
updateRelativeOffset(long relativeOffset)
Updates the relative offset of this block. void
updateAdPod(@NonNull() AdPod adPod)
Updates the AdPod of this block. String
toString()
-
-
Method Detail
-
create
static ContentBlock create(long durationMs, long absoluteOffsetMs, long relativeOffsetMs)
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.
-
create
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-null AdPod.
-
createDynamicBlock
static ContentBlock createDynamicBlock()
-
isAd
boolean isAd()
Specify if the block is an Ad.
-
getAdPod
@NonNull() AdPod getAdPod()
If isAd returns true, use this method to get additional information about theAd Pod.
-
getDuration
long getDuration()
Gets the duration of the block in milliseconds.
-
getAbsoluteOffset
long getAbsoluteOffset()
Gets the absolute Block offset in milliseconds, that is,the offset with respect to the total video length (content + ads).
-
getRelativeOffset
long getRelativeOffset()
Gets the relative Block offset in milliseconds, that is,the offset with respect to the content length only (no Ads).
-
isDynamic
boolean isDynamic()
Returns whether the Timeline block is dynamic or not.
Note: The default implementation returns false.
-
updateDuration
void updateDuration(long duration)
Updates the duration of this block.This block must only be updated when isDynamic returns true.
Note: The default implementation does nothing. It can be overridden to provide thedesired implementation.
- Parameters:
duration
- the new duration
-
updateAbsoluteOffset
void updateAbsoluteOffset(long absoluteOffset)
Updates the absolute offset of this block.This block must only be updated when isDynamic returns true.
Note: The default implementation does nothing. It can be overridden to provide thedesired implementation.
- Parameters:
absoluteOffset
- the new absolute offset
-
updateRelativeOffset
void updateRelativeOffset(long relativeOffset)
Updates the relative offset of this block.This block must only be updated when isDynamic returns true.
Note: The default implementation does nothing. It can be overridden to provide thedesired implementation.
- Parameters:
relativeOffset
- the new relative offset
-
updateAdPod
void updateAdPod(@NonNull() AdPod adPod)
Updates the AdPod of this block.This block must only be updated when isDynamic returns true.
Note: The default implementation does nothing. It can be overridden to provide thedesired implementation.
- Parameters:
adPod
- the new AdPod
-
-
-
-