public static final class Timeline.Period extends Object
Timeline
. A period defines a single logical piece
of media, for example a a media file. See Timeline
for more details. The figure below
shows some of the information defined by a period, as well as how this information relates to a
corresponding Timeline.Window
in the timeline.
Modifier and Type | Field and Description |
---|---|
Object |
id
An identifier for the period.
|
Object |
uid
A unique identifier for the period.
|
int |
windowIndex
The index of the window to which this period belongs.
|
Constructor and Description |
---|
Period() |
Modifier and Type | Method and Description |
---|---|
long |
getDurationMs()
Returns the duration of the period in milliseconds, or
C.TIME_UNSET if unknown. |
long |
getDurationUs()
Returns the duration of this period in microseconds, or
C.TIME_UNSET if unknown. |
long |
getPositionInWindowMs()
Returns the position of the start of this period relative to the start of the window to which
it belongs, in milliseconds.
|
long |
getPositionInWindowUs()
Returns the position of the start of this period relative to the start of the window to which
it belongs, in microseconds.
|
Timeline.Period |
set(Object id,
Object uid,
int windowIndex,
long durationUs,
long positionInWindowUs)
Sets the data held by this period.
|
public Object id
public Object uid
public int windowIndex
public Timeline.Period set(Object id, Object uid, int windowIndex, long durationUs, long positionInWindowUs)
public long getDurationMs()
C.TIME_UNSET
if unknown.public long getDurationUs()
C.TIME_UNSET
if unknown.public long getPositionInWindowMs()
public long getPositionInWindowUs()