Builder

class Builder
kotlin.Any
   ↳ androidx.mediarouter.media.MediaItemStatus.Builder

Builder for media item status objects.

Summary

Public constructors
<init>(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 methods
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!
setContentDuration(durationMilliseconds: Long)

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

MediaItemStatus.Builder!
setExtras(extras: Bundle!)

Sets a bundle of extras for this status object.

MediaItemStatus.Builder!
setTimestamp(elapsedRealtimeTimestamp: Long)

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

MediaItemStatus.Builder!
setPlaybackState(playbackState: Int)

Sets the playback state of the media item.

MediaItemStatus!

Builds the media item status object.

Public constructors

<init>

Builder(playbackState: Int)

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

Parameters
playbackState Int: The item playback state.

<init>

Builder(status: MediaItemStatus!)

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

Public methods

setContentPosition

fun setContentPosition(positionMilliseconds: Long): MediaItemStatus.Builder!

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

setContentDuration

fun setContentDuration(durationMilliseconds: Long): MediaItemStatus.Builder!

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

setExtras

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.

setTimestamp

fun setTimestamp(elapsedRealtimeTimestamp: Long): MediaItemStatus.Builder!

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

setPlaybackState

fun setPlaybackState(playbackState: Int): MediaItemStatus.Builder!

Sets the playback state of the media item.

build

fun build(): MediaItemStatus!

Builds the media item status object.