# HlsMediaPlaylist.SegmentBase

Artifact: [androidx.media3:media3-exoplayer-hls](https://developer.android.com/jetpack/androidx/releases/media3) [View Source](https://cs.android.com/search?q=file:androidx/media3/exoplayer/hls/playlist/HlsMediaPlaylist.java+class:androidx.media3.exoplayer.hls.playlist.HlsMediaPlaylist.SegmentBase)

*** ** * ** ***


```
class HlsMediaPlaylist.SegmentBase : Comparable<Long!>
```

<br />

Known direct subclasses [HlsMediaPlaylist.Part](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/hls/playlist/HlsMediaPlaylist.Part), [HlsMediaPlaylist.Segment](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/hls/playlist/HlsMediaPlaylist.Segment)

|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/hls/playlist/HlsMediaPlaylist.Part` | A media part. |
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/hls/playlist/HlsMediaPlaylist.Segment` | Media segment reference. |

*** ** * ** ***

The base for a `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/hls/playlist/HlsMediaPlaylist.Segment` or a `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/hls/playlist/HlsMediaPlaylist.Part` required for playback.

## Summary

| ### Public functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/hls/playlist/HlsMediaPlaylist.SegmentBase#compareTo(java.lang.Long)(relativeStartTimeUs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html!)` |

| ### Public properties |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/hls/playlist/HlsMediaPlaylist.SegmentBase#byteRangeLength()` The segment's byte range length, as defined by #EXT-X-BYTERANGE, #EXT-X-PART or #EXT-X-PRELOAD-HINT, or `https://developer.android.com/reference/kotlin/androidx/media3/common/C#LENGTH_UNSET()` if no byte range is specified or the byte range is open-ended. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/hls/playlist/HlsMediaPlaylist.SegmentBase#byteRangeOffset()` The segment's byte range offset, as defined by #EXT-X-BYTERANGE, #EXT-X-PART or #EXT-X-PRELOAD-HINT. |
| `https://developer.android.com/reference/kotlin/androidx/media3/common/DrmInitData?` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/hls/playlist/HlsMediaPlaylist.SegmentBase#drmInitData()` DRM initialization data for sample decryption, or null if the segment does not use CDM-DRM protection. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/hls/playlist/HlsMediaPlaylist.SegmentBase#durationUs()` The duration of the segment in microseconds, as defined by #EXTINF or #EXT-X-PART. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/hls/playlist/HlsMediaPlaylist.SegmentBase#encryptionIV()` The encryption initialization vector as defined by #EXT-X-KEY, or null if the segment is not encrypted. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/hls/playlist/HlsMediaPlaylist.SegmentBase#fullSegmentEncryptionKeyUri()` 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. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/hls/playlist/HlsMediaPlaylist.SegmentBase#hasGapTag()` Whether the segment is marked as a gap. |
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/hls/playlist/HlsMediaPlaylist.Segment?` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/hls/playlist/HlsMediaPlaylist.SegmentBase#initializationSegment()` The media initialization section for this segment, as defined by #EXT-X-MAP. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/hls/playlist/HlsMediaPlaylist.SegmentBase#relativeDiscontinuitySequence()` The number of #EXT-X-DISCONTINUITY tags in the playlist before the segment. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/hls/playlist/HlsMediaPlaylist.SegmentBase#relativeStartTimeUs()` The start time of the segment in microseconds, relative to the start of the playlist. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/hls/playlist/HlsMediaPlaylist.SegmentBase#url()` The url of the segment. |

## Public functions

### compareTo

```
fun compareTo(relativeStartTimeUs: Long!): Int
```

## Public properties

### byteRangeLength

```
val byteRangeLength: Long
```

The segment's byte range length, as defined by #EXT-X-BYTERANGE, #EXT-X-PART or #EXT-X-PRELOAD-HINT, or `https://developer.android.com/reference/kotlin/androidx/media3/common/C#LENGTH_UNSET()` if no byte range is specified or the byte range is open-ended.

### byteRangeOffset

```
val byteRangeOffset: Long
```

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

### drmInitData

```
val drmInitData: DrmInitData?
```

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

### durationUs

```
val durationUs: Long
```

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

### encryptionIV

```
val encryptionIV: String?
```

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

### fullSegmentEncryptionKeyUri

```
val fullSegmentEncryptionKeyUri: 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.

### hasGapTag

```
val hasGapTag: Boolean
```

Whether the segment is marked as a gap.

### initializationSegment

```
val initializationSegment: HlsMediaPlaylist.Segment?
```

The media initialization section for this segment, as defined by #EXT-X-MAP. May be null if the media playlist does not define a media initialization section for this segment. The same instance is used for all segments that share an EXT-X-MAP tag.

### relativeDiscontinuitySequence

```
val relativeDiscontinuitySequence: Int
```

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

### relativeStartTimeUs

```
val relativeStartTimeUs: Long
```

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

### url

```
val url: String!
```

The url of the segment.