Class StreamKey

  • All Implemented Interfaces:
    Parcelable, Bundleable, Comparable<StreamKey>

    @Deprecated
    public final class StreamKey
    extends Object
    implements Comparable<StreamKey>, Parcelable, Bundleable
    Deprecated.
    com.google.android.exoplayer2 is deprecated. Please migrate to androidx.media3 (which contains the same ExoPlayer code). See the migration guide for more details, including a script to help with the migration.
    A key for a subset of media that can be separately loaded (a "stream").

    The stream key consists of a period index, a group index within the period and a stream index within the group. The interpretation of these indices depends on the type of media for which the stream key is used. Note that they are not the same as track group and track indices, because multiple tracks can be multiplexed into a single stream.

    Application code should not generally attempt to build StreamKey instances directly. Instead, DownloadHelper.getDownloadRequest can be used to generate download requests with the correct StreamKeys for the track selections that have been configured on the helper. MediaPeriod.getStreamKeys provides a lower level way of generating StreamKeys corresponding to a particular track selection.

    • Field Detail

      • periodIndex

        public final int periodIndex
        Deprecated.
        The period index.
      • groupIndex

        public final int groupIndex
        Deprecated.
        The group index.
      • streamIndex

        public final int streamIndex
        Deprecated.
        The stream index.
    • Constructor Detail

      • StreamKey

        public StreamKey​(int groupIndex,
                         int streamIndex)
        Deprecated.
        Creates an instance with periodIndex set to 0.
        Parameters:
        groupIndex - The group index.
        streamIndex - The stream index.
      • StreamKey

        public StreamKey​(int periodIndex,
                         int groupIndex,
                         int streamIndex)
        Deprecated.
        Creates an instance of StreamKey using 3 indices.
        Parameters:
        periodIndex - The period index.
        groupIndex - The group index.
        streamIndex - The stream index.