Summary: Nested Classes | Constants | Inherited Constants | Fields | Methods | Inherited Methods | [Expand All]
public class

# MediaQueueItem

extends Object
implements SafeParcelable

java.lang.Object
↳ | com.google.android.gms.cast.MediaQueueItem

## Class Overview

A class that aggregates information about an item in a media queue. Use `MediaQueueItem.Builder` to build an instance of this class.

`MediaQueueItem` is used in two-way communication between a sender application and a receiver application. Sender constructs them to load or insert a list of media items on the receiver application. The `MediaStatus` from the receiver also contains the list of items represented as `MediaQueueItem`.

Once loaded, the receiver will assign an unique item ID to each `MediaQueueItem`, even if the same media gets loaded multiple times.

## Summary

Nested Classes
class | MediaQueueItem.Builder | A builder for `MediaQueueItem` objects.

Constants
double | DEFAULT_PLAYBACK_DURATION | A constant indicating the actual playback duration will not be overridden.
int | INVALID_ITEM_ID | A constant indicating the item ID is invalid or unassigned.

[Expand] Inherited Constants
From interface com.google.android.gms.common.internal.safeparcel.SafeParcelable
String | NULL |
From interface android.os.Parcelable
int | CONTENTS_FILE_DESCRIPTOR |
int | PARCELABLE_WRITE_RETURN_VALUE |

Fields
public static final Creator<MediaQueueItem> | CREATOR |

Public Methods
boolean | equals(Object other)
long[] | getActiveTrackIds() Returns the list of active media tracks, or `null` if none have been specified.
boolean | getAutoplay() Returns the autoplay state.
JSONObject | getCustomData() Returns the custom data, if any.
int | getItemId() Returns the item ID, or `INVALID_ITEM_ID` if not assigned.
MediaInfo | getMedia() Returns the `MediaInfo` information associated with this queue item.
double | getPlaybackDuration() Returns the playback duration in seconds.
double | getPreloadTime() Returns the preload time in seconds.
double | getStartTime() Returns the start time of the item in seconds.
int | hashCode()
void | writeToParcel(Parcel out, int flags)

[Expand] Inherited Methods
From class java.lang.Object
Object | clone()
boolean | equals(Object arg0)
void | finalize()
final Class<?> | getClass()
int | hashCode()
final void | notify()
final void | notifyAll()
String | toString()
final void | wait(long arg0, int arg1)
final void | wait(long arg0)
final void | wait()
From interface android.os.Parcelable
abstract int | describeContents()
abstract void | writeToParcel(Parcel arg0, int arg1)

## Constants

#### public static final double DEFAULT_PLAYBACK_DURATION

A constant indicating the actual playback duration will not be overridden.

Constant Value: Infinity

#### public static final int INVALID_ITEM_ID

A constant indicating the item ID is invalid or unassigned.

Constant Value: 0 (0x00000000)

## Fields

#### public static final Creator<MediaQueueItem> CREATOR

## Public Methods

#### public boolean equals (Object other)

#### public long[] getActiveTrackIds ()

Returns the list of active media tracks, or `null` if none have been specified.

#### public boolean getAutoplay ()

Returns the autoplay state. Default value is `true`.

#### public JSONObject getCustomData ()

Returns the custom data, if any.

#### public int getItemId ()

Returns the item ID, or `INVALID_ITEM_ID` if not assigned.

#### public MediaInfo getMedia ()

Returns the `MediaInfo` information associated with this queue item.

#### public double getPlaybackDuration ()

Returns the playback duration in seconds. Default value is `DEFAULT_PLAYBACK_DURATION`.

#### public double getPreloadTime ()

Returns the preload time in seconds. Default value is 0.

#### public double getStartTime ()

Returns the start time of the item in seconds. Default value is 0.

#### public int hashCode ()

#### public void writeToParcel (Parcel out, int flags)