Package com.google.android.exoplayer2
Class Player.PositionInfo
- java.lang.Object
-
- com.google.android.exoplayer2.Player.PositionInfo
-
- All Implemented Interfaces:
Bundleable
- Enclosing interface:
- Player
public static final class Player.PositionInfo extends Object implements Bundleable
Position info describing a playback position involved in a discontinuity.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.google.android.exoplayer2.Bundleable
Bundleable.Creator<T extends Bundleable>
-
-
Field Summary
Fields Modifier and Type Field Description intadGroupIndexThe ad group index if the playback position is within an ad,C.INDEX_UNSETotherwise.intadIndexInAdGroupThe index of the ad within the ad group if the playback position is within an ad,C.INDEX_UNSETotherwise.longcontentPositionMsThe content position, in milliseconds.static Bundleable.Creator<Player.PositionInfo>CREATORObject that can restorePlayer.PositionInfofrom aBundle.MediaItemmediaItemThe media item, ornullif the timeline isempty.intmediaItemIndexThe media item index.intperiodIndexThe period index.ObjectperiodUidThe UID of the period, ornullif the timeline isempty.longpositionMsThe playback position, in milliseconds.intwindowIndexDeprecated.UsemediaItemIndexinstead.ObjectwindowUidThe UID of the window, ornullif the timeline isempty.
-
Constructor Summary
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.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)inthashCode()BundletoBundle()Returns aBundlerepresenting the information stored in this object.BundletoBundle(boolean canAccessCurrentMediaItem, boolean canAccessTimeline)Returns aBundlerepresenting the information stored in this object, filtered by available commands.
-
-
-
Field Detail
-
windowUid
@Nullable public final Object windowUid
The UID of the window, ornullif the timeline isempty.
-
windowIndex
@Deprecated public final int windowIndex
Deprecated.UsemediaItemIndexinstead.
-
mediaItemIndex
public final int mediaItemIndex
The media item index.
-
mediaItem
@Nullable public final MediaItem mediaItem
The media item, ornullif the timeline isempty.
-
periodUid
@Nullable public final Object periodUid
The UID of the period, ornullif the timeline isempty.
-
periodIndex
public final int periodIndex
The period index.
-
positionMs
public final long positionMs
The playback position, in milliseconds.
-
contentPositionMs
public final long contentPositionMs
The content position, in milliseconds.If
adGroupIndexisC.INDEX_UNSET, this is the same aspositionMs.
-
adGroupIndex
public final int adGroupIndex
The ad group index if the playback position is within an ad,C.INDEX_UNSETotherwise.
-
adIndexInAdGroup
public final int adIndexInAdGroup
The index of the ad within the ad group if the playback position is within an ad,C.INDEX_UNSETotherwise.
-
CREATOR
public static final Bundleable.Creator<Player.PositionInfo> CREATOR
Object that can restorePlayer.PositionInfofrom aBundle.
-
-
Constructor Detail
-
PositionInfo
@Deprecated public PositionInfo(@Nullable Object windowUid, int mediaItemIndex, @Nullable Object periodUid, int periodIndex, long positionMs, long contentPositionMs, int adGroupIndex, int adIndexInAdGroup)
Deprecated.
-
-
Method Detail
-
toBundle
public Bundle toBundle()
Returns aBundlerepresenting the information stored in this object.It omits the
windowUidandperiodUidfields. ThewindowUidandperiodUidof an instance restored byCREATORwill always benull.- Specified by:
toBundlein interfaceBundleable
-
toBundle
public Bundle toBundle(boolean canAccessCurrentMediaItem, boolean canAccessTimeline)
Returns aBundlerepresenting the information stored in this object, filtered by available commands.- Parameters:
canAccessCurrentMediaItem- Whether theBundleshould contain information accessbile withPlayer.COMMAND_GET_CURRENT_MEDIA_ITEM.canAccessTimeline- Whether theBundleshould contain information accessbile withPlayer.COMMAND_GET_TIMELINE.
-
-