Class SimpleBasePlayer.MediaItemData.Builder

    • Constructor Detail

      • Builder

        public Builder​(Object uid)
        Creates the builder.
        Parameters:
        uid - The unique identifier of the media item within a playlist. This value will be set as Timeline.Window.uid for this item.
    • Method Detail

      • setUid

        @CanIgnoreReturnValue
        public SimpleBasePlayer.MediaItemData.Builder setUid​(Object uid)
        Sets the unique identifier of this media item within a playlist.

        This value will be set as Timeline.Window.uid for this item.

        Parameters:
        uid - The unique identifier of this media item within a playlist.
        Returns:
        This builder.
      • setMediaMetadata

        @CanIgnoreReturnValue
        public SimpleBasePlayer.MediaItemData.Builder setMediaMetadata​(@Nullable
                                                                       MediaMetadata mediaMetadata)
        Sets the MediaMetadata.

        This data includes static data from the MediaItem and the media's Format, as well any dynamic metadata that has been parsed from the media. If null, the metadata is assumed to be the simple combination of the MediaItem metadata and the metadata of the selected Formats.

        Parameters:
        mediaMetadata - The MediaMetadata, or null to assume that the metadata is the simple combination of the MediaItem metadata and the metadata of the selected Formats.
        Returns:
        This builder.
      • setManifest

        @CanIgnoreReturnValue
        public SimpleBasePlayer.MediaItemData.Builder setManifest​(@Nullable
                                                                  Object manifest)
        Sets the manifest of the media item.
        Parameters:
        manifest - The manifest of the media item, or null if not applicable.
        Returns:
        This builder.
      • setPresentationStartTimeMs

        @CanIgnoreReturnValue
        public SimpleBasePlayer.MediaItemData.Builder setPresentationStartTimeMs​(long presentationStartTimeMs)
        Sets the start time of the live presentation.

        This value can only be set to anything other than C.TIME_UNSET if the stream is live.

        Parameters:
        presentationStartTimeMs - The start time of the live presentation, in milliseconds since the Unix epoch, or C.TIME_UNSET if unknown or not applicable.
        Returns:
        This builder.
      • setWindowStartTimeMs

        @CanIgnoreReturnValue
        public SimpleBasePlayer.MediaItemData.Builder setWindowStartTimeMs​(long windowStartTimeMs)
        Sets the start time of the live window.

        This value can only be set to anything other than C.TIME_UNSET if the stream is live. The value should also be greater or equal than the presentation start time, if set.

        Parameters:
        windowStartTimeMs - The start time of the live window, in milliseconds since the Unix epoch, or C.TIME_UNSET if unknown or not applicable.
        Returns:
        This builder.
      • setElapsedRealtimeEpochOffsetMs

        @CanIgnoreReturnValue
        public SimpleBasePlayer.MediaItemData.Builder setElapsedRealtimeEpochOffsetMs​(long elapsedRealtimeEpochOffsetMs)
        Sets the offset between SystemClock.elapsedRealtime() and the time since the Unix epoch according to the clock of the media origin server.

        This value can only be set to anything other than C.TIME_UNSET if the stream is live.

        Parameters:
        elapsedRealtimeEpochOffsetMs - The offset between SystemClock.elapsedRealtime() and the time since the Unix epoch according to the clock of the media origin server, or C.TIME_UNSET if unknown or not applicable.
        Returns:
        This builder.
      • setIsSeekable

        @CanIgnoreReturnValue
        public SimpleBasePlayer.MediaItemData.Builder setIsSeekable​(boolean isSeekable)
        Sets whether it's possible to seek within this media item.
        Parameters:
        isSeekable - Whether it's possible to seek within this media item.
        Returns:
        This builder.
      • setIsDynamic

        @CanIgnoreReturnValue
        public SimpleBasePlayer.MediaItemData.Builder setIsDynamic​(boolean isDynamic)
        Sets whether this media item may change over time, for example a moving live window.
        Parameters:
        isDynamic - Whether this media item may change over time, for example a moving live window.
        Returns:
        This builder.
      • setDefaultPositionUs

        @CanIgnoreReturnValue
        public SimpleBasePlayer.MediaItemData.Builder setDefaultPositionUs​(long defaultPositionUs)
        Sets the default position relative to the start of the media item at which to begin playback, in microseconds.

        The default position must be less or equal to the duration, is set.

        Parameters:
        defaultPositionUs - The default position relative to the start of the media item at which to begin playback, in microseconds.
        Returns:
        This builder.
      • setDurationUs

        @CanIgnoreReturnValue
        public SimpleBasePlayer.MediaItemData.Builder setDurationUs​(long durationUs)
        Sets the duration of the media item, in microseconds.

        If both this duration and all period durations are set, the sum of this duration and the offset in the first period must match the total duration of all periods.

        Parameters:
        durationUs - The duration of the media item, in microseconds, or C.TIME_UNSET if unknown.
        Returns:
        This builder.
      • setPositionInFirstPeriodUs

        @CanIgnoreReturnValue
        public SimpleBasePlayer.MediaItemData.Builder setPositionInFirstPeriodUs​(long positionInFirstPeriodUs)
        Sets the position of the start of this media item relative to the start of the first period belonging to it, in microseconds.
        Parameters:
        positionInFirstPeriodUs - The position of the start of this media item relative to the start of the first period belonging to it, in microseconds.
        Returns:
        This builder.
      • setIsPlaceholder

        @CanIgnoreReturnValue
        public SimpleBasePlayer.MediaItemData.Builder setIsPlaceholder​(boolean isPlaceholder)
        Sets whether this media item contains placeholder information because the real information has yet to be loaded.
        Parameters:
        isPlaceholder - Whether this media item contains placeholder information because the real information has yet to be loaded.
        Returns:
        This builder.