Class: shaka.cast.CastUtils

A set of cast utility functions and variables shared between sender and receiver.

Members

(static, constant) GENERIC_MESSAGE_NAMESPACE :string

The namespace for generic messages on the cast bus.
Type:
  • string
Source:

(static, constant, non-null) PlayerEvents :Array.<string>

Player events that are proxied while casting.
Type:
  • Array.<string>
Source:

(static, constant, non-null) 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:

(static, constant, non-null) 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:

(static, constant, non-null) PlayerInitAfterLoadState :Array.<!Array.<string>>

Player getter and setter methods that are used to transfer state after load() is resolved.
Type:
  • Array.<!Array.<string>>
Source:

(static, constant, non-null) PlayerInitState :Array.<!Array.<string>>

Player getter and setter methods that are used to transfer state when casting begins.
Type:
  • Array.<!Array.<string>>
Source:

(static, constant, non-null) PlayerPromiseMethods :Array.<string>

Player methods returning a Promise that are proxied while casting.
Type:
  • Array.<string>
Source:

(static, constant, non-null) PlayerVoidMethods :Array.<string>

Player methods with no return value that are proxied while casting.
Type:
  • Array.<string>
Source:

(static, constant) SHAKA_MESSAGE_NAMESPACE :string

The namespace for Shaka messages on the cast bus.
Type:
  • string
Source:

(static, constant, non-null) VideoAttributes :Array.<string>

HTMLMediaElement attributes that are proxied while casting.
Type:
  • Array.<string>
Source:

(static, constant, non-null) VideoEvents :Array.<string>

HTMLMediaElement events that are proxied while casting.
Type:
  • Array.<string>
Source:

(static, constant, non-null) VideoInitStateAttributes :Array.<string>

HTMLMediaElement attributes that are transferred when casting begins.
Type:
  • Array.<string>
Source:

(static, constant, non-null) VideoVoidMethods :Array.<string>

HTMLMediaElement methods with no return value that are proxied while casting.
Type:
  • Array.<string>
Source:

Methods

(static) deserialize(str) → {?}

Deserialize JSON using our special encodings.
Parameters:
Name Type Description
str string
Source:
Returns:
Type
?

(private, static) makeUint8Array_(obj) → {Uint8Array}

Creates a Uint8Array object from data sent by the cast receiver.
Parameters:
Name Type Description
obj ?
Source:
Returns:
Type
Uint8Array

(static) serialize(thing) → {string}

Serialize as JSON, but specially encode things JSON will not otherwise represent.
Parameters:
Name Type Description
thing ?
Source:
Returns:
Type
string

(private, static) 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}

(private, static) unpackTimeRanges_(rangesnon-null) → {Object}

Parameters:
Name Type Description
ranges TimeRanges
Source:
Returns:
Type
Object

(private, static) 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: