PlaylistParser

Logic for parsing HLS manifest files and handling URL resolution for segments.

Constructor

new PlaylistParser()

Author
  • Nur Rony<pro.nmrony@gmail.com>

Members

HLS_PLAYLIST_EXT

HLS Playlist file extension

Methods

isPlaylist(url)

Checks if a given URL points to an HLS playlist based on its extension.

Parameters:
NameTypeDescription
url

The URL to check.

Returns:

True if the URL ends with the HLS playlist extension.

parse(baseUrl, content)

Extracts absolute URLs from HLS playlist content.

Parameters:
NameTypeDescription
baseUrl

The base URL used to resolve relative paths found in the playlist.

content

The raw string content of the HLS manifest.

Returns:

An array of absolute URLs extracted from the manifest.