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. Treating an
absent echo as a failure would break those connections, so we fall back to
the newest dialect we offered.
Parameters:
| Name | Type | Description |
|---|---|---|
offered |
Array<!shaka.extern.MsfDialect> | Newest draft first. |
echoedSubprotocol |
string |
- Source:
Returns:
unregisterDialect(name)
Unregisters a MoQT dialect.
Parameters:
| Name | Type | Description |
|---|---|---|
name |
string |
- Source: