Class TrackIndexOverride

java.lang.Object
com.castlabs.android.player.TrackIndexOverride

public class TrackIndexOverride extends Object
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

    Fields
    Modifier and Type
    Field
    Description
    final int
    The index of the track group.
    final int
    The index of the track within the track group.
  • Constructor Summary

    Constructors
    Constructor
    Description
    TrackIndexOverride(int trackGroupIndex, int trackIndex)
    Constructs a new TrackIndexOverride.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    isValid(com.google.android.exoplayer2.source.TrackGroupArray trackGroups)
    Checks if this TrackIndexOverride is valid for the given track groups.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • trackGroupIndex

      public final int trackGroupIndex
      The index of the track group.
    • trackIndex

      public final int trackIndex
      The 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.