Skip to content

Most visited

Recently visited

navigation
added in version 22.1.0
belongs to Maven artifact com.android.support:mediarouter-v7:27.0.0

MediaItemStatus.Builder

public static final class MediaItemStatus.Builder
extends Object

java.lang.Object
   ↳ android.support.v7.media.MediaItemStatus.Builder


Builder for media item status objects.

Summary

Public constructors

MediaItemStatus.Builder(int playbackState)

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

MediaItemStatus.Builder(MediaItemStatus status)

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

Public methods

MediaItemStatus build()

Builds the media item status object.

MediaItemStatus.Builder setContentDuration(long durationMilliseconds)

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

MediaItemStatus.Builder setContentPosition(long positionMilliseconds)

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

MediaItemStatus.Builder setExtras(Bundle extras)

Sets a bundle of extras for this status object.

MediaItemStatus.Builder setPlaybackState(int playbackState)

Sets the playback state of the media item.

MediaItemStatus.Builder setTimestamp(long elapsedRealtimeTimestamp)

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

Inherited methods

From class java.lang.Object

Public constructors

MediaItemStatus.Builder

added in version 22.1.0
MediaItemStatus.Builder (int playbackState)

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

Parameters
playbackState int: The item playback state.

MediaItemStatus.Builder

added in version 22.1.0
MediaItemStatus.Builder (MediaItemStatus status)

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

Parameters
status MediaItemStatus

Public methods

build

added in version 22.1.0
MediaItemStatus build ()

Builds the media item status object.

Returns
MediaItemStatus

setContentDuration

added in version 22.1.0
MediaItemStatus.Builder setContentDuration (long durationMilliseconds)

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

Parameters
durationMilliseconds long

Returns
MediaItemStatus.Builder

setContentPosition

added in version 22.1.0
MediaItemStatus.Builder setContentPosition (long positionMilliseconds)

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

Parameters
positionMilliseconds long

Returns
MediaItemStatus.Builder

setExtras

added in version 22.1.0
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.

Parameters
extras Bundle

Returns
MediaItemStatus.Builder

setPlaybackState

added in version 22.1.0
MediaItemStatus.Builder setPlaybackState (int playbackState)

Sets the playback state of the media item.

Parameters
playbackState int

Returns
MediaItemStatus.Builder

setTimestamp

added in version 22.1.0
MediaItemStatus.Builder setTimestamp (long elapsedRealtimeTimestamp)

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

Parameters
elapsedRealtimeTimestamp long

Returns
MediaItemStatus.Builder

This site uses cookies to store your preferences for site-specific language and display options.

Get the latest Android developer news and tips that will help you find success on Google Play.

* Required Fields

Hooray!

Follow Google Developers on WeChat

Browse this site in ?

You requested a page in , but your language preference for this site is .

Would you like to change your language preference and browse this site in ? If you want to change your language preference later, use the language menu at the bottom of each page.

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a short survey?
Help us improve the Android developer experience.
(Sep 2017 survey)