public static final class Timeline.Window extends 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. See Timeline
for more details. The figure below shows some
of the information defined by a window, as well as how this information relates to
corresponding Timeline.Period
s in the timeline.
Modifier and Type | Field and Description |
---|---|
int |
firstPeriodIndex
The index of the first period that belongs to this window.
|
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 |
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 windows 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(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 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 Timeline.Window set(Object id, long presentationStartTimeMs, long windowStartTimeMs, boolean isSeekable, boolean isDynamic, long defaultPositionUs, long durationUs, int firstPeriodIndex, int lastPeriodIndex, long positionInFirstPeriodUs)
public long getDefaultPositionMs()
public long getDefaultPositionUs()
public long getDurationMs()
C.TIME_UNSET
if unknown.public long getDurationUs()
C.TIME_UNSET
if unknown.public long getPositionInFirstPeriodMs()
public long getPositionInFirstPeriodUs()