Interface TimelineBlock
- All Known Implementing Classes:
AdBlock
,ContentBlock
public interface TimelineBlock
A Timeline block represents linear and delimited part of a Timeline.
It may represent content of a Video, or it can represent an Ad, such as preroll, midroll or postroll.
-
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()
IfisAd()
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.default boolean
Returns whether the Timeline block is dynamic or not.default void
updateAbsoluteOffset
(long absoluteOffset) Updates the absolute offset of this block.default void
updateAdPod
(AdPod adPod) Updates theAdPod
of this block.default void
updateDuration
(long duration) Updates the duration of this block.default void
updateRelativeOffset
(long relativeOffset) Updates the relative offset of this block.
-
Method Details
-
getDuration
long getDuration()Gets the duration of the block in milliseconds.- Returns:
- the duration.
-
getAbsoluteOffset
long getAbsoluteOffset()Gets the absolute Block offset in milliseconds, that is, the offset with respect to the total video length (content + ads).- Returns:
- the offset in milliseconds.
-
getRelativeOffset
long getRelativeOffset()Gets the relative Block offset in milliseconds, that is, the offset with respect to the content length only (no Ads).- Returns:
- the offset in milliseconds.
-
isAd
boolean isAd()Specify if the block is an Ad.- Returns:
- true if an Ad.
-
getAdPod
IfisAd()
returns true, use this method to get additional information about the Ad Pod.- Returns:
- the Ad Pod info
-
isDynamic
default boolean isDynamic()Returns whether the Timeline block is dynamic or not.Note: The default implementation returns false.
- Returns:
- true if it is dynamic
-
updateDuration
default void updateDuration(long duration) Updates the duration of this block. This block must only be updated whenisDynamic()
returns true.Note: The default implementation does nothing. It can be overridden to provide the desired implementation.
- Parameters:
duration
- the new duration
-
updateAbsoluteOffset
default void updateAbsoluteOffset(long absoluteOffset) Updates the absolute offset of this block. This block must only be updated whenisDynamic()
returns true.Note: The default implementation does nothing. It can be overridden to provide the desired implementation.
- Parameters:
absoluteOffset
- the new absolute offset
-
updateRelativeOffset
default void updateRelativeOffset(long relativeOffset) Updates the relative offset of this block. This block must only be updated whenisDynamic()
returns true.Note: The default implementation does nothing. It can be overridden to provide the desired implementation.
- Parameters:
relativeOffset
- the new relative offset
-
updateAdPod
Updates theAdPod
of this block. This block must only be updated whenisDynamic()
returns true.Note: The default implementation does nothing. It can be overridden to provide the desired implementation.
- Parameters:
adPod
- the new AdPod
-