docs/doc/reference/com/google/android/exoplayer2/offline/StreamKey.html
Package com.google.android.exoplayer2.offline
All Implemented Interfaces:Parcelable, Bundleable, Comparable<StreamKey>
[@Deprecated](https://developer.android.com/reference/java/lang/Deprecated.html "class or interface in java.lang")public final classStreamKeyextends[Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")implements[Comparable](https://developer.android.com/reference/java/lang/Comparable.html "class or interface in java.lang")<[StreamKey](StreamKey.html "class in com.google.android.exoplayer2.offline")>,[Parcelable](https://developer.android.com/reference/android/os/Parcelable.html?is-external=true "class or interface in android.os"),[Bundleable](../Bundleable.html "interface in com.google.android.exoplayer2")
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.
-
Bundleable.Creator<T extends Bundleable>
-
Parcelable.ClassLoaderCreator<T extends Object>, Parcelable.Creator<T extends Object>
Fields | Modifier and Type | Field | Description |
| --- | --- | --- |
| static Parcelable.Creator<StreamKey> | CREATOR |
Deprecated.
|
| int | groupIndex |
Deprecated.
The group index.
|
| int | periodIndex |
Deprecated.
The period index.
|
| int | streamIndex |
Deprecated.
The stream index. |
-
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE
Constructors | Constructor | Description |
| --- | --- |
| StreamKey(int groupIndex, int streamIndex) |
Deprecated.
Creates an instance with periodIndex set to 0.
|
| StreamKey(int periodIndex, int groupIndex, int streamIndex) |
Deprecated.
Creates an instance of StreamKey using 3 indices.
|
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods | Modifier and Type | Method | Description |
| --- | --- | --- |
| int | compareTo(StreamKey o) |
Deprecated.
|
| int | describeContents() |
Deprecated.
|
| boolean | equals(Object o) |
Deprecated.
|
| static StreamKey | fromBundle(Bundle bundle) |
Deprecated.
Constructs an instance of StreamKey from a Bundle produced by toBundle().
|
| int | hashCode() |
Deprecated.
|
| Bundle | toBundle() |
Deprecated.
Returns a Bundle representing the information stored in this object.
|
| String | toString() |
Deprecated.
|
| void | writeToParcel(Parcel dest, int flags) |
Deprecated.
|
-
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
public final int periodIndex
Deprecated.
The period index.
-
public final int groupIndex
Deprecated.
The group index.
-
public final int streamIndex
Deprecated.
The stream index.
-
public static final[Parcelable.Creator](https://developer.android.com/reference/android/os/Parcelable.Creator.html "class or interface in android.os")<[StreamKey](StreamKey.html "class in com.google.android.exoplayer2.offline")> CREATOR
Deprecated.
-
public StreamKey(int groupIndex,
int streamIndex)
Deprecated.
Creates an instance with periodIndex set to 0.
Parameters:groupIndex - The group index.streamIndex - The stream index.
-
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.
-
public[String](https://developer.android.com/reference/java/lang/String.html "class or interface in java.lang")toString()
Deprecated.
Overrides:toString in class Object
-
public boolean equals(@Nullable[Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")o)
Deprecated.
Overrides:equals in class Object
-
public int hashCode()
Deprecated.
Overrides:hashCode in class Object
-
public int compareTo([StreamKey](StreamKey.html "class in com.google.android.exoplayer2.offline")o)
Deprecated.
Specified by:compareTo in interface Comparable<StreamKey>
-
public int describeContents()
Deprecated.
Specified by:describeContents in interface Parcelable
-
public void writeToParcel([Parcel](https://developer.android.com/reference/android/os/Parcel.html "class or interface in android.os")dest,
int flags)
Deprecated.
Specified by:writeToParcel in interface Parcelable
-
public[Bundle](https://developer.android.com/reference/android/os/Bundle.html "class or interface in android.os")toBundle()
Deprecated.
Description copied from interface: Bundleable
Returns a Bundle representing the information stored in this object.
Specified by:toBundle in interface Bundleable
-
public static[StreamKey](StreamKey.html "class in com.google.android.exoplayer2.offline")fromBundle([Bundle](https://developer.android.com/reference/android/os/Bundle.html "class or interface in android.os")bundle)
Deprecated.
Constructs an instance of StreamKey from a Bundle produced by toBundle().