Class: shaka.cast.CastUtils

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

Source:

Members

(static, constant) MESSAGE_NAMESPACE :string

The namespace for Shaka 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 :Array.<string>

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

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

Player getter and setter methods that are used to transfer state after 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, 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
?

(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

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: