Remove unused PlaybackInfo.resetToNewPosition
PiperOrigin-RevId: 244838165
This commit is contained in:
parent
9441f72445
commit
3acd8a6048
@ -628,8 +628,11 @@ import java.util.concurrent.CopyOnWriteArrayList;
|
||||
if (playbackInfo.startPositionUs == C.TIME_UNSET) {
|
||||
// Replace internal unset start position with externally visible start position of zero.
|
||||
playbackInfo =
|
||||
playbackInfo.resetToNewPosition(
|
||||
playbackInfo.periodId, /* startPositionUs= */ 0, playbackInfo.contentPositionUs);
|
||||
playbackInfo.copyWithNewPosition(
|
||||
playbackInfo.periodId,
|
||||
/* positionUs= */ 0,
|
||||
playbackInfo.contentPositionUs,
|
||||
playbackInfo.totalBufferedDurationUs);
|
||||
}
|
||||
if (!this.playbackInfo.timeline.isEmpty() && playbackInfo.timeline.isEmpty()) {
|
||||
// Update the masking variables, which are used when the timeline becomes empty.
|
||||
|
@ -170,35 +170,7 @@ import com.google.android.exoplayer2.trackselection.TrackSelectorResult;
|
||||
}
|
||||
|
||||
/**
|
||||
* Copies playback info and resets playing and loading position.
|
||||
*
|
||||
* @param periodId New playing and loading {@link MediaPeriodId}.
|
||||
* @param startPositionUs New start position. See {@link #startPositionUs}.
|
||||
* @param contentPositionUs New content position. See {@link #contentPositionUs}. Value is ignored
|
||||
* if {@code periodId.isAd()} is true.
|
||||
* @return Copied playback info with reset position.
|
||||
*/
|
||||
@CheckResult
|
||||
public PlaybackInfo resetToNewPosition(
|
||||
MediaPeriodId periodId, long startPositionUs, long contentPositionUs) {
|
||||
return new PlaybackInfo(
|
||||
timeline,
|
||||
manifest,
|
||||
periodId,
|
||||
startPositionUs,
|
||||
periodId.isAd() ? contentPositionUs : C.TIME_UNSET,
|
||||
playbackState,
|
||||
isLoading,
|
||||
trackGroups,
|
||||
trackSelectorResult,
|
||||
periodId,
|
||||
startPositionUs,
|
||||
/* totalBufferedDurationUs= */ 0,
|
||||
startPositionUs);
|
||||
}
|
||||
|
||||
/**
|
||||
* Copied playback info with new playing position.
|
||||
* Copies playback info with new playing position.
|
||||
*
|
||||
* @param periodId New playing media period. See {@link #periodId}.
|
||||
* @param positionUs New position. See {@link #positionUs}.
|
||||
|
Loading…
x
Reference in New Issue
Block a user