Constructor
new DialectRegistry()
An interface to register MoQT draft dialects. Dialects register themselves, so this registry has no knowledge of which drafts exist. Supporting a new draft means adding an implementation that registers itself and requiring it from shaka-player.uncompiled.js, with no change here. Applications can register a dialect of their own the same way, or unregister one they do not want offered.
- Source:
Members
dialectsByName :Map<string, shaka.extern.MsfDialect.Factory>
Contains the registered dialect factories, keyed by draft name.
Type:
- Map<string, shaka.extern.MsfDialect.Factory>
- Source:
Methods
getForVersion(version) → {Array<!shaka.extern.MsfDialect>}
Returns the dialects to offer for a configured version, newest draft
first. AUTO offers all of them.
Ordering comes from each dialect's draft number rather than registration
order, so a dialect registered by an application still lands in the right
place in the preference list.
Parameters:
| Name | Type | Description |
|---|---|---|
version |
shaka.config.MsfVersion |
- Source:
Returns:
- Type
- Array<!shaka.extern.MsfDialect>
getRegisteredDialects() → {Array<string>}
Returns the names of all registered dialects.
- Source:
Returns:
- Type
- Array<string>
registerDialect(name, dialectFactory)
Registers a MoQT dialect.
Parameters:
| Name | Type | Description |
|---|---|---|
name |
string | The draft name, which must match the corresponding shaka.config.MsfVersion value, e.g. 'draft-16'. |
dialectFactory |
shaka.extern.MsfDialect.Factory | The factory used to create dialect instances. |
- Source:
select(offerednon-null, echoedSubprotocol) → {shaka.extern.MsfDialect}
Picks the dialect for an established connection.
The WebTransport subprotocol echoed by the server is authoritative when
present, but relays are not consistent about echoing it: some accept the
offered subprotocol and leave WebTransport.protocol empty. A single offer
is still unambiguous without an echo, because a server that did not speak
it would have rejected the opening handshake. Several offers without an
echo are ambiguous, and guessing the newest one talks the wrong draft to
every relay that is not on the newest one, so say so instead.
Parameters:
| Name | Type | Description |
|---|---|---|
offered |
Array<!shaka.extern.MsfDialect> | Newest draft first. |
echoedSubprotocol |
string |
- Source:
Returns:
The negotiated dialect, or null when
the server left the choice ambiguous.
unregisterDialect(name)
Unregisters a MoQT dialect.
Parameters:
| Name | Type | Description |
|---|---|---|
name |
string |
- Source: