Player.PositionInfo
class Player.PositionInfo
Position info describing a playback position involved in a discontinuity.
Summary
Public constructors |
|---|
@UnstableApiThis function is deprecated. Use |
@UnstableApiCreates an instance. |
Public functions |
|
|---|---|
Boolean |
|
Boolean |
Returns whether this position info and the other position info would result in the same |
Player.PositionInfo! |
@UnstableApiReturns a copy of this position info, filtered by the specified available commands. |
java-static Player.PositionInfo! |
@UnstableApiRestores a |
Int |
hashCode() |
Bundle! |
This function is deprecated. Use |
Bundle! |
@UnstableApiReturns a |
String! |
toString() |
Public properties |
|
|---|---|
Int |
The ad group index if the playback position is within an ad, |
Int |
The index of the ad within the ad group if the playback position is within an ad, |
Long |
The content position, in milliseconds. |
MediaItem? |
The media item, or |
Int |
The media item index. |
Int |
The period index. |
Any? |
The UID of the period, or |
Long |
The playback position, in milliseconds. |
Int |
This property is deprecated. Use |
Any? |
The UID of the window, or |
Public constructors
PositionInfo
@UnstableApiPositionInfo(
windowUid: Any?,
mediaItemIndex: Int,
periodUid: Any?,
periodIndex: Int,
positionMs: Long,
contentPositionMs: Long,
adGroupIndex: Int,
adIndexInAdGroup: Int
)
Public functions
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 |
canAccessTimeline: Boolean |
Whether |
| Returns | |
|---|---|
Player.PositionInfo! |
The filtered position info. |
fromBundle
@UnstableApi
java-static fun fromBundle(bundle: Bundle!): Player.PositionInfo!
Restores a PositionInfo from a 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 adGroupIndex: Int
The ad group index if the playback position is within an ad, INDEX_UNSET otherwise.
adIndexInAdGroup
val adIndexInAdGroup: Int
The index of the ad within the ad group if the playback position is within an ad, INDEX_UNSET otherwise.
contentPositionMs
val contentPositionMs: Long
The content position, in milliseconds.
If adGroupIndex is INDEX_UNSET, this is the same as positionMs.