@UnstableApi
public final class HlsPlaylistParser implements ParsingLoadable.Parser


HLS playlists parsing logic.

Summary

Nested types

Exception thrown when merging a delta update fails.

Public constructors

Creates an instance where media playlists are parsed without inheriting attributes from a multivariant playlist.

HlsPlaylistParser(
    HlsMultivariantPlaylist multivariantPlaylist,
    @Nullable HlsMediaPlaylist previousMediaPlaylist
)

Creates an instance where parsed media playlists inherit attributes from the given multivariant playlist.

Public methods

HlsPlaylist
parse(Uri uri, InputStream inputStream)

Parses an object from a response.

Public constructors

HlsPlaylistParser

public HlsPlaylistParser()

Creates an instance where media playlists are parsed without inheriting attributes from a multivariant playlist.

HlsPlaylistParser

public HlsPlaylistParser(
    HlsMultivariantPlaylist multivariantPlaylist,
    @Nullable HlsMediaPlaylist previousMediaPlaylist
)

Creates an instance where parsed media playlists inherit attributes from the given multivariant playlist.

Parameters
HlsMultivariantPlaylist multivariantPlaylist

The multivariant playlist from which media playlists will inherit attributes.

@Nullable HlsMediaPlaylist previousMediaPlaylist

The previous media playlist from which the new media playlist may inherit skipped segments.

Public methods

parse

public HlsPlaylist parse(Uri uri, InputStream inputStream)

Parses an object from a response.

Parameters
Uri uri

The source Uri of the response, after any redirection.

InputStream inputStream

An InputStream from which the response data can be read.

Returns
HlsPlaylist

The parsed object.

Throws
androidx.media3.common.ParserException

If an error occurs parsing the data.

java.io.IOException

If an error occurs reading data from the stream.