LoadControl.Parameters
public final class LoadControl.Parameters
Information about the current playback context and the MediaPeriod for which LoadControl methods are called.
Summary
Public fields |
|
|---|---|
final long |
The total duration of media that's currently buffered. |
final long |
Sets the time at which the last rebuffering occurred, in milliseconds since boot including time spent in sleep. |
final MediaSource.MediaPeriodId |
The |
final boolean |
Whether playback should proceed when |
final long |
The current playback position in microseconds, relative to the start of the affected |
final float |
The current factor by which playback is sped up. |
final PlayerId |
The |
final boolean |
Whether the player is rebuffering. |
final long |
The desired playback position offset to the live edge in microseconds, or |
final Timeline |
The current |
Public constructors |
|---|
Parameters(Creates parameters for |
Public fields
bufferedDurationUs
public final long bufferedDurationUs
The total duration of media that's currently buffered.
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.
mediaPeriodId
public final MediaSource.MediaPeriodId mediaPeriodId
The MediaPeriodId of the affected MediaPeriod in the current timeline.
playbackPositionUs
public final long playbackPositionUs
The current playback position in microseconds, relative to the start of the affected MediaPeriod identified by mediaPeriodId. If playback of this period has not yet started, the value will be negative and equal in magnitude to the duration of any media in previous periods still to be played.
rebuffering
public final boolean rebuffering
Whether the player is rebuffering. A rebuffer is defined to be caused by buffer depletion rather than a user action. Hence this parameter is false during initial buffering and when buffering as a result of a seek operation.
targetLiveOffsetUs
public final long targetLiveOffsetUs
The desired playback position offset to the live edge in microseconds, or TIME_UNSET if the media is not a live stream or no offset is configured.
Public constructors
Parameters
public Parameters(
PlayerId playerId,
Timeline timeline,
MediaSource.MediaPeriodId mediaPeriodId,
long playbackPositionUs,
long bufferedDurationUs,
float playbackSpeed,
boolean playWhenReady,
boolean rebuffering,
long targetLiveOffsetUs,
long lastRebufferRealtimeMs
)
Creates parameters for LoadControl methods.
| Parameters | |
|---|---|
PlayerId playerId |
See |
Timeline timeline |
See |
MediaSource.MediaPeriodId mediaPeriodId |
See |
long playbackPositionUs |
See |
long bufferedDurationUs |
See |
float playbackSpeed |
See |
boolean playWhenReady |
See |
boolean rebuffering |
See |
long targetLiveOffsetUs |
See |
long lastRebufferRealtimeMs |