public final class HlsMediaPlaylist extends HlsPlaylist
Modifier and Type | Class and Description |
---|---|
static interface |
HlsMediaPlaylist.PlaylistType
Type of the playlist, as defined by #EXT-X-PLAYLIST-TYPE.
|
static class |
HlsMediaPlaylist.Segment
Media segment reference.
|
Modifier and Type | Field and Description |
---|---|
int |
discontinuitySequence
The discontinuity sequence number of the first media segment in the playlist, as defined by
#EXT-X-DISCONTINUITY-SEQUENCE.
|
long |
durationUs
The total duration of the playlist in microseconds.
|
boolean |
hasDiscontinuitySequence
Whether the playlist contains the #EXT-X-DISCONTINUITY-SEQUENCE tag.
|
boolean |
hasEndTag
Whether the playlist contains the #EXT-X-ENDLIST tag.
|
boolean |
hasProgramDateTime
Whether the playlist contains a #EXT-X-PROGRAM-DATE-TIME tag.
|
long |
mediaSequence
The media sequence number of the first media segment in the playlist, as defined by
#EXT-X-MEDIA-SEQUENCE.
|
static int |
PLAYLIST_TYPE_EVENT |
static int |
PLAYLIST_TYPE_UNKNOWN |
static int |
PLAYLIST_TYPE_VOD |
int |
playlistType
The type of the playlist.
|
DrmInitData |
protectionSchemes
Contains the CDM protection schemes used by segments in this playlist.
|
List<HlsMediaPlaylist.Segment> |
segments
The list of segments in the playlist.
|
long |
startOffsetUs
The start offset in microseconds, as defined by #EXT-X-START.
|
long |
startTimeUs
If
hasProgramDateTime is true, contains the datetime as microseconds since epoch. |
long |
targetDurationUs
The target duration in microseconds, as defined by #EXT-X-TARGETDURATION.
|
int |
version
The compatibility version, as defined by #EXT-X-VERSION.
|
baseUri, hasIndependentSegments, tags
Constructor and Description |
---|
HlsMediaPlaylist(int playlistType,
String baseUri,
List<String> tags,
long startOffsetUs,
long startTimeUs,
boolean hasDiscontinuitySequence,
int discontinuitySequence,
long mediaSequence,
int version,
long targetDurationUs,
boolean hasIndependentSegments,
boolean hasEndTag,
boolean hasProgramDateTime,
DrmInitData protectionSchemes,
List<HlsMediaPlaylist.Segment> segments) |
Modifier and Type | Method and Description |
---|---|
HlsMediaPlaylist |
copy(List<StreamKey> streamKeys)
Returns a copy of the manifest including only the streams specified by the given keys.
|
HlsMediaPlaylist |
copyWith(long startTimeUs,
int discontinuitySequence)
Returns a playlist identical to this one except for the start time, the discontinuity sequence
and
hasDiscontinuitySequence values. |
HlsMediaPlaylist |
copyWithEndTag()
Returns a playlist identical to this one except that an end tag is added.
|
long |
getEndTimeUs()
Returns the result of adding the duration of the playlist to its start time.
|
boolean |
isNewerThan(HlsMediaPlaylist other)
Returns whether this playlist is newer than
other . |
public static final int PLAYLIST_TYPE_UNKNOWN
public static final int PLAYLIST_TYPE_VOD
public static final int PLAYLIST_TYPE_EVENT
@HlsMediaPlaylist.PlaylistType public final int playlistType
HlsMediaPlaylist.PlaylistType
.public final long startOffsetUs
public final long startTimeUs
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.public final boolean hasDiscontinuitySequence
public final int discontinuitySequence
public final long mediaSequence
public final int version
public final long targetDurationUs
public final boolean hasEndTag
public final boolean hasProgramDateTime
@Nullable public final DrmInitData protectionSchemes
public final List<HlsMediaPlaylist.Segment> segments
public final long durationUs
public HlsMediaPlaylist(@HlsMediaPlaylist.PlaylistType int playlistType, String baseUri, List<String> tags, long startOffsetUs, long startTimeUs, boolean hasDiscontinuitySequence, int discontinuitySequence, long mediaSequence, int version, long targetDurationUs, boolean hasIndependentSegments, boolean hasEndTag, boolean hasProgramDateTime, @Nullable DrmInitData protectionSchemes, List<HlsMediaPlaylist.Segment> segments)
playlistType
- See playlistType
.baseUri
- See HlsPlaylist.baseUri
.tags
- See HlsPlaylist.tags
.startOffsetUs
- See startOffsetUs
.startTimeUs
- See startTimeUs
.hasDiscontinuitySequence
- See hasDiscontinuitySequence
.discontinuitySequence
- See discontinuitySequence
.mediaSequence
- See mediaSequence
.version
- See version
.targetDurationUs
- See targetDurationUs
.hasIndependentSegments
- See HlsPlaylist.hasIndependentSegments
.hasEndTag
- See hasEndTag
.protectionSchemes
- See protectionSchemes
.hasProgramDateTime
- See hasProgramDateTime
.segments
- See segments
.public HlsMediaPlaylist copy(List<StreamKey> streamKeys)
FilterableManifest
streamKeys
- A non-empty list of stream keys.public boolean isNewerThan(HlsMediaPlaylist other)
other
.other
- The playlist to compare.other
.public long getEndTimeUs()
public HlsMediaPlaylist copyWith(long startTimeUs, int discontinuitySequence)
hasDiscontinuitySequence
values. The first two are set to the specified values,
hasDiscontinuitySequence
is set to true.startTimeUs
- The start time for the returned playlist.discontinuitySequence
- The discontinuity sequence for the returned playlist.public HlsMediaPlaylist copyWithEndTag()