Interface TrackSelection

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Interface Description
      static interface  TrackSelection.Type
      Represents a type track selection.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int TYPE_CUSTOM_BASE
      The first value that can be used for application specific track selection types.
      static int TYPE_UNSET
      An unspecified track selection type.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      Format getFormat​(int index)
      Returns the format of the track at a given index in the selection.
      int getIndexInTrackGroup​(int index)
      Returns the index in the track group of the track at a given index in the selection.
      TrackGroup getTrackGroup()
      Returns the TrackGroup to which the selected tracks belong.
      @com.google.android.exoplayer2.trackselection.TrackSelection.Type int getType()
      Returns an integer specifying the type of the selection, or TYPE_UNSET if not specified.
      int indexOf​(int indexInTrackGroup)
      Returns the index in the selection of the track with the specified index in the track group.
      int indexOf​(Format format)
      Returns the index in the selection of the track with the specified format.
      int length()
      Returns the number of tracks in the selection.
    • Field Detail

      • TYPE_UNSET

        static final int TYPE_UNSET
        An unspecified track selection type.
        See Also:
        Constant Field Values
      • TYPE_CUSTOM_BASE

        static final int TYPE_CUSTOM_BASE
        The first value that can be used for application specific track selection types.
        See Also:
        Constant Field Values
    • Method Detail

      • getType

        @com.google.android.exoplayer2.trackselection.TrackSelection.Type int getType()
        Returns an integer specifying the type of the selection, or TYPE_UNSET if not specified.

        Track selection types are specific to individual applications, but should be defined starting from TYPE_CUSTOM_BASE to ensure they don't conflict with any types that may be added to the library in the future.

      • getTrackGroup

        TrackGroup getTrackGroup()
        Returns the TrackGroup to which the selected tracks belong.
      • length

        int length()
        Returns the number of tracks in the selection.
      • getFormat

        Format getFormat​(int index)
        Returns the format of the track at a given index in the selection.
        Parameters:
        index - The index in the selection.
        Returns:
        The format of the selected track.
      • getIndexInTrackGroup

        int getIndexInTrackGroup​(int index)
        Returns the index in the track group of the track at a given index in the selection.
        Parameters:
        index - The index in the selection.
        Returns:
        The index of the selected track.
      • indexOf

        int indexOf​(Format format)
        Returns the index in the selection of the track with the specified format. The format is located by identity so, for example, selection.indexOf(selection.getFormat(index)) == index even if multiple selected tracks have formats that contain the same values.
        Parameters:
        format - The format.
        Returns:
        The index in the selection, or C.INDEX_UNSET if the track with the specified format is not part of the selection.
      • indexOf

        int indexOf​(int indexInTrackGroup)
        Returns the index in the selection of the track with the specified index in the track group.
        Parameters:
        indexInTrackGroup - The index in the track group.
        Returns:
        The index in the selection, or C.INDEX_UNSET if the track with the specified index is not part of the selection.