Class MediaPeriodId
- java.lang.Object
-
- com.google.android.exoplayer2.source.MediaPeriodId
-
- Direct Known Subclasses:
MediaSource.MediaPeriodId
public class MediaPeriodId extends Object
Identifies a specific playback of aTimeline.Period.A
Timeline.Periodcan be played multiple times, for example if it is repeated. Each instances of this class identifies a specific playback of aTimeline.Period.In ExoPlayer's implementation,
MediaPeriodIdidentifies aMediaPeriod.
-
-
Field Summary
Fields Modifier and Type Field Description intadGroupIndexIf the media period is in an ad group, the index of the ad group in the period.intadIndexInAdGroupIf the media period is in an ad group, the index of the ad in its ad group in the period.intnextAdGroupIndexThe index of the next ad group to which the media period's content is clipped, orC.INDEX_UNSETif there is no following ad group or if this media period is an ad.ObjectperiodUidThe unique id of the timeline period.longwindowSequenceNumberThe sequence number of the window in the buffered sequence of windows this media period is part of.
-
Constructor Summary
Constructors Modifier Constructor Description protectedMediaPeriodId(MediaPeriodId mediaPeriodId)Copy constructor for inheritance.MediaPeriodId(Object periodUid)Creates a media period identifier for a period which is not part of a buffered sequence of windows.MediaPeriodId(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(Object periodUid, long windowSequenceNumber)Creates a media period identifier for the specified period in the timeline.MediaPeriodId(Object periodUid, long windowSequenceNumber, int nextAdGroupIndex)Creates a media period identifier for the specified clipped period in the timeline.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MediaPeriodIdcopyWithPeriodUid(Object newPeriodUid)Returns a copy of this period identifier but withnewPeriodUidas its period uid.MediaPeriodIdcopyWithWindowSequenceNumber(long windowSequenceNumber)Returns a copy of this period identifier with a newwindowSequenceNumber.booleanequals(Object obj)inthashCode()booleanisAd()Returns whether this period identifier identifies an ad in an ad group in a period.
-
-
-
Field Detail
-
periodUid
public final Object periodUid
The unique id of the timeline period.
-
adGroupIndex
public final int adGroupIndex
If the media period is in an ad group, the index of the ad group in the period.C.INDEX_UNSETotherwise.
-
adIndexInAdGroup
public final int adIndexInAdGroup
If the media period is in an ad group, the index of the ad in its ad group in the period.C.INDEX_UNSETotherwise.
-
windowSequenceNumber
public final long windowSequenceNumber
The sequence number of the window in the buffered sequence of windows this media period is part of.C.INDEX_UNSETif the media period id is not part of a buffered sequence of windows.
-
nextAdGroupIndex
public final int nextAdGroupIndex
The index of the next ad group to which the media period's content is clipped, orC.INDEX_UNSETif there is no following ad group or if this media period is an ad.
-
-
Constructor Detail
-
MediaPeriodId
public MediaPeriodId(Object periodUid)
Creates a media period identifier for a period which is not part of a buffered sequence of windows.- Parameters:
periodUid- The unique id of the timeline period.
-
MediaPeriodId
public MediaPeriodId(Object periodUid, long windowSequenceNumber)
Creates a media period identifier for the specified period in the timeline.- Parameters:
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.
-
MediaPeriodId
public MediaPeriodId(Object periodUid, long windowSequenceNumber, int nextAdGroupIndex)
Creates a media period identifier for the specified clipped period in the timeline.- Parameters:
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.nextAdGroupIndex- The index of the next ad group to which the media period's content is clipped.
-
MediaPeriodId
public MediaPeriodId(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.- Parameters:
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.
-
MediaPeriodId
protected MediaPeriodId(MediaPeriodId mediaPeriodId)
Copy constructor for inheritance.
-
-
Method Detail
-
copyWithPeriodUid
public MediaPeriodId copyWithPeriodUid(Object newPeriodUid)
Returns a copy of this period identifier but withnewPeriodUidas its period uid.
-
copyWithWindowSequenceNumber
public MediaPeriodId copyWithWindowSequenceNumber(long windowSequenceNumber)
Returns a copy of this period identifier with a newwindowSequenceNumber.
-
isAd
public boolean isAd()
Returns whether this period identifier identifies an ad in an ad group in a period.
-
-