Constructor
new CastUtils()
A set of cast utility functions and variables shared between sender and receiver.
- Source:
Members
GENERIC_MESSAGE_NAMESPACE :string
The namespace for generic messages on the cast bus.
Type:
- string
- Source:
LargePlayerGetterMethods :Object.<string, number>
Player getter methods with data large enough to be sent in their own update
messages, to reduce the size of each message. The format of this is
identical to PlayerGetterMethods.
Type:
- Object.<string, number>
- Source:
PlayerGetterMethods :Object.<string, number>
Player getter methods that are proxied while casting.
The key is the method, the value is the frequency of updates.
Frequency 1 translates to every update; frequency 2 to every 2 updates, etc.
Type:
- Object.<string, number>
- Source:
PlayerGetterMethodsThatRequireLive :Object.<string, number>
Player getter methods that are proxied while casting, but only when casting
a livestream.
The key is the method, the value is the frequency of updates.
Frequency 1 translates to every update; frequency 2 to every 2 updates, etc.
Type:
- Object.<string, number>
- Source:
PlayerInitAfterLoadState :Array.<!Array.<string>>
Player getter and setter methods that are used to transfer state after
load() is resolved.
Type:
- Array.<!Array.<string>>
- Source:
PlayerInitState :Array.<!Array.<string>>
Player getter and setter methods that are used to transfer state when casting
begins.
Type:
- Array.<!Array.<string>>
- Source:
PlayerPromiseMethods :Array.<string>
Player methods returning a Promise that are proxied while casting.
Type:
- Array.<string>
- Source:
PlayerVoidMethods :Array.<string>
Player methods with no return value that are proxied while casting.
Type:
- Array.<string>
- Source:
SHAKA_MESSAGE_NAMESPACE :string
The namespace for Shaka messages on the cast bus.
Type:
- string
- Source:
VideoAttributes :Array.<string>
HTMLMediaElement attributes that are proxied while casting.
Type:
- Array.<string>
- Source:
VideoEvents :Array.<string>
HTMLMediaElement events that are proxied while casting.
Type:
- Array.<string>
- Source:
VideoInitStateAttributes :Array.<string>
HTMLMediaElement attributes that are transferred when casting begins.
Type:
- Array.<string>
- Source:
VideoVoidMethods :Array.<string>
HTMLMediaElement methods with no return value that are proxied while casting.
Type:
- Array.<string>
- Source:
Methods
deserialize(str) → {?}
Deserialize JSON using our special encodings.
Parameters:
Name | Type | Description |
---|---|---|
str |
string |
- Source:
Returns:
- Type
- ?
makeError_(obj) → {Error}
Creates an Error object from data sent by the cast receiver.
Parameters:
Name | Type | Description |
---|---|---|
obj |
? |
- Source:
Returns:
- Type
- Error
makeUint8Array_(obj) → {Uint8Array}
Creates a Uint8Array object from data sent by the cast receiver.
Parameters:
Name | Type | Description |
---|---|---|
obj |
? |
- Source:
Returns:
- Type
- Uint8Array
serialize(thing) → {string}
Serialize as JSON, but specially encode things JSON will not otherwise
represent.
Parameters:
Name | Type | Description |
---|---|---|
thing |
? |
- Source:
Returns:
- Type
- string
simulateTimeRanges_(obj) → {{length: number, start: function(number): number, end: function(number): number}}
Creates a simulated TimeRanges object from data sent by the cast receiver.
Parameters:
Name | Type | Description |
---|---|---|
obj |
? |
- Source:
Returns:
- Type
- {length: number, start: function(number): number, end: function(number): number}
unpackError_(errornon-null) → {Object}
Parameters:
Name | Type | Description |
---|---|---|
error |
Error |
- Source:
Returns:
- Type
- Object
unpackTimeRanges_(rangesnon-null) → {Object}
Parameters:
Name | Type | Description |
---|---|---|
ranges |
TimeRanges |
- Source:
Returns:
- Type
- Object
unpackUint8Array_(arraynon-null) → {Object}
Parameters:
Name | Type | Description |
---|---|---|
array |
Uint8Array |
- Source:
Returns:
- Type
- Object
Type Definitions
InitStateType
Type:
- {video: Object, player: Object, manifest: ?string, startTime: ?number}
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
video |
Object | Dictionary of video properties to be set. | |
player |
Object | Dictionary of player setters to be called. | |
manifest |
string |
<nullable> |
The currently-selected manifest, if present. |
startTime |
number |
<nullable> |
The playback start time, if currently playing. |
- Source: