- java.lang.Object
-
- javafx.scene.media.Track
-
- Direct Known Subclasses:
AudioTrack
,SubtitleTrack
,VideoTrack
public abstract class Track extends Object
A class representing a track contained in a media resource. A media resource may have multiple parallel tracks, such as a video track with several audio tracks in different languages. The types of tracks supported by the system may be inferred from the existing subclasses of this class. Not all media resources will contain a track of each supported type, and the time span of a given track need not be commensurate with the time span of the containing media.- Since:
- JavaFX 2.0
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Locale
getLocale()
TheLocale
specifying the language and possibly the country that theTrack
contents are formatted for.Map<String,Object>
getMetadata()
String
getName()
Retrieves the name of the track.long
getTrackID()
Get the track ID as defined by the media container format.String
toString()
Returns a string representation of the object.
-
-
-
Method Detail
-
getName
public final String getName()
Retrieves the name of the track.- Returns:
- the track name or
null
.
-
getLocale
public final Locale getLocale()
TheLocale
specifying the language and possibly the country that theTrack
contents are formatted for. ForAudioTrack
s this will be the language spoken, forSubtitleTrack
s this will be the language presented in the captions. Not allTrack
s will have an associated language, in which case this method will return null.- Returns:
- the
Track
s language information or null - Since:
- JavaFX 8.0
-
getTrackID
public final long getTrackID()
Get the track ID as defined by the media container format. The ID of eachTrack
must be unique for its sourceMedia
.- Returns:
- the
Track
s unique ID - Since:
- JavaFX 8.0
-
getMetadata
public final Map<String,Object> getMetadata()
- Returns:
- a Map containing all known metadata for this
Track
- Since:
- JavaFX 8.0
-
toString
public final String toString()
Description copied from class:Object
Returns a string representation of the object. In general, thetoString
method returns a string that "textually represents" this object. The result should be a concise but informative representation that is easy for a person to read. It is recommended that all subclasses override this method.The
toString
method for classObject
returns a string consisting of the name of the class of which the object is an instance, the at-sign character `@
', and the unsigned hexadecimal representation of the hash code of the object. In other words, this method returns a string equal to the value of:getClass().getName() + '@' + Integer.toHexString(hashCode())
-
-