@UnstableApi
class HlsPlaylistParser : 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(
    multivariantPlaylist: HlsMultivariantPlaylist!,
    previousMediaPlaylist: HlsMediaPlaylist?
)

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

Public functions

HlsPlaylist!
parse(uri: Uri!, inputStream: InputStream!)

Parses an object from a response.

Public constructors

HlsPlaylistParser

HlsPlaylistParser()

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

HlsPlaylistParser

HlsPlaylistParser(
    multivariantPlaylist: HlsMultivariantPlaylist!,
    previousMediaPlaylist: HlsMediaPlaylist?
)

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

Parameters
multivariantPlaylist: HlsMultivariantPlaylist!

The multivariant playlist from which media playlists will inherit attributes.

previousMediaPlaylist: HlsMediaPlaylist?

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

Public functions

parse

fun parse(uri: Uri!, inputStream: InputStream!): HlsPlaylist!

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.