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

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      long getAbsoluteOffset()
      Gets the absolute Block offset in milliseconds, that is, the offset with respect to the total video length (content + ads).
      AdPod getAdPod()
      If isAd() returns true, use this method to get additional information about the Ad Pod.
      long getDuration()
      Gets the duration of the block in milliseconds.
      long getRelativeOffset()
      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 isDynamic()
      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 the AdPod 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 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()
        If isAd() 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 when isDynamic() 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 when isDynamic() 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 when isDynamic() 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 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 the desired implementation.

        Parameters:
        adPod - the new AdPod