Class: shaka.util.ManifestParserUtils

Utility functions for manifest parsing.

Constructor

new ManifestParserUtils()

Utility functions for manifest parsing.

Source:

Members

AUDIO_CODEC_REGEXPS :Array<!RegExp>

A list of regexps to detect well-known audio codecs.
Type:
  • Array<!RegExp>
Source:

CODEC_REGEXPS_BY_CONTENT_TYPE_ :Map<string, !Array<!RegExp>>

Type:
  • Map<string, !Array<!RegExp>>
Source:

ContentType :string

Type:
  • string
Properties:
Name Value Type Description
VIDEO video string
AUDIO audio string
TEXT text string
IMAGE image string
APPLICATION application string
CHAPTER chapter string
Source:

GAP_OVERLAP_TOLERANCE_SECONDS :number

Specifies how tolerant the player is of inaccurate segment start times and end times within a manifest. For example, gaps or overlaps between segments in a SegmentTimeline which are greater than or equal to this value will result in a warning message.
Type:
  • number
Source:

TEXT_CODEC_REGEXPS :Array<!RegExp>

A list of regexps to detect well-known text codecs.
Type:
  • Array<!RegExp>
Source:

TextStreamKind :string

Type:
  • string
Properties:
Name Value Type Description
SUBTITLE subtitle string
CLOSED_CAPTION caption string
Source:

VIDEO_CODEC_REGEXPS :Array<!RegExp>

A list of regexps to detect well-known video codecs.
Type:
  • Array<!RegExp>
Source:

Methods

createDrmInfo(keySystem, encryptionScheme, initData, keySystemUriopt, mediaTypesopt, non-null) → {shaka.extern.DrmInfo}

Creates a DrmInfo object from the given info.
Parameters:
Name Type Attributes Description
keySystem string
encryptionScheme string
initData Array<shaka.extern.InitDataOverride>
keySystemUri string <optional>
mediaTypes Array<string> <optional>
Source:
Returns:
Type
shaka.extern.DrmInfo

createDrmInfoFromClearKeys(clearKeysnon-null, encryptionSchemeopt) → {shaka.extern.DrmInfo}

Creates a DrmInfo object from ClearKeys.
Parameters:
Name Type Attributes Default Description
clearKeys Map<string, string>
encryptionScheme string <optional>
cenc
Source:
Returns:
Type
shaka.extern.DrmInfo

guessAllCodecsSafe(contentType, codecsnon-null) → {Array<string>}

Attempts to guess which codecs from the codecs list belong to a given content.
Parameters:
Name Type Description
contentType string
codecs Array<string>
Source:
Returns:
Type
Array<string>

guessCodecs(contentType, codecsnon-null) → {string}

Attempts to guess which codecs from the codecs list belong to a given content type. Assumes that at least one codec is correct, and throws if none are.
Parameters:
Name Type Description
contentType string
codecs Array<string>
Source:
Returns:
Type
string

guessCodecsSafe(contentType, codecsnon-null) → {string}

Attempts to guess which codecs from the codecs list belong to a given content type. Does not assume a single codec is anything special, and does not throw if it fails to match.
Parameters:
Name Type Description
contentType string
codecs Array<string>
Source:
Returns:
or null if no match is found
Type
string

parseCEA608Captions(valuenullable, closedCaptionsnon-null)

Parses a CEA-608 accessibility value string and populates the provided closedCaptions map with the channel-to-language assignments found in it. The value string follows the format defined in "urn:scte:dash:cc:cea-608:2015", which is shared by both DASH and MSF. Examples: "CC1=eng;CC3=spa" – explicit channel ids with ISO 639-2 language codes "eng;spa" – implicit channel ids (CC1 / CC3 for 2 entries, CC1 / CC2 / … otherwise) null / undefined – defaults to { CC1: 'und' } The map is mutated in place so the caller can accumulate entries from multiple accessibility descriptors before passing it to the stream object.
Parameters:
Name Type Attributes Description
value string <nullable>
The raw value attribute / field, or null.
closedCaptions Map<string, string> Map to populate.
Source:

parseCEA708Captions(valuenullable, closedCaptionsnon-null)

Parses a CEA-708 accessibility value string and populates the provided closedCaptions map with the service-to-language assignments found in it. The value string follows the format defined in "urn:scte:dash:cc:cea-708:2015", which is shared by both DASH and MSF. Examples: "1=lang:eng;2=lang:deu" – explicit service numbers with language "1=lang:eng,war:1;2=lang:deu" – extra parameters after the language are silently ignored "eng;deu;swe" – implicit service numbers (svc1, svc2 …) null / undefined – defaults to { svc1: 'und' } The map is mutated in place so the caller can accumulate entries from multiple accessibility descriptors before passing it to the stream object.
Parameters:
Name Type Attributes Description
value string <nullable>
The raw value attribute / field, or null.
closedCaptions Map<string, string> Map to populate.
Source:

resolveUris(baseUrisnon-null, relativeUrisnon-null, extraQueryParamsopt) → {Array<string>}

Resolves an array of relative URIs to the given base URIs. This will result in M*N number of URIs. Note: This method is slow in SmartTVs and Consoles. It should only be called when necessary.
Parameters:
Name Type Attributes Description
baseUris Array<string>
relativeUris Array<string>
extraQueryParams string <optional>
Source:
Returns:
Type
Array<string>