SegmentBase.SegmentTemplate


class SegmentBase.SegmentTemplate : SegmentBase.MultiSegmentBase


A MultiSegmentBase that uses a SegmentTemplate to define its segments.

Summary

Public constructors

SegmentTemplate(
    initialization: RangedUri!,
    timescale: Long,
    presentationTimeOffset: Long,
    startNumber: Long,
    endNumber: Long,
    duration: Long,
    segmentTimeline: (Mutable)List<SegmentBase.SegmentTimelineElement!>?,
    availabilityTimeOffsetUs: Long,
    initializationTemplate: UrlTemplate?,
    mediaTemplate: UrlTemplate?,
    timeShiftBufferDepthUs: Long,
    periodStartUnixTimeUs: Long
)

Public functions

RangedUri?

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

Long
getSegmentCount(periodDurationUs: Long)

See getSegmentCount.

RangedUri!
getSegmentUrl(representation: Representation!, sequenceNumber: Long)

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

Inherited functions

From androidx.media3.exoplayer.dash.manifest.SegmentBase
Long

Returns the presentation time offset, in microseconds.

From androidx.media3.exoplayer.dash.manifest.SegmentBase.MultiSegmentBase
Long
getAvailableSegmentCount(periodDurationUs: Long, nowUnixTimeUs: Long)

See getAvailableSegmentCount.

Long
getFirstAvailableSegmentNum(periodDurationUs: Long, nowUnixTimeUs: Long)

See getFirstAvailableSegmentNum.

Long

See getFirstSegmentNum.

Long
getNextSegmentAvailableTimeUs(
    periodDurationUs: Long,
    nowUnixTimeUs: Long
)

See getNextSegmentAvailableTimeUs.

Long
getSegmentDurationUs(sequenceNumber: Long, periodDurationUs: Long)

See getDurationUs.

Long
getSegmentNum(timeUs: Long, periodDurationUs: Long)

See getSegmentNum.

Long
getSegmentTimeUs(sequenceNumber: Long)

See getTimeUs.

Boolean

See isExplicit

Public constructors

SegmentTemplate

SegmentTemplate(
    initialization: RangedUri!,
    timescale: Long,
    presentationTimeOffset: Long,
    startNumber: Long,
    endNumber: Long,
    duration: Long,
    segmentTimeline: (Mutable)List<SegmentBase.SegmentTimelineElement!>?,
    availabilityTimeOffsetUs: Long,
    initializationTemplate: UrlTemplate?,
    mediaTemplate: UrlTemplate?,
    timeShiftBufferDepthUs: Long,
    periodStartUnixTimeUs: Long
)
Parameters
initialization: RangedUri!

A RangedUri corresponding to initialization data, if such data exists. The value of this parameter is ignored if initializationTemplate is non-null.

timescale: Long

The timescale in units per second.

presentationTimeOffset: Long

The presentation time offset. The value in seconds is the division of this value and timescale.

startNumber: Long

The sequence number of the first segment.

endNumber: Long

The sequence number of the last segment as specified by the SupplementalProperty with schemeIdUri="http://dashif.org/guidelines/last-segment-number", or INDEX_UNSET.

duration: Long

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: (Mutable)List<SegmentBase.SegmentTimelineElement!>?

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: Long

The offset to the current realtime at which segments become available in microseconds, or TIME_UNSET if not applicable.

initializationTemplate: UrlTemplate?

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: UrlTemplate?

A template defining the location of each media segment.

timeShiftBufferDepthUs: Long

The time shift buffer depth in microseconds.

periodStartUnixTimeUs: Long

The start of the enclosing period in microseconds since the Unix epoch.

Public functions

getInitialization

fun getInitialization(representation: Representation!): RangedUri?

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

Parameters
representation: Representation!

The Representation for which initialization data is required.

Returns
RangedUri?

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

getSegmentCount

fun getSegmentCount(periodDurationUs: Long): Long

See getSegmentCount.

getSegmentUrl

fun getSegmentUrl(representation: Representation!, sequenceNumber: Long): RangedUri!

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

See getSegmentUrl.