HlsMediaPlaylist.Segment


class HlsMediaPlaylist.Segment : HlsMediaPlaylist.SegmentBase


Media segment reference.

Summary

Public constructors

Segment(
    uri: String!,
    byteRangeOffset: Long,
    byteRangeLength: Long,
    fullSegmentEncryptionKeyUri: String?,
    encryptionIV: String?
)

Creates an instance to be used as init segment.

Segment(
    url: String!,
    initializationSegment: HlsMediaPlaylist.Segment?,
    title: String!,
    durationUs: Long,
    relativeDiscontinuitySequence: Int,
    relativeStartTimeUs: Long,
    drmInitData: DrmInitData?,
    fullSegmentEncryptionKeyUri: String?,
    encryptionIV: String?,
    byteRangeOffset: Long,
    byteRangeLength: Long,
    hasGapTag: Boolean,
    parts: (Mutable)List<HlsMediaPlaylist.Part!>!
)

Creates an instance.

Public functions

HlsMediaPlaylist.Segment!
copyWith(relativeStartTimeUs: Long, relativeDiscontinuitySequence: Int)

Public properties

(Mutable)List<HlsMediaPlaylist.Part!>!

The parts belonging to this segment.

String!

The human readable title of the segment.

Inherited functions

From java.lang.Comparable
abstract Int
compareTo(p: T!)
From androidx.media3.exoplayer.hls.playlist.HlsMediaPlaylist.SegmentBase
Int
compareTo(relativeStartTimeUs: Long!)

Inherited properties

From androidx.media3.exoplayer.hls.playlist.HlsMediaPlaylist.SegmentBase
Long

The segment's byte range length, as defined by #EXT-X-BYTERANGE, #EXT-X-PART or #EXT-X-PRELOAD-HINT, or LENGTH_UNSET if no byte range is specified or the byte range is open-ended.

Long

The segment's byte range offset, as defined by #EXT-X-BYTERANGE, #EXT-X-PART or #EXT-X-PRELOAD-HINT.

DrmInitData?

DRM initialization data for sample decryption, or null if the segment does not use CDM-DRM protection.

Long

The duration of the segment in microseconds, as defined by #EXTINF or #EXT-X-PART.

String?

The encryption initialization vector as defined by #EXT-X-KEY, or null if the segment is not encrypted.

String?

The encryption identity key uri as defined by #EXT-X-KEY, or null if the segment does not use full segment encryption with identity key.

Boolean

Whether the segment is marked as a gap.

HlsMediaPlaylist.Segment?

The media initialization section for this segment, as defined by #EXT-X-MAP.

Int

The number of #EXT-X-DISCONTINUITY tags in the playlist before the segment.

Long

The start time of the segment in microseconds, relative to the start of the playlist.

String!

The url of the segment.

Public constructors

Segment

Segment(
    uri: String!,
    byteRangeOffset: Long,
    byteRangeLength: Long,
    fullSegmentEncryptionKeyUri: String?,
    encryptionIV: String?
)

Creates an instance to be used as init segment.

Parameters
uri: String!

See url.

byteRangeOffset: Long

See byteRangeOffset.

byteRangeLength: Long

See byteRangeLength.

fullSegmentEncryptionKeyUri: String?

See fullSegmentEncryptionKeyUri.

encryptionIV: String?

See encryptionIV.

Segment

Segment(
    url: String!,
    initializationSegment: HlsMediaPlaylist.Segment?,
    title: String!,
    durationUs: Long,
    relativeDiscontinuitySequence: Int,
    relativeStartTimeUs: Long,
    drmInitData: DrmInitData?,
    fullSegmentEncryptionKeyUri: String?,
    encryptionIV: String?,
    byteRangeOffset: Long,
    byteRangeLength: Long,
    hasGapTag: Boolean,
    parts: (Mutable)List<HlsMediaPlaylist.Part!>!
)

Creates an instance.

Parameters
url: String!

See url.

initializationSegment: HlsMediaPlaylist.Segment?

See initializationSegment.

title: String!

See title.

durationUs: Long

See durationUs.

relativeDiscontinuitySequence: Int

See relativeDiscontinuitySequence.

relativeStartTimeUs: Long

See relativeStartTimeUs.

drmInitData: DrmInitData?

See drmInitData.

fullSegmentEncryptionKeyUri: String?

See fullSegmentEncryptionKeyUri.

encryptionIV: String?

See encryptionIV.

byteRangeOffset: Long

See byteRangeOffset.

byteRangeLength: Long

See byteRangeLength.

hasGapTag: Boolean

See hasGapTag.

parts: (Mutable)List<HlsMediaPlaylist.Part!>!

See parts.

Public functions

copyWith

fun copyWith(relativeStartTimeUs: Long, relativeDiscontinuitySequence: Int): HlsMediaPlaylist.Segment!

Public properties

parts

val parts: (Mutable)List<HlsMediaPlaylist.Part!>!

The parts belonging to this segment.

title

val titleString!

The human readable title of the segment.