MediaPlayer.TrackInfo

public static final class MediaPlayer.TrackInfo
extends Object

java.lang.Object
   ↳ androidx.media2.player.MediaPlayer.TrackInfo


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

Summary

Constants

int MEDIA_TRACK_TYPE_AUDIO

int MEDIA_TRACK_TYPE_METADATA

int MEDIA_TRACK_TYPE_SUBTITLE

int MEDIA_TRACK_TYPE_UNKNOWN

int MEDIA_TRACK_TYPE_VIDEO

Public methods

boolean equals(Object obj)
MediaFormat getFormat()

Gets the MediaFormat of the track.

Locale getLanguage()

Gets the language code of the track.

int getTrackType()

Gets the track type.

int hashCode()
String toString()

Inherited methods

Constants

MEDIA_TRACK_TYPE_AUDIO

public static final int MEDIA_TRACK_TYPE_AUDIO

Constant Value: 2 (0x00000002)

MEDIA_TRACK_TYPE_METADATA

public static final int MEDIA_TRACK_TYPE_METADATA

Constant Value: 5 (0x00000005)

MEDIA_TRACK_TYPE_SUBTITLE

public static final int MEDIA_TRACK_TYPE_SUBTITLE

Constant Value: 4 (0x00000004)

MEDIA_TRACK_TYPE_UNKNOWN

public static final int MEDIA_TRACK_TYPE_UNKNOWN

Constant Value: 0 (0x00000000)

MEDIA_TRACK_TYPE_VIDEO

public static final int MEDIA_TRACK_TYPE_VIDEO

Constant Value: 1 (0x00000001)

Public methods

equals

public boolean equals (Object obj)

Parameters
obj Object

Returns
boolean

getFormat

public MediaFormat getFormat ()

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

Returns
MediaFormat

getLanguage

public Locale getLanguage ()

Gets the language code of the track.

Returns
Locale Locale which includes the language information.

getTrackType

public int getTrackType ()

Gets the track type.

Returns
int TrackType which indicates if the track is video, audio, subtitle or metadata.

hashCode

public int hashCode ()

Returns
int

toString

public String toString ()

Returns
String