public static final class Timeline.Period
extends java.lang.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 |
|---|---|
long |
durationUs
The duration of this period in microseconds, or
C.TIME_UNSET if unknown. |
java.lang.Object |
id
An identifier for the period.
|
boolean |
isAd
Whether this period contains an ad.
|
java.lang.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(java.lang.Object id,
java.lang.Object uid,
int windowIndex,
long durationUs,
long positionInWindowUs,
boolean isAd)
Sets the data held by this period.
|
public java.lang.Object id
public java.lang.Object uid
public int windowIndex
public long durationUs
C.TIME_UNSET if unknown.public boolean isAd
public Timeline.Period set(java.lang.Object id, java.lang.Object uid, int windowIndex, long durationUs, long positionInWindowUs, boolean isAd)
public long getDurationMs()
C.TIME_UNSET if unknown.public long getDurationUs()
C.TIME_UNSET if unknown.public long getPositionInWindowMs()
public long getPositionInWindowUs()