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 |
hasIndependentSegmentsTag
Whether the playlist contains the #EXT-X-INDEPENDENT-SEGMENTS tag.
|
boolean |
hasProgramDateTime
Whether the playlist contains a #EXT-X-PROGRAM-DATE-TIME tag.
|
HlsMediaPlaylist.Segment |
initializationSegment
The initialization segment, as defined by #EXT-X-MAP.
|
int |
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.
|
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
The start time of the playlist in playback timebase in microseconds.
|
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, tags
Constructor and Description |
---|
HlsMediaPlaylist(int playlistType,
String baseUri,
List<String> tags,
long startOffsetUs,
long startTimeUs,
boolean hasDiscontinuitySequence,
int discontinuitySequence,
int mediaSequence,
int version,
long targetDurationUs,
boolean hasIndependentSegmentsTag,
boolean hasEndTag,
boolean hasProgramDateTime,
HlsMediaPlaylist.Segment initializationSegment,
List<HlsMediaPlaylist.Segment> segments) |
Modifier and Type | Method and Description |
---|---|
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
public final int playlistType
HlsMediaPlaylist.PlaylistType
.public final long startOffsetUs
public final long startTimeUs
public final boolean hasDiscontinuitySequence
public final int discontinuitySequence
public final int mediaSequence
public final int version
public final long targetDurationUs
public final boolean hasIndependentSegmentsTag
public final boolean hasEndTag
public final boolean hasProgramDateTime
public final HlsMediaPlaylist.Segment initializationSegment
public final List<HlsMediaPlaylist.Segment> segments
public final long durationUs
public HlsMediaPlaylist(int playlistType, String baseUri, List<String> tags, long startOffsetUs, long startTimeUs, boolean hasDiscontinuitySequence, int discontinuitySequence, int mediaSequence, int version, long targetDurationUs, boolean hasIndependentSegmentsTag, boolean hasEndTag, boolean hasProgramDateTime, HlsMediaPlaylist.Segment initializationSegment, 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
.hasIndependentSegmentsTag
- See hasIndependentSegmentsTag
.hasEndTag
- See hasEndTag
.hasProgramDateTime
- See hasProgramDateTime
.initializationSegment
- See initializationSegment
.segments
- See segments
.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()