Class Track
java.lang.Object
com.castlabs.android.player.models.Track
- Direct Known Subclasses:
AudioTrack
,SubtitleTrack
,VideoTrack
Base class for tracks that exposes a track index to uniquely identify the track
within a player model.
- Since:
- 3.0.0
-
Field Summary
Modifier and TypeFieldDescriptionstatic Locale
For Tracks that display a language, this Locale will be used.static final int
Indicates that an index is unknown -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addDescriptor
(DashDescriptor dashDescriptor) Adds a Dash descriptor to the listboolean
static String
getLocalizedLanguageName
(String language) Returns the given language code's name, in theLocale
determined byLABEL_LOCALE
.int
int
int
int
hashCode()
boolean
hasTrickModeId
(int trickModeId) boolean
void
setDescriptors
(List<DashDescriptor> descriptors) Sets the Dash descriptors listvoid
setOriginalGroupIndex
(int originalGroupIndex) Set the original index of this groupvoid
setOriginalTrackIndex
(int originalTrackIndex) Set the original index of this trackvoid
setTrackIndex
(int trackIndex) Set the track index of this trackvoid
setTrickModeIds
(int[] trickModeIds)
-
Field Details
-
UNKNOWN_INDEX
public static final int UNKNOWN_INDEXIndicates that an index is unknown- See Also:
-
LABEL_LOCALE
For Tracks that display a language, this Locale will be used. This is the language in which the Track's language name is displayed. If null (default) will use the current system Locale.
-
-
Constructor Details
-
Track
public Track()
-
-
Method Details
-
getTrackIndex
public int getTrackIndex()- Returns:
- The track index of this track
-
setTrackIndex
public void setTrackIndex(int trackIndex) Set the track index of this track- Parameters:
trackIndex
- the track index
-
getOriginalTrackIndex
public int getOriginalTrackIndex()- Returns:
- The original index if this track, when no filters where applied
-
setOriginalTrackIndex
public void setOriginalTrackIndex(int originalTrackIndex) Set the original index of this track- Parameters:
originalTrackIndex
- The original index
-
getOriginalGroupIndex
public int getOriginalGroupIndex()- Returns:
- The original index if this group, when no filters where applied
-
setOriginalGroupIndex
public void setOriginalGroupIndex(int originalGroupIndex) Set the original index of this group- Parameters:
originalGroupIndex
- The original index
-
setTrickModeIds
public void setTrickModeIds(@NonNull int[] trickModeIds) -
isTrickModeTrack
public boolean isTrickModeTrack() -
hasTrickModeId
public boolean hasTrickModeId(int trickModeId) -
hashCode
public int hashCode() -
equals
-
addDescriptor
Adds a Dash descriptor to the list- Parameters:
dashDescriptor
- Dash descriptor to add
-
getDescriptors
- Returns:
- list of Dash descriptors for this track.
-
setDescriptors
Sets the Dash descriptors list- Parameters:
descriptors
- list of Dash descriptors to set.
-
getLocalizedLanguageName
Returns the given language code's name, in theLocale
determined byLABEL_LOCALE
. If such is null, the current device Locale will be used.- Parameters:
language
- the language code- Returns:
- the language name
-