MediaItemStatus.Builder


public final class MediaItemStatus.Builder


Builder for media item status objects.

Summary

Public constructors

Builder(int playbackState)

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

@NonNull MediaItemStatus

Builds the media item status object.

@NonNull MediaItemStatus.Builder
setContentDuration(long durationMilliseconds)

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

@NonNull MediaItemStatus.Builder
setContentPosition(long positionMilliseconds)

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

@NonNull MediaItemStatus.Builder

Sets a bundle of extras for this status object.

@NonNull MediaItemStatus.Builder
setPlaybackState(int playbackState)

Sets the playback state of the media item.

@NonNull MediaItemStatus.Builder
setTimestamp(long elapsedRealtimeTimestamp)

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
public Builder(int playbackState)

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

Parameters
int playbackState

The item playback state.

Builder

Added in 1.1.0
public Builder(@NonNull MediaItemStatus status)

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

Public methods

build

Added in 1.1.0
public @NonNull MediaItemStatus build()

Builds the media item status object.

setContentDuration

Added in 1.1.0
public @NonNull MediaItemStatus.Builder setContentDuration(long durationMilliseconds)

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

setContentPosition

Added in 1.1.0
public @NonNull MediaItemStatus.Builder setContentPosition(long positionMilliseconds)

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

setExtras

Added in 1.1.0
public @NonNull MediaItemStatus.Builder setExtras(@Nullable Bundle extras)

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
public @NonNull MediaItemStatus.Builder setPlaybackState(int playbackState)

Sets the playback state of the media item.

setTimestamp

Added in 1.1.0
public @NonNull MediaItemStatus.Builder setTimestamp(long elapsedRealtimeTimestamp)

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