@UnstableApi
public final class LoadingInfo


Information about the player state when loading is started or continued.

Summary

Nested types

public final class LoadingInfo.Builder

A builder for LoadingInfo instances.

Public fields

final long

Sets the time at which the last rebuffering occurred, in milliseconds since boot including time spent in sleep.

final long

The current playback position in microseconds, or TIME_UNSET if unset.

final float

The playback speed indicating the current rate of playback, or RATE_UNSET if playback speed is not known when the load is started or continued.

Public methods

LoadingInfo.Builder

Creates a new Builder, copying the initial values from this instance.

boolean
int
boolean
rebufferedSince(long realtimeMs)

Checks if rebuffering has occurred since realtimeMs.

Public fields

lastRebufferRealtimeMs

public final long lastRebufferRealtimeMs

Sets the time at which the last rebuffering occurred, in milliseconds since boot including time spent in sleep.

The time base used is the same as that measured by elapsedRealtime.

Note: If rebuffer events are not known when the load is started or continued, or if no rebuffering has occurred, or if there have been any user interactions such as seeking or stopping the player, the value will be set to TIME_UNSET.

playbackPositionUs

public final long playbackPositionUs

The current playback position in microseconds, or TIME_UNSET if unset. If playback of the period to which this loading info belongs has not yet started, the value will be the starting position in the period minus the duration of any media in previous periods still to be played.

playbackSpeed

public final float playbackSpeed

The playback speed indicating the current rate of playback, or RATE_UNSET if playback speed is not known when the load is started or continued.

Public methods

buildUpon

public LoadingInfo.Builder buildUpon()

Creates a new Builder, copying the initial values from this instance.

equals

public boolean equals(@Nullable Object o)

hashCode

public int hashCode()

rebufferedSince

public boolean rebufferedSince(long realtimeMs)

Checks if rebuffering has occurred since realtimeMs.

Parameters
long realtimeMs

The time to compare against, as measured by elapsedRealtime.

Returns
boolean

Whether rebuffering has occurred since the provided timestamp.