public final class

Player.PositionInfo

extends java.lang.Object

implements Bundleable

 java.lang.Object

↳androidx.media3.common.Player.PositionInfo

Overview

Position info describing a playback position involved in a discontinuity.

Summary

Fields
public final intadGroupIndex

The ad group index if the playback position is within an ad, C.INDEX_UNSET otherwise.

public final intadIndexInAdGroup

The index of the ad within the ad group if the playback position is within an ad, C.INDEX_UNSET otherwise.

public final longcontentPositionMs

The content position, in milliseconds.

public static final Bundleable.Creator<Player.PositionInfo>CREATOR

Object that can restore Player.PositionInfo from a .

public final MediaItemmediaItem

The media item, or null if the timeline is empty.

public final intmediaItemIndex

The media item index.

public final intperiodIndex

The period index.

public final java.lang.ObjectperiodUid

The UID of the period, or null if the timeline is empty.

public final longpositionMs

The playback position, in milliseconds.

public final intwindowIndex

public final java.lang.ObjectwindowUid

The UID of the window, or null if the timeline is empty.

Constructors
publicPositionInfo(java.lang.Object windowUid, int mediaItemIndex, MediaItem mediaItem, java.lang.Object periodUid, int periodIndex, long positionMs, long contentPositionMs, int adGroupIndex, int adIndexInAdGroup)

Creates an instance.

publicPositionInfo(java.lang.Object windowUid, int mediaItemIndex, java.lang.Object periodUid, int periodIndex, long positionMs, long contentPositionMs, int adGroupIndex, int adIndexInAdGroup)

Methods
public booleanequals(java.lang.Object o)

public inthashCode()

public BundletoBundle()

from java.lang.Objectclone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait

Fields

public final java.lang.Object windowUid

The UID of the window, or null if the timeline is empty.

public final int windowIndex

Deprecated: Use Player.PositionInfo.mediaItemIndex instead.

public final int mediaItemIndex

The media item index.

public final MediaItem mediaItem

The media item, or null if the timeline is empty.

public final java.lang.Object 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 Player.PositionInfo.adGroupIndex is C.INDEX_UNSET, this is the same as Player.PositionInfo.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<Player.PositionInfo> CREATOR

Object that can restore Player.PositionInfo from a .

Constructors

public PositionInfo(java.lang.Object windowUid, int mediaItemIndex, java.lang.Object periodUid, int periodIndex, long positionMs, long contentPositionMs, int adGroupIndex, int adIndexInAdGroup)

Deprecated: Use Player.PositionInfo instead.

public PositionInfo(java.lang.Object windowUid, int mediaItemIndex, MediaItem mediaItem, java.lang.Object periodUid, int periodIndex, long positionMs, long contentPositionMs, int adGroupIndex, int adIndexInAdGroup)

Creates an instance.

Methods

public boolean equals(java.lang.Object o)

public int hashCode()

public Bundle toBundle()

It omits the Player.PositionInfo.windowUid and Player.PositionInfo.periodUid fields. The Player.PositionInfo.windowUid and Player.PositionInfo.periodUid of an instance restored by Player.PositionInfo.CREATOR will always be null.