public final class

MediaSource.MediaPeriodId

extends java.lang.Object

 java.lang.Object

↳androidx.media3.exoplayer.source.MediaSource.MediaPeriodId

Overview

Identifier for a MediaPeriod.

Summary

Fields
public final intadGroupIndex

If the media period is in an ad group, the index of the ad group in the period.

public final intadIndexInAdGroup

If the media period is in an ad group, the index of the ad in its ad group in the period.

public final intnextAdGroupIndex

The index of the next ad group to which the media period's content is clipped, or C.INDEX_UNSET if there is no following ad group or if this media period is an ad.

public final java.lang.ObjectperiodUid

The unique id of the timeline period.

public final longwindowSequenceNumber

The sequence number of the window in the buffered sequence of windows this media period is part of.

Constructors
publicMediaPeriodId(java.lang.Object periodUid)

Creates a media period identifier for a period which is not part of a buffered sequence of windows.

publicMediaPeriodId(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.

publicMediaPeriodId(java.lang.Object periodUid, long windowSequenceNumber)

Creates a media period identifier for the specified period in the timeline.

publicMediaPeriodId(java.lang.Object periodUid, long windowSequenceNumber, int nextAdGroupIndex)

Creates a media period identifier for the specified clipped period in the timeline.

Methods
public MediaSource.MediaPeriodIdcopyWithPeriodUid(java.lang.Object newPeriodUid)

Returns a copy of this period identifier but with newPeriodUid as its period uid.

public MediaSource.MediaPeriodIdcopyWithWindowSequenceNumber(long windowSequenceNumber)

Returns a copy of this period identifier with a new windowSequenceNumber.

public booleanequals(java.lang.Object obj)

public inthashCode()

public booleanisAd()

Returns whether this period identifier identifies an ad in an ad group in a period.

from java.lang.Objectclone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait

Fields

public final java.lang.Object periodUid

The unique id of the timeline period.

public final int adGroupIndex

If the media period is in an ad group, the index of the ad group in the period. C.INDEX_UNSET otherwise.

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_UNSET otherwise.

public final long windowSequenceNumber

The sequence number of the window in the buffered sequence of windows this media period is part of. C.INDEX_UNSET if the media period id is not part of a buffered sequence of windows.

public final int nextAdGroupIndex

The index of the next ad group to which the media period's content is clipped, or C.INDEX_UNSET if there is no following ad group or if this media period is an ad.

Constructors

public MediaPeriodId(java.lang.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.

public MediaPeriodId(java.lang.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.

public MediaPeriodId(java.lang.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.

public 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.

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.

Methods

public MediaSource.MediaPeriodId copyWithPeriodUid(java.lang.Object newPeriodUid)

Returns a copy of this period identifier but with newPeriodUid as its period uid.

public MediaSource.MediaPeriodId copyWithWindowSequenceNumber(long windowSequenceNumber)

Returns a copy of this period identifier with a new windowSequenceNumber.

public boolean isAd()

Returns whether this period identifier identifies an ad in an ad group in a period.

public boolean equals(java.lang.Object obj)

public int hashCode()