MediaItemStatus.Builder
class MediaItemStatus.Builder
Builder for media item status objects.
Summary
Public constructors |
|---|
|
Creates a media item status builder using the current time as the reference timestamp. |
Builder(status: MediaItemStatus)Creates a media item status builder whose initial contents are copied from an existing status. |
Public functions |
|
|---|---|
MediaItemStatus |
build()Builds the |
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 |
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 |
Public constructors
Builder
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
Builder(status: MediaItemStatus)
Creates a media item status builder whose initial contents are copied from an existing status.
Public functions
setContentDuration
fun setContentDuration(durationMilliseconds: Long): MediaItemStatus.Builder
Sets the total duration of the content to be played as a long integer number of milliseconds.
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.
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.
setPlaybackState
fun setPlaybackState(playbackState: Int): MediaItemStatus.Builder
Sets the playback state of the media item.
setTimestamp
fun setTimestamp(elapsedRealtimeTimestamp: Long): MediaItemStatus.Builder
Sets the timestamp associated with the status information in milliseconds since boot in the elapsedRealtime time base.