Android Dev Summit, October 23-24: two days of technical content, directly from the Android team. Sign-up for livestream updates.

TrackInfo

class TrackInfo
kotlin.Any
   ↳ androidx.media2.player.MediaPlayer.TrackInfo

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

Summary

Constants

static Int

static Int

static Int

static Int

static Int

Public methods

Boolean
equals(other: Any?)

MediaFormat?

Gets the MediaFormat of the track.

Locale

Gets the language code of the track.

Int

Gets the track type.

Int

String

Constants

MEDIA_TRACK_TYPE_AUDIO

static val MEDIA_TRACK_TYPE_AUDIO: Int
Value: 2

MEDIA_TRACK_TYPE_METADATA

static val MEDIA_TRACK_TYPE_METADATA: Int
Value: 5

MEDIA_TRACK_TYPE_SUBTITLE

static val MEDIA_TRACK_TYPE_SUBTITLE: Int
Value: 4

MEDIA_TRACK_TYPE_UNKNOWN

static val MEDIA_TRACK_TYPE_UNKNOWN: Int
Value: 0

MEDIA_TRACK_TYPE_VIDEO

static val MEDIA_TRACK_TYPE_VIDEO: Int
Value: 1

Public methods

equals

fun equals(other: Any?): Boolean

getFormat

@Nullable fun getFormat(): MediaFormat?

Gets the MediaFormat of the track. If the format is unknown or could not be determined, null is returned.

getLanguage

@NonNull fun getLanguage(): Locale

Gets the language code of the track.

Return
Locale: Locale which includes the language information.

getTrackType

fun getTrackType(): Int

Gets the track type.

Return
Int: TrackType which indicates if the track is video, audio, subtitle or metadata.

hashCode

fun hashCode(): Int

toString

fun toString(): String