MediaItemStatus.Builder


class MediaItemStatus.Builder


Builder for media item status objects.

Summary

Public constructors

Builder(playbackState: Int)

Creates a media item status builder using the current time as the reference timestamp.

Creates a media item status builder whose initial contents are copied from an existing status.

Public functions

MediaItemStatus

Builds the media item status object.

MediaItemStatus.Builder
setContentDuration(durationMilliseconds: Long)

Sets the total duration of the content to be played as a long integer number of milliseconds.

MediaItemStatus.Builder
setContentPosition(positionMilliseconds: Long)

Sets the content playback position as a long integer number of milliseconds from the beginning of the content.

MediaItemStatus.Builder
setExtras(extras: Bundle?)

Sets a bundle of extras for this status object.

MediaItemStatus.Builder
setPlaybackState(playbackState: Int)

Sets the playback state of the media item.

MediaItemStatus.Builder
setTimestamp(elapsedRealtimeTimestamp: Long)

Sets the timestamp associated with the status information in milliseconds since boot in the elapsedRealtime time base.

Public constructors

Builder

Added in 1.1.0
Builder(playbackState: Int)

Creates a media item status builder using the current time as the reference timestamp.

Parameters
playbackState: Int

The item playback state.

Builder

Added in 1.1.0
Builder(status: MediaItemStatus)

Creates a media item status builder whose initial contents are copied from an existing status.

Public functions

build

Added in 1.1.0
fun build(): MediaItemStatus

Builds the media item status object.

setContentDuration

Added in 1.1.0
fun setContentDuration(durationMilliseconds: Long): MediaItemStatus.Builder

Sets the total duration of the content to be played as a long integer number of milliseconds.

setContentPosition

Added in 1.1.0
fun setContentPosition(positionMilliseconds: Long): MediaItemStatus.Builder

Sets the content playback position as a long integer number of milliseconds from the beginning of the content.

setExtras

Added in 1.1.0
fun setExtras(extras: Bundle?): MediaItemStatus.Builder

Sets a bundle of extras for this status object. The extras will be ignored by the media router but they may be used by applications.

setPlaybackState

Added in 1.1.0
fun setPlaybackState(playbackState: Int): MediaItemStatus.Builder

Sets the playback state of the media item.

setTimestamp

Added in 1.1.0
fun setTimestamp(elapsedRealtimeTimestamp: Long): MediaItemStatus.Builder

Sets the timestamp associated with the status information in milliseconds since boot in the elapsedRealtime time base.