MediaInfo

public classMediaInfoextendsObject
implementsParcelableParcelable

A class that aggregates information about a media item. UseMediaInfo.Builder to build an instance of this class.MediaInfois used byRemoteMediaPlayer to load media on the receiver application.

Nested Class Summary

class MediaInfo.Builder A builder forMediaInfo 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.
long UNKNOWN_START_ABSOLUTE_TIME A constant indicating an unknown start absolute time.

Inherited Constant Summary

Public Method Summary

boolean
List<AdBreakClipInfo>
getAdBreakClips()
Returns an unmodifiable list ofAdBreakClipInfos, ornullif none have been specified.
List<AdBreakInfo>
getAdBreaks()
Returns an unmodifiable list ofAdBreakInfos, ornullif none have been specified.
String
getContentId()
Returns the content ID.
String
getContentType()
Returns the content (MIME) type.
String
getContentUrl()
Returns the URL of the content to be played.
JSONObject
getCustomData()
Returns the custom data, if any.
String
getEntity()
Returns the entity: a URI that identifies content in an application-specific way.
String
getHlsSegmentFormat()
Returns theHlsSegmentFormat, ornullif none have been specified.
String
getHlsVideoSegmentFormat()
Returns theHlsVideoSegmentFormat, ornullif none have been specified.
List<MediaTrack>
getMediaTracks()
Returns the list of media tracks, ornullif none have been specified.
MediaMetadata
getMetadata()
Returns the media item metadata.
long
getStartAbsoluteTime()
Returns the start absolute time in milliseconds in epoch time, or UNKNOWN_START_ABSOLUTE_TIMEif it is not available.
long
getStreamDuration()
Returns the stream duration, in milliseconds.
int
getStreamType()
Returns the stream type; one of theSTREAM_TYPE_constants.
TextTrackStyle
getTextTrackStyle()
Returns the text track style, ornullif none has been specified.
VastAdsRequest
getVmapAdsRequest()
Gets the VMAP ad request configuration, which is a collection of VAST ads.
int
void
setTextTrackStyle(TextTrackStyle textTrackStyle)
Sets the text track style.
void
writeToParcel(Parcelout, int flags)

Inherited Method Summary

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 static final long UNKNOWN_START_ABSOLUTE_TIME

A constant indicating an unknown start absolute time.

Constant Value:-1

Public Methods

public booleanequals(Objectother)

publicList<AdBreakClipInfo> getAdBreakClips()

Returns an unmodifiable list ofAdBreakClipInfos, ornullif none have been specified.

publicList<AdBreakInfo> getAdBreaks()

Returns an unmodifiable list ofAdBreakInfos, ornullif none have been specified.

publicStringgetContentId()

Returns the content ID.

publicStringgetContentType()

Returns the content (MIME) type.

publicStringgetContentUrl()

Returns the URL of the content to be played.

publicJSONObject getCustomData()

Returns the custom data, if any.

publicStringgetEntity()

Returns the entity: a URI that identifies content in an application-specific way.

publicStringgetHlsSegmentFormat()

Returns theHlsSegmentFormat, ornullif none have been specified.

publicStringgetHlsVideoSegmentFormat()

Returns theHlsVideoSegmentFormat, ornullif none have been specified.

publicList<MediaTrack> getMediaTracks()

Returns the list of media tracks, ornullif none have been specified.

publicMediaMetadata getMetadata()

Returns the media item metadata.

public longgetStartAbsoluteTime()

Returns the start absolute time in milliseconds in epoch time, or UNKNOWN_START_ABSOLUTE_TIMEif it is not available. Defaults to UNKNOWN_START_ABSOLUTE_TIME.

public longgetStreamDuration()

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

public intgetStreamType()

Returns the stream type; one of theSTREAM_TYPE_constants.

publicTextTrackStyle getTextTrackStyle()

Returns the text track style, ornullif none has been specified.

publicVastAdsRequest getVmapAdsRequest()

Gets the VMAP ad request configuration, which is a collection of VAST ads.Digital Video Ad Serving Template (VAST)is a common protocol that enables ad servers to use a single ad response format across multiple publishers/video players.

This is used to load ads ifgetAdBreaks() andgetAdBreakClips() are not provided.

public inthashCode()

public voidsetTextTrackStyle(TextTrackStyle textTrackStyle)

Sets the text track style.

public voidwriteToParcel(Parcelout, int flags)