public final class

MediaItemStatus.Builder

extends java.lang.Object

 java.lang.Object

↳androidx.mediarouter.media.MediaItemStatus.Builder

Overview

Builder for media item status objects.

Summary

Constructors
publicBuilder(int playbackState)

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

publicBuilder(MediaItemStatus status)

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

Methods
public MediaItemStatusbuild()

Builds the media item status object.

public MediaItemStatus.BuildersetContentDuration(long durationMilliseconds)

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

public MediaItemStatus.BuildersetContentPosition(long positionMilliseconds)

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

public MediaItemStatus.BuildersetExtras(Bundle extras)

Sets a bundle of extras for this status object.

public MediaItemStatus.BuildersetPlaybackState(int playbackState)

Sets the playback state of the media item.

public MediaItemStatus.BuildersetTimestamp(long elapsedRealtimeTimestamp)

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

from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructors

public Builder(int playbackState)

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

Parameters:

playbackState: The item playback state.

public Builder(MediaItemStatus status)

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

Methods

public MediaItemStatus.Builder setTimestamp(long elapsedRealtimeTimestamp)

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

public MediaItemStatus.Builder setPlaybackState(int playbackState)

Sets the playback state of the media item.

public MediaItemStatus.Builder setContentPosition(long positionMilliseconds)

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

public MediaItemStatus.Builder setContentDuration(long durationMilliseconds)

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

public MediaItemStatus.Builder setExtras(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.

public MediaItemStatus build()

Builds the media item status object.