MediaQueueItem.Builder

public static class MediaQueueItem.Builder extends Object

A builder for MediaQueueItem objects.

Public Constructor Summary

MediaQueueItem.Builder(MediaInfo media)
Constructs a new Builder with the given MediaInfo.
MediaQueueItem.Builder(JSONObject json)
Constructs a new Builder from the given JSONObject.
MediaQueueItem.Builder(MediaQueueItem item)
Copy constructor, reads defaults from provided MediaQueueItem.

Public Method Summary

MediaQueueItem
build()
Builds and returns the MediaQueueItem object.
MediaQueueItem.Builder
clearItemId()
Optional.
MediaQueueItem.Builder
setActiveTrackIds(long[] activeTrackIds)
Optional.
MediaQueueItem.Builder
setAutoplay(boolean autoplay)
Optional.
MediaQueueItem.Builder
setCustomData(JSONObject customData)
Optional.
MediaQueueItem.Builder
setPlaybackDuration(double playbackDuration)
Optional.
MediaQueueItem.Builder
setPreloadTime(double preloadTime)
Optional.
MediaQueueItem.Builder
setStartTime(double startTime)
Optional.

Inherited Method Summary

Public Constructors

public MediaQueueItem.Builder (MediaInfo media)

Constructs a new Builder with the given MediaInfo.

Throws
IllegalArgumentException If the MediaInfo is null.

public MediaQueueItem.Builder (JSONObject json)

Constructs a new Builder from the given JSONObject.

Throws
JSONException if any JSON parsing error.

public MediaQueueItem.Builder (MediaQueueItem item)

Copy constructor, reads defaults from provided MediaQueueItem.

Throws
IllegalArgumentException If the getMedia() is null.

Public Methods

public MediaQueueItem build ()

Builds and returns the MediaQueueItem object.

Throws
IllegalArgumentException If all required fields have not been populated with valid values.

public MediaQueueItem.Builder clearItemId ()

Optional. Sets the item ID TO INVALID_ITEM_ID.

public MediaQueueItem.Builder setActiveTrackIds (long[] activeTrackIds)

Optional. Sets the list of active track IDs.

public MediaQueueItem.Builder setAutoplay (boolean autoplay)

Optional. Sets the autoplay preference.

public MediaQueueItem.Builder setCustomData (JSONObject customData)

Optional. Sets the custom application-specific data.

public MediaQueueItem.Builder setPlaybackDuration (double playbackDuration)

Optional. Sets the playback duration, in seconds.

public MediaQueueItem.Builder setPreloadTime (double preloadTime)

Optional. Sets the preload hint, in seconds.

Throws
IllegalArgumentException If the preload time is negative.

public MediaQueueItem.Builder setStartTime (double startTime)

Optional. Sets the start position of the stream, in seconds.

Throws
IllegalArgumentException If the start time is negative.