Package com.castlabs.android.player
Class TrackIndexOverride
java.lang.Object
com.castlabs.android.player.TrackIndexOverride
Represents an override for a track index within a track group.
This class is used to specify a particular track to be selected.
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal int
The index of the track group.final int
The index of the track within the track group. -
Constructor Summary
ConstructorsConstructorDescriptionTrackIndexOverride
(int trackGroupIndex, int trackIndex) Constructs a new TrackIndexOverride. -
Method Summary
Modifier and TypeMethodDescriptionboolean
isValid
(com.google.android.exoplayer2.source.TrackGroupArray trackGroups) Checks if this TrackIndexOverride is valid for the given track groups.
-
Field Details
-
trackGroupIndex
public final int trackGroupIndexThe index of the track group. -
trackIndex
public final int trackIndexThe index of the track within the track group.
-
-
Constructor Details
-
TrackIndexOverride
public TrackIndexOverride(int trackGroupIndex, int trackIndex) Constructs a new TrackIndexOverride.- Parameters:
trackGroupIndex
- The index of the track group.trackIndex
- The index of the track within the track group.
-
-
Method Details
-
isValid
public boolean isValid(@NonNull com.google.android.exoplayer2.source.TrackGroupArray trackGroups) Checks if this TrackIndexOverride is valid for the given track groups. A TrackIndexOverride is considered valid if both the track group index and the track index are within the bounds of the provided track groups.- Parameters:
trackGroups
- The available track groups.- Returns:
- True if this TrackIndexOverride is valid, false otherwise.
-