docs/doc/reference/com/google/android/exoplayer2/Player.PositionInfo.html
Package com.google.android.exoplayer2
All Implemented Interfaces:BundleableEnclosing interface:Player
public static final classPlayer.PositionInfoextends[Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")implements[Bundleable](Bundleable.html "interface in com.google.android.exoplayer2")
Position info describing a playback position involved in a discontinuity.
-
Bundleable.Creator<T extends Bundleable>
Fields | Modifier and Type | Field | Description |
| --- | --- | --- |
| int | adGroupIndex |
The ad group index if the playback position is within an ad, C.INDEX_UNSET otherwise.
|
| int | adIndexInAdGroup |
The index of the ad within the ad group if the playback position is within an ad, C.INDEX_UNSET otherwise.
|
| long | contentPositionMs |
The content position, in milliseconds.
|
| static Bundleable.Creator<Player.PositionInfo> | CREATOR |
Object that can restore Player.PositionInfo from a Bundle.
|
| MediaItem | mediaItem |
The media item, or null if the timeline is empty.
|
| int | mediaItemIndex |
The media item index.
|
| int | periodIndex |
The period index.
|
| Object | periodUid |
The UID of the period, or null if the timeline is empty.
|
| long | positionMs |
The playback position, in milliseconds.
|
| int | windowIndex |
Deprecated.
Use mediaItemIndex instead.
|
| Object | windowUid |
The UID of the window, or null if the timeline is empty.
|
Constructors | Constructor | Description |
| --- | --- |
| PositionInfo(Object windowUid, int mediaItemIndex, MediaItem mediaItem, Object periodUid, int periodIndex, long positionMs, long contentPositionMs, int adGroupIndex, int adIndexInAdGroup) |
Creates an instance.
|
| PositionInfo(Object windowUid, int mediaItemIndex, Object periodUid, int periodIndex, long positionMs, long contentPositionMs, int adGroupIndex, int adIndexInAdGroup) |
Deprecated.
Use PositionInfo(Object, int, MediaItem, Object, int, long, long, int, int) instead.
|
All Methods Instance Methods Concrete Methods | Modifier and Type | Method | Description |
| --- | --- | --- |
| boolean | equals(Object o) | |
| int | hashCode() | |
| Bundle | toBundle() |
Returns a Bundle representing the information stored in this object.
|
| Bundle | toBundle(boolean canAccessCurrentMediaItem, boolean canAccessTimeline) |
Returns a Bundle representing the information stored in this object, filtered by available commands.
|
-
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
@Nullable
public final[Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")windowUid
The UID of the window, or null if the timeline is empty.
-
[@Deprecated](https://developer.android.com/reference/java/lang/Deprecated.html "class or interface in java.lang")public final int windowIndex
Deprecated.
Use mediaItemIndex instead.
-
public final int mediaItemIndex
The media item index.
-
@Nullable
public final[MediaItem](MediaItem.html "class in com.google.android.exoplayer2")mediaItem
The media item, or null if the timeline is empty.
-
@Nullable
public final[Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")periodUid
The UID of the period, or null if the timeline is empty.
-
public final int periodIndex
The period index.
-
public final long positionMs
The playback position, in milliseconds.
-
public final long contentPositionMs
The content position, in milliseconds.
If adGroupIndex is C.INDEX_UNSET, this is the same as positionMs.
-
public final int adGroupIndex
The ad group index if the playback position is within an ad, C.INDEX_UNSET otherwise.
-
public final int adIndexInAdGroup
The index of the ad within the ad group if the playback position is within an ad, C.INDEX_UNSET otherwise.
-
public static final[Bundleable.Creator](Bundleable.Creator.html "interface in com.google.android.exoplayer2")<[Player.PositionInfo](Player.PositionInfo.html "class in com.google.android.exoplayer2")> CREATOR
Object that can restore Player.PositionInfo from a Bundle.
-
[@Deprecated](https://developer.android.com/reference/java/lang/Deprecated.html "class or interface in java.lang")public PositionInfo(@Nullable[Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")windowUid,
int mediaItemIndex,
@Nullable[Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")periodUid,
int periodIndex,
long positionMs,
long contentPositionMs,
int adGroupIndex,
int adIndexInAdGroup)
Deprecated.
Use PositionInfo(Object, int, MediaItem, Object, int, long, long, int, int) instead.
-
public PositionInfo(@Nullable[Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")windowUid,
int mediaItemIndex,
@Nullable[MediaItem](MediaItem.html "class in com.google.android.exoplayer2")mediaItem,
@Nullable[Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")periodUid,
int periodIndex,
long positionMs,
long contentPositionMs,
int adGroupIndex,
int adIndexInAdGroup)
Creates an instance.
-
public boolean equals(@Nullable[Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")o)
Overrides:equals in class Object
-
public int hashCode()
Overrides:hashCode in class Object
-
public[Bundle](https://developer.android.com/reference/android/os/Bundle.html "class or interface in android.os")toBundle()
Returns a Bundle representing the information stored in this object.
It omits the windowUid and periodUid fields. The windowUid and periodUid of an instance restored by CREATOR will always be null.
Specified by:toBundle in interface Bundleable
-
public[Bundle](https://developer.android.com/reference/android/os/Bundle.html "class or interface in android.os")toBundle(boolean canAccessCurrentMediaItem,
boolean canAccessTimeline)
Returns a Bundle representing the information stored in this object, filtered by available commands.
Parameters:canAccessCurrentMediaItem - Whether the Bundle should contain information accessbile with Player.COMMAND_GET_CURRENT_MEDIA_ITEM.canAccessTimeline - Whether the Bundle should contain information accessbile with Player.COMMAND_GET_TIMELINE.