Class: shaka.hls.ManifestTextParser

Constructor

new ManifestTextParser()

Source:

Members

MEDIA_PLAYLIST_TAGS :Set<string>

HLS tags that only appear on Media Playlists. Used to determine a playlist type. O(1) lookup set for tag classification.
Type:
  • Set<string>
Source:

SEGMENT_TAGS :Set<string>

HLS tags that only appear on Segments in a Media Playlists. Used to determine the start of the segments info. O(1) lookup set for tag classification.
Type:
  • Set<string>
Source:

STATIC_PATTERNS :{tagBlocks: !RegExp, valueRegex: !RegExp, attributeRegex: !RegExp, header: !RegExp}

Static pre-compiled regex patterns for maximum performance. Shared across all parser instances. Pre-compiled patterns eliminate repeated regex compilation during parsing.
Type:
  • {tagBlocks: !RegExp, valueRegex: !RegExp, attributeRegex: !RegExp, header: !RegExp}
Source:

globalId_ :number

Type:
  • number
Source:

Methods

parseAttributes_(data) → {{value: ?string, list: !Array<!shaka.hls.Attribute>}}

Parses the data portion of an HLS tag into an optional leading value and a list of key=value attributes.
Parameters:
Name Type Description
data string
Source:
Returns:
Type
{value: ?string, list: !Array<!shaka.hls.Attribute>}

parseTag(id, word) → {shaka.hls.Tag}

Parses a string into an HLS Tag object.
Parameters:
Name Type Description
id number
word string
Source:
Returns:
Type
shaka.hls.Tag

splitTag_(word) → {{name: string, data: ?string}}

Splits a raw HLS tag string into its name and data portions. Validates that the tag name starts with 'EXT'.
Parameters:
Name Type Description
word string Raw tag line, e.g. '#EXT-X-MEDIA:TYPE=AUDIO'
Source:
Returns:
Type
{name: string, data: ?string}

parsePlaylist(data) → {shaka.hls.Playlist}

Parameters:
Name Type Description
data BufferSource
Source:
Returns:
Type
shaka.hls.Playlist

parseSegments_(linesnon-null, startIndex, playlistTagsnon-null) → {Array<shaka.hls.Segment>}

Parses an array of strings into an array of HLS Segment objects.
Parameters:
Name Type Description
lines Array<string>
startIndex number
playlistTags Array<!shaka.hls.Tag>
Source:
Returns:
Type
Array<shaka.hls.Segment>

parseTag_(word) → {shaka.hls.Tag}

Parses a string into an HLS Tag object while tracking what id to use next.
Parameters:
Name Type Description
word string
Source:
Returns:
Type
shaka.hls.Tag