public abstract class

MediaPlayer2.TrackInfo

extends java.lang.Object

 java.lang.Object

↳androidx.media2.MediaPlayer2.TrackInfo

Subclasses:

TrackInfoImpl

Overview

Class for MediaPlayer2 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

Constructors
publicTrackInfo()

Methods
public abstract MediaFormatgetFormat()

Gets the of the track.

public abstract java.lang.StringgetLanguage()

Gets the language code of the track.

public abstract intgetTrackType()

Gets the track type.

public abstract 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

Constructors

public TrackInfo()

Methods

public abstract int getTrackType()

Gets the track type.

Returns:

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

public abstract 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 abstract MediaFormat getFormat()

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

public abstract java.lang.String toString()