# HlsMediaPlaylist

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)

*** ** * ** ***


```
@UnstableApi
public final class HlsMediaPlaylist extends HlsPlaylist
```

<br />

|---|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object.html) |||
| ↳ | [androidx.media3.exoplayer.hls.playlist.HlsPlaylist](https://developer.android.com/reference/androidx/media3/exoplayer/hls/playlist/HlsPlaylist) ||
|   | ↳ | [androidx.media3.exoplayer.hls.playlist.HlsMediaPlaylist](https://developer.android.com/reference/androidx/media3/exoplayer/hls/playlist/HlsMediaPlaylist) |

*** ** * ** ***

Represents an HLS media playlist.

## Summary

| ### Nested types |
|---|
| `public class https://developer.android.com/reference/androidx/media3/exoplayer/hls/playlist/HlsMediaPlaylist.ClientDefinedAttribute` A client defined attribute. |
| `@https://developer.android.com/reference/java/lang/annotation/Retention.html(value = https://developer.android.com/reference/java/lang/annotation/RetentionPolicy.html#SOURCE) @https://developer.android.com/reference/androidx/annotation/IntDef(value = ) @https://developer.android.com/reference/java/lang/annotation/Documented.html @https://developer.android.com/reference/java/lang/annotation/Target.html(value = https://developer.android.com/reference/java/lang/annotation/ElementType.html#TYPE_USE) public annotation https://developer.android.com/reference/androidx/media3/exoplayer/hls/playlist/HlsMediaPlaylist.ClientDefinedAttribute.Type` The type of the client defined attribute. |
| `public final class https://developer.android.com/reference/androidx/media3/exoplayer/hls/playlist/HlsMediaPlaylist.Interstitial` An interstitial data range. |
| `public final class https://developer.android.com/reference/androidx/media3/exoplayer/hls/playlist/HlsMediaPlaylist.Interstitial.Builder` Builder for `https://developer.android.com/reference/androidx/media3/exoplayer/hls/playlist/HlsMediaPlaylist.Interstitial`. |
| `@https://developer.android.com/reference/java/lang/annotation/Retention.html(value = https://developer.android.com/reference/java/lang/annotation/RetentionPolicy.html#SOURCE) @https://developer.android.com/reference/androidx/annotation/StringDef(value = ) @https://developer.android.com/reference/java/lang/annotation/Documented.html @https://developer.android.com/reference/java/lang/annotation/Target.html(value = https://developer.android.com/reference/java/lang/annotation/ElementType.html#TYPE_USE) public annotation https://developer.android.com/reference/androidx/media3/exoplayer/hls/playlist/HlsMediaPlaylist.Interstitial.CueTriggerType` The cue trigger type. |
| `@https://developer.android.com/reference/java/lang/annotation/Retention.html(value = https://developer.android.com/reference/java/lang/annotation/RetentionPolicy.html#SOURCE) @https://developer.android.com/reference/androidx/annotation/StringDef(value = ) @https://developer.android.com/reference/java/lang/annotation/Documented.html @https://developer.android.com/reference/java/lang/annotation/Target.html(value = https://developer.android.com/reference/java/lang/annotation/ElementType.html#TYPE_USE) public annotation https://developer.android.com/reference/androidx/media3/exoplayer/hls/playlist/HlsMediaPlaylist.Interstitial.NavigationRestriction` The navigation restriction identifier. |
| `@https://developer.android.com/reference/java/lang/annotation/Retention.html(value = https://developer.android.com/reference/java/lang/annotation/RetentionPolicy.html#SOURCE) @https://developer.android.com/reference/androidx/annotation/StringDef(value = ) @https://developer.android.com/reference/java/lang/annotation/Documented.html @https://developer.android.com/reference/java/lang/annotation/Target.html(value = https://developer.android.com/reference/java/lang/annotation/ElementType.html#TYPE_USE) public annotation https://developer.android.com/reference/androidx/media3/exoplayer/hls/playlist/HlsMediaPlaylist.Interstitial.SnapType` The snap identifier. |
| `@https://developer.android.com/reference/java/lang/annotation/Retention.html(value = https://developer.android.com/reference/java/lang/annotation/RetentionPolicy.html#SOURCE) @https://developer.android.com/reference/androidx/annotation/StringDef(value = ) @https://developer.android.com/reference/java/lang/annotation/Documented.html @https://developer.android.com/reference/java/lang/annotation/Target.html(value = https://developer.android.com/reference/java/lang/annotation/ElementType.html#TYPE_USE) public annotation https://developer.android.com/reference/androidx/media3/exoplayer/hls/playlist/HlsMediaPlaylist.Interstitial.TimelineOccupiesType` The timeline occupies identifier. |
| `@https://developer.android.com/reference/java/lang/annotation/Retention.html(value = https://developer.android.com/reference/java/lang/annotation/RetentionPolicy.html#SOURCE) @https://developer.android.com/reference/androidx/annotation/StringDef(value = ) @https://developer.android.com/reference/java/lang/annotation/Documented.html @https://developer.android.com/reference/java/lang/annotation/Target.html(value = https://developer.android.com/reference/java/lang/annotation/ElementType.html#TYPE_USE) public annotation https://developer.android.com/reference/androidx/media3/exoplayer/hls/playlist/HlsMediaPlaylist.Interstitial.TimelineStyleType` The timeline style identifier. |
| `public final class https://developer.android.com/reference/androidx/media3/exoplayer/hls/playlist/HlsMediaPlaylist.Part extends https://developer.android.com/reference/androidx/media3/exoplayer/hls/playlist/HlsMediaPlaylist.SegmentBase` A media part. |
| `@https://developer.android.com/reference/java/lang/annotation/Documented.html @https://developer.android.com/reference/java/lang/annotation/Retention.html(value = https://developer.android.com/reference/java/lang/annotation/RetentionPolicy.html#SOURCE) @https://developer.android.com/reference/java/lang/annotation/Target.html(value = https://developer.android.com/reference/java/lang/annotation/ElementType.html#TYPE_USE) @https://developer.android.com/reference/androidx/annotation/IntDef(value = ) public annotation https://developer.android.com/reference/androidx/media3/exoplayer/hls/playlist/HlsMediaPlaylist.PlaylistType` Type of the playlist, as defined by #EXT-X-PLAYLIST-TYPE. |
| `public final class https://developer.android.com/reference/androidx/media3/exoplayer/hls/playlist/HlsMediaPlaylist.RenditionReport` A rendition report for an alternative rendition defined in another media playlist. |
| `public final class https://developer.android.com/reference/androidx/media3/exoplayer/hls/playlist/HlsMediaPlaylist.Segment extends https://developer.android.com/reference/androidx/media3/exoplayer/hls/playlist/HlsMediaPlaylist.SegmentBase` Media segment reference. |
| `public class https://developer.android.com/reference/androidx/media3/exoplayer/hls/playlist/HlsMediaPlaylist.SegmentBase implements https://developer.android.com/reference/java/lang/Comparable.html<https://developer.android.com/reference/java/lang/Long.html>` The base for a `https://developer.android.com/reference/androidx/media3/exoplayer/hls/playlist/HlsMediaPlaylist.Segment` or a `https://developer.android.com/reference/androidx/media3/exoplayer/hls/playlist/HlsMediaPlaylist.Part` required for playback. |
| `public final class https://developer.android.com/reference/androidx/media3/exoplayer/hls/playlist/HlsMediaPlaylist.ServerControl` Server control attributes. |

| ### Constants |
|---|---|
| `static final int` | `https://developer.android.com/reference/androidx/media3/exoplayer/hls/playlist/HlsMediaPlaylist#PLAYLIST_TYPE_EVENT() = 2` |
| `static final int` | `https://developer.android.com/reference/androidx/media3/exoplayer/hls/playlist/HlsMediaPlaylist#PLAYLIST_TYPE_UNKNOWN() = 0` |
| `static final int` | `https://developer.android.com/reference/androidx/media3/exoplayer/hls/playlist/HlsMediaPlaylist#PLAYLIST_TYPE_VOD() = 1` |

| ### Public fields |
|---|---|
| `final int` | `https://developer.android.com/reference/androidx/media3/exoplayer/hls/playlist/HlsMediaPlaylist#discontinuitySequence()` The discontinuity sequence number of the first media segment in the playlist, as defined by #EXT-X-DISCONTINUITY-SEQUENCE. |
| `final long` | `https://developer.android.com/reference/androidx/media3/exoplayer/hls/playlist/HlsMediaPlaylist#durationUs()` The total duration of the playlist in microseconds. |
| `final boolean` | `https://developer.android.com/reference/androidx/media3/exoplayer/hls/playlist/HlsMediaPlaylist#hasDiscontinuitySequence()` Whether the playlist contains the #EXT-X-DISCONTINUITY-SEQUENCE tag. |
| `final boolean` | `https://developer.android.com/reference/androidx/media3/exoplayer/hls/playlist/HlsMediaPlaylist#hasEndTag()` Whether the playlist contains the #EXT-X-ENDLIST tag. |
| `final boolean` | `https://developer.android.com/reference/androidx/media3/exoplayer/hls/playlist/HlsMediaPlaylist#hasPositiveStartOffset()` Whether the `https://developer.android.com/reference/androidx/media3/exoplayer/hls/playlist/HlsMediaPlaylist#startOffsetUs()` was explicitly defined by #EXT-X-START as a positive value or zero. |
| `final boolean` | `https://developer.android.com/reference/androidx/media3/exoplayer/hls/playlist/HlsMediaPlaylist#hasProgramDateTime()` Whether the playlist contains a #EXT-X-PROGRAM-DATE-TIME tag. |
| `final https://guava.dev/releases/snapshot-android/api/docs/com/google/common/collect/ImmutableList.html<https://developer.android.com/reference/androidx/media3/exoplayer/hls/playlist/HlsMediaPlaylist.Interstitial>` | `https://developer.android.com/reference/androidx/media3/exoplayer/hls/playlist/HlsMediaPlaylist#interstitials()` The interstitials declared as `#EXT-X-DATERANGE` with ` CLASS="com.apple.hls.interstitial"` |
| `final @https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/androidx/media3/exoplayer/hls/playlist/HlsMediaPlaylist.Segment` | `https://developer.android.com/reference/androidx/media3/exoplayer/hls/playlist/HlsMediaPlaylist#lastSeenInitSegment()` The last seen initialization segment defined by `#EXT-X-MAP`, or `null` if no `#EXT-X-MAP` has been declared for the corresponding stream. |
| `final long` | `https://developer.android.com/reference/androidx/media3/exoplayer/hls/playlist/HlsMediaPlaylist#mediaSequence()` The media sequence number of the first media segment in the playlist, as defined by #EXT-X-MEDIA-SEQUENCE. |
| `final long` | `https://developer.android.com/reference/androidx/media3/exoplayer/hls/playlist/HlsMediaPlaylist#partTargetDurationUs()` The target duration for segment parts, as defined by #EXT-X-PART-INF, or `https://developer.android.com/reference/androidx/media3/common/C#TIME_UNSET()` if undefined. |
| `final int` | `@https://developer.android.com/reference/androidx/media3/exoplayer/hls/playlist/HlsMediaPlaylist.PlaylistType https://developer.android.com/reference/androidx/media3/exoplayer/hls/playlist/HlsMediaPlaylist#playlistType()` The type of the playlist. |
| `final boolean` | `https://developer.android.com/reference/androidx/media3/exoplayer/hls/playlist/HlsMediaPlaylist#preciseStart()` Whether the start position should be precise, as defined by #EXT-X-START. |
| `final @https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/androidx/media3/common/DrmInitData` | `https://developer.android.com/reference/androidx/media3/exoplayer/hls/playlist/HlsMediaPlaylist#protectionSchemes()` Contains the CDM protection schemes used by segments in this playlist. |
| `final https://developer.android.com/reference/java/util/Map.html<https://developer.android.com/reference/android/net/Uri.html, https://developer.android.com/reference/androidx/media3/exoplayer/hls/playlist/HlsMediaPlaylist.RenditionReport>` | `https://developer.android.com/reference/androidx/media3/exoplayer/hls/playlist/HlsMediaPlaylist#renditionReports()` The rendition reports of alternative rendition playlists. |
| `final https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/androidx/media3/exoplayer/hls/playlist/HlsMediaPlaylist.Segment>` | `https://developer.android.com/reference/androidx/media3/exoplayer/hls/playlist/HlsMediaPlaylist#segments()` The list of segments in the playlist. |
| `final https://developer.android.com/reference/androidx/media3/exoplayer/hls/playlist/HlsMediaPlaylist.ServerControl` | `https://developer.android.com/reference/androidx/media3/exoplayer/hls/playlist/HlsMediaPlaylist#serverControl()` The attributes of the #EXT-X-SERVER-CONTROL header. |
| `final long` | `https://developer.android.com/reference/androidx/media3/exoplayer/hls/playlist/HlsMediaPlaylist#startOffsetUs()` The start offset in microseconds from the beginning of the playlist, as defined by #EXT-X-START, or `https://developer.android.com/reference/androidx/media3/common/C#TIME_UNSET()` if undefined. |
| `final long` | `https://developer.android.com/reference/androidx/media3/exoplayer/hls/playlist/HlsMediaPlaylist#startTimeUs()` If `https://developer.android.com/reference/androidx/media3/exoplayer/hls/playlist/HlsMediaPlaylist#hasProgramDateTime()` is true, contains the datetime as microseconds since epoch. |
| `final long` | `https://developer.android.com/reference/androidx/media3/exoplayer/hls/playlist/HlsMediaPlaylist#targetDurationUs()` The target duration in microseconds, as defined by #EXT-X-TARGETDURATION. |
| `final https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/androidx/media3/exoplayer/hls/playlist/HlsMediaPlaylist.Part>` | `https://developer.android.com/reference/androidx/media3/exoplayer/hls/playlist/HlsMediaPlaylist#trailingParts()` The list of parts at the end of the playlist for which the segment is not in the playlist yet. |
| `final int` | `https://developer.android.com/reference/androidx/media3/exoplayer/hls/playlist/HlsMediaPlaylist#version()` The compatibility version, as defined by #EXT-X-VERSION. |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/media3/exoplayer/hls/playlist/HlsMediaPlaylist#HlsMediaPlaylist(int,java.lang.String,java.util.List<java.lang.String>,long,boolean,long,boolean,int,long,int,long,long,boolean,boolean,boolean,androidx.media3.common.DrmInitData,java.util.List<androidx.media3.exoplayer.hls.playlist.HlsMediaPlaylist.Segment>,java.util.List<androidx.media3.exoplayer.hls.playlist.HlsMediaPlaylist.Part>,androidx.media3.exoplayer.hls.playlist.HlsMediaPlaylist.ServerControl,java.util.Map<android.net.Uri,androidx.media3.exoplayer.hls.playlist.HlsMediaPlaylist.RenditionReport>,java.util.List<androidx.media3.exoplayer.hls.playlist.HlsMediaPlaylist.Interstitial>,androidx.media3.exoplayer.hls.playlist.HlsMediaPlaylist.Segment)( @https://developer.android.com/reference/androidx/media3/exoplayer/hls/playlist/HlsMediaPlaylist.PlaylistType int playlistType, https://developer.android.com/reference/java/lang/String.html baseUri, https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/java/lang/String.html> tags, long startOffsetUs, boolean preciseStart, long startTimeUs, boolean hasDiscontinuitySequence, int discontinuitySequence, long mediaSequence, int version, long targetDurationUs, long partTargetDurationUs, boolean hasIndependentSegments, boolean hasEndTag, boolean hasProgramDateTime, @https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/androidx/media3/common/DrmInitData protectionSchemes, https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/androidx/media3/exoplayer/hls/playlist/HlsMediaPlaylist.Segment> segments, https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/androidx/media3/exoplayer/hls/playlist/HlsMediaPlaylist.Part> trailingParts, https://developer.android.com/reference/androidx/media3/exoplayer/hls/playlist/HlsMediaPlaylist.ServerControl serverControl, https://developer.android.com/reference/java/util/Map.html<https://developer.android.com/reference/android/net/Uri.html, https://developer.android.com/reference/androidx/media3/exoplayer/hls/playlist/HlsMediaPlaylist.RenditionReport> renditionReports, https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/androidx/media3/exoplayer/hls/playlist/HlsMediaPlaylist.Interstitial> interstitials, @https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/androidx/media3/exoplayer/hls/playlist/HlsMediaPlaylist.Segment lastSeenInitSegment )` Constructs an instance. |

| ### Public methods |
|---|---|
| `https://developer.android.com/reference/androidx/media3/exoplayer/hls/playlist/HlsMediaPlaylist` | `https://developer.android.com/reference/androidx/media3/exoplayer/hls/playlist/HlsMediaPlaylist#copy(java.util.List<androidx.media3.common.StreamKey>)(https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/androidx/media3/common/StreamKey> streamKeys)` Returns a copy of the manifest including only the streams specified by the given keys. |
| `https://developer.android.com/reference/androidx/media3/exoplayer/hls/playlist/HlsMediaPlaylist` | `https://developer.android.com/reference/androidx/media3/exoplayer/hls/playlist/HlsMediaPlaylist#copyWith(long,int)(long startTimeUs, int discontinuitySequence)` Returns a playlist identical to this one except for the start time, the discontinuity sequence and `hasDiscontinuitySequence` values. |
| `https://developer.android.com/reference/androidx/media3/exoplayer/hls/playlist/HlsMediaPlaylist` | `https://developer.android.com/reference/androidx/media3/exoplayer/hls/playlist/HlsMediaPlaylist#copyWithEndTag()()` Returns a playlist identical to this one except that an end tag is added. |
| `long` | `https://developer.android.com/reference/androidx/media3/exoplayer/hls/playlist/HlsMediaPlaylist#getEndTimeUs()()` Returns the result of adding the duration of the playlist to its start time. |
| `boolean` | `https://developer.android.com/reference/androidx/media3/exoplayer/hls/playlist/HlsMediaPlaylist#isNewerThan(androidx.media3.exoplayer.hls.playlist.HlsMediaPlaylist)(@https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/androidx/media3/exoplayer/hls/playlist/HlsMediaPlaylist other)` Returns whether this playlist is newer than `other`. |

### Inherited fields

From [androidx.media3.exoplayer.hls.playlist.HlsPlaylist](https://developer.android.com/reference/androidx/media3/exoplayer/hls/playlist/HlsPlaylist) `final https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/androidx/media3/exoplayer/hls/playlist/HlsPlaylist#baseUri()`

The base uri.
`final boolean` `https://developer.android.com/reference/androidx/media3/exoplayer/hls/playlist/HlsPlaylist#hasIndependentSegments()`

Whether the media is formed of independent segments, as defined by the #EXT-X-INDEPENDENT-SEGMENTS tag.
`final https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/java/lang/String.html>` `https://developer.android.com/reference/androidx/media3/exoplayer/hls/playlist/HlsPlaylist#tags()`

The list of tags in the playlist.

## Constants

### PLAYLIST_TYPE_EVENT

```
public static final int PLAYLIST_TYPE_EVENT = 2
```

### PLAYLIST_TYPE_UNKNOWN

```
public static final int PLAYLIST_TYPE_UNKNOWN = 0
```

### PLAYLIST_TYPE_VOD

```
public static final int PLAYLIST_TYPE_VOD = 1
```

## Public fields

### discontinuitySequence

```
public final int discontinuitySequence
```

The discontinuity sequence number of the first media segment in the playlist, as defined by #EXT-X-DISCONTINUITY-SEQUENCE.

### durationUs

```
public final long durationUs
```

The total duration of the playlist in microseconds.

### hasDiscontinuitySequence

```
public final boolean hasDiscontinuitySequence
```

Whether the playlist contains the #EXT-X-DISCONTINUITY-SEQUENCE tag.

### hasEndTag

```
public final boolean hasEndTag
```

Whether the playlist contains the #EXT-X-ENDLIST tag.

### hasPositiveStartOffset

```
public final boolean hasPositiveStartOffset
```

Whether the `https://developer.android.com/reference/androidx/media3/exoplayer/hls/playlist/HlsMediaPlaylist#startOffsetUs()` was explicitly defined by #EXT-X-START as a positive value or zero.

### hasProgramDateTime

```
public final boolean hasProgramDateTime
```

Whether the playlist contains a #EXT-X-PROGRAM-DATE-TIME tag.

### interstitials

```
public final ImmutableList<HlsMediaPlaylist.Interstitial> interstitials
```

The interstitials declared as `#EXT-X-DATERANGE` with `
CLASS="com.apple.hls.interstitial"`

### lastSeenInitSegment

```
public final @Nullable HlsMediaPlaylist.Segment lastSeenInitSegment
```

The last seen initialization segment defined by `#EXT-X-MAP`, or `null` if no `#EXT-X-MAP` has been declared for the corresponding stream.

### mediaSequence

```
public final long mediaSequence
```

The media sequence number of the first media segment in the playlist, as defined by #EXT-X-MEDIA-SEQUENCE.

### partTargetDurationUs

```
public final long partTargetDurationUs
```

The target duration for segment parts, as defined by #EXT-X-PART-INF, or `https://developer.android.com/reference/androidx/media3/common/C#TIME_UNSET()` if undefined.

### playlistType

```
@HlsMediaPlaylist.PlaylistType
public final int playlistType
```

The type of the playlist. See `https://developer.android.com/reference/androidx/media3/exoplayer/hls/playlist/HlsMediaPlaylist.PlaylistType`.

### preciseStart

```
public final boolean preciseStart
```

Whether the start position should be precise, as defined by #EXT-X-START.

### protectionSchemes

```
public final @Nullable DrmInitData protectionSchemes
```

Contains the CDM protection schemes used by segments in this playlist. Does not contain any key acquisition data. Null if none of the segments in the playlist is CDM-encrypted.

### renditionReports

```
public final Map<Uri, HlsMediaPlaylist.RenditionReport> renditionReports
```

The rendition reports of alternative rendition playlists.

### segments

```
public final List<HlsMediaPlaylist.Segment> segments
```

The list of segments in the playlist.

### serverControl

```
public final HlsMediaPlaylist.ServerControl serverControl
```

The attributes of the #EXT-X-SERVER-CONTROL header.

### startOffsetUs

```
public final long startOffsetUs
```

The start offset in microseconds from the beginning of the playlist, as defined by #EXT-X-START, or `https://developer.android.com/reference/androidx/media3/common/C#TIME_UNSET()` if undefined. The value is guaranteed to be between 0 and `https://developer.android.com/reference/androidx/media3/exoplayer/hls/playlist/HlsMediaPlaylist#durationUs()`, inclusive.

### startTimeUs

```
public final long startTimeUs
```

If `https://developer.android.com/reference/androidx/media3/exoplayer/hls/playlist/HlsMediaPlaylist#hasProgramDateTime()` is true, contains the datetime as microseconds since epoch. Otherwise, contains the aggregated duration of removed segments up to this snapshot of the playlist.

### targetDurationUs

```
public final long targetDurationUs
```

The target duration in microseconds, as defined by #EXT-X-TARGETDURATION.

### trailingParts

```
public final List<HlsMediaPlaylist.Part> trailingParts
```

The list of parts at the end of the playlist for which the segment is not in the playlist yet.

### version

```
public final int version
```

The compatibility version, as defined by #EXT-X-VERSION.

## Public constructors

### HlsMediaPlaylist

```
public HlsMediaPlaylist(
    @HlsMediaPlaylist.PlaylistType int playlistType,
    String baseUri,
    List<String> tags,
    long startOffsetUs,
    boolean preciseStart,
    long startTimeUs,
    boolean hasDiscontinuitySequence,
    int discontinuitySequence,
    long mediaSequence,
    int version,
    long targetDurationUs,
    long partTargetDurationUs,
    boolean hasIndependentSegments,
    boolean hasEndTag,
    boolean hasProgramDateTime,
    @Nullable DrmInitData protectionSchemes,
    List<HlsMediaPlaylist.Segment> segments,
    List<HlsMediaPlaylist.Part> trailingParts,
    HlsMediaPlaylist.ServerControl serverControl,
    Map<Uri, HlsMediaPlaylist.RenditionReport> renditionReports,
    List<HlsMediaPlaylist.Interstitial> interstitials,
    @Nullable HlsMediaPlaylist.Segment lastSeenInitSegment
)
```

Constructs an instance.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/media3/exoplayer/hls/playlist/HlsMediaPlaylist.PlaylistType int playlistType` | See `https://developer.android.com/reference/androidx/media3/exoplayer/hls/playlist/HlsMediaPlaylist#playlistType()`. |
| `https://developer.android.com/reference/java/lang/String.html baseUri` | See `https://developer.android.com/reference/androidx/media3/exoplayer/hls/playlist/HlsPlaylist#baseUri()`. |
| `https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/java/lang/String.html> tags` | See `https://developer.android.com/reference/androidx/media3/exoplayer/hls/playlist/HlsPlaylist#tags()`. |
| `long startOffsetUs` | See `https://developer.android.com/reference/androidx/media3/exoplayer/hls/playlist/HlsMediaPlaylist#startOffsetUs()`. |
| `boolean preciseStart` | See `https://developer.android.com/reference/androidx/media3/exoplayer/hls/playlist/HlsMediaPlaylist#preciseStart()`. |
| `long startTimeUs` | See `https://developer.android.com/reference/androidx/media3/exoplayer/hls/playlist/HlsMediaPlaylist#startTimeUs()`. |
| `boolean hasDiscontinuitySequence` | See `https://developer.android.com/reference/androidx/media3/exoplayer/hls/playlist/HlsMediaPlaylist#hasDiscontinuitySequence()`. |
| `int discontinuitySequence` | See `https://developer.android.com/reference/androidx/media3/exoplayer/hls/playlist/HlsMediaPlaylist#discontinuitySequence()`. |
| `long mediaSequence` | See `https://developer.android.com/reference/androidx/media3/exoplayer/hls/playlist/HlsMediaPlaylist#mediaSequence()`. |
| `int version` | See `https://developer.android.com/reference/androidx/media3/exoplayer/hls/playlist/HlsMediaPlaylist#version()`. |
| `long targetDurationUs` | See `https://developer.android.com/reference/androidx/media3/exoplayer/hls/playlist/HlsMediaPlaylist#targetDurationUs()`. |
| `long partTargetDurationUs` | See `https://developer.android.com/reference/androidx/media3/exoplayer/hls/playlist/HlsMediaPlaylist#partTargetDurationUs()`. |
| `boolean hasIndependentSegments` | See `https://developer.android.com/reference/androidx/media3/exoplayer/hls/playlist/HlsPlaylist#hasIndependentSegments()`. |
| `boolean hasEndTag` | See `https://developer.android.com/reference/androidx/media3/exoplayer/hls/playlist/HlsMediaPlaylist#hasEndTag()`. |
| `boolean hasProgramDateTime` | See `https://developer.android.com/reference/androidx/media3/exoplayer/hls/playlist/HlsMediaPlaylist#hasProgramDateTime()`. |
| `@https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/androidx/media3/common/DrmInitData protectionSchemes` | See `https://developer.android.com/reference/androidx/media3/exoplayer/hls/playlist/HlsMediaPlaylist#protectionSchemes()`. |
| `https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/androidx/media3/exoplayer/hls/playlist/HlsMediaPlaylist.Segment> segments` | See `https://developer.android.com/reference/androidx/media3/exoplayer/hls/playlist/HlsMediaPlaylist#segments()`. |
| `https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/androidx/media3/exoplayer/hls/playlist/HlsMediaPlaylist.Part> trailingParts` | See `https://developer.android.com/reference/androidx/media3/exoplayer/hls/playlist/HlsMediaPlaylist#trailingParts()`. |
| `https://developer.android.com/reference/androidx/media3/exoplayer/hls/playlist/HlsMediaPlaylist.ServerControl serverControl` | See `https://developer.android.com/reference/androidx/media3/exoplayer/hls/playlist/HlsMediaPlaylist#serverControl()` |
| `https://developer.android.com/reference/java/util/Map.html<https://developer.android.com/reference/android/net/Uri.html, https://developer.android.com/reference/androidx/media3/exoplayer/hls/playlist/HlsMediaPlaylist.RenditionReport> renditionReports` | See `https://developer.android.com/reference/androidx/media3/exoplayer/hls/playlist/HlsMediaPlaylist#renditionReports()`. |
| `https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/androidx/media3/exoplayer/hls/playlist/HlsMediaPlaylist.Interstitial> interstitials` | See `https://developer.android.com/reference/androidx/media3/exoplayer/hls/playlist/HlsMediaPlaylist#interstitials()`. |
| `@https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/androidx/media3/exoplayer/hls/playlist/HlsMediaPlaylist.Segment lastSeenInitSegment` | See `https://developer.android.com/reference/androidx/media3/exoplayer/hls/playlist/HlsMediaPlaylist#lastSeenInitSegment()`. |

## Public methods

### copy

```
public HlsMediaPlaylist copy(List<StreamKey> streamKeys)
```

Returns a copy of the manifest including only the streams specified by the given keys. If the manifest is unchanged then the instance may return itself.

| Parameters |
|---|---|
| `https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/androidx/media3/common/StreamKey> streamKeys` | A non-empty list of stream keys. |

| Returns |
|---|---|
| `https://developer.android.com/reference/androidx/media3/exoplayer/hls/playlist/HlsMediaPlaylist` | The filtered manifest. |

### copyWith

```
public HlsMediaPlaylist copyWith(long startTimeUs, int discontinuitySequence)
```

Returns a playlist identical to this one except for the start time, the discontinuity sequence and `hasDiscontinuitySequence` values. The first two are set to the specified values, `hasDiscontinuitySequence` is set to true.

| Parameters |
|---|---|
| `long startTimeUs` | The start time for the returned playlist. |
| `int discontinuitySequence` | The discontinuity sequence for the returned playlist. |

| Returns |
|---|---|
| `https://developer.android.com/reference/androidx/media3/exoplayer/hls/playlist/HlsMediaPlaylist` | An identical playlist including the provided discontinuity and timing information. |

### copyWithEndTag

```
public HlsMediaPlaylist copyWithEndTag()
```

Returns a playlist identical to this one except that an end tag is added. If an end tag is already present then the playlist will return itself.

### getEndTimeUs

```
public long getEndTimeUs()
```

Returns the result of adding the duration of the playlist to its start time.

### isNewerThan

```
public boolean isNewerThan(@Nullable HlsMediaPlaylist other)
```

Returns whether this playlist is newer than `other`.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/androidx/media3/exoplayer/hls/playlist/HlsMediaPlaylist other` | The playlist to compare. |

| Returns |
|---|---|
| `boolean` | Whether this playlist is newer than `other`. |