public final class

LoadControl.Parameters

extends java.lang.Object

 java.lang.Object

↳androidx.media3.exoplayer.LoadControl.Parameters

Overview

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

Summary

Fields
public final longbufferedDurationUs

The total duration of media that's currently buffered.

public final MediaSource.MediaPeriodIdmediaPeriodId

The MediaSource.MediaPeriodId of the affected MediaPeriod in the current LoadControl.Parameters.timeline.

public final longplaybackPositionUs

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

public final floatplaybackSpeed

The current factor by which playback is sped up.

public final PlayerIdplayerId

The ID of the player.

public final booleanplayWhenReady

Whether playback should proceed when Player.STATE_READY.

public final booleanrebuffering

Whether the player is rebuffering.

public final longtargetLiveOffsetUs

The desired playback position offset to the live edge in microseconds, or C.TIME_UNSET if the media is not a live stream or no offset is configured.

public final Timelinetimeline

The current Timeline of the player.

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

Creates parameters for LoadControl methods.

Methods
from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Fields

public final PlayerId playerId

The ID of the player.

public final Timeline timeline

The current Timeline of the player.

public final MediaSource.MediaPeriodId mediaPeriodId

The MediaSource.MediaPeriodId of the affected MediaPeriod in the current LoadControl.Parameters.timeline.

public final long playbackPositionUs

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

public final long bufferedDurationUs

The total duration of media that's currently buffered.

public final float playbackSpeed

The current factor by which playback is sped up.

public final boolean playWhenReady

Whether playback should proceed when Player.STATE_READY.

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.

public final long targetLiveOffsetUs

The desired playback position offset to the live edge in microseconds, or C.TIME_UNSET if the media is not a live stream or no offset is configured.

Constructors

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: See LoadControl.Parameters.playerId.
timeline: See LoadControl.Parameters.timeline.
mediaPeriodId: See LoadControl.Parameters.mediaPeriodId.
playbackPositionUs: See LoadControl.Parameters.playbackPositionUs.
bufferedDurationUs: See LoadControl.Parameters.bufferedDurationUs.
playbackSpeed: See LoadControl.Parameters.playbackSpeed.
playWhenReady: See LoadControl.Parameters.playWhenReady.
rebuffering: See LoadControl.Parameters.rebuffering.
targetLiveOffsetUs: See LoadControl.Parameters.targetLiveOffsetUs.