public static final class Timeline.Window
extends java.lang.Object
Timeline. A window defines a region of media
currently available for playback along with additional information such as whether seeking is
supported within the window. The figure below shows some of the information defined by a
window, as well as how this information relates to corresponding Timeline.Periods in the
timeline.
| Modifier and Type | Field and Description |
|---|---|
long |
defaultPositionUs
The default position relative to the start of the window at which to begin playback, in
microseconds.
|
long |
durationUs
The duration of this window in microseconds, or
C.TIME_UNSET if unknown. |
int |
firstPeriodIndex
The index of the first period that belongs to this window.
|
java.lang.Object |
id
An identifier for the window.
|
boolean |
isDynamic
Whether this window may change when the timeline is updated.
|
boolean |
isSeekable
Whether it's possible to seek within this window.
|
int |
lastPeriodIndex
The index of the last period that belongs to this window.
|
long |
positionInFirstPeriodUs
The position of the start of this window relative to the start of the first period belonging
to it, in microseconds.
|
long |
presentationStartTimeMs
The start time of the presentation to which this window belongs in milliseconds since the
epoch, or
C.TIME_UNSET if unknown or not applicable. |
long |
windowStartTimeMs
The window's start time in milliseconds since the epoch, or
C.TIME_UNSET if unknown
or not applicable. |
| Constructor and Description |
|---|
Window() |
| Modifier and Type | Method and Description |
|---|---|
long |
getDefaultPositionMs()
Returns the default position relative to the start of the window at which to begin playback,
in milliseconds.
|
long |
getDefaultPositionUs()
Returns the default position relative to the start of the window at which to begin playback,
in microseconds.
|
long |
getDurationMs()
Returns the duration of the window in milliseconds, or
C.TIME_UNSET if unknown. |
long |
getDurationUs()
Returns the duration of this window in microseconds, or
C.TIME_UNSET if unknown. |
long |
getPositionInFirstPeriodMs()
Returns the position of the start of this window relative to the start of the first period
belonging to it, in milliseconds.
|
long |
getPositionInFirstPeriodUs()
Returns the position of the start of this window relative to the start of the first period
belonging to it, in microseconds.
|
Timeline.Window |
set(java.lang.Object id,
long presentationStartTimeMs,
long windowStartTimeMs,
boolean isSeekable,
boolean isDynamic,
long defaultPositionUs,
long durationUs,
int firstPeriodIndex,
int lastPeriodIndex,
long positionInFirstPeriodUs)
Sets the data held by this window.
|
public java.lang.Object id
public long presentationStartTimeMs
C.TIME_UNSET if unknown or not applicable. For informational purposes only.public long windowStartTimeMs
C.TIME_UNSET if unknown
or not applicable. For informational purposes only.public boolean isSeekable
public boolean isDynamic
public int firstPeriodIndex
public int lastPeriodIndex
public long defaultPositionUs
C.TIME_UNSET if and only if the window was populated with a
non-zero default position projection, and if the specified projection cannot be performed
whilst remaining within the bounds of the window.public long durationUs
C.TIME_UNSET if unknown.public long positionInFirstPeriodUs
public Timeline.Window set(java.lang.Object id, long presentationStartTimeMs, long windowStartTimeMs, boolean isSeekable, boolean isDynamic, long defaultPositionUs, long durationUs, int firstPeriodIndex, int lastPeriodIndex, long positionInFirstPeriodUs)
public long getDefaultPositionMs()
C.TIME_UNSET if and only if the window was populated with a
non-zero default position projection, and if the specified projection cannot be performed
whilst remaining within the bounds of the window.public long getDefaultPositionUs()
C.TIME_UNSET if and only if the window was populated with a
non-zero default position projection, and if the specified projection cannot be performed
whilst remaining within the bounds of the window.public long getDurationMs()
C.TIME_UNSET if unknown.public long getDurationUs()
C.TIME_UNSET if unknown.public long getPositionInFirstPeriodMs()
public long getPositionInFirstPeriodUs()