docs/doc/reference/com/google/android/exoplayer2/source/hls/playlist/HlsMediaPlaylist.SegmentBase.html
Package com.google.android.exoplayer2.source.hls.playlist
All Implemented Interfaces:Comparable<Long>Direct Known Subclasses:HlsMediaPlaylist.Part, HlsMediaPlaylist.SegmentEnclosing class:HlsMediaPlaylist
public static classHlsMediaPlaylist.SegmentBaseextends[Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")implements[Comparable](https://developer.android.com/reference/java/lang/Comparable.html "class or interface in java.lang")<[Long](https://developer.android.com/reference/java/lang/Long.html?is-external=true "class or interface in java.lang")>
The base for a HlsMediaPlaylist.Segment or a HlsMediaPlaylist.Part required for playback.
Fields | Modifier and Type | Field | Description |
| --- | --- | --- |
| long | byteRangeLength |
The segment's byte range length, as defined by #EXT-X-BYTERANGE, #EXT-X-PART or #EXT-X-PRELOAD-HINT, or C.LENGTH_UNSET if no byte range is specified or the byte range is open-ended.
|
| long | byteRangeOffset |
The segment's byte range offset, as defined by #EXT-X-BYTERANGE, #EXT-X-PART or #EXT-X-PRELOAD-HINT.
|
| DrmInitData | drmInitData |
DRM initialization data for sample decryption, or null if the segment does not use CDM-DRM protection.
|
| long | durationUs |
The duration of the segment in microseconds, as defined by #EXTINF or #EXT-X-PART.
|
| String | encryptionIV |
The encryption initialization vector as defined by #EXT-X-KEY, or null if the segment is not encrypted.
|
| String | 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.
|
| boolean | hasGapTag |
Whether the segment is marked as a gap.
|
| HlsMediaPlaylist.Segment | initializationSegment |
The media initialization section for this segment, as defined by #EXT-X-MAP.
|
| int | relativeDiscontinuitySequence |
The number of #EXT-X-DISCONTINUITY tags in the playlist before the segment.
|
| long | relativeStartTimeUs |
The start time of the segment in microseconds, relative to the start of the playlist.
|
| String | url |
The url of the segment.
|
All Methods Instance Methods Concrete Methods | Modifier and Type | Method | Description |
| --- | --- | --- |
| int | compareTo(Long relativeStartTimeUs) | |
-
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
public final[String](https://developer.android.com/reference/java/lang/String.html "class or interface in java.lang")url
The url of the segment.
-
@Nullable
public final[HlsMediaPlaylist.Segment](HlsMediaPlaylist.Segment.html "class in com.google.android.exoplayer2.source.hls.playlist")initializationSegment
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.
-
public final long durationUs
The duration of the segment in microseconds, as defined by #EXTINF or #EXT-X-PART.
-
public final int relativeDiscontinuitySequence
The number of #EXT-X-DISCONTINUITY tags in the playlist before the segment.
-
public final long relativeStartTimeUs
The start time of the segment in microseconds, relative to the start of the playlist.
-
@Nullable
public final[DrmInitData](../../../drm/DrmInitData.html "class in com.google.android.exoplayer2.drm")drmInitData
DRM initialization data for sample decryption, or null if the segment does not use CDM-DRM protection.
-
@Nullable
public final[String](https://developer.android.com/reference/java/lang/String.html "class or interface in java.lang")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.
-
@Nullable
public final[String](https://developer.android.com/reference/java/lang/String.html "class or interface in java.lang")encryptionIV
The encryption initialization vector as defined by #EXT-X-KEY, or null if the segment is not encrypted.
-
public final long byteRangeOffset
The segment's byte range offset, as defined by #EXT-X-BYTERANGE, #EXT-X-PART or #EXT-X-PRELOAD-HINT.
-
public final long byteRangeLength
The segment's byte range length, as defined by #EXT-X-BYTERANGE, #EXT-X-PART or #EXT-X-PRELOAD-HINT, or C.LENGTH_UNSET if no byte range is specified or the byte range is open-ended.
-
public final boolean hasGapTag
Whether the segment is marked as a gap.
-
public int compareTo([Long](https://developer.android.com/reference/java/lang/Long.html "class or interface in java.lang")relativeStartTimeUs)
Specified by:compareTo in interface Comparable<Long>