SimpleBasePlayer.MediaItemData.Builder


class SimpleBasePlayer.MediaItemData.Builder


A builder for MediaItemData objects.

Summary

Public constructors

Builder(uid: Any!)

Creates the builder.

Public functions

SimpleBasePlayer.MediaItemData!

Builds the MediaItemData.

SimpleBasePlayer.MediaItemData.Builder!

Sets the default position relative to the start of the media item at which to begin playback, in microseconds.

SimpleBasePlayer.MediaItemData.Builder!

Sets the duration of the media item, in microseconds.

SimpleBasePlayer.MediaItemData.Builder!

Sets the offset between elapsedRealtime and the time since the Unix epoch according to the clock of the media origin server.

SimpleBasePlayer.MediaItemData.Builder!

Sets whether this media item may change over time, for example a moving live window.

SimpleBasePlayer.MediaItemData.Builder!

Sets whether this media item contains placeholder information because the real information has yet to be loaded.

SimpleBasePlayer.MediaItemData.Builder!

Sets whether it's possible to seek within this media item.

SimpleBasePlayer.MediaItemData.Builder!

Sets the active MediaItem.LiveConfiguration, or null if the media item is not live.

SimpleBasePlayer.MediaItemData.Builder!

Sets the manifest of the media item.

SimpleBasePlayer.MediaItemData.Builder!

Sets the MediaItem.

SimpleBasePlayer.MediaItemData.Builder!

Sets the MediaMetadata.

SimpleBasePlayer.MediaItemData.Builder!

Sets the list of periods in this media item.

SimpleBasePlayer.MediaItemData.Builder!

Sets the position of the start of this media item relative to the start of the first period belonging to it, in microseconds.

SimpleBasePlayer.MediaItemData.Builder!

Sets the start time of the live presentation.

SimpleBasePlayer.MediaItemData.Builder!

Sets the Tracks of this media item.

SimpleBasePlayer.MediaItemData.Builder!

Sets the unique identifier of this media item within a playlist.

SimpleBasePlayer.MediaItemData.Builder!

Sets the start time of the live window.

Public constructors

Builder

Builder(uid: Any!)

Creates the builder.

Parameters
uid: Any!

The unique identifier of the media item within a playlist. This value will be set as uid for this item.

Public functions

build

fun build(): SimpleBasePlayer.MediaItemData!

Builds the MediaItemData.

setDefaultPositionUs

@CanIgnoreReturnValue
fun setDefaultPositionUs(defaultPositionUs: Long): SimpleBasePlayer.MediaItemData.Builder!

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, if set.

Parameters
defaultPositionUs: Long

The default position relative to the start of the media item at which to begin playback, in microseconds.

setDurationUs

@CanIgnoreReturnValue
fun setDurationUs(durationUs: Long): SimpleBasePlayer.MediaItemData.Builder!

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: Long

The duration of the media item, in microseconds, or TIME_UNSET if unknown.

setElapsedRealtimeEpochOffsetMs

@CanIgnoreReturnValue
fun setElapsedRealtimeEpochOffsetMs(elapsedRealtimeEpochOffsetMs: Long): SimpleBasePlayer.MediaItemData.Builder!

Sets the offset between 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 TIME_UNSET if the stream is live.

Parameters
elapsedRealtimeEpochOffsetMs: Long

The offset between elapsedRealtime and the time since the Unix epoch according to the clock of the media origin server, or TIME_UNSET if unknown or not applicable.

setIsDynamic

@CanIgnoreReturnValue
fun setIsDynamic(isDynamic: Boolean): SimpleBasePlayer.MediaItemData.Builder!

Sets whether this media item may change over time, for example a moving live window.

Parameters
isDynamic: Boolean

Whether this media item may change over time, for example a moving live window.

setIsPlaceholder

@CanIgnoreReturnValue
fun setIsPlaceholder(isPlaceholder: Boolean): SimpleBasePlayer.MediaItemData.Builder!

Sets whether this media item contains placeholder information because the real information has yet to be loaded.

Parameters
isPlaceholder: Boolean

Whether this media item contains placeholder information because the real information has yet to be loaded.

setIsSeekable

@CanIgnoreReturnValue
fun setIsSeekable(isSeekable: Boolean): SimpleBasePlayer.MediaItemData.Builder!

Sets whether it's possible to seek within this media item.

Parameters
isSeekable: Boolean

Whether it's possible to seek within this media item.

setLiveConfiguration

@CanIgnoreReturnValue
fun setLiveConfiguration(liveConfiguration: MediaItem.LiveConfiguration?): SimpleBasePlayer.MediaItemData.Builder!

Sets the active MediaItem.LiveConfiguration, or null if the media item is not live.

Parameters
liveConfiguration: MediaItem.LiveConfiguration?

The active MediaItem.LiveConfiguration, or null if the media item is not live.

setManifest

@CanIgnoreReturnValue
fun setManifest(manifest: Any?): SimpleBasePlayer.MediaItemData.Builder!

Sets the manifest of the media item.

Parameters
manifest: Any?

The manifest of the media item, or null if not applicable.

setMediaItem

@CanIgnoreReturnValue
fun setMediaItem(mediaItem: MediaItem!): SimpleBasePlayer.MediaItemData.Builder!

Sets the MediaItem.

Parameters
mediaItem: MediaItem!

The MediaItem.

setMediaMetadata

@CanIgnoreReturnValue
fun setMediaMetadata(mediaMetadata: MediaMetadata?): SimpleBasePlayer.MediaItemData.Builder!

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: 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.

setPeriods

@CanIgnoreReturnValue
fun setPeriods(periods: (Mutable)List<SimpleBasePlayer.PeriodData!>!): SimpleBasePlayer.MediaItemData.Builder!

Sets the list of periods in this media item.

All periods must have unique UIDs and only the last period is allowed to have an unset duration.

Parameters
periods: (Mutable)List<SimpleBasePlayer.PeriodData!>!

The list of periods in this media item, or an empty list to assume a single period without ads and the same duration as the media item.

setPositionInFirstPeriodUs

@CanIgnoreReturnValue
fun setPositionInFirstPeriodUs(positionInFirstPeriodUs: Long): SimpleBasePlayer.MediaItemData.Builder!

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: Long

The position of the start of this media item relative to the start of the first period belonging to it, in microseconds.

setPresentationStartTimeMs

@CanIgnoreReturnValue
fun setPresentationStartTimeMs(presentationStartTimeMs: Long): SimpleBasePlayer.MediaItemData.Builder!

Sets the start time of the live presentation.

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

Parameters
presentationStartTimeMs: Long

The start time of the live presentation, in milliseconds since the Unix epoch, or TIME_UNSET if unknown or not applicable.

setTracks

@CanIgnoreReturnValue
fun setTracks(tracks: Tracks!): SimpleBasePlayer.MediaItemData.Builder!

Sets the Tracks of this media item.

Parameters
tracks: Tracks!

The Tracks of this media item.

setUid

@CanIgnoreReturnValue
fun setUid(uid: Any!): SimpleBasePlayer.MediaItemData.Builder!

Sets the unique identifier of this media item within a playlist.

This value will be set as uid for this item.

Parameters
uid: Any!

The unique identifier of this media item within a playlist.

setWindowStartTimeMs

@CanIgnoreReturnValue
fun setWindowStartTimeMs(windowStartTimeMs: Long): SimpleBasePlayer.MediaItemData.Builder!

Sets the start time of the live window.

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

Parameters
windowStartTimeMs: Long

The start time of the live window, in milliseconds since the Unix epoch, or TIME_UNSET if unknown or not applicable.