public static final class MediaSource.MediaPeriodId
extends java.lang.Object
MediaPeriod
.Modifier and Type | Field and Description |
---|---|
int |
adGroupIndex
If the media period is in an ad group, the index of the ad group in the period.
|
int |
adIndexInAdGroup
If the media period is in an ad group, the index of the ad in its ad group in the period.
|
long |
endPositionUs
The end position of the media to play within the media period, in microseconds, or
C.TIME_END_OF_SOURCE if the end position is the end of the media period. |
java.lang.Object |
periodUid
The unique id of the timeline period.
|
long |
windowSequenceNumber
The sequence number of the window in the buffered sequence of windows this media period is
part of.
|
Constructor and Description |
---|
MediaPeriodId(java.lang.Object periodUid)
Creates a media period identifier for a dummy period which is not part of a buffered sequence
of windows.
|
MediaPeriodId(java.lang.Object periodUid,
int adGroupIndex,
int adIndexInAdGroup,
long windowSequenceNumber)
Creates a media period identifier that identifies an ad within an ad group at the specified
timeline period.
|
MediaPeriodId(java.lang.Object periodUid,
long windowSequenceNumber)
Creates a media period identifier for the specified period in the timeline.
|
MediaPeriodId(java.lang.Object periodUid,
long windowSequenceNumber,
long endPositionUs)
Creates a media period identifier for the specified clipped period in the timeline.
|
Modifier and Type | Method and Description |
---|---|
MediaSource.MediaPeriodId |
copyWithPeriodUid(java.lang.Object newPeriodUid)
Returns a copy of this period identifier but with
newPeriodUid as its period uid. |
boolean |
equals(java.lang.Object obj) |
int |
hashCode() |
boolean |
isAd()
Returns whether this period identifier identifies an ad in an ad group in a period.
|
public final java.lang.Object periodUid
public final int adGroupIndex
C.INDEX_UNSET
otherwise.public final int adIndexInAdGroup
C.INDEX_UNSET
otherwise.public final long windowSequenceNumber
C.INDEX_UNSET
if the media period id is not part of a buffered sequence of
windows.public final long endPositionUs
C.TIME_END_OF_SOURCE
if the end position is the end of the media period.
Note that this only applies if the media period is for content (i.e., not for an ad) and is clipped to the position of the next ad group.
public MediaPeriodId(java.lang.Object periodUid)
periodUid
- The unique id of the timeline period.public MediaPeriodId(java.lang.Object periodUid, long windowSequenceNumber)
periodUid
- The unique id of the timeline period.windowSequenceNumber
- The sequence number of the window in the buffered sequence of
windows this media period is part of.public MediaPeriodId(java.lang.Object periodUid, long windowSequenceNumber, long endPositionUs)
periodUid
- The unique id of the timeline period.windowSequenceNumber
- The sequence number of the window in the buffered sequence of
windows this media period is part of.endPositionUs
- The end position of the media period within the timeline period, in
microseconds.public MediaPeriodId(java.lang.Object periodUid, int adGroupIndex, int adIndexInAdGroup, long windowSequenceNumber)
periodUid
- The unique id of the timeline period that contains the ad group.adGroupIndex
- The index of the ad group.adIndexInAdGroup
- The index of the ad in the ad group.windowSequenceNumber
- The sequence number of the window in the buffered sequence of
windows this media period is part of.public MediaSource.MediaPeriodId copyWithPeriodUid(java.lang.Object newPeriodUid)
newPeriodUid
as its period uid.public boolean isAd()
public boolean equals(@Nullable java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object