Class FakeTimeline.TimelineWindowDefinition

  • Enclosing class:
    FakeTimeline

    public static final class FakeTimeline.TimelineWindowDefinition
    extends Object
    Definition used to define a FakeTimeline.
    • Field Detail

      • DEFAULT_WINDOW_DURATION_US

        public static final long DEFAULT_WINDOW_DURATION_US
        Default window duration in microseconds.
        See Also:
        Constant Field Values
      • DEFAULT_WINDOW_OFFSET_IN_FIRST_PERIOD_US

        public static final long DEFAULT_WINDOW_OFFSET_IN_FIRST_PERIOD_US
        Default offset of a window in its first period in microseconds.
        See Also:
        Constant Field Values
      • periodCount

        public final int periodCount
      • mediaItem

        public final MediaItem mediaItem
      • isSeekable

        public final boolean isSeekable
      • isDynamic

        public final boolean isDynamic
      • isLive

        public final boolean isLive
      • isPlaceholder

        public final boolean isPlaceholder
      • durationUs

        public final long durationUs
      • defaultPositionUs

        public final long defaultPositionUs
      • windowOffsetInFirstPeriodUs

        public final long windowOffsetInFirstPeriodUs
    • Constructor Detail

      • TimelineWindowDefinition

        public TimelineWindowDefinition​(int periodCount,
                                        Object id)
        Creates a seekable, non-dynamic window definition with a duration of DEFAULT_WINDOW_DURATION_US.
        Parameters:
        periodCount - The number of periods in the window. Each period get an equal slice of the total window duration.
        id - The UID of the window.
      • TimelineWindowDefinition

        public TimelineWindowDefinition​(boolean isSeekable,
                                        boolean isDynamic,
                                        long durationUs)
        Creates a window definition with one period.
        Parameters:
        isSeekable - Whether the window is seekable.
        isDynamic - Whether the window is dynamic.
        durationUs - The duration of the window in microseconds.
      • TimelineWindowDefinition

        public TimelineWindowDefinition​(int periodCount,
                                        Object id,
                                        boolean isSeekable,
                                        boolean isDynamic,
                                        long durationUs)
        Creates a window definition.
        Parameters:
        periodCount - The number of periods in the window. Each period get an equal slice of the total window duration.
        id - The UID of the window.
        isSeekable - Whether the window is seekable.
        isDynamic - Whether the window is dynamic.
        durationUs - The duration of the window in microseconds.
      • TimelineWindowDefinition

        public TimelineWindowDefinition​(int periodCount,
                                        Object id,
                                        boolean isSeekable,
                                        boolean isDynamic,
                                        long durationUs,
                                        AdPlaybackState adPlaybackState)
        Creates a window definition with ad groups.
        Parameters:
        periodCount - The number of periods in the window. Each period get an equal slice of the total window duration.
        id - The UID of the window.
        isSeekable - Whether the window is seekable.
        isDynamic - Whether the window is dynamic.
        durationUs - The duration of the window in microseconds.
        adPlaybackState - The ad playback state.
      • TimelineWindowDefinition

        public TimelineWindowDefinition​(int periodCount,
                                        Object id,
                                        boolean isSeekable,
                                        boolean isDynamic,
                                        boolean isLive,
                                        boolean isPlaceholder,
                                        long durationUs,
                                        long defaultPositionUs,
                                        long windowOffsetInFirstPeriodUs,
                                        AdPlaybackState adPlaybackState)
        Creates a window definition with ad groups.
        Parameters:
        periodCount - The number of periods in the window. Each period get an equal slice of the total window duration.
        id - The UID of the window.
        isSeekable - Whether the window is seekable.
        isDynamic - Whether the window is dynamic.
        isLive - Whether the window is live.
        isPlaceholder - Whether the window is a placeholder.
        durationUs - The duration of the window in microseconds.
        defaultPositionUs - The default position of the window in microseconds.
        windowOffsetInFirstPeriodUs - The offset of the window in the first period, in microseconds.
        adPlaybackState - The ad playback state.
      • TimelineWindowDefinition

        public TimelineWindowDefinition​(int periodCount,
                                        Object id,
                                        boolean isSeekable,
                                        boolean isDynamic,
                                        boolean isLive,
                                        boolean isPlaceholder,
                                        long durationUs,
                                        long defaultPositionUs,
                                        long windowOffsetInFirstPeriodUs,
                                        AdPlaybackState adPlaybackState,
                                        MediaItem mediaItem)
        Creates a window definition with ad groups and a custom media item.
        Parameters:
        periodCount - The number of periods in the window. Each period get an equal slice of the total window duration.
        id - The UID of the window.
        isSeekable - Whether the window is seekable.
        isDynamic - Whether the window is dynamic.
        isLive - Whether the window is live.
        isPlaceholder - Whether the window is a placeholder.
        durationUs - The duration of the window in microseconds.
        defaultPositionUs - The default position of the window in microseconds.
        windowOffsetInFirstPeriodUs - The offset of the window in the first period, in microseconds.
        adPlaybackState - The ad playback state.
        mediaItem - The media item to include in the timeline.
    • Method Detail

      • createPlaceholder

        public static FakeTimeline.TimelineWindowDefinition createPlaceholder​(Object tag)
        Creates a window definition that corresponds to a placeholder timeline using the given tag.
        Parameters:
        tag - The tag to use in the timeline.