Class HlsMediaPlaylist

    • Field Detail

      • startOffsetUs

        public final long startOffsetUs
        The start offset in microseconds from the beginning of the playlist, as defined by #EXT-X-START, or C.TIME_UNSET if undefined. The value is guaranteed to be between 0 and durationUs, inclusive.
      • hasPositiveStartOffset

        public final boolean hasPositiveStartOffset
        Whether the startOffsetUs was explicitly defined by #EXT-X-START as a positive value or zero.
      • preciseStart

        public final boolean preciseStart
        Whether the start position should be precise, as defined by #EXT-X-START.
      • startTimeUs

        public final long startTimeUs
        If 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.
      • hasDiscontinuitySequence

        public final boolean hasDiscontinuitySequence
        Whether the playlist contains the #EXT-X-DISCONTINUITY-SEQUENCE tag.
      • discontinuitySequence

        public final int discontinuitySequence
        The discontinuity sequence number of the first media segment in the playlist, as defined by #EXT-X-DISCONTINUITY-SEQUENCE.
      • mediaSequence

        public final long mediaSequence
        The media sequence number of the first media segment in the playlist, as defined by #EXT-X-MEDIA-SEQUENCE.
      • version

        public final int version
        The compatibility version, as defined by #EXT-X-VERSION.
      • targetDurationUs

        public final long targetDurationUs
        The target duration in microseconds, as defined by #EXT-X-TARGETDURATION.
      • partTargetDurationUs

        public final long partTargetDurationUs
        The target duration for segment parts, as defined by #EXT-X-PART-INF, or C.TIME_UNSET if undefined.
      • hasEndTag

        public final boolean hasEndTag
        Whether the playlist contains the #EXT-X-ENDLIST tag.
      • hasProgramDateTime

        public final boolean hasProgramDateTime
        Whether the playlist contains a #EXT-X-PROGRAM-DATE-TIME tag.
      • protectionSchemes

        public final 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.
      • 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.
      • durationUs

        public final long durationUs
        The total duration of the playlist in microseconds.
    • Method Detail

      • copy

        public HlsMediaPlaylist copy​(List<StreamKey> streamKeys)
        Description copied from interface: FilterableManifest
        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.
        streamKeys - A non-empty list of stream keys.
        The filtered manifest.
      • isNewerThan

        public boolean isNewerThan​(@Nullable
                                   HlsMediaPlaylist other)
        Returns whether this playlist is newer than other.
        other - The playlist to compare.
        Whether this playlist is newer than other.
      • getEndTimeUs

        public long getEndTimeUs()
        Returns the result of adding the duration of the playlist to its start time.
      • 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.
        startTimeUs - The start time for the returned playlist.
        discontinuitySequence - The discontinuity sequence for the returned playlist.
        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.