public final class

MediaPlayer.TrackInfo

extends java.lang.Object

 java.lang.Object

↳androidx.media2.MediaPlayer.TrackInfo

Overview

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

Summary

Fields
public static final intMEDIA_TRACK_TYPE_AUDIO

public static final intMEDIA_TRACK_TYPE_METADATA

public static final intMEDIA_TRACK_TYPE_SUBTITLE

public static final intMEDIA_TRACK_TYPE_TIMEDTEXT

public static final intMEDIA_TRACK_TYPE_UNKNOWN

public static final intMEDIA_TRACK_TYPE_VIDEO

Methods
public MediaFormatgetFormat()

Gets the of the track.

public java.lang.StringgetLanguage()

Gets the language code of the track.

public intgetTrackType()

Gets the track type.

public java.lang.StringtoString()

from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Fields

public static final int MEDIA_TRACK_TYPE_UNKNOWN

public static final int MEDIA_TRACK_TYPE_VIDEO

public static final int MEDIA_TRACK_TYPE_AUDIO

public static final int MEDIA_TRACK_TYPE_TIMEDTEXT

public static final int MEDIA_TRACK_TYPE_SUBTITLE

public static final int MEDIA_TRACK_TYPE_METADATA

Methods

public int getTrackType()

Gets the track type.

Returns:

TrackType which indicates if the track is video, audio, timed text.

public java.lang.String getLanguage()

Gets the language code of the track.

Returns:

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.

public MediaFormat getFormat()

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

public java.lang.String toString()