Player.PositionInfo


class Player.PositionInfo


Position info describing a playback position involved in a discontinuity.

Summary

Public constructors

@UnstableApi
PositionInfo(
    windowUid: Any?,
    mediaItemIndex: Int,
    periodUid: Any?,
    periodIndex: Int,
    positionMs: Long,
    contentPositionMs: Long,
    adGroupIndex: Int,
    adIndexInAdGroup: Int
)

This function is deprecated.

Use PositionInfo instead.

@UnstableApi
PositionInfo(
    windowUid: Any?,
    mediaItemIndex: Int,
    mediaItem: MediaItem?,
    periodUid: Any?,
    periodIndex: Int,
    positionMs: Long,
    contentPositionMs: Long,
    adGroupIndex: Int,
    adIndexInAdGroup: Int
)

Creates an instance.

Public functions

Boolean
equals(o: Any?)
Boolean

Returns whether this position info and the other position info would result in the same Bundle.

Player.PositionInfo!
@UnstableApi
filterByAvailableCommands(
    canAccessCurrentMediaItem: Boolean,
    canAccessTimeline: Boolean
)

Returns a copy of this position info, filtered by the specified available commands.

java-static Player.PositionInfo!

Restores a PositionInfo from a Bundle.

Int
Bundle!

This function is deprecated.

Use toBundle instead.

Bundle!
@UnstableApi
toBundle(controllerInterfaceVersion: Int)

Returns a Bundle representing the information stored in this object.

Public properties

Int

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

Int

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

Long

The content position, in milliseconds.

MediaItem?

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

Int

The media item index.

Int

The period index.

Any?

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

Long

The playback position, in milliseconds.

Int

This property is deprecated.

Use mediaItemIndex instead.

Any?

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

Public constructors

PositionInfo

@UnstableApi
PositionInfo(
    windowUid: Any?,
    mediaItemIndex: Int,
    periodUid: Any?,
    periodIndex: Int,
    positionMs: Long,
    contentPositionMs: Long,
    adGroupIndex: Int,
    adIndexInAdGroup: Int
)

PositionInfo

@UnstableApi
PositionInfo(
    windowUid: Any?,
    mediaItemIndex: Int,
    mediaItem: MediaItem?,
    periodUid: Any?,
    periodIndex: Int,
    positionMs: Long,
    contentPositionMs: Long,
    adGroupIndex: Int,
    adIndexInAdGroup: Int
)

Creates an instance.

Public functions

equals

fun equals(o: Any?): Boolean

equalsForBundling

@UnstableApi
fun equalsForBundling(other: Player.PositionInfo!): Boolean

Returns whether this position info and the other position info would result in the same Bundle.

filterByAvailableCommands

@UnstableApi
fun filterByAvailableCommands(
    canAccessCurrentMediaItem: Boolean,
    canAccessTimeline: Boolean
): Player.PositionInfo!

Returns a copy of this position info, filtered by the specified available commands.

The filtered fields are reset to their default values.

The return value may be the same object if nothing is filtered.

Parameters
canAccessCurrentMediaItem: Boolean

Whether COMMAND_GET_CURRENT_MEDIA_ITEM is available.

canAccessTimeline: Boolean

Whether COMMAND_GET_TIMELINE is available.

Returns
Player.PositionInfo!

The filtered position info.

fromBundle

@UnstableApi
java-static fun fromBundle(bundle: Bundle!): Player.PositionInfo!

Restores a PositionInfo from a Bundle.

hashCode

fun hashCode(): Int

toBundle

@UnstableApi
fun toBundle(): Bundle!

toBundle

@UnstableApi
fun toBundle(controllerInterfaceVersion: Int): Bundle!

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 fromBundle will always be null.

Parameters
controllerInterfaceVersion: Int

The interface version of the media controller this Bundle will be sent to.

Public properties

adGroupIndex

val adGroupIndexInt

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

adIndexInAdGroup

val adIndexInAdGroupInt

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

contentPositionMs

val contentPositionMsLong

The content position, in milliseconds.

If adGroupIndex is INDEX_UNSET, this is the same as positionMs.

mediaItem

@UnstableApi
val mediaItemMediaItem?

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

mediaItemIndex

val mediaItemIndexInt

The media item index.

periodIndex

val periodIndexInt

The period index.

periodUid

val periodUidAny?

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

positionMs

val positionMsLong

The playback position, in milliseconds.

windowIndex

@UnstableApi
val windowIndexInt

windowUid

val windowUidAny?

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