MediaTrack

public final class MediaTrack extends Object
implements Parcelable Parcelable

A class that represents a media track, such as a language track or closed caption text track in a video.

Nested Class Summary

class MediaTrack.Builder A builder for MediaTrack objects. 

Constant Summary

String ROLE_ALTERNATE Constant value for the "alternate" role.
String ROLE_CAPTION Constant value for the "caption" role.
String ROLE_COMMENTARY Constant value for the "commentary" role.
String ROLE_DESCRIPTION Constant value for the "description" role.
String ROLE_DUB Constant value for the "dub" role.
String ROLE_EMERGENCY Constant value for the "emergency" role.
String ROLE_FORCED_SUBTITLE Constant value for the "forced subtitle" role.
String ROLE_MAIN Constant value for the "main" role.
String ROLE_SIGN Constant value for the "sign" role.
String ROLE_SUBTITLE Constant value for the "subtitle" role.
String ROLE_SUPPLEMENTARY Constant value for the "supplementary" role.
int SUBTYPE_CAPTIONS A media track subtype indicating closed captions.
int SUBTYPE_CHAPTERS A media track subtype indicating chapters.
int SUBTYPE_DESCRIPTIONS A media track subtype indicating descriptions.
int SUBTYPE_METADATA A media track subtype indicating metadata.
int SUBTYPE_NONE A media track subtype indicating no subtype.
int SUBTYPE_SUBTITLES A media track subtype indicating subtitles.
int SUBTYPE_UNKNOWN A media track subtype indicating an unknown subtype.
int TYPE_AUDIO A media track type indicating an audio track.
int TYPE_TEXT A media track type indicating a text track.
int TYPE_UNKNOWN A media track type indicating an unknown track type.
int TYPE_VIDEO A media track type indicating a video track.

Inherited Constant Summary

Public Method Summary

boolean
equals(Object other)
String
getContentId()
Returns the content ID of the media track.
String
getContentType()
Returns the content type (MIME type) of the media track, or null if none was specified.
JSONObject
getCustomData()
Returns the custom data object for this media track, or null if none was specified.
long
getId()
Returns the unique ID of the media track.
String
getLanguage()
Returns the language of this media track in RFC-5464 format, or null if none was specified.
Locale
getLanguageLocale()
Returns the Locale representing the track language defined by the language field.
String
getName()
Returns the name of the media track, or null if none was specified.
List<String>
getRoles()
Returns the roles of this media track.
int
getSubtype()
Returns the subtype of this media track; one of the SUBTYPE_ constants.
int
getType()
Returns the type of the track; one of the TYPE_ constants.
int
void
setContentId(String contentId)
Sets the content ID for the media track.
void
setContentType(String contentType)
Sets the content type (MIME type) of the media track.
void
writeToParcel(Parcel out, int flags)

Inherited Method Summary

Constants

public static final String ROLE_ALTERNATE

Constant value for the "alternate" role.

Constant Value: "alternate"

public static final String ROLE_CAPTION

Constant value for the "caption" role.

Constant Value: "caption"

public static final String ROLE_COMMENTARY

Constant value for the "commentary" role.

Constant Value: "commentary"

public static final String ROLE_DESCRIPTION

Constant value for the "description" role.

Constant Value: "description"

public static final String ROLE_DUB

Constant value for the "dub" role.

Constant Value: "dub"

public static final String ROLE_EMERGENCY

Constant value for the "emergency" role.

Constant Value: "emergency"

public static final String ROLE_FORCED_SUBTITLE

Constant value for the "forced subtitle" role.

Constant Value: "forced_subtitle"

public static final String ROLE_MAIN

Constant value for the "main" role.

Constant Value: "main"

public static final String ROLE_SIGN

Constant value for the "sign" role.

Constant Value: "sign"

public static final String ROLE_SUBTITLE

Constant value for the "subtitle" role.

Constant Value: "subtitle"

public static final String ROLE_SUPPLEMENTARY

Constant value for the "supplementary" role.

Constant Value: "supplementary"

public static final int SUBTYPE_CAPTIONS

A media track subtype indicating closed captions.

Constant Value: 2

public static final int SUBTYPE_CHAPTERS

A media track subtype indicating chapters.

Constant Value: 4

public static final int SUBTYPE_DESCRIPTIONS

A media track subtype indicating descriptions.

Constant Value: 3

public static final int SUBTYPE_METADATA

A media track subtype indicating metadata.

Constant Value: 5

public static final int SUBTYPE_NONE

A media track subtype indicating no subtype.

Constant Value: 0

public static final int SUBTYPE_SUBTITLES

A media track subtype indicating subtitles.

Constant Value: 1

public static final int SUBTYPE_UNKNOWN

A media track subtype indicating an unknown subtype.

Constant Value: -1

public static final int TYPE_AUDIO

A media track type indicating an audio track.

Constant Value: 2

public static final int TYPE_TEXT

A media track type indicating a text track.

Constant Value: 1

public static final int TYPE_UNKNOWN

A media track type indicating an unknown track type.

Constant Value: 0

public static final int TYPE_VIDEO

A media track type indicating a video track.

Constant Value: 3

Public Methods

public boolean equals (Object other)

public String getContentId ()

Returns the content ID of the media track.

public String getContentType ()

Returns the content type (MIME type) of the media track, or null if none was specified.

public JSONObject getCustomData ()

Returns the custom data object for this media track, or null if none was specified.

public long getId ()

Returns the unique ID of the media track.

public String getLanguage ()

Returns the language of this media track in RFC-5464 format, or null if none was specified.

public Locale getLanguageLocale ()

Returns the Locale representing the track language defined by the language field.

public String getName ()

Returns the name of the media track, or null if none was specified.

public List<String> getRoles ()

Returns the roles of this media track. This can be a List of ROLE_ constants, or null if not specified. The values explanations are described in ISO/IEC 23009-1, labeled "DASH role scheme":

The following values are available depending on the type of this track:

public int getSubtype ()

Returns the subtype of this media track; one of the SUBTYPE_ constants.

public int getType ()

Returns the type of the track; one of the TYPE_ constants.

public int hashCode ()

public void setContentId (String contentId)

Sets the content ID for the media track.

public void setContentType (String contentType)

Sets the content type (MIME type) of the media track.

public void writeToParcel (Parcel out, int flags)