public final class

SegmentBase.SegmentTemplate

extends SegmentBase.MultiSegmentBase

 java.lang.Object

androidx.media3.exoplayer.dash.manifest.SegmentBase

androidx.media3.exoplayer.dash.manifest.SegmentBase.MultiSegmentBase

↳androidx.media3.exoplayer.dash.manifest.SegmentBase.SegmentTemplate

Overview

A SegmentBase.MultiSegmentBase that uses a SegmentTemplate to define its segments.

Summary

Constructors
publicSegmentTemplate(RangedUri initialization, long timescale, long presentationTimeOffset, long startNumber, long endNumber, long duration, java.util.List<SegmentBase.SegmentTimelineElement> segmentTimeline, long availabilityTimeOffsetUs, UrlTemplate initializationTemplate, UrlTemplate mediaTemplate, long timeShiftBufferDepthUs, long periodStartUnixTimeUs)

Methods
public RangedUrigetInitialization(Representation representation)

Returns the RangedUri defining the location of initialization data for a given representation, or null if no initialization data exists.

public abstract longgetSegmentCount(long periodDurationUs)

See DashSegmentIndex.getSegmentCount(long).

public abstract RangedUrigetSegmentUrl(Representation representation, long index)

Returns a RangedUri defining the location of a segment for the given index in the given representation.

from SegmentBase.MultiSegmentBasegetAvailableSegmentCount, getFirstAvailableSegmentNum, getFirstSegmentNum, getNextSegmentAvailableTimeUs, getSegmentDurationUs, getSegmentNum, getSegmentTimeUs, isExplicit
from SegmentBasegetPresentationTimeOffsetUs
from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructors

public SegmentTemplate(RangedUri initialization, long timescale, long presentationTimeOffset, long startNumber, long endNumber, long duration, java.util.List<SegmentBase.SegmentTimelineElement> segmentTimeline, long availabilityTimeOffsetUs, UrlTemplate initializationTemplate, UrlTemplate mediaTemplate, long timeShiftBufferDepthUs, long periodStartUnixTimeUs)

Parameters:

initialization: A RangedUri corresponding to initialization data, if such data exists. The value of this parameter is ignored if initializationTemplate is non-null.
timescale: The timescale in units per second.
presentationTimeOffset: The presentation time offset. The value in seconds is the division of this value and timescale.
startNumber: The sequence number of the first segment.
endNumber: The sequence number of the last segment as specified by the SupplementalProperty with schemeIdUri="http://dashif.org/guidelines/last-segment-number", or C.INDEX_UNSET.
duration: The duration of each segment in the case of fixed duration segments. The value in seconds is the division of this value and timescale. If segmentTimeline is non-null then this parameter is ignored.
segmentTimeline: A segment timeline corresponding to the segments. If null, then segments are assumed to be of fixed duration as specified by the duration parameter.
availabilityTimeOffsetUs: The offset to the current realtime at which segments become available in microseconds, or C.TIME_UNSET if not applicable.
initializationTemplate: A template defining the location of initialization data, if such data exists. If non-null then the initialization parameter is ignored. If null then initialization will be used.
mediaTemplate: A template defining the location of each media segment.
timeShiftBufferDepthUs: The time shift buffer depth in microseconds.
periodStartUnixTimeUs: The start of the enclosing period in microseconds since the Unix epoch.

Methods

public RangedUri getInitialization(Representation representation)

Returns the RangedUri defining the location of initialization data for a given representation, or null if no initialization data exists.

Parameters:

representation: The Representation for which initialization data is required.

Returns:

A RangedUri defining the location of the initialization data, or null.

public abstract RangedUri getSegmentUrl(Representation representation, long index)

Returns a RangedUri defining the location of a segment for the given index in the given representation.

See DashSegmentIndex.getSegmentUrl(long).

public abstract long getSegmentCount(long periodDurationUs)

See DashSegmentIndex.getSegmentCount(long).