Hide

MediaInfo

public final class MediaInfo extends Object
java.lang.Object
   ↳ com.google.android.gms.cast.MediaInfo

A class that aggregates information about a media item. Use MediaInfo.Builder to build an instance of this class. MediaInfo is used by RemoteMediaPlayer to load media on the receiver application.

Nested Class Summary

class MediaInfo.Builder A builder for MediaInfo objects. 

Constant Summary

int STREAM_TYPE_BUFFERED A buffered stream type.
int STREAM_TYPE_INVALID An invalid (unknown) stream type.
int STREAM_TYPE_LIVE A live stream type.
int STREAM_TYPE_NONE A stream type of "none".
long UNKNOWN_DURATION A constant indicating an unknown duration, such as for a live stream.

Public Method Summary

boolean
equals(Object other)
String
String
JSONObject
List<MediaTrack>
MediaMetadata
long
int
TextTrackStyle
int
void

Constants

public static final int STREAM_TYPE_BUFFERED

A buffered stream type.

Constant Value: 1

public static final int STREAM_TYPE_INVALID

An invalid (unknown) stream type.

Constant Value: -1

public static final int STREAM_TYPE_LIVE

A live stream type.

Constant Value: 2

public static final int STREAM_TYPE_NONE

A stream type of "none".

Constant Value: 0

public static final long UNKNOWN_DURATION

A constant indicating an unknown duration, such as for a live stream.

Constant Value: -1

Public Methods

public boolean equals (Object other)

public String getContentId ()

Returns the content ID.

public String getContentType ()

Returns the content (MIME) type.

public JSONObject getCustomData ()

Returns the custom data, if any.

public List<MediaTrack> getMediaTracks ()

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

public MediaMetadata getMetadata ()

Returns the media item metadata.

public long getStreamDuration ()

Returns the stream duration, in milliseconds. Returns UNKNOWN_DURATION for live streams.

public int getStreamType ()

Returns the stream type; one of the STREAM_TYPE_ constants.

public TextTrackStyle getTextTrackStyle ()

Returns the text track style, or null if none has been specified.

public int hashCode ()

public void setTextTrackStyle (TextTrackStyle textTrackStyle)

Sets the text track style.