diff --git a/library/src/main/java/com/google/android/exoplayer2/ExoPlayerImplInternal.java b/library/src/main/java/com/google/android/exoplayer2/ExoPlayerImplInternal.java index 75af1eb242..8cb15a0271 100644 --- a/library/src/main/java/com/google/android/exoplayer2/ExoPlayerImplInternal.java +++ b/library/src/main/java/com/google/android/exoplayer2/ExoPlayerImplInternal.java @@ -913,7 +913,7 @@ import java.io.IOException; timeline.getWindow(period.windowIndex, window); periodIndex = window.firstPeriodIndex; long periodPositionUs = window.getPositionInFirstPeriodUs() - + window.getDefaultStartPositionUs(); + + window.getDefaultPositionUs(); timeline.getPeriod(periodIndex, period); while (periodIndex < window.lastPeriodIndex && periodPositionUs > period.getDurationMs()) { diff --git a/library/src/main/java/com/google/android/exoplayer2/Timeline.java b/library/src/main/java/com/google/android/exoplayer2/Timeline.java index 1fba044e4f..acbe2e34d4 100644 --- a/library/src/main/java/com/google/android/exoplayer2/Timeline.java +++ b/library/src/main/java/com/google/android/exoplayer2/Timeline.java @@ -25,8 +25,8 @@ package com.google.android.exoplayer2; * logical piece of media, for example a media file. A window spans one or more periods, defining * the region within those periods that's currently available for playback along with additional * information such as whether seeking is supported within the window. Each window defines a default - * start position, which is the position from which playback will start when the player starts - * playing the window. The following examples illustrate timelines for various use cases. + * position, which is the position from which playback will start when the player starts playing the + * window. The following examples illustrate timelines for various use cases. * *
@@ -34,18 +34,18 @@ package com.google.android.exoplayer2; *
* A timeline for a single media file or on-demand stream consists of a single period and window. * The window spans the whole period, indicating that all parts of the media are available for - * playback. The window's default start position is typically at the start of the period (indicated - * by the black dot in the figure above). - + * playback. The window's default position is typically at the start of the period (indicated by the + * black dot in the figure above). + * *
*
*
@@ -56,8 +56,8 @@ package com.google.android.exoplayer2; * continually extending as more content is broadcast. If content only remains available for a * limited period of time then the window may start at a non-zero position, defining the region of * content that can still be played. The window will have {@link Window#isDynamic} set to true if - * the stream is still live. Its default start position is typically near to the live edge - * (indicated by the black dot in the figure above). + * the stream is still live. Its default position is typically near to the live edge (indicated by + * the black dot in the figure above). * *
@@ -86,8 +86,8 @@ package com.google.android.exoplayer2; *
* This case is the concatenation of the Single media file or on-demand * stream and Live stream with multiple periods cases. When playback - * of the pre-roll ends, playback of the live stream will start from its default start position near - * the live edge. + * of the pre-roll ends, playback of the live stream will start from its default position near the + * live edge. */ public abstract class Timeline { @@ -206,7 +206,7 @@ public abstract class Timeline { */ public int lastPeriodIndex; - private long defaultStartPositionUs; + private long defaultPositionUs; private long durationUs; private long positionInFirstPeriodUs; @@ -214,14 +214,14 @@ public abstract class Timeline { * Sets the data held by this window. */ public Window set(Object id, long presentationStartTimeMs, long windowStartTimeMs, - boolean isSeekable, boolean isDynamic, long defaultStartPositionUs, long durationUs, + boolean isSeekable, boolean isDynamic, long defaultPositionUs, long durationUs, int firstPeriodIndex, int lastPeriodIndex, long positionInFirstPeriodUs) { this.id = id; this.presentationStartTimeMs = presentationStartTimeMs; this.windowStartTimeMs = windowStartTimeMs; this.isSeekable = isSeekable; this.isDynamic = isDynamic; - this.defaultStartPositionUs = defaultStartPositionUs; + this.defaultPositionUs = defaultPositionUs; this.durationUs = durationUs; this.firstPeriodIndex = firstPeriodIndex; this.lastPeriodIndex = lastPeriodIndex; @@ -233,16 +233,16 @@ public abstract class Timeline { * Returns the default position relative to the start of the window at which to begin playback, * in milliseconds. */ - public long getDefaultStartPositionMs() { - return C.usToMs(defaultStartPositionUs); + public long getDefaultPositionMs() { + return C.usToMs(defaultPositionUs); } /** * Returns the default position relative to the start of the window at which to begin playback, * in microseconds. */ - public long getDefaultStartPositionUs() { - return defaultStartPositionUs; + public long getDefaultPositionUs() { + return defaultPositionUs; } /**