Interface TimelineBlock
-
- All Known Implementing Classes:
AdBlock,ContentBlock
public interface TimelineBlockA 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
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description longgetAbsoluteOffset()Gets the absolute Block offset in milliseconds, that is, the offset with respect to the total video length (content + ads).AdPodgetAdPod()IfisAd()returns true, use this method to get additional information about the Ad Pod.longgetDuration()Gets the duration of the block in milliseconds.longgetRelativeOffset()Gets 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.default booleanisDynamic()Returns whether the Timeline block is dynamic or not.default voidupdateAbsoluteOffset(long absoluteOffset)Updates the absolute offset of this block.default voidupdateAdPod(AdPod adPod)Updates theAdPodof this block.default voidupdateDuration(long duration)Updates the duration of this block.default voidupdateRelativeOffset(long relativeOffset)Updates the relative offset of this block.
-
-
-
Method Detail
-
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
@NonNull AdPod 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
default void updateAdPod(@NonNull AdPod adPod)Updates theAdPodof 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
-
-