Class: shaka.msf.Compression

Constructor

new Compression()

Source:

Members

Algorithm :number

The MSF_COMPRESSION values, from the "MSF Compression Algorithms" registry.
Type:
  • number
Properties:
Name Value Type Description
NONE 0 number
GZIP 1 number
Source:

PROPERTY_TYPE_ :number

The MSF_COMPRESSION Property Type, used both as a Track Property and as an Object Property. Even, so its value is a bare var int. Declared as a number and widened with BigInt() at the lookup: a BigInt() call here would run at load time and throw on platforms without BigInt (Tizen 3), abandoning the whole test run.
Type:
  • number
Source:

Methods

decode(objnon-null, codecnon-null) → {Uint8Array|!Promise<!Uint8Array>}

Returns an Object's payload with its compression undone. An uncompressed payload comes back as is and synchronously, so a caller that has nothing waiting ahead of it can go on handling it in the same turn. A compressed one comes back as a promise.
Parameters:
Name Type Description
obj shaka.extern.MsfObject
codec shaka.extern.MsfCodec
Source:
Throws:
MSF_UNSUPPORTED_COMPRESSION when the algorithm is one this player does not know, or the browser cannot decompress it. MSF forbids processing such a payload.
Type
shaka.util.Error
Returns:
Type
Uint8Array | !Promise<!Uint8Array>

getAlgorithm(objnon-null, codecnon-null) → {number}

The compression algorithm an Object's payload is in. The Track Property wins when both are somehow present, since it covers every Object.
Parameters:
Name Type Description
obj shaka.extern.MsfObject
codec shaka.extern.MsfCodec The negotiated draft's primitive codec, which the property blocks are encoded with.
Source:
Returns:
A shaka.msf.Compression.Algorithm value, or whatever other value the publisher sent.
Type
number

gunzip_(datanon-null) → {Promise<!Uint8Array>}

Not async on purpose: the stream is created before returning, so a browser that cannot create it throws to the caller synchronously rather than through the returned promise, which is left for a payload that fails to decompress.
Parameters:
Name Type Description
data Uint8Array
Source:
Returns:
Type
Promise<!Uint8Array>

readAll_(streamnon-null, datanon-null) → {Promise<!Uint8Array>}

Parameters:
Name Type Description
stream DecompressionStream
data Uint8Array
Source:
Returns:
Type
Promise<!Uint8Array>