Class: shaka.dash.ServiceDescriptionParser
Parses MPD-level ServiceDescription elements (ISO/IEC 23009-1:2026
Annex K) into a shaka.extern.ServiceDescription.
Selection rules:
1. Descriptions are visited in document order.
2. A description that carries Scope children is ignored unless one of
them names a scheme this player recognizes, per K.4.2.1: clients
that recognize none of the scope descriptors must ignore the
description. The DVB DASH low-latency scope is recognized; the
event-activation scope (K.6) is not, which keeps event-activated
descriptions from being applied at load time.
3. Latency and PlaybackRate come from the first remaining description
that has them.
4. ClientDataReporting comes from the first remaining description that
has one with a supported scheme.
Constructor
new ServiceDescriptionParser()
Parses MPD-level ServiceDescription elements (ISO/IEC 23009-1:2026
Annex K) into a shaka.extern.ServiceDescription.
Selection rules:
1. Descriptions are visited in document order.
2. A description that carries Scope children is ignored unless one of
them names a scheme this player recognizes, per K.4.2.1: clients
that recognize none of the scope descriptors must ignore the
description. The DVB DASH low-latency scope is recognized; the
event-activation scope (K.6) is not, which keeps event-activated
descriptions from being applied at load time.
3. Latency and PlaybackRate come from the first remaining description
that has them.
4. ClientDataReporting comes from the first remaining description that
has one with a supported scheme.
- Source:
Members
CMCD_SCHEME_ :string
The descriptor scheme that identifies CMCD client data reporting
(ISO/IEC 23009-1:2026 K.4.2.7.2). dash.js also accepts a DASH-IF alias,
urn:dashif:cta-5004:2025, which has no registry entry; it is deliberately
not accepted here.
Type:
- Source:
MAX_CMCD_VERSION_ :number
Highest CMCD version this player can emit.
Type:
- Source:
RECOGNIZED_SCOPES_ :Array<string>
Scope schemes this player recognizes (ISO/IEC 23009-1:2026 Table K.10).
DVB-DASH low-latency MPDs (ETSI TS 103 285 clause 10.20.3, DASH-IF
CR-Low-Latency-Live-r8 clause 9) scope their low-latency
ServiceDescription, and shaka has always honored its Latency and
PlaybackRate targets.
Type:
- Source:
REQUEST_TYPES_ :Array<string>
Request type tokens from ISO/IEC 23009-1:2026 Table I.4, plus '*'.
Type:
- Source:
Methods
A description with no latency targets and no client data reporting.
Latency fields are deliberately left undefined so existing consumers
that test for `undefined` keep working.
- Source:
Returns:
-
Type
-
shaka.extern.ServiceDescription
Parameters:
| Name |
Type |
Description |
mpd |
shaka.extern.xml.Node
|
|
baseUris |
Array<shaka.extern.ServiceLocationBaseUri>
|
The
MPD-level BaseURL and Location elements that carry a serviceLocation
attribute, resolved to absolute URIs by the caller the same way it
resolves request URIs. They are attached to the parsed
ClientDataReporting so the CMCD service-location filter can match
requests by URI prefix. |
- Source:
Returns:
-
Type
-
shaka.extern.ServiceDescription
Reads the first ClientDataReporting child with a supported CMCD scheme.
The scheme is taken from ClientDataReporting@schemeIdUri and, for
lenience with MPDs written against dash.js samples, falls back to
CMCDParameters@schemeIdUri.
Parameters:
- Source:
Returns:
-
Type
-
shaka.extern.ClientDataReporting
Reads a CMCDParameters element (Table K.8 / K.17). As with every other
attribute parsed through TXml.parseAttr, an absent, empty or invalid
value takes the spec default; parsing never throws.
Parameters:
- Source:
Returns:
-
Type
-
shaka.extern.CmcdParameters
parseId_(value) → {string}
Parses a contentID / sessionID attribute, enforcing the 1..64 character
limit from Table K.8.
Parameters:
| Name |
Type |
Description |
value |
string
|
|
- Source:
Returns:
-
Type
-
string
parseLatencyAndPlaybackRate_(elemnon-null) → {Object}
Reads the Latency and PlaybackRate children of a ServiceDescription.
Parameters:
- Source:
Returns:
Partial description with only the attributes that are
present and parse, or null when neither child exists.
-
Type
-
Object
parseRequestTypes_(value) → {Array<string>}
Parses CMCDParameters@includeInRequests, keeping the request type tokens
this player understands.
Parameters:
| Name |
Type |
Description |
value |
string
|
|
- Source:
Returns:
Possibly empty, in which case CMCD is attached
to no request at all.
-
Type
-
Array<string>