Class AdBlock
java.lang.Object
com.brightcove.ssai.timeline.block.AdBlock
- All Implemented Interfaces:
TimelineBlock
A timeline block representing an Ad.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionlong
Gets 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.long
Gets the duration of the block in milliseconds.long
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
Returns whether the Timeline block is dynamic or not.toString()
void
updateAbsoluteOffset
(long absoluteOffset) Updates the absolute offset of this block.void
updateAdPod
(AdPod adPod) Updates theAdPod
of this block.void
updateDuration
(long duration) Updates the duration of this block.void
updateRelativeOffset
(long relativeOffset) Updates the relative offset of this block.
-
Constructor Details
-
AdBlock
Instantiates a new Ad block. -
AdBlock
Instantiates a new Ad block.
-
-
Method Details
-
getDuration
public long getDuration()Description copied from interface:TimelineBlock
Gets the duration of the block in milliseconds.- Specified by:
getDuration
in interfaceTimelineBlock
- Returns:
- the duration.
-
getAbsoluteOffset
public long getAbsoluteOffset()Description copied from interface:TimelineBlock
Gets the absolute Block offset in milliseconds, that is, the offset with respect to the total video length (content + ads).- Specified by:
getAbsoluteOffset
in interfaceTimelineBlock
- Returns:
- the offset in milliseconds.
-
getRelativeOffset
public long getRelativeOffset()Description copied from interface:TimelineBlock
Gets the relative Block offset in milliseconds, that is, the offset with respect to the content length only (no Ads).- Specified by:
getRelativeOffset
in interfaceTimelineBlock
- Returns:
- the offset in milliseconds.
-
isAd
public boolean isAd()Description copied from interface:TimelineBlock
Specify if the block is an Ad.- Specified by:
isAd
in interfaceTimelineBlock
- Returns:
- true if an Ad.
-
getAdPod
Description copied from interface:TimelineBlock
IfTimelineBlock.isAd()
returns true, use this method to get additional information about the Ad Pod.- Specified by:
getAdPod
in interfaceTimelineBlock
- Returns:
- the Ad Pod info
-
isDynamic
public boolean isDynamic()Description copied from interface:TimelineBlock
Returns whether the Timeline block is dynamic or not.Note: The default implementation returns false.
- Specified by:
isDynamic
in interfaceTimelineBlock
- Returns:
- true if it is dynamic
-
updateDuration
public void updateDuration(long duration) Description copied from interface:TimelineBlock
Updates 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:
updateDuration
in interfaceTimelineBlock
- Parameters:
duration
- the new duration
-
updateAbsoluteOffset
public void updateAbsoluteOffset(long absoluteOffset) Description copied from interface:TimelineBlock
Updates 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:
updateAbsoluteOffset
in interfaceTimelineBlock
- Parameters:
absoluteOffset
- the new absolute offset
-
updateRelativeOffset
public void updateRelativeOffset(long relativeOffset) Description copied from interface:TimelineBlock
Updates 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:
updateRelativeOffset
in interfaceTimelineBlock
- Parameters:
relativeOffset
- the new relative offset
-
updateAdPod
Description copied from interface:TimelineBlock
Updates theAdPod
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:
updateAdPod
in interfaceTimelineBlock
- Parameters:
adPod
- the new AdPod
-
toString
-