LoadControl.Parameters


public final class LoadControl.Parameters


Information about the current playback context and the MediaPeriod for which methods are called.

Summary

Public fields

final long

The total duration of media that's currently buffered.

final MediaSource.MediaPeriodId

The MediaPeriodId of the affected MediaPeriod in the current timeline.

final boolean

Whether playback should proceed when STATE_READY.

final long

The current playback position in microseconds, relative to the start of the affected identified by mediaPeriodId.

final float

The current factor by which playback is sped up.

final PlayerId

The ID of the player.

final boolean

Whether the player is rebuffering.

final long

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.

final Timeline

The current Timeline of the player.

Public constructors

Parameters(
    PlayerId playerId,
    Timeline timeline,
    MediaSource.MediaPeriodId mediaPeriodId,
    long playbackPositionUs,
    long bufferedDurationUs,
    float playbackSpeed,
    boolean playWhenReady,
    boolean rebuffering,
    long targetLiveOffsetUs
)

Creates parameters for LoadControl methods.

Public fields

bufferedDurationUs

public final long bufferedDurationUs

The total duration of media that's currently buffered.

mediaPeriodId

public final MediaSource.MediaPeriodId mediaPeriodId

The MediaPeriodId of the affected MediaPeriod in the current timeline.

playWhenReady

public final boolean playWhenReady

Whether playback should proceed when STATE_READY.

playbackPositionUs

public final long playbackPositionUs

The current playback position in microseconds, relative to the start of the affected 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.

playbackSpeed

public final float playbackSpeed

The current factor by which playback is sped up.

playerId

public final PlayerId playerId

The ID of the player.

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.

timeline

public final Timeline timeline

The current Timeline of the player.

Public constructors

Parameters

public Parameters(
    PlayerId playerId,
    Timeline timeline,
    MediaSource.MediaPeriodId mediaPeriodId,
    long playbackPositionUs,
    long bufferedDurationUs,
    float playbackSpeed,
    boolean playWhenReady,
    boolean rebuffering,
    long targetLiveOffsetUs
)

Creates parameters for LoadControl methods.

Parameters
PlayerId playerId

See playerId.

Timeline timeline

See timeline.

MediaSource.MediaPeriodId mediaPeriodId

See mediaPeriodId.

long playbackPositionUs

See playbackPositionUs.

long bufferedDurationUs

See bufferedDurationUs.

float playbackSpeed

See playbackSpeed.

boolean playWhenReady

See playWhenReady.

boolean rebuffering

See rebuffering.

long targetLiveOffsetUs

See targetLiveOffsetUs.