# MediaPlayer.TrackInfo

Added in [API level 16](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

# TrackInfo

*** ** * ** ***

Kotlin \|[Java](https://developer.android.com/reference/android/media/MediaPlayer.TrackInfo "View this page in Java")  

```
open class TrackInfo : Parcelable
```

|---|----------------------------------------------------------------------------------------------------------------------------|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)                                             ||
| ↳ | [android.media.MediaPlayer.TrackInfo](https://developer.android.com/reference/kotlin/android/media/MediaPlayer.TrackInfo#) |

Class for MediaPlayer to return each audio/video/subtitle track's metadata.

## Summary

|                                                                                                                    Constants                                                                                                                     ||
|-----------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------|
| static [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [MEDIA_TRACK_TYPE_AUDIO](https://developer.android.com/reference/kotlin/android/media/MediaPlayer.TrackInfo#MEDIA_TRACK_TYPE_AUDIO:kotlin.Int) <br />         |
| static [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [MEDIA_TRACK_TYPE_METADATA](https://developer.android.com/reference/kotlin/android/media/MediaPlayer.TrackInfo#MEDIA_TRACK_TYPE_METADATA:kotlin.Int) <br />   |
| static [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [MEDIA_TRACK_TYPE_SUBTITLE](https://developer.android.com/reference/kotlin/android/media/MediaPlayer.TrackInfo#MEDIA_TRACK_TYPE_SUBTITLE:kotlin.Int) <br />   |
| static [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [MEDIA_TRACK_TYPE_TIMEDTEXT](https://developer.android.com/reference/kotlin/android/media/MediaPlayer.TrackInfo#MEDIA_TRACK_TYPE_TIMEDTEXT:kotlin.Int) <br /> |
| static [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [MEDIA_TRACK_TYPE_UNKNOWN](https://developer.android.com/reference/kotlin/android/media/MediaPlayer.TrackInfo#MEDIA_TRACK_TYPE_UNKNOWN:kotlin.Int) <br />     |
| static [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [MEDIA_TRACK_TYPE_VIDEO](https://developer.android.com/reference/kotlin/android/media/MediaPlayer.TrackInfo#MEDIA_TRACK_TYPE_VIDEO:kotlin.Int) <br />         |

| Inherited constants ||
|---|---|
| From class [Parcelable](https://developer.android.com/reference/kotlin/android/os/Parcelable.html#) |----------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [CONTENTS_FILE_DESCRIPTOR](https://developer.android.com/reference/kotlin/android/os/Parcelable.html#CONTENTS_FILE_DESCRIPTOR:kotlin.Int) Descriptor bit used with [describeContents()](https://developer.android.com/reference/kotlin/android/os/Parcelable.html#describeContents()): indicates that the Parcelable object's flattened representation includes a file descriptor. <br />                                                                                                                                                                                                        | | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [PARCELABLE_WRITE_RETURN_VALUE](https://developer.android.com/reference/kotlin/android/os/Parcelable.html#PARCELABLE_WRITE_RETURN_VALUE:kotlin.Int) Flag for use with [writeToParcel](https://developer.android.com/reference/kotlin/android/os/Parcelable.html#writeToParcel(android.os.Parcel,%20kotlin.Int)): the object being written is a return value, that is the result of a function such as "`Parcelable someFunction()`", "`void someFunction(out Parcelable)`", or "`void someFunction(inout Parcelable)`". Some implementations may want to release resources at this point. <br /> | ||

|                                                                                                                                                                                                                               Public methods                                                                                                                                                                                                                               ||
|-----------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| open [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)               | [describeContents](https://developer.android.com/reference/kotlin/android/media/MediaPlayer.TrackInfo#describeContents())`()` Describe the kinds of special objects contained in this Parcelable instance's marshaled representation.                                                                                                                                       |
| open [MediaFormat](https://developer.android.com/reference/kotlin/android/media/MediaFormat)! | [getFormat](https://developer.android.com/reference/kotlin/android/media/MediaPlayer.TrackInfo#getFormat())`()` Gets the [MediaFormat](https://developer.android.com/reference/kotlin/android/media/MediaFormat) of the track.                                                                                                                                              |
| open [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!        | [getLanguage](https://developer.android.com/reference/kotlin/android/media/MediaPlayer.TrackInfo#getLanguage())`()` Gets the language code of the track.                                                                                                                                                                                                                    |
| open [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)               | [getTrackType](https://developer.android.com/reference/kotlin/android/media/MediaPlayer.TrackInfo#getTrackType())`()` Gets the track type.                                                                                                                                                                                                                                  |
| open [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)         | [toString](https://developer.android.com/reference/kotlin/android/media/MediaPlayer.TrackInfo#toString())`()` <br />                                                                                                                                                                                                                                                        |
| open [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)             | [writeToParcel](https://developer.android.com/reference/kotlin/android/media/MediaPlayer.TrackInfo#writeToParcel(android.os.Parcel,%20kotlin.Int))`(`dest:` `[Parcel](https://developer.android.com/reference/kotlin/android/os/Parcel.html#)`, `flags:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Flatten this object in to a Parcel. |

## Constants

### MEDIA_TRACK_TYPE_AUDIO

Added in [API level 16](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val MEDIA_TRACK_TYPE_AUDIO: Int
```  

    Value: 2

### MEDIA_TRACK_TYPE_METADATA

Added in [API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val MEDIA_TRACK_TYPE_METADATA: Int
```  

    Value: 5

### MEDIA_TRACK_TYPE_SUBTITLE

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val MEDIA_TRACK_TYPE_SUBTITLE: Int
```  

    Value: 4

### MEDIA_TRACK_TYPE_TIMEDTEXT

Added in [API level 16](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val MEDIA_TRACK_TYPE_TIMEDTEXT: Int
```  

    Value: 3

### MEDIA_TRACK_TYPE_UNKNOWN

Added in [API level 16](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val MEDIA_TRACK_TYPE_UNKNOWN: Int
```  

    Value: 0

### MEDIA_TRACK_TYPE_VIDEO

Added in [API level 16](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val MEDIA_TRACK_TYPE_VIDEO: Int
```  

    Value: 1

## Public methods

### describeContents

Added in [API level 16](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
open fun describeContents(): Int
```

Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. For example, if the object will include a file descriptor in the output of [writeToParcel(android.os.Parcel,int)](https://developer.android.com/reference/kotlin/android/os/Parcelable.html#writeToParcel(android.os.Parcel,%20kotlin.Int)), the return value of this method must include the [CONTENTS_FILE_DESCRIPTOR](https://developer.android.com/reference/kotlin/android/os/Parcelable.html#CONTENTS_FILE_DESCRIPTOR:kotlin.Int) bit.

|                                                                                                                                                                                Return                                                                                                                                                                                 ||
|----------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either `0` or [android.os.Parcelable#CONTENTS_FILE_DESCRIPTOR](https://developer.android.com/reference/kotlin/android/os/Parcelable.html#CONTENTS_FILE_DESCRIPTOR:kotlin.Int) |

### getFormat

Added in [API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
open fun getFormat(): MediaFormat!
```

Gets the [MediaFormat](https://developer.android.com/reference/kotlin/android/media/MediaFormat) of the track. If the format is unknown or could not be determined, null is returned.  

### getLanguage

Added in [API level 16](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
open fun getLanguage(): String!
```

Gets the language code of the track.

|                                                                                                                      Return                                                                                                                       ||
|-----------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)! | a language code in either way of ISO-639-1 or ISO-639-2. When the language is unknown or could not be determined, ISO-639-2 language code, "und", is returned. |

### getTrackType

Added in [API level 16](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
open fun getTrackType(): Int
```

Gets the track type.

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   Return                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   ||
|----------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | TrackType which indicates if the track is video, audio, timed text. Value is [android.media.MediaPlayer.TrackInfo#MEDIA_TRACK_TYPE_UNKNOWN](https://developer.android.com/reference/kotlin/android/media/MediaPlayer.TrackInfo#MEDIA_TRACK_TYPE_UNKNOWN:kotlin.Int), [android.media.MediaPlayer.TrackInfo#MEDIA_TRACK_TYPE_VIDEO](https://developer.android.com/reference/kotlin/android/media/MediaPlayer.TrackInfo#MEDIA_TRACK_TYPE_VIDEO:kotlin.Int), [android.media.MediaPlayer.TrackInfo#MEDIA_TRACK_TYPE_AUDIO](https://developer.android.com/reference/kotlin/android/media/MediaPlayer.TrackInfo#MEDIA_TRACK_TYPE_AUDIO:kotlin.Int), [android.media.MediaPlayer.TrackInfo#MEDIA_TRACK_TYPE_TIMEDTEXT](https://developer.android.com/reference/kotlin/android/media/MediaPlayer.TrackInfo#MEDIA_TRACK_TYPE_TIMEDTEXT:kotlin.Int), [android.media.MediaPlayer.TrackInfo#MEDIA_TRACK_TYPE_SUBTITLE](https://developer.android.com/reference/kotlin/android/media/MediaPlayer.TrackInfo#MEDIA_TRACK_TYPE_SUBTITLE:kotlin.Int), or [android.media.MediaPlayer.TrackInfo#MEDIA_TRACK_TYPE_METADATA](https://developer.android.com/reference/kotlin/android/media/MediaPlayer.TrackInfo#MEDIA_TRACK_TYPE_METADATA:kotlin.Int) |

### toString

Added in [API level 16](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
open fun toString(): String
```

|                                                          Return                                                          ||
|----------------------------------------------------------------------------------|----------------------------------------|
| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | a string representation of the object. |

### writeToParcel

Added in [API level 16](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
open fun writeToParcel(
    dest: Parcel, 
    flags: Int
): Unit
```

Flatten this object in to a Parcel.

|                                                                                                                                                                                                                                                                                       Parameters                                                                                                                                                                                                                                                                                        ||
|---------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `dest`  | [Parcel](https://developer.android.com/reference/kotlin/android/os/Parcel.html#): The Parcel in which the object should be written. This value cannot be `null`.                                                                                                                                                                                                                                                                                                                                                                                                               |
| `flags` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): Additional flags about how the object should be written. May be 0 or [PARCELABLE_WRITE_RETURN_VALUE](https://developer.android.com/reference/kotlin/android/os/Parcelable.html#PARCELABLE_WRITE_RETURN_VALUE:kotlin.Int). Value is either `0` or a combination of [android.os.Parcelable#PARCELABLE_WRITE_RETURN_VALUE](https://developer.android.com/reference/kotlin/android/os/Parcelable.html#PARCELABLE_WRITE_RETURN_VALUE:kotlin.Int), and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES |