MediaTrack | Android Developers

Quicknav Quicknav
Links

- Google Play Developer Console
- Android Developers Blog
- About Android

Android Sites

- Android.com
- Android Developers
- Android Open Source Project

Language
close

- - About
  - Wear
  - TV
  - Auto
- - Get Started
  - Devices
  - Style
  - Patterns
  - Building Blocks
  - Downloads
  - Videos
- - Training
  - API Guides
  - Reference
  - Tools
  - Google Services
  - Samples
- - Google Play
  - Essentials
  - Get Users
  - Engage & Retain
  - Monetize
  - Tools & Reference
  - Developer Stories

## Results

Loading...
Summary: Nested Classes | Constants | Methods | Inherited Methods | [Expand All]
public final class

# MediaTrack

extends Object

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

## Class Overview

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

## Summary

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

Constants
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.

Public Methods
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.
String | getName() Returns the name of the media track, or `null` if none was specified.
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 | hashCode()
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.

[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()
final void | wait(long arg0, int arg1)
final void | wait(long arg0)

## Constants

#### public static final int SUBTYPE_CAPTIONS

A media track subtype indicating closed captions.

Constant Value: 2 (0x00000002)

#### public static final int SUBTYPE_CHAPTERS

A media track subtype indicating chapters.

Constant Value: 4 (0x00000004)

#### public static final int SUBTYPE_DESCRIPTIONS

A media track subtype indicating descriptions.

Constant Value: 3 (0x00000003)

#### public static final int SUBTYPE_METADATA

A media track subtype indicating metadata.

Constant Value: 5 (0x00000005)

#### public static final int SUBTYPE_NONE

A media track subtype indicating no subtype.

Constant Value: 0 (0x00000000)

#### public static final int SUBTYPE_SUBTITLES

A media track subtype indicating subtitles.

Constant Value: 1 (0x00000001)

#### public static final int SUBTYPE_UNKNOWN

A media track subtype indicating an unknown subtype.

Constant Value: -1 (0xffffffff)

#### public static final int TYPE_AUDIO

A media track type indicating an audio track.

Constant Value: 2 (0x00000002)

#### public static final int TYPE_TEXT

A media track type indicating a text track.

Constant Value: 1 (0x00000001)

#### public static final int TYPE_UNKNOWN

A media track type indicating an unknown track type.

Constant Value: 0 (0x00000000)

#### public static final int TYPE_VIDEO

A media track type indicating a video track.

Constant Value: 3 (0x00000003)

## 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 String getName ()

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

#### 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.