Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions RELEASENOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
* Fix a bug where `ExoPlayer.isLoading()` remains `true` while it has
transitioned to `STATE_IDLE` or `STATE_ENDED`
([#2133](https://github.com/androidx/media/issues/2133)).
* Add `lastRebufferRealtimeMs` to `LoadControl.Parameter`
([#2113](https://github.com/androidx/media/pull/2113))
* Transformer:
* Track Selection:
* Extractors:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2168,7 +2168,8 @@ private boolean shouldTransitionToReadyState(boolean renderersReadyOrEnded) {
mediaClock.getPlaybackParameters().speed,
playbackInfo.playWhenReady,
isRebuffering,
targetLiveOffsetUs));
targetLiveOffsetUs,
lastRebufferRealtimeMs));
}

private boolean isTimelineReady() {
Expand Down Expand Up @@ -2888,7 +2889,8 @@ private boolean shouldContinueLoading() {
mediaClock.getPlaybackParameters().speed,
playbackInfo.playWhenReady,
isRebuffering,
targetLiveOffsetUs);
targetLiveOffsetUs,
lastRebufferRealtimeMs);
boolean shouldContinueLoading = loadControl.shouldContinueLoading(loadParameters);
MediaPeriodHolder playingPeriodHolder = queue.getPlayingPeriod();
if (!shouldContinueLoading
Expand Down Expand Up @@ -3146,7 +3148,8 @@ private void updateLoadControlTrackSelection(
mediaClock.getPlaybackParameters().speed,
playbackInfo.playWhenReady,
isRebuffering,
targetLiveOffsetUs),
targetLiveOffsetUs,
lastRebufferRealtimeMs),
trackGroups,
trackSelectorResult.selections);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/
package androidx.media3.exoplayer;

import android.os.SystemClock;
import androidx.media3.common.C;
import androidx.media3.common.Player;
import androidx.media3.common.Timeline;
Expand Down Expand Up @@ -80,6 +81,18 @@ final class Parameters {
*/
public final long targetLiveOffsetUs;

/**
* Sets the time at which the last rebuffering occurred, in milliseconds since boot including
* time spent in sleep.
*
* <p>The time base used is the same as that measured by {@link SystemClock#elapsedRealtime}.
*
* <p><b>Note:</b> 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 {@link C#TIME_UNSET}.
*/
public final long lastRebufferRealtimeMs;

/**
* Creates parameters for {@link LoadControl} methods.
*
Expand All @@ -92,6 +105,7 @@ final class Parameters {
* @param playWhenReady See {@link #playWhenReady}.
* @param rebuffering See {@link #rebuffering}.
* @param targetLiveOffsetUs See {@link #targetLiveOffsetUs}.
* @param lastRebufferRealtimeMs see {@link #lastRebufferRealtimeMs}
*/
public Parameters(
PlayerId playerId,
Expand All @@ -102,7 +116,8 @@ public Parameters(
float playbackSpeed,
boolean playWhenReady,
boolean rebuffering,
long targetLiveOffsetUs) {
long targetLiveOffsetUs,
long lastRebufferRealtimeMs) {
this.playerId = playerId;
this.timeline = timeline;
this.mediaPeriodId = mediaPeriodId;
Expand All @@ -112,6 +127,7 @@ public Parameters(
this.playWhenReady = playWhenReady;
this.rebuffering = rebuffering;
this.targetLiveOffsetUs = targetLiveOffsetUs;
this.lastRebufferRealtimeMs = lastRebufferRealtimeMs;
}
}

Expand Down
Loading