Constructor
new MessageWriter(codecnon-null, initialSizeopt)
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
codec |
shaka.extern.MsfCodec | |||
initialSize |
number |
<optional> |
1024 |
Members
codec_ :shaka.extern.MsfCodec
Type:
writer_ :shaka.util.DataViewWriter
Type:
Methods
getBytes() → {Uint8Array}
Returns:
- Type
- Uint8Array
marshal_(type, writeContent) → {shaka.msf.draft18.MessageWriter}
Writes the var int type and 16-bit length around a payload.
Parameters:
| Name | Type | Description |
|---|---|---|
type |
shaka.msf.draft18.MessageTypeId | |
writeContent |
function() |
Returns:
marshalFetch(msg) → {shaka.msf.draft18.MessageWriter}
A standalone FETCH. Start and End are Location structures rather than the
four loose var ints draft-16 used.
Parameters:
| Name | Type | Description |
|---|---|---|
msg |
{requestId: bigint, namespace: Array<string>, trackName: string, startLocation: shaka.msf.Utils.Location, endLocation: shaka.msf.Utils.Location, params: (Array<shaka.msf.Utils.KeyValuePair>|undefined)} |
Returns:
marshalRequestOk(paramsopt) → {shaka.msf.draft18.MessageWriter}
REQUEST_OK answers PUBLISH_NAMESPACE, SUBSCRIBE_NAMESPACE, TRACK_STATUS
and the rest. It carries no Request ID: it goes back on the request's own
bidirectional stream.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
params |
Array<shaka.msf.Utils.KeyValuePair> | undefined |
<optional> |
Returns:
marshalSetup(optionsnon-null) → {shaka.msf.draft18.MessageWriter}
Draft-17 collapsed CLIENT_SETUP and SERVER_SETUP into one message whose
payload is nothing but Setup Options, uncounted and bounded by the
message length.
Parameters:
| Name | Type | Description |
|---|---|---|
options |
Array<shaka.msf.Utils.KeyValuePair> |
Returns:
marshalSubscribe(msg) → {shaka.msf.draft18.MessageWriter}
Parameters:
| Name | Type | Description |
|---|---|---|
msg |
{requestId: bigint, namespace: Array<string>, trackName: string, params: (Array<shaka.msf.Utils.KeyValuePair>|undefined)} |
Returns:
marshalSubscribeNamespace(msg) → {shaka.msf.draft18.MessageWriter}
Parameters:
| Name | Type | Description |
|---|---|---|
msg |
{requestId: bigint, namespace: Array<string>, params: (Array<shaka.msf.Utils.KeyValuePair>|undefined)} |
Returns:
reset()
Resets the buffer to start writing from the beginning.
writeKeyValuePairs_(pairsnon-null)
Writes delta-encoded Key-Value-Pairs without a count prefix, which is how
Setup Options are framed: they span the whole message payload and are
bounded by the message length.
Parameters:
| Name | Type | Description |
|---|---|---|
pairs |
Array<shaka.msf.Utils.KeyValuePair> |
writeNamespace_(namespace)
A Track Namespace is a count of fields followed by each length-prefixed
field.
Parameters:
| Name | Type | Description |
|---|---|---|
namespace |
Array<string> |
writeParameters_(pairs)
Writes a count-prefixed parameter list, which is how every message other
than SETUP frames its parameters.
Parameters:
| Name | Type | Description |
|---|---|---|
pairs |
Array<shaka.msf.Utils.KeyValuePair> | undefined |
writeString_(str)
Parameters:
| Name | Type | Description |
|---|---|---|
str |
string |
writeVarInt_(value)
Parameters:
| Name | Type | Description |
|---|---|---|
value |
bigint | number |